Skip to content

Commit 6de7a48

Browse files
author
Artem Labazin
committed
the new update
1 parent 9095f5e commit 6de7a48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+487
-120
lines changed

.codestyle/checkstyle.xml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ limitations under the License.
6464
<module name="UniqueProperties"/>
6565

6666
<module name="SuppressWarningsFilter" />
67+
<module name="LineLength">
68+
<property name="max" value="120"/>
69+
</module>
6770

6871

6972
<module name="TreeWalker">
7073
<module name="SuppressWarningsHolder" />
7174

7275
<!-- Checks for Javadoc comments. -->
7376
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
74-
<!-- <module name="JavadocMethod">
77+
<module name="JavadocMethod">
7578
<property name="scope" value="protected"/>
7679
<property name="allowedAnnotations" value="Override, Test"/>
7780
<property name="allowThrowsTagsForSubclasses" value="true"/>
@@ -90,15 +93,14 @@ limitations under the License.
9093
<module name="SummaryJavadoc">
9194
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
9295
</module>
93-
<module name="JavadocParagraph"/>
9496
<module name="SingleLineJavadoc">
9597
<property name="ignoreInlineTags" value="false"/>
9698
</module>
9799
<module name="AtclauseOrder">
98100
<property name="tagOrder" value="@param, @return, @throws, @see, @since, @author, @version, @deprecated"/>
99101
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
100102
</module>
101-
<module name="NonEmptyAtclauseDescription"/> -->
103+
<module name="NonEmptyAtclauseDescription"/>
102104

103105

104106
<!-- Checks for Naming Conventions. -->
@@ -183,9 +185,6 @@ limitations under the License.
183185
<module name="AnonInnerLength">
184186
<property name="max" value="20"/>
185187
</module>
186-
<module name="LineLength">
187-
<property name="max" value="140"/>
188-
</module>
189188
<module name="MethodLength">
190189
<property name="tokens" value="METHOD_DEF"/>
191190
<property name="max" value="60"/>
@@ -234,7 +233,7 @@ limitations under the License.
234233
<module name="OperatorWrap">
235234
<property name="option" value="NL"/>
236235
<property name="tokens"
237-
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LT, MINUS, MOD, NOT_EQUAL, QUESTION, SL, SR, STAR"/>
236+
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LE, LITERAL_INSTANCEOF, LT, MINUS, MOD, NOT_EQUAL, QUESTION, SL, SR, STAR"/>
238237
</module>
239238
<module name="ParenPad"/>
240239
<module name="SeparatorWrap">
@@ -347,7 +346,6 @@ limitations under the License.
347346
<module name="OneStatementPerLine"/>
348347
<module name="PackageDeclaration"/>
349348
<module name="ParameterAssignment"/>
350-
<module name="SimplifyBooleanExpression"/>
351349
<module name="SimplifyBooleanReturn"/>
352350
<module name="StringLiteralEquality"/>
353351
<module name="SuperClone"/>
@@ -379,11 +377,10 @@ limitations under the License.
379377
<property name="caseIndent" value="0"/>
380378
<property name="throwsIndent" value="0"/>
381379
<property name="lineWrappingIndentation" value="4"/>
382-
<property name="arrayInitIndent" value="4"/>
380+
<property name="arrayInitIndent" value="2"/>
383381
<property name="forceStrictCondition" value="false"/>
384382
</module>
385383
<module name="OuterTypeFilename"/>
386-
<module name="TodoComment"/>
387384
<module name="UncommentedMain">
388385
<property name="excludedClasses" value="\.Main$"/>
389386
</module>

.codestyle/pmd.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@ limitations under the License.
2424
<description>PMD Rules</description>
2525

