Skip to content

Commit c44ca10

Browse files
Artem LabazinArtem Labazin
authored andcommitted
Initial commit
0 parents  commit c44ca10

18 files changed

Lines changed: 2222 additions & 0 deletions

.codestyle/checkstyle.xml

Lines changed: 414 additions & 0 deletions
Large diffs are not rendered by default.

.codestyle/findbugs.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Copyright 2018 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
19+
<FindBugsFilter>
20+
<Match>
21+
<Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER"/>
22+
</Match>
23+
<Match>
24+
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
25+
</Match>
26+
</FindBugsFilter>

.codestyle/license_for_check.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright 2018 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/

.codestyle/pmd.xml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Copyright 2018 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
19+
<ruleset name="Apulse PMD rule set"
20+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
21+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
23+
24+
<description>PMD Rules</description>
25+
26+
<rule ref="rulesets/java/basic.xml">
27+
<exclude name="AvoidUsingHardCodedIP" />
28+
</rule>
29+
30+
<rule ref="rulesets/java/braces.xml" />
31+
<rule ref="rulesets/java/clone.xml" />
32+
<rule ref="rulesets/java/unusedcode.xml"/>
33+
<rule ref="rulesets/java/finalizers.xml" />
34+
35+
36+
<rule ref="rulesets/java/imports.xml">
37+
<!-- Stupid rule... -->
38+
<exclude name="TooManyStaticImports" />
39+
</rule>
40+
41+
<rule ref="rulesets/java/codesize.xml" >
42+
<!-- See the explanation for TooManyMethods.-->
43+
<exclude name="TooManyFields" />
44+
<!-- Design is very hard to measure by numbers like this.-->
45+
<!-- The number and quality of dependencies might be a better indicator, -->
46+
<!-- and that requires a different tool.-->
47+
<exclude name="TooManyMethods" />
48+
<!-- See the explanation for TooManyMethods.-->
49+
<exclude name="ExcessivePublicCount" />
50+
<!-- Needs better understanding and proper configuration-->
51+
<exclude name="StdCyclomaticComplexity" />
52+
<!-- Needs better understanding and proper configuration-->
53+
<exclude name="ModifiedCyclomaticComplexity" />
54+
<!-- See the explanation for TooManyMethods.-->
55+
<exclude name="ExcessiveParameterList" />
56+
<!-- Too abstract rule -->
57+
<exclude name="CyclomaticComplexity" />
58+
</rule>
59+
60+
<rule ref="rulesets/java/design.xml">
61+
<!-- Sometimes important to avoid "DOS attack" but not as a general rule-->
62+
<exclude name="AvoidSynchronizedAtMethodLevel" />
63+
<!-- It's just extra effort to write and read the final keyword-->
64+
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal" />
65+
<!-- Maybe good idea if PMD could exclude null checks from this-->
66+
<exclude name="ConfusingTernary" />
67+
<!-- Statistical analysis is prone to givin false positives. Potential god classes-->
68+
<!-- most probably violate something else, too.-->
69+
<!-- And dependency analysis tools also help here.-->
70+
<exclude name="GodClass" />
71+
<!-- Switch is sometimes very readable-->
72+
<exclude name="TooFewBranchesForASwitchStatement"/>
73+
<!-- A static utility is a static utility even if it masquerades as something-->
74+
<!-- else by using the Singleton pattern-->
75+
<exclude name="UseUtilityClass" />
76+
<!-- This is good advice, but since it's violated so much in this project-->
77+
<!-- and the problem is not big (especially with good syntax colouring),-->
78+
<!-- we'll keep this ignored for now.-->
79+
<exclude name="AvoidReassigningParameters" />
80+
<!-- Good idea almost always, but not quite.-->
81+
<!--<exclude name="ReturnEmptyArrayRatherThanNull" />-->
82+
<!-- Sometimes one step at a time makes clearer code.-->
83+
<!-- Debugging is also easier if the return value is in a variable.-->
84+
<exclude name="UnnecessaryLocalBeforeReturn" />
85+
<!-- There are valid reasons for passing arrays (making it nullable for example)-->
86+
<exclude name="UseVarargs" />
87+
<!-- TODO explain what false positives this gives-->
88+
<exclude name="MissingBreakInSwitch" />
89+
<!-- TODO enable when all findings have been fixed-->
90+
<exclude name="UseLocaleWithCaseConversions" />
91+
<!-- It gives a lot of warnings on 'equals' method, fixing would decrease readability-->
92+
<exclude name="SimplifyBooleanReturns"/>
93+
<!--Gives false positive-->
94+
<exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
95+
<!-- Good rule but in practice to often suppressed -->
96+
<exclude name="PreserveStackTrace"/>
97+
98+
<exclude name="AccessorMethodGeneration"/>
99+
</rule>
100+
101+
<rule ref="rulesets/java/migrating.xml">
102+
<!-- The annotation is not as readable and there is no way to state which-->
103+
<!-- line should throw the exception and with what message-->
104+
<exclude name="JUnitUseExpected" />
105+
<!-- Main code is not junit code-->
106+
<exclude name="JUnit4TestShouldUseTestAnnotation" />
107+
</rule>
108+
109+
<rule ref="rulesets/java/naming.xml">
110+
<!-- Often good to start name with Abstract, but on the other hand this-->
111+
<!-- rule is a bit too much like Hungarian notation and I in interface names.-->
112+
<!-- Who cares if it's abstract or not when you are using it?-->
113+
<exclude name="AbstractNaming" />
114+
<!-- Opinion, for me a getter is not a command, it's a declarative-->
115+
<!-- data reference-->
116+
<exclude name="AvoidFieldNameMatchingMethodName" />
117+
<!-- Why should generics not be named properly, like all other things-->
118+
<!-- (well, except Windows filesystem roots)?-->
119+
<exclude name="GenericsNaming" />
120+
<!-- It can be long if it's the only way to make it good-->
121+
<exclude name="LongVariable" />
122+
<!-- It can be short if it's good-->
123+
<exclude name="ShortVariable" />
124+
<!-- TODO explain why.-->
125+
<exclude name="BooleanGetMethodName" />
126+
<!-- It can be short if it's good-->
127+
<exclude name="ShortClassName" />
128+
<!-- It can be short if it's good-->
129+
<exclude name="ShortMethodName" />
130+
</rule>
131+
132+
<rule ref="rulesets/java/optimizations.xml">
133+
<!-- Too many false hits. Optimization can't be done with static analysis.
134+
Besides, following this may encourage the antipattern of using too broad
135+
scope for stuff: -->
136+
<exclude name="AvoidInstantiatingObjectsInLoops" />
137+
<!-- Good principle but too verbose in practice: -->
138+
<exclude name="MethodArgumentCouldBeFinal" />
139+
<!-- Good principle and maybe sometimes even practical but not in this
140+
project: -->
141+
<exclude name="LocalVariableCouldBeFinal" />
142+
<exclude name="RedundantFieldInitializer" />
143+
</rule>
144+
145+
<rule ref="rulesets/java/strictexception.xml" >
146+
<!-- NPE communicates very cleary what is happening, it is not-->
147+
<!-- interesting who reports it (jvm or user code)-->
148+
<exclude name="AvoidThrowingNullPointerException" />
149+
<!-- TODO explain why-->
150+
<exclude name="AvoidCatchingGenericException" />
151+
<!-- TODO explain why-->
152+
<exclude name="AvoidThrowingRawExceptionTypes" />
153+
<!-- One valid case is to catch runtime, throw as such and after that-->
154+
<!-- catch Exception and wrap as runtime.-->
155+
<!-- Without the first all runtimes are unnecessarily wrapped.-->
156+
<exclude name="AvoidRethrowingException" />
157+
<!-- There are case which should throws generic exceptions -->
158+
<exclude name="SignatureDeclareThrowsException" />
159+
</rule>
160+
161+
<rule ref="rulesets/java/strings.xml" >
162+
<!-- Splitting to multiple lines is sometimes more readable.-->
163+
<!-- Besides, where's the proof that it affects performance?-->
164+
<exclude name="ConsecutiveAppendsShouldReuse" />
165+
</rule>
166+
</ruleset>

