[Git][java-team/access-modifier-checker][master] 11 commits: New upstream version 1.17

Emmanuel Bourg gitlab at salsa.debian.org
Mon Jan 4 16:18:15 GMT 2021



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / access-modifier-checker


Commits:
fb1e74bb by Emmanuel Bourg at 2020-12-28T11:56:34+01:00
New upstream version 1.17
- - - - -
319b4787 by Emmanuel Bourg at 2020-12-28T11:56:44+01:00
New upstream version 1.18
- - - - -
c6a15e2a by Emmanuel Bourg at 2020-12-28T11:56:49+01:00
New upstream version 1.21
- - - - -
14794a0d by Emmanuel Bourg at 2020-12-28T11:56:49+01:00
Update upstream source from tag 'upstream/1.21'

Update to upstream version '1.21'
with Debian dir 89d0203bd4d968249e01adebb48cd9f06d0b657b
- - - - -
7365f6d0 by Emmanuel Bourg at 2021-01-04T17:13:59+01:00
Depend on libasm-java (>= 9.0)

- - - - -
96a04783 by Emmanuel Bourg at 2021-01-04T17:14:40+01:00
Depend on junit4 instead of junit

- - - - -
e76a662c by Emmanuel Bourg at 2021-01-04T17:15:19+01:00
New dependency on libfindbugs-annotations-java

- - - - -
eada9a75 by Emmanuel Bourg at 2021-01-04T17:16:20+01:00
Set the source/target level to Java 8

- - - - -
b926d9aa by Emmanuel Bourg at 2021-01-04T17:16:26+01:00
Standards-Version updated to 4.5.1

- - - - -
5b60573e by Emmanuel Bourg at 2021-01-04T17:16:33+01:00
Switch to debhelper level 13

- - - - -
e90972a5 by Emmanuel Bourg at 2021-01-04T17:17:55+01:00
Upload to unstable

- - - - -


26 changed files:

- + .github/dependabot.yml
- + .github/release-drafter.yml
- + .github/workflows/release-drafter.yml
- + .mvn/extensions.xml
- + .mvn/maven.config
- + Jenkinsfile
- + LICENSE.md
- README → README.md
- access-modifier-annotation/pom.xml
- access-modifier-annotation/src/main/java/org/kohsuke/accmod/restrictions/ProtectedExternally.java
- access-modifier-checker/pom.xml
- + access-modifier-checker/src/it/own-members/invoker.properties
- + access-modifier-checker/src/it/own-members/pom.xml
- + access-modifier-checker/src/it/own-members/src/main/java/Outer.java
- + access-modifier-checker/src/it/own-members/src/main/java/SomeClass.java
- access-modifier-checker/src/main/java/org/kohsuke/accmod/impl/Checker.java
- access-modifier-checker/src/main/java/org/kohsuke/accmod/impl/EnforcerMojo.java
- access-modifier-checker/src/main/java/org/kohsuke/accmod/impl/Restrictions.java
- access-modifier-suppressions/pom.xml
- debian/changelog
- − debian/compat
- debian/control
- debian/maven.properties
- debian/maven.rules
- pom.xml
- + src/spotbugs/excludesFilter.xml


Changes:

=====================================
.github/dependabot.yml
=====================================
@@ -0,0 +1,8 @@
+# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
+
+version: 2
+updates:
+  - package-ecosystem: "maven"
+    directory: "/"
+    schedule:
+      interval: "weekly"


=====================================
.github/release-drafter.yml
=====================================
@@ -0,0 +1,2 @@
+_extends: .github
+tag-template: access-modifier-$NEXT_MINOR_VERSION
\ No newline at end of file


=====================================
.github/workflows/release-drafter.yml
=====================================
@@ -0,0 +1,16 @@
+# Automates creation of Release Drafts using Release Drafter
+# More Info: https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc
+
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  update_release_draft:
+    runs-on: ubuntu-latest
+    steps:
+      # Drafts your next Release notes as Pull Requests are merged into "master"
+      - uses: release-drafter/release-drafter at v5
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


