Skip to content

Instantly share code, notes, and snippets.

@platan
Created October 28, 2014 12:20
Show Gist options
  • Save platan/d4467251570f792d5daf to your computer and use it in GitHub Desktop.
Save platan/d4467251570f792d5daf to your computer and use it in GitHub Desktop.
Two Checkstyle Checks finds Spring @component and @Autowired and suggets using JSR-330 @nAmed and @Inject.
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<module name="RegexpMultiline">
<property name="format" value="@Component( |\n|\r|\r\n)"/>
<property name="message" value="JSR-330 @Named should be used instead of Spring @Component. "/>
<property name="fileExtensions" value="java"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="@Autowired( |\n|\r|\r\n)"/>
<property name="message" value="JSR-330 @Inject should be used instead of Spring @Autowired. "/>
<property name="fileExtensions" value="java"/>
</module>
</module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment