[JAVA-3632] Ignore redundant null check error from Spotbugs Created: 21/Feb/20 Updated: 28/Oct/23 Resolved: 21/Feb/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Build |
| Affects Version/s: | 4.0.0, 4.1.0 |
| Fix Version/s: | 4.0.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
See https://github.com/spotbugs/spotbugs/issues/756 for details. Essentially, Java 11 has changed the bytecode generation for try-with-resources, and it triggers this Spotbugs error wherever it's used:
Since this is a relatively harmless mistake in handwritten code, and try-with-resources is quite nice syntactically, let's disable the check. |
| Comments |
| Comment by Githook User [ 21/Feb/20 ] |
|
Author: {'username': 'jyemin', 'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com'}Message: Disable RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE Spotbugs check Spotbugs plugin complains about an extraneous null check for any use
|
| Comment by Githook User [ 21/Feb/20 ] |
|
Author: {'username': 'jyemin', 'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com'}Message: Disable RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE Spotbugs check Spotbugs plugin complains about an extraneous null check for any use
|
| Comment by Jeffrey Yemin [ 21/Feb/20 ] |