projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.88k stars 2.39k forks source link

[FEATURE] Default lombok.nonNull.exceptionType to JDK when targetting Java >= 9 #2400

Open candrews opened 4 years ago

candrews commented 4 years ago

Before submitting :+1:

Describe the feature Currently, the default value of the configuration setting lombok.nonNull.exceptionType is NullPointerException

This issue proposed that when targeting Java >= 9, the default value of lombok.nonNull.exceptionType be JDK

Describe the target audience The current default, NullPointerException, generates if statements which results in lots of branches. Code coverage tools, such as JaCoCo, see these branches and will require tests for each one in order for the code to be considered covered.

JDK doesn't generate any branches. Therefore, code coverage tools "just work" the way developers expect.

Instead of requiring all developers to realize this situation, it would be better to have lombok automatically use the best default configuration based on the version of java targeted.

jburrill commented 4 years ago

This would be very beneficial for my team's work, as well. Thank you for the submittal, @candrews