[Git][java-team/jboss-modules][master] 6 commits: New upstream version 1.11.0

Markus Koschany gitlab at salsa.debian.org
Sat Dec 5 01:25:20 GMT 2020



Markus Koschany pushed to branch master at Debian Java Maintainers / jboss-modules


Commits:
6ce2b122 by Markus Koschany at 2020-12-05T01:56:55+01:00
New upstream version 1.11.0
- - - - -
8167ad25 by Markus Koschany at 2020-12-05T01:57:01+01:00
Update upstream source from tag 'upstream/1.11.0'

Update to upstream version '1.11.0'
with Debian dir 04f9588670059f7c533435a84f257ca72f25d7f3
- - - - -
28b3d2bb by Markus Koschany at 2020-12-05T01:57:25+01:00
Declare compliance with Debian Policy 4.5.1.

- - - - -
9e1d1edd by Markus Koschany at 2020-12-05T01:57:55+01:00
Update changelog

- - - - -
474fb0bb by Markus Koschany at 2020-12-05T01:59:13+01:00
Remove java11.patch. Fixed upstream.

- - - - -
9716faa4 by Markus Koschany at 2020-12-05T02:07:09+01:00
Refresh the patches

- - - - -


11 changed files:

- + .github/workflows/ci.yml
- debian/changelog
- debian/control
- debian/patches/invalid-release-flag.patch
- debian/patches/java11.patch
- pom.xml
- pom.xml.versionsBackup
- src/main/java/org/jboss/modules/JDKSpecific.java
- src/main/java/org/jboss/modules/Module.java
- src/main/java/org/jboss/modules/ModuleLoader.java
- src/main/java9/org/jboss/modules/JDKSpecific.java


Changes:

=====================================
.github/workflows/ci.yml
=====================================
@@ -0,0 +1,53 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: JBoss Modules CI
+
+on:
+  pull_request:
+    types: [opened, synchronize, reopened, ready_for_review]
+
+jobs:
+  build-test-matrix:
+    name: JDK${{ matrix.jdk }}-${{ matrix.impl}}-${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-latest, windows-latest]
+        jdk: [11]
+        impl: [hotspot, openj9]
+    steps:
+    - uses: actions/checkout at v2
+    # test runs use -Djava8.home=... as well, so we need both JDKs
+    - name: Set up JDK 8
+      uses: AdoptOpenJDK/install-jdk at v1
+      with:
+        version: 8
+        impl: ${{ matrix.impl }}
+        targets: 'JAVA_HOME_8'
+    - name: Set up JDK 9
+      uses: AdoptOpenJDK/install-jdk at v1
+      with:
+        version: 9
+        impl: ${{ matrix.impl }}
+        targets: 'JAVA_HOME_9'
+    - name: Set up JDK 10
+      uses: AdoptOpenJDK/install-jdk at v1
+      with:
+        version: 10
+        impl: ${{ matrix.impl }}
+        targets: 'JAVA_HOME_10'
+    - name: Set up JDK ${{ matrix.jdk }}
+      uses: AdoptOpenJDK/install-jdk at v1
+      with:
+        version: ${{ matrix.jdk }}
+        impl: ${{ matrix.impl }}
+    - name: Run Build & Test
+    # -D needs to be escaped in powershell, use --define= instead
+      run: mvn -U -B -fae clean install --define=java8.home=${{ env.JAVA_HOME_8 }} --define=java9.home=${{ env.JAVA_HOME_9 }} --define=java10.home=${{ env.JAVA_HOME_10 }}
+    - uses: actions/upload-artifact at v2
+      if: failure()
+      with:
+        name: surefire-reports-JDK${{ matrix.jdk }}-${{ matrix.impl}}-${{ matrix.os }}
+        path: '**/surefire-reports/*.txt'


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+jboss-modules (1.11.0-1) unstable; urgency=medium
+
+  * New upstream version 1.11.0.
+  * Declare compliance with Debian Policy 4.5.1.
+  * Refresh the patches.
+
+ -- Markus Koschany <apo at debian.org>  Sat, 05 Dec 2020 01:57:36 +0100
+
 jboss-modules (1.10.2-1) unstable; urgency=medium
 
   * New upstream version 1.10.2.


=====================================
debian/control
=====================================
@@ -14,7 +14,7 @@ Build-Depends:
  libmaven-javadoc-plugin-java,
  libmaven-source-plugin-java,
  maven-debian-helper (>= 1.5)
