Author: hlship
Date: Sat Jul 23 16:57:12 2011
New Revision: 1150145

URL: http://svn.apache.org/viewvc?rev=1150145&view=rev
Log:
TAP5-1508: Lazily initialize PlasticMethod.methodIdentifier property

Modified:
    
tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java

Modified: 
tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java?rev=1150145&r1=1150144&r2=1150145&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
 (original)
+++ 
tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
 Sat Jul 23 16:57:12 2011
@@ -146,6 +146,9 @@ public class PlasticClassImpl extends Lo
 
         private int methodIndex = -1;
 
+        // Lazily initialized
+        private String methodIdentifier;
+
         public PlasticMethodImpl(MethodNode node)
         {
             super(node.visibleAnnotations);
@@ -175,23 +178,36 @@ public class PlasticClassImpl extends Lo
 
         public int compareTo(PlasticMethodImpl o)
         {
+            check();
+
             return description.compareTo(o.description);
         }
 
         public boolean isOverride()
         {
+            check();
+
             return parentMethodBundle.isImplemented(node.name, node.desc);
         }
 
         public String getMethodIdentifier()
         {
-            return String.format("%s.%s",
-                    className,
-                    description.toShortString());
+            check();
+
+            if (methodIdentifier == null)
+            {
+                methodIdentifier = String.format("%s.%s",
+                        className,
+                        description.toShortString());
+            }
+
+            return methodIdentifier;
         }
 
         public boolean isVoid()
         {
+            check();
+
             return description.returnType.equals("void");
         }
 


Reply via email to