Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropertiesConfigReader.canLoad never returns false #511

Open
mfulgo opened this issue Aug 9, 2017 · 0 comments
Open

PropertiesConfigReader.canLoad never returns false #511

mfulgo opened this issue Aug 9, 2017 · 0 comments
Labels

Comments

@mfulgo
Copy link

mfulgo commented Aug 9, 2017

PropertiesConfigReader.canLoad will never return false because getResources never returns null.

    @Override
    public boolean canLoad(ClassLoader loader, String name) {
        return getResources(loader, name) != null;
    }

In getResources you see:

    private static Collection<URL> getResources(ClassLoader loader, String resourceName) {
        LinkedHashSet<URL> resources = new LinkedHashSet<URL>();
        ...
        return resources;
    }

So, canLoad should probably be:

    @Override
    public boolean canLoad(ClassLoader loader, String name) {
        return !getResources(loader, name).isEmpty();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants