Author: sebb
Date: Mon Jan 29 17:23:01 2007
New Revision: 501272

URL: http://svn.apache.org/viewvc?view=rev&rev=501272
Log:
Elimimate various JDK 1.3 work-rounds

Modified:
    
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java
    
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
    
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
    
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/util/HTTPArgument.java

Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java?view=diff&rev=501272&r1=501271&r2=501272
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java
 Mon Jan 29 17:23:01 2007
@@ -154,7 +154,7 @@
                } catch (MalformedPatternException mpe) {
                        log.error("Internal error compiling regular expression 
in ParseRegexp.");
                        log.error("MalformedPatternException - " + mpe);
-                       throw new Error(mpe.toString());// JDK1.4: remove 
.toString()
+                       throw new Error(mpe);
                }
        }
 

Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java?view=diff&rev=501272&r1=501271&r2=501272
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
 Mon Jan 29 17:23:01 2007
@@ -431,14 +431,12 @@
                                                // Not 100% sure, but I believe 
this can't happen, so
                                                // I'll log and throw an error:
                                                log.error("Program error", e);
-                                               throw new 
Error(e.toString());// JDK1.4: remove
-                                                                               
                                // .toString()
+                                               throw new Error(e);
                                        } catch (IllegalUserActionException e) {
                                                // Not 100% sure, but I believe 
this can't happen, so
                                                // I'll log and throw an error:
                                                log.error("Program error", e);
-                                               throw new 
Error(e.toString());// JDK1.4: remove
-                                                                               
                                // .toString()
+                                               throw new Error(e);
                                        }
                                }
                        }

Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java?view=diff&rev=501272&r1=501271&r2=501272
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
 Mon Jan 29 17:23:01 2007
@@ -19,6 +19,7 @@
 import java.io.BufferedInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -217,25 +218,22 @@
                                in = new 
BufferedInputStream(conn.getInputStream());
                        }
                } catch (IOException e) {
-                       // TODO JDK1.4: if (!e.getCause() instanceof 
FileNotFoundException)
-                       // JDK1.4: {
-            // TODO: what about other 4xx errors? Do we need to log them?
-                       if (conn.getResponseCode() != 404) // for JDK1.3
+                       if (! (e.getCause() instanceof FileNotFoundException))
                        {
                                log.error("readResponse: "+e.toString());
-                               // JDK1.4: Throwable cause = e.getCause();
-                               // JDK1.4: if (cause != null){
-                               // JDK1.4: log.error("Cause: "+cause);
-                               // JDK1.4: }
+                               Throwable cause = e.getCause();
+                               if (cause != null){
+                                   log.error("Cause: "+cause);
+                               }
                        }
                        // Normal InputStream is not available
                        in = new BufferedInputStream(conn.getErrorStream());
                } catch (Exception e) {
                        log.error("readResponse: "+e.toString());
-                       // JDK1.4: Throwable cause = e.getCause();
-                       // JDK1.4: if (cause != null){
-                       // JDK1.4: log.error("Cause: "+cause);
-                       // JDK1.4: }
+                       Throwable cause = e.getCause();
+                       if (cause != null){
+                           log.error("Cause: "+cause);
+                       }
                        in = new BufferedInputStream(conn.getErrorStream());
                }
                java.io.ByteArrayOutputStream w = new ByteArrayOutputStream();

Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/util/HTTPArgument.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/util/HTTPArgument.java?view=diff&rev=501272&r1=501271&r2=501272
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/util/HTTPArgument.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/util/HTTPArgument.java
 Mon Jan 29 17:23:01 2007
@@ -20,6 +20,7 @@
 
 import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -28,7 +29,6 @@
 import org.apache.jmeter.testelement.property.BooleanProperty;
 import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jorphan.logging.LoggingManager;
-import org.apache.jorphan.util.JOrphanUtils;
 import org.apache.log.Logger;
 
 //For unit tests, @see TestHTTPArgument
@@ -92,8 +92,8 @@
                setAlwaysEncoded(true);
                if (alreadyEncoded) {
                        try {
-                               name = JOrphanUtils.decode(name, "UTF-8");
-                               value = JOrphanUtils.decode(value, "UTF-8");
+                               name = URLDecoder.decode(name, "UTF-8"); // 
$NON-NLS-1$
+                               value = URLDecoder.decode(value, "UTF-8");  // 
$NON-NLS-1$
                        } catch (UnsupportedEncodingException e) {
                                // UTF-8 unsupported? You must be joking!
                                log.error("UTF-8 encoding not supported!");



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to