목록전체 글 (23)
ordinary
Item16: public 클래스에서는 public필드가 아닌 접근자 메서드를 사용해라 Item17: 변경가능성을 최소화하라 두개의 주제는 필드의 쓰레드-safe한 접근을 가능하도록 함이다. 가변필드를 public으로 직접 노출하지 않도록 dto같은 클래스에서 필드를 private로 사용하고 getter를 사용해 데이터를 가져오는 익숙하고 쉬운 패턴 메서드를 작성할때도 함수형 프로그래밍에서 사용하듯 피연산자에 함수를 적용해 결과를 반환하고, 피연산자 자체는 그대로임.
또 자바독 - Runnable interface The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. The class must define a method of no arguments called run. This interface is designed to provide a common protocol for objects that wish to execute code while they are active. For example, Runnable is implemented by class Thread. Being active simply means ..
java11기준 자바독 참고 - Stringbuilder A mutable sequence of characters. mutable = 수정가능한 수정 가능한 문자의 배열 This class provides an API compatible with StringBuffer, but with no guarantee of synchronization. 이 클래스는 StringBuffer와 호환을 제공하지만, 동기화를 보장하지는 않음. This class is designed for use as a drop in replacement for StringBuffer in places where the string buffer was being used by a single thread (as is generall..
nohup ./mvnw spring-boot:run & echo $! > ./pid.file & pid.file을 삭제하는것이 포인트 kill $(cat ./pid.file)
- 컴파일단계에서 나는 오류 친절하게 Action: Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed 요렇게 저렇게 하라고 알려준다. bean등록 오류인데 @Component로 등록해뒀던 클래스를 Config파일에서 다시 생성해서 쓰려고 @Bean을 붙혀서 두번 bean이 등록되어 발생한 오류였다. -> 해결방법 : 에러로그에 경로 파일을 둘다 열어보고 두 파일에 등록된 bean 중에 하나의 bean 등록 해제 or 콘솔에서 알려준대로 둘중 하나에 @Primary 나 @Q..