Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #3229: update to java8 #3231

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 10 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ matrix:
- CMD7=" && if grep 'warning' output.log ; then exit 1; fi"
- CMD=$CMD1$CMD2$CMD3$CMD4$CMD5$CMD6$CMD7
- COVERAGE_CMD=""
# nemo.sonarqube.com (oraclejdk7)
- jdk: oraclejdk7
# nemo.sonarqube.com (oraclejd8)
- jdk: oraclejdk8
env:
- DESC="nemo.sonarqube.com"
- CMD1="mvn clean install cobertura:cobertura -Dcobertura.report.format=xml "
Expand Down Expand Up @@ -269,6 +269,7 @@ matrix:
- CMD3=" -Dcheckstyle.ant.skip=true -Dcheckstyle.skip=true -Dgpg.skip=true'"
- CMD=$CMD1$CMD2$CMD3
- COVERAGE_CMD=""

# unit tests in German locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests de" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=de -Duser.country=DE -XX:-UseSplitVerifier'" COVERAGE_CMD=""
Expand All @@ -293,29 +294,15 @@ matrix:
# unit tests in Turkish locale (oraclejdk8)
- jdk: oraclejdk8
env: DESC="tests tr" CMD="mvn clean integration-test failsafe:verify -DargLine='-Duser.language=tr -Duser.country=TR -XX:-UseSplitVerifier'" COVERAGE_CMD=""
# unit tests (openjdk7, oraclejdk7)
- jdk: openjdk7
env: DESC="tests" CMD="mvn clean integration-test failsafe:verify" COVERAGE_CMD=""
- jdk: oraclejdk7
env: DESC="tests" CMD="mvn clean integration-test failsafe:verify" COVERAGE_CMD=""
# checkstyle (openjdk7, oraclejdk7)
- jdk: openjdk7
env:
- DESC="checkstyle and sevntu-checkstyle"
- CMD="mvn clean verify -DskipTests -DskipITs -Dpmd.skip=true -Dfindbugs.skip=true -Dcobertura.skip=true"
- COVERAGE_CMD=""
- jdk: oraclejdk7
env:
- DESC="checkstyle and sevntu-checkstyle"
- CMD="mvn clean verify -DskipTests -DskipITs -Dpmd.skip=true -Dfindbugs.skip=true -Dcobertura.skip=true"
- COVERAGE_CMD=""

# No java8 support on Travis for MacOS
# Config is disabled till https://github.com/travis-ci/travis-ci/issues/2317
# MacOS verify (till cache is not working, we can not do verify)
- os: osx
env:
- DESC="MacOS verify, site, assembly"
- CMD="export JAVA_HOME=$(/usr/libexec/java_home) && mvn package -Dlinkcheck.skip=true && mvn package -Passembly "
- COVERAGE_CMD=""
#- os: osx
# env:
# - DESC="MacOS verify, site, assembly"
# - CMD="export JAVA_HOME=$(/usr/libexec/java_home) && mvn package -Dlinkcheck.skip=true && mvn package -Passembly "
# - COVERAGE_CMD=""

