fix: Fix bugs and improve code quality across the codebase#233
Closed
fix: Fix bugs and improve code quality across the codebase#233
Conversation
|
Thank you for following naming conventions! 😻 |
|
Thanks for opening this pull request! |
|
@Copilot |
- Fix integer overflow in Cache.CACHE_HOLD_1DAY (24*60*60*1000*1000*1000L overflows int) - Fix Cache.get() to use generic type K instead of String - Fix DelayedItem.getDelay() unit conversion (convert from NANOSECONDS, not unit) - Fix ZIP entry duplicate name bug in DataBaseDocumentController - Fix LogAspect.doAround() return type from Map to Object for void methods - Replace e.printStackTrace() with SLF4J logging in 16 locations - Make SimpleCache constants static final - Fix incorrect javadoc on BaseUtils.callbackNotFound - Fix raw types in CacheManage CACHE_MAP - Replace magic numbers in BaseUtils char case methods with Character API Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
PR Summary
|
…ull message in LogAspect Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
|
Copilot
AI
changed the title
[WIP] Optimize and refactor project code for improvements
Fix bugs and improve code quality across the codebase
Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Code audit fixing real bugs and cleaning up common anti-patterns.
Proposed Changes
Bug fixes
Cache.CACHE_HOLD_1DAY—24 * 60 * 60 * 1000 * 1000 * 1000Loverflowsintbefore widening tolong. Replaced all cache duration constants withTimeUnit.toNanos().Cache.get()parameter typed asStringinstead of genericK— broke contract ofCache<K, V>.DelayedItem.getDelay()no-op conversion —unit.convert(delay, unit)converts unit→unit. Fixed to convert fromTimeUnit.NANOSECONDS.DataBaseDocumentControllerZIP entries all share same name — multi-format export produced corrupt ZIP. Now appends format-specific suffix.LogAspect.doAround()returnsMap<String, Object>— unchecked cast fails forvoid/ModelAndViewmethods annotated with@Log. Changed toObject.Code quality
e.printStackTrace()calls with SLF4Jlog.error(msg, e)across 7 files.SimpleCacheconstants —static→static final.CacheManage.CACHE_MAP— eliminated raw types with proper generics.BaseUtilschar case methods — replaced magic number arithmetic (chars[0] += 32,chars ^= 32) withCharacter.toLowerCase()/toUpperCase().BaseUtils.callbackNotFound— fixed javadoc that incorrectly said "深度克隆".Readiness Checklist
Author/Contributor
Reviewing Maintainer
enhancement,bug,documentation,styleordependenciesWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkstyle.org/opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/xml/tools/xml-extractor.jar --fileList=/tmp/codeql-scratch-e937359de4103e32/dbs/java/working/files-to-index5732281612012063206.list --sourceArchiveDir=/tmp/codeql-scratch-e937359de4103e32/dbs/java/src --outputDir=/tmp/codeql-scratch-e937359de4103e32/dbs/java/trap/java(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.