Correctness - SpotBugsExtensionForSpringFrameWork/CS5098 GitHub Wiki
(probably) Fully understood and theorized Bug Patterns
- Inject a Value to static field @Zhuoyang
- While using constructor injection, beware of circular dependencies (BeanCurrentlyInCreationException) @YooChul @YC :dog:
- @Autowired annotation can be applied to only one of the constructor methods, when multiple constructors are used @YooChul :dog:
- Do not access an autowired field in the constructor @YooChul :dog:
- Spring doesn't know which component to autowire (NoUniqueBeanDefinitionException) @YooChul @YC :dog:
- Bean should not be an abstract class. (InstantiationException) @YooChul @YC :dog:
- We can't use @Autowired on a constructor of an abstract class. @YooChul @YC :dog:
- If multiple beans of the same type without an ID or name are declared, Spring will throw an exception @YooChul @YC :dog:
- While using JdbcTemplate, we should distinguish queryForList() and query() dependant on single or multiple columns' queries. (IncorrectResultSetColumnCountException) #JPA #Hibernate #Spring Data @YooChul
- Using @ExceptionHandler to handle @Async exception @Zhuoyang @ZL
- Using Try-Catch Block to handle @Async exception with return type void @Zhuoyang @ZL
Waiting List for theorization
- Using
new
operator to instantiate beans without autowired @Zhuoyang - BeanDefinitionOverrideException #BeansExceptions @YooChul @ZL
- Violation of DB integrity constraint #JPA #Hibernate #Spring Data @YooChul
- DuplicateKeyException #JPA #Hibernate #Spring Data @YooChul
- @ManyToOne @OneToMany Relationships #JPA @YooChul
- HTTP element should be defined if we use Spring security #Spring Security @YooChul
- LazyInitializationException #JPA @YooChul
- @Async must be applied to public methods only @YooChul
- @Async - calling the async method from within the same class won't work @YooChul
- In Spring AOP, you can’t advise final classes. @YooChul
- @PreAuthorize should not combine with public method @Zhuoyang @ZL
Need to Study
- Proxied Beans #BeansExceptions @YooChul reason: Concept of Proxy and Transaction part is not familiar
- Property in placeholder should be defined (BeanDefinitionStoreException) @YooChul @YC
Not Sure
- Bean should be defined if it is used in the Spring configuration file. (CannotLoadBeanClassException) reason: too basic @YooChul
- NoSuchMethodException @YooChul reason: cannot find evidence and probably default constructor is automatically made in IDE
- One of three forms (Java, XML, Annotation-based) must exist for Spring configuration. @YooChul
- @AliasFor cannot be used on any stereotype annotations (@Component and its specializations). @YooChul
- BadSqlGrammarException #JPA #Hibernate #Spring Data @YooChul reason: developers would find it easily... maybe
- PropertyValueException #JPA #Hibernate #Spring Data @YooChul reason: developers would find it easily... maybe
Will delete
- Infinite Recursion #JacksonLibrary @YooChul reason: since it is not directly relevant to Spring Framework
- NotWritablePropertyException @YooChul reason: this is better to be replaced with checking of correct implementation on DI injection rules - setter, constructor, field
- Field injection cannot be used for final fields. @YooChul @ZL reason: final injection cannot be compiled so it shows error before application starts
- Inject a bean that doesn't exist @Zhuoyang @ZL
- Custom Exception in Bean Creation Process @Zhuoyang @ZL
- Non-unique Dependency Resolution #BeansExceptions @YooChul @ZL
- Component Annotation Missing #BeansExceptions @YooChul @ZL