abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r473468 - /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
Date Fri, 10 Nov 2006 20:51:00 GMT
Author: jmsnell
Date: Fri Nov 10 12:51:00 2006
New Revision: 473468

URL: http://svn.apache.org/viewvc?view=rev&rev=473468
Log:
Add a null check to ExtensionFactoryMap to defend against misbehaving ExtensionFactory implementations

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java?view=diff&rev=473468&r1=473467&r2=473468
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/ExtensionFactoryMap.java
Fri Nov 10 12:51:00 2006
@@ -45,14 +45,14 @@
     if (t == null) {
       for (ExtensionFactory factory : factories) {
         t = (T) factory.getElementWrapper(internal);
-        if (t != internal) {
+        if (t != null && t != internal) {
           wrappers.put(internal, t);
           return t;
         }
       }
       t = (T) internal;
     }
-    return t;
+    return (t != null) ? t : (T)internal;
   }
   
   public void setElementWrapper(Element internal, Element wrapper) {



Mime
View raw message