-
Notifications
You must be signed in to change notification settings - Fork 0
fix(OFJAVA-018): 2 review findings in CacheServiceAbs.java #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ protected boolean isCacheEntryStale(String cachePath, String key, Long refreshIn | |
| } | ||
| return isStale; | ||
| } catch (Throwable e) { | ||
| log.error("Error checking cache entry age: {}", e.getMessage()); | ||
| log.error("Error checking cache entry age", e); | ||
| return true; // Consider it stale if we can't check | ||
| } | ||
| } | ||
|
|
@@ -161,7 +161,7 @@ protected <T> Optional<T> doHttpCall(Supplier<T> supplier, String cachePath, Str | |
| put(cachePath, cacheKey, response); | ||
| return Optional.of(response); | ||
| } catch (Exception e) { | ||
| log.error("Error fetching data: {}", e.getMessage()); | ||
| log.error("Error fetching data", e); | ||
| return Optional.empty(); | ||
| } | ||
| } | ||
|
Comment on lines
161
to
167
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ Exception swallowed with message-only logging instead of full exception object In doHttpCall (catch block around line 155), changed π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
@@ -247,3 +247,4 @@ public void setCacheMode(CacheMode cacheMode) { | |
| this.cacheMode = cacheMode; | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
𦩠π΄ Cache-entry-age check logs only exception message, discarding stack trace
In isCacheEntryStale (catch block around line 74), changed
log.error("Error checking cache entry age: {}", e.getMessage());tolog.error("Error checking cache entry age", e);, passing the exception object so the stack trace is preserved.π€ Prompt for AI agents
fix confidence: π’ 95 high β react π/π to teach the reviewer