onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject svn commit: r1462728 - in /incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard: DisposeModule.java StagerWrapper.java
Date Sat, 30 Mar 2013 10:56:08 GMT
Author: ash2k
Date: Sat Mar 30 10:56:07 2013
New Revision: 1462728

URL: http://svn.apache.org/r1462728
Log:
trivial: refactor to avoid raw types, no functional changes

Modified:
    incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/DisposeModule.java
    incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/StagerWrapper.java

Modified: incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/DisposeModule.java
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/DisposeModule.java?rev=1462728&r1=1462727&r2=1462728&view=diff
==============================================================================
--- incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/DisposeModule.java
(original)
+++ incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/DisposeModule.java
Sat Mar 30 10:56:07 2013
@@ -64,14 +64,22 @@ public class DisposeModule
                 .build();
     }
 
-    @SuppressWarnings( "unchecked" )
     protected DisposeModule( Builder builder )
     {
         disposer = builder.disposer;
-        StagerWrapper wrapper = new StagerWrapper( builder.disposer, builder.disposeAnnotationType
);
-        lifeCycleStageModule =
-            LifeCycleStageModule.builder( builder.disposeAnnotationType ).withStager( wrapper
).withTypeMatcher(
-                builder.typeMatcher ).build();
+        lifeCycleStageModule = buildModule( builder.disposer, builder.disposeAnnotationType,
+                builder.typeMatcher );
+    }
+
+    // Wildcard capturing method. Bloch, item 28.
+    private static <A extends Annotation> LifeCycleStageModule<A> buildModule(
Disposer disposer,
+    	    Class<A> stage, Matcher<? super TypeLiteral<?>> typeMatcher )
+    {
+    	StagerWrapper<A> wrapper = new StagerWrapper<A>( disposer, stage );
+    	return LifeCycleStageModule.builder( stage )
+                .withStager( wrapper )
+                .withTypeMatcher( typeMatcher )
+                .build();
     }
 
     public static Builder builder()

Modified: incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/StagerWrapper.java
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/StagerWrapper.java?rev=1462728&r1=1462727&r2=1462728&view=diff
==============================================================================
--- incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/StagerWrapper.java
(original)
+++ incubator/onami/trunk/lifecycle/standard/src/main/java/org/apache/onami/lifecycle/standard/StagerWrapper.java
Sat Mar 30 10:56:07 2013
@@ -12,7 +12,7 @@ class StagerWrapper<A extends Annotation
 
     private final Class<A> stage;
 
-    StagerWrapper(Disposer disposer, Class<A> stage)
+    StagerWrapper( Disposer disposer, Class<A> stage )
     {
         this.disposer = disposer;
         this.stage = stage;



Mime
View raw message