=====================================
.mvn/extensions.xml
=====================================
@@ -0,0 +1,7 @@
+<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
+  <extension>
+    <groupId>io.jenkins.tools.incrementals</groupId>
+    <artifactId>git-changelist-maven-extension</artifactId>
+    <version>1.2</version>
+  </extension>
+</extensions>


=====================================
.mvn/maven.config
=====================================
@@ -0,0 +1,2 @@
+-Pconsume-incrementals
+-Pmight-produce-incrementals


=====================================
Jenkinsfile
=====================================
@@ -0,0 +1,8 @@
+// While this isn't a plugin, it is much simpler to reuse the pipeline code for CI
+// allowing easy windows / linux testing and producing incrementals
+// the only feature that buildPlugin has that relates to plugins is allowing you to test against multiple jenkins versions
+buildPlugin(configurations: [
+        [ platform: "linux", jdk: "8", jenkins: null ],
+        [ platform: "linux", jdk: "11", jenkins: null, javaLevel: "8" ],
+        [ platform: "windows", jdk: "11", jenkins: null, javaLevel: "8" ]
+])


=====================================
LICENSE.md
=====================================
@@ -0,0 +1,9 @@
+The MIT License
+
+Copyright (c) 2010- Kohsuke Kawaguchi, Jenkins project and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file


=====================================
README → README.md
=====================================
@@ -1,3 +1,5 @@
+# Access modifier
+
 Allows applications to define custom access modifiers programmatically,
 to be enforced at compile time in the opt-in basis. Obviously,
 there's no runtime check either --- this is strictly a voluntary annotations.


=====================================
access-modifier-annotation/pom.xml
=====================================
@@ -4,7 +4,7 @@
   <parent>
     <artifactId>access-modifier</artifactId>
     <groupId>org.kohsuke</groupId>
-    <version>1.16</version>
+    <version>1.21</version>
   </parent>
   <artifactId>access-modifier-annotation</artifactId>
 
@@ -18,14 +18,17 @@
     </dependency>
     <dependency>
       <groupId>org.ow2.asm</groupId>
-      <artifactId>asm-debug-all</artifactId>
+      <artifactId>asm</artifactId>
       <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>3.8.1</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.github.spotbugs</groupId>
+      <artifactId>spotbugs-annotations</artifactId>
+    </dependency>
   </dependencies>
 </project>


=====================================
access-modifier-annotation/src/main/java/org/kohsuke/accmod/restrictions/ProtectedExternally.java
=====================================
@@ -29,6 +29,8 @@ import java.io.InputStream;
 import java.lang.annotation.Inherited;
 import java.util.Arrays;
 import java.util.concurrent.atomic.AtomicBoolean;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.kohsuke.accmod.Restricted;
 import org.kohsuke.accmod.impl.ErrorListener;
 import org.kohsuke.accmod.impl.Location;
