You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mi...@apache.org on 2003/08/13 01:55:24 UTC
cvs commit: xml-xalan/java/src/org/apache/xml/serializer Utils.java
minchau 2003/08/12 16:55:24
Modified: java/src/org/apache/xml/serializer Utils.java
Log:
PR: bugzilla 21309
Submitted by: Brian Minchau
Utils.classForName(String classname) still throws a ClassNotFoundException rather than
return null, but it doesn't cache the classname/null combination anymore if the classname
is not loaded.
Revision Changes Path
1.2 +7 -16 xml-xalan/java/src/org/apache/xml/serializer/Utils.java
Index: Utils.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/serializer/Utils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Utils.java 15 May 2003 20:13:17 -0000 1.1
+++ Utils.java 12 Aug 2003 23:55:24 -0000 1.2
@@ -96,27 +96,18 @@
Object o = CacheHolder.cache.get(classname);
if (o == null)
{
- try
- {
- // class was not in the cache, so try to load it
- c = Class.forName(classname);
- CacheHolder.cache.put(classname, c);
- }
- catch (ClassNotFoundException e)
- {
- // class could not be loaded, lets put it in the
- // cache anyway to make subsequent attempts quicker.
- c = null;
- CacheHolder.cache.put(classname, null);
- }
+ // class was not in the cache, so try to load it
+ c = Class.forName(classname);
+ // if the class is not found we will have thrown a
+ // ClassNotFoundException on the statement above
+
+ // if we get here c is not null
+ CacheHolder.cache.put(classname, c);
}
else
{
c = (Class)o;
}
- if (c == null)
- throw new ClassNotFoundException(); // never return null
return c;
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org