Identify and apply modern Java (Java 8+) refactoring opportunities to improve readability, maintainability, and performance.
Prerequisites: Run ./mvnw compile or mvn compile before applying any changes. If compilation fails, stop immediately — do not proceed until the project compiles successfully.
Core areas: Lambda expressions and method references (over anonymous classes), Stream API for declarative collection processing, Optional for null-safe APIs, java.time API (replacing Date/Calendar), default interface methods, var type inference, unmodifiable collection factory methods (List.of(), Set.of(), Map.of()), CompletableFuture for composable async programming, text blocks for multi-line strings, Java 25 Fl...
익명 클래스를 람다로 마이그레이션, Iterator 루프를 Stream API로 대체, Null 안전을 위한 Optional 채택, 레거시 Date/Calendar에서 java.time으로 전환, 컬렉션 팩토리 메서드 사용, 비동기 작업을 위해 CompletableFuture로 마이그레이션, 텍스트 블록 적용, var 추론 또는 유연한 생성자 본문 및 모듈 가져오기 선언과 같은 Java 25 기능 활용 등 최신 Java 기능(Java 8+)을 채택하기 위해 Java 코드를 리팩터링해야 하는 경우에 사용합니다. Skills-for-Java 프로젝트의 일부 출처: jabrena/cursor-rules-java.