bbottema / email-rfc2822-validator

The world's only Java-based rfc2822-compliant email address validator and parser
64 stars 13 forks source link

Remove proprietary annotations #15

Closed Lonzak closed 5 years ago

Lonzak commented 5 years ago

The project is difficult to use since you use those proprietary @NonNull etc. annotations. Can you just remove them? Same goes for the findbugs/spotbugs import... It is fine to run it inside maven but to have such an import makes it difficult to use the lib at all (since though its transitive dependencies lots of others stuff is coming along and we need to really take care what is going into a project and what not...

bbottema commented 5 years ago

It seems you misunderstood how annotation dependencies work.

First, these transitive dependencies are not needed and indeed are set to provided. If you omit them completely, this causes no issues, because the JVM was designed to allow for missing annotation classes.

Second, these nullability annotation libraries don't have "lots of others stuff is coming along", as you can see in a Maven analyses: image Not only are there no nested transitive dependencies, these are set to provided, so they are not needed at all. If you don't include them, the only thing you accomplish is that your IDE/build tool can't do proper null-checks anymore, so you basically harm your own project.

Third, these libraries are the defacto industry standard. Many many projects uses them (including popular projects such as Google Guava); either the old spotbugs version, the findbugs successor or Google's CheckerQual etc. They allow analyser tools (Spotbugs, IntelliJ etc)., to perform static analyses for nullabillity-problems. But if you don't want them, you can and that's totally fine.

Lonzak commented 5 years ago

Mhm indeed didn't know that missing annotations would be ignored. Fine. But I disagree with your statement that Intellij' annotation are a defacto industry standard (findbugs/spotbugs might be). You can compare my thread "Which nonnull annotation to use" https://stackoverflow.com/questions/35892063/which-nonnull-java-annotation-to-use