You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2019/08/27 16:16:36 UTC

[sling-org-apache-sling-scripting-bundle-tracker] branch master updated: SLING-8662 - Migrate the Apache Sling Scripting Bundle Tracker to sling-bundle-parent 35

This is an automated email from the ASF dual-hosted git repository.

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-bundle-tracker.git


The following commit(s) were added to refs/heads/master by this push:
     new 479ead9  SLING-8662 - Migrate the Apache Sling Scripting Bundle Tracker to sling-bundle-parent 35
479ead9 is described below

commit 479ead9ac46dea0bfd511cf4f5d5a05e927d2e51
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Tue Aug 27 18:16:18 2019 +0200

    SLING-8662 - Migrate the Apache Sling Scripting Bundle Tracker to sling-bundle-parent 35
---
 pom.xml                                            | 47 +++++++++-------------
 .../internal/AbstractBundledRenderUnit.java        |  2 +-
 .../scripting/bundle/tracker/internal/Script.java  |  5 ++-
 3 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/pom.xml b/pom.xml
index 21d4552..e184eeb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,8 +22,8 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.sling</groupId>
-        <artifactId>sling</artifactId>
-        <version>34</version>
+        <artifactId>sling-bundle-parent</artifactId>
+        <version>35</version>
         <relativePath/>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -33,32 +33,31 @@
     </properties>
 
     <artifactId>org.apache.sling.scripting.bundle.tracker</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-    <packaging>bundle</packaging>
+    <version>0.1.0-SNAPSHOT</version>
+    <name>Apache Sling Scripting Bundle Tracker</name>
+    <description>
+        The Apache Sling Scripting Bundle Tracker bundle represents an add-on module that can be deployed on a Sling 10 instance or
+        newer to enhance the scripting resolving capabilities. Being an add-on, the bundle hooks into Sling's current mechanisms for
+        content-to-servlet resolution and essentially acts as a service registration broker for bundles providing scripting capabilities
+    </description>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>4.2.0</version>
-                <extensions>true</extensions>
-                <executions>
-                    <execution>
-                        <id>scr-metadata</id>
-                        <goals>
-                            <goal>manifest</goal>
-                        </goals>
-                    </execution>
-                </executions>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>bnd-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>bnd-baseline-maven-plugin</artifactId>
                 <configuration>
-                    <exportScr>true</exportScr>
+                    <failOnMissing>false</failOnMissing>
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>findbugs-maven-plugin</artifactId>
-                <version>3.0.5</version>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+                <version>3.1.11</version>
                 <configuration>
                     <effort>Max</effort>
                     <xmlOutput>true</xmlOutput>
@@ -184,13 +183,7 @@
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <version>2.13.0</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.powermock</groupId>
-            <artifactId>powermock-reflect</artifactId>
-            <version>1.6.5</version>
+            <version>2.25.1</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
diff --git a/src/main/java/org/apache/sling/scripting/bundle/tracker/internal/AbstractBundledRenderUnit.java b/src/main/java/org/apache/sling/scripting/bundle/tracker/internal/AbstractBundledRenderUnit.java
index 1d552d5..192934d 100644
--- a/src/main/java/org/apache/sling/scripting/bundle/tracker/internal/AbstractBundledRenderUnit.java
+++ b/src/main/java/org/apache/sling/scripting/bundle/tracker/internal/AbstractBundledRenderUnit.java
@@ -83,7 +83,7 @@ abstract class AbstractBundledRenderUnit implements Executable {
     @Override
     @Nullable
     @SuppressWarnings("unchecked")
-    public <ServiceType> ServiceType[] getServices(@NotNull String className, @NotNull String filter) {
+    public <ServiceType> ServiceType[] getServices(@NotNull String className, @Nullable String filter) {
         ServiceType[] result = null;
         try {
             final ServiceReference[] refs = this.bundleContext.getServiceReferences(className, filter);
diff --git a/src/main/java/org/apache/sling/scripting/bundle/tracker/internal/Script.java b/src/main/java/org/apache/sling/scripting/bundle/tracker/internal/Script.java
index 172c5b4..b752f49 100644
--- a/src/main/java/org/apache/sling/scripting/bundle/tracker/internal/Script.java
+++ b/src/main/java/org/apache/sling/scripting/bundle/tracker/internal/Script.java
@@ -33,6 +33,7 @@ import javax.script.ScriptException;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.sling.scripting.core.ScriptNameAwareReader;
+import org.jetbrains.annotations.NotNull;
 import org.osgi.framework.Bundle;
 
 class Script extends AbstractBundledRenderUnit {
@@ -65,18 +66,20 @@ class Script extends AbstractBundledRenderUnit {
         return sourceCode;
     }
 
+    @NotNull
     @Override
     public String getName() {
         return url.getPath();
     }
 
+    @NotNull
     @Override
     public ScriptEngine getScriptEngine() {
         return scriptEngine;
     }
 
     @Override
-    public void eval(ScriptContext context) throws ScriptException {
+    public void eval(@NotNull ScriptContext context) throws ScriptException {
         try {
             if (scriptEngine instanceof Compilable && compiledScript == null) {
                 compilationLock.lock();