Skip to content

Commit

Permalink
Change: Reports: Show artifact name instead of JAR file name in first…
Browse files Browse the repository at this point in the history
… column. Try to extract artifact name and version from JAR file name if Maven coordinates are unknown.
  • Loading branch information
smarkwal committed Sep 26, 2024
1 parent 94e0119 commit ea82269
Show file tree
Hide file tree
Showing 74 changed files with 13,921 additions and 13,853 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void analyze_jdkInternalClass(@TempDir Path tempDir) throws IOException {

String[] values = rows.get(0);
assertEquals(2, values.length);
assertEquals("a.jar", values[0]);
assertEquals("a", values[0]);

if (javaVersion == 11) {
assertEquals(StringUtils.joinLines("a.A", "\u2022 Class is not exported by module java.base: public class jdk.internal.util.ArraysSupport", "\u2022 Class is not exported by module java.base: public final class sun.text.IntHashtable"), values[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void test_analyze(@TempDir Path tempDir) throws IOException {

String[] values = rows.get(0);
assertEquals(2, values.length);
assertEquals("a.jar", values[0]);
assertEquals("a", values[0]);

String expectedMessage = StringUtils.joinLines(
"a.Runtime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void analyze_incompatible(@TempDir Path tempDir) throws IOException {

String[] values = rows.get(0);
assertEquals(2, values.length);
assertEquals("a.jar", values[0]);
assertEquals("a", values[0]);

String value = values[1];
String expectedValue = TestUtils.getResourceAsString("/org/jarhc/it/ClassHierarchyAnalyzerTest/result.txt", "UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void test_incompatible(@TempDir Path tempDir) throws IOException {

String[] values = rows.get(0);
assertEquals(2, values.length);
assertEquals("a.jar", values[0]);
assertEquals("a", values[0]);

String value = values[1];
String expectedValue = TestUtils.getResourceAsString("/org/jarhc/it/FieldRefAnalyzerTest/result.txt", "UTF-8");
Expand Down Expand Up @@ -152,7 +152,7 @@ void test_reportOwnerClassNotFound_false(@TempDir Path tempDir) throws IOExcepti

String[] values = rows.get(0);
assertEquals(2, values.length);
assertEquals("a.jar", values[0]);
assertEquals("a", values[0]);

String expectedMessage = StringUtils.joinLines(
"a.A",
Expand Down Expand Up @@ -187,7 +187,7 @@ void test_reportOwnerClassNotFound_true(@TempDir Path tempDir) throws IOExceptio

String[] values = rows.get(0);
assertEquals(2, values.length);
assertEquals("a.jar", values[0]);
assertEquals("a", values[0]);

String expectedMessage = StringUtils.joinLines(
"a.A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void test_analyze(@TempDir Path tempDir) throws IOException {

String[] values = rows.get(0);
assertEquals(2, values.length);
assertEquals("a.jar", values[0]);
assertEquals("a", values[0]);

String result = values[1];
String expectedResult = TestUtils.getResourceAsString("/org/jarhc/it/UnstableAPIsAnalyzerTest/result.txt", "UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ List of JAR files found in classpath.

Artifact | Version | Source | Size | Classes | Resources | Checksum (SHA-1) | Coordinates
----------+-----------+--------+-------+---------+-----------+------------------------------------------+------------
a.jar | [unknown] | a.jar | 678 B | 1 | 0 | b2de6f7c6eff51a28729be9c4f6555354f16a1ca | [unknown]
a | [unknown] | a.jar | 678 B | 1 | 0 | b2de6f7c6eff51a28729be9c4f6555354f16a1ca | [unknown]
Classpath | - | - | 678 B | 1 | 0 | - | -

Modules
Expand All @@ -24,15 +24,15 @@ List of Java Modules found in classpath.

Artifact | Module name | Definition | Automatic | Requires | Exports
---------+-------------+----------------+-----------+----------+---------------
a.jar | a | Auto-generated | Yes | - | [all packages]
a | a | Auto-generated | Yes | - | [all packages]

Class Versions
--------------
Java class file format information.

Artifact | Multi-release | Class files by Java version
----------+---------------+----------------------------
a.jar | No | Java 8 (1)
a | No | Java 8 (1)
Classpath | - | Java 8 (1)

JAR Dependencies
Expand All @@ -41,23 +41,23 @@ Dependencies between JAR files.

Artifact | Uses | Used by
---------+--------+--------
a.jar | [none] | [none]
a | [none] | [none]

Dependencies
------------
Dependencies as declared in POM file.

Artifact | Maven coordinates | Direct dependencies | Status
---------+-------------------+---------------------+-------
a.jar | [unknown] | [unknown] |
a | [unknown] | [unknown] |

Packages
--------
List of packages per JAR file.

Artifact | Count | Packages | Issues
---------+-------+----------+-------
a.jar | 1 | a |
a | 1 | a |

Duplicate Classes
-----------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,63 +13,63 @@ JAR Files
---------
List of JAR files found in classpath.

Artifact | Version | Source | Size | Classes | Resources | Checksum (SHA-1) | Coordinates
--------------------+---------+-----------------------------+---------+---------+-----------+------------------------------------------+----------------------------
asm-commons-7.0.jar | 7.0 | org.ow2.asm:asm-commons:7.0 | 78.0 KB | 32 | 0 | 478006d07b7c561ae3a92ddc1829bca81ae0cdd1 | org.ow2.asm:asm-commons:7.0
asm-tree-7.0.jar | 7.0 | org.ow2.asm:asm-tree:7.0 | 49.2 KB | 37 | 0 | 29bc62dcb85573af6e62e5b2d735ef65966c4180 | org.ow2.asm:asm-tree:7.0
Classpath | - | - | 127 KB | 69 | 0 | - | -
Artifact | Version | Source | Size | Classes | Resources | Checksum (SHA-1) | Coordinates
------------+---------+-----------------------------+---------+---------+-----------+------------------------------------------+----------------------------
asm-commons | 7.0 | org.ow2.asm:asm-commons:7.0 | 78.0 KB | 32 | 0 | 478006d07b7c561ae3a92ddc1829bca81ae0cdd1 | org.ow2.asm:asm-commons:7.0
asm-tree | 7.0 | org.ow2.asm:asm-tree:7.0 | 49.2 KB | 37 | 0 | 29bc62dcb85573af6e62e5b2d735ef65966c4180 | org.ow2.asm:asm-tree:7.0
Classpath | - | - | 127 KB | 69 | 0 | - | -

Modules
-------
List of Java Modules found in classpath.

Artifact | Module name | Definition | Automatic | Requires | Exports
--------------------+---------------------------+-------------+-----------+---------------------------------+--------------------------
asm-commons-7.0.jar | org.objectweb.asm.commons | Module-Info | No | org.objectweb.asm | org.objectweb.asm.commons
| | | | org.objectweb.asm.tree |
| | | | org.objectweb.asm.tree.analysis |
| | | | java.base |
asm-tree-7.0.jar | org.objectweb.asm.tree | Module-Info | No | org.objectweb.asm | org.objectweb.asm.tree
| | | | java.base |
Artifact | Module name | Definition | Automatic | Requires | Exports
------------+---------------------------+-------------+-----------+---------------------------------+--------------------------
asm-commons | org.objectweb.asm.commons | Module-Info | No | org.objectweb.asm | org.objectweb.asm.commons
| | | | org.objectweb.asm.tree |
| | | | org.objectweb.asm.tree.analysis |
| | | | java.base |
asm-tree | org.objectweb.asm.tree | Module-Info | No | org.objectweb.asm | org.objectweb.asm.tree
| | | | java.base |

Class Versions
--------------
Java class file format information.

Artifact | Multi-release | Class files by Java version
--------------------+---------------+----------------------------
asm-commons-7.0.jar | No | Java 5 (32)
asm-tree-7.0.jar | No | Java 5 (37)
Classpath | - | Java 5 (69)
Artifact | Multi-release | Class files by Java version
------------+---------------+----------------------------
asm-commons | No | Java 5 (32)
asm-tree | No | Java 5 (37)
Classpath | - | Java 5 (69)

JAR Dependencies
----------------
Dependencies between JAR files.

Artifact | Uses | Used by
--------------------+------------------+--------------------
asm-commons-7.0.jar | asm-tree-7.0.jar | [none]
asm-tree-7.0.jar | [none] | asm-commons-7.0.jar
Artifact | Uses | Used by
------------+----------+------------
asm-commons | asm-tree | [none]
asm-tree | [none] | asm-commons

Dependencies
------------
Dependencies as declared in POM file.

Artifact | Maven coordinates | Direct dependencies | Status
--------------------+-----------------------------+------------------------------+--------------
asm-commons-7.0.jar | org.ow2.asm:asm-commons:7.0 | org.ow2.asm:asm:7.0 | OK [Provided]
| | org.ow2.asm:asm-tree:7.0 | OK
| | org.ow2.asm:asm-analysis:7.0 | Unsatisfied
asm-tree-7.0.jar | org.ow2.asm:asm-tree:7.0 | org.ow2.asm:asm:7.0 | OK [Provided]
Artifact | Maven coordinates | Direct dependencies | Status
------------+-----------------------------+------------------------------+--------------
asm-commons | org.ow2.asm:asm-commons:7.0 | org.ow2.asm:asm:7.0 | OK [Provided]
| | org.ow2.asm:asm-tree:7.0 | OK
| | org.ow2.asm:asm-analysis:7.0 | Unsatisfied
asm-tree | org.ow2.asm:asm-tree:7.0 | org.ow2.asm:asm:7.0 | OK [Provided]

Packages
--------
List of packages per JAR file.

Artifact | Count | Packages | Issues
--------------------+-------+---------------------------+-------
asm-commons-7.0.jar | 1 | org.objectweb.asm.commons |
asm-tree-7.0.jar | 1 | org.objectweb.asm.tree |
Artifact | Count | Packages | Issues
------------+-------+---------------------------+-------
asm-commons | 1 | org.objectweb.asm.commons |
asm-tree | 1 | org.objectweb.asm.tree |

Java Runtime
------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ Blacklist
---------
Use of dangerous, unsafe, unstable, or deprecated classes and methods.

Artifact | Issues
--------------------+-----------------------------------------------------------------------------------------------------------------------------------
asm-commons-7.0.jar | org.objectweb.asm.commons.AdviceAdapter
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.AnalyzerAdapter
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.CodeSizeEvaluator
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.InstructionAdapter
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.MethodRemapper
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.RemappingMethodAdapter
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
asm-tree-7.0.jar | org.objectweb.asm.tree.MethodNode
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
Artifact | Issues
------------+-----------------------------------------------------------------------------------------------------------------------------------
asm-commons | org.objectweb.asm.commons.AdviceAdapter
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.AnalyzerAdapter
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.CodeSizeEvaluator
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.InstructionAdapter
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.MethodRemapper
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
|
| org.objectweb.asm.commons.RemappingMethodAdapter
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)
asm-tree | org.objectweb.asm.tree.MethodNode
| • @Deprecated: public void org.objectweb.asm.MethodVisitor.visitMethodInsn(int,java.lang.String,java.lang.String,java.lang.String)

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Class Versions
--------------
Java class file format information.

Artifact | Multi-release | Class files by Java version
---------------------+---------------+----------------------------
asm-7.0.jar | No | Java 5 (35)
asm-analysis-7.0.jar | No | Java 5 (14)
asm-commons-7.0.jar | No | Java 5 (32)
asm-tree-7.0.jar | No | Java 5 (37)
Classpath | - | Java 5 (118)
Artifact | Multi-release | Class files by Java version
-------------+---------------+----------------------------
asm | No | Java 5 (35)
asm-analysis | No | Java 5 (14)
asm-commons | No | Java 5 (32)
asm-tree | No | Java 5 (37)
Classpath | - | Java 5 (118)

Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Dependencies
------------
Dependencies as declared in POM file.

Artifact | Maven coordinates | Direct dependencies | Status
---------------------+------------------------------+------------------------------+-------
asm-7.0.jar | org.ow2.asm:asm:7.0 | [none] |
asm-analysis-7.0.jar | org.ow2.asm:asm-analysis:7.0 | org.ow2.asm:asm-tree:7.0 | OK
asm-commons-7.0.jar | org.ow2.asm:asm-commons:7.0 | org.ow2.asm:asm:7.0 | OK
| | org.ow2.asm:asm-tree:7.0 | OK
| | org.ow2.asm:asm-analysis:7.0 | OK
asm-tree-7.0.jar | org.ow2.asm:asm-tree:7.0 | org.ow2.asm:asm:7.0 | OK
Artifact | Maven coordinates | Direct dependencies | Status
-------------+------------------------------+------------------------------+-------
asm | org.ow2.asm:asm:7.0 | [none] |
asm-analysis | org.ow2.asm:asm-analysis:7.0 | org.ow2.asm:asm-tree:7.0 | OK
asm-commons | org.ow2.asm:asm-commons:7.0 | org.ow2.asm:asm:7.0 | OK
| | org.ow2.asm:asm-tree:7.0 | OK
| | org.ow2.asm:asm-analysis:7.0 | OK
asm-tree | org.ow2.asm:asm-tree:7.0 | org.ow2.asm:asm:7.0 | OK

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ JAR Dependencies
----------------
Dependencies between JAR files.

Artifact | Uses | Used by
---------------------+------------------+---------------------
asm-7.0.jar | [none] | asm-analysis-7.0.jar
| | asm-commons-7.0.jar
| | asm-tree-7.0.jar
asm-analysis-7.0.jar | asm-7.0.jar | [none]
| asm-tree-7.0.jar |
asm-commons-7.0.jar | asm-7.0.jar | [none]
| asm-tree-7.0.jar |
asm-tree-7.0.jar | asm-7.0.jar | asm-analysis-7.0.jar
| | asm-commons-7.0.jar
Artifact | Uses | Used by
-------------+----------+-------------
asm | [none] | asm-analysis
| | asm-commons
| | asm-tree
asm-analysis | asm | [none]
| asm-tree |
asm-commons | asm | [none]
| asm-tree |
asm-tree | asm | asm-analysis
| | asm-commons

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ JAR Files
---------
List of JAR files found in classpath.

Artifact | Version | Source | Size | Classes | Resources | Checksum (SHA-1) | Coordinates
---------------------+-----------+----------------------+---------+---------+-----------+------------------------------------------+-----------------------------
asm-7.0.jar | [unknown] | asm-7.0.jar | 111 KB | 35 | 0 | d74d4ba0dee443f68fb2dcb7fcdb945a2cd89912 | org.ow2.asm:asm:7.0
asm-analysis-7.0.jar | [unknown] | asm-analysis-7.0.jar | 32.5 KB | 14 | 0 | 4b310d20d6f1c6b7197a75f1b5d69f169bc8ac1f | org.ow2.asm:asm-analysis:7.0
asm-commons-7.0.jar | [unknown] | asm-commons-7.0.jar | 78.0 KB | 32 | 0 | 478006d07b7c561ae3a92ddc1829bca81ae0cdd1 | org.ow2.asm:asm-commons:7.0
asm-tree-7.0.jar | [unknown] | asm-tree-7.0.jar | 49.2 KB | 37 | 0 | 29bc62dcb85573af6e62e5b2d735ef65966c4180 | org.ow2.asm:asm-tree:7.0
Classpath | - | - | 271 KB | 118 | 0 | - | -
Artifact | Version | Source | Size | Classes | Resources | Checksum (SHA-1) | Coordinates
-------------+---------+----------------------+---------+---------+-----------+------------------------------------------+-----------------------------
asm | 7.0 | asm-7.0.jar | 111 KB | 35 | 0 | d74d4ba0dee443f68fb2dcb7fcdb945a2cd89912 | org.ow2.asm:asm:7.0
asm-analysis | 7.0 | asm-analysis-7.0.jar | 32.5 KB | 14 | 0 | 4b310d20d6f1c6b7197a75f1b5d69f169bc8ac1f | org.ow2.asm:asm-analysis:7.0
asm-commons | 7.0 | asm-commons-7.0.jar | 78.0 KB | 32 | 0 | 478006d07b7c561ae3a92ddc1829bca81ae0cdd1 | org.ow2.asm:asm-commons:7.0
asm-tree | 7.0 | asm-tree-7.0.jar | 49.2 KB | 37 | 0 | 29bc62dcb85573af6e62e5b2d735ef65966c4180 | org.ow2.asm:asm-tree:7.0
Classpath | - | - | 271 KB | 118 | 0 | - | -

Loading

0 comments on commit ea82269

Please sign in to comment.