# Releasenotes generation - validaton
- jdk: oraclejdk8
Expand Down
14 changes: 7 additions & 7 deletions config/intellij-idea-inspections.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<option name="m_maxLength" value="64" />
</inspection_tool>
<inspection_tool class="Annotator" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="Anonymous2MethodRef" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Anonymous2MethodRef" enabled="false" level="ERROR" enabled_by_default="true" />
<inspection_tool class="AnonymousClassComplexity" enabled="true" level="ERROR" enabled_by_default="true">
<option name="m_limit" value="3" />
</inspection_tool>
Expand Down Expand Up @@ -424,10 +424,10 @@
<inspection_tool class="ContinueStatementWithLabelJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Contract" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ControlFlowStatementWithoutBraces" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Convert2Diamond" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Convert2Lambda" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Convert2MethodRef" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Convert2streamapi" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Convert2Diamond" enabled="false" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Convert2Lambda" enabled="false" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Convert2MethodRef" enabled="false" level="ERROR" enabled_by_default="true" />
<inspection_tool class="Convert2streamapi" enabled="false" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConvertAnnotations" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConvertJavadoc" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConvertOldAnnotations" enabled="true" level="ERROR" enabled_by_default="true" />
Expand Down Expand Up @@ -1063,7 +1063,7 @@
<option name="ignoreNonOverflowingCompileTimeConstants" value="true" />
</inspection_tool>
<inspection_tool class="InterceptionAnnotationWithoutRuntimeRetention" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="InterfaceMayBeAnnotatedFunctional" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="InterfaceMayBeAnnotatedFunctional" enabled="false" level="WARNING" enabled_by_default="true" />
<inspection_tool class="InterfaceNamingConvention" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_regex" value="[A-Z][A-Za-z\d]*" />
<option name="m_minLength" value="6" />
Expand Down Expand Up @@ -1708,7 +1708,7 @@
<option name="ignoreEmptySuperMethods" value="false" />
<option name="onlyReportWhenAnnotated" value="true" />
</inspection_tool>
<inspection_tool class="RemoveExplicitTypeArguments" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="RemoveExplicitTypeArguments" enabled="false" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ReplaceAllDot" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ReplaceAssignmentWithOperatorAssignment" enabled="true" level="ERROR" enabled_by_default="true">
<option name="ignoreLazyOperators" value="true" />
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
<maven.sevntu.checkstyle.plugin.version>1.20.0</maven.sevntu.checkstyle.plugin.version>
<tools.jar.version>1.7.0</tools.jar.version>
<tools.jar.path>${java.home}/../lib/tools.jar</tools.jar.path>
<java.version>1.7</java.version>
<java.version>1.8</java.version>
<checkstyle.version>6.18</checkstyle.version>
</properties>

Expand Down Expand Up @@ -1179,7 +1179,7 @@
<!-- SSLHandshakeException but page is opening -->
<excludedLink>http://www.sickboy.cz/checkstyle/</excludedLink>
<!-- Excluded due to Checkstyle's issue #549 until https://issues.apache.org/jira/browse/MJAVADOC-428 will be fixed -->
<excludedLink>http://docs.oracle.com/javase/7/docs/api/org/xml/sax/helpers.DefaultHandler.html?*</excludedLink>
<excludedLink>http://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers.DefaultHandler.html?*</excludedLink>
<!-- Excluded due to Maven Enforcer Plugin's issue #234: https://issues.apache.org/jira/browse/MENFORCER-234-->
<excludedLink>http://maven.apache.org/enforcer/maven-enforcer-plugin</excludedLink>
<!-- Excluded due to Maven Surefire Plugin's issue #1173: https://issues.apache.org/jira/browse/SUREFIRE-1173-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void testCustomAnnotation() throws Exception {

final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;

