You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/05/11 17:55:01 UTC

svn commit: r1101930 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java

Author: simonetripodi
Date: Wed May 11 15:55:01 2011
New Revision: 1101930

URL: http://svn.apache.org/viewvc?rev=1101930&view=rev
Log:
entityValidator map can be private since registrations happen with proper methods
getRegistrations() return an read-only Map

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java?rev=1101930&r1=1101929&r2=1101930&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/Digester.java Wed May 11 15:55:01 2011
@@ -29,6 +29,7 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.EmptyStackException;
 import java.util.HashMap;
 import java.util.List;
@@ -189,7 +190,7 @@ public class Digester extends DefaultHan
      * The URLs of entityValidator that have been registered, keyed by the public
      * identifier that corresponds.
      */
-    protected HashMap<String, URL> entityValidator = new HashMap<String, URL>();
+    private final HashMap<String, URL> entityValidator = new HashMap<String, URL>();
 
 
     /**
@@ -3018,10 +3019,12 @@ public class Digester extends DefaultHan
 
     /**
      * Return the set of DTD URL registrations, keyed by public identifier.
+     *
+     * NOTE: the returned map is in read-only mode.
      */
     Map<String, URL> getRegistrations() {
 
-        return (entityValidator);
+        return Collections.unmodifiableMap(entityValidator);
 
     }