Skip to content

Commit 2640c07

Browse files
committed
[MPIR-449] Don't count and display debug information if dependency does not contain class files
1 parent d8f8086 commit 2640c07

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java

+21-17
Original file line numberDiff line numberDiff line change
@@ -548,34 +548,38 @@ private void renderSectionDependencyFileDetails() {
548548
try {
549549
JarData jarDetails = dependencies.getJarDependencyDetails(artifact);
550550

551-
String debugInformationCellValue = debugInformationCellNo;
552-
if (jarDetails.isDebugPresent()) {
553-
debugInformationCellValue = debugInformationCellYes;
554-
totalDebugInformation.incrementTotal(artifact.getScope());
555-
}
556-
557551
totalentries.addTotal(jarDetails.getNumEntries(), artifact.getScope());
558552
totalclasses.addTotal(jarDetails.getNumClasses(), artifact.getScope());
559553
totalpackages.addTotal(jarDetails.getNumPackages(), artifact.getScope());
560554

561-
try {
562-
if (jarDetails.getJdkRevision() != null) {
563-
double jdkRevision = Double.parseDouble(jarDetails.getJdkRevision());
555+
String jdkRevisionCellValue = jarDetails.getJdkRevision();
556+
String debugInformationCellValue = null;
557+
String sealedCellValue = null;
558+
559+
if (jdkRevisionCellValue != null) {
560+
try {
561+
double jdkRevision = Double.parseDouble(jdkRevisionCellValue);
564562
boolean isTestScope = Artifact.SCOPE_TEST.equalsIgnoreCase(artifact.getScope());
565563
if (isTestScope) {
566564
highestTestJavaVersion = Math.max(highestTestJavaVersion, jdkRevision);
567565
} else {
568566
highestNonTestJavaVersion = Math.max(highestNonTestJavaVersion, jdkRevision);
569567
}
568+
} catch (NumberFormatException e) {
569+
// ignore
570570
}
571-
} catch (NumberFormatException e) {
572-
// ignore
573-
}
574571

575-
String sealedCellValue = sealedCellNo;
576-
if (jarDetails.isSealed()) {
577-
sealedCellValue = sealedCellYes;
578-
totalsealed.incrementTotal(artifact.getScope());
572+
debugInformationCellValue = debugInformationCellNo;
573+
if (jarDetails.isDebugPresent()) {
574+
debugInformationCellValue = debugInformationCellYes;
575+
totalDebugInformation.incrementTotal(artifact.getScope());
576+
}
577+
578+
sealedCellValue = sealedCellNo;
579+
if (jarDetails.isSealed()) {
580+
sealedCellValue = sealedCellYes;
581+
totalsealed.incrementTotal(artifact.getScope());
582+
}
579583
}
580584

581585
String name = artifactFile.getName();
@@ -593,7 +597,7 @@ private void renderSectionDependencyFileDetails() {
593597
String.valueOf(jarDetails.getNumEntries()),
594598
String.valueOf(jarDetails.getNumClasses()),
595599
String.valueOf(jarDetails.getNumPackages()),
596-
jarDetails.getJdkRevision(),
600+
jdkRevisionCellValue,
597601
debugInformationCellValue,
598602
sealedCellValue
599603
});

0 commit comments

Comments
 (0)