-Standards-Version: 4.5.0
+Standards-Version: 4.5.1
 Vcs-Git: https://salsa.debian.org/java-team/jboss-modules.git
 Vcs-Browser: https://salsa.debian.org/java-team/jboss-modules
 Homepage: https://github.com/jboss-modules/jboss-modules


=====================================
debian/patches/invalid-release-flag.patch
=====================================
@@ -8,7 +8,7 @@ Work around a FTBFS due to "invalid release flag".
  1 file changed, 2 deletions(-)
 
 diff --git a/pom.xml b/pom.xml
-index 11506bf..393a575 100644
+index 90fadd8..9aa3f4c 100644
 --- a/pom.xml
 +++ b/pom.xml
 @@ -149,7 +149,6 @@


=====================================
debian/patches/java11.patch
=====================================
@@ -1,5 +1,5 @@
 From: Markus Koschany <apo at debian.org>
-Date: Tue, 30 Oct 2018 22:39:28 +0100
+Date: Sat, 5 Dec 2020 02:05:44 +0100
 Subject: java11
 
 Ugly workaround for removed sun.reflect.Reflection class. Fixes FTBFS with
@@ -12,18 +12,18 @@ Forwarded: no
  1 file changed, 3 insertions(+), 4 deletions(-)
 
 diff --git a/src/main/java/org/jboss/modules/JDKSpecific.java b/src/main/java/org/jboss/modules/JDKSpecific.java
-index 666c3b7..3d89a6f 100644
+index 565e0e9..33a7596 100644
 --- a/src/main/java/org/jboss/modules/JDKSpecific.java
 +++ b/src/main/java/org/jboss/modules/JDKSpecific.java
-@@ -34,7 +34,6 @@ import java.util.List;
- import java.util.Set;
+@@ -38,7 +38,6 @@ import java.util.Set;
+ import java.util.function.Predicate;
  import java.util.jar.JarFile;
  
 -import sun.reflect.Reflection;
  
  /**
   * JDK-specific classes which are replaced for different JDK major versions.  This one is for Java 8 only.
-@@ -82,9 +81,9 @@ final class JDKSpecific {
+@@ -86,9 +85,9 @@ final class JDKSpecific {
          int offset = 0;
          try {
              //noinspection deprecation
@@ -35,7 +35,7 @@ index 666c3b7..3d89a6f 100644
  
          } catch (Throwable ignored) {}
          hasGetCallerClass = result;
-@@ -117,7 +116,7 @@ final class JDKSpecific {
+@@ -121,7 +120,7 @@ final class JDKSpecific {
          // 1 == immediate caller in jboss-modules
          // 2 == user caller
          if (hasGetCallerClass) {


=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.jboss.modules</groupId>
     <artifactId>jboss-modules</artifactId>
-    <version>1.10.2.Final</version>
+    <version>1.11.0.Final</version>
     <name>JBoss Modules</name>
 
     <parent>
@@ -295,7 +295,7 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.11</version>
+            <version>4.13.1</version>
             <scope>test</scope>
         </dependency>
     </dependencies>


=====================================
pom.xml.versionsBackup
=====================================
@@ -23,7 +23,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.jboss.modules</groupId>
     <artifactId>jboss-modules</artifactId>
-    <version>1.10.2.Final-SNAPSHOT</version>
+    <version>1.11.0.Final-SNAPSHOT</version>
     <name>JBoss Modules</name>
 
     <parent>
@@ -295,7 +295,7 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.11</version>
+            <version>4.13.1</version>
             <scope>test</scope>
         </dependency>
     </dependencies>


=====================================
src/main/java/org/jboss/modules/JDKSpecific.java
=====================================
@@ -30,8 +30,12 @@ import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Collections;
 import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.ServiceLoader;
 import java.util.Set;
+import java.util.function.Predicate;
 import java.util.jar.JarFile;
 
 import sun.reflect.Reflection;
@@ -185,6 +189,37 @@ final class JDKSpecific {
         list.add("jdk.internal.reflect.");
     }
 
+    static <T> Iterable<T> findServices(final Class<T> serviceType, final Predicate<Class<?>> filter, final ClassLoader classLoader) {
+        final Iterator<T> delegate = ServiceLoader.load(serviceType, classLoader).iterator();
+        return new Iterable<T>() {
+            public Iterator<T> iterator() {
+                return new Iterator<T>() {
+                    T next = null;
+
+                    public boolean hasNext() {
+                        T next;
+                        while (this.next == null) {
+                            if (!delegate.hasNext()) return false;
+                            next = delegate.next();
+                            if (filter.test(next.getClass())) {
+                                this.next = next;
+                                return true;
+                            }
+                        }
+                        return true;
+                    }
+
+                    public T next() {
+                        if (!hasNext()) throw new NoSuchElementException();
+                        T next = this.next;
+                        this.next = null;
+                        return next;
+                    }
+                };
+            }
+        };
+    }
+
     // === nested util stuff, non-API ===
 
     static final class Hack extends SecurityManager {


=====================================
src/main/java/org/jboss/modules/Module.java
=====================================
@@ -45,6 +45,7 @@ import java.util.NoSuchElementException;
 import java.util.ServiceLoader;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Predicate;
 
 import org.jboss.modules._private.ModulesPrivateAccess;
 import org.jboss.modules.filter.ClassFilter;
@@ -547,6 +548,27 @@ public final class Module {
         return Utils.JDK_MODULE_LOADER;
     }
 
+    /**
+     * Returns an iterable of available and filtered providers of given type.
+     *
+     * @param type service provider type
+     * @param filter to specify which providers to load
+     * @param loader to be used for providers lookup
+     * @return An iterable of available and filtered providers of given type
+     */
+    public static <T> Iterable<T> findServices(final Class<T> type, final Predicate<Class<?>> filter, final ClassLoader loader) {
+        if (type == null) {
+            throw new IllegalArgumentException("type is null");
+        }
+        if (filter == null) {
+            throw new IllegalArgumentException("filter is null");
+        }
+        if (loader == null) {
+            throw new IllegalArgumentException("loader is null");
+        }
+        return JDKSpecific.findServices(type, filter, loader);
+    }
+
     static void initBootModuleLoader(ModuleLoader loader) {
         BOOT_MODULE_LOADER.set(loader);
     }


