polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [1/4] zest-java git commit: Removed all warnings from org.apache.zest.api.association package
Date Mon, 24 Oct 2016 01:47:31 GMT
Repository: zest-java
Updated Branches:
  refs/heads/develop 3b1ed4c6d -> efdfb03b8


Removed all warnings from org.apache.zest.api.association package


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

Branch: refs/heads/develop
Commit: 246e3677aaddc0ba58ab0c481f8f86fd63543b90
Parents: 3b1ed4c
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Mon Oct 24 09:30:39 2016 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Mon Oct 24 09:30:39 2016 +0800

----------------------------------------------------------------------
 .../apache/zest/api/association/AssociationMixin.java  |  2 +-
 .../zest/api/association/AssociationWrapper.java       |  1 +
 .../zest/api/association/GenericAssociationInfo.java   | 13 ++++++++-----
 .../zest/api/association/ManyAssociationMixin.java     |  2 +-
 .../zest/api/association/ManyAssociationWrapper.java   |  1 +
 .../zest/api/association/NamedAssociationMixin.java    |  2 +-
 .../zest/api/association/NamedAssociationWrapper.java  |  1 +
 7 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/246e3677/core/api/src/main/java/org/apache/zest/api/association/AssociationMixin.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/association/AssociationMixin.java
b/core/api/src/main/java/org/apache/zest/api/association/AssociationMixin.java
index 9c2d064..0cbd3da 100644
--- a/core/api/src/main/java/org/apache/zest/api/association/AssociationMixin.java
+++ b/core/api/src/main/java/org/apache/zest/api/association/AssociationMixin.java
@@ -46,7 +46,7 @@ public final class AssociationMixin
     /**
      * Associations generic mixin AppliesToFilter.
      */
-    public static class AssociationFilter
+    static class AssociationFilter
         implements AppliesToFilter
     {
         @Override

http://git-wip-us.apache.org/repos/asf/zest-java/blob/246e3677/core/api/src/main/java/org/apache/zest/api/association/AssociationWrapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/association/AssociationWrapper.java
b/core/api/src/main/java/org/apache/zest/api/association/AssociationWrapper.java
index cd06779..9877e1a 100644
--- a/core/api/src/main/java/org/apache/zest/api/association/AssociationWrapper.java
+++ b/core/api/src/main/java/org/apache/zest/api/association/AssociationWrapper.java
@@ -67,6 +67,7 @@ public class AssociationWrapper
     }
 
     @Override
+    @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
     public boolean equals( Object obj )
     {
         return next.equals( obj );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/246e3677/core/api/src/main/java/org/apache/zest/api/association/GenericAssociationInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/association/GenericAssociationInfo.java
b/core/api/src/main/java/org/apache/zest/api/association/GenericAssociationInfo.java
index 119edd2..2d53bc7 100644
--- a/core/api/src/main/java/org/apache/zest/api/association/GenericAssociationInfo.java
+++ b/core/api/src/main/java/org/apache/zest/api/association/GenericAssociationInfo.java
@@ -45,12 +45,15 @@ public final class GenericAssociationInfo
                 return parameterizedType.getActualTypeArguments()[ 0 ];
             }
         }
-
-        Type[] interfaces = ( (Class<?>) methodReturnType ).getGenericInterfaces();
-        for( Type anInterface : interfaces )
+        if (!(methodReturnType instanceof Class))
+        {
+            throw new IllegalArgumentException( "Unable to make an association with " + methodReturnType
);
+        }
+        Type[] interfaces = ((Class<?>) methodReturnType).getGenericInterfaces();
+        for (Type anInterface : interfaces)
         {
-            Type associationType = toAssociationType( anInterface );
-            if( associationType != null )
+            Type associationType = toAssociationType(anInterface);
+            if (associationType != null)
             {
                 return associationType;
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/246e3677/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationMixin.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationMixin.java
b/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationMixin.java
index 19caec7..a948b55 100644
--- a/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationMixin.java
+++ b/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationMixin.java
@@ -46,7 +46,7 @@ public final class ManyAssociationMixin
     /**
      * ManyAssociations generic mixin AppliesToFilter.
      */
-    public static class AssociationFilter
+    static class AssociationFilter
         implements AppliesToFilter
     {
         @Override

http://git-wip-us.apache.org/repos/asf/zest-java/blob/246e3677/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationWrapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationWrapper.java
b/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationWrapper.java
index 6759a86..e9e5a10 100644
--- a/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationWrapper.java
+++ b/core/api/src/main/java/org/apache/zest/api/association/ManyAssociationWrapper.java
@@ -111,6 +111,7 @@ public class ManyAssociationWrapper
     }
 
     @Override
+    @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
     public boolean equals( Object obj )
     {
         return next.equals( obj );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/246e3677/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationMixin.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationMixin.java
b/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationMixin.java
index 6644d69..40e2d06 100644
--- a/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationMixin.java
+++ b/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationMixin.java
@@ -45,7 +45,7 @@ public final class NamedAssociationMixin
     /**
      * NamedAssociations generic mixin AppliesToFilter.
      */
-    public static class AssociationFilter
+    static class AssociationFilter
         implements AppliesToFilter
     {
         @Override

http://git-wip-us.apache.org/repos/asf/zest-java/blob/246e3677/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationWrapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationWrapper.java
b/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationWrapper.java
index af49488..42ee180 100644
--- a/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationWrapper.java
+++ b/core/api/src/main/java/org/apache/zest/api/association/NamedAssociationWrapper.java
@@ -110,6 +110,7 @@ public class NamedAssociationWrapper
     }
 
     @Override
+    @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
     public boolean equals( Object obj )
     {
         return next.equals( obj );


Mime
View raw message