Remove the stale migration deprecations of ObjectClass and AttributeDescription - #832
Merged
vharseko merged 1 commit intoAug 4, 2026
Conversation
…escription ObjectClass.isPlaceHolder(), AttributeDescription.getNameOrOID() and the four AttributeDescription.create() overloads taking the user provided attribute name are marked "@deprecated This method may be removed at any time" with an "@SInCE OPENDJ-2803/2987 Migrate ..." tag. These are migration markers of the SDK rework which never named a replacement, and there is none: * a non strict schema returns ObjectClass.newPlaceHolder(name) for an unknown object class, and isPlaceHolder() is the only way of recognising it without asking the schema again by name; * getNameOrOID() returns the name as the user provided it, which the primary name of the attribute type does not preserve; * the create() overloads taking an attribute name keep that name, which the overloads without it drop. The 54 calls to these methods are spread over the entry, schema, replication and control panel code, so keeping the markers only produces permanent alerts without telling anybody what to use instead. Drop the markers and document what each method is for, and how it differs from the neighbouring API. The remaining deprecated calls of the server are left alone: getConfigEntry() documents a replacement its callers cannot use, isAllowAttributeNameExceptions() would need a schema which the control panel may not have, ChangelogBackend .getInstance() asks for a lifecycle change, and Subject.getSubject() has no replacement before Java 18.
maximthomas
approved these changes
Aug 3, 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.
Closes 54 of the 68
java/deprecated-callalerts left after #823 and #826 — the ones pointing at the SDK's own API — without touching a single call site.The problem with these deprecations
ObjectClass.isPlaceHolder(),AttributeDescription.getNameOrOID()and the fourAttributeDescription.create()overloads which take the user provided attribute name are all marked the same way:These are migration markers left by the SDK rework. They name no replacement, and there is none:
ObjectClass.newPlaceHolder(name)for an object class it does not know, andisPlaceHolder()is the only way of recognising it — short of asking the schema again by name withhasObjectClass(), which every one of the 27 call sites would have to do;getNameOrOID()returns the attribute name as the user provided it, preserving its case and any alias;getAttributeType().getNameOrOID()returns the primary name from the schema, andtoString()appends the options, so neither is a replacement — swapping them in would change the attribute names the server echoes back in responses and LDIF;create()overloads taking an attribute name keep that name in the resulting description, which the overloads without it drop.The 54 calls are spread over the entry, schema, replication, plugin and control panel code. Keeping the markers therefore produces permanent code scanning alerts while telling nobody what to use instead.
What this change does
Drops the
@Deprecatedannotation and the@deprecated/@sincetags from the six methods, and replaces them with a sentence explaining what each method is for and how it differs from the neighbouring, non-deprecated API — which is the information the marker was missing. No call site is modified, and no behaviour changes.Alerts deliberately left open (14)
DirectoryServer.getConfigEntry(9) — this deprecation is meaningful ("usegetEntry(DN)when possible") and worth keeping for new code, but all nine call sites are backend and config-manager initialization, or the collection of user defined attributes from a configuration entry, where the virtual attribute processing ofgetEntry()must not happen. The advice does not apply to them.CoreConfigManager.isAllowAttributeNameExceptions(2) — its replacement, theALLOW_MALFORMED_NAMES_AND_OPTIONSschema option, needs a schema from the server context. Both calls are inStaticUtils.isValidSchemaElement(), which is only called by the control panel schema editors while the user types a name, and a missing schema there would break the editor.ChangelogBackend.getInstance(2) — "instead inject the required object where needed":FileChangelogDBandChangeNumberIndexerare created by the replication server independently of the backend, so this is a lifecycle change rather than a call replacement.Subject.getSubject(1) —Subject.current()requires Java 18; this project targets Java 11.Testing
Annotation and javadoc only, no code path changes.
opendj-corefull test suite — 8173 tests, all passing;opendj-corepackages including javadoc generation, andopendj-server-legacycompiles cleanly against it.