=====================================
src/main/java/org/jboss/modules/ModuleLoader.java
=====================================
@@ -265,7 +265,11 @@ public class ModuleLoader {
         return version == null ? module.getName() : module.getName() + "@" + version;
     }
 
-    static void installMBeanServer() {
+    /**
+     * Install JBoss Modules MBeans. WARNING: This method is not intended to be
+     * called by application code.
+     */
+    public static void installMBeanServer() {
         REG_REF.installReal();
     }
 


=====================================
src/main/java9/org/jboss/modules/JDKSpecific.java
=====================================
@@ -46,9 +46,13 @@ import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.ServiceLoader;
 import java.util.Set;
-import java.util.stream.Stream;
+import java.util.stream.Collectors;
+import java.util.function.Predicate;
 import java.util.jar.JarFile;
+import java.util.stream.Stream;
 
 /**
  * JDK-specific classes which are replaced for different JDK major versions.  This one is for Java 9 only.
@@ -188,6 +192,37 @@ final class JDKSpecific {
         // none in Java 9+
     }
 
+    static <T> Iterable<T> findServices(final Class<T> serviceType, final Predicate<Class<?>> filter, final ClassLoader classLoader) {
+       final Iterator<ServiceLoader.Provider<T>> delegate = ServiceLoader.load(serviceType, classLoader).stream().iterator();
+       return new Iterable<T>() {
+            public Iterator<T> iterator() {
+                return new Iterator<T>() {
+                    T next = null;
+
+                    public boolean hasNext() {
+                        ServiceLoader.Provider<T> next;
+                        while (this.next == null) {
+                            if (!delegate.hasNext()) return false;
+                            next = delegate.next();
+                            if (filter.test(next.type())) {
+                                this.next = next.get();
+                                return true;
+                            }
+                        }
+                        return true;
+                    }
+
+                    public T next() {
+                        if (!hasNext()) throw new NoSuchElementException();
+                        T next = this.next;
+                        this.next = null;
+                        return next;
+                    }
+                };
+            }
+        };
+    }
+
     // === nested util stuff, non-API ===
 
     private static Class<?> processFrame(Stream<StackWalker.StackFrame> stream) {



View it on GitLab: https://salsa.debian.org/java-team/jboss-modules/-/compare/56b548c411ccee7465ab6ca62ec4c72f2f1a984a...9716faa4fc163c410bae374f1b9eb5727dfe8ed5

-- 
View it on GitLab: https://salsa.debian.org/java-team/jboss-modules/-/compare/56b548c411ccee7465ab6ca62ec4c72f2f1a984a...9716faa4fc163c410bae374f1b9eb5727dfe8ed5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20201205/574a64bd/attachment.html>


More information about the pkg-java-commits mailing list