2626
<rule ref="category/java/bestpractices.xml">
27+
<exclude name="AvoidPrintStackTrace" />
28+
<exclude name="SystemPrintln" />
29+
<exclude name="UseVarargs" />
2730
</rule>
2831
<rule ref="category/java/codestyle.xml">
32+
<exclude name="LinguisticNaming" />
2933
<exclude name="AbstractNaming" />
3034
<exclude name="AtLeastOneConstructor" />
3135
<exclude name="AvoidPrefixingMethodParameters" />
36+
<exclude name="ClassNamingConventions" />
3237
<exclude name="CommentDefaultAccessModifier" />
3338
<exclude name="DefaultPackage" />
3439
<exclude name="FieldDeclarationsShouldBeAtStartOfClass" />
3540
<exclude name="LocalVariableCouldBeFinal" />
3641
<exclude name="LongVariable" />
3742
<exclude name="MethodArgumentCouldBeFinal" />
3843
<exclude name="OnlyOneReturn" />
44+
<exclude name="PrematureDeclaration" />
3945
<exclude name="ShortClassName" />
4046
<exclude name="ShortMethodName" />
4147
<exclude name="ShortVariable" />
@@ -46,10 +52,12 @@ limitations under the License.
4652
<exclude name="AvoidCatchingGenericException" />
4753
<exclude name="AvoidRethrowingException" />
4854
<exclude name="AvoidThrowingNullPointerException" />
55+
<exclude name="CyclomaticComplexity" />
4956
<exclude name="ExcessiveImports" />
5057
<exclude name="ExcessivePublicCount" />
5158
<exclude name="LawOfDemeter" />
5259
<exclude name="LoosePackageCoupling" />
60+
<exclude name="SimplifyBooleanExpressions" />
5361
<exclude name="TooManyFields" />
5462
<exclude name="TooManyMethods" />
5563

@@ -63,14 +71,18 @@ limitations under the License.
6371
<exclude name="CommentRequired" />
6472
</rule>
6573
<rule ref="category/java/errorprone.xml">
66-
<exclude name="AvoidFieldNameMatchingTypeName" />
6774
<exclude name="AvoidFieldNameMatchingMethodName" />
75+
<exclude name="AvoidFieldNameMatchingTypeName" />
6876
<exclude name="BeanMembersShouldSerialize" />
77+
<exclude name="CompareObjectsWithEquals" />
6978
<exclude name="DataflowAnomalyAnalysis" />
79+
<exclude name="DontImportSun" />
7080
<exclude name="MissingBreakInSwitch" />
7181
</rule>
7282
<rule ref="category/java/multithreading.xml">
73-
<exclude name="AvoidUsingVolatile" />
83+
<exclude name="AvoidSynchronizedAtMethodLevel" />
84+
<exclude name="DoNotUseThreads" />
85+
<exclude name="UseConcurrentHashMap" />
7486
</rule>
7587
<rule ref="category/java/performance.xml">
7688
<exclude name="AvoidUsingShortType" />

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1212
- Add more tests.
1313
- Add `JavaDoc`.
1414

15+
## [1.17.0](https://github.com/appulse-projects/utils-java/releases/tag/1.17.0) - 2019-12-09
16+
17+
### Added
18+
19+
- `BytesInputStream` implementation of `InputStream` with `Bytes` internal;
20+
- `BytesOutputStream` implementation of `OutputStream` with `Bytes` internal.
21+
22+
### Changed
23+
24+
- Updated plugins;
25+
- Updated `pmd` and `checkstyle` rules;
26+
- Correct *Javadoc*s.
27+
1528
## [1.16.4](https://github.com/appulse-projects/utils-java/releases/tag/1.16.4) - 2019-12-05
1629

1730
### Changed

pom.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ limitations under the License.
2424

2525
<groupId>io.appulse</groupId>
2626
<artifactId>utils-java</artifactId>
27-
<version>1.16.4</version>
27+
<version>1.17.0</version>
2828
<packaging>jar</packaging>
2929

3030
<properties>
@@ -66,7 +66,7 @@ limitations under the License.
6666
<url>https://github.com/appulse-projects/utils-java</url>
6767
<connection>scm:git:https://github.com/appulse-projects/utils-java.git</connection>
6868
<developerConnection>scm:git:https://github.com/appulse-projects/utils-java.git</developerConnection>
69-
<tag>1.16.4</tag>
69+
<tag>1.17.0</tag>
7070
</scm>
7171

7272
<distributionManagement>
@@ -194,13 +194,14 @@ limitations under the License.
194194
<plugin>
195195
<groupId>pl.project13.maven</groupId>
196196
<artifactId>git-commit-id-plugin</artifactId>
197-
<version>3.0.0</version>
197+
<version>4.0.0</version>
198198
<executions>
199199
<execution>
200-
<id>git-infos</id>
200+
<id>get-the-git-infos</id>
201201
<goals>
202202
<goal>revision</goal>
203203
</goals>
204+
<phase>initialize</phase>
204205
</execution>
205206
</executions>
206207
<configuration>
@@ -224,7 +225,7 @@ limitations under the License.
224225
<plugin>
225226
<groupId>org.apache.maven.plugins</groupId>
226227
<artifactId>maven-javadoc-plugin</artifactId>
227-
<version>3.1.0</version>
228+
<version>3.1.1</version>
228229
<configuration>
229230
<additionalOptions>-Xdoclint:none</additionalOptions>
230231
<additionalparam>-Xdoclint:none</additionalparam>
@@ -301,7 +302,7 @@ limitations under the License.
301302
<plugin>
302303
<groupId>com.github.spotbugs</groupId>
303304
<artifactId>spotbugs-maven-plugin</artifactId>
304-
<version>3.1.11</version>
305+
<version>3.1.12.2</version>
305306
<configuration>
306307
<effort>Max</effort>
307308
<threshold>Low</threshold>
@@ -353,7 +354,7 @@ limitations under the License.
353354
<dependency>
354355
<groupId>com.puppycrawl.tools</groupId>
355356
<artifactId>checkstyle</artifactId>
356-
<version>8.21</version>
357+
<version>8.24</version>
357358
</dependency>
358359
</dependencies>
359360
<executions>

