diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java index 0300759..b36bd54 100644 --- a/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java +++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java @@ -61,9 +61,7 @@ public class DefaultProjectDependencyAnalyzer implements ProjectDependencyAnalyz @Inject private DependencyAnalyzer dependencyAnalyzer; - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public ProjectDependencyAnalysis analyze(MavenProject project, Collection excludedClasses) throws ProjectDependencyAnalyzerException { diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java index e8fecee..3ce7c16 100644 --- a/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java +++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java @@ -18,7 +18,14 @@ */ package org.apache.maven.shared.dependency.analyzer; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import org.apache.maven.artifact.Artifact; diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultAnnotationVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultAnnotationVisitor.java index 1c7f4bf..562637d 100644 --- a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultAnnotationVisitor.java +++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultAnnotationVisitor.java @@ -44,9 +44,7 @@ public DefaultAnnotationVisitor(ResultCollector resultCollector, String usedByCl this.usedByClass = usedByClass; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visit(final String name, final Object value) { if (value instanceof Type) { @@ -54,17 +52,13 @@ public void visit(final String name, final Object value) { } } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitEnum(final String name, final String desc, final String value) { resultCollector.addDesc(usedByClass, desc); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public AnnotationVisitor visitAnnotation(final String name, final String desc) { resultCollector.addDesc(usedByClass, desc); @@ -72,9 +66,7 @@ public AnnotationVisitor visitAnnotation(final String name, final String desc) { return this; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public AnnotationVisitor visitArray(final String name) { return this; diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultClassVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultClassVisitor.java index 2d37c18..84f63d8 100644 --- a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultClassVisitor.java +++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultClassVisitor.java @@ -18,7 +18,12 @@ */ package org.apache.maven.shared.dependency.analyzer.asm; -import org.objectweb.asm.*; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; import org.objectweb.asm.signature.SignatureReader; import org.objectweb.asm.signature.SignatureVisitor; @@ -44,11 +49,11 @@ public class DefaultClassVisitor extends ClassVisitor { /** *

Constructor for DefaultClassVisitor.

* - * @param signatureVisitor a {@link org.objectweb.asm.signature.SignatureVisitor} object. + * @param signatureVisitor a {@link org.objectweb.asm.signature.SignatureVisitor} object. * @param annotationVisitor a {@link org.objectweb.asm.AnnotationVisitor} object. - * @param fieldVisitor a {@link org.objectweb.asm.FieldVisitor} object. - * @param methodVisitor a {@link org.objectweb.asm.MethodVisitor} object. - * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. + * @param fieldVisitor a {@link org.objectweb.asm.FieldVisitor} object. + * @param methodVisitor a {@link org.objectweb.asm.MethodVisitor} object. + * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. */ public DefaultClassVisitor( SignatureVisitor signatureVisitor, @@ -92,9 +97,7 @@ public void visit( } } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { resultCollector.addDesc(usedByClass, desc); @@ -102,9 +105,7 @@ public AnnotationVisitor visitAnnotation(final String desc, final boolean visibl return annotationVisitor; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public FieldVisitor visitField( final int access, final String name, final String desc, final String signature, final Object value) { @@ -124,10 +125,10 @@ public FieldVisitor visitField( /** *

visitMethod.

* - * @param access a int. - * @param name a {@link java.lang.String} object. - * @param desc a {@link java.lang.String} object. - * @param signature a {@link java.lang.String} object. + * @param access a int. + * @param name a {@link java.lang.String} object. + * @param desc a {@link java.lang.String} object. + * @param signature a {@link java.lang.String} object. * @param exceptions an array of {@link java.lang.String} objects. * @return a {@link org.objectweb.asm.MethodVisitor} object. */ @@ -145,17 +146,13 @@ public MethodVisitor visitMethod( return methodVisitor; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitNestHost(final String nestHost) { resultCollector.addName(usedByClass, nestHost); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitNestMember(final String nestMember) { resultCollector.addName(usedByClass, nestMember); diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultFieldVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultFieldVisitor.java index 074e35e..2a791b9 100644 --- a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultFieldVisitor.java +++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultFieldVisitor.java @@ -39,7 +39,7 @@ public class DefaultFieldVisitor extends FieldVisitor { *

Constructor for DefaultFieldVisitor.

* * @param annotationVisitor a {@link org.objectweb.asm.AnnotationVisitor} object. - * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. + * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. */ public DefaultFieldVisitor( AnnotationVisitor annotationVisitor, ResultCollector resultCollector, String usedByClass) { @@ -49,9 +49,7 @@ public DefaultFieldVisitor( this.usedByClass = usedByClass; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { resultCollector.addDesc(usedByClass, desc); diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultMethodVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultMethodVisitor.java index c1b4ce7..a61bb04 100644 --- a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultMethodVisitor.java +++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultMethodVisitor.java @@ -49,8 +49,8 @@ public class DefaultMethodVisitor extends MethodVisitor { *

Constructor for DefaultMethodVisitor.

* * @param annotationVisitor a {@link org.objectweb.asm.AnnotationVisitor} object. - * @param signatureVisitor a {@link org.objectweb.asm.signature.SignatureVisitor} object. - * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. + * @param signatureVisitor a {@link org.objectweb.asm.signature.SignatureVisitor} object. + * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. */ public DefaultMethodVisitor( AnnotationVisitor annotationVisitor, @@ -64,9 +64,7 @@ public DefaultMethodVisitor( this.usedByClass = usedByClass; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { resultCollector.addDesc(usedByClass, desc); @@ -74,9 +72,7 @@ public AnnotationVisitor visitAnnotation(final String desc, final boolean visibl return annotationVisitor; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { resultCollector.addDesc(usedByClass, desc); @@ -84,9 +80,7 @@ public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, Str return annotationVisitor; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public AnnotationVisitor visitParameterAnnotation(final int parameter, final String desc, final boolean visible) { resultCollector.addDesc(usedByClass, desc); @@ -94,9 +88,7 @@ public AnnotationVisitor visitParameterAnnotation(final int parameter, final Str return annotationVisitor; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public AnnotationVisitor visitLocalVariableAnnotation( int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) { @@ -105,9 +97,7 @@ public AnnotationVisitor visitLocalVariableAnnotation( return annotationVisitor; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitTypeInsn(final int opcode, final String desc) { if (desc.charAt(0) == '[') { @@ -117,9 +107,7 @@ public void visitTypeInsn(final int opcode, final String desc) { } } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) { resultCollector.addName(usedByClass, owner); @@ -131,17 +119,13 @@ public void visitFieldInsn(final int opcode, final String owner, final String na */ } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { resultCollector.addName(usedByClass, owner); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitLdcInsn(final Object cst) { if (cst instanceof Type) { @@ -149,17 +133,13 @@ public void visitLdcInsn(final Object cst) { } } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitMultiANewArrayInsn(final String desc, final int dims) { resultCollector.addDesc(usedByClass, desc); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitTryCatchBlock(final Label start, final Label end, final Label handler, final String type) { resultCollector.addName(usedByClass, type); diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultSignatureVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultSignatureVisitor.java index 89bd1a4..60e7dc6 100644 --- a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultSignatureVisitor.java +++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultSignatureVisitor.java @@ -42,17 +42,13 @@ public DefaultSignatureVisitor(ResultCollector resultCollector, String usedByCla this.usedByClass = usedByClass; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitClassType(final String name) { resultCollector.addName(usedByClass, name); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitInnerClassType(final String name) { resultCollector.addName(usedByClass, name); diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyClassFileVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyClassFileVisitor.java index 7516381..3d16943 100644 --- a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyClassFileVisitor.java +++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyClassFileVisitor.java @@ -27,7 +27,11 @@ import org.apache.maven.shared.dependency.analyzer.ClassFileVisitor; import org.apache.maven.shared.dependency.analyzer.ClassesPatterns; import org.apache.maven.shared.dependency.analyzer.DependencyUsage; -import org.objectweb.asm.*; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.signature.SignatureVisitor; /** @@ -59,9 +63,7 @@ public DependencyClassFileVisitor() { this(new ClassesPatterns()); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ @Override public void visitClass(String className, InputStream in) { try { diff --git a/src/test/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyVisitorTest.java b/src/test/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyVisitorTest.java index 0ed87b7..7d814e7 100644 --- a/src/test/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyVisitorTest.java +++ b/src/test/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyVisitorTest.java @@ -20,7 +20,13 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.objectweb.asm.*; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Attribute; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; import org.objectweb.asm.signature.SignatureVisitor; import static org.assertj.core.api.Assertions.assertThat;