Commit Graph

4880 Commits

Author SHA1 Message Date
Allon Mureinik 754e669f76 org.apache.commons.lang3.concurrent.annotation package-info
Added package-info.java to the
org.apache.commons.lang3.concurrent.annotation package to solve a
checkstyle violation.
2017-03-12 17:41:50 +01:00
Allon Mureinik c121f03d5c Upgrade maven-checkstyle-plugin to 2.17
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.
2017-03-12 17:41:50 +01:00
Allon Mureinik 4259a706ab Replace tabs with spaces in DateUtils 2017-03-12 17:41:50 +01:00
Allon Mureinik ba7c788042 Remove unused SystemUtils import from ExceptionUtils 2017-03-12 17:41:49 +01:00
Allon Mureinik 1f8479a84b Apply JavaDoc checkstyle only to public methods
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.
2017-03-12 17:41:49 +01:00
pascalschumacher 4282efae5f LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods
fix error in javadoc

(side effects: close #221, close #197)
2017-03-12 17:33:53 +01:00
pascalschumacher 3ce7f9eecf revert "LANG-1270: Add StringUtils#isAnyNotEmpty and #isAnyNotBlank" and add "LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods" instead 2017-03-12 17:21:27 +01:00
Martin 6b9c331588 LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods 2017-03-12 17:07:31 +01:00
pascalschumacher 31a9fa0cce ClassUtilsTest: some tests can simplified because lang does not support java versions without autoboxing anymore 2017-03-12 13:44:03 +01:00
pascalschumacher 5482ce61b0 ClassUtilsTest#test_isAssignable_ClassArray_ClassArray: add explicit cast to avoid compiler warning and remove commented out code 2017-03-12 13:13:35 +01:00
pascalschumacher f0f896ee60 AbstractExceptionContextTest#testJavaSerialization: remove unnecessary SuppressWarnings annotation 2017-03-12 13:10:34 +01:00
pascalschumacher 05bf337fc0 StringUtils#indexOfAny, #lastIndexOfAny: remove unused local variable 2017-03-12 13:06:53 +01:00
Bruno P. Kinoshita ee19f8247c Fix checkstyle xml by closing module tag 2017-03-09 22:03:56 +13:00
pascalschumacher d43e1d0198 add changes.xml entry for LANG-1314 2017-03-06 19:27:36 +01:00
Allon Mureinik 0ba25aa97b Add javadoc creation to Travis CI (closes #252) 2017-03-06 19:27:36 +01:00
pascalschumacher 7337507a79 LANG-1314: Fix javadoc creation on with Java 8
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.
2017-03-06 19:27:36 +01:00
pascalschumacher 0f5c769e0c LANG-1314: Fix javadoc creation on with Java 8
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>
2017-03-06 19:27:36 +01:00
pascalschumacher a0f9db2831 LANG-1314: Fix javadoc creation on with Java 8
Add @param for <T> in ArrayUtils#insert
2017-03-06 19:27:36 +01:00
Allon Mureinik e5ed4ffe5d Checkstyle for long literals (closes #249)
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.
2017-03-05 13:05:47 +01:00
Allon Mureinik 6597c19652 Use long literals (closes #248)
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.
2017-03-04 10:07:11 +01:00
Allon Mureinik 4670a941be Use uppercase L for long literals
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.
2017-03-04 10:06:53 +01:00
pascalschumacher 42cf674026 add changes.xml entry for LANG-1265 2017-02-28 23:41:58 +01:00
pascalschumacher 72476ff462 LANG-1265: Build failures when building with Java 9 EA (closes #244)
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.
2017-02-28 23:37:26 +01:00
Allon Mureinik c79e6fb8f9 JUnit imports (closes #247)
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.
2017-02-28 23:33:26 +01:00
Allon Mureinik 98fa164cd8 DateUtilsTest asserts (closes #246)
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.
2017-02-27 23:31:35 +01:00
Allon Mureinik 44516f77ec Use foreach loop for arrays (closes #245)
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.
2017-02-24 22:52:13 +01:00
Allon Mureinik 36b00f803a Fix JsonToStringStyleTest.NestingPerson javadoc (closes #243)
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.
2017-02-24 17:20:50 +01:00
Andrii 914844e1b2 EnumUtilsTest: fix spaces between enum constants (closes #241) 2017-02-22 23:22:31 +01:00
Allon Mureinik 8767cd4f1a Fix FastDateParser#getStrategy(char, int, Calendar) javadoc (closes #242)
The javadoc refers to a formatField parameter, which the method doesn't
have.
Reading the description and the method's code, this documentation
clearly refers to the f parameter.

This patch fixes the javadoc and aligns it with the method's parameters.
2017-02-22 23:16:03 +01:00
pascalschumacher 4bd982d1a1 LANG-1312: LocaleUtils#toLocale does not support language followed by UN M.49 numeric-3 area code (closes #239) 2017-02-21 21:13:45 +01:00
Allon Mureinik a6443e146f Remove redundant semicolons from enums (closes #240)
While enums allow ending the member list in a semicolon(;), it's
redundant. Some enums in the codebase use a semicolon in the end, and
some do not.

This patch standardizes the codebase's enum and cleans up the code by
removing these semicolons.
2017-02-21 19:58:49 +01:00
Allon Mureinik a64153a371 Validate's String.format without arguments (closes #238)
While calling String.format("some string") without any additional
arguments is not technically wrong, it's redundant, as it just
returns the same string.

Removing these calls and just using the string instead both cleans up
the code and offers a (very slight) performance gain.
2017-02-20 23:18:50 +01:00
Tobias Gesellchen 954ade4c1a (doc) Use the full alphabet for the well-known example text.
This change adds the missing `s` character.

Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
2017-02-18 14:49:42 +01:00
pascalschumacher 1661e5519c LANG-1311: TypeUtils.toString() doesn't handle primitive and Object arrays correctly
apply patch by Aaron Digulla
2017-02-17 18:32:32 +01:00
Sebb 30c85ad053 Use StringBuilders instead of StringBuffers
(A couple of instances were overlooked)
This fixes #236
2017-02-16 18:59:01 +00:00
Allon Mureinik ce1bd5785d Remove redundant casts (closes #235)
Remove redundant casts throughout the codebase to make it cleaner and easier to read.
2017-02-14 23:10:56 +01:00
pascalschumacher 5bdf0a938a ObjectUtilsTest#testIdentityToStringAppendable: fail test if IOException is thrown 2017-02-14 22:59:12 +01:00
pascalschumacher aaeb4c621a ObjectUtilsTest: remove commented-out code 2017-02-14 22:51:45 +01:00
Bruno P. Kinoshita b715d18f09 Merge branch 'pr/228'
This closes #228 thanks @andyklimczak
2017-02-12 10:34:31 +13:00
Bruno P. Kinoshita 21810dc920 Merge branch 'pr/234'
This closes #234 thanks @mureinik
2017-02-12 10:28:26 +13:00
Allon Mureinik 07811434b7 ObjectUtilsTest: collapse empty catch blocks
This patch employs Java 7's syntax to catch multiple exceptions in
the same block with the | operator to make ObjectUtilsTest's code
cleaner and easier to read.
2017-02-11 21:35:16 +02:00
Sebastian Kürten 04a2a4b456 Fix a few broken @literal tags (closes #233)
The Javadoc of SystemDefaultsSwitch contains some broken @literal tags.
Instead of {@literal @} to insert a '@' into the HTML, {@literal@}
without the space is used, which does not work.
2017-02-05 12:46:43 +01:00
Sebastian Kürten ebcef2d16a Fix a number of Javadoc typos (closes #232) 2017-02-03 20:00:04 +01:00
peleghila ab25f67348 Fix copy-paste error in CharUtilsTest#testIsAsciiPrintable_char (closes #230)
Line 238 has copy paste error from testIsAscii_char
2017-02-01 20:03:48 +01:00
stonio 857e0de492 Update RELEASE-NOTES.txt fix typo "vom" (closes #229)
Replace `vom` by `from`.
2017-01-26 18:56:51 +01:00
Andy Klimczak 00bf35cdd9 Increase test coverage
CharRangeTest -> 100%
RandomUtilsTest -> 100%
StringEscapeUtilsTest -> 100%
StringUtils -> 99%
2017-01-21 02:50:50 -05:00
pascalschumacher 86a082e8be MultilineRecursiveToStringStyle: made private field indent static 2017-01-20 18:48:13 +01:00
pascalschumacher bd7788b384 JsonToStringStyle: improve private constant name and remove wrong comment 2017-01-20 18:46:34 +01:00
pascalschumacher 044367419d JsonToStringStyle: private field FIELD_NAME_PREFIX can be static 2017-01-20 18:39:16 +01:00
pascalschumacher 928e74f73f LANG-1295: ArrayUtils.toArray(T... items) has unsafe use of varargs
remove SafeVarargs annotation
2017-01-20 17:49:11 +01:00