⚠️ This is a demo codebase with intentional legacy patterns for modernization demos.
A simple Spring Boot 3 REST API for managing Users and Products. It targets Java 17 and includes intentional legacy patterns that make it a realistic demo target for modernization.
| Issue | Location | Why It Matters |
|---|---|---|
System.out.println logging |
UserServiceImpl.java, ProductServiceImpl.java |
Should use SLF4J / LoggerFactory |
ObjectOutputStream serialization |
ProductServiceImpl.java |
Legacy Java serialization — use Jackson/JSON |
| Synchronous service methods | UserServiceImpl.java, ProductServiceImpl.java |
No reactive/async patterns |
| Custom exception handler exposes internals | GlobalExceptionHandler.java |
Raw exception messages sent to client |
| Hardcoded secrets in config | application.properties |
Security risk — should use vault / env vars |
| Plain POJOs instead of records | model/ |
Java 17 supports record types |
| No input validation | Controllers, Models | No Bean Validation annotations |
| In-memory static storage | Services | No persistence layer |
Requires Java 17+ and Maven:
mvn spring-boot:runTests (8 tests, all green):
mvn testBuild fat JAR:
mvn package
java -jar target/legacy-api-1.0.0.jar