Some code cleanups as suggested by Jürg Lehni.

This commit is contained in:
hns 2004-09-10 09:28:04 +00:00
parent 33808d06b3
commit c16fc50354

View file

@ -16,10 +16,10 @@
package helma.util; package helma.util;
import java.io.UnsupportedEncodingException;
import org.apache.commons.codec.net.URLCodec;
import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.net.URLCodec;
import java.io.UnsupportedEncodingException;
import java.util.BitSet; import java.util.BitSet;
/** /**
@ -32,8 +32,6 @@ import java.util.BitSet;
*/ */
public final class UrlEncoded extends URLCodec { public final class UrlEncoded extends URLCodec {
public static final String defaultEncoding = "ISO8859_1";
/** /**
* URL-encode a string using the given encoding, or return it * URL-encode a string using the given encoding, or return it
* unchanged if no encoding was necessary. * unchanged if no encoding was necessary.
@ -54,8 +52,7 @@ public final class UrlEncoded extends URLCodec {
if (c == ' ') { if (c == ' ') {
needsSpaceEncoding = true; needsSpaceEncoding = true;
} else if (!urlsafe.get(c)) { } else if (!urlsafe.get(c)) {
URLCodec codec = new URLCodec(); return new URLCodec().encode(str, encoding);
return codec.encode(str, encoding);
} }
} }