[jboss-cvs] JBossAS SVN: r94035 - in projects/interceptors/trunk/src: test/java/org/jboss/interceptors and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Sep 25 16:08:46 EDT 2009


Author: marius.bogoevici
Date: 2009-09-25 16:08:46 -0400 (Fri, 25 Sep 2009)
New Revision: 94035

Modified:
   projects/interceptors/trunk/src/main/java/org/jboss/interceptor/model/InterceptionModelBuilder.java
   projects/interceptors/trunk/src/test/java/org/jboss/interceptors/InterceptionTest.java
Log:
Some adjustments to generic types

Modified: projects/interceptors/trunk/src/main/java/org/jboss/interceptor/model/InterceptionModelBuilder.java
===================================================================
--- projects/interceptors/trunk/src/main/java/org/jboss/interceptor/model/InterceptionModelBuilder.java	2009-09-25 20:06:30 UTC (rev 94034)
+++ projects/interceptors/trunk/src/main/java/org/jboss/interceptor/model/InterceptionModelBuilder.java	2009-09-25 20:08:46 UTC (rev 94035)
@@ -27,19 +27,19 @@
 public class InterceptionModelBuilder<T>
 {
 
-   private InterceptionModelImpl interceptionModel;
+   private InterceptionModelImpl<T> interceptionModel;
 
    private T interceptedEntity;
 
    private InterceptionModelBuilder(T interceptedEntity)
    {
       this.interceptedEntity = interceptedEntity;
-      this.interceptionModel = new InterceptionModelImpl(interceptedEntity);
+      this.interceptionModel = new InterceptionModelImpl<T>(interceptedEntity);
    }
 
    public static <T> InterceptionModelBuilder<T> newBuilderFor(T entity)
    {
-      return new InterceptionModelBuilder(entity);
+      return new InterceptionModelBuilder<T>(entity);
    }
 
    public T getInterceptedEntity()
@@ -47,7 +47,7 @@
       return interceptedEntity;
    }
 
-   public InterceptionModel build()
+   public InterceptionModel<T> build()
    {
       return interceptionModel;
    }

Modified: projects/interceptors/trunk/src/test/java/org/jboss/interceptors/InterceptionTest.java
===================================================================
--- projects/interceptors/trunk/src/test/java/org/jboss/interceptors/InterceptionTest.java	2009-09-25 20:06:30 UTC (rev 94034)
+++ projects/interceptors/trunk/src/test/java/org/jboss/interceptors/InterceptionTest.java	2009-09-25 20:08:46 UTC (rev 94035)
@@ -17,23 +17,20 @@
 
 package org.jboss.interceptors;
 
-import org.jboss.interceptor.proxy.InterceptorProxyCreatorImpl;
+import org.jboss.interceptor.model.InterceptionModelBuilder;
 import org.jboss.interceptor.proxy.InterceptorProxyCreator;
+import org.jboss.interceptor.proxy.InterceptorProxyCreatorImpl;
 import org.jboss.interceptor.proxy.SimpleInterceptionHandlerFactory;
 import org.jboss.interceptor.registry.InterceptorRegistry;
-import org.jboss.interceptor.model.InterceptionModelImpl;
-import org.jboss.interceptor.model.InterceptionType;
-import org.jboss.interceptor.model.InterceptionModelBuilder;
 import org.jboss.interceptor.util.InterceptionUtils;
-import org.junit.Test;
-import org.junit.Before;
 import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-import javax.interceptor.InvocationContext;
-import javax.interceptor.AroundInvoke;
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
-import java.util.Arrays;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
 
 /**
  * @author <a href="mailto:mariusb at redhat.com">Marius Bogoevici</a>
@@ -54,17 +51,15 @@
          "org.jboss.interceptors.InterceptionTest$MySecondInterceptor_preDestroy"
 
    };
-   private InterceptorRegistry<Class<?>> interceptorRegistry;
-   private InterceptionModelBuilder builder;
    private InterceptorProxyCreator interceptorProxyCreator;
 
    @Before
    public void resetLogAndSetupClasses() throws Exception
    {
       InterceptorTestLogger.reset();
-      interceptorRegistry = new InterceptorRegistry<Class<?>>();
+      InterceptorRegistry<Class<?>> interceptorRegistry = new InterceptorRegistry<Class<?>>();
 
-      builder = InterceptionModelBuilder.newBuilderFor(FootballTeam.class);
+      InterceptionModelBuilder<Class<?>> builder = InterceptionModelBuilder.<Class<?>>newBuilderFor(FootballTeam.class);
 
       builder.interceptAroundInvoke(FootballTeam.class.getMethod("getName")).with(MyFirstInterceptor.class, MySecondInterceptor.class);
       builder.interceptPostConstruct().with(MyFirstInterceptor.class);
@@ -108,7 +103,7 @@
       StringBuffer buffer = new StringBuffer();
       for (Object logValue: logValues)
       {
-         buffer.append(logValue.toString() + "\n");
+         buffer.append(logValue.toString()).append("\n");
       }
       return buffer.toString();
    }




More information about the jboss-cvs-commits mailing list