Skip to content

PathMatchingResourcePatternResolver(ClassLoader classLoader) [SPR-5264] #9937

@spring-projects-issues

Description

@spring-projects-issues

Peter Rietzler opened SPR-5264 and commented

The method documentation says:

  • @param classLoader the ClassLoader to load classpath resources with,
  • or <code>null</code> for using the thread context class loader
    ...
    public PathMatchingResourcePatternResolver(ClassLoader classLoader) {

The following code throws a NullPointerException:

new PathMatchingResourcePatternResolver(null).getResources("*/**");

java.lang.NullPointerException
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:299)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:267)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:334)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:263)
....


No further details from SPR-5264

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions