michael-o commented on a change in pull request #34: [MRESOLVER-88] Use Java 7 
features and style fixes
URL: https://github.com/apache/maven-resolver/pull/34#discussion_r283131314
 
 

 ##########
 File path: 
maven-resolver-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java
 ##########
 @@ -253,15 +256,12 @@ public boolean equals( Object obj )
 
         RemoteRepository that = (RemoteRepository) obj;
 
-        return eq( url, that.url ) && eq( type, that.type ) && eq( id, that.id 
)
-            && eq( releasePolicy, that.releasePolicy ) && eq( snapshotPolicy, 
that.snapshotPolicy )
-            && eq( proxy, that.proxy ) && eq( authentication, 
that.authentication )
-            && eq( mirroredRepositories, that.mirroredRepositories ) && 
repositoryManager == that.repositoryManager;
-    }
-
-    private static <T> boolean eq( T s1, T s2 )
-    {
-        return s1 != null ? s1.equals( s2 ) : s2 == null;
+        return Objects.equals( url, that.url ) && Objects.equals( type, 
that.type )
+                && Objects.equals( id, that.id ) && Objects.equals( 
releasePolicy, that.releasePolicy )
+                && Objects.equals( snapshotPolicy, that.snapshotPolicy ) && 
Objects.equals( proxy, that.proxy )
+                && Objects.equals( authentication, that.authentication )
+                && Objects.equals( mirroredRepositories, 
that.mirroredRepositories )
+                && repositoryManager == that.repositoryManager;
 
 Review comment:
   I'll resolve this discussion because you ported the code as-is, but the 
reference comparison w/o a comment still looks fishly to me.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to