Conversation
- Replace the deprecated boxed-type constructors with valueOf() - Make the nested classes that never touch their enclosing instance static - Remove locals that are assigned but never read (incl. two String constants left over from commented-out throws) - Use String.isEmpty() instead of "".equals(...) on String values - Fix javadoc: drop @throws for exceptions that cannot be thrown, align @PARAM names with the signatures, remove the javadoc of a commented-out method Resolves CodeQL alerts OpenIdentityPlatform#26, OpenIdentityPlatform#29, OpenIdentityPlatform#31, OpenIdentityPlatform#32, OpenIdentityPlatform#35-OpenIdentityPlatform#38, OpenIdentityPlatform#43-OpenIdentityPlatform#46, OpenIdentityPlatform#51, #422-#434, #436, #438, #439, #441-#451, #633-#645.
2 tasks
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.
Summary
Second note-level CodeQL batch: the mechanical Java cleanups — 52 alerts across 30 files, no behaviour change. Every edit is compiler-checked (a
staticnested class cannot reach the enclosing instance; a removed local cannot be read).java/inefficient-boxed-constructornew Long/Byte/Character/Float/Integer(...)→valueOf(...)(or the primitive passed straight topad(long)) inInstanceStateandConnectorUtil. These constructors are deprecated for removal since JDK 16.java/non-static-nested-classstaticon nested classes that never use the enclosing instance:SQLBuilder.{Column,Table,Join,OrderBy},RepoJobStore.{TriggerComparator,WaitingTriggers,AcquiredTriggers},PostgreSQLTableHandler.JsonExtractPathQueryFilterVisitor,Queries.OrientQueryFilterVisitor,ConfigObjectService.ParsedId,ManagedObjectService.ManagedObjectSetRequestHandler,SystemAction.SystemTypeAction,AuthenticationService.SocialAuthModuleConfigFactory.java/local-variable-is-never-readVoid result = future.get(),int val = executeUpdate()×3, unusedpropertyTable/projectDir/studioUiEnabled/type/result, the twoMSGconstants left over from commented-outthrows inAttributeInfoHelper(with the emptyifaround one of them),propsinDelayedConfigHandler(thegetPropertiesToEncryptcall is kept — it validates).java/inefficient-empty-string-test"".equals(x)→x.isEmpty()wherexis aString(JDBCRepoService,OrientDBRepoService×3,ScriptRegistryService).java/inconsistent-javadoc-throws@throwsremoved where the method cannot throw it (AuditServiceImpl,ManagedObjectSet,MaintenanceService×2,RepoJobStore×4 — only the four flagged blocks; the other@throws ResourceExceptionin that file are genuine).java/unknown-javadoc-parameter@paramnames aligned with the signatures (LinkType,ReconciliationContext,ReconFeeder,ReconStage); the orphaned javadoc of a commented-out method inOperationHelperremoved.Dismissed (6):
confusing-method-signature— public overloads used across modules (IdentityServer.initInstance,LogUtil.logAtLevel, the DisruptoronEventhandlers,AttributeInfoHelper.build); renaming would be a breaking change.non-static-nested-class—ZipArchive's constructor deliberately calls the enclosingresolveChecksumFile(), whichUpdateManagerImplTestoverrides as a test seam.inefficient-empty-string-test—valueAssertionis anObject;"".equals(...)is the right null-safe comparison there.Deferred (1): #437
ResourceServlet:127sits in the hunk #202 rewrites; it will follow once that PR lands.Test plan