immutables / immutables-vavr

Immutables encodings for Vavr
Other
33 stars 7 forks source link

#21 Move the inhibit-classpath file from vavr-encodings to vavr-examples #22

Closed kennymacleod closed 6 years ago

kennymacleod commented 6 years ago

Issue #21 describes a problem with the inhibit-classpath file that's bundled as part of vavr-encodings.jar, which results in Immutables suppressing the usage of any classes in javax.annotations when generating code.

This suppression is only really required when using Java9+ (which the project maven build requires), so I've moved the inhibit-classpath file from vavr-encodings to vavr-examples. This allows the tests to pass under Java9, without forcing all consumers of vavr-encodings.jar to use the suppression.

io7m commented 6 years ago

Hello!

Thanks for the PR. However, I'm not entirely sure if this is the way to go. The problem: The classpath inhibition really is needed on JDK 9 in a modular context because the @Generated annotation no longer exists. I'm wondering if the right way to go might be to instead put the inhibition inside a META-INF/versions/9/ section in the jar so that pre-JDK9 consumers don't get the inhibition. I don't actually know if that will work or not...

kennymacleod commented 6 years ago

I don't disagree with that, but I don't think that immutables-vavr is where that problem should be solved. The classpath inhibition has nothing to do with the integration between vavr and immutables. If Java9+ users need the inhibition, then the immutables documentation describes how to add one in the consuming project.

Obviously, that's up to you, I'm happy as long as the inhibition gets removed for Java8.

io7m commented 6 years ago

I think you're right. I think this problem needs to be solved more generally in immutables itself.

@elucash ^^ :smile:

elucash commented 6 years ago

@io7m sorry for delay, getting back to business, so basically 2.6.x address most of the issues if something is not working well, we'll fix it on Immutables side