.gitignore

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
generated
2+
3+
*.class
4+
5+
# Mobile Tools for Java (J2ME)
6+
.mtj.tmp/
7+
8+
# Package Files #
9+
*.jar
10+
*.war
11+
*.ear
12+
13+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
14+
hs_err_pid*
15+
16+
*.pydevproject
17+
.metadata
18+
.gradle
19+
bin/
20+
tmp/
21+
*.tmp
22+
*.bak
23+
*.swp
24+
*~.nib
25+
local.properties
26+
.settings/
27+
.loadpath
28+
29+
# Eclipse Core
30+
.project
31+
32+
# External tool builders
33+
.externalToolBuilders/
34+
35+
# Locally stored "Eclipse launch configurations"
36+
*.launch
37+
38+
# CDT-specific
39+
.cproject
40+
41+
# JDT-specific (Eclipse Java Development Tools)
42+
.classpath
43+
44+
# Java annotation processor (APT)
45+
.factorypath
46+
47+
# PDT-specific
48+
.buildpath
49+
50+
# sbteclipse plugin
51+
.target
52+
53+
# TeXlipse plugin
54+
.texlipse
55+
56+
# STS (Spring Tool Suite)
57+
.springBeans
58+
59+
# Windows image file caches
60+
Thumbs.db
61+
ehthumbs.db
62+
63+
# Folder config file
64+
Desktop.ini
65+
66+
# Recycle Bin used on file shares
67+
$RECYCLE.BIN/
68+
69+
# Windows Installer files
70+
*.cab
71+
*.msi
72+
*.msm
73+
*.msp
74+
# Windows shortcuts
75+
*.lnk
76+
target/
77+
pom.xml.tag
78+
pom.xml.releaseBackup
79+
pom.xml.versionsBackup
80+
pom.xml.next
81+
release.properties
82+
dependency-reduced-pom.xml
83+
buildNumber.properties
84+
.mvn/timing.properties
85+
/.project
86+
/.settings/
87+
/.classpath
88+
*.classpath
89+
*.project
90+
*.classpath
91+
*.project
92+
/.apt_generated/
93+
94+
# IntelliJ Idea
95+
.idea/
96+
*.iml
97+
*.ipr
98+
*.iws
99+
out/
100+
101+
# Netbeans
102+
nbproject/private/
103+
build/
104+
nbbuild/
105+
dist/
106+
nbdist/
107+
nbactions.xml
108+
nb-configuration.xml
109+
.nb-gradle/
110+
111+
# Test output log file
112+
log*.txt*
113+
.DS_Store
114+
.vscode/
115+
116+
# Secure incomplete sub-projects
117+
client/
118+
server/

.settings.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Copyright 2018 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
19+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
22+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
23+
<servers>
24+
<server>
25+
<id>ossrh</id>
26+
<username>${env.SONATYPE_USERNAME}</username>
27+
<password>${env.SONATYPE_PASSWORD}</password>
28+
</server>
29+
</servers>
30+
<profiles>
31+
<profile>
32+
<id>ossrh</id>
33+
<activation>
34+
<activeByDefault>true</activeByDefault>
35+
</activation>
36+
<properties>
37+
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
38+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
39+
</properties>
40+
</profile>
41+
</profiles>
42+
</settings>

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
language: java
3+
4+
jdk:
5+
- oraclejdk8
6+
7+
install:
8+
mvn --settings .settings.xml install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip -B -V
9+
10+
script:
11+
mvn --settings .settings.xml clean verify -DskipTests=false -Dmaven.javadoc.skip=true -Dgpg.skip -B -U

0 commit comments

Comments
 (0)