Repository navigation
Backend: exception handlers, controller advice, interceptors and validation - #6090
Conversation
…dation Controllers and @ControllerAdvice beans declare @ExceptionHandler methods, resolved at build time by closest type and then advice order. Security failures and Errors are never offered to a handler. HandlerInterceptor beans run inside the security chain with Spring's preHandle/postHandle/ afterCompletion semantics. @Valid and the constraints in com.codename1.backend.validation compile to plain checks that report stable field paths; an unhandled ValidationException answers 400 JSON. Fixes #5993 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cloudflare Preview
|
|
Compared 191 screenshots: 191 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 227 screenshots: 227 matched. |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
|
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Flutter vs Codename OneSame application, built both ways: Flutter's AOT compile of the gallery, and the identical Dart source transpiled to Java on Codename One. Lower is better for every metric, so a ratio above 1.00x means Codename One is ahead by that factor. android9 interleaved rounds; host load 0.56, 1.85, 1.54
Compute -- the VM workloads (
Gate: within tolerance against
ios9 interleaved rounds; host load 18.19, 27.77, 21.54
Compute -- the VM workloads ( Not measured: iOS compute is not measured: a device build needs signed hardware, and on the simulator Flutter runs its JIT debug engine rather than AOT code. The macOS row runs the same ParparVM and Dart AOT compilers on the same Apple silicon. Gate: within tolerance against
javascript9 interleaved rounds; host load 2.01, 1.3, 0.57
Compute -- the VM workloads (
Gate: within tolerance against
linux9 interleaved rounds; host load 0.26, 2.88, 2.49
Compute -- the VM workloads (
Gate: within tolerance against
macos9 interleaved rounds; host load 10.34, 24.34, 22.64
Compute -- the VM workloads (
Gate: within tolerance against
windows9 interleaved rounds
Compute -- the VM workloads (
Gate: within tolerance against
Codename One wins 26 of 26 measured metrics across 6 platform(s). |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 206 screenshots: 206 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 9V45 96-Core Processor (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 206 screenshots: 206 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
… includes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 192 screenshots: 192 matched. Benchmark Results
Detailed Performance Metrics
ParparVM vs HotSpot (JDK 25): macOS arm64Runner CPU: Apple M1 (Virtual) (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 189 screenshots: 189 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 188 screenshots: 188 matched. Benchmark Results
Detailed Performance Metrics
|
|
Compared 249 screenshots: 249 matched. |
|
Compared 176 screenshots: 176 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 184 screenshots: 184 matched. |
Fixes #5993.
@ExceptionHandleron controllers and on@ControllerAdvice/@RestControllerAdvicebeans, resolved at build time: controller first, then advice by@Orderand bean name, closest exception type within each. Handlers may take the exception, the request and theHandlerMethod, and return aResponse, a body or nothing.AccessDeniedException,AuthenticationException, CSRF) andErrorare never offered to a handler, so error routing cannot bypass security.HandlerInterceptorbeans run after the security chain and route selection, with Spring'spreHandle/postHandle/afterCompletionordering.afterCompletionruns on every outcome.ExceptionResolverbeans replaceHandlerExceptionResolver.@Validplus@NotNull/@NotBlank/@NotEmpty/@Size/@Min/@Maxgenerate plain checks (no reflection) with stable JSON field paths. An unhandledValidationExceptionanswers a 400 JSON list of field errors. A constraint on a type that cannot carry it fails the build.Tests: processor unit tests plus an end-to-end
BackendBeansTestthat runs a real server and checks the interaction with security (401 before interceptors run, 403 not overridden by a broad handler). build-engine verify and backend verify pass with SpotBugs, Checkstyle and the PMD report clean.🤖 Generated with Claude Code