Skip to content

Properties is not loaded from classpath when use "common" predicate (only for Windows!) #51

@dmytro-lazebnyi

Description

@dmytro-lazebnyi

Properties are not loaded from classpath source if predicate matches with files from classpath that cannot be loaded (e.g. property files from jre jars)

Let's imagine we have following example:

Predicate<Path> propsPredicate = path -> path.toString().endsWith(".properties");
ConfigRegistry configRegistry = ConfigRegistry.create(
    ConfigRegistrySettings.builder()
        .addLastSource("classpath", new ClassPathConfigSource(propsPredicate))
        .addListener(new Slf4JConfigEventListener())
        .build());
StringConfigProperty myProp = configRegistry.stringProperty("myProp");
System.out.println("myProp=" + myProp.value().get());

In runtime FilteredPathConfigSource tries to load, for example, com/sun/javafx/scene/control/skin/resources/controls-nt.properties as it is matched with predicate, but can't do it because of java.io.FileNotFoundException: C:\Program%20Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar (The system cannot find the path specified)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions