geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r618250 - in /geronimo/sandbox/async-http-client-mina2/src: main/java/org/apache/ahc/ main/java/org/apache/ahc/auth/ main/java/org/apache/ahc/codec/ main/java/org/apache/ahc/proxy/ main/java/org/apache/ahc/util/ test/java/org/apache/ahc/
Date Mon, 04 Feb 2008 12:12:53 GMT
Author: rickmcguire
Date: Mon Feb  4 04:12:50 2008
New Revision: 618250

URL: http://svn.apache.org/viewvc?rev=618250&view=rev
Log:
GERONIMO-3801 Some warning cleanup.  Patch provided by Sangjin Lee. 


Modified:
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthChallengeParser.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthPolicy.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthenticationException.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/DigestScheme.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/RFC2617Scheme.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/proxy/ProxyConfiguration.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/DateUtil.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/ParameterParser.java
    geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/FakeRealm.java
    geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/MonitoringTest.java

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java
Mon Feb  4 04:12:50 2008
@@ -42,14 +42,19 @@
 import org.apache.ahc.util.EventDispatcher;
 import org.apache.ahc.util.MonitoringEvent;
 import org.apache.ahc.util.MonitoringListener;
-import org.apache.mina.common.*;
-import org.apache.mina.filter.ssl.SslFilter;
+import org.apache.mina.common.ConnectFuture;
+import org.apache.mina.common.DefaultConnectFuture;
+import org.apache.mina.common.IoFutureListener;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.common.RuntimeIoException;
+import org.apache.mina.common.SimpleIoProcessorPool;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.apache.mina.filter.executor.ExecutorFilter;
+import org.apache.mina.filter.ssl.SslFilter;
 import org.apache.mina.transport.socket.SocketConnector;
 import org.apache.mina.transport.socket.SocketSessionConfig;
-import org.apache.mina.transport.socket.nio.NioSocketConnector;
 import org.apache.mina.transport.socket.nio.NioProcessor;
+import org.apache.mina.transport.socket.nio.NioSocketConnector;
 
 
 /**
@@ -644,7 +649,7 @@
      * the proper SSL filter if the connection is to be used for <code>https</code>.
 If a good
      * connection occurs, it is also responsible for sending the request.
      */