src/main/java/io/appulse/utils/AnnotationUtils.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
/**
3232
* Different annotation helpers.
3333
*
34-
* @author Artem Labazin
3534
* @since 1.7.0
35+
* @author Artem Labazin
3636
*/
3737
public final class AnnotationUtils {
3838

@@ -62,6 +62,8 @@ public final class AnnotationUtils {
6262
*
6363
* @param annotationType the annotation type to look for, both locally and as a meta-annotation
6464
*
65+
* @param <T> the annotation type.
66+
*
6567
* @return the first matching annotation
6668
*
6769
* @since 1.7.0
@@ -89,6 +91,8 @@ public static <T extends Annotation> Optional<T> findAnnotation (Class<?> clazz,
8991
*
9092
* @param annotationType the annotation type to look for, both locally and as a meta-annotation
9193
*
94+
* @param <T> the annotation type.
95+
*
9296
* @return the first matching annotation
9397
*
9498
* @since 1.7.0
@@ -118,6 +122,8 @@ public static <T extends Annotation> Optional<T> findAnnotation (AnnotatedElemen
118122
*
119123
* @param annotationType the annotation type to look for
120124
*
125+
* @param <T> the annotation type.
126+
*
121127
* @return the first matching annotation
122128
*
123129
* @since 1.7.0
@@ -141,7 +147,8 @@ public static boolean isInJavaLangAnnotationPackage (Annotation annotation) {
141147
}
142148

143149
/**
144-
* Determine if the {@link Annotation} with the supplied name is defined in the core JDK {@code java.lang.annotation} package.
150+
* Determine if the {@link Annotation} with the supplied name is defined in
151+
* the core JDK {@code java.lang.annotation} package.
145152
*
146153
* @param annotationType the annotation type to check
147154
*
@@ -154,7 +161,8 @@ public static boolean isInJavaLangAnnotationPackage (Class<? extends Annotation>
154161
}
155162

156163
/**
157-
* Determine if the {@link Annotation} with the supplied name is defined in the core JDK {@code java.lang.annotation} package.
164+
* Determine if the {@link Annotation} with the supplied name is defined in
165+
* the core JDK {@code java.lang.annotation} package.
158166
*
159167
* @param annotationType the name of the annotation type to check
160168
*

src/main/java/io/appulse/utils/Bytes.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* This interface provides an abstract view for a primitive byte
2525
* arrays ({@code byte[]}).
2626
*
27-
* @author Artem Labazin
2827
* @since 1.12.0
28+
* @author Artem Labazin
2929
*/
3030
@SuppressWarnings({
3131
"PMD.ExcessiveClassLength",
@@ -90,7 +90,9 @@ static Bytes copy (ByteBuffer buffer) {
9090
}
9191

9292
/**
93-
* Create a new {@link Bytes} instance with a fixed size content
93+
* Create a new {@link Bytes} instance with a fixed size content.
94+
*
95+
* @param size the size of a new buffer.
9496
*
9597
* @return the new {@link Bytes} instance
9698
*/
@@ -1638,6 +1640,8 @@ static Bytes resizableArray (int initialSize) {
16381640

16391641
/**
16401642
* Returns the number of bytes (octets) this buffer can contain.
1643+
*
1644+
* @return the number of bytes.
16411645
*/
16421646
int capacity ();
16431647

@@ -1766,7 +1770,7 @@ static Bytes resizableArray (int initialSize) {
17661770

17671771
/**
17681772
* Returns the copy of range the buffer's back byte array from
1769-
* <b>0</b> till <b>writeIndex</t>.
1773+
* <b>0</b> till <b>writeIndex</b>.
17701774
* <p>
17711775
* Modifications to this buffer's content may NOT cause the
17721776
* returned array's content to be modified, and vice versa.

0 commit comments

Comments
 (0)