verify(checkConfig, getNonCompilablePath("InputSuppressWarningsHolder.java"), expected);
verify(checkConfig, getPath("InputSuppressWarningsHolder5.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public void testDefaultLambda() throws Exception {
"12:32: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 32),
"15:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5),
};
verify(checkConfig, getNonCompilablePath("InputLeftCurlyNewLineOptionWithLambda.java"),
verify(checkConfig, getPath("InputLeftCurlyNewLineOptionWithLambda.java"),
expected);
}

Expand All @@ -304,7 +304,7 @@ public void testNewLineOptionWithLambda() throws Exception {
"6:32: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 32),
"12:32: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 32),
};
verify(checkConfig, getNonCompilablePath("InputLeftCurlyNewLineOptionWithLambda.java"),
verify(checkConfig, getPath("InputLeftCurlyNewLineOptionWithLambda.java"),
expected);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void testSingleLineLambda() throws Exception {
final String[] expected = {
"7: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"),
};
verify(checkConfig, getNonCompilablePath("InputSingleLineLambda.java"), expected);
verify(checkConfig, getPath("InputSingleLineLambda.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void testDefaultMethodsInJava8()
createCheckConfig(DefaultComesLastCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig,
getNonCompilablePath("InputDefaultComesLast2.java"),
getPath("InputDefaultComesLast2.java"),
expected);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void testLambda()
final String[] expected = {
"32:16: " + "Variable 'result' should be declared final.",
};
verify(checkConfig, getNonCompilablePath("InputFinalLocalVariableNameLambda.java"),
verify(checkConfig, getPath("InputFinalLocalVariableNameLambda.java"),
expected);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testStaticVisibilityFromLambdas() throws Exception {
"219:55: " + getCheckMessage(MSG_KEY, "someObject"),
"227:52: " + getCheckMessage(MSG_KEY, "someObject"),
};
verify(checkConfig, getNonCompilablePath("InputHiddenFieldLambdas.java"), expected);
verify(checkConfig, getPath("InputHiddenFieldLambdas.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void testJava8() throws Exception {
createCheckConfig(IllegalInstantiationCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig,
getNonCompilablePath("InputIllegalInstantiation2.java"),
getPath("InputIllegalInstantiation2.java"),
expected);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testLambdaExpression() throws Exception {
final DefaultConfiguration checkConfig =
createCheckConfig(InnerAssignmentCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getNonCompilablePath("InputInnerAssignmentLambdaExpressions.java"),
verify(checkConfig, getPath("InputInnerAssignmentLambdaExpressions.java"),
expected);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testMethodsAndLambdas() throws Exception {
"41:5: " + getCheckMessage(MSG_KEY, 2, 1),
"49:57: " + getCheckMessage(MSG_KEY, 2, 1),
};
verify(checkConfig, getNonCompilablePath("InputReturnCountLambda.java"), expected);
verify(checkConfig, getPath("InputReturnCountLambda.java"), expected);
}

@Test
Expand All @@ -95,7 +95,7 @@ public void testLambdasOnly() throws Exception {
final String[] expected = {
"34:42: " + getCheckMessage(MSG_KEY, 3, 2),
};
verify(checkConfig, getNonCompilablePath("InputReturnCountLambda.java"), expected);
verify(checkConfig, getPath("InputReturnCountLambda.java"), expected);
}

@Test
Expand All @@ -108,15 +108,15 @@ public void testMethodsOnly() throws Exception {
"41:5: " + getCheckMessage(MSG_KEY, 4, 2),
"56:5: " + getCheckMessage(MSG_KEY, 3, 2),
};
verify(checkConfig, getNonCompilablePath("InputReturnCountLambda.java"), expected);
verify(checkConfig, getPath("InputReturnCountLambda.java"), expected);
}

@Test
public void testWithReturnOnlyAsTokens() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(ReturnCountCheck.class);
checkConfig.addAttribute("tokens", "LITERAL_RETURN");
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getNonCompilablePath("InputReturnCountLambda.java"), expected);
verify(checkConfig, getPath("InputReturnCountLambda.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testAnotherInputFile() throws Exception {
final String[] expected = {
"9:17: " + getCheckMessage(MSG_KEY, "clone", "super.clone"),
};
verify(checkConfig, getNonCompilablePath("InputSuperClone.java"), expected);
verify(checkConfig, getPath("InputSuperClone.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ public void testLambda1() throws Exception {
"180: " + getCheckMessage(MSG_CHILD_ERROR, "block", 11, 10),
"185: " + getCheckMessage(MSG_ERROR, "block rcurly", 7, 8),
};
verifyWarns(checkConfig, getNonCompilablePath("InputLambda1.java"), expected);
verifyWarns(checkConfig, getPath("InputLambda1.java"), expected);
}

@Test
Expand All @@ -1635,7 +1635,7 @@ public void testLambda2() throws Exception {
checkConfig.addAttribute("basicOffset", "4");
checkConfig.addAttribute("lineWrappingIndentation", "8");
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verifyWarns(checkConfig, getNonCompilablePath("InputLambda2.java"), expected);
verifyWarns(checkConfig, getPath("InputLambda2.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
*/
public class NewHandlerTest extends BaseCheckTestSupport {
@Override
protected String getNonCompilablePath(String filename) throws IOException {
return super.getNonCompilablePath("checks" + File.separator
protected String getPath(String filename) throws IOException {
return super.getPath("checks" + File.separator
+ "indentation" + File.separator + filename);
}

@Test
public void testInvalidLabel() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getNonCompilablePath("InputNewHandler.java"), expected);
verify(checkConfig, getPath("InputNewHandler.java"), expected);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testDefaultMethods()
final DefaultConfiguration checkConfig =
createCheckConfig(ModifierOrderCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getNonCompilablePath("InputModifier2.java"), expected);
verify(checkConfig, getPath("InputModifier2.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void testStaticMethodInInterface()
final DefaultConfiguration checkConfig =
createCheckConfig(RedundantModifierCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getNonCompilablePath("InputStaticModifierInInterface.java"), expected);
verify(checkConfig, getPath("InputStaticModifierInInterface.java"), expected);
}

@Test
Expand All @@ -99,7 +99,7 @@ public void testFinalInInterface()
final String[] expected = {
"5:9: " + getCheckMessage(MSG_KEY, "final"),
};
verify(checkConfig, getNonCompilablePath("InputFinalInDefaultMethods.java"), expected);
verify(checkConfig, getPath("InputFinalInDefaultMethods.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void testStaticMethodInInterface()
final DefaultConfiguration checkConfig =
createCheckConfig(ConstantNameCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getNonCompilablePath("InputStaticModifierInInterface.java"), expected);
verify(checkConfig, getPath("InputStaticModifierInInterface.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ public void testInnerClass() throws Exception {
@Test
public void testMethodReferences() throws Exception {
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getNonCompilablePath("InputMethodReferences3.java"), expected);
verify(checkConfig, getPath("InputMethodReferences3.java"), expected);
}

@Test
public void testMethodReferences2() throws Exception {
final String[] expected = {
"10:70: " + getCheckMessage(MSG_WS_FOLLOWED, ">"),
};
verify(checkConfig, getNonCompilablePath("InputGenericWhitespaceMethodRef.java"), expected);
verify(checkConfig, getPath("InputGenericWhitespaceMethodRef.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,7 @@ public void testMethodReference() throws Exception {
"9:40: " + getCheckMessage(MSG_KEY, "int"),
"10:61: " + getCheckMessage(MSG_KEY, "String"),
};
verify(checkConfig,
getNonCompilablePath("InputNoWhitespaceAfterMethodRef.java"),
expected);
verify(checkConfig, getPath("InputNoWhitespaceAfterMethodRef.java"), expected);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public void testNotAllowEmptyLambdaExpressionsByDefault() throws Exception {
"13:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"),
"13:42: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"),
};
verify(checkConfig, getNonCompilablePath("InputAllowEmptyLambdaExpressions.java"),
verify(checkConfig, getPath("InputAllowEmptyLambdaExpressions.java"),
expected);
}

Expand All @@ -375,7 +375,7 @@ public void testAllowEmptyLambdaExpressionsWithAllowEmptyLambdaParameter() throw
"13:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"),
"13:42: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"),
};
verify(checkConfig, getNonCompilablePath("InputAllowEmptyLambdaExpressions.java"),
verify(checkConfig, getPath("InputAllowEmptyLambdaExpressions.java"),
expected);
}

Expand All @@ -385,6 +385,6 @@ public void testWhitespaceAroundLambda() throws Exception {
"8:48: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "->"),
"8:50: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "->"),
};
verify(checkConfig, getNonCompilablePath("InputWhitespaceAroundLambda.java"), expected);
verify(checkConfig, getPath("InputWhitespaceAroundLambda.java"), expected);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public void testClassAstTree2() throws Exception {

@Test
public void testJava8ClassAstTree1() throws Exception {
verifyAst(getNonCompilablePath("InputRegressionJava8Class1Ast.txt"),
getNonCompilablePath("InputRegressionJava8Class1.java"));
verifyAst(getPath("InputRegressionJava8Class1Ast.txt"),
getPath("InputRegressionJava8Class1.java"));
}

@Test
Expand All @@ -85,8 +85,8 @@ public void testInterfaceAstTree2() throws Exception {

@Test
public void testJava8InterfaceAstTree1() throws Exception {
verifyAst(getNonCompilablePath("InputRegressionJava8Interface1Ast.txt"),
getNonCompilablePath("InputRegressionJava8Interface1.java"));
verifyAst(getPath("InputRegressionJava8Interface1Ast.txt"),
getPath("InputRegressionJava8Interface1.java"));
}

@Test
Expand Down