aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/URLDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/net/URLDecoder.java')
-rw-r--r--libjava/java/net/URLDecoder.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/libjava/java/net/URLDecoder.java b/libjava/java/net/URLDecoder.java
index 8cdcf94..3674740 100644
--- a/libjava/java/net/URLDecoder.java
+++ b/libjava/java/net/URLDecoder.java
@@ -63,7 +63,7 @@ import java.io.UnsupportedEncodingException;
public class URLDecoder
{
/**
- * Constructor for compatibility with Sun's JDK.
+ * Public contructor. Note that this class has only static methods.
*/
public URLDecoder ()
{
@@ -116,8 +116,6 @@ public class URLDecoder
public static String decode(String s, String encoding)
throws UnsupportedEncodingException
{
- StringBuffer result = new StringBuffer();
-
// First convert all '+' characters to spaces.
String str = s.replace('+', ' ');
@@ -126,6 +124,7 @@ public class URLDecoder
int start = 0;
byte[] bytes = null;
int length = str.length();
+ StringBuffer result = new StringBuffer(length);
while ((i = str.indexOf('%', start)) >= 0)
{
// Add all non-encoded characters to the result buffer