Index: java/org/apache/naming/resources/DirContextURLConnection.java =================================================================== --- java/org/apache/naming/resources/DirContextURLConnection.java (revision 1652972) +++ java/org/apache/naming/resources/DirContextURLConnection.java (working copy) @@ -56,13 +56,9 @@ */ public class DirContextURLConnection extends URLConnection { - private static final UDecoder URL_DECODER = new UDecoder(); - private static final UEncoder URL_ENCODER = new UEncoder(); + private UDecoder urlDecoder = new UDecoder(); + private UEncoder urlEncoder = new UEncoder(); - static{ - URL_ENCODER.addSafeCharacter('/'); - } - // ----------------------------------------------------------- Constructors public DirContextURLConnection(DirContext context, URL url) { @@ -72,8 +68,9 @@ ("Directory context can't be null"); if (org.apache.naming.Constants.IS_SECURITY_ENABLED) { this.permission = new JndiPermission(url.toString()); - } + } this.context = context; + urlEncoder.addSafeCharacter('/'); } @@ -146,7 +143,7 @@ try { date = System.currentTimeMillis(); - path = URL_DECODER.convert(getURL().getFile(), false); + path = urlDecoder.convert(getURL().getFile(), false); if (context instanceof ProxyDirContext) { ProxyDirContext proxyDirContext = (ProxyDirContext) context; @@ -440,7 +437,7 @@ NameClassPair ncp = enumeration.nextElement(); String s = ncp.getName(); result.addElement( - URL_ENCODER.encodeURL(s, 0, s.length()).toString()); + urlEncoder.encodeURL(s, 0, s.length()).toString()); } } catch (NamingException e) { // Unexpected exception