bug 41797: CNFE/NPE thrown from function mapper when externalizing
authorfunkman <funkman@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 23 Sep 2007 23:33:56 +0000 (23:33 +0000)
committerfunkman <funkman@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 23 Sep 2007 23:33:56 +0000 (23:33 +0000)
Patch by Tuomas Kiviaho- tuomas.kiviahos at ikis fi
(submit part2 of the patch as seem in comment #3)

(Format police - help!!! I did my best)

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@578610 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/el/lang/FunctionMapperImpl.java

index a101994..a225e3b 100644 (file)
@@ -120,9 +120,16 @@ public class FunctionMapperImpl extends FunctionMapper implements
         public void writeExternal(ObjectOutput out) throws IOException {
             out.writeUTF((this.prefix != null) ? this.prefix : "");
             out.writeUTF(this.localName);
-            out.writeUTF(this.m.getDeclaringClass().getName());
-            out.writeUTF(this.m.getName());
-            out.writeObject(ReflectionUtil.toTypeNameArray(this.m.getParameterTypes()));
+            out.writeUTF((this.owner != null) ? 
+                     this.owner : 
+                     this.m.getDeclaringClass().getName());
+            out.writeUTF((this.name != null) ? 
+                     this.name : 
+                     this.m.getName());
+            out.writeObject((this.types != null) ? 
+                     this.types : 
+                     ReflectionUtil.toTypeNameArray(this.m.getParameterTypes()));
+
         }
     
         /*