Clean up low-severity CodeQL code-quality alerts#299
Merged
vharseko merged 1 commit intoJul 23, 2026
Conversation
Resolve 17 CodeQL note-level alerts across 15 files: - inefficient-empty-string-test: use String.isEmpty() instead of ""-equality (8) - inefficient-string-constructor: drop redundant new String(...) wrappers (2) - inefficient-key-set-iterator: iterate entrySet() instead of keySet()+get() (2) - useless-tostring-call: remove toString() on values already String (2) - local-variable-is-never-read: remove dead local assignments (3) Behaviour is unchanged; all touched modules compile.
maximthomas
approved these changes
Jul 23, 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.
Resolves 17 open CodeQL
note-level (code-quality) alerts across 15 files. All changes are behaviour-preserving mechanical cleanups.Fixes by rule
java/inefficient-empty-string-test"".equals(x)/x.equals("")→x.isEmpty()(each site already null-guards separately)java/inefficient-string-constructornew String(url.toString())wrapperjava/inefficient-key-set-iteratorentrySet()instead ofkeySet()+get(key)(identical output)java/useless-tostring-call.toString()on a value that is already aStringjava/local-variable-is-never-readIntentionally left alone (not mechanical)
These open alerts are not included, as a "fix" would be wrong or would change behaviour:
persistit/core/.../BufferPool.java:272(local-variable-is-never-read) — deliberate OOM reserve: thebyte[] reserveblock is nulled in thecatchto free memory for the diagnostic path. Removing it would break the mechanism (false positive).rest/api-descriptor/.../CrestApiProducer.java:93(call-to-object-tostring) — no clean mechanical fix; a change would alter the text of a diagnostic exception message.persistit/doc/conf.py:14(py/unused-import) —import sys, osbacks the commented Sphinx example on line 19; removing it would introduce a latentNameError.Verification
mvn -o compilepasses for every touched Maven module;AsciiDocIndex.java(non-Maven doc tooling) compiles viajavacwith persistit-core on the classpath.