bhabegger commented on code in PR #2729:
URL: https://github.com/apache/jackrabbit-oak/pull/2729#discussion_r3361742269


##########
oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/cli/blob/LoopbackBlobStoreTest.java:
##########
@@ -81,6 +82,7 @@ public void 
getBlobIdShouldReturnTheSameValuePassedExceptOfNull(
     }
 
 
+    @Ignore("Now throws IllegalArgumentException")

Review Comment:
   For the IllegalArgumentException, this is the cause:
   
   
https://stackoverflow.com/questions/40847472/why-nonnull-annotation-checked-at-runtime
   
   It is linked to the upgrade from hamcrest-core 1.3 to 2.2. With 2.2 the 
@NotNull annotation is picked up by intelliJ and leads to an IllegalArgument 
exception rather than a NullPointerException...
   
   Minimal reproducer is in the oak-upgrade pom:
   
   Swap:
   ```
   <dependency>
     <groupId>org.hamcrest</groupId>
     <artifactId>hamcrest-all</artifactId>
     <version>1.3</version>
     <scope>test</scope>
   </dependency>
   ```
   
   to
   
   ```
   <dependency>
     <groupId>org.hamcrest</groupId>
     <artifactId>hamcrest</artifactId>
     <version>2.2</version>
     <scope>test</scope>
   </dependency>
   ```
   
   And add:
   
   ```
   <dependencyManagement>
     <dependencies>
       <dependency>
         <groupId>org.hamcrest</groupId>
         <artifactId>hamcrest-core</artifactId>
         <version>2.2</version>
         <scope>test</scope>
       </dependency>
     </dependencies>
   </dependencyManagement>
   ```
   
   This flips the dependency tree from:
   
   ```
   ...
   [INFO] +- junit:junit:jar:4.13.1:test
   [INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
   ...
   ```
   
   to
   
   ```
   ...
   [INFO] +- junit:junit:jar:4.13.1:test
   [INFO] |  \- org.hamcrest:hamcrest-core:jar:2.2:test(edited)
   ...
   ```
   
   If I remove the option in Intellij, the test passes.
   
   Using maven the test passes.
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to