polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [38/50] [abbrv] zest-qi4j git commit: Changing a loop into the Stream API filter instead.
Date Fri, 17 Apr 2015 16:08:50 GMT
Changing a loop into the Stream API filter instead.


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

Branch: refs/heads/3.0
Commit: 0a50ebd5293476471eac62d4ad9b614753277478
Parents: b71c878
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Sat Oct 4 14:07:30 2014 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Sat Oct 4 14:07:30 2014 +0800

----------------------------------------------------------------------
 .../java/org/qi4j/api/activation/ActivationEvent.java    |  2 --
 .../org/qi4j/api/association/GenericAssociationInfo.java | 11 ++---------
 2 files changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/0a50ebd5/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java b/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java
index e3fdf70..c5f889c 100644
--- a/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java
+++ b/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java
@@ -24,13 +24,11 @@ public final class ActivationEvent
         ACTIVATING, ACTIVATED, PASSIVATING, PASSIVATED
     }
 
-    private final long timestamp;
     private final Object source;
     private final EventType type;
 
     public ActivationEvent( Object source, EventType type )
     {
-        this.timestamp = System.currentTimeMillis();
         this.source = source;
         this.type = type;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/0a50ebd5/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java b/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java
index 7173547..96e466d 100644
--- a/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java
+++ b/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java
@@ -20,6 +20,7 @@ package org.qi4j.api.association;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.Arrays;
 
 import static org.qi4j.api.util.Classes.typeOf;
 
@@ -45,14 +46,6 @@ public final class GenericAssociationInfo
         }
 
         Type[] interfaces = ( (Class<?>) methodReturnType ).getGenericInterfaces();
-        for( Type anInterface : interfaces )
-        {
-            Type associationType = toAssociationType( anInterface );
-            if( associationType != null )
-            {
-                return associationType;
-            }
-        }
-        return null;
+        return Arrays.stream( interfaces ).findFirst().filter( intFace -> toAssociationType(
intFace ) != null ).get();
     }
 }


Mime
View raw message