Currently, checkstyle is only run as part of the reporting phase, and
it's up to the developer to check the report manually.
This patch adds the checkstyle configuration to the build plugins so
it can be used to check the code (as opposed to just generate a
report of the failures) and adds it to Travis CI's configuration so
every new patch will be automatically checked against it.
This patch upgrades maven-checkstyle-plugin to the latest available
version, 2.17.
This is done in order to consume a fix for checkstyle wrongfully
reporting an error if the @return javadoc tag was used in an
annotation type, as it is in Guarded (line 36).
Note that checkstyle has removed the RedundantThrows check (see
discussion at https://github.com/checkstyle/checkstyle/issues/473),
so it was removed from the project's checkstyle.xml configuration.
The defacto style of the project requires Javadoc for public methods
only, but the checkstyle Javadoc check defaults to requiring them even
for private methods, generating 46 errors.
This patch sets the checkstyle Javadoc check's scope to public to clean
up the checkstyle report so it can be enabled in the CI.
If we wish to reset the check to a laxer scope, the aforementioned
errors should be fixed first.
Remove </p> tag from Computable's javadoc
The standard javadoc doclet does not allow self closing tags (such as
</p>). This patch removes such a tag from Computable's javadoc, as it's
redundant anyway, as it's only used to create spaces between two
existing paragraphs.
Fix StirngUtils </p> tags in javadoc
The paragraph
</p>Whitespace is defined by {@link Character#isWhitespace(char)}.</p>
appears in several places in the javadoc (presumably, copy-pasted from
the original one to the others). This is obviously a mistake, as a
paragraph should start with <p>, not with </p>.
This patch fixes all the occurrences of this paragraph to the proper
form:
<p>Whitespace is defined by {@link Character#isWhitespace(char)}.</p>
PR #248 corrected all the long literals to use the upper case L
notation.
This patch finishes the job as per the discussion there, and adds a
checktysle check to ensure no code that introduces long literals with
lowercase l are introduced.
This patch replaces int literals that were cast to longs (e.g.,
"(long) 1)" with long literals (e.g., "1L"), making the code cleaner
and easier to maintain.
Long literals can be specified by a lower case l (e.g., 1l) or by an
uppercase one (e.g., 1L).
This patch converts all existing long literals to use the uppercase L,
as in some terminals, the lowercase l and the 1 characters are
graphically similar, leading to possible confusions.
Fix build on Java 9 Build 157 by adding a java-9 maven profile. This is activated by default on Java 9 and opens up java.base classes for reflection, which makes all unit tests pass.
The junit.framework package has been deprecated, and should no longer
be used.
This patch fixes the one remaining import from it to statically import
org.junit.Assert.assertNull instead.
Use JUnit's assertFalse for assertions with conditions instead of
re-implementing the logic here by testing the condition and throwing an
AssertionFailureException if the condition is met.
Since the project no longer supports Java versions older than 6, it's
safe to use the enhanced for loop syntax introduced in Java 5.
This patch employs this syntax where possible to clean up the code.
A {@link} javadoc can only reference a resolvable class name. The
{@link} tag in NestingPerson's javadoc is thus broken, as it directly
references JsonToStringStyle without qualifying it with the enclosing
ToStringStyle class.
This patch adds the enclosing class to the javadoc, thus "unbreaking"
the reference.