geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1432973 - /geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
Date Mon, 14 Jan 2013 16:11:03 GMT
Author: gawor
Date: Mon Jan 14 16:11:03 2013
New Revision: 1432973

URL: http://svn.apache.org/viewvc?rev=1432973&view=rev
Log:
NPE in tagPlugins:ForEach - https://issues.apache.org/bugzilla/show_bug.cgi?id=54242

Modified:
    geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java

Modified: geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java?rev=1432973&r1=1432972&r2=1432973&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
Mon Jan 14 16:11:03 2013
@@ -155,6 +155,9 @@ public final class ForEach implements Ta
         ctxt.generateJavaSource("else if (" + itemsV + " instanceof Map)");
         ctxt.generateJavaSource(iterV + "=((Map)" + itemsV + ").entrySet().iterator();");
         
+        // Not null
+        ctxt.generateJavaSource("if (" + iterV + " != null) {");
+
         if (hasBegin) {
             String tV = ctxt.getTemporaryVariableName();
             ctxt.generateJavaSource("for (int " + tV + "=" + beginV + ";" +
@@ -196,6 +199,7 @@ public final class ForEach implements Ta
             ctxt.generateJavaSource("break;");
         }
         ctxt.generateJavaSource("}"); // while
+        ctxt.generateJavaSource("}"); // Not Null
     }
     
     /**



Mime
View raw message