-    class FutureListener implements IoFutureListener {
+    class FutureListener implements IoFutureListener<ConnectFuture> {
         /** The request. */
         final HttpRequestMessage request;
         /** The response future. */
@@ -668,12 +673,10 @@
          * Event notification that the conection has completed, either by a successful connection
or
          * by an error.
          *
-         * @param future the {@link org.apache.mina.common.IoFuture} representing the <code>ConnectFuture</code>.
-         * @see org.apache.mina.common.IoFutureListener#operationComplete(org.apache.mina.common.IoFuture)
+         * @param future the {@link org.apache.mina.common.ConnectFuture}.
          */
-        public void operationComplete(IoFuture future) {
-            ConnectFuture connFuture = (ConnectFuture) future;
-            if (connFuture.isConnected()) {
+        public void operationComplete(ConnectFuture future) {
+            if (future.isConnected()) {
                 notifyMonitoringListeners(MonitoringEvent.CONNECTION_SUCCESSFUL, request);

                 IoSession sess = future.getSession();
 
@@ -845,9 +848,8 @@
          * 
          * @param future The Future object associated with the operation.
          */
-        public void operationComplete(IoFuture future) {
-            ConnectFuture connectFuture = (ConnectFuture)future;
-            if (connectFuture.isConnected()) {
+        public void operationComplete(ConnectFuture future) {
+            if (future.isConnected()) {
                 IoSession session = future.getSession();
                 // add the protocol filter (if it's not there already like in a
                 // reused session)

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthChallengeParser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthChallengeParser.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthChallengeParser.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthChallengeParser.java
Mon Feb  4 04:12:50 2008
@@ -68,7 +68,7 @@
      *
      * @since 2.0beta1
      */
-    public static Map extractParams(final String challengeStr)
+    public static Map<String, String> extractParams(final String challengeStr)
       throws MalformedChallengeException {
         if (challengeStr == null) {
             throw new IllegalArgumentException("Challenge may not be null");
@@ -77,11 +77,10 @@
         if (idx == -1) {
             throw new MalformedChallengeException("Invalid challenge: " + challengeStr);
         }
-        Map map = new HashMap();
+        Map<String,String> map = new HashMap<String,String>();
         ParameterParser parser = new ParameterParser();
-        List params = parser.parse( challengeStr.substring(idx + 1, challengeStr.length()),
',');
-        for (int i = 0; i < params.size(); i++) {
-            NameValuePair param = (NameValuePair) params.get(i);
+        List<NameValuePair> params = parser.parse( challengeStr.substring(idx + 1,
challengeStr.length()), ',');
+        for (NameValuePair param : params) {
             map.put(param.getName().toLowerCase(), param.getValue());
         }
         return map;

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthPolicy.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthPolicy.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthPolicy.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthPolicy.java
Mon Feb  4 04:12:50 2008
@@ -27,8 +27,9 @@
 import org.slf4j.LoggerFactory;
 
 public class AuthPolicy {
-    private static final HashMap SCHEMES = new HashMap();
-    private static final ArrayList SCHEME_LIST = new ArrayList();
+    private static final HashMap<String,Class<? extends AuthScheme>> SCHEMES
= 
+            new HashMap<String,Class<? extends AuthScheme>>();
+    private static final ArrayList<String> SCHEME_LIST = new ArrayList<String>();
 
     /**
      * The key used to look up the list of IDs of supported {@link AuthScheme
@@ -92,7 +93,7 @@
      * @see #getAuthScheme(String)
      * @see #AUTH_SCHEME_PRIORITY
      */
-    public static synchronized void registerAuthScheme(final String id, Class clazz) {
+    public static synchronized void registerAuthScheme(final String id, Class<? extends
AuthScheme> clazz) {
         if (id == null) {
             throw new IllegalArgumentException("Id may not be null");
         }
@@ -130,10 +131,10 @@
         if (id == null) {
             throw new IllegalArgumentException("Id may not be null");
         }
-        Class clazz = (Class)SCHEMES.get(id.toLowerCase());
+        Class<? extends AuthScheme> clazz = SCHEMES.get(id.toLowerCase());
         if (clazz != null) {
             try {
-                return (AuthScheme)clazz.newInstance();
+                return clazz.newInstance();
             } catch (Exception e) {
                 LOG.error("Error initializing authentication scheme: " + id, e);
                 throw new IllegalStateException(id +
@@ -151,7 +152,8 @@
      *
      * @return {@link AuthScheme authentication scheme}
      */
-    public static synchronized List getDefaultAuthPrefs() {
-        return (List)SCHEME_LIST.clone();
+    @SuppressWarnings("unchecked")
+    public static synchronized List<String> getDefaultAuthPrefs() {
+        return (List<String>)SCHEME_LIST.clone();
     }
 }

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthenticationException.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthenticationException.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthenticationException.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/AuthenticationException.java
Mon Feb  4 04:12:50 2008
@@ -19,7 +19,6 @@
 
 package org.apache.ahc.auth;
 
-import org.apache.ahc.AsyncHttpClient;
 
 public class AuthenticationException extends Exception{
 

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/DigestScheme.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/DigestScheme.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/DigestScheme.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/DigestScheme.java
Mon Feb  4 04:12:50 2008
@@ -353,7 +353,7 @@
         String response = digest;
         String algorithm = getParameter("algorithm");
 
-        List params = new ArrayList(20);
+        List<NameValuePair> params = new ArrayList<NameValuePair>(20);
         params.add(new NameValuePair("username", uname));
         params.add(new NameValuePair("realm", realm));
         params.add(new NameValuePair("nonce", nonce));

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/RFC2617Scheme.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/RFC2617Scheme.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/RFC2617Scheme.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/auth/RFC2617Scheme.java
Mon Feb  4 04:12:50 2008
@@ -25,7 +25,7 @@
         /**
      * Authentication parameter map.
      */
-    private Map params = null;
+    private Map<String,String> params = null;
 
     /**
      * Default constructor for RFC2617 compliant authetication schemes.
@@ -77,7 +77,7 @@
      *
      * @return the map of authentication parameters
      */
-    protected Map getParameters() {
+    protected Map<String, String> getParameters() {
         return this.params;
     }
 
@@ -95,7 +95,7 @@
         if (this.params == null) {
             return null;
         }
-        return (String) this.params.get(name.toLowerCase());
+        return this.params.get(name.toLowerCase());
     }
 
     /**

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java
Mon Feb  4 04:12:50 2008
@@ -32,8 +32,8 @@
 import org.apache.ahc.auth.AuthPolicy;
 import org.apache.ahc.auth.AuthScheme;
 import org.apache.ahc.auth.AuthState;
+import org.apache.ahc.util.MonitoringEvent;
 import org.apache.ahc.util.NameValuePair;
-import org.apache.ahc.util.MonitoringEvent; 
 import org.apache.mina.common.IoHandlerAdapter;
 import org.apache.mina.common.IoSession;
 
@@ -128,7 +128,6 @@
      * @param object    the {@link HttpResponseMessage} object
      * @see org.apache.mina.common.IoHandlerAdapter#messageReceived(org.apache.mina.common.IoSession,java.lang.Object)
      */
-    @SuppressWarnings({"UnusedDeclaration"})
     public void messageReceived(IoSession ioSession, Object object) throws Exception {
 
         HttpResponseMessage response = (HttpResponseMessage) object;
@@ -150,7 +149,7 @@
             request.setUrl(new URL(response.getLocation()));
             // if we're redirected via 30x, the request method should be reset to GET
             if (!request.getRequestMethod().equals(HttpRequestMessage.REQUEST_GET)) {
-            	request.setRequestMethod(HttpRequestMessage.REQUEST_GET);
+                request.setRequestMethod(HttpRequestMessage.REQUEST_GET);
             }
             // we also need to clear out the parameters
             request.clearAllParameters();
@@ -288,7 +287,7 @@
         //Start the timeout timer now if a timeout is needed and there is not one already
in effect for this request
         if (msg.getTimeOut() > 0 && msg.getTimeoutHandle() == null) {
             TimeoutTask task = new TimeoutTask(ioSession);
-            ScheduledFuture handle = scheduler.schedule(task, msg.getTimeOut(), TimeUnit.MILLISECONDS);
+            ScheduledFuture<?> handle = scheduler.schedule(task, msg.getTimeOut(),
TimeUnit.MILLISECONDS);
             msg.setTimeoutHandle(handle);
         }
     }
@@ -299,7 +298,7 @@
      * @param request the {@link HttpRequestMessage} request
      */
     private void cancelTasks(HttpRequestMessage request) {
-        ScheduledFuture handle = request.getTimeoutHandle();
+        ScheduledFuture<?> handle = request.getTimeoutHandle();
         if (handle != null) {
             boolean canceled = handle.cancel(true);
             //See if it canceled

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpRequestMessage.java
Mon Feb  4 04:12:50 2008
@@ -22,7 +22,6 @@
 import java.net.ProtocolException;
 import java.net.URL;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.ScheduledFuture;
 
@@ -114,7 +113,7 @@
     /**
      * The timeout handle.
      */
-    private ScheduledFuture timeoutHandle;
+    private ScheduledFuture<?> timeoutHandle;
 
     /**
      * The response future.
@@ -198,7 +197,7 @@
      *
      * @return the timeout <code>ScheduledFuture</code> handle
      */
-    protected ScheduledFuture getTimeoutHandle() {
+    protected ScheduledFuture<?> getTimeoutHandle() {
         return timeoutHandle;
     }
 
@@ -207,7 +206,7 @@
      *
      * @param timeoutHandle the new <code>ScheduledFuture</code> timeout handle
      */
-    protected void setTimeoutHandle(ScheduledFuture timeoutHandle) {
+    protected void setTimeoutHandle(ScheduledFuture<?> timeoutHandle) {
         this.timeoutHandle = timeoutHandle;
     }
 
@@ -479,7 +478,7 @@
         return matchCredentials(credentials, scope);
     }
 
-    private static Credentials matchCredentials(final HashMap map, final AuthScope authscope)
{
+    private static Credentials matchCredentials(final HashMap<AuthScope, Credentials>
map, final AuthScope authscope) {
         // see if we get a direct hit
         Credentials creds = (Credentials)map.get(authscope);
         if (creds == null) {
@@ -487,9 +486,7 @@
             // Do a full scan
             int bestMatchFactor = -1;
             AuthScope bestMatch = null;
-            Iterator items = map.keySet().iterator();
-            while (items.hasNext()) {
-                AuthScope current = (AuthScope)items.next();
+            for (AuthScope current : map.keySet()) {
                 int factor = authscope.match(current);
                 if (factor > bestMatchFactor) {
                     bestMatchFactor = factor;
@@ -497,7 +494,7 @@
                 }
             }
             if (bestMatch != null) {
-                creds = (Credentials)map.get(bestMatch);
+                creds = map.get(bestMatch);
             }
         }
         return creds;

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpResponseMessage.java
Mon Feb  4 04:12:50 2008
@@ -19,10 +19,8 @@
  */
 package org.apache.ahc.codec;
 
-import java.util.HashMap;
 import java.util.ArrayList;
 
-import org.apache.ahc.auth.AuthState;
 import org.apache.ahc.util.NameValuePair;
 
 /**

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/proxy/ProxyConfiguration.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/proxy/ProxyConfiguration.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/proxy/ProxyConfiguration.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/proxy/ProxyConfiguration.java
Mon Feb  4 04:12:50 2008
@@ -1,7 +1,6 @@
 package org.apache.ahc.proxy;
 
 import java.net.InetSocketAddress;
-import java.net.InetAddress;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/DateUtil.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/DateUtil.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/DateUtil.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/DateUtil.java
Mon Feb  4 04:12:50 2008
@@ -25,7 +25,6 @@
 import java.util.Calendar;
 import java.util.Collection;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.Locale;
 import java.util.TimeZone;
 
@@ -55,7 +54,7 @@
      */
     public static final String PATTERN_ASCTIME = "EEE MMM d HH:mm:ss yyyy";
 
-    private static final Collection DEFAULT_PATTERNS = Arrays.asList(
+    private static final Collection<String> DEFAULT_PATTERNS = Arrays.asList(
         new String[] {PATTERN_ASCTIME, PATTERN_RFC1036, PATTERN_RFC1123});
 
     private static final Date DEFAULT_TWO_DIGIT_YEAR_START;
@@ -96,7 +95,7 @@
      * @return the parsed date
      * @throws DateParseException if none of the dataFormats could parse the dateValue
      */
-    public static Date parseDate(String dateValue, Collection dateFormats)
+    public static Date parseDate(String dateValue, Collection<String> dateFormats)
         throws DateParseException {
         return parseDate(dateValue, dateFormats, null);
     }
@@ -115,7 +114,7 @@
      */
     public static Date parseDate(
         String dateValue,
-        Collection dateFormats,
+        Collection<String> dateFormats,
         Date startDate
     ) throws DateParseException {
 
@@ -138,10 +137,7 @@
         }
 
         SimpleDateFormat dateParser = null;
-        Iterator formatIter = dateFormats.iterator();
-
-        while (formatIter.hasNext()) {
-            String format = (String)formatIter.next();
+        for (String format : dateFormats) {
             if (dateParser == null) {
                 dateParser = new SimpleDateFormat(format, Locale.US);
                 dateParser.setTimeZone(TimeZone.getTimeZone("GMT"));

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/ParameterParser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/ParameterParser.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/ParameterParser.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/util/ParameterParser.java
Mon Feb  4 04:12:50 2008
@@ -162,10 +162,10 @@
      * @param str the string that contains a sequence of name/value pairs
      * @return a list of {@link NameValuePair}s
      */
-    public List parse(final String str, char separator) {
+    public List<NameValuePair> parse(final String str, char separator) {
 
         if (str == null) {
-            return new ArrayList();
+            return new ArrayList<NameValuePair>();
         }
         return parse(str.toCharArray(), separator);
     }
@@ -178,10 +178,10 @@
      *              name/value pairs
      * @return a list of {@link NameValuePair}s
      */
-    public List parse(final char[] chars, char separator) {
+    public List<NameValuePair> parse(final char[] chars, char separator) {
 
         if (chars == null) {
-            return new ArrayList();
+            return new ArrayList<NameValuePair>();
         }
         return parse(chars, 0, chars.length, separator);
     }
@@ -197,12 +197,12 @@
      * @param length - the length.
      * @return a list of {@link NameValuePair}s
      */
-    public List parse(final char[] chars, int offset, int length, char separator) {
+    public List<NameValuePair> parse(final char[] chars, int offset, int length, char
separator) {
 
         if (chars == null) {
-            return new ArrayList();
+            return new ArrayList<NameValuePair>();
         }
-        List params = new ArrayList();
+        List<NameValuePair> params = new ArrayList<NameValuePair>();
         this.chars = chars;
         this.pos = offset;
         this.len = length;

Modified: geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/FakeRealm.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/FakeRealm.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/FakeRealm.java (original)
+++ geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/FakeRealm.java Mon
Feb  4 04:12:50 2008
@@ -36,7 +36,7 @@
 
     protected Principal getPrincipal(String user) {
         if (user.equals("test")) {
-            ArrayList roles = new ArrayList();
+            ArrayList<String> roles = new ArrayList<String>();
             roles.add("test");
             Principal principal = new GenericPrincipal(this, user, "password", roles);
             return principal;

Modified: geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/MonitoringTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/MonitoringTest.java?rev=618250&r1=618249&r2=618250&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/MonitoringTest.java
(original)
+++ geronimo/sandbox/async-http-client-mina2/src/test/java/org/apache/ahc/MonitoringTest.java
Mon Feb  4 04:12:50 2008
@@ -19,17 +19,14 @@
  */
 package org.apache.ahc;
 
-import java.io.File;
-import java.io.FileInputStream;
 import java.net.URL;
-import java.util.Arrays;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.ahc.codec.HttpRequestMessage;
 import org.apache.ahc.codec.HttpResponseMessage;
 import org.apache.ahc.util.CountingMonitor;
 import org.apache.ahc.util.MonitoringEvent;
-import org.apache.ahc.util.MonitoringListener; 
+import org.apache.ahc.util.MonitoringListener;
 
 public class MonitoringTest extends AbstractTest {
 
@@ -145,16 +142,6 @@
 
         request.setParameter("TEST1", "Test One");
         request.setParameter("TEST2", "Test Two");
-        doConnection(request, false, callback, listener);
-    }
-
-    private void doPostConnection(TestCallback callback, String url, 
-                                  boolean testForException, MonitoringListener listener)
-        throws Exception {
-        HttpRequestMessage request = new HttpRequestMessage(new URL(url), callback);
-        request.setParameter("TEST1", "Test One");
-        request.setParameter("TEST2", "Test Two");
-        request.setRequestMethod(HttpRequestMessage.REQUEST_POST);
         doConnection(request, false, callback, listener);
     }
 



Mime
View raw message