Return-Path: X-Original-To: apmail-zest-commits-archive@minotaur.apache.org Delivered-To: apmail-zest-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 42A6E17E30 for ; Fri, 17 Apr 2015 16:08:15 +0000 (UTC) Received: (qmail 48364 invoked by uid 500); 17 Apr 2015 16:08:15 -0000 Delivered-To: apmail-zest-commits-archive@zest.apache.org Received: (qmail 48312 invoked by uid 500); 17 Apr 2015 16:08:15 -0000 Mailing-List: contact commits-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list commits@zest.apache.org Received: (qmail 48212 invoked by uid 99); 17 Apr 2015 16:08:15 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2015 16:08:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0D8BBDFE2C; Fri, 17 Apr 2015 16:08:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: niclas@apache.org To: commits@zest.apache.org Date: Fri, 17 Apr 2015 16:08:50 -0000 Message-Id: In-Reply-To: <2da16a2ab3144bd6bd2beabd68134615@git.apache.org> References: <2da16a2ab3144bd6bd2beabd68134615@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [38/50] [abbrv] zest-qi4j git commit: Changing a loop into the Stream API filter instead. 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 Authored: Sat Oct 4 14:07:30 2014 +0800 Committer: Niclas Hedhman 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(); } }