This is an automated email from the ASF dual-hosted git repository.
gerdogdu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git
The following commit(s) were added to refs/heads/master by this push:
new b812c6f OWB-1328 NPE in AbstractMetaDataFactory
new ff4c809 Merge branch 'master' of
https://github.com/apache/openwebbeans
b812c6f is described below
commit b812c6ff7db69723d692efa1efd4dca00fd73c2a
Author: Gurkan Erdogdu <[email protected]>
AuthorDate: Wed Jun 10 08:10:54 2020 +0300
OWB-1328 NPE in AbstractMetaDataFactory
---
.../corespi/scanner/AbstractMetaDataDiscovery.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git
a/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
b/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
index 44febe9..c011670 100644
---
a/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
+++
b/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
@@ -43,6 +43,8 @@ import org.apache.xbean.finder.util.Files;
import javax.decorator.Decorator;
import javax.interceptor.Interceptor;
+
+import java.io.File;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.net.URL;
@@ -283,11 +285,14 @@ public abstract class AbstractMetaDataDiscovery
implements BdaScannerService
else
{
// we could check for META-INF/maven/org.apache.geronimo.specs
presence there but this is faster
- final String filename = Files.toFile(url).getName();
- if (filename.startsWith("geronimo-") &&
filename.contains("_spec"))
- {
- it.remove();
- }
+ File file = Files.toFile(url);
+ if(file!= null && file.exists()) {
+ final String filename = file.getName();
+ if (filename.startsWith("geronimo-") &&
filename.contains("_spec"))
+ {
+ it.remove();
+ }
+ }
}
}
}