@@ -47,6 +49,9 @@ import org.objectweb.asm.Opcodes;
 public class ProtectedExternally extends None {
 
     @Override
+    @SuppressFBWarnings(
+            value={"RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE","RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", "NP_LOAD_OF_KNOWN_NULL_VALUE"},
+            justification="something in this class confuses spotbugs, I can't see anything redundant and the error line is the catch block")
     public void invoked(Location loc, RestrictedElement target, ErrorListener errorListener) {
         if (target.isInTheInspectedModule()) {
             return;
@@ -59,7 +64,7 @@ public class ProtectedExternally extends None {
             ClassReader cr = new ClassReader(is);
             final AtomicBoolean ok = new AtomicBoolean();
             final String supe = target.toString().replaceFirst("[.].+$", "");
-            cr.accept(new ClassVisitor(Opcodes.ASM5) {
+            cr.accept(new ClassVisitor(Opcodes.ASM9) {
                 @Override
                 public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
                     // TODO traverse supertype hierarchy recursively


=====================================
access-modifier-checker/pom.xml
=====================================
@@ -4,7 +4,7 @@
   <parent>
     <artifactId>access-modifier</artifactId>
     <groupId>org.kohsuke</groupId>
-    <version>1.16</version>
+    <version>1.21</version>
   </parent>
   <artifactId>access-modifier-checker</artifactId>
   <packaging>maven-plugin</packaging>
@@ -14,7 +14,6 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>3.8.1</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -29,23 +28,34 @@
     </dependency>
     <dependency>
       <groupId>org.ow2.asm</groupId>
-      <artifactId>asm-debug-all</artifactId>
+      <artifactId>asm</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.kohsuke.metainf-services</groupId>
+      <artifactId>metainf-services</artifactId>
+      <version>1.8</version>
+      <optional>true</optional>
+    </dependency>
+    <!-- https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api -->
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0.1</version>
+      <version>3.6.3</version>
+      <scope>provided</scope>
     </dependency>
     <dependency>
+      <!-- needed when injecting the Maven Project into a plugin  -->
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-      <version>2.0.1</version>
+      <artifactId>maven-core</artifactId>
+      <version>3.6.3</version>
+      <scope>provided</scope>
     </dependency>
+
     <dependency>
-      <groupId>org.kohsuke.metainf-services</groupId>
-      <artifactId>metainf-services</artifactId>
-      <version>1.1</version>
-      <optional>true</optional>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <version>3.6.0</version>
+      <optional>true</optional> <!-- annotations are not used at runtime because @Retention(value=CLASS), they are needed only to build the plugin -->
     </dependency>
   </dependencies>
 
@@ -63,7 +73,7 @@
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>mrm-maven-plugin</artifactId>
-            <version>1.0.1</version>
+            <version>1.2.0</version>
             <executions>
               <execution>
                 <goals>
@@ -81,7 +91,7 @@
           </plugin>
           <plugin>
             <artifactId>maven-invoker-plugin</artifactId>
-            <version>2.0.0</version>
+            <version>3.2.1</version>
             <executions>
               <execution>
                 <id>integration-test</id>
@@ -98,6 +108,7 @@
                   <filterProperties>
                     <repository.proxy.url>${repository.proxy.url}</repository.proxy.url>
                   </filterProperties>
+                  <writeJunitReport>true</writeJunitReport>
                 </configuration>
               </execution>
             </executions>


=====================================
access-modifier-checker/src/it/own-members/invoker.properties
=====================================
@@ -0,0 +1 @@
+invoker.goals=clean package


=====================================
access-modifier-checker/src/it/own-members/pom.xml
=====================================
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>test</groupId>
+    <artifactId>this-instance-impl</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.kohsuke</groupId>
+            <artifactId>access-modifier-annotation</artifactId>
+            <version>@project.version@</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.kohsuke</groupId>
+                <artifactId>access-modifier-checker</artifactId>
+                <version>@project.version@</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                    </execution>
+                </executions>
+           </plugin>
+        </plugins>
+    </build>
+</project>


=====================================
access-modifier-checker/src/it/own-members/src/main/java/Outer.java
=====================================
@@ -0,0 +1,11 @@
+import org.kohsuke.accmod.Restricted;
+import org.kohsuke.accmod.restrictions.DoNotUse;
+
+class Outer {
+  @Restricted(DoNotUse.class)
+  static class Middle {
+    static class Inner {
+      static {new Middle();}
+    }
+  }
+}
\ No newline at end of file


=====================================
access-modifier-checker/src/it/own-members/src/main/java/SomeClass.java
=====================================
@@ -0,0 +1,18 @@
+import org.kohsuke.accmod.Restricted;
+import org.kohsuke.accmod.restrictions.DoNotUse;
+
+ at Restricted(DoNotUse.class)
+public class SomeClass {
+  private int foo;
+
+  public SomeClass() {
+    foo = 12;
+  }
+
+  public int getFoo() {
+    doSomething();
+    return foo;
+  }
+
+  private void doSomething() {}
+}


=====================================
access-modifier-checker/src/main/java/org/kohsuke/accmod/impl/Checker.java
=====================================
@@ -93,7 +93,7 @@ public class Checker {
 
     private int line;
 
-    Checker(ClassLoader dependencies, ErrorListener errorListener, Properties properties,
+    public Checker(ClassLoader dependencies, ErrorListener errorListener, Properties properties,
             Log log) throws IOException {
         this.dependencies = dependencies;
         this.errorListener = errorListener;
@@ -114,8 +114,13 @@ public class Checker {
      */
     public void check(File f) throws IOException {
         if (f.isDirectory()) {
-            for (File c : f.listFiles())
+            File[] files = f.listFiles();
+            if (files == null) {
+                throw new IllegalArgumentException("Directory " + f.getName() + " is empty when it should not be");
+            }
+            for (File c : files) {
                 check(c);
+            }
             return;
         }
 
@@ -154,7 +159,7 @@ public class Checker {
             }
 
             try {
-                new ClassReader(is).accept(new ClassVisitor(Opcodes.ASM5) {
+                new ClassReader(is).accept(new ClassVisitor(Opcodes.ASM9) {
                     private String className;
 
                     @Override
@@ -169,7 +174,7 @@ public class Checker {
 
                     @Override
                     public FieldVisitor visitField(int access, final String name, String desc, String signature, Object value) {
-                        return new FieldVisitor(Opcodes.ASM5) {
+                        return new FieldVisitor(Opcodes.ASM9) {
                             @Override
                             public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
                                 return onAnnotationFor(className+'.'+name,desc);
@@ -179,7 +184,7 @@ public class Checker {
 
                     @Override
                     public MethodVisitor visitMethod(int access, final String methodName, final String methodDesc, String signature, String[] exceptions) {
-                        return new MethodVisitor(Opcodes.ASM5) {
+                        return new MethodVisitor(Opcodes.ASM9) {
                             @Override
                             public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
                                 return onAnnotationFor(className+'.'+methodName+methodDesc,desc);
@@ -298,7 +303,7 @@ public class Checker {
         }
 
         public RestrictedClassVisitor() {
-            super(Opcodes.ASM5);
+            super(Opcodes.ASM9);
         }
 
         @Override
@@ -339,7 +344,7 @@ public class Checker {
                 return null;
             }
 
-            return new RestrictedMethodVisitor(currentLocation, annotationVisitor.getSkippedTypes());
+            return new RestrictedMethodVisitor(currentLocation, className, annotationVisitor.getSkippedTypes());
         }
 
         @Override
@@ -383,11 +388,24 @@ public class Checker {
         };
     }
 
+    private static String topLevelClass(String a) {
+      int i = a.indexOf('$');
+      if (i == -1) {
+          return a;
+      }
+      return a.substring(0, i);
+    }
+
+    private static boolean sameClassFile(String currentClass, String owner) {
+        return topLevelClass(currentClass).equals(topLevelClass(owner));
+    }
+
     private class RestrictedMethodVisitor extends MethodVisitor {
 
         private final Set<Type> skippedTypesFromParent;
         private Location currentLocation;
         private RestrictedAnnotationVisitor annotationVisitor = new RestrictedAnnotationVisitor();
+        private final String currentClass;
 
         private Set<Type> getSkippedTypes() {
             Set<Type> allSkippedTypes = new HashSet<>(skippedTypesFromParent);
@@ -395,12 +413,13 @@ public class Checker {
             return allSkippedTypes;
         }
 
-        public RestrictedMethodVisitor(Location currentLocation, Set<Type> skippedTypes) {
-            super(Opcodes.ASM5);
+        public RestrictedMethodVisitor(Location currentLocation, String currentClass, Set<Type> skippedTypes) {
+            super(Opcodes.ASM9);
             log.debug(String.format("New method visitor at %s#%s",
                     currentLocation.getClassName(), currentLocation.getMethodName()));
             this.currentLocation = currentLocation;
             this.skippedTypesFromParent = skippedTypes;
+            this.currentClass = currentClass;
         }
 
         @Override
@@ -411,6 +430,10 @@ public class Checker {
         public void visitTypeInsn(int opcode, String type) {
             switch (opcode) {
             case Opcodes.NEW:
+                if (sameClassFile(currentClass, type)) {
+                    return;
+                }
+
                 for (Restrictions r : getRestrictions(type, getSkippedTypes())) {
                     r.instantiated(currentLocation, errorListener);
                 }
@@ -420,6 +443,11 @@ public class Checker {
         @Override
         public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
             log.debug(String.format("Visiting method %s#%s", owner, name));
+
+            if (sameClassFile(currentClass, owner)) {
+                return;
+            }
+
             for (Restrictions r : getRestrictions(owner + '.' + name + desc, getSkippedTypes())) {
                 r.invoked(currentLocation, errorListener);
             }
@@ -429,6 +457,10 @@ public class Checker {
         public void visitFieldInsn(int opcode, String owner, String name, String desc) {
             log.debug(String.format("Visiting field '%s %s' in type %s", desc, name, owner));
 
+            if (sameClassFile(currentClass, owner)) {
+                return;
+            }
+
             Iterable<Restrictions> rs = getRestrictions(owner + '.' + name, getSkippedTypes());
             switch (opcode) {
                 case Opcodes.GETSTATIC:
@@ -444,7 +476,6 @@ public class Checker {
                     }
                     break;
             }
-            super.visitFieldInsn(opcode, owner, name, desc);
         }
 
         @Override
@@ -460,7 +491,7 @@ public class Checker {
         private Set<Type> skippedRestrictedClasses = new HashSet<>();
 
         public RestrictedAnnotationVisitor() {
-            super(Opcodes.ASM5);
+            super(Opcodes.ASM9);
         }
 
         public Set<Type> getSkippedTypes() {
@@ -469,7 +500,7 @@ public class Checker {
 
         @Override
         public AnnotationVisitor visitArray(String name) {
-            return new AnnotationVisitor(Opcodes.ASM5) {
+            return new AnnotationVisitor(Opcodes.ASM9) {
 
                 @Override
                 public void visit(String name, Object value) {


=====================================
access-modifier-checker/src/main/java/org/kohsuke/accmod/impl/EnforcerMojo.java
=====================================
@@ -1,9 +1,14 @@
 package org.kohsuke.accmod.impl;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.maven.project.MavenProject;
 import org.kohsuke.accmod.Restricted;
 
@@ -21,39 +26,41 @@ import java.util.Properties;
  * Enforces the {@link Restricted} access modifier annotations.
  *
  * @author Kohsuke Kawaguchi
- * @goal enforce
- * @phase process-classes
- * @requiresDependencyResolution compile
- * @author Kohsuke Kawaguchi
  */
+ at Mojo(name="enforce", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution = ResolutionScope.COMPILE)
 public class EnforcerMojo extends AbstractMojo {
     /**
      * The maven project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
      */
+    @Parameter(property = "project", readonly = true)
     protected MavenProject project;
 
     /**
      * If true, skip running the checker entirely.
-     * @parameter expression="${access-modifier-checker.skip}" default-value="false"
      */
-    private boolean skip;
+    @Parameter(property = "access-modifier-checker.skip", defaultValue = "false")
+    private boolean skip = false;
 
     /**
      * If false, print warnings about violations but do not fail the build.
-     * @parameter expression="${access-modifier-checker.failOnError}" default-value="true"
      */
+    @Parameter(property = "access-modifier-checker.failOnError", defaultValue = "true")
     private boolean failOnError = true;
 
     /**
      * Optional properties to also make available to restriction checkers.
-     * @parameter
      */
+    @Parameter
     private Properties properties;
 
+    @SuppressFBWarnings(value = {
+            "UWF_UNWRITTEN_FIELD",
+            "URLCONNECTION_SSRF_FD",
+            "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD",
+            "PATH_TRAVERSAL_IN",
+            "DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED",
+            "NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"
+    })
     public void execute() throws MojoExecutionException, MojoFailureException {
         if (skip) {
             getLog().info("Skipping access modifier checks");


=====================================
access-modifier-checker/src/main/java/org/kohsuke/accmod/impl/Restrictions.java
=====================================
@@ -31,6 +31,7 @@ import org.objectweb.asm.Type;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * @author Kohsuke Kawaguchi
@@ -77,12 +78,26 @@ public class Restrictions extends ArrayList<AccessRestriction> {
             ar.written(location,target,errorListener);
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        if (!super.equals(o)) return false;
+        Restrictions that = (Restrictions) o;
+        return Objects.equals(target, that.target);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(super.hashCode(), target);
+    }
+
     abstract static class Parser extends AnnotationVisitor {
         private List<Type> restrictions = new ArrayList<Type>();
         private final RestrictedElement target;
 
         protected Parser(RestrictedElement target) {
-            super(Opcodes.ASM5);
+            super(Opcodes.ASM9);
             this.target = target;
         }
 


=====================================
access-modifier-suppressions/pom.xml
=====================================
@@ -4,7 +4,7 @@
   <parent>
     <artifactId>access-modifier</artifactId>
     <groupId>org.kohsuke</groupId>
-    <version>1.16</version>
+    <version>1.21</version>
   </parent>
   <artifactId>access-modifier-suppressions</artifactId>
 


=====================================
debian/changelog
=====================================
@@ -1,3 +1,16 @@
+access-modifier-checker (1.21-1) unstable; urgency=medium
+
+  * Team upload.
+  * New upstream release
+    - Depend on libasm-java (>= 9.0)
+    - Depend on junit4 instead of junit
+    - New dependency on libfindbugs-annotations-java
+    - Set the source/target level to Java 8
+  * Standards-Version updated to 4.5.1
+  * Switch to debhelper level 13
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Mon, 04 Jan 2021 17:17:43 +0100
+
 access-modifier-checker (1.16-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-11


=====================================
debian/control
=====================================
@@ -4,17 +4,18 @@ Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
 Uploaders: James Page <jamespage at debian.org>
 Build-Depends:
- debhelper (>= 11),
+ debhelper-compat (= 13),
  default-jdk,
- junit (>= 3.8.1),
+ junit4,
  libannotation-indexer-java (>= 1.3),
- libasm-java (>= 5.0),
+ libasm-java (>= 9.0),
+ libfindbugs-annotations-java,
  libmaven-plugin-tools-java (>= 2.8),
  libmaven-scm-java,
  libmaven3-core-java,
  libmetainf-services-java,
  maven-debian-helper (>= 2.0)
-Standards-Version: 4.3.0
+Standards-Version: 4.5.1
 Vcs-Git: https://salsa.debian.org/java-team/access-modifier-checker.git
 Vcs-Browser: https://salsa.debian.org/java-team/access-modifier-checker
 Homepage: https://github.com/kohsuke/access-modifier


=====================================
debian/maven.properties
=====================================
@@ -3,3 +3,4 @@
 # maven.test.skip=true
 
 project.build.sourceEncoding=UTF-8
+maven.compiler.release=8


=====================================
debian/maven.rules
=====================================
@@ -16,7 +16,8 @@
 # and version starting with 3., replacing the version with 3.x
 #   junit junit jar s/3\\..*/3.x/
 
-junit junit jar s/3\..*/3.x/ * *
+junit junit jar s/.*/4.x/ * *
 s/org.jvnet.hudson/org.jenkins-ci/ annotation-indexer * s/.*/debian/ * *
 org.apache.maven s/maven-project/maven-core/ * s/.*/3.x/ * *
 org.apache.maven maven-* * s/.*/3.x/ * *
+s/com.github.spotbugs/com.google.code.findbugs/ s/spotbugs-annotations/annotations/ * s/.*/debian/ * *


=====================================
pom.xml
=====================================
@@ -2,37 +2,40 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <groupId>org.kohsuke</groupId>
-    <artifactId>pom</artifactId>
-    <version>19</version>
+    <groupId>org.jenkins-ci</groupId>
+    <artifactId>jenkins</artifactId>
+    <version>1.61</version>
     <relativePath />
   </parent>
 
+  <groupId>org.kohsuke</groupId>
   <artifactId>access-modifier</artifactId>
-  <version>1.16</version>
+  <version>1.21</version>
 
   <name>Custom access modifier for Java</name>
   <packaging>pom</packaging>
   <description>Extensible application-specific access modifiers for Java</description>
 
+  <properties>
+    <revision>1.19</revision>
+    <changelist>-SNAPSHOT</changelist>
+    <gitHubRepo>jenkinsci/lib-access-modifier</gitHubRepo>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <java.level>8</java.level>
+    <spotbugs.excludeFilterFile>${project.basedir}/../src/spotbugs/excludesFilter.xml</spotbugs.excludeFilterFile>
+  </properties>
+
   <modules>
     <module>access-modifier-annotation</module>
     <module>access-modifier-checker</module>
     <module>access-modifier-suppressions</module>
   </modules>
 
-  <distributionManagement>
-    <site>
-      <id>github-pages</id>
-      <url>gitsite:git at github.com/kohsuke/access-modifier.git</url>
-    </site>
-  </distributionManagement>
-
   <scm>
-    <connection>scm:git:git at github.com/kohsuke/${project.artifactId}.git</connection>
-    <developerConnection>scm:git:ssh://git@github.com/kohsuke/${project.artifactId}.git</developerConnection>
-    <url>http://${project.artifactId}.kohsuke.org/</url>
-    <tag>access-modifier-1.16</tag>
+    <connection>scm:git:git at github.com/${gitHubRepo}.git</connection>
+    <developerConnection>scm:git:ssh://git@github.com/${gitHubRepo}.git</developerConnection>
+    <url>https://github.com/${gitHubRepo}</url>
+    <tag>access-modifier-1.21</tag>
   </scm>
 
   <developers>
@@ -50,47 +53,43 @@
       </plugin>
     </plugins>
   </reporting>
-  
+
   <licenses>
     <license>
       <name>MIT License</name>
       <distribution>repository</distribution>
-      <url>http://www.opensource.org/licenses/mit-license.php</url>
+      <url>https://opensource.org/licenses/MIT</url>
     </license>
   </licenses>
 
   <build>
     <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.3.2</version>
-        <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
-        </configuration>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
         <configuration>
-          <additionalparam>-Xdoclint:none</additionalparam>
+          <doclint>none</doclint>
+          <source>${java.level}</source>
+          <locale>en_US</locale>
         </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-site-plugin</artifactId>
-        <configuration>
-          <reportPlugins>
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-javadoc-plugin</artifactId>
-              <configuration>
-                <additionalparam>-Xdoclint:none</additionalparam>
-              </configuration>
-            </plugin>
-          </reportPlugins>
-        </configuration>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <version>3.6.0</version>
+        <executions>
+          <execution>
+            <id>default-descriptor</id>
+            <phase>process-classes</phase>
+          </execution>
+          <!-- if you want to generate help goal -->
+          <execution>
+            <id>help-goal</id>
+            <goals>
+              <goal>helpmojo</goal>
+            </goals>
+          </execution>
+        </executions>
       </plugin>
     </plugins>
   </build>
@@ -99,8 +98,8 @@
     <dependencies>
       <dependency>
         <groupId>org.ow2.asm</groupId>
-        <artifactId>asm-debug-all</artifactId>
-        <version>5.0.3</version>
+        <artifactId>asm</artifactId>
+        <version>9.0</version>
       </dependency>
     </dependencies>
   </dependencyManagement>


=====================================
src/spotbugs/excludesFilter.xml
=====================================
@@ -0,0 +1,7 @@
+<FindBugsFilter>
+    <Match>
+        <!-- generated class -->
+        <Class name="org.kohsuke.accmod.impl.HelpMojo"/>
+        <Bug pattern="XXE_DOCUMENT"/>
+    </Match>
+</FindBugsFilter>
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/java-team/access-modifier-checker/-/compare/bc9d685d7ab77c19895508ee9f09e4502ed27297...e90972a573a64330c45f34fc0c7db17e8de79ab0

-- 
View it on GitLab: https://salsa.debian.org/java-team/access-modifier-checker/-/compare/bc9d685d7ab77c19895508ee9f09e4502ed27297...e90972a573a64330c45f34fc0c7db17e8de79ab0
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/20210104/050f96b2/attachment.html>


More information about the pkg-java-commits mailing list