Object를 일반적인 방법으로 복제를 하는 경우 문제가 발생할 수 있습니다. 아래 예제를 통해 확인해 보겠습니다. 테스트 코드 public class TestClone { public static void main(String[] args) { User user1 = new User("test1"); User cUser1 = (User)user1.clone(); cUser1.setName("test2"); System.out.println(user1.toString()); System.out.println(cUser1.toString()); } public static class User implements Cloneable, Serializable{ private String name; private..
검출 메시지 The type of the "map" object should be an interface such as "Map" rather than the implementation "HashMap".List, Set, Map 사용 시 자주 실수하는 내용 중 하나입니다. 심지어 List가 인터페이스인 줄도 모르는 개발자가 많습니다. 왜 인터페이스를 사용해야 하는지를 모르면서 습관처럼 만들고 사용합니다. 왜 그러해야하는가에 대한 것을 공부하고 좋은 습관을 만드는게 중요한거 같습니다. 잘못 사용 되는 예ArrayList list = new ArrayList();HashMap map = new HashMap();HashSet set = new HashSet(); public void test(HashMap..
리팩토링 검출 메시지 "Reorder the modifiers to comply with the Java Language Specification."Java class, method 선언 시 표현 순서 1. Annotations 2. 접근자 (public/protected/private) 3. abstract 4. static 5. final 6. transient 7. volatile 8. default 9. synchronized10. native11. strictfp 잘못된 예 : public synchronized static String replace(...} 변경 : public static synchronized String replace(...}참고 및 발췌8.1. Class Declara..
- Total
- Today
- Yesterday
- mybatis
- 스프링부트
- springboot
- spring
- REST
- Javascript
- 설정
- 스프링
- 예제
- listToMap
- ag grid
- 엑셀
- Spring Boot
- UI
- RESTful
- sample
- SHEETJS
- 메시지
- restful서비스
- 샘플
- cache
- java
- oracle
- thymeleaf
- example
- AG-GRID
- 타임리프
- lombok
- mapToList
- 그리드
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |