You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gemini 2.5 Pro LOW findings applied to the Java financial benchmark service:
- FinancialBenchmarkService: add logger.warn() to all validation failure paths
so rejected requests appear in server logs (previously silent)
- FinancialBenchmarkService: runtimeInfo() now reports heap tier classification
("JVM heap tier: 16+ GB") instead of Java version string (information disclosure)
- FinancialBenchmarkService: simplify monteCarlo() — remove redundant ternary
defaults now that MonteCarloRequest getters enforce them
- MonteCarloRequest: getters enforce defaults (nSimulations, nPeriods,
initialValue, nPeriodsPerYear) so service code has no ternary clutter
CRITICAL finding applied: add unit test coverage (FinancialBenchmarkServiceTest):
- portfolioVariance: 2-asset known result (σ²=0.0355), single asset, flat matrix,
monthly nPeriodsPerYear, normalizeWeights rescaling, 6 validation paths
- monteCarlo: seeded reproducibility, defaults, zero volatility, custom percentiles,
monthly vs daily nPeriodsPerYear, max-simulations cap, negative-volatility rejection
- scenarioAnalysis: single-asset known result (E[r]=0.04, upside=120, downside=80,
U/D=1.5), 200-asset hash vs linear speedup, useHashLookup=false, 4 validation paths
- MonteCarloRequest getter defaults verified independently
- 30 tests total; all paths exercised without Spring context (plain unit tests)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/webservices/FinancialBenchmarkService.java
+44-30Lines changed: 44 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -94,26 +94,30 @@ public PortfolioVarianceResponse portfolioVariance(PortfolioVarianceRequest requ
94
94
95
95
intn = request.getNAssets();
96
96
if (n <= 0 || n > MAX_ASSETS) {
97
-
returnPortfolioVarianceResponse.failed(
98
-
"n_assets=" + n + " is out of range [1, " + MAX_ASSETS + "].");
97
+
Stringerr = "n_assets=" + n + " is out of range [1, " + MAX_ASSETS + "].";
Copy file name to clipboardExpand all lines: modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/webservices/MonteCarloRequest.java
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -80,16 +80,16 @@ public class MonteCarloRequest {
80
80
/** Optional identifier echoed in the response for request tracing. */
0 commit comments