Skip to content

Replace UIDefaultsWithResourceBundleCache with delegation #341

@vlsi

Description

@vlsi

Describe the bug

Currently UIDefaultsWithResourceBundleCache uses a copy of the resources, so it might go out of date with JDK.

Have you considered using delegation instead?

In other words, something like

public class DelegatingUIDefaults extends UIDefaults {
    private final UIDefaults base; // or an array

    public DelegatingUIDefaults(UIDefaults base) {
        this.base = base;
    }

    @Override
    public Object get(Object key, Locale l) {
        Object value = super.get(key, l); // try searching locally first
        if (value != null) {
            return value;
        }
        return base.get(key, l); // delegate if missing
    }

Additional context

See apache/jmeter#5715 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions