polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [1/2] zest-java git commit: Fixed compile errors that has snuck in.
Date Wed, 13 Apr 2016 15:19:37 GMT
Repository: zest-java
Updated Branches:
  refs/heads/ZEST-105 15f156d50 -> e5c57f95e


Fixed compile errors that has snuck in.


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/be492ed6
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/be492ed6
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/be492ed6

Branch: refs/heads/ZEST-105
Commit: be492ed63de48807389ae0e69073774476771262
Parents: 15f156d
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Wed Apr 13 22:42:52 2016 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Wed Apr 13 22:42:52 2016 +0800

----------------------------------------------------------------------
 .../apache/zest/library/groovy/GroovyMixinTest.java |  4 ++--
 .../zest/library/groovy/HelloSpeakerTest.java       |  2 +-
 .../apache/zest/library/scala/ScalaTraitMixin.java  | 16 ++++++++++++----
 3 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/be492ed6/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/GroovyMixinTest.java
----------------------------------------------------------------------
diff --git a/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/GroovyMixinTest.java
b/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/GroovyMixinTest.java
index f5f6e9d..6f42453 100644
--- a/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/GroovyMixinTest.java
+++ b/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/GroovyMixinTest.java
@@ -29,8 +29,8 @@ public class GroovyMixinTest extends AbstractZestTest
     @Test
     public void testInvoke()
     {
-        GroovyComposite domain1 = module.newTransient( GroovyComposite.class );
-        GroovyComposite domain2 = module.newTransient( GroovyComposite.class );
+        GroovyComposite domain1 = transientBuilderFactory.newTransient( GroovyComposite.class
);
+        GroovyComposite domain2 = transientBuilderFactory.newTransient( GroovyComposite.class
);
         Assert.assertEquals( "do1() in Groovy:1", domain1.do1() );
         Assert.assertEquals( "do1() in Groovy:2", domain1.do1() );
         Assert.assertEquals( "do1() in Groovy:3", domain1.do1() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/be492ed6/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/HelloSpeakerTest.java
----------------------------------------------------------------------
diff --git a/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/HelloSpeakerTest.java
b/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/HelloSpeakerTest.java
index ac36ec7..3f3e384 100644
--- a/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/HelloSpeakerTest.java
+++ b/libraries/lang-groovy/src/test/groovy/org/apache/zest/library/groovy/HelloSpeakerTest.java
@@ -35,7 +35,7 @@ public class HelloSpeakerTest extends AbstractZestTest
     @Test
     public void testHello()
     {
-        HelloSpeaker speaker = module.newTransient( HelloSpeaker.class );
+        HelloSpeaker speaker = transientBuilderFactory.newTransient( HelloSpeaker.class );
         Assert.assertEquals( "Hello World!", speaker.sayHello( "World" ) );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/be492ed6/libraries/lang-scala/src/main/java/org/apache/zest/library/scala/ScalaTraitMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-scala/src/main/java/org/apache/zest/library/scala/ScalaTraitMixin.java
b/libraries/lang-scala/src/main/java/org/apache/zest/library/scala/ScalaTraitMixin.java
index 95dbc5c..493b6f9 100644
--- a/libraries/lang-scala/src/main/java/org/apache/zest/library/scala/ScalaTraitMixin.java
+++ b/libraries/lang-scala/src/main/java/org/apache/zest/library/scala/ScalaTraitMixin.java
@@ -30,9 +30,12 @@ import org.apache.zest.api.common.AppliesToFilter;
 import org.apache.zest.api.composite.Composite;
 import org.apache.zest.api.composite.CompositeInstance;
 import org.apache.zest.api.injection.scope.Service;
+import org.apache.zest.api.injection.scope.Structure;
 import org.apache.zest.api.injection.scope.This;
 import org.apache.zest.api.service.ServiceReference;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.api.util.Classes;
+import org.apache.zest.spi.ZestSPI;
 
 import static org.apache.zest.api.util.Classes.interfacesOf;
 
@@ -45,6 +48,9 @@ public class ScalaTraitMixin
 {
     private static Map<Class<?>, Map<Method, InvocationHandler>> methods
= new HashMap<>();
 
+    @Structure
+    private ZestSPI spi;
+
     private Class<?> compositeType;
 
     public ScalaTraitMixin( @This Composite composite )
@@ -79,8 +85,9 @@ public class ScalaTraitMixin
                             public Object invoke( Object composite, Method method, Object[]
objects )
                                 throws Throwable
                             {
-                                return ( (CompositeInstance) Proxy.getInvocationHandler(
composite ) ).module()
-                                    .findService( method.getReturnType() );
+                                CompositeInstance compositeInstance = (CompositeInstance)
Proxy.getInvocationHandler( composite );
+                                ModuleDescriptor moduleDescriptor = compositeInstance.module();
+                                return moduleDescriptor.instance().findService( method.getReturnType()
);
                             }
                         };
                         getHandlers( compositeType ).put( method, handler );
@@ -93,8 +100,9 @@ public class ScalaTraitMixin
                             public Object invoke( Object composite, Method method, Object[]
objects )
                                 throws Throwable
                             {
-                                return ( (CompositeInstance) Proxy.getInvocationHandler(
composite ) ).module()
-                                    .findService( method.getReturnType() ).get();
+                                CompositeInstance compositeInstance = (CompositeInstance)
Proxy.getInvocationHandler( composite );
+                                ModuleDescriptor moduleDescriptor = compositeInstance.module();
+                                return moduleDescriptor.instance().findService( method.getReturnType()
).get();
                             }
                         };
                         getHandlers( compositeType ).put( method, handler );


Mime
View raw message