Skip to content

Remove obsolete PropertyEditorManager cleanup task #1602

Description

@ptziegler

The registry field no longer exists since openjdk/jdk@d46ed5c. Neither the IDE nor WindowBuilder support such ancient Java versions and this is therefore dead code.

/**
* Clear {@link PropertyEditorManager} cache to prevent {@link Class} and {@link ClassLoader}
* leaks.
*/
private void dispose_PropertyEditorManager() {
ExecutionUtils.runIgnore(new RunnableEx() {
@Override
@SuppressWarnings("rawtypes")
public void run() throws Exception {
Map registry =
(Map) ReflectionUtils.getFieldObject(PropertyEditorManager.class, "registry");
if (registry != null) {
for (Iterator I = registry.entrySet().iterator(); I.hasNext();) {
Map.Entry entry = (Map.Entry) I.next();
Class editorClass = (Class) entry.getValue();
if (isLoadedFrom(editorClass)) {
I.remove();
}
}
}
}
});
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions