@@ -75,9 +75,6 @@ public class DependenciesRenderer extends AbstractProjectInfoRenderer {
75
75
/** URL for the 'close.gif' image */
76
76
private static final String IMG_CLOSE_URL = "./images/close.gif" ;
77
77
78
- /** Used to format decimal values in the "Dependency File Details" table */
79
- protected static final DecimalFormat DEFAULT_DECIMAL_FORMAT = new DecimalFormat ("###0" );
80
-
81
78
private static final Set <String > JAR_SUBTYPE ;
82
79
83
80
private final DependencyNode dependencyNode ;
@@ -181,10 +178,6 @@ public DependenciesRenderer(
181
178
this .projectBuilder = projectBuilder ;
182
179
this .buildingRequest = buildingRequest ;
183
180
this .licenseMappings = licenseMappings ;
184
-
185
- // Using the right set of symbols depending of the locale
186
- DEFAULT_DECIMAL_FORMAT .setDecimalFormatSymbols (new DecimalFormatSymbols (locale ));
187
-
188
181
this .fileLengthDecimalFormat = new FileDecimalFormat (i18n , locale );
189
182
this .fileLengthDecimalFormat .setDecimalFormatSymbols (new DecimalFormatSymbols (locale ));
190
183
}
@@ -501,14 +494,14 @@ private void renderSectionDependencyFileDetails() {
501
494
502
495
startTable (justification , false );
503
496
504
- TotalCell totaldeps = new TotalCell (DEFAULT_DECIMAL_FORMAT );
497
+ TotalCell totaldeps = new TotalCell ();
505
498
TotalCell totaldepsize = new TotalCell (fileLengthDecimalFormat );
506
- TotalCell totalentries = new TotalCell (DEFAULT_DECIMAL_FORMAT );
507
- TotalCell totalclasses = new TotalCell (DEFAULT_DECIMAL_FORMAT );
508
- TotalCell totalpackages = new TotalCell (DEFAULT_DECIMAL_FORMAT );
499
+ TotalCell totalentries = new TotalCell ();
500
+ TotalCell totalclasses = new TotalCell ();
501
+ TotalCell totalpackages = new TotalCell ();
509
502
double highestJavaVersion = 0.0 ;
510
- TotalCell totalDebugInformation = new TotalCell (DEFAULT_DECIMAL_FORMAT );
511
- TotalCell totalsealed = new TotalCell (DEFAULT_DECIMAL_FORMAT );
503
+ TotalCell totalDebugInformation = new TotalCell ();
504
+ TotalCell totalsealed = new TotalCell ();
512
505
513
506
boolean hasSealed = hasSealed (alldeps );
514
507
@@ -579,9 +572,9 @@ private void renderSectionDependencyFileDetails() {
579
572
tableRow (hasSealed , new String [] {
580
573
name ,
581
574
fileLength ,
582
- DEFAULT_DECIMAL_FORMAT . format (jarDetails .getNumEntries ()),
583
- DEFAULT_DECIMAL_FORMAT . format (jarDetails .getNumClasses ()),
584
- DEFAULT_DECIMAL_FORMAT . format (jarDetails .getNumPackages ()),
575
+ String . valueOf (jarDetails .getNumEntries ()),
576
+ String . valueOf (jarDetails .getNumClasses ()),
577
+ String . valueOf (jarDetails .getNumPackages ()),
585
578
jarDetails .getJdkRevision (),
586
579
debugInformationCellValue ,
587
580
sealedCellValue
@@ -1143,7 +1136,7 @@ private String getString(String key) {
1143
1136
static class TotalCell {
1144
1137
static final int SCOPES_COUNT = 5 ;
1145
1138
1146
- final DecimalFormat decimalFormat ;
1139
+ DecimalFormat decimalFormat ;
1147
1140
1148
1141
long total = 0 ;
1149
1142
@@ -1157,6 +1150,8 @@ static class TotalCell {
1157
1150
1158
1151
long totalSystemScope = 0 ;
1159
1152
1153
+ TotalCell () {}
1154
+
1160
1155
TotalCell (DecimalFormat decimalFormat ) {
1161
1156
this .decimalFormat = decimalFormat ;
1162
1157
}
@@ -1210,7 +1205,12 @@ String getTotalString(int index) {
1210
1205
if (index >= 0 ) {
1211
1206
sb .append (getScope (index )).append (": " );
1212
1207
}
1213
- sb .append (decimalFormat .format (getTotal (index )));
1208
+ if (decimalFormat != null ) {
1209
+ sb .append (decimalFormat .format (getTotal (index )));
1210
+ } else {
1211
+ sb .append (getTotal (index ));
1212
+ }
1213
+
1214
1214
return sb .toString ();
1215
1215
}
1216
1216
@@ -1233,7 +1233,12 @@ void addTotal(long add, String scope) {
1233
1233
/** {@inheritDoc} */
1234
1234
public String toString () {
1235
1235
StringBuilder sb = new StringBuilder ();
1236
- sb .append (decimalFormat .format (total ));
1236
+ if (decimalFormat != null ) {
1237
+ sb .append (decimalFormat .format (total ));
1238
+ } else {
1239
+ sb .append (total );
1240
+ }
1241
+
1237
1242
sb .append (" (" );
1238
1243
1239
1244
boolean needSeparator = false ;
0 commit comments