Issue #3229: resources were moved to compilable area
This commit is contained in:
parent
015fa7f3e7
commit
60f3a92c22
|
|
@ -87,7 +87,7 @@ public class SuppressWarningsHolderTest extends BaseCheckTestSupport {
|
|||
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
verify(checkConfig, getNonCompilablePath("InputSuppressWarningsHolder.java"), expected);
|
||||
verify(checkConfig, getPath("InputSuppressWarningsHolder5.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ public class LeftCurlyCheckTest extends BaseCheckTestSupport {
|
|||
"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);
|
||||
}
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ public class LeftCurlyCheckTest extends BaseCheckTestSupport {
|
|||
"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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public class NeedBracesCheckTest extends BaseCheckTestSupport {
|
|||
final String[] expected = {
|
||||
"7: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"),
|
||||
};
|
||||
verify(checkConfig, getNonCompilablePath("InputSingleLineLambda.java"), expected);
|
||||
verify(checkConfig, getPath("InputSingleLineLambda.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class DefaultComesLastCheckTest extends BaseCheckTestSupport {
|
|||
createCheckConfig(DefaultComesLastCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig,
|
||||
getNonCompilablePath("InputDefaultComesLast2.java"),
|
||||
getPath("InputDefaultComesLast2.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ public class FinalLocalVariableCheckTest
|
|||
final String[] expected = {
|
||||
"32:16: " + "Variable 'result' should be declared final.",
|
||||
};
|
||||
verify(checkConfig, getNonCompilablePath("InputFinalLocalVariableNameLambda.java"),
|
||||
verify(checkConfig, getPath("InputFinalLocalVariableNameLambda.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class HiddenFieldCheckTest
|
|||
"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
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class IllegalInstantiationCheckTest
|
|||
createCheckConfig(IllegalInstantiationCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig,
|
||||
getNonCompilablePath("InputIllegalInstantiation2.java"),
|
||||
getPath("InputIllegalInstantiation2.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class InnerAssignmentCheckTest
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(InnerAssignmentCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputInnerAssignmentLambdaExpressions.java"),
|
||||
verify(checkConfig, getPath("InputInnerAssignmentLambdaExpressions.java"),
|
||||
expected);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public class ReturnCountCheckTest extends BaseCheckTestSupport {
|
|||
"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
|
||||
|
|
@ -95,7 +95,7 @@ public class ReturnCountCheckTest extends BaseCheckTestSupport {
|
|||
final String[] expected = {
|
||||
"34:42: " + getCheckMessage(MSG_KEY, 3, 2),
|
||||
};
|
||||
verify(checkConfig, getNonCompilablePath("InputReturnCountLambda.java"), expected);
|
||||
verify(checkConfig, getPath("InputReturnCountLambda.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -108,7 +108,7 @@ public class ReturnCountCheckTest extends BaseCheckTestSupport {
|
|||
"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
|
||||
|
|
@ -116,7 +116,7 @@ public class ReturnCountCheckTest extends BaseCheckTestSupport {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class SuperCloneCheckTest
|
|||
final String[] expected = {
|
||||
"9:17: " + getCheckMessage(MSG_KEY, "clone", "super.clone"),
|
||||
};
|
||||
verify(checkConfig, getNonCompilablePath("InputSuperClone.java"), expected);
|
||||
verify(checkConfig, getPath("InputSuperClone.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -1640,7 +1640,7 @@ public class IndentationCheckTest extends BaseCheckTestSupport {
|
|||
"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
|
||||
|
|
@ -1650,7 +1650,7 @@ public class IndentationCheckTest extends BaseCheckTestSupport {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ public class NewHandlerTest extends BaseCheckTestSupport {
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class ModifierOrderCheckTest
|
|||
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
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class RedundantModifierCheckTest
|
|||
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
|
||||
|
|
@ -99,7 +99,7 @@ public class RedundantModifierCheckTest
|
|||
final String[] expected = {
|
||||
"5:9: " + getCheckMessage(MSG_KEY, "final"),
|
||||
};
|
||||
verify(checkConfig, getNonCompilablePath("InputFinalInDefaultMethods.java"), expected);
|
||||
verify(checkConfig, getPath("InputFinalInDefaultMethods.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ public class ConstantNameCheckTest
|
|||
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
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class GenericWhitespaceCheckTest
|
|||
@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
|
||||
|
|
@ -133,7 +133,7 @@ public class GenericWhitespaceCheckTest
|
|||
final String[] expected = {
|
||||
"10:70: " + getCheckMessage(MSG_WS_FOLLOWED, ">"),
|
||||
};
|
||||
verify(checkConfig, getNonCompilablePath("InputGenericWhitespaceMethodRef.java"), expected);
|
||||
verify(checkConfig, getPath("InputGenericWhitespaceMethodRef.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -185,9 +185,7 @@ public class NoWhitespaceAfterCheckTest
|
|||
"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
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ public class WhitespaceAroundCheckTest
|
|||
"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);
|
||||
}
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ public class WhitespaceAroundCheckTest
|
|||
"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);
|
||||
}
|
||||
|
||||
|
|
@ -385,6 +385,6 @@ public class WhitespaceAroundCheckTest
|
|||
"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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ public class AstRegressionTest extends BaseCheckTestSupport {
|
|||
|
||||
@Test
|
||||
public void testJava8ClassAstTree1() throws Exception {
|
||||
verifyAst(getNonCompilablePath("InputRegressionJava8Class1Ast.txt"),
|
||||
getNonCompilablePath("InputRegressionJava8Class1.java"));
|
||||
verifyAst(getPath("InputRegressionJava8Class1Ast.txt"),
|
||||
getPath("InputRegressionJava8Class1.java"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -85,8 +85,8 @@ public class AstRegressionTest extends BaseCheckTestSupport {
|
|||
|
||||
@Test
|
||||
public void testJava8InterfaceAstTree1() throws Exception {
|
||||
verifyAst(getNonCompilablePath("InputRegressionJava8Interface1Ast.txt"),
|
||||
getNonCompilablePath("InputRegressionJava8Interface1.java"));
|
||||
verifyAst(getPath("InputRegressionJava8Interface1Ast.txt"),
|
||||
getPath("InputRegressionJava8Interface1.java"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations2.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations2.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations3.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations3.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations4.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations4.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations5.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations5.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations6.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations6.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations7.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations7.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations8.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations8.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations9.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations9.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations10.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations10.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ public class AnnotationTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotations11.java"), expected);
|
||||
verify(checkConfig, getPath("InputAnnotations11.java"), expected);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
|||
|
||||
public class AnnotationsOnArrayTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getNonCompilablePath(String filename) throws IOException {
|
||||
return super.getNonCompilablePath("grammars" + File.separator
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("grammars" + File.separator
|
||||
+ "java8" + File.separator + filename);
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ public class AnnotationsOnArrayTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputAnnotationsOnArray.java"),
|
||||
verify(checkConfig, getPath("InputAnnotationsOnArray.java"),
|
||||
expected);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class DefaultMethodsTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputDefaultMethods.java"), expected);
|
||||
verify(checkConfig, getPath("InputDefaultMethods.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
|||
|
||||
public class LambdaTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getNonCompilablePath(String filename) throws IOException {
|
||||
return super.getNonCompilablePath("grammars" + File.separator
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("grammars" + File.separator
|
||||
+ "java8" + File.separator + filename);
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda1.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda1.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda2.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda2.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda3.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda3.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda4.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda4.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda5.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda5.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda6.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda6.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda7.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda7.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda8.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda8.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda9.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda9.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda10.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda10.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda11.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda11.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda12.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda12.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda13.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda13.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda14.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda14.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda15.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda15.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda16.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda16.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda17.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda17.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ public class LambdaTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputLambda18.java"), expected);
|
||||
verify(checkConfig, getPath("InputLambda18.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
|||
|
||||
public class MethodReferencesTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getNonCompilablePath(String filename) throws IOException {
|
||||
return super.getNonCompilablePath("grammars" + File.separator
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("grammars" + File.separator
|
||||
+ "java8" + File.separator + filename);
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ public class MethodReferencesTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputMethodReferences.java"), expected);
|
||||
verify(checkConfig, getPath("InputMethodReferences.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ public class MethodReferencesTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputMethodReferences2.java"), expected);
|
||||
verify(checkConfig, getPath("InputMethodReferences2.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ public class MethodReferencesTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputMethodReferences3.java"), expected);
|
||||
verify(checkConfig, getPath("InputMethodReferences3.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ public class MethodReferencesTest extends BaseCheckTestSupport {
|
|||
throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputMethodReferences4.java"), expected);
|
||||
verify(checkConfig, getPath("InputMethodReferences4.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ public class MethodReferencesTest extends BaseCheckTestSupport {
|
|||
throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputMethodReferences5.java"), expected);
|
||||
verify(checkConfig, getPath("InputMethodReferences5.java"), expected);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ public class MethodReferencesTest extends BaseCheckTestSupport {
|
|||
throws Exception {
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputMethodReferences6.java"), expected);
|
||||
verify(checkConfig, getPath("InputMethodReferences6.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -98,7 +98,7 @@ public class MethodReferencesTest extends BaseCheckTestSupport {
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputMethodReferences7.java"), expected);
|
||||
verify(checkConfig, getPath("InputMethodReferences7.java"), expected);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
|||
|
||||
public class TypeUseAnnotationsOnQualifiedTypesTest extends BaseCheckTestSupport {
|
||||
@Override
|
||||
protected String getNonCompilablePath(String filename) throws IOException {
|
||||
return super.getNonCompilablePath("grammars" + File.separator
|
||||
protected String getPath(String filename) throws IOException {
|
||||
return super.getPath("grammars" + File.separator
|
||||
+ "java8" + File.separator + filename);
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ public class TypeUseAnnotationsOnQualifiedTypesTest extends BaseCheckTestSupport
|
|||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(MemberNameCheck.class);
|
||||
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
|
||||
verify(checkConfig, getNonCompilablePath("InputTypeUseAnnotationsOnQualifiedTypes.java"),
|
||||
verify(checkConfig, getPath("InputTypeUseAnnotationsOnQualifiedTypes.java"),
|
||||
expected);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import java.lang.annotation.Target;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class InputSuppressWarningsHolder{
|
||||
public class InputSuppressWarningsHolder5{
|
||||
|
||||
public static Object foo1(@SuppressWarnings("unsused") Object str) {
|
||||
String myString = (@SuppressWarnings("unsused") String) str;
|
||||
|
|
@ -164,7 +164,7 @@ class class1
|
|||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
class AA {
|
||||
{
|
||||
int y = 0;
|
||||
y = 9;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,226 @@
|
|||
//Compilable with Java8 //indent:0 exp:0
|
||||
package com.puppycrawl.tools.checkstyle.checks.indentation; //indent:0 exp:0
|
||||
|
||||
import java.util.ArrayList; //indent:0 exp:0
|
||||
import java.util.List; //indent:0 exp:0
|
||||
import java.util.Map; //indent:0 exp:0
|
||||
import java.util.StringJoiner; //indent:0 exp:0
|
||||
import java.util.stream.Collector; //indent:0 exp:0
|
||||
import java.util.stream.Collectors; //indent:0 exp:0
|
||||
import java.util.stream.IntStream; //indent:0 exp:0
|
||||
import java.util.stream.Stream; //indent:0 exp:0
|
||||
|
||||
public class InputFinalInDefaultMethods { //indent:0 exp:0
|
||||
|
||||
interface Printer //indent:2 exp:2
|
||||
{ //indent:2 exp:2
|
||||
void print(String s); //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
|
||||
class LongTypeName { //indent:2 exp:2
|
||||
} //indent:2 exp:2
|
||||
|
||||
interface SomeInterface { //indent:2 exp:2
|
||||
void someFunction(LongTypeName arg); //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
|
||||
void function1(Runnable x) { //indent:2 exp:2
|
||||
Runnable r1 = () -> { //indent:4 exp:4
|
||||
x.run(); //indent:6 exp:6
|
||||
}; //indent:4 exp:4
|
||||
|
||||
Runnable r2 = () -> { x.run(); }; //indent:4 exp:4
|
||||
|
||||
Runnable r3 = () -> //indent:4 exp:4
|
||||
x.run(); //indent:8 exp:8
|
||||
|
||||
Runnable r4 = () -> x.run(); //indent:4 exp:4
|
||||
|
||||
Printer r5 = s -> System.out.print(s); //indent:4 exp:4
|
||||
|
||||
Printer r6 = s -> System.out //indent:4 exp:4
|
||||
.print(s); //indent:8 exp:8
|
||||
|
||||
Runnable r7 = () //indent:4 exp:4
|
||||
-> //indent:8 exp:8
|
||||
{ //indent:5 exp:4 warn
|
||||
}; //indent:5 exp:4 warn
|
||||
|
||||
Runnable r8 = //indent:4 exp:4
|
||||
() //indent:9 exp:8 warn
|
||||
-> //indent:11 exp:12 warn
|
||||
{}; //indent:9 exp:8 warn
|
||||
|
||||
Runnable r9 = //indent:4 exp:4
|
||||
() //indent:8 exp:8
|
||||
-> //indent:12 exp:12
|
||||
{}; //indent:8 exp:8
|
||||
|
||||
Object o = new Thread(() -> { //indent:4 exp:4
|
||||
x.run(); //indent:6 exp:6
|
||||
}); //indent:4 exp:4
|
||||
|
||||
Runnable r01 = () -> { //indent:4 exp:4
|
||||
x.run(); //indent:7 exp:6 warn
|
||||
}; //indent:5 exp:4 warn
|
||||
|
||||
Runnable r11 = //indent:4 exp:4
|
||||
() -> { //indent:8 exp:8
|
||||
x.run(); //indent:10 exp:10
|
||||
}; //indent:8 exp:8
|
||||
|
||||
Runnable r21 = //indent:4 exp:4
|
||||
() -> { x.run(); }; //indent:8 exp:8
|
||||
|
||||
Runnable r31 = //indent:4 exp:4
|
||||
() -> x //indent:8 exp:8
|
||||
.run(); //indent:12 exp:12
|
||||
|
||||
Runnable r41 = //indent:4 exp:4
|
||||
() -> x.run(); //indent:8 exp:8
|
||||
|
||||
Printer r51 = //indent:4 exp:4
|
||||
s -> System.out.print(s); //indent:8 exp:8
|
||||
|
||||
Printer r61 = //indent:4 exp:4
|
||||
s -> System.out //indent:8 exp:8
|
||||
.print(s); //indent:12 exp:12
|
||||
|
||||
Object o1 = new Thread( //indent:4 exp:4
|
||||
() -> { //indent:8 exp:8
|
||||
x.run(); //indent:10 exp:10
|
||||
}); //indent:8 exp:8
|
||||
|
||||
Object o2 = new Thread(() -> { //indent:4 exp:4
|
||||
x.run(); //indent:6 exp:6
|
||||
}).toString(); //indent:4 exp:4
|
||||
|
||||
SomeInterface i1 = (LongTypeName //indent:4 exp:4
|
||||
arg) -> { //indent:8 exp:8
|
||||
System.out.print(arg.toString()); //indent:6 exp:6
|
||||
}; //indent:4 exp:4
|
||||
|
||||
Printer[] manyRunnable = new Printer[]{ //indent:4 exp:4
|
||||
s -> System.out.print(s), //indent:8 exp:6,8
|
||||
s -> { System.out.print(s); }, //indent:8 exp:6,8
|
||||
s -> System.out //indent:8 exp:6,8
|
||||
.print(s), //indent:12 exp:12
|
||||
s -> { //indent:8 exp:6,8
|
||||
System.out.print(s); //indent:10 exp:10
|
||||
}, //indent:8 exp:8
|
||||
}; //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
|
||||
void function3(Runnable x) { //indent:2 exp:2
|
||||
function1(() -> { //indent:4 exp:4
|
||||
x.run(); //indent:6 exp:6
|
||||
}); //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
|
||||
class Person { //indent:2 exp:2
|
||||
String name; //indent:4 exp:4
|
||||
int age; //indent:4 exp:4
|
||||
Person(String name, int age) { //indent:4 exp:4
|
||||
} //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
|
||||
class Foo { //indent:2 exp:2
|
||||
String name; //indent:4 exp:4
|
||||
List<Bar> bars = new ArrayList<>(); //indent:4 exp:4
|
||||
|
||||
Foo(String name) { //indent:4 exp:4
|
||||
this.name = name; //indent:6 exp:6
|
||||
} //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
|
||||
class Bar { //indent:2 exp:2
|
||||
String name; //indent:4 exp:4
|
||||
Bar(String name) { //indent:4 exp:4
|
||||
this.name = name; //indent:6 exp:6
|
||||
} //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
|
||||
public void f() { //indent:2 exp:2
|
||||
Stream.of("d2", "a2", "b1", "b3", "c") //indent:4 exp:4
|
||||
.map(s -> { //indent:8 exp:8
|
||||
System.out.println("map: " + s); //indent:10 exp:10
|
||||
return s.toUpperCase(); //indent:10 exp:10
|
||||
}) //indent:8 exp:8
|
||||
.anyMatch(s -> { //indent:8 exp:8
|
||||
System.out.println("anyMatch: " + s); //indent:10 exp:10
|
||||
return s.startsWith("A"); //indent:10 exp:10
|
||||
}); //indent:8 exp:8
|
||||
|
||||
List<Person> persons = null; //indent:4 exp:4
|
||||
|
||||
Map<Integer, List<Person>> personsByAge = persons //indent:4 exp:4
|
||||
.stream() //indent:8 exp:8
|
||||
.collect(Collectors.groupingBy(p -> p.age)); //indent:8 exp:8
|
||||
|
||||
personsByAge //indent:4 exp:4
|
||||
.forEach((age, p) -> System.out.format("age %s: %s\n", age, p)); //indent:8 exp:8
|
||||
|
||||
Collector<Person, StringJoiner, String> personNameCollector = //indent:4 exp:4
|
||||
Collector.of( //indent:8 exp:8
|
||||
() -> new StringJoiner(" | "), //indent:12 exp:12
|
||||
(j, p) -> j.add(p.name.toUpperCase()), //indent:12 exp:12
|
||||
(j1, j2) -> j1.merge(j2), //indent:12 exp:12
|
||||
StringJoiner::toString); //indent:12 exp:12
|
||||
|
||||
List<Foo> foos = new ArrayList<>(); //indent:4 exp:4
|
||||
|
||||
foos.forEach(f -> //indent:4 exp:4
|
||||
IntStream //indent:8 exp:8
|
||||
.range(1, 4) //indent:12 exp:12
|
||||
.forEach(i -> f.bars.add(new Bar("Bar" + i + " <- " + f.name)))); //indent:12 exp:12
|
||||
|
||||
Stream.of("d2", "a2", "b1", "b3", "c") //indent:4 exp:4
|
||||
.filter(s -> { //indent:8 exp:8
|
||||
System.out.println("filter: " + s); //indent:9 exp:10 warn
|
||||
return s.startsWith("a"); //indent:11 exp:10 warn
|
||||
}) //indent:8 exp:8
|
||||
.map(s -> { //indent:8 exp:8
|
||||
System.out.println("map: " + s); //indent:10 exp:10
|
||||
return s.toUpperCase(); //indent:10 exp:10
|
||||
}) //indent:7 exp:8 warn
|
||||
.forEach(s -> //indent:8 exp:8
|
||||
System.out.println("forEach: " + s)); //indent:12 exp:12
|
||||
|
||||
IntStream.range(1, 4) //indent:4 exp:4
|
||||
.mapToObj(i -> new Foo("Foo" + i)) //indent:8 exp:8
|
||||
.peek(f -> IntStream.range(1, 4) //indent:8 exp:8
|
||||
.mapToObj(i -> new Bar("Bar" + i + " <- " + f.name)) //indent:12 exp:12
|
||||
.forEach(f.bars::add)) //indent:12 exp:12
|
||||
.flatMap(f -> f.bars.stream()) //indent:8 exp:8
|
||||
.forEach(b -> System.out.println(b.name)); //indent:8 exp:8
|
||||
|
||||
IntStream.range(1, 4) //indent:4 exp:4
|
||||
.mapToObj(i -> new Foo("Foo" + i)) //indent:8 exp:8
|
||||
.peek(f -> IntStream.range(1, 4) //indent:8 exp:8
|
||||
.mapToObj(i -> new Bar("Bar" + i + " <- " + f.name)) //indent:12 exp:12
|
||||
.forEach(f.bars::add)) //indent:12 exp:12
|
||||
.flatMap(f -> f.bars.stream()) //indent:8 exp:8
|
||||
.forEach(b -> System.out.println(b.name)); //indent:8 exp:8
|
||||
} //indent:2 exp:2
|
||||
|
||||
Runnable r2r(Runnable x) { //indent:2 exp:2
|
||||
return x; //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
|
||||
void function2(Runnable x) { //indent:2 exp:2
|
||||
Runnable r0 = r2r(() -> { //indent:4 exp:4
|
||||
int i = 1; //indent:6 exp:6
|
||||
}); //indent:4 exp:4
|
||||
|
||||
Runnable r1 = r2r(() -> { //indent:4 exp:4
|
||||
int i = 1; //indent:10 exp:10
|
||||
} //indent:8 exp:8
|
||||
); //indent:4 exp:4
|
||||
|
||||
Runnable r2 = r2r(r2r(() -> { //indent:4 exp:4
|
||||
int i = 1; //indent:14 exp:14
|
||||
} //indent:12 exp:12
|
||||
) //indent:8 exp:8
|
||||
); //indent:4 exp:4
|
||||
} //indent:2 exp:2
|
||||
} //indent:0 exp:0
|
||||
|
|
@ -40,4 +40,4 @@ public class InputLambda2 { //indent:0 exp:0
|
|||
(x) -> print(x * 1), //indent:16 exp:16
|
||||
(x) -> print(x * 2)); //indent:16 exp:16
|
||||
} //indent:4 exp:4
|
||||
} //indent:0 exp:0
|
||||
} //indent:0 exp:0
|
||||
|
|
@ -8,14 +8,14 @@ import java.util.function.Supplier;
|
|||
*
|
||||
* @author IljaDubinin
|
||||
*/
|
||||
public class InputNewHandler
|
||||
public class InputNewHandler
|
||||
{
|
||||
|
||||
|
||||
public static void test() {
|
||||
method(ArrayList::new);
|
||||
}
|
||||
|
||||
private static void method(Supplier<?> s) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -14,4 +14,4 @@ public interface InputFinalInDefaultMethods {
|
|||
final int square = x * x; //No violation here!
|
||||
return square;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue