This project is a fork of original Spring PetClinic application modified to trigger inspections provided by IJ IDEA Ultimate.
# | Subsystem | Inspection | Highlighted for |
---|---|---|---|
1 | Spring Data | SpringDataRepositoryMethodParametersInspection | PetRepository#findByType |
2 | SpringDataMethodInconsistencyInspection | OwnerRepository#findByName |
|
3 | SpringDataRepositoryMethodReturnTypeInspection | PetRepository#findByName |
|
4 | Spring Boot | SpringBootApplicationPropertiesInspection | application.properties |
5 | SpringBootApplicationSetupInspection | PetClinicApplication |
|
6 | ConfigurationPropertiesInspection | GeneralConfig |
|
7 | Spring Core | SpringAutowiringInspection | Owner, Pet & Vet controller constructors |
8 | SpringJavaAutowiredFieldsWarningInspection | PetController#generalConfig |
|
9 | SpringDependsOnUnresolvedBeanInspection | EntityRequestedEventPublisher |
|
10 | ContextJavaBeanUnresolvedMethodsInspection | PetFormatterProvider#petFormatter |
|
11 | SpringCacheNamesInspection | OwnerController#findAllOwners |
|
12 | SpringEventListenerInspection | EntityRequestedEventListener#onEntityRequested |
|
13 | SpringComponentScanInspection | PetClinicApplication |
|
14 | Spring MVC | SpringMVCViewInspection | PetController#getAllPets |
15 | MVCPathVariableInspection | PetController#getAllPets |
Reports Spring Data CRUD repository method parameters with incorrect types:
Reports Spring Data CRUD repository methods for which the Spring Data Query builder cannot generate the corresponding query.
Reports Spring Data CRUD repository methods with incorrect return types:
Reports unresolved and deprecated configuration keys and invalid values in
Spring Boot application .properties
configuration files, which can lead
to runtime errors:
Reports @SpringBootApplication
in the default package and redundant
@EnableAutoConfiguration
or @ComponentScan
annotations.
The quick-fix removes the redundant annotations:
Reports invalid prefixes defined in the @ConfigurationProperties
annotations:
- Missing prefix
- Empty prefix
- Duplicate prefix
- Prefix in notation other than kebab-case
Reports autowiring problems on injection points of Spring beans:
-
More than one bean of 'concrete' type
-
No beans of 'concrete' type
-
No bean with qualifier
-
Incorrect usages of
@Autowired
on Spring bean constructors
Reports injected or autowired fields in Spring components.
The quick-fix suggests the recommended constructor-based dependency injection in beans and assertions for mandatory fields.
Reports incorrect bean references in the value parameter of the @DependsOn
annotation:
Reports unresolved method references on initMethod
and destroyMethod
parameters @Bean
annotation:
Reports incorrect @Cache*
annotation names.
At least one cache name should be provided per cache operation:
@Cacheable("cache_name")
or @Cacheable(cacheNames ="cache_name")
.
@CacheConfig#cacheNames()
can be used for sharing common cache-related settings at the class level.
Reports incorrect @EventListener
methods:
Reports unresolved Spring MVC View references:
Reports @PathVariable
parameters that are declared in the method signature
but are absent in the URL path or vice versa. The quick-fix adds the missing parameter: