tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r961459 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/DiscardAfterWorker.java
Date Wed, 07 Jul 2010 18:27:51 GMT
Author: hlship
Date: Wed Jul  7 18:27:50 2010
New Revision: 961459

URL: http://svn.apache.org/viewvc?rev=961459&view=rev
Log:
Change the DiscardAfterWork's ComponentMethodAdvice to static as it does not use any members
of the top-level class

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/DiscardAfterWorker.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/DiscardAfterWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/DiscardAfterWorker.java?rev=961459&r1=961458&r2=961459&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/DiscardAfterWorker.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/DiscardAfterWorker.java
Wed Jul  7 18:27:50 2010
@@ -26,21 +26,20 @@ import org.apache.tapestry5.services.Tra
 
 public class DiscardAfterWorker implements ComponentClassTransformWorker
 {
-    
-    private final ComponentMethodAdvice advice = new ComponentMethodAdvice()
+
+    private static final ComponentMethodAdvice advice = new ComponentMethodAdvice()
     {
 
         public void advise(ComponentMethodInvocation invocation)
         {
             invocation.proceed();
-            
-            if(invocation.isFail())
+
+            if (invocation.isFail())
                 return;
-            
+
             ComponentResources resources = invocation.getComponentResources();
-            
-            resources.discardPersistentFieldChanges();
 
+            resources.discardPersistentFieldChanges();
         }
 
     };
@@ -49,12 +48,12 @@ public class DiscardAfterWorker implemen
     {
         final List<TransformMethod> methods = transformation.matchMethodsWithAnnotation(DiscardAfter.class);
 
-        if (methods.isEmpty()) 
-            return; 
+        if (methods.isEmpty())
+            return;
 
-        for (final TransformMethod metod : methods)
+        for (final TransformMethod method : methods)
         {
-            metod.addAdvice(advice);
+            method.addAdvice(advice);
         }
 
     }



Mime
View raw message