You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/06/15 13:55:35 UTC

[GitHub] [commons-geometry] singhbaljit opened a new pull request #79: GEOMETRY-63: Fix some SonarQube smells

singhbaljit opened a new pull request #79:
URL: https://github.com/apache/commons-geometry/pull/79


   https://sonarcloud.io/dashboard?id=commons-geometry


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [commons-geometry] darkma773r commented on pull request #79: GEOMETRY-63: Fix some SonarQube smells

Posted by GitBox <gi...@apache.org>.
darkma773r commented on pull request #79:
URL: https://github.com/apache/commons-geometry/pull/79#issuecomment-649505999


   Apologies, Baljit! I didn't realize that you had a pull request open. I'll take a look now.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [commons-geometry] asfgit merged pull request #79: GEOMETRY-63: Fix some SonarQube smells

Posted by GitBox <gi...@apache.org>.
asfgit merged pull request #79:
URL: https://github.com/apache/commons-geometry/pull/79


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [commons-geometry] singhbaljit commented on pull request #79: GEOMETRY-63: Fix some SonarQube smells

Posted by GitBox <gi...@apache.org>.
singhbaljit commented on pull request #79:
URL: https://github.com/apache/commons-geometry/pull/79#issuecomment-649551543


   There is also https://jqno.nl/equalsverifier 😄 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [commons-geometry] darkma773r commented on a change in pull request #79: GEOMETRY-63: Fix some SonarQube smells

Posted by GitBox <gi...@apache.org>.
darkma773r commented on a change in pull request #79:
URL: https://github.com/apache/commons-geometry/pull/79#discussion_r445520548



##########
File path: commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/EpsilonDoublePrecisionContextTest.java
##########
@@ -199,13 +199,13 @@ public void testEquals() {
         EpsilonDoublePrecisionContext c = new EpsilonDoublePrecisionContext(1e-6);
 
         // act/assert
-        Assert.assertFalse(a.equals(null));
-        Assert.assertFalse(a.equals(new Object()));
-        Assert.assertFalse(a.equals(b));
-        Assert.assertFalse(b.equals(a));
+        Assert.assertNotEquals(null, a);
+        Assert.assertNotEquals(new Object(), a);

Review comment:
       JUnit applies its own null checks in the `assertEquals` and `assertNotEquals` methods, meaning that we end up missing those branches in our code. This seems to be why the code coverage decreased. Let's revert these changes on this and all of the other `equals()` method tests and see if the code coverage goes back up.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [commons-geometry] singhbaljit commented on a change in pull request #79: GEOMETRY-63: Fix some SonarQube smells

Posted by GitBox <gi...@apache.org>.
singhbaljit commented on a change in pull request #79:
URL: https://github.com/apache/commons-geometry/pull/79#discussion_r445525532



##########
File path: commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/EpsilonDoublePrecisionContextTest.java
##########
@@ -199,13 +199,13 @@ public void testEquals() {
         EpsilonDoublePrecisionContext c = new EpsilonDoublePrecisionContext(1e-6);
 
         // act/assert
-        Assert.assertFalse(a.equals(null));
-        Assert.assertFalse(a.equals(new Object()));
-        Assert.assertFalse(a.equals(b));
-        Assert.assertFalse(b.equals(a));
+        Assert.assertNotEquals(null, a);
+        Assert.assertNotEquals(new Object(), a);

Review comment:
       Undid the tests for null checks.




----------------------------------------------------------------
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:
users@infra.apache.org