File tree Expand file tree Collapse file tree 18 files changed +53
-89
lines changed Expand file tree Collapse file tree 18 files changed +53
-89
lines changed Original file line number Diff line number Diff line change 27
27
<subethasmtp .version>3.1.7</subethasmtp .version>
28
28
<aspectj .version>1.8.5</aspectj .version>
29
29
<javax .validation.version>1.1.0.Final</javax .validation.version>
30
- <javax .inject.version>1</javax .inject.version>
31
30
<javax .persistence.version>1.0.0.Final</javax .persistence.version>
32
31
<servlet .api.version>3.0.20100224</servlet .api.version>
33
32
<commons .lang.version>3.3.2</commons .lang.version>
197
196
<scope >provided</scope >
198
197
</dependency >
199
198
200
- <!-- @Inject -->
201
- <dependency >
202
- <groupId >javax.inject</groupId >
203
- <artifactId >javax.inject</artifactId >
204
- <version >${javax.inject.version} </version >
205
- </dependency >
206
-
207
199
<dependency >
208
200
<groupId >javax.validation</groupId >
209
201
<artifactId >validation-api</artifactId >
Original file line number Diff line number Diff line change 111
111
</rule >
112
112
<rule ref =" rulesets/java/clone.xml" />
113
113
114
-
115
- <rule
116
- name=" SpringAutowiredUsage"
117
- message=" Use @Inject over @Autowired for dependency injection"
118
- class=" net.sourceforge.pmd.lang.rule.XPathRule"
119
- language=" java" >
120
-
121
- <description >
122
- Use @Inject annotation from javax.inject which is standartized (belongs to JSR-303) analogue of Spring-specific @Autowired.
123
- </description >
124
-
125
- <properties >
126
- <property name =" xpath" >
127
- <value >
128
- <![CDATA[
129
- //ClassOrInterfaceBodyDeclaration/Annotation/*/Name[@Image="Autowired"]
130
- ]]>
131
- </value >
132
- </property >
133
- </properties >
134
- <priority >4</priority >
135
- <example >
136
- <![CDATA[
137
- public class UserService {
138
- @Autowired
139
- private UserDao userDao;
140
- }
141
- ]]>
142
- </example >
143
- </rule >
144
-
145
114
</ruleset >
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .config ;
19
19
20
- import javax .inject .Inject ;
21
-
20
+ import org .springframework .beans .factory .annotation .Autowired ;
22
21
import org .springframework .context .MessageSource ;
23
22
import org .springframework .context .annotation .Bean ;
24
23
import org .springframework .context .annotation .Configuration ;
29
28
@ Configuration
30
29
public class ControllersConfig {
31
30
32
- @ Inject
31
+ @ Autowired
33
32
private ServicesConfig servicesConfig ;
34
33
35
- @ Inject
34
+ @ Autowired
36
35
private MessageSource messageSource ;
37
36
38
37
@ Bean
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .config ;
19
19
20
- import javax .inject .Inject ;
21
-
20
+ import org .springframework .beans .factory .annotation .Autowired ;
22
21
import org .springframework .context .annotation .Bean ;
23
22
import org .springframework .context .annotation .Configuration ;
24
23
import org .springframework .jdbc .core .namedparam .NamedParameterJdbcTemplate ;
41
40
@ Configuration
42
41
public class DaoConfig {
43
42
44
- @ Inject
43
+ @ Autowired
45
44
private NamedParameterJdbcTemplate jdbcTemplate ;
46
45
47
46
@ Bean
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .config ;
19
19
20
- import javax .inject .Inject ;
21
-
22
20
import java .util .List ;
23
21
import java .util .Locale ;
24
22
23
+ import org .springframework .beans .factory .annotation .Autowired ;
25
24
import org .springframework .context .annotation .Bean ;
26
25
import org .springframework .context .annotation .Configuration ;
27
26
import org .springframework .context .annotation .Import ;
@@ -116,7 +115,7 @@ public LocaleResolver getLocaleResolver() {
116
115
}
117
116
118
117
@ Bean
119
- @ Inject
118
+ @ Autowired
120
119
public DomainClassConverter <?> getDomainClassConverter (FormattingConversionService service ) {
121
120
return new DomainClassConverter <FormattingConversionService >(service );
122
121
}
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .config ;
19
19
20
- import javax .inject .Inject ;
21
-
20
+ import org .springframework .beans .factory .annotation .Autowired ;
22
21
import org .springframework .context .MessageSource ;
23
22
import org .springframework .context .annotation .Bean ;
24
23
import org .springframework .context .annotation .Configuration ;
35
34
@ EnableAsync
36
35
public class ServicesConfig {
37
36
38
- @ Inject
37
+ @ Autowired
39
38
private DaoConfig daoConfig ;
40
39
41
- @ Inject
40
+ @ Autowired
42
41
private SecurityConfig securityConfig ;
43
42
44
- @ Inject
43
+ @ Autowired
45
44
private SeriesDao seriesDao ;
46
45
47
- @ Inject
46
+ @ Autowired
48
47
private UserDao userDao ;
49
48
50
- @ Inject
49
+ @ Autowired
51
50
private UsersActivationDao usersActivationDao ;
52
51
53
- @ Inject
52
+ @ Autowired
54
53
private StrategiesConfig strategiesConfig ;
55
54
56
- @ Inject
55
+ @ Autowired
57
56
private ImageDao imageDao ;
58
57
59
- @ Inject
58
+ @ Autowired
60
59
private JavaMailSender mailSender ;
61
60
62
- @ Inject
61
+ @ Autowired
63
62
private Environment env ;
64
63
65
- @ Inject
64
+ @ Autowired
66
65
private MessageSource messageSource ;
67
66
68
67
@ Bean
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .config ;
19
19
20
- import javax .inject .Inject ;
21
-
20
+ import org .springframework .beans .factory .annotation .Autowired ;
22
21
import org .springframework .context .annotation .Bean ;
23
22
import org .springframework .context .annotation .Configuration ;
24
23
import org .springframework .context .annotation .Profile ;
@@ -37,7 +36,7 @@ public interface StrategiesConfig {
37
36
@ Profile ("test" )
38
37
class TestStrategiesConfig implements StrategiesConfig {
39
38
40
- @ Inject
39
+ @ Autowired
41
40
private ImageDataDao imageDataDao ;
42
41
43
42
@ Bean
@@ -51,7 +50,7 @@ public ImagePersistenceStrategy getImagePersistenceStrategy() {
51
50
@ Profile ("prod" )
52
51
class ProdStrategiesConfig implements StrategiesConfig {
53
52
54
- @ Inject
53
+ @ Autowired
55
54
private Environment env ;
56
55
57
56
@ Bean
Original file line number Diff line number Diff line change 19
19
20
20
import java .util .Date ;
21
21
22
- import javax .inject .Inject ;
23
22
import javax .servlet .http .HttpServletRequest ;
24
23
25
24
import org .slf4j .Logger ;
26
25
import org .slf4j .LoggerFactory ;
27
26
27
+ import org .springframework .beans .factory .annotation .Autowired ;
28
28
import org .springframework .context .ApplicationListener ;
29
29
import org .springframework .security .authentication .event .AuthenticationFailureBadCredentialsEvent ;
30
30
import org .springframework .web .context .request .RequestContextHolder ;
@@ -37,7 +37,7 @@ public class AuthenticationFailureListener
37
37
38
38
private static final Logger LOG = LoggerFactory .getLogger (AuthenticationFailureListener .class );
39
39
40
- @ Inject
40
+ @ Autowired
41
41
private SiteService siteService ;
42
42
43
43
@ Override
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .support .spring .security ;
19
19
20
- import javax .inject .Inject ;
21
20
import javax .servlet .http .HttpServletRequest ;
22
21
22
+ import org .springframework .beans .factory .annotation .Autowired ;
23
23
import org .springframework .context .annotation .Bean ;
24
24
import org .springframework .context .ApplicationListener ;
25
25
import org .springframework .http .HttpMethod ;
48
48
@ EnableGlobalMethodSecurity (prePostEnabled = true )
49
49
public class SecurityConfig extends WebSecurityConfigurerAdapter {
50
50
51
- @ Inject
51
+ @ Autowired
52
52
private MessageSource messageSource ;
53
53
54
- @ Inject
54
+ @ Autowired
55
55
private ServicesConfig servicesConfig ;
56
56
57
57
@ Override
@@ -105,7 +105,7 @@ protected void configure(HttpSecurity http) throws Exception {
105
105
.disable ();
106
106
}
107
107
108
- @ Inject
108
+ @ Autowired
109
109
@ Override
110
110
protected void configure (AuthenticationManagerBuilder auth ) {
111
111
auth .authenticationProvider (getAuthenticationProvider ());
Original file line number Diff line number Diff line change 19
19
20
20
import java .util .Collections ;
21
21
22
- import javax .inject .Inject ;
23
22
import javax .sql .DataSource ;
24
23
24
+ import org .springframework .beans .factory .annotation .Autowired ;
25
25
import org .springframework .boot .context .embedded .ServletRegistrationBean ;
26
26
import org .springframework .context .annotation .Bean ;
27
27
import org .springframework .context .annotation .Configuration ;
39
39
@ Configuration
40
40
public class TogglzConfig {
41
41
42
- @ Inject
42
+ @ Autowired
43
43
private DataSource dataSource ;
44
44
45
45
@ Bean
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .validation .jsr303 ;
19
19
20
- import javax .inject .Inject ;
21
20
import javax .validation .ConstraintValidator ;
22
21
import javax .validation .ConstraintValidatorContext ;
23
22
23
+ import org .springframework .beans .factory .annotation .Autowired ;
24
+
24
25
import ru .mystamps .web .service .UsersActivationService ;
25
26
26
27
public class ExistingActivationKeyValidator
27
28
implements ConstraintValidator <ExistingActivationKey , String > {
28
29
29
- @ Inject
30
+ @ Autowired
30
31
private UsersActivationService usersActivationService ;
31
32
32
33
@ Override
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .validation .jsr303 ;
19
19
20
- import javax .inject .Inject ;
21
20
import javax .validation .ConstraintValidator ;
22
21
import javax .validation .ConstraintValidatorContext ;
23
22
23
+ import org .springframework .beans .factory .annotation .Autowired ;
24
+
24
25
import ru .mystamps .web .service .CategoryService ;
25
26
import ru .mystamps .web .validation .jsr303 .UniqueCategoryName .Lang ;
26
27
27
28
public class UniqueCategoryNameValidator
28
29
implements ConstraintValidator <UniqueCategoryName , String > {
29
30
30
- @ Inject
31
+ @ Autowired
31
32
private CategoryService categoryService ;
32
33
33
34
private Lang lang ;
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .validation .jsr303 ;
19
19
20
- import javax .inject .Inject ;
21
20
import javax .validation .ConstraintValidator ;
22
21
import javax .validation .ConstraintValidatorContext ;
23
22
23
+ import org .springframework .beans .factory .annotation .Autowired ;
24
+
24
25
import ru .mystamps .web .service .CountryService ;
25
26
import ru .mystamps .web .validation .jsr303 .UniqueCountryName .Lang ;
26
27
27
28
public class UniqueCountryNameValidator implements ConstraintValidator <UniqueCountryName , String > {
28
29
29
- @ Inject
30
+ @ Autowired
30
31
private CountryService countryService ;
31
32
32
33
private Lang lang ;
Original file line number Diff line number Diff line change 19
19
20
20
import java .util .Set ;
21
21
22
- import javax .inject .Inject ;
23
22
import javax .validation .ConstraintValidator ;
24
23
import javax .validation .ConstraintValidatorContext ;
25
24
25
+ import org .springframework .beans .factory .annotation .Autowired ;
26
+
26
27
import ru .mystamps .web .entity .GibbonsCatalog ;
27
28
import ru .mystamps .web .service .SeriesService ;
28
29
import ru .mystamps .web .util .CatalogUtils ;
29
30
30
31
public class UniqueGibbonsNumbersValidator
31
32
implements ConstraintValidator <UniqueGibbonsNumbers , String > {
32
33
33
- @ Inject
34
+ @ Autowired
34
35
private SeriesService seriesService ;
35
36
36
37
@ Override
Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .validation .jsr303 ;
19
19
20
- import javax .inject .Inject ;
21
20
import javax .validation .ConstraintValidator ;
22
21
import javax .validation .ConstraintValidatorContext ;
23
22
23
+ import org .springframework .beans .factory .annotation .Autowired ;
24
+
24
25
import ru .mystamps .web .service .UserService ;
25
26
26
27
public class UniqueLoginValidator implements ConstraintValidator <UniqueLogin , String > {
27
28
28
- @ Inject
29
+ @ Autowired
29
30
private UserService userService ;
30
31
31
32
@ Override
You can’t perform that action at this time.
0 commit comments