You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2021/11/26 15:28:52 UTC
[sling-org-apache-sling-testing-osgi-mock] branch master updated: SLING-8073 update reflections library to 0.10.2 (#18)
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
The following commit(s) were added to refs/heads/master by this push:
new 48e0d1e SLING-8073 update reflections library to 0.10.2 (#18)
48e0d1e is described below
commit 48e0d1e632f13f025161507349f9bc2a1d364fd8
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Nov 26 16:28:47 2021 +0100
SLING-8073 update reflections library to 0.10.2 (#18)
improves logging and exception handling
---
core/pom.xml | 10 +++++++---
.../org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java | 7 ++-----
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/core/pom.xml b/core/pom.xml
index 9b00c6b..4480bd5 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -90,13 +90,13 @@
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
- <version>0.9.12</version>
+ <version>0.10.2</version>
<scope>compile</scope>
<!-- exclude all optional dependencies -->
<exclusions>
<exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>dom4j</groupId>
@@ -114,6 +114,10 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ </exclusion>
</exclusions>
</dependency>
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
index 673a146..e094d10 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
@@ -52,7 +52,7 @@ import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.reflections.Reflections;
-import org.reflections.scanners.ResourcesScanner;
+import org.reflections.scanners.Scanners;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
@@ -74,9 +74,6 @@ final class OsgiMetadataUtil {
static {
DOCUMENT_BUILDER_FACTORY = DocumentBuilderFactory.newInstance();
DOCUMENT_BUILDER_FACTORY.setNamespaceAware(true);
-
- // suppress log entries from Reflections library
- Reflections.log = null;
}
private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance();
@@ -156,7 +153,7 @@ final class OsgiMetadataUtil {
}
// get all OSGI-INF/*.xml files from classpath
- Reflections reflections = new Reflections(METADATA_PATH, new ResourcesScanner());
+ Reflections reflections = new Reflections(METADATA_PATH, Scanners.Resources);
Pattern xmlFilesPattern = Pattern.compile("^.*\\.xml$");
Set<String> paths = reflections.getResources(xmlFilesPattern);