Skip to content

Replace deprecated API calls flagged by CodeQL - #213

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fix-codeql-notes-deprecated
Open

vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fix-codeql-notes-deprecated

Conversation

@vharseko

Copy link
Copy Markdown
Member

Summary

Third note-level CodeQL batch: java/deprecated-call. 22 alerts replaced 1:1 with the current API, 5 dismissed with reasons; the 9 boxed-constructor ones (#60#64, #69#72) are already covered by #212.

Alerts Replacement
#56, #59, #67, #68, #86 Class.newInstance() getDeclaredConstructor().newInstance(); the specific catches in AuditServiceImpl / AuthenticationService widened to ReflectiveOperationException (the other three sites already caught Exception).
#87#92 Jackson MapperFeature.SORT_PROPERTIES_ALPHABETICALLY is applied through JsonMapper.builder()configure/enable(MapperFeature) on a built ObjectMapper has been deprecated since 2.13. JsonUtil plus the five Activiti resources; the other features stay as they were.
#65, #66 OSGi LogEntry.getLevel() getLogLevel() with a switch over the LogLevel enum. Minor behavioural improvement: AUDIT now logs at error and TRACE at trace instead of both falling into the "unknown level" warn branch.
#76, #77, #82, #83 ODocument.save() db.save(doc) (the session is in scope at all four sites).
#78#81 OrientDB index manager getIndexManagerInternal() with the session-taking dropIndex(db, …) / getClassInvolvedIndexes(db, …).
#54, #55 commons-io FileUtils.write The overload with an explicit StandardCharsets.UTF_8.
#58 X509Certificate.getSubjectDN() (log line) getSubjectX500Principal().
#73 BoneCP setReleaseHelperThreads(5) Removed — a no-op since BoneCP 0.8.

Dismissed:

Test plan

- Class.newInstance() -> getDeclaredConstructor().newInstance()
- Jackson: set MapperFeature through JsonMapper.builder() instead of on a
  built ObjectMapper (JsonUtil and the Activiti resources)
- OSGi LogEntry.getLevel() -> getLogLevel(), mapping AUDIT and TRACE too
- OrientDB: db.save(doc) and the internal index manager API
- commons-io FileUtils.write with an explicit charset
- Log the client certificate subject via getSubjectX500Principal()
- Drop the no-op BoneCP setReleaseHelperThreads()

Resolves CodeQL alerts OpenIdentityPlatform#54-OpenIdentityPlatform#56, OpenIdentityPlatform#58, OpenIdentityPlatform#59, OpenIdentityPlatform#65-OpenIdentityPlatform#68, OpenIdentityPlatform#73, OpenIdentityPlatform#76-OpenIdentityPlatform#83, OpenIdentityPlatform#86-OpenIdentityPlatform#92.
@vharseko vharseko added java Pull requests that update Java code refactor Code refactoring without behavior change repo Storage / repository layer (OrientDB, JDBC, HSQLDB) workflow Activiti workflow engine / scripting labels Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code refactor Code refactoring without behavior change repo Storage / repository layer (OrientDB, JDBC, HSQLDB) workflow Activiti workflow engine / scripting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant