├── src ├── test │ ├── resources │ │ └── com │ │ │ └── puppycrawl │ │ │ └── tools │ │ │ └── checkstyle │ │ │ ├── InputEmptyFile.txt │ │ │ ├── header │ │ │ ├── H2.properties │ │ │ ├── H1.properties │ │ │ ├── H2.xml │ │ │ ├── H1.xml │ │ │ ├── H1.java │ │ │ └── H2.java │ │ │ ├── javadoc │ │ │ ├── bothfiles │ │ │ │ ├── package.html │ │ │ │ ├── package-info.java │ │ │ │ └── Ignored.java │ │ │ ├── pkghtml │ │ │ │ ├── package.html │ │ │ │ └── Ignored.java │ │ │ ├── pkginfo │ │ │ │ ├── invalidformat │ │ │ │ │ └── package-info.java │ │ │ │ ├── invalidinherit │ │ │ │ │ └── package-info.java │ │ │ │ ├── valid │ │ │ │ │ └── package-info.java │ │ │ │ └── annotation │ │ │ │ │ └── package-info.java │ │ │ ├── InputBadTag.java │ │ │ ├── InputTestNumberFomatException.java │ │ │ ├── GuavaFP.java │ │ │ ├── InputJavadocMethodIgnoreNameRegex.java │ │ │ ├── InputSummaryJavadocCheckNoPeriod.java │ │ │ ├── InputSummaryJavadocCheckPeriod.java │ │ │ └── AllowedAnnotations.java │ │ │ ├── coding │ │ │ ├── InputWithCommentOnly.java │ │ │ ├── GregorianCalendar.java │ │ │ ├── InputPackageDeclaration.java │ │ │ ├── InputMissingCtor.java │ │ │ ├── InputIllegalTypeStarImports.java │ │ │ ├── InputRequireThis2.java │ │ │ ├── InputModifiedControlVariableEnhancedForLoopVariable.java │ │ │ ├── InputIllegalThrowsCheckIgnoreOverriddenMethods.java │ │ │ ├── InputIllegalThrowsCheck.java │ │ │ ├── InputFinalLocalVariableEnhancedForLoopVariable.java │ │ │ ├── InputParameterAssignment.java │ │ │ ├── InputIllegalCatchCheck.java │ │ │ ├── InputReturnFromCatchCheck.java │ │ │ ├── InputFinalLocalVariableCheckFalsePositive.java │ │ │ ├── InputIllegalTypeStaticImports.java │ │ │ ├── InputFinalLocalVariableNativeMethods.java │ │ │ ├── InputEqualsHashCodeCheck.java │ │ │ └── InputMultipleVariableDeclarations.java │ │ │ ├── grammars │ │ │ ├── javadoc │ │ │ │ ├── htmlTags │ │ │ │ │ ├── ClosedOtherTag.txt │ │ │ │ │ ├── OneSimpleHtmlTag.txt │ │ │ │ │ ├── NegativeNumberInAttribute.txt │ │ │ │ │ ├── Comments.txt │ │ │ │ │ ├── AttributeValueWithoutQuotes.txt │ │ │ │ │ ├── UnclosedAndClosedParagraphs.txt │ │ │ │ │ ├── UnclosedParagraphFollowedByJavadocTag.txt │ │ │ │ │ ├── ListWithUnclosedItemInUnclosedParagraph.txt │ │ │ │ │ ├── HtmlTagsInParagraph.txt │ │ │ │ │ └── MixedCaseOfHtmlTags.txt │ │ │ │ ├── javadocTags │ │ │ │ │ ├── AsteriskInLiteral.txt │ │ │ │ │ ├── InnerBracesInCodeTag.txt │ │ │ │ │ ├── ParamWithGeneric.txt │ │ │ │ │ ├── Since.txt │ │ │ │ │ ├── AsteriskInJavadocInlineTag.txt │ │ │ │ │ ├── DollarInLink.txt │ │ │ │ │ ├── TwoLinkTagsInRow.txt │ │ │ │ │ ├── AuthorWithMailto.txt │ │ │ │ │ ├── NewlineAndAsteriskInParameters.txt │ │ │ │ │ ├── CustomJavadocTags.txt │ │ │ │ │ ├── LinkInlineTags.txt │ │ │ │ │ ├── FewWhiteSpacesAsSeparator.txt │ │ │ │ │ ├── JavadocTagDescriptionWithInlineTags.txt │ │ │ │ │ ├── SeeReferenceWithFewNestedClasses.txt │ │ │ │ │ ├── TextBeforeJavadocTags.txt │ │ │ │ │ ├── AllJavadocInlineTags.txt │ │ │ │ │ ├── DocRootInheritDoc.txt │ │ │ │ │ └── Serial.txt │ │ │ │ └── LeadingAsterisks.txt │ │ │ ├── LineCommentAtTheEndOfFile.java │ │ │ ├── InputGrammar.java │ │ │ ├── InputVararg.java │ │ │ ├── java8 │ │ │ │ ├── InputAnnotationsTest1.java │ │ │ │ └── InputDefaultMethodsTest2.java │ │ │ ├── InputJava7Diamond.java │ │ │ ├── Bug3553541.java │ │ │ ├── EofBug1667137.java │ │ │ ├── InputEmbeddedNullChar.java │ │ │ ├── InputHexFloat.java │ │ │ └── InputJava7StringSwitch.java │ │ │ ├── regexp.header1 │ │ │ ├── regexp.header │ │ │ ├── InputStartingWithEmptyLine.java │ │ │ ├── regexp.header2 │ │ │ ├── mycheckstyle.properties │ │ │ ├── inputHeader.java │ │ │ ├── annotation │ │ │ ├── package-info.java │ │ │ ├── AnnotationsUseStyleParams.java │ │ │ ├── SuppressWarningsValuePair.java │ │ │ ├── NotOverride.java │ │ │ └── SuppressWarningsConstants.java │ │ │ ├── InputMain.java │ │ │ ├── InputRegexpSmallHeader.java │ │ │ ├── InputRegexpHeader3.java │ │ │ ├── design │ │ │ ├── InputOneTopLevelEnum.java │ │ │ ├── InputOneTopLevelInterface.java │ │ │ ├── InputOneTopLevelClassNoPublic.java │ │ │ ├── HideUtilityClassConstructor.java │ │ │ ├── HideUtilityClassContructor3041574_2.java │ │ │ ├── HideUtilityClassContructor3041574_1.java │ │ │ ├── UtilityClassConstructorPrivate.java │ │ │ ├── UtilityClassConstructorPublic.java │ │ │ ├── InputOneTopLevelEnum2.java │ │ │ ├── InputOneTopLevelInterface2.java │ │ │ ├── UtilityClassConstructor.java │ │ │ ├── InputRegression1762702.java │ │ │ └── InputNonUtilityClass.java │ │ │ ├── InetSocketAddress.java │ │ │ ├── InputRegexpHeader4.java │ │ │ ├── imports │ │ │ ├── InputCustomImportOrder_NoImports.java │ │ │ ├── DOMSource.java │ │ │ ├── InputImportOrder_NoFailureForRedundantImports.java │ │ │ ├── import-control_broken.xml │ │ │ ├── InputCustomImportOrderNoValid.java │ │ │ ├── import-control_wrong.xml │ │ │ ├── InputImportControl.java │ │ │ ├── InputAvoidStaticImportNestedClass.java │ │ │ ├── InputCustomImportOrderImportsContainingJava.java │ │ │ ├── InputImportOrder_HonorsTokensProperty.java │ │ │ ├── InputImportOrderStaticGroupOrder.java │ │ │ ├── InputImportOrderStaticGroupOrderBottom.java │ │ │ ├── InputImportOrderStaticOnDemandGroupOrderBottom.java │ │ │ ├── InputImportOrderCaseInsensitive.java │ │ │ ├── InputImportOrderStaticOnDemandGroupOrder.java │ │ │ ├── InputImportBug.java │ │ │ ├── package-info.java │ │ │ ├── InputImportOrder_WildcardUnspecified.java │ │ │ ├── InputCustomImportOrderThirdPartyPackage.java │ │ │ ├── InputImportOrder_Wildcard.java │ │ │ ├── import-control_one.xml │ │ │ ├── InputCustomImportOrderThirdPartyAndSpecial.java │ │ │ ├── import-control_one-re.xml │ │ │ ├── InputCustomImportOrder2.java │ │ │ ├── InputCustomImportOrder3.java │ │ │ ├── InputCustomImportOrderTemp.java │ │ │ ├── import-control_two.xml │ │ │ ├── InputImportOrder_Above.java │ │ │ ├── InputImportOrder_Under.java │ │ │ ├── import-control_complete.xml │ │ │ ├── InputImportOrder_Bottom.java │ │ │ ├── InputImportOrder_Top.java │ │ │ ├── import-control_two-re.xml │ │ │ ├── InputImportOrder.java │ │ │ ├── InputImportOrder_InFlow.java │ │ │ ├── import-control_WithNewElement.xml │ │ │ └── InputCustomImportOrder.java │ │ │ ├── LocalAnnotations.java │ │ │ ├── whitespace │ │ │ ├── InputEmptyLineSeparatorFormerException.java │ │ │ ├── Gh47.java │ │ │ ├── InputEmptyLineSeparatorMultipleFieldsInClass.java │ │ │ ├── InputNoWhiteSpaceAfterCheckFormerNpe.java │ │ │ ├── InputEmptyLineSeparatorMultipleImportEmptyClass.java │ │ │ ├── InputDoWhileWhitespaceAround.java │ │ │ ├── InputGenericWhitespaceInnerClassCheck.java │ │ │ ├── InputSwitchWhitespaceAround.java │ │ │ ├── NoLineWrapGoodInput.java │ │ │ ├── ParenPadWithSpace.java │ │ │ ├── NoLineWrapBadInput.java │ │ │ └── InputWhitespaceAround.java │ │ │ ├── InputRegexpHeader1.java │ │ │ ├── comments │ │ │ ├── InputCommentsTest_1.java │ │ │ ├── InputCommentsTest_2.java │ │ │ └── InputFullOfBlockComments.java │ │ │ ├── java.header │ │ │ ├── indentation │ │ │ └── InputAnnotationDefinition.java │ │ │ ├── suppressions_none.xml │ │ │ ├── configs │ │ │ ├── included.xml │ │ │ ├── empty_configuration.xml │ │ │ ├── missing_config_parent.xml │ │ │ ├── missing_config_name.xml │ │ │ ├── missing_property_name.xml │ │ │ ├── missing_property_value.xml │ │ │ ├── including.xml │ │ │ ├── subdir │ │ │ │ └── including.xml │ │ │ └── custom_messages.xml │ │ │ ├── InputRightCurlyEmptyAbstractMethod.java │ │ │ ├── InputRegexpHeader2.java │ │ │ ├── suppressions_no_check.xml │ │ │ ├── suppressions_no_file.xml │ │ │ ├── naming │ │ │ ├── InputAbstractClassNameFormerFalsePositive.java │ │ │ ├── InputTypeName.java │ │ │ ├── InputConstantNames.java │ │ │ ├── InputMemberName.java │ │ │ ├── InputStaticVariableName.java │ │ │ ├── AbstractMultisetSetCountTester.java │ │ │ ├── InputAbstractClassName.java │ │ │ └── InputMethodNameOverridenMethods.java │ │ │ ├── suppressions_bad_int.xml │ │ │ ├── OuterTypeNumberCheckInput.java │ │ │ ├── InputImmutableStarImport2.java │ │ │ ├── AnnotatedVisibilitySameTypeName.java │ │ │ ├── IntMethodAnnotation.java │ │ │ ├── metrics │ │ │ └── InputBooleanExpressionComplexityNPE.java │ │ │ ├── app-dev.properties │ │ │ ├── app-stage.properties │ │ │ ├── messages_test.properties │ │ │ ├── messages_test_de.properties │ │ │ ├── config-Incorrect.xml │ │ │ ├── config-classname.xml │ │ │ ├── InputNewlineCrAtEndOfFile.java │ │ │ ├── config-classname-prop.xml │ │ │ ├── InputImmutableStarImport.java │ │ │ ├── suppressions_multiple.xml │ │ │ ├── InputNoNewlineAtEndOfFile.java │ │ │ ├── config-classname2-error.xml │ │ │ ├── config-classname2.xml │ │ │ ├── InputFinalParametersPrimitiveTypes.java │ │ │ ├── InputNewlineLfAtEndOfFile.java │ │ │ ├── InputMissingSwitchDefault.java │ │ │ ├── InputNewlineCrlfAtEndOfFile.java │ │ │ ├── MyAnnotation.java │ │ │ ├── InputImmutableSameTypeName.java │ │ │ ├── InputRightCurlyAnnotations.java │ │ │ ├── Input15Extensions.java │ │ │ ├── InputWriteTag2.java │ │ │ ├── InputNullModifiers.java │ │ │ ├── InputParameterNumberCheck.java │ │ │ ├── InputInterfaceIsType.java │ │ │ ├── InputWriteTag.java │ │ │ └── InputPublicImmutable.java │ ├── resources-noncompilable │ │ └── com │ │ │ └── puppycrawl │ │ │ └── tools │ │ │ └── checkstyle │ │ │ ├── coding │ │ │ ├── InputNoPackage.java │ │ │ ├── InputInnerAssignmentLambdaExpressions.java │ │ │ ├── InputDefaultComesLast2.java │ │ │ ├── InputIllegalInstantiationCheckTest2.java │ │ │ └── InputOneStatementPerLineCheck.java │ │ │ ├── InputStaticModifierInInterface.java │ │ │ ├── imports │ │ │ ├── InputImportOrder_MultiplePatternMatches.java │ │ │ ├── InputRedundantImportCheck_UnnamedPackage.java │ │ │ ├── InputCustomImportOrderSamePackage2.java │ │ │ ├── InputCustomImportOrderSamePackage.java │ │ │ └── InputDefaultPackage.java │ │ │ ├── InputModifier2.java │ │ │ ├── blocks │ │ │ └── InputSingleLineLambda.java │ │ │ ├── indentation │ │ │ └── NewHandlerTestInput.java │ │ │ ├── grammars │ │ │ ├── java8 │ │ │ │ ├── InputDefaultMethodsTest.java │ │ │ │ ├── InputLambdaTest18.java │ │ │ │ ├── InputAnnotationsTest2.java │ │ │ │ ├── InputLambdaTest6.java │ │ │ │ ├── InputLambdaTest1.java │ │ │ │ ├── InputLambdaTest4.java │ │ │ │ ├── InputAnnotationsTest5.java │ │ │ │ ├── InputLambdaTest5.java │ │ │ │ ├── InputLambdaTest7.java │ │ │ │ ├── InputAnnotationsTest4.java │ │ │ │ ├── InputAnnotationsTest3.java │ │ │ │ ├── InputAnnotationsTest6.java │ │ │ │ ├── InputAnnotationsTest9.java │ │ │ │ ├── InputAnnotationsTest7.java │ │ │ │ ├── InputLambdaTest14.java │ │ │ │ ├── InputLambdaTest2.java │ │ │ │ ├── InputLambdaTest10.java │ │ │ │ ├── InputLambdaTest11.java │ │ │ │ ├── InputLambdaTest3.java │ │ │ │ ├── InputLambdaTest8.java │ │ │ │ ├── InputLambdaTest9.java │ │ │ │ ├── InputLambdaTest12.java │ │ │ │ ├── InputMethodReferencesTest3.java │ │ │ │ ├── InputLambdaTest13.java │ │ │ │ ├── InputAnnotationsTest10.java │ │ │ │ ├── InputLambdaTest17.java │ │ │ │ ├── InputMethodReferencesTest2.java │ │ │ │ └── InputAnnotationsTest8.java │ │ │ └── SemicolonBetweenImports.java │ │ │ ├── whitespace │ │ │ └── InputGenericWhitespaceMethodRef.java │ │ │ ├── InputFinalInDefaultMethods.java │ │ │ └── naming │ │ │ └── InputFinalLocalVariableNameLambda.java │ └── java │ │ └── com │ │ └── puppycrawl │ │ └── tools │ │ └── checkstyle │ │ ├── checks │ │ ├── javadoc │ │ │ └── BadCls.java │ │ └── sizes │ │ │ └── MethodCountCheckInput2.java │ │ ├── BaseFileSetCheckTestSupport.java │ │ ├── DebugChecker.java │ │ └── DebugFilter.java ├── main │ └── resources │ │ └── com │ │ └── puppycrawl │ │ └── tools │ │ └── checkstyle │ │ ├── checks │ │ ├── annotation │ │ │ └── messages_es.properties │ │ ├── regexp │ │ │ ├── messages_ja.properties │ │ │ ├── messages_pt.properties │ │ │ ├── messages_fi.properties │ │ │ ├── messages_es.properties │ │ │ ├── messages_fr.properties │ │ │ ├── messages_tr.properties │ │ │ ├── messages_de.properties │ │ │ └── messages.properties │ │ ├── indentation │ │ │ ├── messages_fi.properties │ │ │ ├── messages_ja.properties │ │ │ ├── messages_de.properties │ │ │ ├── messages_es.properties │ │ │ ├── messages_pt.properties │ │ │ ├── messages_fr.properties │ │ │ ├── messages_tr.properties │ │ │ └── messages.properties │ │ ├── header │ │ │ ├── messages_ja.properties │ │ │ ├── messages.properties │ │ │ ├── messages_fi.properties │ │ │ ├── messages_de.properties │ │ │ ├── messages_pt.properties │ │ │ ├── messages_es.properties │ │ │ ├── messages_fr.properties │ │ │ └── messages_tr.properties │ │ ├── modifier │ │ │ ├── messages_ja.properties │ │ │ ├── messages_fi.properties │ │ │ ├── messages_pt.properties │ │ │ ├── messages.properties │ │ │ ├── messages_es.properties │ │ │ ├── messages_fr.properties │ │ │ ├── messages_de.properties │ │ │ └── messages_tr.properties │ │ ├── naming │ │ │ ├── messages_ja.properties │ │ │ ├── messages_fi.properties │ │ │ ├── messages_pt.properties │ │ │ ├── messages_es.properties │ │ │ ├── messages_fr.properties │ │ │ ├── messages.properties │ │ │ ├── messages_tr.properties │ │ │ └── messages_de.properties │ │ ├── messages_fi.properties │ │ ├── blocks │ │ │ ├── messages_ja.properties │ │ │ ├── messages_fi.properties │ │ │ ├── messages_pt.properties │ │ │ ├── messages_es.properties │ │ │ ├── messages_de.properties │ │ │ ├── messages_fr.properties │ │ │ ├── messages_tr.properties │ │ │ └── messages.properties │ │ ├── sizes │ │ │ ├── messages_fi.properties │ │ │ ├── messages_ja.properties │ │ │ ├── messages_pt.properties │ │ │ ├── messages_es.properties │ │ │ └── messages_fr.properties │ │ ├── imports │ │ │ ├── messages_fi.properties │ │ │ ├── messages_ja.properties │ │ │ ├── messages_es.properties │ │ │ ├── messages_pt.properties │ │ │ └── messages_fr.properties │ │ ├── design │ │ │ ├── messages_ja.properties │ │ │ ├── messages_fi.properties │ │ │ ├── messages_es.properties │ │ │ ├── messages_pt.properties │ │ │ └── messages.properties │ │ ├── whitespace │ │ │ ├── messages_ja.properties │ │ │ ├── messages_fi.properties │ │ │ ├── messages_pt.properties │ │ │ ├── messages_fr.properties │ │ │ └── messages_es.properties │ │ ├── messages_ja.properties │ │ ├── messages_pt.properties │ │ ├── javadoc │ │ │ ├── messages_fi.properties │ │ │ └── messages_ja.properties │ │ └── messages_es.properties │ │ ├── ant │ │ ├── checkstyle-ant-task.properties │ │ └── antlib.xml │ │ ├── messages_pt.properties │ │ ├── packages_1_0.dtd │ │ ├── messages.properties │ │ ├── messages_fi.properties │ │ ├── messages_es.properties │ │ ├── messages_fr.properties │ │ ├── messages_de.properties │ │ ├── messages_tr.properties │ │ ├── configuration_1_0.dtd │ │ ├── suppressions_1_0.dtd │ │ └── suppressions_1_1.dtd ├── site │ └── resources │ │ ├── images │ │ ├── logo.png │ │ ├── Filter.gif │ │ ├── anchor.png │ │ ├── ban_red.png │ │ ├── banner.jpg │ │ ├── favicon.ico │ │ ├── favicon.png │ │ ├── groups.png │ │ ├── ok_blue.png │ │ ├── sflogo.gif │ │ ├── ok_green.png │ │ ├── rss-long.png │ │ ├── AuditListener.gif │ │ ├── gui_screenshot.png │ │ ├── stackoverflow.jpeg │ │ ├── twitter_button.png │ │ ├── Google-Plus-Logo-120x38.png │ │ ├── checkstyle_logo_small_64.png │ │ ├── gui_screenshot_debug_idea.png │ │ ├── gui_screenshot_debug_eclipse.png │ │ ├── gui_screenshot_debug_netbeans.png │ │ ├── gui_screenshot_importing_idea.png │ │ ├── gui_screenshot_ut_select_idea.png │ │ ├── gui_screenshot_importing_eclipse.png │ │ ├── gui_screenshot_importing_idea1.png │ │ ├── gui_screenshot_select_check_idea.png │ │ ├── gui_screenshot_ut_select_eclipse.png │ │ ├── github_logo_social_coding_outlined.png │ │ ├── gui_screenshot_importing_netbeans.png │ │ ├── gui_screenshot_importing_netbeans1.png │ │ ├── gui_screenshot_ut_select_netbeans.png │ │ ├── gui_screenshot_select_check_eclipse.png │ │ └── gui_screenshot_select_check_netbeans.png │ │ ├── files │ │ └── suppressions_none.xml │ │ └── js │ │ ├── google-analytics.js │ │ └── anchors.js └── it │ └── resources │ └── com │ └── google │ └── checkstyle │ └── test │ ├── chapter5naming │ ├── rule521$packagenames │ │ └── PackageBadNameInput3.java │ ├── rule521_packagenames │ │ └── BadPackageNameInput2.java │ ├── rule521packagenames │ │ └── PackageNameInputGood.java │ ├── rule521packageNamesCamelCase │ │ └── PackageNameInputBad.java │ └── rule525nonconstantfieldnames │ │ └── MemberNameInput_Basic.java │ ├── chapter3filestructure │ ├── rule341onetoplevel │ │ ├── OneTopLevelClassBad2.java │ │ ├── OneTopLevelClassBad3.java │ │ └── OneTopLevelClassInputGood.java │ ├── rule332nolinewrap │ │ ├── NoLineWrap_Good.java │ │ └── NoLineWrap_Bad.java │ └── rule333orderingandsoacing │ │ ├── CustomImportOrderInput_3.java │ │ ├── CustomImportOrderInput_2.java │ │ └── CustomImportOrderInput_1.java │ ├── chapter7javadoc │ └── rule711generalform │ │ └── InputSingleLineJavadocCheckError.java │ ├── chapter2filebasic │ └── rule21filename │ │ ├── OuterTypeFilenameInput_2.java │ │ ├── OuterTypeFilenameInput_1.java │ │ └── OuterTypeFilenameInput_3.java │ └── chapter4formatting │ └── rule462horizontalwhitespace │ └── WhitespaceAroundnput_EmptyTypesAndCycles.java ├── .gitattributes ├── .gitignore └── config └── assembly-src.xml /src/test/resources/com/puppycrawl/tools/checkstyle/InputEmptyFile.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/header/H2.properties: -------------------------------------------------------------------------------- 1 | x=y -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/bothfiles/package.html: -------------------------------------------------------------------------------- 1 | Ignored -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/pkghtml/package.html: -------------------------------------------------------------------------------- 1 | Ignored -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/annotation/messages_es.properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputWithCommentOnly.java: -------------------------------------------------------------------------------- 1 | /* Comment only */ 2 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/ClosedOtherTag.txt: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/OneSimpleHtmlTag.txt: -------------------------------------------------------------------------------- 1 | blabla -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/regexp.header1: -------------------------------------------------------------------------------- 1 | ^/*$ 2 | // .* 3 | ^.*$ 4 | ^.*$ 5 | ^.*$ 6 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/header/H1.properties: -------------------------------------------------------------------------------- 1 | # 2 | # (C) 2006 correct header 3 | # 4 | x=y -------------------------------------------------------------------------------- /src/site/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/logo.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/AsteriskInLiteral.txt: -------------------------------------------------------------------------------- 1 | {@literal as 2 | * as} -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/InnerBracesInCodeTag.txt: -------------------------------------------------------------------------------- 1 | {@code {{{}}{{}}} } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/regexp.header: -------------------------------------------------------------------------------- 1 | ^/*$ 2 | // .* 3 | // Created: 2002 4 | ^.*$ 5 | ^.*$ 6 | -------------------------------------------------------------------------------- /src/site/resources/images/Filter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/Filter.gif -------------------------------------------------------------------------------- /src/site/resources/images/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/anchor.png -------------------------------------------------------------------------------- /src/site/resources/images/ban_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/ban_red.png -------------------------------------------------------------------------------- /src/site/resources/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/banner.jpg -------------------------------------------------------------------------------- /src/site/resources/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/favicon.ico -------------------------------------------------------------------------------- /src/site/resources/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/favicon.png -------------------------------------------------------------------------------- /src/site/resources/images/groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/groups.png -------------------------------------------------------------------------------- /src/site/resources/images/ok_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/ok_blue.png -------------------------------------------------------------------------------- /src/site/resources/images/sflogo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/sflogo.gif -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/ParamWithGeneric.txt: -------------------------------------------------------------------------------- 1 | @param my favorite type -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_ja.properties: -------------------------------------------------------------------------------- 1 | illegal.regexp=行が不正なパターン ''{0}'' に合致します。 2 | -------------------------------------------------------------------------------- /src/site/resources/images/ok_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/ok_green.png -------------------------------------------------------------------------------- /src/site/resources/images/rss-long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/rss-long.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputStartingWithEmptyLine.java: -------------------------------------------------------------------------------- 1 | 2 | package com.puppycrawl.tools.checkstyle; 3 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/NegativeNumberInAttribute.txt: -------------------------------------------------------------------------------- 1 | TM -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/Since.txt: -------------------------------------------------------------------------------- 1 | * @since 1.5 2 | * @since Release 3.4.5 -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/LeadingAsterisks.txt: -------------------------------------------------------------------------------- 1 | 2 | * Leading asterisk 3 | * Another one -------------------------------------------------------------------------------- /src/site/resources/images/AuditListener.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/AuditListener.gif -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot.png -------------------------------------------------------------------------------- /src/site/resources/images/stackoverflow.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/stackoverflow.jpeg -------------------------------------------------------------------------------- /src/site/resources/images/twitter_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/twitter_button.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/AsteriskInJavadocInlineTag.txt: -------------------------------------------------------------------------------- 1 | {@link 2 | * GwtIncompatible} -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/DollarInLink.txt: -------------------------------------------------------------------------------- 1 | {@link My$Class#$$simple_$Method(_A78, $8$)} -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/regexp.header2: -------------------------------------------------------------------------------- 1 | ^package 2 | ^$ 3 | ^import 4 | ^$ 5 | ^/\*\* 6 | ^ \*([^/]|$) 7 | ^ \*/ 8 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/Comments.txt: -------------------------------------------------------------------------------- 1 | * Use String -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/mycheckstyle.properties: -------------------------------------------------------------------------------- 1 | # mycheckstyle.severity=error 2 | mycheckstyle.severity=warning 3 | 4 | # -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_pt.properties: -------------------------------------------------------------------------------- 1 | illegal.regexp=A linha condiz com o padrão inválido ''{0}''. 2 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/header/H2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/inputHeader.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; class inputHeader {} // One line test 2 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/bothfiles/package-info.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc.bothfiles; 2 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties: -------------------------------------------------------------------------------- 1 | checkstyle=com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask 2 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/annotation/package-info.java: -------------------------------------------------------------------------------- 1 | @Deprecated 2 | package com.puppycrawl.tools.checkstyle.annotation; 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/TwoLinkTagsInRow.txt: -------------------------------------------------------------------------------- 1 | {@link #WHITESPACE WHITESPACE}{@link #trimFrom trimFrom} -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fi.properties: -------------------------------------------------------------------------------- 1 | illegal.regexp=Rivi on sääntöjenvaistaisen mallin mukainen: ''{0}''. 2 | -------------------------------------------------------------------------------- /src/site/resources/images/Google-Plus-Logo-120x38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/Google-Plus-Logo-120x38.png -------------------------------------------------------------------------------- /src/site/resources/images/checkstyle_logo_small_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/checkstyle_logo_small_64.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/header/H1.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_debug_idea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_debug_idea.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/AttributeValueWithoutQuotes.txt: -------------------------------------------------------------------------------- 1 | RFC 3758. -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/AuthorWithMailto.txt: -------------------------------------------------------------------------------- 1 | @author Baratali Izmailov -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/NewlineAndAsteriskInParameters.txt: -------------------------------------------------------------------------------- 1 | * {@link ImmutableSortedMap#of( 2 | * 3 | * )} -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/indentation/messages_fi.properties: -------------------------------------------------------------------------------- 1 | indentation.error={0} sisennyssyvyydellä {1} ei ole oikealla syvyydellä {2}. 2 | -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_debug_eclipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_debug_eclipse.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_debug_netbeans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_debug_netbeans.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_importing_idea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_importing_idea.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_ut_select_idea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_ut_select_idea.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/UnclosedAndClosedParagraphs.txt: -------------------------------------------------------------------------------- 1 |

