Skip to content

chore: fix issues with compilation on later JDKs #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Nov 15, 2022

This just fixes an issue that prevents JDK 11+ from working with our build and adds some associated missing javadoc. This is troublesome if you happen to be working with other projects that require a later version of the JDK.

Specifically, there were changes in later versions of javac that applied more rules, mostly around javadoc. These caused errors we could not customize, so I've disabled the lint checks in the maven-javadoc-plugin and I instead enforce them with checkstyle, which is more customizable.

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2022

Codecov Report

Merging #178 (5ef9d03) into main (ca68ae7) will not change coverage.
The diff coverage is n/a.

❗ Current head 5ef9d03 differs from pull request most recent head 967ea50. Consider uploading reports for the commit 967ea50 to get more accurate results

@@            Coverage Diff            @@
##               main     #178   +/-   ##
=========================================
  Coverage     91.60%   91.60%           
  Complexity      187      187           
=========================================
  Files            20       20           
  Lines           417      417           
  Branches         22       22           
=========================================
  Hits            382      382           
  Misses           23       23           
  Partials         12       12           
Flag Coverage Δ
unittests 91.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/java/dev/openfeature/sdk/BooleanHook.java 0.00% <ø> (ø)
src/main/java/dev/openfeature/sdk/DoubleHook.java 0.00% <ø> (ø)
src/main/java/dev/openfeature/sdk/ErrorCode.java 100.00% <ø> (ø)
...ava/dev/openfeature/sdk/FlagEvaluationDetails.java 100.00% <ø> (ø)
...c/main/java/dev/openfeature/sdk/FlagValueType.java 100.00% <ø> (ø)
src/main/java/dev/openfeature/sdk/HookSupport.java 95.12% <ø> (ø)
src/main/java/dev/openfeature/sdk/IntegerHook.java 0.00% <ø> (ø)
...ain/java/dev/openfeature/sdk/MutableStructure.java 92.85% <ø> (ø)
...in/java/dev/openfeature/sdk/OpenFeatureClient.java 97.91% <ø> (ø)
src/main/java/dev/openfeature/sdk/Reason.java 100.00% <ø> (ø)
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

beeme1mr
beeme1mr previously approved these changes Nov 15, 2022
@toddbaert toddbaert closed this Nov 16, 2022
@toddbaert toddbaert reopened this Nov 16, 2022
@toddbaert toddbaert changed the title chore: fix issues prevent compilation with later JDKs chore: fix issues prevent compilation with later JDK versions Nov 16, 2022
@toddbaert toddbaert requested a review from beeme1mr November 16, 2022 14:39
Copy link
Member

@justinabrahms justinabrahms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're somehow blocked on jdk versions.. I'd like to separate that from the documentation changes. I think the documentation changes are of low value (no offense intended) and I don't really want to accept them. No one needs to know that collection.add(thing) adds the thing to the collection. It's apparent on it's face.

@Override
public Value getValue(String key) {
return this.attributes.get(key);
}

// adders
/**
* Adds the specified value at key.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docs feel kinda useless?

Copy link
Member Author

@toddbaert toddbaert Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're somehow blocked on jdk versions

I'm not blocked... I just find it tedious, and the effort to build with 8+ is relatively low.

If you're somehow blocked on jdk versions.. I'd like to separate that from the documentation changes. I think the documentation changes are of low value (no offense intended) and I don't really want to accept them. No one needs to know that collection.add(thing) adds the thing to the collection. It's apparent on it's face.

I see your point. While these ones in particular aren't super valuable, even in this PR there are some that are (I think some of the exceptions are nice, for instance).

I guess the questions is, would you rather see us add this rule, and ignore it where we think it's silly, or not add the rule, and be careful to add doc where users might be confused.

Chose what you prefer and I will update accordingly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference would be to enable the rule and explicitly say "skip this one" on the things that are very obvious to keep the tool happy.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @justinabrahms I've done this.

I removed the lowest value javadocs (like the ones for the adders) and added the capability to suppress checkstyle warnings with annotations for those instances.

@toddbaert toddbaert changed the title chore: fix issues prevent compilation with later JDK versions chore: fix issues with compilation on later JDKs Nov 16, 2022
@toddbaert toddbaert force-pushed the chore/fix-jdk-11+ branch 5 times, most recently from 05149f1 to 1ccfd5f Compare November 17, 2022 13:52
Comment on lines -309 to -314
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
<module name="SuppressionXpathFilter">
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
default="checkstyle-xpath-suppressions.xml" />
<property name="optional" value="true"/>
</module>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved all the suppression-related config to the top of the parent element.

Comment on lines +50 to +58
<module name="SuppressWarningsFilter" />

<module name="TreeWalker">
<!-- needed for SuppressWarningsFilter -->
<module name="SuppressWarningsHolder" />

<module name="SuppressWarnings">
<property name="id" value="checkstyle:suppresswarnings"/>
</module>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New stuff to support suppression via annotations.

Comment on lines +3 to +5
/**
* Predefined resolution reasons.
*/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one it debatable but I wanted to make it clear that you're not limited to just these reasons, these are just some we pre-defined.

@justinabrahms justinabrahms merged commit 1a40c97 into main Nov 21, 2022
@justinabrahms justinabrahms deleted the chore/fix-jdk-11+ branch November 21, 2022 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants