Skip to content

Commit

Permalink
[MPIR-449] Don't count and display debug information if dependency do…
Browse files Browse the repository at this point in the history
…es not contain class files
  • Loading branch information
michael-o committed May 31, 2023
1 parent d8f8086 commit 2640c07
Showing 1 changed file with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,34 +548,38 @@ private void renderSectionDependencyFileDetails() {
try {
JarData jarDetails = dependencies.getJarDependencyDetails(artifact);

String debugInformationCellValue = debugInformationCellNo;
if (jarDetails.isDebugPresent()) {
debugInformationCellValue = debugInformationCellYes;
totalDebugInformation.incrementTotal(artifact.getScope());
}

totalentries.addTotal(jarDetails.getNumEntries(), artifact.getScope());
totalclasses.addTotal(jarDetails.getNumClasses(), artifact.getScope());
totalpackages.addTotal(jarDetails.getNumPackages(), artifact.getScope());

try {
if (jarDetails.getJdkRevision() != null) {
double jdkRevision = Double.parseDouble(jarDetails.getJdkRevision());
String jdkRevisionCellValue = jarDetails.getJdkRevision();
String debugInformationCellValue = null;
String sealedCellValue = null;

if (jdkRevisionCellValue != null) {
try {
double jdkRevision = Double.parseDouble(jdkRevisionCellValue);
boolean isTestScope = Artifact.SCOPE_TEST.equalsIgnoreCase(artifact.getScope());
if (isTestScope) {
highestTestJavaVersion = Math.max(highestTestJavaVersion, jdkRevision);
} else {
highestNonTestJavaVersion = Math.max(highestNonTestJavaVersion, jdkRevision);
}
} catch (NumberFormatException e) {
// ignore
}
} catch (NumberFormatException e) {
// ignore
}

String sealedCellValue = sealedCellNo;
if (jarDetails.isSealed()) {
sealedCellValue = sealedCellYes;
totalsealed.incrementTotal(artifact.getScope());
debugInformationCellValue = debugInformationCellNo;
if (jarDetails.isDebugPresent()) {
debugInformationCellValue = debugInformationCellYes;
totalDebugInformation.incrementTotal(artifact.getScope());
}

sealedCellValue = sealedCellNo;
if (jarDetails.isSealed()) {
sealedCellValue = sealedCellYes;
totalsealed.incrementTotal(artifact.getScope());
}
}

String name = artifactFile.getName();
Expand All @@ -593,7 +597,7 @@ private void renderSectionDependencyFileDetails() {
String.valueOf(jarDetails.getNumEntries()),
String.valueOf(jarDetails.getNumClasses()),
String.valueOf(jarDetails.getNumPackages()),
jarDetails.getJdkRevision(),
jdkRevisionCellValue,
debugInformationCellValue,
sealedCellValue
});
Expand Down

0 comments on commit 2640c07

Please sign in to comment.