Skip to content

Commit 1a40c97

Browse files
authored
chore: fix issues with compilation on later JDKs (#178)
chore: fix compile/lint issues on 8+ Signed-off-by: Todd Baert <[email protected]> Signed-off-by: Todd Baert <[email protected]>
1 parent 1b59dc4 commit 1a40c97

29 files changed

+94
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class MyClass {
5656
For complete documentation, visit: https://docs.openfeature.dev/docs/category/concepts
5757

5858
## Requirements
59-
- Java 8+
59+
- Java 8+ (compiler target is 1.8)
6060

6161
## Installation
6262

checkstyle-suppressions.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
3+
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd">
4+
5+
<suppressions>
6+
<!-- checkstyle suppressions can go here -->
7+
</suppressions>

checkstyle.xml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<property name="optional" value="true"/>
3535
</module>
3636

37+
3738
<!-- Checks for whitespace -->
3839
<!-- See http://checkstyle.org/config_whitespace.html -->
3940
<module name="FileTabCharacter">
@@ -46,7 +47,23 @@
4647
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
4748
</module>
4849

50+
<module name="SuppressWarningsFilter" />
51+
4952
<module name="TreeWalker">
53+
<!-- needed for SuppressWarningsFilter -->
54+
<module name="SuppressWarningsHolder" />
55+
56+
<module name="SuppressWarnings">
57+
<property name="id" value="checkstyle:suppresswarnings"/>
58+
</module>
59+
60+
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
61+
<module name="SuppressionXpathFilter">
62+
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
63+
default="checkstyle-xpath-suppressions.xml" />
64+
<property name="optional" value="true"/>
65+
</module>
66+
5067
<module name="OuterTypeFilename"/>
5168
<module name="IllegalTokenText">
5269
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
@@ -223,7 +240,7 @@
223240
<property name="arrayInitIndent" value="4"/>
224241
</module>
225242
<module name="AbbreviationAsWordInName">
226-
<property name="ignoreFinal" value="false"/>
243+
<property name="ignoreFinal" value="true"/>
227244
<property name="allowedAbbreviations" value="API" />
228245
<property name="allowedAbbreviationLength" value="1"/>
229246
<property name="tokens"
@@ -292,6 +309,12 @@
292309
<property name="allowedAnnotations" value="Override, Test"/>
293310
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF"/>
294311
</module>
312+
<module name="MissingJavadocType">
313+
<property name="scope" value="protected"/>
314+
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
315+
RECORD_DEF, ANNOTATION_DEF"/>
316+
<property name="excludeScope" value="nothing"/>
317+
</module>
295318
<module name="MethodName">
296319
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
297320
<message key="name.invalidPattern"
@@ -306,12 +329,5 @@
306329
<module name="CommentsIndentation">
307330
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
308331
</module>
309-
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
310-
<module name="SuppressionXpathFilter">
311-
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
312-
default="checkstyle-xpath-suppressions.xml" />
313-
<property name="optional" value="true"/>
314-
</module>
315332
</module>
316333
</module>
317-

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@
369369
<version>3.4.1</version>
370370
<configuration>
371371
<failOnWarnings>true</failOnWarnings>
372+
<doclint>all,-missing</doclint> <!-- ignore missing javadoc, these are enforced with more customizability in the checkstyle plugin -->
372373
</configuration>
373374
<executions>
374375
<execution>

spotbugs-exclusions.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
<Bug pattern="EI_EXPOSE_REP2"/>
2828
</And>
2929

30-
31-
32-
3330
<!-- Test class that should be excluded -->
3431
<Match>
3532
<Class name="dev.openfeature.sdk.DoSomethingProvider"/>

src/main/java/dev/openfeature/sdk/BooleanHook.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package dev.openfeature.sdk;
22

3+
/**
4+
* {@inheritDoc}
5+
*/
36
public interface BooleanHook extends Hook<Boolean> {
47

58
@Override

src/main/java/dev/openfeature/sdk/DoubleHook.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package dev.openfeature.sdk;
22

3+
/**
4+
* {@inheritDoc}
5+
*/
36
public interface DoubleHook extends Hook<Double> {
47

58
@Override
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.openfeature.sdk;
22

3+
@SuppressWarnings("checkstyle:MissingJavadocType")
34
public enum ErrorCode {
45
PROVIDER_NOT_READY, FLAG_NOT_FOUND, PARSE_ERROR, TYPE_MISMATCH, TARGETING_KEY_MISSING, INVALID_CONTEXT, GENERAL
56
}

src/main/java/dev/openfeature/sdk/FlagEvaluationDetails.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class FlagEvaluationDetails<T> implements BaseEvaluation<T> {
2020

2121
/**
2222
* Generate detail payload from the provider response.
23+
*
2324
* @param providerEval provider response
2425
* @param flagKey key for the flag being evaluated
2526
* @param <T> type of flag being returned

src/main/java/dev/openfeature/sdk/FlagEvaluationOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import lombok.Builder;
88
import lombok.Singular;
99

10+
@SuppressWarnings("checkstyle:MissingJavadocType")
1011
@lombok.Value
1112
@Builder
1213
public class FlagEvaluationOptions {

0 commit comments

Comments
 (0)