2 | first paragraph 3 |

4 | second paragraph 5 |

-------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_importing_eclipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_importing_eclipse.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_importing_idea1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_importing_idea1.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_select_check_idea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_select_check_idea.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_ut_select_eclipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_ut_select_eclipse.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/UnclosedParagraphFollowedByJavadocTag.txt: -------------------------------------------------------------------------------- 1 |

2 | text text 3 | @author Baratali -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/CustomJavadocTags.txt: -------------------------------------------------------------------------------- 1 | * @myTag yes it is 2 | * @anotherTagWithoutParameter 3 | * @author I 4 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/LinkInlineTags.txt: -------------------------------------------------------------------------------- 1 | {@link java.lang.Integer#valueOf} 2 | {@link java.lang.Integer#valueOf valueOf} -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/pkghtml/Ignored.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc.pkghtml; 2 | 3 | class Ignored 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /src/site/resources/images/github_logo_social_coding_outlined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/github_logo_social_coding_outlined.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_importing_netbeans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_importing_netbeans.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_importing_netbeans1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_importing_netbeans1.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_ut_select_netbeans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_ut_select_netbeans.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputMain.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | public class InputMain { 4 | } 5 | class InputMainInner { 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/ListWithUnclosedItemInUnclosedParagraph.txt: -------------------------------------------------------------------------------- 1 |

2 |

-------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/bothfiles/Ignored.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc.bothfiles; 2 | 3 | class Ignored 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/header/messages_ja.properties: -------------------------------------------------------------------------------- 1 | header.missing=ヘッダがありません - ファイルの行数が不足しています。 2 | header.mismatch=行が期待されるヘッダ行 ''{0}'' と合致しません。 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/modifier/messages_ja.properties: -------------------------------------------------------------------------------- 1 | 2 | redundantModifier=冗長な ''{0}'' 修飾子です。 3 | 4 | mod.order=''{0}'' 修飾子が JLS 提案の順序に沿いません。 5 | -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_select_check_eclipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_select_check_eclipse.png -------------------------------------------------------------------------------- /src/site/resources/images/gui_screenshot_select_check_netbeans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/site/resources/images/gui_screenshot_select_check_netbeans.png -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/FewWhiteSpacesAsSeparator.txt: -------------------------------------------------------------------------------- 1 | * @param initialCapacity the initial capacity of the ByteBuffer. -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputRegexpSmallHeader.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | 4 | /** 5 | */ 6 | public class InputRegexpSmallHeader {} 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/JavadocTagDescriptionWithInlineTags.txt: -------------------------------------------------------------------------------- 1 | @deprecated use {@link java.lang.Integer Integer{@code Wat}} instead -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/messages_pt.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/checkstyle/master/src/main/resources/com/puppycrawl/tools/checkstyle/messages_pt.properties -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputRegexpHeader3.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import java.awt.*; 4 | 5 | public class InputRegexpHeader3 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/HtmlTagsInParagraph.txt: -------------------------------------------------------------------------------- 1 | 2 | *

3 | * Description of my class. 4 | *

5 | * Another line of text 6 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/SeeReferenceWithFewNestedClasses.txt: -------------------------------------------------------------------------------- 1 | @see java.lang.Integer.Nested.AnotherNested#someMethod(String, int) Description of the link -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/TextBeforeJavadocTags.txt: -------------------------------------------------------------------------------- 1 | 2 | * a b 3 | * c 4 | * @see Integer Int 5 | * @author Walter White 6 | * @author John Snow 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/pkginfo/invalidformat/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * blah blah 3 | */ 4 | package com.puppycrawl.tools.checkstyle.javadoc.pkginfo.invalidformat; 5 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/InputOneTopLevelEnum.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | public enum InputOneTopLevelEnum { 4 | VALUE1, VALUE2; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/modifier/messages_fi.properties: -------------------------------------------------------------------------------- 1 | redundantModifier=Tarpeeton määrite: ''{0}'' 2 | mod.order=''{0}'' määrite rikkoo JLS:n suositusten mukaisesen järjestyksen. 3 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InetSocketAddress.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | public class InetSocketAddress 4 | { 5 | class Arrays { 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputRegexpHeader4.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import java.awt.*; 4 | import java.awt.*; 5 | import java.awt.*; 6 | import java.awt.*; 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/htmlTags/MixedCaseOfHtmlTags.txt: -------------------------------------------------------------------------------- 1 |

2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 |
10 |

-------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/header/H1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) 2006 correct header 3 | */ 4 | 5 | package com.puppycrawl.tools.checkstyle.header; 6 | 7 | public class H1 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/header/H2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) '06 incorrect header 3 | */ 4 | 5 | package com.puppycrawl.tools.checkstyle.header; 6 | 7 | public class H2 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrder_NoImports.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | 4 | public class InputCustomImportOrder_NoImports { 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/header/messages.properties: -------------------------------------------------------------------------------- 1 | header.missing=Missing a header - not enough lines in file. 2 | header.mismatch=Line does not match expected header line of ''{0}''. 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/modifier/messages_pt.properties: -------------------------------------------------------------------------------- 1 | 2 | redundantModifier=Modificador ''{0}'' é redundante. 3 | 4 | mod.order=Modificador ''{0}'' fora da orderm sugerida pela JLS. 5 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/naming/messages_ja.properties: -------------------------------------------------------------------------------- 1 | name.invalidPattern=名前 ''{0}'' はパターン ''{1}'' に一致しなければなりません。 2 | illegal.abstract.class.name=名前 ''{0}'' はパターン ''{1}'' に一致しなければなりません。 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_es.properties: -------------------------------------------------------------------------------- 1 | illegal.regexp=La línea coincide con el patrón ilegal ''{0}''. 2 | required.regexp=El patron requerido ''{0}'' falta en el fichero. 3 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/coding/InputNoPackage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * No package here. Compilable by javac, but noncompilable by eclipse 3 | */ 4 | public class InputNoPackage { 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/InputOneTopLevelInterface.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | public interface InputOneTopLevelInterface { 4 | int foo(); 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/LineCommentAtTheEndOfFile.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | public class LineCommentAtTheEndOfFile 4 | { 5 | } // EOF on this line -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter5naming/rule521$packagenames/PackageBadNameInput3.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter5naming.rule521$packagenames; //warn 2 | final class PackageBadNameInput3 {} 3 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter5naming/rule521_packagenames/BadPackageNameInput2.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter5naming.rule521_packagenames; //warn 2 | final class BadPackageNameInput2 {} 3 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameInputGood.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter5naming.rule521packagenames; //ok 2 | final class PackageNameInputGood {} 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/header/messages_fi.properties: -------------------------------------------------------------------------------- 1 | header.missing=Headeri puuttuu - ei riittävästi rivejä tiedostossa. 2 | header.mismatch=Rivi ei ole odotetun ''{0}'' headerin mukainen. 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fr.properties: -------------------------------------------------------------------------------- 1 | illegal.regexp=La ligne correspond au motif illégal ''{0}''. 2 | required.regexp=Le motif ''{0}'' attendu dans le fichier est manquant. 3 | -------------------------------------------------------------------------------- /src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/BadCls.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.checks.javadoc; 2 | 3 | class BadCls { 4 | class X extends Exception {} 5 | void m() throws X {} 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/LocalAnnotations.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | public class LocalAnnotations 4 | { 5 | public @interface Rule { 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/header/messages_de.properties: -------------------------------------------------------------------------------- 1 | header.missing=Header fehlt - Datei hat nicht genug Zeilen. 2 | header.mismatch=Zeile entspricht nicht der erwarteten Header-Zeile ''{0}''. 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/indentation/messages_ja.properties: -------------------------------------------------------------------------------- 1 | indentation.error=インデント階層 {1} の {0} が正しいインデント {2} にありません 2 | indentation.child.error=インデント階層 {1} の子 {0} が正しいインデント {2} にありません 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/DOMSource.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import javax.xml.transform.Source; 4 | 5 | import org.w3c.dom.Node; 6 | 7 | class DOMSource {} 8 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/GregorianCalendar.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class GregorianCalendar 4 | { 5 | class SubCalendar { 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter5naming/rule521packageNamesCamelCase/PackageNameInputBad.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter5naming.rule521packageNamesCamelCase; //warn 2 | final class PackageNameInputBad {} 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/naming/messages_fi.properties: -------------------------------------------------------------------------------- 1 | name.invalidPattern=Nimen ''{0}'' pitää olla mallin ''{1}'' mukainen. 2 | illegal.abstract.class.name=Nimen ''{0}'' pitää olla mallin ''{1}'' mukainen. 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/naming/messages_pt.properties: -------------------------------------------------------------------------------- 1 | illegal.abstract.class.name=Nome ''{0}'' deve condizer com o padrão ''{1}''. 2 | name.invalidPattern=Nome ''{0}'' deve condizer com o padrão ''{1}''. 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/packages_1_0.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/AllJavadocInlineTags.txt: -------------------------------------------------------------------------------- 1 | {@code } {@literal } {@docRoot} {@inheritDoc} {@link A A class} {@linkplain A another link} {@value lang.Integer#MAX_VALUE} -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/pkginfo/invalidinherit/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * {@inheritDoc} Where are we inheriting from 3 | */ 4 | package com.puppycrawl.tools.checkstyle.javadoc.pkginfo.invalidinherit; 5 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/InputEmptyLineSeparatorFormerException.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | public class InputEmptyLineSeparatorFormerException 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassBad2.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter3filestructure.rule341onetoplevel; 2 | 3 | class Foo {} //ok 4 | enum FooEnum {} // warn 5 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/header/messages_pt.properties: -------------------------------------------------------------------------------- 1 | header.mismatch=A linha não condiz com a linha de cabeçalho esperada ''{0}''. 2 | header.missing=Falta o cabeçalho - o ficheiro não tem linhas suficientes. 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/header/messages_es.properties: -------------------------------------------------------------------------------- 1 | header.missing=Falta una cabecera - no hay líneas suficientes en el fichero. 2 | header.mismatch=La línea no coincide con la línea de cabecera esperada ''{0}''. 3 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputRegexpHeader1.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import java.awt.*; 4 | 5 | /** 6 | * Some doc. 7 | */ 8 | 9 | public class InputRegexpHeader1 10 | { 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/DocRootInheritDoc.txt: -------------------------------------------------------------------------------- 1 | 2 | * {@docRoot} 3 | * {@docRoot } 4 | * {@docRoot 5 | * } 6 | * {@inheritDoc} 7 | * {@inheritDoc } 8 | * {@inheritDoc 9 | * } 10 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/ant/antlib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/header/messages_fr.properties: -------------------------------------------------------------------------------- 1 | header.missing=En-tête manquante - Le fichier ne contient pas assez de lignes. 2 | header.mismatch=La ligne ne correspond pas à la ligne d''en-tête attendue ''{0}''. 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/naming/messages_es.properties: -------------------------------------------------------------------------------- 1 | name.invalidPattern=El nombre ''{0}'' debe coincidir con el patrón ''{1}''. 2 | illegal.abstract.class.name=El nombre ''{0}'' debe coincidir con el patrón ''{1}''. 3 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputPackageDeclaration.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | class InputPackageDeclaration { 4 | public String value; 5 | 6 | private void get(){ 7 | } 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/comments/InputCommentsTest_1.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.comments; 2 | public class /* 3 | i'mcomment567 4 | */ 5 | InputCommentsTest_1 6 | { // comment to left curly brace 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/InputBadTag.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc; 2 | 3 | /** 4 | * The following is a bad tag. 5 | * @mytag Hello 6 | */ 7 | public class InputBadTag 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/InputTestNumberFomatException.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc; 2 | 3 | /**
  • a' {@link EntityEntry} (by way of {@link #;}
*/ 4 | class InputTestNumberFomatException{} -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/InputGrammar.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | /** 3 | * Input for grammar test. 4 | */ 5 | public class InputGrammar 6 | { 7 | int ÃЯ = 1; // illegal, unless UTF-8 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/Gh47.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | import java.util.List; 4 | 5 | public class Gh47 6 | { 7 | public List[]> listOfListOFArrays; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/indentation/messages_de.properties: -------------------------------------------------------------------------------- 1 | indentation.error={0} bei Einrücktiefe {1} nicht an korrekter Einrücktiefe {2} 2 | indentation.child.error=Kind von {0} bei Einrücktiefe {1} nicht an korrekter Einrücktiefe {2} 3 | 4 | -------------------------------------------------------------------------------- /src/site/resources/files/suppressions_none.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/InputOneTopLevelClassNoPublic.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | class InputOneTopLevelClassNoPublic 4 | { 5 | 6 | } 7 | 8 | class InputOneTopLevelClassNoPublic2 9 | { 10 | 11 | } -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/indentation/messages_es.properties: -------------------------------------------------------------------------------- 1 | indentation.error={0} en el nivel de sangrado {1} no está al nivel correcto, {2} 2 | indentation.child.error={0} el descendiente en el nivel de sangrado {1} no está al nivel correcto, {2} 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/indentation/messages_pt.properties: -------------------------------------------------------------------------------- 1 | indentation.error={0} no nível de indentação {1} não está na indentação correcta, {2} 2 | indentation.child.error=Filho de {0} no nível de indentação {1} não está na indentação correcta, {2} 3 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/naming/messages_fr.properties: -------------------------------------------------------------------------------- 1 | name.invalidPattern=Le nom ''{0}'' n''est pas conforme à l''expression ''{1}''. 2 | illegal.abstract.class.name=Le nom de la classe abstraite ''{0}'' n''est pas conforme à l''expression ''{1}''. 3 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/java.header: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Test case file for checkstyle. 3 | // Created: 2001 4 | //////////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/InputEmptyLineSeparatorMultipleFieldsInClass.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | public class InputEmptyLineSeparatorMultipleFieldsInClass 4 | { 5 | int first; 6 | int second; 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/indentation/InputAnnotationDefinition.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.indentation; //indent:0 exp:0 2 | 3 | @interface AnnotationDefinition { //indent:0 exp:0 4 | int value = 1; //indent:4 exp:4 5 | } //indent:0 exp:0 6 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/indentation/messages_fr.properties: -------------------------------------------------------------------------------- 1 | indentation.error={0} au niveau d''indentation {1} n''est pas indenté correctement ({2}) 2 | indentation.child.error=Le fils de {0} au niveau d''identation {1} n''est pas indenté correctement ({2}) 3 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/HideUtilityClassConstructor.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | public class HideUtilityClassConstructor { 4 | 5 | protected HideUtilityClassConstructor() { 6 | //does nothing 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /src/test/resources/com/puppycrawl/tools/checkstyle/InputNewlineLfAtEndOfFile.java eol=lf 2 | /src/test/resources/com/puppycrawl/tools/checkstyle/InputNewlineCrlfAtEndOfFile.java eol=crlf 3 | /src/test/resources/com/puppycrawl/tools/checkstyle/InputNewlineCrAtEndOfFile.java -text 4 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/modifier/messages.properties: -------------------------------------------------------------------------------- 1 | redundantModifier=Redundant ''{0}'' modifier. 2 | annotation.order=''{0}'' annotation modifier does not precede non-annotation modifiers. 3 | 4 | mod.order=''{0}'' modifier out of order with the JLS suggestions. 5 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/InputVararg.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | /** 4 | * Input for vararg test. 5 | */ 6 | public class InputVararg 7 | { 8 | public static void main(String... args) 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/suppressions_none.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/messages_fi.properties: -------------------------------------------------------------------------------- 1 | noNewlineAtEOF=Tiedosto ei pääty rivinvaihtoon. 2 | 3 | todo.match=Kommentti on to-do formaatin ''{0}'' mukainen. 4 | 5 | upperEll=Pitää olla iso ''L''. 6 | 7 | translation.missingKey=Käännösavain ''{0}'' puuttuu. 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/InputStaticModifierInInterface.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | public interface InputStaticModifierInInterface 3 | { 4 | static int f() 5 | { 6 | int someName = 5; 7 | return someName; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/included.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_NoFailureForRedundantImports.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.awt.Button; 4 | import java.awt.Button; 5 | 6 | public class InputImportOrder_NoFailureForRedundantImports { 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/InputNoWhiteSpaceAfterCheckFormerNpe.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | public class InputNoWhiteSpaceAfterCheckFormerNpe 4 | { 5 | private int[] getSome() { 6 | return new int[4]; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter7javadoc/rule711generalform/InputSingleLineJavadocCheckError.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter7javadoc.rule711generalform; 2 | 3 | public class InputSingleLineJavadocCheckError { 4 | /** {@customTag} */ //warn 5 | void bar() {} 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/javadoc/javadocTags/Serial.txt: -------------------------------------------------------------------------------- 1 | @serial field description 2 | on few lines 3 | and even here 4 | @serial include 5 | @serial exclude 6 | @serialField myField myObjectStreamField description of my serial field 7 | @serialData The data-description documents -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/import-control_broken.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/header/messages_tr.properties: -------------------------------------------------------------------------------- 1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) 2 | 3 | header.mismatch = Satır, beklenen başlık satırı olan ''{0}'' ile eşleşmiyor. 4 | header.missing = Başlık eksik - dosyada yeterli satır yok. 5 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputRightCurlyEmptyAbstractMethod.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | abstract class CharSequenceReader{ 3 | 4 | abstract void moveTo(double deltaX, double deltaY); 5 | 6 | void foo() { 7 | while (true); 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrderNoValid.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.util.Map; 4 | import java.util.Map.Entry; 5 | import java.util.NoSuchElementException; 6 | 7 | public class InputCustomImportOrderNoValid { 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/InputEmptyLineSeparatorMultipleImportEmptyClass.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | import java.util.Calendar; 4 | import java.util.Date; 5 | 6 | public class InputEmptyLineSeparatorMultipleImportEmptyClass 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputRegexpHeader2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import java.awt.*; 4 | import java.awt.event.*; 5 | import java.io.*; 6 | 7 | /** 8 | * 9 | * blah blah 10 | * @see foo 11 | */ 12 | public class InputRegexpHeader2 13 | { 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/import-control_wrong.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/modifier/messages_es.properties: -------------------------------------------------------------------------------- 1 | redundantModifier=Modificador ''{0}'' redundante. 2 | annotation.order=El modificador de anotación ''{0}'' no precede a los modificadores normales. 3 | 4 | mod.order=Modificador ''{0}'' desordenado según las sugerencias de la JLS. 5 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/empty_configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassBad3.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter3filestructure.rule341onetoplevel; 2 | 3 | public enum OneTopLevelClassBad3 {} //ok 4 | 5 | interface FooIn {} // warn 6 | 7 | class FooClass {} // warn 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_MultiplePatternMatches.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.io.File; 4 | 5 | import org.*; 6 | import org.myOrgorgan.Test; 7 | 8 | public class InputImportOrder_WildcardUnspecified { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/modifier/messages_fr.properties: -------------------------------------------------------------------------------- 1 | redundantModifier=Mot-clef ''{0}'' redondant. 2 | 3 | annotation.order=Le modificateur d''annotation ''{0}'' ne précède pas les autres modificateurs. 4 | 5 | mod.order=Le mot-clef ''{0}'' n''apparaît pas dans l''ordre préconisé par les JLS. 6 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/missing_config_parent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportControl.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.awt.Image; 4 | import javax.swing.border.*; 5 | import java.io.File; 6 | import static java.awt.Button.ABORT; 7 | 8 | public class InputImportControl 9 | { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/suppressions_no_check.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest1.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars.java8; 2 | 3 | import java.util.List; 4 | 5 | public class InputAnnotationsTest1 { 6 | 7 | @NonNull 8 | List numbers; 9 | 10 | @interface NonNull { 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/suppressions_no_file.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/modifier/messages_de.properties: -------------------------------------------------------------------------------- 1 | redundantModifier=Überflüssiger Modifier ''{0}''. 2 | annotation.order=''{0}'' Annotation-Modifier sollte vor den anderen Modifiern stehen. 3 | 4 | mod.order=Modifier ''{0}'' weicht von der empfohlenen Modifier-Reihenfolge aus der Java-Sprachdefinition ab. 5 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/HideUtilityClassContructor3041574_2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | import java.io.Serializable; 4 | /*input file*/ 5 | public class HideUtilityClassContructor3041574_2 implements Serializable { 6 | private static final long serialVersionUID = 1L; 7 | 8 | } -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/messages.properties: -------------------------------------------------------------------------------- 1 | general.fileNotFound=File not found! 2 | general.exception=Got an exception - {0} 3 | 4 | # 5 | # for DefaultLogger.java 6 | # 7 | DefaultLogger.addException=Error auditing {0} 8 | DefaultLogger.auditStarted=Starting audit... 9 | DefaultLogger.auditFinished=Audit done. 10 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/InputModifier2.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle; 3 | import java.util.Comparator; 4 | public interface InputModifier2 extends Comparator { 5 | @Override 6 | default int compare(Integer a, Integer b) { 7 | return 0; 8 | } 9 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/HideUtilityClassContructor3041574_1.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | import java.io.Serializable; 4 | /*input file*/ 5 | public abstract class HideUtilityClassContructor3041574_1 implements Serializable { 6 | private static final long serialVersionUID = 1L; 7 | 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/UtilityClassConstructorPrivate.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | public class UtilityClassConstructorPrivate { 4 | private UtilityClassConstructorPrivate() {} 5 | 6 | private static int value = 0; 7 | public static void foo (int val) { value = val;} 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/UtilityClassConstructorPublic.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | public class UtilityClassConstructorPublic { 4 | public UtilityClassConstructorPublic() {} 5 | 6 | private static int value = 0; 7 | public static void foo (int val) { value = val;} 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/naming/InputAbstractClassNameFormerFalsePositive.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.naming; 2 | 3 | public class InputAbstractClassNameFormerFalsePositive 4 | { 5 | class Abstract { 6 | 7 | } 8 | 9 | class AbstractClass { 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputAvoidStaticImportNestedClass.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | public class InputAvoidStaticImportNestedClass{ 4 | public static Integer zero=0; 5 | 6 | public static class InnerClass { 7 | public static Integer one=1; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/naming/InputTypeName.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.naming; 2 | 3 | class inputHeaderClass { 4 | 5 | public interface inputHeaderInterface {}; 6 | //comment 7 | public enum inputHeaderEnum { one, two }; 8 | 9 | public @interface inputHeaderAnnotation {}; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/suppressions_bad_int.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/InputDoWhileWhitespaceAround.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | public class InputDoWhileWhitespaceAround { 4 | 5 | public void doWhileTest(int n) { 6 | int k = 0; 7 | do { 8 | ++k; 9 | } while(k < n); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/OuterTypeNumberCheckInput.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | /**Contains empty inner class for OuterTypeNumberCheckTest*/ 4 | public class OuterTypeNumberCheckInput { 5 | 6 | /** Just empty inner class*/ 7 | private class InnerClass { 8 | // Do nothing 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/InputOneTopLevelEnum2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | enum InputOneTopLevelEnum2inner1 { 4 | VALUE1, VALUE2; 5 | } 6 | 7 | public enum InputOneTopLevelEnum2 { 8 | VALUE1, VALUE2; 9 | } 10 | 11 | enum InputOneTopLevelEnum2inner2 { 12 | VALUE1, VALUE2; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/messages_fi.properties: -------------------------------------------------------------------------------- 1 | general.fileNotFound=Tiedostoa ei löydy! 2 | general.exception=Poikkeus - {0} 3 | 4 | # 5 | # for DefaultLogger.java 6 | # 7 | DefaultLogger.addException=Virhe {0}:n tarkistuksessa 8 | DefaultLogger.auditStarted=Aloitetaan tarkistus... 9 | DefaultLogger.auditFinished=Tarkistus valmis. 10 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/blocks/InputSingleLineLambda.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.blocks; 3 | public class InputSingleLineLambda { 4 | 5 | static Runnable r1 = ()->System.out.println("Hello world one!"); 6 | static Runnable r2 = () -> System.out.println("Hello world two!"); 7 | } -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/indentation/NewHandlerTestInput.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.indentation; 2 | 3 | /** 4 | * 5 | * @author IljaDubinin 6 | */ 7 | public class NewHandlerTestInput 8 | { 9 | 10 | public static void test() { 11 | method(ArrayList::new); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputImmutableStarImport2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import com.google.common.collect.*; 4 | //config.immutableClassName=com.google.google.common.ImmutableSet 5 | public final class InputImmutableStarImport2 6 | { 7 | public final ImmutableSet set = null; // No warning here 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputMissingCtor.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputMissingCtor 4 | { 5 | } 6 | // we shouln't flag abstract classes 7 | abstract class AbstactClass { 8 | } 9 | 10 | // this class has ctor 11 | class CorrectClass { 12 | CorrectClass() { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/comments/InputCommentsTest_2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.comments; 2 | // my class 3 | class InputCommentsTest_2 4 | { 5 | /** 6 | * Lines method. 7 | * 8 | * @return string. 9 | */ 10 | protected String line() 11 | { 12 | return null; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/missing_config_name.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrderImportsContainingJava.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.io.File; 4 | import javax.lang.model.SourceVersion; 5 | import com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck; 6 | 7 | public class InputCustomImportOrderImportsContainingJava {} 8 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/messages_es.properties: -------------------------------------------------------------------------------- 1 | general.fileNotFound=¡Fichero no encontrado! 2 | general.exception=Ocurrió una excepción - {0} 3 | 4 | # 5 | # for DefaultLogger.java 6 | # 7 | DefaultLogger.addException=Error auditando {0} 8 | DefaultLogger.auditStarted=Comenzando auditoría... 9 | DefaultLogger.auditFinished=Auditoría concluida. 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/annotation/AnnotationsUseStyleParams.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.annotation; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | 6 | public class AnnotationsUseStyleParams 7 | { 8 | @Target({}) 9 | public @interface myAnn { 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/missing_property_name.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/missing_property_value.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/indentation/messages_tr.properties: -------------------------------------------------------------------------------- 1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) 2 | 3 | indentation.child.error = {0} ifadesi doğru hizalanmamış. Bulunduğu sütun {1}, olması gereken sütun {2}. 4 | indentation.error = {0} ifadesi doğru hizalanmamış. Bulunduğu sütun {1}, olması gereken sütun {2}. 5 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/messages_fr.properties: -------------------------------------------------------------------------------- 1 | general.fileNotFound=Fichier non trouvé ! 2 | general.exception=Exception levée : {0} 3 | 4 | # 5 | # for DefaultLogger.java 6 | # 7 | DefaultLogger.addException=Une erreur est survenue {0} 8 | DefaultLogger.auditStarted=Début de la vérification... 9 | DefaultLogger.auditFinished=Vérification terminée. 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/InputOneTopLevelInterface2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | interface InputOneTopLevelInterface2inner1 { 4 | int foo(); 5 | } 6 | 7 | public interface InputOneTopLevelInterface2 { 8 | int foo(); 9 | } 10 | 11 | interface InputOneTopLevelInterface2inner2 { 12 | int foo(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/messages_de.properties: -------------------------------------------------------------------------------- 1 | general.fileNotFound=Datei nicht gefunden! 2 | general.exception=Folgende Ausnahme ist aufgetreten - {0} 3 | 4 | # 5 | # for DefaultLogger.java 6 | # 7 | DefaultLogger.addException=Fehler beim Prüfen von {0} 8 | DefaultLogger.auditStarted=Beginne Prüfung... 9 | DefaultLogger.auditFinished=Prüfung beendet. 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_HonorsTokensProperty.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; 4 | import static java.awt.Button.ABORT; 5 | import java.awt.Dialog; 6 | import java.awt.Button; 7 | 8 | public class InputImportOrder_HonorsTokensProperty { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrderStaticGroupOrder.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import static java.lang.Math.abs; 4 | import static org.abego.treelayout.Configuration.AlignmentInLevel; 5 | 6 | import org.*; 7 | 8 | import java.util.Set; 9 | 10 | public class InputImportOrderStaticGroupOrder 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputDefaultMethodsTest.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public interface InputDefaultMethodsTest { 4 | 5 | default public void doSomething(){ 6 | System.out.println("Something done."); 7 | } 8 | 9 | public void doOneMoreThing(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/pkginfo/valid/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a valid package documentation. <--- See the period after the 3 | * first sentence. 4 | * 5 | *

6 | * hurray for javadocs in html 7 | *
8 | * with a legacy non-closed br element 9 | *

10 | */ 11 | package com.puppycrawl.tools.checkstyle.javadoc.pkginfo.valid; 12 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/blocks/messages_ja.properties: -------------------------------------------------------------------------------- 1 | 2 | block.empty=空の {0} ブロックです。 3 | block.nested=ネストしたブロックは避けてください。 4 | block.noStmt=少なくとも1文はあるはずです。 5 | 6 | line.alone=''{0}'' は独立した行にあるべきです。 7 | line.new=''{0}'' は新しい行にあるべきです。 8 | line.previous=''{0}'' は前の行にあるべきです。 9 | line.same=''{0}'' は同一行にあるべきです。 10 | 11 | needBraces=''{0}'' 文では '''{}''' を使用しなければなりません。 12 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/sizes/messages_fi.properties: -------------------------------------------------------------------------------- 1 | maxLen.file=Tiedoston pituus on {0,number,integer} riviä (suurin sallittu on {1,number,integer}). 2 | maxLen.method=Metodin pituus on {0,number,integer} riviä (suurin sallittu on {1,number,integer}). 3 | maxLineLen=Rivi on pidempi kuin {0,number,integer} merkkiä. 4 | maxParam=Enemmän kuin {0,number,integer} parametriä. 5 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest18.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | import java.util.function.Predicate; 3 | public class InputLambdaTest19 { 4 | 5 | static Predicate isEqual(Object targetRef) { 6 | return (null == targetRef) 7 | ? null 8 | : object -> targetRef.equals(object); 9 | } 10 | } -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/imports/InputRedundantImportCheck_UnnamedPackage.java: -------------------------------------------------------------------------------- 1 | import java.util.List; 2 | import java.util.List; 3 | import java.util.Arrays; 4 | import java.lang.String; 5 | import static java.lang.Math.PI; 6 | 7 | public class InputRedundantImportCheck_UnnamedPackage 8 | { 9 | public static double pi=PI; 10 | public List myList; 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/whitespace/InputGenericWhitespaceMethodRef.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.whitespace; 3 | 4 | public class InputGenericWhitespaceMethodRef 5 | { 6 | final Supplier> function = Optional::empty; 7 | final Supplier> function = Optional:: empty; 8 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/AnnotatedVisibilitySameTypeName.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import org.junit.rules.TemporaryFolder; 4 | 5 | import com.puppycrawl.tools.checkstyle.LocalAnnotations.Rule; 6 | 7 | public class AnnotatedVisibilitySameTypeName 8 | { 9 | @Rule 10 | public TemporaryFolder publicJUnitRule = new TemporaryFolder(); 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputIllegalTypeStarImports.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | import java.*; 4 | import java.util.*; 5 | import org.abego.treelayout.*; 6 | import com.*; 7 | //configuration "illegalClassNames": List 8 | public class InputIllegalTypeStarImports 9 | { 10 | List l = new LinkedList<>(); //WARNING 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputRequireThis2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputRequireThis2 { 4 | private final int number = 1; 5 | 6 | public int check() { 7 | int sum = number; 8 | sum += other(); 9 | return sum; 10 | } 11 | 12 | private int other() { 13 | return 0; 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrderStaticGroupOrderBottom.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import org.*; 4 | 5 | import java.util.Set; 6 | 7 | import static java.lang.Math.PI; 8 | import static org.abego.treelayout.Configuration.AlignmentInLevel; 9 | 10 | public class InputImportOrderStaticGroupOrderBottom 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrderStaticOnDemandGroupOrderBottom.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import org.*; 4 | 5 | import java.util.Set; 6 | 7 | import static java.lang.Math.*; 8 | import static org.abego.treelayout.Configuration.*; 9 | 10 | public class InputImportOrderStaticOnDemandGroupOrderBottom 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/modifier/messages_tr.properties: -------------------------------------------------------------------------------- 1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) 2 | 3 | annotation.order = ''{0}'' anotasyon niteleyicisi, anotasyon olmayan niteleyicilerden önce kullanılmalı. 4 | 5 | mod.order = ''{0}'' niteleyicisi, Java tarafından önerilen sırada değil. 6 | 7 | redundantModifier = Gereksiz ''{0}'' niteleyicisi. 8 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/naming/InputConstantNames.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.naming; 2 | 3 | import java.io.ObjectStreamField; 4 | 5 | public class InputConstantNames 6 | { 7 | private static final long serialVersionUID = 1L; //should be ignored 8 | private static final ObjectStreamField[] serialPersistentFields = {}; // should be ignored too 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/InputGenericWhitespaceInnerClassCheck.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | import java.util.List; 4 | 5 | public class InputGenericWhitespaceInnerClassCheck 6 | { 7 | private List.InnerClass> field; 8 | 9 | public class InnerClass { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_tr.properties: -------------------------------------------------------------------------------- 1 | regexp.exceeded = Satır, geçersiz ''{0}'' kalıbıyla eşleşiyor. 2 | regexp.minimum = Dosya, ''{1}'' kalıbı için en az {0} eşleşme içermiyor. 3 | 4 | illegal.regexp = Satırda geçersiz bir kalıp var: ''{0}''. 5 | required.regexp = Dosyada olması gereken ''{0}'' kalıbı yok. 6 | duplicate.regexp = Tekrarlanmýþbir kalıp bulundu: ''{0}''. 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrderCaseInsensitive.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.io.File; 4 | import java.io.InputStream; 5 | import java.io.IOException; 6 | import java.io.Reader; 7 | import static java.io.InputStream.*; 8 | import static java.io.IOException.*; 9 | 10 | public class InputImportOrderCaseInsensitive { 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrderStaticOnDemandGroupOrder.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import static java.lang.Math.*; 4 | import static org.abego.treelayout.Configuration.*; 5 | 6 | import org.*; 7 | 8 | import java.util.Set; 9 | import org.junit.Test; 10 | 11 | public class InputImportOrderStaticOnDemandGroupOrder 12 | { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/pkginfo/annotation/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a valid package documentation. <--- See the period after the 3 | * first sentence. 4 | * 5 | *

6 | * hurray for javadocs in html 7 | *
8 | * with a legacy non-closed br element 9 | *

10 | */ 11 | @Deprecated 12 | package com.puppycrawl.tools.checkstyle.javadoc.pkginfo.annotation; 13 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/messages_tr.properties: -------------------------------------------------------------------------------- 1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) 2 | 3 | DefaultLogger.addException = {0} denetlenirken hata oluştu. 4 | DefaultLogger.auditFinished = Denetleme tamamlandı. 5 | DefaultLogger.auditStarted = Denetleme başlıyor... 6 | 7 | general.exception = Bir istisna yakalandı - {0} 8 | general.fileNotFound = Dosya bulunamadı! 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportBug.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.net.URL; 4 | 5 | public class InputImportBug { 6 | //same as a class name 7 | private static String URL = "This is a String object"; 8 | 9 | public InputImportBug() throws Exception { 10 | URL url = new URL("file://this.is.a.url.object"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/naming/InputMemberName.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.naming; 2 | 3 | public class InputMemberName 4 | { 5 | public int mPublic; 6 | protected int mProtected; 7 | int mPackage;//comment 8 | private int mPrivate; 9 | 10 | public int _public; 11 | protected int _protected; 12 | int _package; 13 | private int _private; 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/InputSwitchWhitespaceAround.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | public class InputSwitchWhitespaceAround { 4 | 5 | public void switchTest(int k) { 6 | switch(k) { 7 | default: 8 | break; 9 | } 10 | switch (k) { 11 | case 7: 12 | break; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/NoLineWrapGoodInput.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | import com.google.common.annotations.Beta; 4 | 5 | import javax.accessibility.AccessibleAttributeSequence; 6 | import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; 7 | 8 | public class NoLineWrapGoodInput { 9 | 10 | public void fooMethod() { 11 | // 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/imports/messages_fi.properties: -------------------------------------------------------------------------------- 1 | import.avoidStar=Älä käytä import-muotoa ''.*'' - {0}. 2 | import.duplicate=Duplikaatti-import rivin {0,number,integer} kanssa - {1}. 3 | import.illegal=Import sääntöjenvastaisesta paketista - {0}. 4 | import.lang=Tarpeeton import java.lang-paketista - {0}. 5 | import.same=Tarpeeton import samasta paketista - {0}. 6 | import.unused=Käyttämätön import - {0}. 7 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/IntMethodAnnotation.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.METHOD) 10 | public @interface IntMethodAnnotation{ 11 | int value(); 12 | } -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/SemicolonBetweenImports.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | import java.util.Arrays; 4 | ; 5 | import java.util.ArrayList; 6 | /** 7 | * Compilable by javac, but noncompilable by eclipse due to 8 | * this bug 9 | */ 10 | public class SemicolonBetweenImports 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/metrics/InputBooleanExpressionComplexityNPE.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.metrics; 2 | 3 | public class InputBooleanExpressionComplexityNPE 4 | { 5 | static { 6 | try { 7 | System.out.println("a"); 8 | } catch (IllegalStateException | IllegalArgumentException e) { 9 | throw new RuntimeException(e); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_de.properties: -------------------------------------------------------------------------------- 1 | regexp.exceeded=Zeile trifft auf das verbotene Muster ''{0}'' zu. 2 | regexp.minimum=Datei enthält weniger als die erforderlichen {0} Treffer für das Muster ''{1}''. 3 | 4 | illegal.regexp=Die Zeile entspricht dem verbotenen Muster ''{0}''. 5 | required.regexp=Keine Zeile entspricht dem Muster ''{0}''. 6 | duplicate.regexp=Duplikat gefunden nach dem Muster ''{0}''. 7 | -------------------------------------------------------------------------------- /src/site/resources/js/google-analytics.js: -------------------------------------------------------------------------------- 1 | 2 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 3 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 4 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 5 | })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 6 | 7 | ga('create', 'UA-63181194-1', 'auto'); 8 | ga('send', 'pageview'); 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/including.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | ]> 8 | 9 | 10 | 11 | &includedConfig; 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/app-dev.properties: -------------------------------------------------------------------------------- 1 | # input file for TranslationCheck 2 | 3 | # a key that is available in all translations 4 | hello=Hallo 5 | 6 | # whitespace at end of key should be trimmed before comparing. 7 | # the german translation does not contain whitespace, no error should 8 | # be reported here 9 | cancel=Abbrechen 10 | 11 | # a key that is missing in german translation 12 | #only.english=only english 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/app-stage.properties: -------------------------------------------------------------------------------- 1 | # input file for TranslationCheck 2 | 3 | # a key that is available in all translations 4 | hello=Hello 5 | 6 | # whitespace at end of key should be trimmed before comparing. 7 | # the german translation does not contain whitespace, no error should 8 | # be reported here 9 | cancel = Cancel 10 | 11 | # a key that is missing in german translation 12 | only.english=only english 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/UtilityClassConstructor.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | public class UtilityClassConstructor { 4 | private static int value = 0; 5 | public static void foo (int val) { value = val;} 6 | 7 | public static class Inner { 8 | public int foo; 9 | } 10 | 11 | public static class Inner2 { 12 | public static int foo; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/InputJava7Diamond.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | import java.util.*; 4 | 5 | public class InputJava7Diamond { 6 | HashMap map = new HashMap(); 7 | HashMap map2 = new HashMap<>(); 8 | HashMap> map3 = new HashMap<>(); 9 | ArrayList list = new ArrayList<>(); 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/java8/InputDefaultMethodsTest2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars.java8; 2 | 3 | public class InputDefaultMethodsTest2 { 4 | 5 | public void doSomething(){ 6 | int a = 5; 7 | switch (a) 8 | { 9 | case 0: 10 | break; 11 | 12 | default: 13 | break; 14 | 15 | } 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputModifiedControlVariableEnhancedForLoopVariable.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputModifiedControlVariableEnhancedForLoopVariable { 4 | 5 | public void method2() 6 | { 7 | final String[] lines = {"line1", "line2", "line3"}; 8 | for (String line: lines) { 9 | line = line.trim(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/subdir/including.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | ]> 8 | 9 | 10 | 11 | &includedConfig; 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/package-info.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Annotated package definition to check if import is declared unused 3 | // Created: 2005 4 | //////////////////////////////////////////////////////////////////////////////// 5 | @MyAnnotation 6 | package com.puppycrawl.tools.checkstyle.imports; 7 | 8 | import com.puppycrawl.tools.checkstyle.MyAnnotation; -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/messages_test.properties: -------------------------------------------------------------------------------- 1 | # input file for TranslationCheck 2 | 3 | # a key that is available in all translations 4 | hello=Hello 5 | 6 | # whitespace at end of key should be trimmed before comparing. 7 | # the german translation does not contain whitespace, no error should 8 | # be reported here 9 | cancel = Cancel 10 | 11 | # a key that is missing in german translation 12 | only.english=only english 13 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/design/messages_ja.properties: -------------------------------------------------------------------------------- 1 | design.forExtension=メソッド ''{0}'' は拡張するように設計されていません - abstract か final か空である必要があります。 2 | final.class=クラス {0} は final として宣言すべきです。 3 | interface.type=インタフェースは型を記述するものであり、メソッドを持つべきです。 4 | variable.notPrivate=変数 ''{0}'' は private とし、アクセッサメソッドを持つべきです。 5 | mutable.exception=フィールド ''{0}'' は final 宣言しなければなりません。 6 | throws.count=throws の数が {0,number,integer} (最大 {1,number,integer} まで)です。 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest2.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | 6 | @Schedule 7 | public class InputAnnotationsTest2 { 8 | 9 | 10 | } 11 | 12 | @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 13 | @interface Schedule { 14 | 15 | } -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest6.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class InputLambdaTest6 { 7 | 8 | public void doSomething() { 9 | List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); 10 | 11 | numbers.forEach((value) -> System.out.println(value)); 12 | } 13 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/Bug3553541.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | import java.util.List; 4 | import java.util.ArrayList; 5 | 6 | // Demonstrates the bug #3553541 7 | class Bug3553541 8 | { 9 | List a; 10 | { 11 | a = new ArrayList(); 12 | } 13 | List b; 14 | { 15 | b = new ArrayList(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/messages_test_de.properties: -------------------------------------------------------------------------------- 1 | # input file for TranslationCheck 2 | 3 | # a key that is available in all translations 4 | hello=Hallo 5 | 6 | # whitespace at end of key should be trimmed before comparing. 7 | # the german translation does not contain whitespace, no error should 8 | # be reported here 9 | cancel=Abbrechen 10 | 11 | # a key that is missing in german translation 12 | #only.english=only english 13 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/imports/messages_ja.properties: -------------------------------------------------------------------------------- 1 | import.avoidStar=''.*'' 形式のインポートの使用は避けるべきです - {0}。 2 | import.duplicate={0,number,integer} 行目と重複するインポートです - {1}。 3 | import.illegal=不正なパッケージからのインポートです - {0}。 4 | import.lang=java.lang パッケージからのインポートは冗長です - {0}。 5 | import.same=同一パッケージからのインポートは冗長です - {0}。 6 | import.unused=使用されないインポートです - {0}。 7 | import.ordering=''{0}'' のインポート順序が間違っています。 8 | import.separation=''{0}'' は上のインポート文から1行空けるべきです。 9 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/coding/InputInnerAssignmentLambdaExpressions.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.coding; 3 | 4 | public class InputInnerAssignmentLambdaExpressions { 5 | 6 | private void setAction() { 7 | button.setOnAction(e -> pressed = true); //No violation here 8 | button.setOnAction(e -> { pressed = true; }); //No violation here 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest1.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest1 { 4 | 5 | static Runnable r1 = ()->System.out.println("Hello world one!"); 6 | static Runnable r2 = () -> System.out.println("Hello world two!"); 7 | 8 | public static void main(String[] args) { 9 | r1.run(); 10 | r2.run(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest4.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class InputLambdaTest4 { 7 | 8 | public void doSomething() { 9 | List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); 10 | 11 | numbers.forEach((Integer value) -> System.out.println(value)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/EofBug1667137.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | // Demonstrates the bug #1667137 4 | class EofBug1667137 { 5 | 6 | void checkstyleIsBroken() { 7 | EofBug1667137 borkage = new EofBug1667137() { 8 | 9 | T borked(T brokenness) { 10 | return brokenness; 11 | } 12 | }; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/blocks/messages_fi.properties: -------------------------------------------------------------------------------- 1 | block.empty=Tyhjä {0}-rakenne. 2 | block.nested=Avoid nested blocks. 3 | block.noStmt=Pitää olla ainakin yksi lause. 4 | 5 | line.alone=''{0}'' pitää olla yksinään rivillä. 6 | line.new=''{0}'' pitää olla uudella rivillä. 7 | line.previous=''{0}'' pitää olla edellisellä rivillä. 8 | line.same=''{0}'' pitää olla samalla rivillä. 9 | 10 | needBraces=''{0}''-rakenteen pitää käyttää '''{}'':a. 11 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/naming/messages.properties: -------------------------------------------------------------------------------- 1 | name.invalidPattern=Name ''{0}'' must match pattern ''{1}''. 2 | illegal.abstract.class.name=Name ''{0}'' must match pattern ''{1}''. 3 | method.name.equals.class.name=Method Name ''{0}'' must not equal the enclosing class name. 4 | no.abstract.class.modifier=Class ''{0}'' must be declared as ''abstract''. 5 | 6 | abbreviation.as.word=Abbreviation in name must contain no more than ''{0}'' capital letters. 7 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest5.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | 6 | 7 | public class InputAnnotationsTest5 { 8 | 9 | 10 | void monitorTemperature() throws @Critical Exception { } 11 | 12 | @Target(ElementType.TYPE_USE) 13 | @interface Critical { 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest5.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | 7 | public class InputLambdaTest5 { 8 | 9 | public void doSomething() { 10 | List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); 11 | 12 | numbers.forEach((Integer value) -> {System.out.println(value);}); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest7.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class InputLambdaTest7 { 7 | 8 | public void doSomething() { 9 | List numbers = Arrays.asList(1, 2, 3, 4, 5, 6); 10 | 11 | numbers.forEach((value) -> { 12 | System.out.println(value); 13 | }); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/InputEmbeddedNullChar.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | public class InputEmbeddedNullChar 4 | { 5 | public void doSomething() 6 | { 7 | // String below has an embedded null in it as well as char 036 repeated 8 | // twice - none of shich should cause a problem as they're all valid 9 | // UTF-8 10 | String cctCxlMsg = ":ET:OE:}}"; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest4.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | 6 | 7 | public class InputAnnotationsTest4 { 8 | 9 | public static void methodName(@NotNull String args) { 10 | 11 | } 12 | 13 | @Target(ElementType.TYPE_USE) 14 | @interface NotNull { 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/InputHexFloat.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | /** 4 | * Input for hex float and double test. 5 | */ 6 | public class InputHexFloat 7 | { 8 | double f1 = 0x.0P10; 9 | double f2 = 0x1.P-1; 10 | double f3 = 0Xab1P0; 11 | double f4 = 0Xab1ap+20; 12 | double f5 = 0Xab1ap+20D; 13 | double f6 = 0Xab1ap+20d; 14 | double f7 = 0Xab1ap+20f; 15 | double f8 = 0Xab1ap+20F; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/blocks/messages_pt.properties: -------------------------------------------------------------------------------- 1 | block.empty=Block {0} vazio. 2 | block.nested=Avoid nested blocks. 3 | block.noStmt=Tem que ter pelo menos uma instrução. 4 | 5 | line.alone=''{0}'' deve estar sozinho numa linha. 6 | line.new=''{0}'' deve estar numa nova linha. 7 | line.previous=''{0}'' deve estar na linha anterior. 8 | line.same=''{0}'' deve estar na mesma linha. 9 | 10 | needBraces=A estrutura sintáctica ''{0}'' deve utilizar '''{}'''s. 11 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/messages_ja.properties: -------------------------------------------------------------------------------- 1 | containsTab=行にタブ文字が含まれています。 2 | 3 | line.alone=''{0}'' は独立した行にあるべきです。 4 | line.new=''{0}'' は新しい行にあるべきです。 5 | line.previous=''{0}'' は前の行にあるべきです。 6 | line.same=''{0}'' は同一行にあるべきです。 7 | 8 | ws.followed=''{0}'' の後にホワイトスペースがあります。 9 | ws.notFollowed=''{0}'' の後にホワイトスペースがありません。 10 | ws.notPreceded=''{0}'' の前にホワイトスペースがありません。 11 | ws.preceded=''{0}'' の前にホワイトスペースがあります。 12 | ws.typeCast=''型変換'' の後にホワイトスペースがありません。 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/config-Incorrect.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | # 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/config-classname.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/naming/InputStaticVariableName.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.naming; 2 | 3 | public class InputStaticVariableName { 4 | 5 | /** Interface fields should be skipped */ 6 | interface A { 7 | public static int VAL_0 = 1; 8 | } 9 | 10 | /** Annotation fields should be skipped */ 11 | @interface B { 12 | String name() default ""; 13 | int version() default 0; 14 | public static int VAL_1 = 0; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrap_Good.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter3filestructure.rule332nolinewrap; //ok 2 | 3 | import com.google.common.annotations.Beta; //ok 4 | 5 | import javax.accessibility.AccessibleAttributeSequence; //ok 6 | import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; //ok 7 | 8 | public class NoLineWrap_Good { 9 | 10 | public void fooMethod() { 11 | // 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/naming/messages_tr.properties: -------------------------------------------------------------------------------- 1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) 2 | 3 | illegal.abstract.class.name = ''{0}'' ismi, şu kalıpta olmalı: ''{1}''. 4 | 5 | method.name.equals.class.name = ''{0}'' metodunun adı kendini kapsayan tür ile aynı olmamalı. 6 | 7 | name.invalidPattern = ''{0}'' ismi, şu kalıpta olmalı: ''{1}''. 8 | 9 | no.abstract.class.modifier = ''{0}'' sınıfı ''abstract'' olarak tanımlanmalı. 10 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/sizes/messages_ja.properties: -------------------------------------------------------------------------------- 1 | executableStatementCount=実行文が {0,number,integer} あります(最大 {1,number,integer} まで)。 2 | maxLen.file=ファイルが {0,number,integer} 行あります(最大 {1,number,integer} 行まで)。 3 | maxLen.method=メソッドが {0,number,integer} 行あります(最大 {1,number,integer} 行まで)。 4 | maxLen.anonInner=無名インナークラスの長さが {0,number,integer} 行あります(最大 {1,number,integer} 行まで)。 5 | maxLineLen=行が {0,number,integer} 文字を超えています。 6 | maxParam=パラメータ数が {0,number,integer} を超えています。 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputNewlineCrAtEndOfFile.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// // Test case file for checkstyle. // Created: 2015 //////////////////////////////////////////////////////////////////////////////// package com.puppycrawl.tools.checkstyle; /** * Test case for detection of an existing CR newline at EOF, using the * NewlineAtEndOfFileCheck. * @author Martin Steiger **/ public interface InputNewlineCrAtEndOfFile { } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/GuavaFP.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc; 2 | 3 | import com.google.common.base.Function; 4 | 5 | class Foo5 { 6 | 7 | /** 8 | * This class implements the GWT serialization of {@link HashMultimap}. 9 | * 10 | * @author Jord Sonneveld 11 | * 12 | */ 13 | public static > Function valueOfFunction( 14 | Class enumClass) { 15 | return null; 16 | } 17 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsValuePair.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.annotation; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class SuppressWarningsValuePair 7 | { 8 | public static final String UNCHECKED = "unchecked"; 9 | 10 | public static void test() { 11 | @SuppressWarnings(value = UNCHECKED) 12 | final List dummyOne = (List) new ArrayList(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/annotation/NotOverride.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.annotation; 2 | 3 | public class NotOverride 4 | { 5 | /** 6 | * {@inheritDoc} 7 | */ 8 | private void bleh() { 9 | 10 | } 11 | 12 | /** 13 | * {@inheritDoc} 14 | */ 15 | public static void eh() { 16 | 17 | } 18 | 19 | /** 20 | * {@inheritDoc} 21 | */ 22 | public String junk = ""; 23 | 24 | void dodoo() {} 25 | } 26 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/InputRegression1762702.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | /** 4 | * Input for HideUtilityClassConstructorCheck, a non utility class that has 5 | * 6 | * @author lkuehne 7 | */ 8 | public class InputRegression1762702 9 | { 10 | public long constructionTime = System.currentTimeMillis(); 11 | 12 | public static InputRegression1762702 create() 13 | { 14 | return new InputRegression1762702(); 15 | } 16 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/InputJavadocMethodIgnoreNameRegex.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc; 2 | 3 | public class InputJavadocMethodIgnoreNameRegex 4 | { 5 | private void foo() { 6 | 7 | } 8 | 9 | private void foo88() { 10 | 11 | } 12 | 13 | private void foo2() { 14 | int x = 0; 15 | int k = x >> 2; 16 | String s = String.valueOf(k); 17 | boolean b = false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/InputSummaryJavadocCheckNoPeriod.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc; 2 | 3 | public class InputSummaryJavadocCheckNoPeriod 4 | { 5 | /** 6 | * As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)} 7 | */ 8 | void foo3() {} 9 | 10 | /** 11 | * Blabla 12 | */ 13 | void foo4() throws Exception {} 14 | 15 | /** An especially short bit of Javadoc */ 16 | void foo5() {} 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/blocks/messages_es.properties: -------------------------------------------------------------------------------- 1 | block.empty=Bloque {0} vacío. 2 | block.nested=Evitar bloques anidados. 3 | block.noStmt=Debe tener al menos una sentencia. 4 | 5 | line.alone=''{0}'' debería estar solo en una línea. 6 | line.new=''{0}'' debería estar en una nueva línea. 7 | line.previous=''{0}'' debería estar en la línea anterior. 8 | line.same=''{0}'' debería estar en la misma línea. 9 | 10 | needBraces=La construcción ''{0}'' debe usar '''{}'' (llaves). 11 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/config-classname-prop.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/messages_ja.properties: -------------------------------------------------------------------------------- 1 | noNewlineAtEOF=ファイルが新しい行で終了していません。 2 | 3 | todo.match=コメントが to-do の形式 ''{0}'' に合致しています。 4 | 5 | upperEll=大文字の ''L'' を使用すべきです。 6 | 7 | translation.missingKey=キー ''{0}'' がありません。 8 | 9 | missing.switch.default="default" 節の無い switch 文です。 10 | 11 | uncommented.main=コメントではない main メソッドが見つかりました。 12 | 13 | descendant.token.min=''{2}'' の子孫 ''{3}'' の数 {0} が最小数 {1} を満たしません。 14 | descendant.token.max=''{2}'' の子孫 ''{3}'' の数 {0} が最大数 {1} を超えています。 15 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/InputFinalInDefaultMethods.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | public interface MyInterface { 3 | final int k = 5; //WARNING 4 | 5 | default int defaultMethod(final int x) { 6 | if (k == 5) { 7 | final int t = 24; //No violation here! 8 | for (; ;) { 9 | final String s = "some"; //No violation here! 10 | } 11 | } 12 | final int square = x * x; //No violation here! 13 | return square; 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest3.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | 6 | 7 | 8 | public class InputAnnotationsTest3 { 9 | 10 | public static void methodName(Object str) { 11 | String myString = (@NonNull String) str; 12 | } 13 | 14 | @Target(ElementType.TYPE_USE) 15 | @interface NonNull { 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckInput2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.checks.sizes; 2 | 3 | public enum MethodCountCheckInput2 { 4 | 5 | RED { 6 | @Override void something() {}; 7 | }, 8 | 9 | BLUE { 10 | @Override void something() {}; 11 | protected void other1() {}; 12 | private void other2() {}; 13 | }; 14 | 15 | @Override public String toString() { return ""; }; 16 | 17 | abstract void something(); 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputImmutableStarImport.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import com.puppycrawl.tools.checkstyle.InputImmutable; 4 | import com.puppycrawl.tools.checkstyle.InetSocketAddress.*; 5 | 6 | public final class InputImmutableStarImport 7 | { 8 | public final Arrays f = null; // If Arrays is specified as immutable class, no matter of canonical name 9 | // no warning will be here, star imports are out of consideration 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_WildcardUnspecified.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | // groups are configured as follows 4 | // com.puppycrawl,*,java 5 | // the trailing javax.crypto.Cipher; should be flagged as an error. 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.util.Iterator; 10 | 11 | import com.puppycrawl.tools.checkstyle.imports.InputImportBug; 12 | 13 | public class InputImportOrder_WildcardUnspecified { 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/design/messages_fi.properties: -------------------------------------------------------------------------------- 1 | design.forExtension=Metodia ''{0}'' ei ole suunniteltu laajennettavaksi - pitäisi olla abstrakti, final tai tyhjä. 2 | final.class=Luokan {0} pitäisi olla final. 3 | interface.type=Rajapintojen pitäisi kuvata tyyppiä ja siten sisältää metodeja. 4 | variable.notPrivate=Muuttujan ''{0}'' pitää olla private ja sillä pitää olla accessorimetodit. 5 | throws.count=Heitettyjen poikkeusten lukumäärä on {0,number,integer} (suurin sallittu on {1,number,integer}). 6 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputIllegalThrowsCheckIgnoreOverriddenMethods.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputIllegalThrowsCheckIgnoreOverriddenMethods 4 | extends InputIllegalThrowsCheck 5 | { 6 | @Override 7 | public void methodTwo() throws RuntimeException { 8 | 9 | } 10 | 11 | @java.lang.Override 12 | public java.lang.Throwable methodOne() throws RuntimeException { 13 | return null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrderThirdPartyPackage.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import org.abego.treelayout.*; 4 | 5 | import org.junit.*; 6 | 7 | import java.*; 8 | import javax.swing.*; 9 | 10 | import static sun.tools.util.CommandLine.parse; 11 | import static sun.tools.util.ModifierFilter.ALL_ACCESS; 12 | import static sun.tools.util.ModifierFilter.ALL_ACCESS; 13 | 14 | public class InputCustomImportOrderThirdPartyPackage 15 | { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_Wildcard.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | // groups are configured as follows 3 | // com.puppycrawl,*,java 4 | // the trailing javax.crypto.Cipher; should be flagged as an error. 5 | 6 | import com.puppycrawl.tools.checkstyle.imports.InputImportOrder_Above; 7 | import javax.crypto.BadPaddingException; 8 | import java.util.List; //comment test 9 | import javax.crypto.Cipher; 10 | 11 | public class InputImportOrder_Wildcard { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/naming/messages_de.properties: -------------------------------------------------------------------------------- 1 | name.invalidPattern=''{0}'' entspricht nicht dem Muster ''{1}''. 2 | illegal.abstract.class.name=Klassenname ''{0}'' entspricht nicht dem Muster ''{1}''. 3 | method.name.equals.class.name=Methodenname ''{0}'' darf nicht der gleiche sein wie der Name der Klasse. 4 | no.abstract.class.modifier=Die Klasse ''{0}'' muss ''abstract'' deklariert werden. 5 | 6 | abbreviation.as.word=Die Abkürzung in diesem Bezeichner darf höchstens aus ''{0}'' Großbuchstaben bestehen. 7 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest6.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Target; 6 | import java.util.List; 7 | 8 | public class InputAnnotationsTest6 { 9 | 10 | abstract class UnmodifiableList implements @Readonly List<@Readonly T> { 11 | } 12 | 13 | @Target(ElementType.TYPE_USE) 14 | @interface Readonly { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrderSamePackage2.java: -------------------------------------------------------------------------------- 1 | //Moved to noncompilable because UT requires imports from the same package 2 | package java.util.concurrent; 3 | import java.util.regex.Pattern; 4 | import java.util.List; 5 | import java.util.regex.Matcher; 6 | import java.util.StringTokenizer; 7 | import java.util.*; 8 | import java.util.concurrent.AbstractExecutorService; 9 | import java.util.concurrent.*; 10 | 11 | public class InputCustomImportOrderSamePackage2 { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/indentation/messages.properties: -------------------------------------------------------------------------------- 1 | indentation.error.multi=''{0}'' have incorrect indentation level {1}, expected level should be one of the following: {2}. 2 | indentation.child.error.multi=''{0}'' child have incorrect indentation level {1}, expected level should be one of the following: {2}. 3 | indentation.error=''{0}'' have incorrect indentation level {1}, expected level should be {2}. 4 | indentation.child.error=''{0}'' child have incorrect indentation level {1}, expected level should be {2}. 5 | -------------------------------------------------------------------------------- /src/test/java/com/puppycrawl/tools/checkstyle/BaseFileSetCheckTestSupport.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import com.puppycrawl.tools.checkstyle.api.Configuration; 4 | 5 | public class BaseFileSetCheckTestSupport extends BaseCheckTestSupport { 6 | @Override 7 | protected DefaultConfiguration createCheckerConfig( 8 | Configuration aCheckConfig) { 9 | final DefaultConfiguration dc = new DefaultConfiguration("root"); 10 | dc.addChild(aCheckConfig); 11 | return dc; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/blocks/messages_de.properties: -------------------------------------------------------------------------------- 1 | block.empty=Leerer {0}-Block. 2 | block.nested=Verschachtelte Blöcke sollten vermieden werden. 3 | block.noStmt=Muss mindestens ein Statement beinhalten. 4 | 5 | line.alone=''{0}'' sollte allein in der Zeile stehen. 6 | line.new=''{0}'' sollte in einer neuen Zeile stehen. 7 | line.previous=''{0}'' sollte in der vorhergehenden Zeile stehen. 8 | line.same=''{0}'' sollte in derselben Zeile stehen. 9 | 10 | needBraces=Das ''{0}''-Konstrukt muss '''{}''' benutzen. 11 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest9.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | import java.util.List; 6 | 7 | public class InputAnnotationsTest9 { 8 | public static void methodName(Object str) { 9 | List<@Immutable ? extends Comparable> unchangeable; 10 | } 11 | 12 | @Target(ElementType.TYPE_USE) 13 | @interface Immutable { 14 | } 15 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/naming/AbstractMultisetSetCountTester.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.naming; 2 | 3 | public abstract class AbstractMultisetSetCountTester { 4 | 5 | private static final String SUPPORTS_REMOVE = ""; 6 | 7 | @CollectionFeature.Require(absent = SUPPORTS_REMOVE) 8 | public void testSetCount_negative_removeUnsupported() { 9 | } 10 | } 11 | 12 | @interface CollectionFeature { 13 | 14 | public @interface Require 15 | { 16 | String absent(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/coding/InputDefaultComesLast2.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.coding; 3 | public interface JsonTranslator { 4 | 5 | String toJson(Response one, Response two, Response three); 6 | 7 | String toJson(Document document); 8 | 9 | default String toJson(Response one) { 10 | return toJson(one, one, one); 11 | } 12 | 13 | default String toJson(Response one, Response two) { 14 | return toJson(one, one, two); 15 | } 16 | } -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest7.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | import java.util.List; 6 | 7 | public class InputAnnotationsTest7 { 8 | 9 | public static void main(String[] args) { 10 | Object object = new @Interned Object(); 11 | 12 | } 13 | 14 | @Target(ElementType.TYPE_USE) 15 | @interface Interned { 16 | 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/suppressions_multiple.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputNoNewlineAtEndOfFile.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Test case file for checkstyle. 3 | // Created: 2003 4 | //////////////////////////////////////////////////////////////////////////////// 5 | package com.puppycrawl.tools.checkstyle; 6 | 7 | /** 8 | * Test case for detection of missing newlines at EOF, using the 9 | * NewlineAtEndOfFileCheck. 10 | * @author Christopher Lenz 11 | **/ 12 | public interface InputNoNewlineAtEndOfFile 13 | { 14 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/config-classname2-error.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/config-classname2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/blocks/messages_fr.properties: -------------------------------------------------------------------------------- 1 | block.empty=Bloc ''{0}'' vide. 2 | block.nested=Evitez d''imbriquer les blocs. 3 | block.noStmt=Le bloc devrait contenir au moins une instruction. 4 | 5 | line.alone=''{0}'' devrait être seul sur sa ligne. 6 | line.new=''{0}'' devrait être sur une nouvelle ligne. 7 | line.previous=''{0}'' devrait être sur la ligne précédente. 8 | line.same=''{0}'' devrait être sur la même ligne. 9 | 10 | needBraces=L''instruction ''{0}'' devrait utiliser des accolades ('''{''' et '''}'''). 11 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputFinalParametersPrimitiveTypes.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | public class InputFinalParametersPrimitiveTypes 4 | { 5 | void foo(int i) {} //no warning 6 | void foo1(int i, String k, float s) {} //no warning on 'i' and 's' 7 | void foo2(String s, Object o, long l) {} //no warning on 'l' 8 | void foo3(int[] array) {} //warning 9 | void foo4(int i, float x, int[] s) {} //warning on 's' 10 | void foo5(int x, long[] l, String s) {} //warning on 'l' and 's' 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/import-control_one.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputNewlineLfAtEndOfFile.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Test case file for checkstyle. 3 | // Created: 2015 4 | //////////////////////////////////////////////////////////////////////////////// 5 | package com.puppycrawl.tools.checkstyle; 6 | 7 | /** 8 | * Test case for detection of an existing LF newline at EOF, using the 9 | * NewlineAtEndOfFileCheck. 10 | * @author Martin Steiger 11 | **/ 12 | public interface InputNewlineLfAtEndOfFile 13 | { 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/ParenPadWithSpace.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | public class ParenPadWithSpace 4 | { 5 | protected ParenPadWithSpace ( int i ) 6 | { 7 | this (); 8 | toString (); 9 | } 10 | protected ParenPadWithSpace () 11 | { 12 | super (); 13 | } 14 | 15 | public void enhancedFor () 16 | { 17 | int[] i = new int[2]; 18 | for ( int j: i ) { 19 | System.out.println ( j ); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/design/messages_es.properties: -------------------------------------------------------------------------------- 1 | design.forExtension=El método ''{0}'' no está diseñado para ser extendido - necesita ser abstracto, final o vacío. 2 | final.class=La clase {0} debería declararse final. 3 | interface.type=Los interfaces deberían describir tipos y por tanto tener métodos. 4 | variable.notPrivate=La variable ''{0}'' debe ser privada y tener métodos de acceso. 5 | mutable.exception=El campo ''{0}'' debe declararse final. 6 | throws.count=El número de throws es {0,number,integer} (máximo permitido es {1,number,integer}). 7 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/design/messages_pt.properties: -------------------------------------------------------------------------------- 1 | design.forExtension=O método ''{0}'' não foi concebido para extensão - precisa de ser abstracto, final ou vazio. 2 | final.class=A classe {0} deve ser declarada como final. 3 | interface.type=As interfaces devem descrever um tipo e portanto devem ter métodos. 4 | mutable.exception=O campo ''{0}'' deve ser declarado final. 5 | throws.count=O número de \"throws\" é {0,number,integer} (máx. permitido é {1,number,integer}). 6 | variable.notPrivate=Variável ''{0}'' deve ser privada e ter métodos acessores. 7 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/configuration_1_0.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 19 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest14.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | 7 | public class InputLambdaTest14 { 8 | 9 | public static void main(String args[]) { 10 | List numbers = Arrays.asList(1, 2, 3, 4, 5); 11 | 12 | numbers.forEach(first -> { 13 | System.out.println("first"); 14 | System.out.println("second"); 15 | System.out.println("third"); 16 | }); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputMissingSwitchDefault.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | public class InputMissingSwitchDefault { 4 | public void foo() { 5 | int i = 1; 6 | switch (i) { 7 | case 1: i++; break; 8 | case 2: i--; break; 9 | default: return; 10 | } 11 | } 12 | } 13 | 14 | class bad_test { 15 | public void foo() { 16 | int i = 1; 17 | switch (i) { 18 | case 1: i++; break; 19 | case 2: i--; break; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammars/InputJava7StringSwitch.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.grammars; 2 | 3 | /** 4 | * Input for Java 7 String in Switch. 5 | */ 6 | public class InputJava7StringSwitch 7 | { 8 | public static void main(String[] args) { 9 | String mystr = "value" + "2"; 10 | 11 | switch (mystr) { 12 | case "value1": 13 | break; 14 | case "value2": 15 | break; 16 | default: 17 | break; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/imports/messages_es.properties: -------------------------------------------------------------------------------- 1 | import.avoidStar=Usar la importación con ''.*'' debería evitarse - {0}. 2 | import.duplicate=import duplicado en la línea {0,number,integer} - {1}. 3 | import.illegal=Importación de un paquete ilegal - {0}. 4 | import.lang=Importación redundante del paquete java.lang - {0}. 5 | import.same=Importación redundante del mismo paquete - {0}. 6 | import.unused=import no usado - {0}. 7 | import.ordering=Orden incorrecto para el import ''{0}''. 8 | import.separation=''{0}'' debería separarse de los import previos. 9 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/NoLineWrapBadInput.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools. 2 | checkstyle.whitespace; 3 | 4 | import com.google.common.annotations.Beta; 5 | 6 | import javax.accessibility. 7 | AccessibleAttributeSequence; 8 | import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; 9 | 10 | public class 11 | NoLineWrapBadInput { 12 | 13 | public void 14 | fooMethod() { 15 | final int 16 | foo = 0; 17 | } 18 | } 19 | 20 | enum 21 | FooFoo { 22 | } 23 | 24 | interface 25 | InterFoo {} 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputNewlineCrlfAtEndOfFile.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Test case file for checkstyle. 3 | // Created: 2015 4 | //////////////////////////////////////////////////////////////////////////////// 5 | package com.puppycrawl.tools.checkstyle; 6 | 7 | /** 8 | * Test case for detection of an existing CRLF newline at EOF, using the 9 | * NewlineAtEndOfFileCheck. 10 | * @author Martin Steiger 11 | **/ 12 | public interface InputNewlineCrlfAtEndOfFile 13 | { 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/imports/messages_pt.properties: -------------------------------------------------------------------------------- 1 | import.avoidStar=A forma de importação ''.*'' deve ser evitada - {0}. 2 | import.duplicate=Importação duplicada na linha {0,number,integer}. - {1}. 3 | import.illegal=Importação de um pacote ilegal - {0}. 4 | import.lang=Importação redundande do pacote java.lang - {0}. 5 | import.same=Importação redundante do mesmo pacote - {0}. 6 | import.unused=Importação não utilizada - {0}. 7 | import.ordering=Ordenação incorrecta para a importação ''{0}''. 8 | import.separation=''{0}'' deve ser separado das importações anteriores. 9 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest2.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest2 { 4 | 5 | public static void testVoidLambda(TestOfVoidLambdas test) { 6 | System.out.println("Method called"); 7 | test.doSmth(); 8 | } 9 | 10 | 11 | public static void main(String[] args) { 12 | testVoidLambda(() -> System.out.println("Method in interface called")); 13 | } 14 | 15 | private interface TestOfVoidLambdas { 16 | 17 | public void doSmth(); 18 | } 19 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/naming/InputAbstractClassName.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.naming; 2 | 3 | abstract public class InputAbstractClassName { 4 | } 5 | // abstract --> ^Abstract.*$ 6 | abstract class NonAbstractClassName { 7 | } 8 | 9 | abstract class AbstractClassOther { 10 | abstract class NonAbstractInnerClass { 11 | } 12 | } 13 | 14 | class NonAbstractClass { 15 | } 16 | 17 | //^Abstract.*$ --> abstract 18 | class AbstractClass { 19 | } 20 | 21 | abstract class AbstractClassName2 { 22 | class AbstractInnerClass { 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputIllegalThrowsCheck.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | /** Input file */ 3 | public class InputIllegalThrowsCheck { 4 | 5 | public void method() throws NullPointerException 6 | { // no code 7 | } 8 | 9 | public java.lang.Throwable methodOne() throws RuntimeException 10 | { 11 | return null; 12 | } 13 | 14 | public void methodTwo() throws java.lang.RuntimeException, java.lang.Error 15 | { 16 | } 17 | 18 | public void finalize() throws Throwable { 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/messages_fi.properties: -------------------------------------------------------------------------------- 1 | containsTab=Rivi sisältää sarkainmerkin. 2 | 3 | line.alone=''{0}'' pitää olla yksinään rivillä. 4 | line.new=''{0}'' pitää olla uudella rivillä. 5 | line.previous=''{0}'' pitää olla edellisellä rivillä. 6 | line.same=''{0}'' pitää olla samalla rivillä. 7 | 8 | ws.followed=''{0}'':ta seuraa välilyönti. 9 | ws.notFollowed=''{0}'':ta ei seuraa välilyönti. 10 | ws.notPreceded=''{0}'':ta ei edellä välilyönti. 11 | ws.preceded=''{0}'':ta edeltää välilyönti. 12 | ws.typeCast=''tyypin muunnos'':ta ei seuraa välilyönti. 13 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest10.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest10 { 4 | 5 | public static void testVoidLambda(TestOfVoidLambdas test) { 6 | System.out.println("Method called"); 7 | test.doSmth("fef"); 8 | } 9 | 10 | 11 | public static void main(String[] args) { 12 | 13 | testVoidLambda(s1 -> System.out.println(s1)); 14 | } 15 | 16 | private interface TestOfVoidLambdas { 17 | 18 | public void doSmth(String first); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest11.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest11 { 4 | 5 | public static void testVoidLambda(TestOfVoidLambdas test) { 6 | System.out.println("Method called"); 7 | test.doSmth("fef"); 8 | } 9 | 10 | 11 | public static void main(String[] args) { 12 | 13 | testVoidLambda(s1 -> {System.out.println(s1);}); 14 | } 15 | 16 | private interface TestOfVoidLambdas { 17 | 18 | public void doSmth(String first); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrderThirdPartyAndSpecial.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import com.google.common.annotations.GwtCompatible; 4 | import com.google.common.annotations.Beta; 5 | import com.google.common.annotations.VisibleForTesting; 6 | 7 | import org.abego.treelayout.Configuration; 8 | 9 | import static sun.tools.util.ModifierFilter.ALL_ACCESS; 10 | 11 | import com.google.common.annotations.GwtCompatible; 12 | 13 | import antlr.*; 14 | 15 | public class InputCustomImportOrderThirdPartyAndSpecial 16 | { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/InputSummaryJavadocCheckPeriod.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc; 2 | 3 | public class InputSummaryJavadocCheckPeriod 4 | { 5 | /** 6 | * As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)} 7 | */ 8 | void foo3() {} 9 | 10 | /** 11 | * Blabla 12 | */ 13 | void foo4() throws Exception {} 14 | 15 | /** An especially short bit of Javadoc_ */ 16 | void foo5() {} 17 | 18 | /** 19 | * An especially short bit of Javadoc_ 20 | */ 21 | void foo6() {} 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #Eclipse project files 2 | #.classpath till https://issues.apache.org/jira/browse/MECLIPSE-735 3 | #.project till https://issues.apache.org/jira/browse/MECLIPSE-735 4 | .settings 5 | .externalToolBuilders 6 | .classpath 7 | .project 8 | 9 | # Eclipse-CS Checkstyle Plug-In IDE configuration files 10 | .checkstyle 11 | 12 | #Netbeans project files 13 | nbactions.xml 14 | nb-configuration.xml 15 | 16 | #Maven build folder 17 | target 18 | bin 19 | 20 | #Idea project files 21 | checkstyle.iml 22 | .idea 23 | 24 | #Temp files 25 | *~ 26 | 27 | #Virtual machine crash logs 28 | hs_err_pid* 29 | replay_pid* 30 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages.properties: -------------------------------------------------------------------------------- 1 | regexp.exceeded=Line matches the illegal pattern ''{0}''. 2 | regexp.minimum=File does not contain at least {0} matches for pattern ''{1}''. 3 | 4 | illegal.regexp=Line matches the illegal pattern ''{0}''. 5 | required.regexp=Required pattern ''{0}'' missing in file. 6 | duplicate.regexp=Found duplicate pattern ''{0}''. 7 | 8 | regexp.empty=Empty (null) pattern. 9 | regexp.StackOverflowError=java.util.regex.Matcher caused a java.lang.StackOverflowError for pattern ''{1}'' (you may be scanning a binary file instead of text?). 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/messages_pt.properties: -------------------------------------------------------------------------------- 1 | descendant.token.max=Contagem de {0} para ''{2}'' descendente ''{3}'' é excede o número máximo {1}. 2 | descendant.token.min=Contagem de {0} para ''{2}'' descendente ''{3}'' é menos do que o número mínimo {1}. 3 | missing.switch.default=switch sem o ramo \"default\". 4 | noNewlineAtEOF=File does not end with a newline. 5 | todo.match=O comentário condiz com o padrão de tarefa pendente ''{0}''. 6 | translation.missingKey=Falta a chave ''{0}''. 7 | uncommented.main=Método main não comentado encontrado. 8 | upperEll=Deve ser utilizado um ''L'' maiúsculo. 9 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/suppressions_1_0.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 17 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/MyAnnotation.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Annotation for use by package definitions 3 | // Created: 2005 4 | //////////////////////////////////////////////////////////////////////////////// 5 | package com.puppycrawl.tools.checkstyle; 6 | 7 | import java.lang.annotation.Target; 8 | import java.lang.annotation.ElementType; 9 | 10 | /** 11 | * Annotation for use by package definitions 12 | * @author Michael Studman 13 | */ 14 | @Target(value=ElementType.PACKAGE) 15 | public @interface MyAnnotation 16 | { 17 | } -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/blocks/messages_tr.properties: -------------------------------------------------------------------------------- 1 | #Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) 2 | 3 | block.empty = Boş blok bulundu: {0} 4 | block.nested = İç içe bloklar kullanılmamalıdır. 5 | block.noStmt = Blok en az bir ifade içermeli. 6 | 7 | line.alone = ''{0}'' ifadesi satırda tek başına olmalı. 8 | line.new = ''{0}'' ifadesi yeni satırda olmalı. 9 | line.previous = ''{0}'' ifadesi önceki satırda olmalı. 10 | line.same = ''{0}'' ifadesi aynı satırda olmalı. 11 | 12 | needBraces = ''{0}'' yapısı süslü parantezler ('''{}''') kullanmalı. 13 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/sizes/messages_pt.properties: -------------------------------------------------------------------------------- 1 | executableStatementCount=Número de declarações executáveis é {0,number,integer} (máx. permitido são {1,number,integer}). 2 | maxLen.anonInner=Classe interna anóima tem {0,number,integer} linhas (máx. permitido são {1,number,integer}). 3 | maxLen.file=Ficheiro tem {0,number,integer} linhas (máx. permitido são {1,number,integer}). 4 | maxLen.method=Método tem {0,number,integer} linhas (máx. permitido são {1,number,integer}). 5 | maxLineLen=Linha contém mais do que {0,number,integer} caracteres. 6 | maxParam=Mais do que {0,number,integer} parâmetros. 7 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest3.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest3 { 4 | 5 | public static void testVoidLambda(TestOfVoidLambdas test) { 6 | System.out.println("Method called"); 7 | test.doSmth(); 8 | } 9 | 10 | 11 | public static void main(String[] args) { 12 | testVoidLambda(() -> { 13 | System.out.println("Method in interface called"); 14 | }); 15 | } 16 | 17 | private interface TestOfVoidLambdas { 18 | 19 | public void doSmth(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest8.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest8 { 4 | public static void testVoidLambda(TestOfVoidLambdas test) { 5 | System.out.println("Method called"); 6 | test.doSmth("fef", 2); 7 | } 8 | 9 | 10 | public static void main(String[] args) { 11 | 12 | testVoidLambda((s1, s2) -> System.out.println(s1 + s2)); 13 | } 14 | 15 | private interface TestOfVoidLambdas { 16 | 17 | public void doSmth(String first, Integer second); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/naming/InputFinalLocalVariableNameLambda.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.naming; 3 | 4 | public class InputFinalLocalVariableNameLambda { 5 | 6 | private void addTotalValueOfOrder(final AugmentedOrder order) { 7 | final BigDecimal totalValueOfOrder = order.getTransactions().stream() 8 | .reduce(BigDecimal.ZERO, 9 | (t, u) -> t.add(u.getAmount()), 10 | BigDecimal::add); 11 | order.setTotalValueOfOrder(totalValueOfOrder.toPlainString()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/import-control_one-re.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest9.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest9 { 4 | public static void testVoidLambda(TestOfVoidLambdas test) { 5 | System.out.println("Method called"); 6 | test.doSmth("fef", 2); 7 | } 8 | 9 | 10 | public static void main(String[] args) { 11 | 12 | testVoidLambda((s1, s2) -> {System.out.println(s1 + s2);}); 13 | } 14 | 15 | private interface TestOfVoidLambdas { 16 | 17 | public void doSmth(String first, Integer second); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputFinalLocalVariableEnhancedForLoopVariable.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputFinalLocalVariableEnhancedForLoopVariable { 4 | public void method1() 5 | { 6 | final java.util.List list = new java.util.ArrayList<>(); 7 | 8 | for(Object a : list){ 9 | } 10 | } 11 | 12 | public void method2() 13 | { 14 | final int[] squares = {0, 1, 4, 9, 16, 25}; 15 | int x; 16 | for (final int i : squares) { 17 | } 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/annotation/SuppressWarningsConstants.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.annotation; 2 | 3 | import java.util.List; 4 | import java.util.ArrayList; 5 | 6 | public class SuppressWarningsConstants 7 | { 8 | public static final String UNCHECKED = "unchecked"; 9 | 10 | public static void test() { 11 | @SuppressWarnings(UNCHECKED) 12 | final List dummyOne = (List) new ArrayList(); 13 | @SuppressWarnings(SuppressWarningsConstants.UNCHECKED) 14 | final List dummyTwo = (List) new ArrayList(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputParameterAssignment.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | /**Input*/ 3 | public class InputParameterAssignment { 4 | int field; 5 | void foo1(int field) { 6 | int i = field; 7 | this.field = field; 8 | i++; 9 | field = 0; 10 | field += 1; 11 | this.field++; 12 | field--; 13 | } 14 | // without parameters 15 | void foo2() { 16 | field = 0; 17 | } 18 | 19 | void foo3(String field, int field1) { 20 | this.field = (field1 += field.length()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/blocks/messages.properties: -------------------------------------------------------------------------------- 1 | block.empty=Empty {0} block. 2 | block.nested=Avoid nested blocks. 3 | block.noStmt=Must have at least one statement. 4 | 5 | catch.block.empty=Empty catch block. 6 | 7 | line.alone=''{0}'' should be alone on a line. 8 | line.new=''{0}'' should be on a new line. 9 | line.previous=''{0}'' should be on the previous line. 10 | line.same=''{0}'' should be on the same line. 11 | 12 | needBraces=''{0}'' construct must use '''{}'''s. 13 | 14 | line.break.after='''{''' should have line break after. 15 | line.break.before='''}''' should have line break before. 16 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputIllegalCatchCheck.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputIllegalCatchCheck { 4 | public void foo() { 5 | try { //class names 6 | } catch (RuntimeException e) { 7 | } catch (Exception e) { 8 | } catch (Throwable e) { 9 | } 10 | } 11 | 12 | public void bar() { 13 | try { /* fully qualified class names */ 14 | } catch (java.lang.RuntimeException e) { 15 | } catch (java.lang.Exception e) { 16 | } catch (java.lang.Throwable e) { 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrder2.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import static java.io.File.createTempFile; 4 | import static java.awt.Button.ABORT; 5 | import static javax.swing.WindowConstants.*; 6 | 7 | import java.util.List; 8 | import java.util.StringTokenizer; 9 | import java.util.*; 10 | import java.util.concurrent.AbstractExecutorService; 11 | import java.util.concurrent.*; 12 | 13 | import com.puppycrawl.tools.*; 14 | import com.*; 15 | 16 | import com.google.common.*; 17 | import org.junit.*; 18 | 19 | public class InputCustomImportOrder2 { 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/imports/messages_fr.properties: -------------------------------------------------------------------------------- 1 | import.avoidStar=L''utilisation des import.* est prohibé - {0}. 2 | import.duplicate=Import dupliqué à la ligne {0,number,integer} - {1}. 3 | import.illegal=Import d''un package illégal - {0}. 4 | import.lang=Import redondant car la classe importée est située dans le package java.lang - {0}. 5 | import.same=Import redondant car la classe importée est située dans le même package - {0}. 6 | import.unused=Import inutilisé - {0}. 7 | import.ordering=L''ordre d''import n''est pas respecté : ''{0}''. 8 | import.separation=''{0}'' devrait être séparé des imports précédents. 9 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest12.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest12 { 4 | 5 | public static void testVoidLambda(TestOfVoidLambdas test) { 6 | System.out.println("Method called"); 7 | test.doSmth("fef", 5); 8 | } 9 | 10 | 11 | public static void main(String[] args) { 12 | 13 | testVoidLambda((String s1, Integer i2) -> System.out.println(s1)); 14 | } 15 | 16 | private interface TestOfVoidLambdas { 17 | 18 | public void doSmth(String first, Integer second); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/puppycrawl/tools/checkstyle/DebugChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | 6 | package com.puppycrawl.tools.checkstyle; 7 | 8 | import com.puppycrawl.tools.checkstyle.api.CheckstyleException; 9 | 10 | class DebugChecker extends Checker { 11 | public DebugChecker() throws CheckstyleException { 12 | } 13 | 14 | @Override 15 | public void fireAuditFinished() { 16 | super.fireAuditFinished(); 17 | } 18 | 19 | @Override 20 | public void fireAuditStarted() { 21 | super.fireAuditStarted(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputImmutableSameTypeName.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import com.puppycrawl.tools.checkstyle.coding.GregorianCalendar; 4 | import com.puppycrawl.tools.checkstyle.InetSocketAddress; 5 | public final class InputImmutableSameTypeName 6 | { 7 | public final java.util.GregorianCalendar calendar = null; 8 | public final GregorianCalendar calendar2 = null; 9 | public final com.puppycrawl.tools.checkstyle.coding.GregorianCalendar calendar3 = null; 10 | public final InetSocketAddress address = null; 11 | public final java.net.InetSocketAddress adr = null; 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrder3.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import static java.io.File.createTempFile; 4 | import static java.awt.Button.ABORT; 5 | import static javax.swing.WindowConstants.*; 6 | 7 | import com.puppycrawl.tools.*; 8 | import java.util.StringTokenizer; 9 | import java.util.*; 10 | import java.util.concurrent.AbstractExecutorService; 11 | import java.util.concurrent.*; 12 | 13 | import com.puppycrawl.tools.*; 14 | import com.*; 15 | 16 | import com.google.common.*; 17 | import org.junit.*; 18 | 19 | public class InputCustomImportOrder3 { 20 | } 21 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputReturnFromCatchCheck.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputReturnFromCatchCheck { 4 | public void foo() { 5 | try { 6 | System.currentTimeMillis(); 7 | } catch (Exception e) { 8 | return; 9 | } 10 | } 11 | 12 | public void bar() { 13 | try { 14 | System.currentTimeMillis(); 15 | } catch (Exception e) { 16 | if (System.currentTimeMillis() == 0) { 17 | return; // return from if statement 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/suppressions_1_1.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 18 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputMethodReferencesTest3.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.util.function.Supplier; 4 | public static class InputMethodReferencesTest3 5 | { 6 | public static class SomeClass { 7 | public static class Nested { 8 | public Nested() { 9 | } 10 | } 11 | } 12 | 13 | public void methodName(V value) { 14 | MyClass::myMethod; 15 | Supplier> passes = SomeClass.Nested::new; 16 | Supplier> fails = SomeClass.Nested::new; 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/messages_fi.properties: -------------------------------------------------------------------------------- 1 | javadoc.missing=Javadoc-kommentti puuttuu. 2 | javadoc.unusedTagGeneral=Tuntematon Javadoc-tagi. 3 | javadoc.unusedTag=Tuntematon tagi ''{1}'':lle: {0}. 4 | javadoc.expectedTag=Javadoc-tagi puuttuu: {0} tagi ''{1}''. 5 | javadoc.duplicateTag=Duplikaatti {0}-tagi. 6 | javadoc.return.expected=@return-tagi puuttuu. 7 | javadoc.classInfo=Luokkatiedot ei saatavilla: {0} tagi ''{1}''. 8 | javadoc.packageHtml=Pakettidokumentaatiotiedosto puuttuu. 9 | 10 | type.missingTag=Javadoc-kommentista puuttuu {0}-tagi. 11 | type.tagFormat=Javadoc-tagin {0} pitää olla mallin ''{1}'' mukainen. 12 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/sizes/messages_es.properties: -------------------------------------------------------------------------------- 1 | executableStatementCount=El número de sentencias ejecutables es {0,number,integer} (máximo permitido es {1,number,integer}). 2 | maxLen.file=El tamaño del fichero es {0,number,integer} líneas (máximas permitidas {1,number,integer}). 3 | maxLen.method=El tamaño del método es {0,number,integer} líneas (máximas permitidas {1,number,integer}). 4 | maxLen.anonInner=El tamaño de la clase interna anónima es {0,number,integer} líneas (máximas permitidas {1,number,integer}). 5 | maxLineLen=La línea es mayor de {0,number,integer} caracteres. 6 | maxParam=Más de {0,number,integer} parámetros. 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest13.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | public class InputLambdaTest13 { 4 | 5 | public static void testVoidLambda(TestOfVoidLambdas test) { 6 | System.out.println("Method called"); 7 | test.doSmth("fef", 5); 8 | } 9 | 10 | 11 | public static void main(String[] args) { 12 | 13 | testVoidLambda((String s1, Integer i2) -> { 14 | System.out.println(s1); 15 | }); 16 | } 17 | 18 | private interface TestOfVoidLambdas { 19 | 20 | public void doSmth(String first, Integer second); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/design/InputNonUtilityClass.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.design; 2 | 3 | import java.awt.Dimension; 4 | import javax.swing.JPanel; 5 | 6 | /** 7 | * Not a util class because it's not directly derived from java.lang.Object. 8 | */ 9 | public class InputNonUtilityClass extends JPanel 10 | { 11 | /** HideUtilityClassConstructorCheck should not report this */ 12 | public InputNonUtilityClass() 13 | { 14 | this.setPreferredSize(new Dimension(100, 100)); 15 | } 16 | 17 | public static void utilMethod() 18 | { 19 | System.out.println("I'm a utility method"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrderTemp.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import com.google.common.annotations.VisibleForTesting; 4 | 5 | import java.io.Closeable; 6 | import java.io.FileNotFoundException; 7 | import java.io.IOException; 8 | import java.lang.ref.PhantomReference; 9 | import java.lang.ref.Reference; 10 | import java.lang.ref.ReferenceQueue; 11 | import java.lang.reflect.Method; 12 | import java.net.URL; 13 | import java.net.URLClassLoader; 14 | import java.util.logging.Level; 15 | import java.util.logging.Logger; 16 | 17 | public class InputCustomImportOrderTemp { 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/messages_pt.properties: -------------------------------------------------------------------------------- 1 | containsTab=Linha contém um caracter de tabulação. 2 | 3 | line.alone=''{0}'' deve estar sozinho numa linha. 4 | line.new=''{0}'' deve estar numa nova linha. 5 | line.previous=''{0}'' deve estar na linha anterior. 6 | line.same=''{0}'' deve estar na mesma linha. 7 | 8 | ws.followed=''{0}'' é seguido de espaço em branco. 9 | ws.notFollowed=''{0}'' não é seguido de espaço em branco. 10 | ws.notPreceded=''{0}'' não é precedido por espaço em branco. 11 | ws.preceded=''{0}'' é precedido por espaço em branco. 12 | ws.typeCast=''conversão de tipos'' não é seguido de espaço em branco. 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/import-control_two.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrap_Bad.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test. //warn 2 | chapter3filestructure.rule332nolinewrap; 3 | 4 | import com.google.common.annotations.Beta; //ok 5 | 6 | import javax.accessibility. //warn 7 | AccessibleAttributeSequence; 8 | import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; //ok 9 | 10 | public class 11 | NoLineWrap_Bad { 12 | 13 | public void 14 | fooMethod() { 15 | final int 16 | foo = 0; 17 | } 18 | } 19 | 20 | enum 21 | FooFoo { 22 | } 23 | 24 | interface 25 | InterFoo {} 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputRightCurlyAnnotations.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | @TestClassAnnotation 4 | class InputRightCurlyAnnotations 5 | { 6 | private static final int X = 10; 7 | @Deprecated 8 | @Override 9 | public boolean equals(Object other) { return false; } 10 | 11 | @Override 12 | public String toString() { 13 | return "InputRightCurlyAnnotations{}"; 14 | } 15 | 16 | public String foo() { return "foo"; } 17 | 18 | @Override 19 | @SuppressWarnings("unused") 20 | public int hashCode() 21 | { 22 | int a = 10; 23 | return 1; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_Above.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import static java.awt.Button.ABORT; 4 | import static javax.swing.WindowConstants.*; 5 | import static java.awt.Button.ABORT; 6 | import java.awt.Button; 7 | import java.awt.Frame; 8 | import java.awt.Dialog; 9 | import java.awt.event.ActionEvent; 10 | import javax.swing.JComponent; 11 | import javax.swing.JTable; 12 | 13 | import java.io.File; 14 | import static java.io.File.createTempFile; 15 | import java.io.IOException; 16 | import java.io.InputStream; 17 | import java.io.Reader; 18 | 19 | public class InputImportOrder_Above { 20 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_Under.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.awt.Button; 4 | import java.awt.Frame; 5 | import java.awt.Dialog; 6 | import java.awt.event.ActionEvent; 7 | import javax.swing.JComponent; 8 | import javax.swing.JTable; 9 | import static java.awt.Button.ABORT; 10 | import static javax.swing.WindowConstants.*; 11 | import static java.awt.Button.ABORT; 12 | 13 | import static java.io.File.createTempFile; 14 | import java.io.File; 15 | import java.io.IOException; 16 | import java.io.InputStream; 17 | import java.io.Reader; 18 | 19 | public class InputImportOrder_Under { 20 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/import-control_complete.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrderSamePackage.java: -------------------------------------------------------------------------------- 1 | //Moved to noncompilable because UT requires imports from the same package 2 | package java.util.concurrent; 3 | import com.google.common.*; 4 | import java.util.StringTokenizer; 5 | import java.util.*; 6 | import java.util.concurrent.*; 7 | import static java.awt.Button.ABORT; 8 | import static javax.swing.WindowConstants.*; 9 | import com.puppycrawl.tools.*; 10 | import java.util.concurrent.AbstractExecutorService; 11 | import static java.io.File.createTempFile; 12 | import com.*; 13 | import org.apache.*; 14 | 15 | public class InputCustomImportOrderSamePackage { 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputFinalLocalVariableCheckFalsePositive.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputFinalLocalVariableCheckFalsePositive 4 | { 5 | public void method() 6 | { 7 | final java.util.List list = new java.util.ArrayList<>(); 8 | 9 | for ( int i = 0, s0 = list.size(); i < s0; i++ ) 10 | { 11 | } 12 | } 13 | 14 | public void method1() 15 | { 16 | final java.util.List list = new java.util.ArrayList<>(); 17 | 18 | for ( int i = 0, s0 = list.size(); i < s0; s0++ ) 19 | { 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/messages_fr.properties: -------------------------------------------------------------------------------- 1 | containsTab=La ligne contient un caractère tabulation. 2 | 3 | line.alone=''{0}'' devrait être la seule instruction sur cette ligne. 4 | line.new=''{0}'' devrait être sur une nouvelle ligne. 5 | line.previous=''{0}'' devrait être sur la ligne précédente. 6 | line.same=''{0}'' devrait être sur la même ligne. 7 | 8 | ws.followed=Il y a une espace de trop après ''{0}''. 9 | ws.notFollowed=Il manque une espace après ''{0}''. 10 | ws.notPreceded=Il manque une espace avant ''{0}''. 11 | ws.preceded=Il y a une espace de trop avant ''{0}''. 12 | ws.typeCast=Il manque une espace après ''conversion de type''. 13 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_Bottom.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.awt.Button; 4 | import java.awt.Dialog; 5 | import java.awt.Frame; 6 | import java.awt.event.ActionEvent; 7 | 8 | import java.io.IOException; 9 | import java.io.InputStream; 10 | 11 | import javax.swing.JComponent; 12 | import javax.swing.JTable; 13 | 14 | import static java.io.File.*; 15 | import java.io.File; 16 | 17 | import static java.io.File.createTempFile; 18 | import static java.awt.Button.ABORT; 19 | import static javax.swing.WindowConstants.*; 20 | 21 | import java.io.Reader; 22 | 23 | public class InputImportOrder_Bottom { 24 | } -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest10.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Target; 6 | 7 | public class InputAnnotationsTest10 { 8 | public static Object methodName(Object str) { 9 | try { 10 | return null; 11 | 12 | } catch (@MyAnnotation1(name = "ABC", version = 1) Exception ex) { 13 | return ""; 14 | } 15 | } 16 | 17 | @Target(ElementType.TYPE_USE) 18 | @interface MyAnnotation1 { 19 | 20 | String name(); 21 | int version(); 22 | } 23 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_Top.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import static java.io.File.createTempFile; 4 | import static java.awt.Button.ABORT; 5 | import static javax.swing.WindowConstants.*; 6 | 7 | import java.awt.Button; 8 | import java.awt.Dialog; 9 | import java.awt.Frame; 10 | import java.awt.event.ActionEvent; 11 | /***comment test***/ 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | 15 | import javax.swing.JComponent; 16 | import javax.swing.JTable; 17 | 18 | import static java.io.File.*; 19 | import java.io.File; 20 | import java.io.Reader; 21 | 22 | public class InputImportOrder_Top { 23 | } -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/messages_es.properties: -------------------------------------------------------------------------------- 1 | containsTab=La línea contiene un carácter de tabulación. 2 | 3 | line.alone=''{0}'' debería estar solo en una línea. 4 | line.new=''{0}'' debería estar en una línea nueva. 5 | line.previous=''{0}'' debería estar en la línea anterior. 6 | line.same=''{0}'' debería estar en la misma línea. 7 | 8 | ws.followed=''{0}'' está seguido de espacios en blanco. 9 | ws.notFollowed=''{0}'' no está seguido de espacio en blanco. 10 | ws.notPreceded=''{0}'' no está precedido de espacio en blanco. 11 | ws.preceded=''{0}'' está precedido de espacio en blanco. 12 | ws.typeCast=''conversión de tipos'' no está seguido de espacio en blanco. 13 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassInputGood.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter3filestructure.rule341onetoplevel; 2 | public class OneTopLevelClassInputGood //ok 3 | { 4 | public OneTopLevelClassInputGood() throws CloneNotSupportedException 5 | { 6 | super.equals(new String()); 7 | super.clone(); 8 | } 9 | 10 | public Object clone() throws CloneNotSupportedException 11 | { 12 | return super.clone(); 13 | } 14 | 15 | public void method() throws CloneNotSupportedException 16 | { 17 | super.clone(); 18 | } 19 | 20 | { 21 | super.clone(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/com/puppycrawl/tools/checkstyle/DebugFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | 6 | package com.puppycrawl.tools.checkstyle; 7 | 8 | import com.puppycrawl.tools.checkstyle.api.AuditEvent; 9 | import com.puppycrawl.tools.checkstyle.api.Filter; 10 | 11 | class DebugFilter implements Filter { 12 | private boolean called; 13 | 14 | @Override 15 | public boolean accept(AuditEvent event) { 16 | called = true; 17 | return true; 18 | } 19 | 20 | public boolean wasCalled() { 21 | return called; 22 | } 23 | 24 | public void resetFilter() { 25 | called = false; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/sizes/messages_fr.properties: -------------------------------------------------------------------------------- 1 | executableStatementCount=Le nombre d''instructions est de {0,number,integer} alors que le maximum autorisé est de {1,number,integer}. 2 | maxLen.file=Le fichier contient {0,number,integer} lignes alors que le maximum autorisé est de {1,number,integer}. 3 | maxLen.method=La méthode contient {0,number,integer} lignes alors que le maximum autorisé est de {1,number,integer}. 4 | maxLen.anonInner=La classe interne anonyme contient {0,number,integer} lignes alors que le maximum autorisé est de {1,number,integer}. 5 | maxLineLen=La ligne excède {0,number,integer} caractères. 6 | maxParam=La méthode ou le constructeur a plus de {0,number,integer} paramètres. 7 | 8 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputLambdaTest17.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | import java.util.function.Supplier; 3 | public class InputLambdaTest17{ 4 | 5 | void initPartialTraversalState() { 6 | SpinedBuffer b = new SpinedBuffer<>(); 7 | 8 | P_OUT spliterator = new P_OUT(); 9 | Supplier pusher = () -> spliterator.tryAdvance(b); 10 | } 11 | 12 | private class P_OUT 13 | { 14 | 15 | public Object tryAdvance(SpinedBuffer b) 16 | { 17 | // comment 18 | return null; 19 | } 20 | 21 | } 22 | 23 | class SpinedBuffer 24 | { 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameInput_2.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter2filebasic.rule21filename; 2 | 3 | /** 4 | * Test for illegal tokens 5 | */ 6 | public class OuterTypeFilenameInput_2 //ok 7 | { 8 | public void defaultMethod() 9 | { 10 | int i = 0; 11 | switch (i) 12 | { 13 | default: 14 | i--; 15 | i++; 16 | break; 17 | } 18 | } 19 | 20 | public native void nativeMethod(); 21 | 22 | public void methodWithLiterals() 23 | { 24 | final String ref = " 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/naming/InputMethodNameOverridenMethods.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.naming; 2 | 3 | public class InputMethodNameOverridenMethods extends SomeClass 4 | { 5 | @Override 6 | public void PUBLICfoo() { //Ignored due to impossibility of change by developer 7 | 8 | } 9 | 10 | @java.lang.Override 11 | protected void PROTECTEDfoo() { //Ignored due to impossibility of change by developer 12 | 13 | } 14 | } 15 | 16 | class SomeClass { 17 | public void PUBLICfoo() { //Warning (broken naming convention) 18 | 19 | } 20 | protected void PROTECTEDfoo() { //Warning (broken naming convention) 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/coding/InputIllegalInstantiationCheckTest2.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.coding; 3 | 4 | import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; 5 | 6 | public class InputIllegalInstantiationCheckTest2 7 | { 8 | 9 | public static void main(String[] args) 10 | { 11 | 12 | Supplier supplier = InputMethodReferencesTest2::new; 13 | Supplier suppl = InputMethodReferencesTest2:: new; 14 | Function messageArrayFactory = Message[]::new; 15 | 16 | } 17 | 18 | private class Bar 19 | { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.awt.Button; 4 | import java.awt.Frame; 5 | import java.awt.Dialog; 6 | import java.awt.event.ActionEvent; 7 | import static java.awt.Button.ABORT 8 | ; 9 | import javax.swing.JComponent; 10 | import javax.swing.JTable; 11 | import java.io.File; 12 | import static java.io.File.createTempFile; 13 | import java.io.IOException; 14 | import java.io.InputStream; 15 | import java.io.Reader; 16 | import static javax.swing.WindowConstants.*; 17 | 18 | import static sun.tools.util.ModifierFilter.ALL_ACCESS; 19 | import static sun.tools.util.ModifierFilter.PACKAGE; 20 | 21 | public class InputImportOrder { 22 | } 23 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundnput_EmptyTypesAndCycles.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter4formatting.rule462horizontalwhitespace; 2 | 3 | import com.google.common.base.Function; 4 | import com.google.common.base.Supplier; 5 | 6 | class myFoo 7 | { 8 | private void foo() 9 | { 10 | int i = 0; 11 | String[][] x = {{"foo"}}; 12 | for (int first = 0; first < 5; first++) {} //ok 13 | int j = 0; 14 | while (j == 1) {} //ok 15 | do {} while (i == 1); //ok 16 | } 17 | } 18 | 19 | interface SupplierFunction extends Function, T> {} //ok 20 | 21 | class EmptyFoo {} //ok 22 | 23 | enum EmptyFooEnum {} //ok 24 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputImportOrder_InFlow.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import java.awt.Button; 4 | import static java.awt.Button.ABORT; 5 | import java.awt.Frame; 6 | import java.awt.Dialog; 7 | import java.awt.event.ActionEvent; 8 | 9 | import javax.swing.JComponent; 10 | import static javax.swing.WindowConstants.HIDE_ON_CLOSE; 11 | import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE; 12 | import static javax.swing.WindowConstants.*; 13 | import javax.swing.JTable; 14 | 15 | import static java.io.File.createTempFile; 16 | import java.io.File; 17 | import java.io.IOException; 18 | import java.io.InputStream; 19 | import java.io.Reader; 20 | 21 | public class InputImportOrder_InFlow { 22 | } -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/messages_es.properties: -------------------------------------------------------------------------------- 1 | noNewlineAtEOF=El fichero no termina con un retorno de carro. 2 | 3 | todo.match=El comentario coincide con el formato to-do ''{0}''. 4 | 5 | upperEll=Debería usar ''L'' mayúscula. 6 | 7 | translation.missingKey=La clave ''{0}'' falta. 8 | 9 | missing.switch.default=switch sin etiqueta \"default\". 10 | 11 | uncommented.main=Se encotró un método main sin comentar. 12 | 13 | descendant.token.min=El recuento {0} para ''{2}'' descendientes ''{3}'' es menor que el mínimo {1}. 14 | descendant.token.max=El recuento {0} para ''{2}'' descendientes ''{3}'' excede el máximo {1}. 15 | 16 | final.parameter=El parámetro {0} debería ser final. 17 | trailing.comments=No usar comentarios de final de línea. 18 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/import-control_WithNewElement.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/Input15Extensions.java: -------------------------------------------------------------------------------- 1 | // someexamples of 1.5 extensions 2 | package com.puppycrawl.tools.checkstyle; 3 | 4 | @interface MyAnnotation1 { 5 | String name(); 6 | int version(); 7 | } 8 | 9 | @MyAnnotation1(name = "ABC", version = 1) 10 | public class Input15Extensions 11 | { 12 | 13 | } 14 | 15 | enum Enum1 16 | { 17 | A, B, C; 18 | Enum1() {} 19 | public String toString() { 20 | return ""; //some custom implementation 21 | } 22 | } 23 | 24 | interface TestRequireThisEnum 25 | { 26 | enum DAY_OF_WEEK 27 | { 28 | SUNDAY, 29 | MONDAY, 30 | TUESDAY, 31 | WEDNESDAY, 32 | THURSDAY, 33 | FRIDAY, 34 | SATURDAY 35 | } 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputWriteTag2.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Test case file for checkstyle. 3 | // Created: 2004 4 | //////////////////////////////////////////////////////////////////////////////// 5 | 6 | package com.puppycrawl.tools.checkstyle; 7 | 8 | /** 9 | * @incomplete This enum needs more code... 10 | */ 11 | enum InputWriteTag2 { 12 | /** 13 | * @incomplete This enum constant needs more code... 14 | */ 15 | FOO; 16 | } 17 | 18 | /** 19 | * @incomplete This annotation needs more code... 20 | */ 21 | @interface InputWriteTag3 { 22 | /** 23 | * @incomplete This annotation field needs more code... 24 | */ 25 | int foo() default 0; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/messages_ja.properties: -------------------------------------------------------------------------------- 1 | javadoc.classInfo={0} タグの ''{1}'' のクラス情報が取得できません。 2 | javadoc.expectedTag=''{1}'' には {0} タグが必要です。 3 | javadoc.extrahtml=不要な終了タグが見つかりました: {0} 4 | javadoc.incompleteTag=不完全なHTMLタグが見つかりました: {0} 5 | javadoc.missing=Javadoc コメントがありません。 6 | javadoc.noperiod=最初の一文はピリオドで終わらなければなりません。 7 | javadoc.packageHtml=パッケージドキュメンテーションが見つかりません。 8 | javadoc.duplicateTag={0} タグが重複しています。 9 | javadoc.return.expected=@return タグが必要です。 10 | javadoc.unclosedhtml=閉じていない HTML タグが見つかりました: {0} 11 | javadoc.unusedTag=''{1}'' に対する使用されない {0} タグです。 12 | javadoc.unusedTagGeneral=使用されない Javadoc タグです。 13 | 14 | type.missingTag=クラスの Javadoc コメントに {0} タグがありません。 15 | type.tagFormat=クラスの Javadoc タグ {0} はパターン ''{1}'' に合致しなければなりません。 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/site/resources/js/anchors.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | window.addEventListener('load', main); 4 | 5 | function main() { 6 | var url = window.location.href; 7 | var anchors = document.getElementsByTagName('h2'); 8 | var mass = []; 9 | for(var i = 0; i < anchors.length; i++) { 10 | mass.push(anchors[i].childNodes[0].name); 11 | } 12 | var links = []; 13 | for(i = 0; i < mass.length; i++) { 14 | links.push('' + url + '#' + mass[i] + ''); 15 | } 16 | for(i = 0; i < anchors.length; i++) { 17 | var anchor = document.createElement('div'); 18 | anchor.className = 'anchor'; 19 | anchor.innerHTML += ''; 20 | anchors[i].appendChild(anchor); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/configs/custom_messages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule333orderingandsoacing/CustomImportOrderInput_3.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter3filestructure.rule333orderingandsoacing; 2 | 3 | import static java.io.File.createTempFile; 4 | import static java.awt.Button.ABORT; //warn 5 | import static javax.swing.WindowConstants.*; 6 | 7 | 8 | import java.util.StringTokenizer; //warn 9 | import java.util.*; //warn 10 | import java.util.concurrent.AbstractExecutorService; //warn 11 | import java.util.concurrent.*; //warn 12 | 13 | import com.google.checkstyle.test.chapter2filebasic.rule21filename.*; 14 | import com.sun.xml.internal.xsom.impl.scd.Iterators; //warn 15 | 16 | import com.google.common.reflect.*; //warn 17 | 18 | public class CustomImportOrderInput_3 { 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputNullModifiers.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import java.io.*; 4 | import java.util.*; 5 | 6 | class StringEntrySet { 7 | private final Set> s; 8 | public StringEntrySet(Set> s) {this.s = s;} 9 | public Iterator> iterator() { 10 | return new Iterator>() { 11 | Iterator> i = s.iterator(); 12 | public boolean hasNext() {return i.hasNext();} 13 | public Map.Entry next() { 14 | return null; 15 | } 16 | public void remove() {i.remove();} 17 | }; 18 | } 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputParameterNumberCheck.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | class InputParameterNumberCheckBase 4 | { 5 | // method with many parameters 6 | void myMethod(int a, int b, int c, int d, int e, int f, int g, int h) { 7 | 8 | } 9 | 10 | // method with many parameters 11 | void myMethod2(int a, int b, int c, int d, int e, int f, int g, int h) { 12 | 13 | } 14 | } 15 | 16 | public class InputParameterNumberCheck extends InputParameterNumberCheckBase 17 | { 18 | @Override 19 | void myMethod(int a, int b, int c, int d, int e, int f, int g, int h) { 20 | 21 | } 22 | 23 | @java.lang.Override 24 | void myMethod2(int a, int b, int c, int d, int e, int f, int g, int h) { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/com/puppycrawl/tools/checkstyle/checks/design/messages.properties: -------------------------------------------------------------------------------- 1 | arrangement.members.before.inner=Fields and methods should be before inner classes. 2 | design.forExtension=Method ''{0}'' is not designed for extension - needs to be abstract, final or empty. 3 | final.class=Class {0} should be declared as final. 4 | interface.type=interfaces should describe a type and hence have methods. 5 | variable.notPrivate=Variable ''{0}'' must be private and have accessor methods. 6 | mutable.exception=The field ''{0}'' must be declared final. 7 | throws.count=Throws count is {0,number,integer} (max allowed is {1,number,integer}). 8 | hide.utility.class=Utility classes should not have a public or default constructor. 9 | one.top.level.class=Top-level class {0} has to reside in its own source file. 10 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/comments/InputFullOfBlockComments.java: -------------------------------------------------------------------------------- 1 | /*0*//*1*/package/*2*/ com/*3*/./*4*/puppycrawl/*5*/./*6*/tools/*7*/./*8*/checkstyle/*9*/./*10*/comments/*11*/;/*12*/ 2 | /*13*/ 3 | /*14*/public/*15*/ class /*16*/InputFullOfBlockComments /*49*/{/*17*/ 4 | /*18*/ 5 | /*19*/public/*20*/ static/* 6 | 21 7 | */ String/*22*/ main/*23*/(/*24*/String/*25*/[/*26*/]/*27*/ args/*28*/)/*29*/ {/*30*/ 8 | /*31*/String /*32*/line /*33*/= /*34*/"/*I'm NOT comment*/blabla"/*35*/;/*36*/ 9 | /*37*/System/*38*/./* 39 */out/*40*/./*41*/println/*42*/(/*43*/line/*44*/)/*45*/;/*46*/ 10 | Integer[] array = null; 11 | /*50*/for/*51*/ (/*52*/Integer/*53*/ i/*54*/:/*55*/ array/*56*/)/*57*/ {/*58*/ 12 | /*59*/ 13 | }/*60*/ 14 | return line; 15 | }/*47*/ 16 | }/*48*/ 17 | /*61*/ -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputMethodReferencesTest2.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.util.function.Function; 4 | import java.util.function.Supplier; 5 | 6 | import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; 7 | public class InputMethodReferencesTest2 8 | { 9 | 10 | public static void main(String[] args) 11 | { 12 | 13 | Supplier supplier = InputMethodReferencesTest2::new; 14 | Supplier suppl = InputMethodReferencesTest2:: new; 15 | Function messageArrayFactory = Message[]::new; 16 | 17 | } 18 | 19 | private class Bar 20 | { 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputIllegalTypeStaticImports.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | import static com.puppycrawl.tools.checkstyle.checks.CheckUtils.isElseIf; 4 | import static com.puppycrawl.tools.checkstyle.checks.CheckUtils.*; 5 | import static com.puppycrawl.tools.checkstyle.coding.InputIllegalType.SomeStaticClass; 6 | import com.puppycrawl.tools.checkstyle.api.DetailAST; 7 | //configuration: "illegalClassNames": SomeStaticClass 8 | public class InputIllegalTypeStaticImports 9 | { 10 | private boolean foo(DetailAST ast) { 11 | return isElseIf(ast); 12 | } 13 | SomeStaticClass staticClass; //WARNING 14 | private static SomeStaticClass foo1() { return null;} 15 | private static void foo2(SomeStaticClass s) {} 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/javadoc/AllowedAnnotations.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.javadoc; 2 | 3 | /** 4 | * Some javadoc. 5 | */ 6 | public class AllowedAnnotations implements SomeInterface { 7 | 8 | @ThisIsOk 9 | public void allowed1() {} 10 | 11 | @ThisIsOkToo 12 | public void allowed2() {} 13 | 14 | @com.puppycrawl.tools.checkstyle.javadoc.ThisIsOk 15 | public void allowed3() {} 16 | 17 | @Override 18 | public void method() {} 19 | } 20 | 21 | /** 22 | * Documented. 23 | */ 24 | interface SomeInterface { 25 | /** 26 | * Documented. 27 | */ 28 | void method(); 29 | } 30 | 31 | /** 32 | * Some javadoc. 33 | */ 34 | @interface ThisIsOk {} 35 | 36 | /** 37 | * Some javadoc. 38 | */ 39 | @interface ThisIsOkToo {} 40 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputInterfaceIsType.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Test case file for checkstyle. 3 | // Created: 2001 4 | //////////////////////////////////////////////////////////////////////////////// 5 | package com.puppycrawl.tools.checkstyle; 6 | 7 | /** 8 | * Test input for InterfaceIsTypeCheck 9 | * @author lkuehne 10 | **/ 11 | class InputInterfaceIsType 12 | { 13 | // OK, has method, so is a type 14 | interface OK 15 | { 16 | void method(); 17 | } 18 | 19 | // Marker interface, OK for some configurations 20 | interface Marker 21 | { 22 | } 23 | 24 | // Always flagged 25 | interface ConstantPool 26 | { 27 | boolean BAD = true; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameInput_1.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter2filebasic.rule21filename; 2 | 3 | @interface MyAnnotation1 { //ok 4 | String name(); 5 | int version(); 6 | } 7 | 8 | @MyAnnotation1(name = "ABC", version = 1) 9 | public class OuterTypeFilenameInput_1 //ok 10 | { 11 | 12 | } 13 | 14 | enum Enum1 //ok 15 | { 16 | A, B, C; 17 | Enum1() {} 18 | public String toString() { 19 | return ""; //some custom implementation 20 | } 21 | } 22 | 23 | interface TestRequireThisEnum //ok 24 | { 25 | enum DAY_OF_WEEK 26 | { 27 | SUNDAY, 28 | MONDAY, 29 | TUESDAY, 30 | WEDNESDAY, 31 | THURSDAY, 32 | FRIDAY, 33 | SATURDAY 34 | } 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameInput_3.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter2filebasic.rule21filename; 2 | 3 | @interface MyAnnotation2 { //warn 4 | String name(); 5 | int version(); 6 | } 7 | 8 | @MyAnnotation2(name = "ABC", version = 1) 9 | class OuterTypeFilenameInput_3 //ok 10 | { 11 | 12 | } 13 | 14 | enum Enum2 //ok 15 | { 16 | A, B, C; 17 | Enum2() {} 18 | public String toString() { 19 | return ""; //some custom implementation 20 | } 21 | } 22 | 23 | interface TestRequireThisEnum2 //ok 24 | { 25 | enum DAY_OF_WEEK 26 | { 27 | SUNDAY, 28 | MONDAY, 29 | TUESDAY, 30 | WEDNESDAY, 31 | THURSDAY, 32 | FRIDAY, 33 | SATURDAY 34 | } 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule333orderingandsoacing/CustomImportOrderInput_2.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter3filestructure.rule333orderingandsoacing; 2 | 3 | import static java.io.File.createTempFile; 4 | import static java.awt.Button.ABORT; //warn 5 | import static javax.swing.WindowConstants.*; 6 | 7 | import java.util.List; //warn 8 | import java.util.StringTokenizer; //warn 9 | import java.util.*; //warn 10 | import java.util.concurrent.AbstractExecutorService; //warn 11 | import java.util.concurrent.*; //warn 12 | 13 | import com.google.checkstyle.test.chapter2filebasic.rule21filename.*; 14 | import com.sun.xml.internal.xsom.impl.scd.Iterators; //warn 15 | 16 | import com.google.common.reflect.*; //warn 17 | 18 | public class CustomImportOrderInput_2 { 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/whitespace/InputWhitespaceAround.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.whitespace; 2 | 3 | @SuppressWarnings({"this", "that"}) 4 | public class InputWhitespaceAround 5 | { 6 | protected InputWhitespaceAround ( int i ) 7 | { 8 | this (); //whitespace 9 | toString (); 10 | } 11 | protected InputWhitespaceAround () 12 | { 13 | super (); 14 | } 15 | 16 | public void enhancedFor () 17 | { 18 | int[] i = new int[2]; 19 | for ( int j: i ) { 20 | System.out.println ( j ); 21 | } 22 | } 23 | } 24 | 25 | @interface CronExpression { 26 | Class[] groups() default {}; 27 | } 28 | 29 | @interface CronExpression1 { 30 | Class[] groups() default { }; // extra space 31 | } 32 | -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter3filestructure/rule333orderingandsoacing/CustomImportOrderInput_1.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter3filestructure.rule333orderingandsoacing; 2 | 3 | import static java.io.File.createTempFile; 4 | import static java.awt.Button.ABORT; //warn 5 | import static javax.swing.WindowConstants.*; 6 | 7 | import java.awt.Button; //warn 8 | import java.awt.Frame; //warn 9 | import java.awt.Dialog; //warn 10 | import java.awt.event.ActionEvent; //warn 11 | import javax.swing.JComponent; //warn 12 | import javax.swing.JTable; //warn 13 | import java.io.File; //warn 14 | import java.io.IOException; //warn 15 | import java.io.InputStream; //warn 16 | import java.io.Reader; //warn 17 | 18 | 19 | 20 | import com.google.common.base.Ascii; 21 | 22 | public class CustomImportOrderInput_1 {} -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/imports/InputCustomImportOrder.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.imports; 2 | 3 | import static java.io.File.createTempFile; 4 | import static java.awt.Button.ABORT; 5 | import static java.awt.print.Paper.*; 6 | import static javax.swing.WindowConstants.*; 7 | 8 | import java.awt.Button; 9 | import java.awt.Frame; 10 | import java.awt.Dialog; 11 | import java.awt.color.ColorSpace; 12 | import java.awt.event.ActionEvent; 13 | import javax.swing.JComponent; 14 | import javax.swing.JTable; 15 | import java.io.File; 16 | import java.io.IOException; 17 | import java.io.InputStream; 18 | import java.io.Reader; 19 | 20 | import com.puppycrawl.tools.*; 21 | 22 | import com.google.common.collect.*; 23 | import org.junit.*; 24 | 25 | public class InputCustomImportOrder { 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputFinalLocalVariableNativeMethods.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputFinalLocalVariableNativeMethods 4 | { 5 | public native String nativeFoo(int a, int b); 6 | private native double average(int n1, int n2); 7 | 8 | static { 9 | System.loadLibrary("foo"); 10 | } 11 | 12 | public void print () { 13 | String str = nativeFoo(1, 4); 14 | System.out.println(str); 15 | } 16 | 17 | public static void main(final String[] args) { 18 | (new InputFinalLocalVariableNativeMethods()).print(); 19 | System.out.println("In Java, the average is " + 20 | new InputFinalLocalVariableNativeMethods().average(3, 2)); 21 | return; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammars/java8/InputAnnotationsTest8.java: -------------------------------------------------------------------------------- 1 | //Compilable with Java8 2 | package com.puppycrawl.tools.checkstyle.grammars.java8; 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Target; 5 | import java.util.Map; 6 | 7 | public class InputAnnotationsTest8 { 8 | 9 | public void main(String[] args) { 10 | Map.@NotNull Entry entry; 11 | MyObject myObject = new MyObject(); 12 | myObject.<@NotBlank String>myMethod(); 13 | myObject.new @NotNull MyObject2(); 14 | 15 | } 16 | 17 | @Target(ElementType.TYPE_USE) 18 | @interface NotNull { 19 | 20 | } 21 | 22 | @Target(ElementType.TYPE_USE) 23 | @interface NotBlank { 24 | 25 | } 26 | 27 | class MyObject{ 28 | 29 | public void myMethod(){}; 30 | 31 | class MyObject2{} 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /config/assembly-src.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | src 7 | 8 | tar.gz 9 | zip 10 | 11 | 12 | 13 | 14 | true 15 | 16 | target/** 17 | *.launch 18 | nbactions.xml 19 | lib/** 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/coding/InputOneStatementPerLineCheck.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.checks.coding; 2 | 3 | /** 4 | * This file contains test inputs for OneStatementPerLineCheckInput 5 | * which cause compilation problem in Eclipse 4.2.2 but still 6 | * must be tested. 7 | */ 8 | 9 | /** 10 | * Two import statements and one 'empty' statement 11 | * which are not on the same line are legal. 12 | */ 13 | import java.lang.annotation.Annotation; 14 | ; 15 | import java.lang.String; 16 | 17 | public class OneStatementPerLineCheckInput { 18 | /** 19 | * According to java language specifications, 20 | * statements end with ';'. That is why ';;' 21 | * may be considered as two empty statements on the same line 22 | * and rises violation. 23 | */ 24 | ;; //warn 25 | } 26 | -------------------------------------------------------------------------------- /src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/imports/InputDefaultPackage.java: -------------------------------------------------------------------------------- 1 | //Compilable by javac, but noncompilable by eclipse 2 | 3 | ////////////////////////////////////////// 4 | //Some header 5 | ////////////////////////////////////////// 6 | import static java.io.File.createTempFile; 7 | import static java.awt.Button.ABORT; 8 | import static javax.swing.WindowConstants.*; 9 | 10 | import java.awt.Button; 11 | import java.awt.Frame; 12 | import java.awt.Dialog; 13 | import java.awt.event.ActionEvent; 14 | import javax.swing.JComponent; 15 | import javax.swing.JTable; 16 | import java.io.File; 17 | import java.io.IOException; 18 | import java.io.InputStream; 19 | import java.io.Reader; 20 | 21 | import com.puppycrawl.tools.*; 22 | 23 | import com.google.common.*; 24 | import org.apache.*; 25 | 26 | public class InputImportOrder { 27 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputWriteTag.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Test case file for checkstyle. 3 | // Created: 2004 4 | //////////////////////////////////////////////////////////////////////////////// 5 | 6 | package com.puppycrawl.tools.checkstyle; 7 | 8 | /** 9 | * Testing tag writing 10 | * @author Daniel Grenner 11 | * @incomplete This class needs more code... 12 | * @doubletag first text 13 | * @doubletag second text 14 | * @emptytag 15 | */ 16 | class InputWriteTag 17 | { 18 | /** 19 | * @todo Add a constructor comment 20 | */ 21 | public InputWriteTag() 22 | { 23 | } 24 | 25 | public void method() 26 | { 27 | } 28 | 29 | /** 30 | * @todo Add a comment 31 | */ 32 | public void anotherMethod() 33 | { 34 | } 35 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputEqualsHashCodeCheck.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | 3 | public class InputEqualsHashCodeCheck { 4 | public boolean notEquals() { 5 | return true; 6 | } 7 | 8 | public boolean equals() { 9 | return false; 10 | } 11 | 12 | public boolean equals(Object o1) { 13 | return false; 14 | } 15 | 16 | private boolean equals(Object o1, Object o2) { 17 | return false; 18 | } 19 | 20 | protected int notHashCode() { 21 | return 1; 22 | } 23 | 24 | public int hashCode() { 25 | return 1; 26 | } 27 | 28 | public int hashCode(Object o1) { 29 | return 1; 30 | } 31 | 32 | private int hashCode(Object o1, Object o2) { 33 | return 1; 34 | } 35 | } -------------------------------------------------------------------------------- /src/it/resources/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameInput_Basic.java: -------------------------------------------------------------------------------- 1 | package com.google.checkstyle.test.chapter5naming.rule525nonconstantfieldnames; 2 | 3 | public class MemberNameInput_Basic 4 | { 5 | public int mPublic; //warn 6 | protected int mProtected; //warn 7 | int mPackage; //warn 8 | private int mPrivate; //warn 9 | 10 | public int _public; //warn 11 | protected int prot_ected; //warn 12 | int package_; //warn 13 | private int priva$te; //warn 14 | 15 | public int ppublic; //ok 16 | protected int pprotected; //ok 17 | int ppackage; //ok 18 | private int pprivate; //ok 19 | 20 | int ABC = 0; //warn 21 | final int C_D_E = 0; //warn 22 | 23 | public int $mPublic; //warn 24 | protected int mPro$tected; //warn 25 | int mPackage$; //warn 26 | } -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/InputPublicImmutable.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Collection; 5 | import java.util.List; 6 | 7 | import com.google.common.collect.ImmutableSet; 8 | 9 | public class InputPublicImmutable { 10 | public final int someIntValue; 11 | public final ImmutableSet includes; 12 | public final java.lang.String notes; 13 | public final BigDecimal value; 14 | public final List list; 15 | public InputPublicImmutable(Collection includes, 16 | BigDecimal value, String notes, int someValue, List l) { 17 | this.includes = ImmutableSet.copyOf(includes); 18 | this.value = value; 19 | this.notes = notes; 20 | this.someIntValue = someValue; 21 | this.list = l; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputMultipleVariableDeclarations.java: -------------------------------------------------------------------------------- 1 | package com.puppycrawl.tools.checkstyle.coding; 2 | public class InputMultipleVariableDeclarations 3 | { 4 | int i, j; 5 | int i1; int j1; 6 | 7 | void method1() { 8 | String str, str1; 9 | java.lang.Object obj; Object obj1; 10 | } 11 | // second definition is wrapped 12 | // line of VARIABLE_DEF is not the same as first line of the definition 13 | java.lang.String string; java.lang.String 14 | strings[]; 15 | //both definitions is wrapped 16 | java.lang. 17 | String string1; java.lang.String 18 | strings1[]; 19 | 20 | void method2() { 21 | for (int i=0, j=0; i < 10; i++, j--) { 22 | } 23 | 24 | for(int i=0; i<4;i++) { 25 | 26 | } 27 | } 28 | } 29 | --------------------------------------------------------------------------------