Skip to content

Commit

Permalink
Remove unnecessary unboxing
Browse files Browse the repository at this point in the history
  • Loading branch information
vlsi committed Oct 18, 2019
1 parent 5cc35f6 commit 2198304
Show file tree
Hide file tree
Showing 50 changed files with 97 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private Random createRandom() {
if (randomSeed.length()>0){
Long seed = getRandomSeedAsLong();
if(seed != null) {
return new Random(seed.longValue());
return new Random(seed);
}
}
return new Random();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private String generateResult(MatchResult match) {
log.debug("RegexExtractor: Template piece {} ({})", obj, obj.getClass());
}
if (obj instanceof Integer) {
result.append(match.group(((Integer) obj).intValue()));
result.append(match.group((Integer) obj));
} else {
result.append(obj);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ public void iterationStart(LoopIterationEvent event) {
globalCounter += increment;
}
} else {
long current = perTheadNumber.get().longValue();
long current = perTheadNumber.get();
if(isResetOnThreadGroupIteration()) {
int iteration = variables.getIteration();
Long lastIterationNumber = perTheadLastIterationNumber.get();
if(iteration != lastIterationNumber.longValue()) {
if(iteration != lastIterationNumber) {
// reset
current = getStart();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public long delay() {
}
}
try {
return Long.decode(ret).longValue();
return Long.decode(ret);
} catch (NumberFormatException e){
log.warn("Number format exception while decoding number: '{}'", ret);
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,15 @@ public void makeGraph() {
graphPanel.setColor(getLinesColors());
graphPanel.setShowGrouping(numberShowGrouping.isSelected());
graphPanel.setLegendPlacement(StatGraphProperties.getPlacementNameMap()
.get(legendPlacementList.getSelectedItem()).intValue());
.get(legendPlacementList.getSelectedItem()));
graphPanel.setPointShape(StatGraphProperties.getPointShapeMap().get(pointShapeLine.getSelectedItem()));
graphPanel.setStrokeWidth(Float.parseFloat((String) strokeWidthList.getSelectedItem()));

graphPanel.setTitleFont(new Font(StatGraphProperties.getFontNameMap().get(titleFontNameList.getSelectedItem()),
StatGraphProperties.getFontStyleMap().get(titleFontStyleList.getSelectedItem()).intValue(),
StatGraphProperties.getFontStyleMap().get(titleFontStyleList.getSelectedItem()),
Integer.parseInt((String) titleFontSizeList.getSelectedItem())));
graphPanel.setLegendFont(new Font(StatGraphProperties.getFontNameMap().get(fontNameList.getSelectedItem()),
StatGraphProperties.getFontStyleMap().get(fontStyleList.getSelectedItem()).intValue(),
StatGraphProperties.getFontStyleMap().get(fontStyleList.getSelectedItem()),
Integer.parseInt((String) fontSizeList.getSelectedItem())));

graphPanel.setHeight(height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,16 @@ public void makeGraph() {
graphPanel.setShowGrouping(numberShowGrouping.isSelected());
graphPanel.setValueOrientation(valueLabelsVertical.isSelected());
graphPanel.setLegendPlacement(StatGraphProperties.getPlacementNameMap()
.get(legendPlacementList.getSelectedItem()).intValue());
.get(legendPlacementList.getSelectedItem()));

graphPanel.setTitleFont(new Font(StatGraphProperties.getFontNameMap().get(titleFontNameList.getSelectedItem()),
StatGraphProperties.getFontStyleMap().get(titleFontStyleList.getSelectedItem()).intValue(),
StatGraphProperties.getFontStyleMap().get(titleFontStyleList.getSelectedItem()),
Integer.parseInt((String) titleFontSizeList.getSelectedItem())));
graphPanel.setLegendFont(new Font(StatGraphProperties.getFontNameMap().get(fontNameList.getSelectedItem()),
StatGraphProperties.getFontStyleMap().get(fontStyleList.getSelectedItem()).intValue(),
StatGraphProperties.getFontStyleMap().get(fontStyleList.getSelectedItem()),
Integer.parseInt((String) fontSizeList.getSelectedItem())));
graphPanel.setValueFont(new Font(StatGraphProperties.getFontNameMap().get(valueFontNameList.getSelectedItem()),
StatGraphProperties.getFontStyleMap().get(valueFontStyleList.getSelectedItem()).intValue(),
StatGraphProperties.getFontStyleMap().get(valueFontStyleList.getSelectedItem()),
Integer.parseInt((String) valueFontSizeList.getSelectedItem())));

graphPanel.setHeight(height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public Object invoke(Object pInvokee) {
Boolean success = (Boolean) super.invoke(pInvokee);

if (success != null) {
if (success.booleanValue()) {
if (success) {
return imageSuccess;
} else {
return imageFailure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public long getLongParameter(String name, long defaultValue) {
}
final String valueString = params.get(name);
try {
return Long.decode(valueString).longValue();
return Long.decode(valueString);
} catch (NumberFormatException e) {
log.warn("Value for parameter '{}' not a long: '{}'. Using default: '{}'.", name, valueString,
defaultValue, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private void addMetrics(long timestampInSeconds, String contextName, SamplerMetr
for (Map.Entry<String, Float> entry : okPercentiles.entrySet()) {
graphiteMetricsManager.addMetric(timestampInSeconds, contextName,
entry.getKey(),
Double.toString(metric.getOkPercentile(entry.getValue().floatValue())));
Double.toString(metric.getOkPercentile(entry.getValue())));
}
}
if (metric.getFailures() > 0) {
Expand All @@ -240,7 +240,7 @@ private void addMetrics(long timestampInSeconds, String contextName, SamplerMetr
for (Map.Entry<String, Float> entry : koPercentiles.entrySet()) {
graphiteMetricsManager.addMetric(timestampInSeconds, contextName,
entry.getKey(),
Double.toString(metric.getKoPercentile(entry.getValue().floatValue())));
Double.toString(metric.getKoPercentile(entry.getValue())));
}
}
graphiteMetricsManager.addMetric(timestampInSeconds, contextName,
Expand All @@ -255,7 +255,7 @@ private void addMetrics(long timestampInSeconds, String contextName, SamplerMetr
for (Map.Entry<String, Float> entry : allPercentiles.entrySet()) {
graphiteMetricsManager.addMetric(timestampInSeconds, contextName,
entry.getKey(),
Double.toString(metric.getAllPercentile(entry.getValue().floatValue())));
Double.toString(metric.getAllPercentile(entry.getValue())));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private BaseMatcher<Long> isAlmost(long value, long precision) {
public boolean matches(Object item) {
if (item instanceof Long) {
Long other = (Long) item;
return Math.abs(other.longValue() - value) < precision;
return Math.abs(other - value) < precision;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ public int getLoops() {
// Evaluation occurs when nbLoops is not yet evaluated
// or when nbLoops is equal to special value INFINITE_LOOP_COUNT
if (nbLoops==null || // No evaluated yet
nbLoops.intValue()==0 || // Last iteration led to nbLoops == 0,
nbLoops ==0 || // Last iteration led to nbLoops == 0,
// in this case as resetLoopCount will not be called,
// it leads to no further evaluations if we don't evaluate, see BUG 56276
nbLoops.intValue()==INFINITE_LOOP_COUNT // Number of iteration is set to infinite
nbLoops ==INFINITE_LOOP_COUNT // Number of iteration is set to infinite
) {
try {
JMeterProperty prop = getProperty(LOOPS);
Expand All @@ -93,7 +93,7 @@ public int getLoops() {
nbLoops = 0;
}
}
return nbLoops.intValue();
return nbLoops;
}

public String getLoopString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void actionPerformed(ActionEvent e) {

private boolean getSaveState(String methodName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Method method = SampleSaveConfiguration.class.getMethod(methodName);
return ((Boolean) method.invoke(saveConfig)).booleanValue();
return (Boolean) method.invoke(saveConfig);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private void updateButtons(Map<String, Boolean> buttonStates) {
JButton button = (JButton) component;
Boolean enabled = buttonStates.get(button.getActionCommand());
if (enabled != null) {
button.setEnabled(enabled.booleanValue());
button.setEnabled(enabled);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void initialize(String exportId,
getExporterPropertyKey(exportId,
EXPORTER_KEY_FILTERS_ONLY_SAMPLE_SERIES),
EXPORTER_KEY_FILTERS_ONLY_SAMPLE_SERIES_DEFAULT,
Boolean.class).booleanValue();
Boolean.class);
exportConfiguration
.filtersOnlySampleSeries(filtersOnlySampleSeries);

Expand All @@ -181,7 +181,7 @@ public void initialize(String exportId,
getExporterPropertyKey(exportId,
EXPORTER_KEY_SHOW_CONTROLLERS_ONLY),
EXPORTER_KEY_SHOW_CONTROLLERS_ONLY_DEFAULT,
Boolean.class).booleanValue();
Boolean.class);
exportConfiguration
.showControllerSeriesOnly(showControllerSeriesOnly);

Expand Down Expand Up @@ -238,7 +238,7 @@ public void initialize(String graphId,
getGraphPropertyKey(graphId,
GRAPH_KEY_EXCLUDE_CONTROLLERS),
GRAPH_KEY_EXCLUDE_CONTROLLERS_DEFAULT,
Boolean.class).booleanValue();
Boolean.class);
graphConfiguration
.setExcludeControllers(excludeControllers);

Expand Down Expand Up @@ -627,14 +627,14 @@ public static ReportGeneratorConfiguration loadFromProperties(
final long apdexSatisfiedThreshold = getRequiredProperty(props,
REPORT_GENERATOR_KEY_APDEX_SATISFIED_THRESHOLD,
REPORT_GENERATOR_KEY_APDEX_SATISFIED_THRESHOLD_DEFAULT,
long.class).longValue();
long.class);
configuration.setApdexSatisfiedThreshold(apdexSatisfiedThreshold);

// Load apdex tolerated threshold
final long apdexToleratedThreshold = getRequiredProperty(props,
REPORT_GENERATOR_KEY_APDEX_TOLERATED_THRESHOLD,
REPORT_GENERATOR_KEY_APDEX_TOLERATED_THRESHOLD_DEFAULT,
long.class).longValue();
long.class);
configuration.setApdexToleratedThreshold(apdexToleratedThreshold);

// Load apdex per transactions, overridden by user
Expand All @@ -647,7 +647,7 @@ public static ReportGeneratorConfiguration loadFromProperties(
props,
REPORT_GENERATOR_KEY_EXCLUDE_TC_FROM_TOP5_ERRORS_BY_SAMPLER,
Boolean.TRUE,
Boolean.class).booleanValue();
Boolean.class);
configuration.setIgnoreTCFromTop5ErrorsBySampler(ignoreTCFromTop5ErrorsBySampler);

// Load sample filter
Expand Down
18 changes: 9 additions & 9 deletions src/core/src/main/java/org/apache/jmeter/report/core/Sample.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public String toString() {
* @return the time stamp
*/
public long getTimestamp() {
return getData(long.class, CSVSaveService.TIME_STAMP).longValue();
return getData(long.class, CSVSaveService.TIME_STAMP);
}

/**
Expand All @@ -158,7 +158,7 @@ public long getTimestamp() {
* @return the elapsed time stored in the sample
*/
public long getElapsedTime() {
return getData(long.class, CSVSaveService.CSV_ELAPSED).longValue();
return getData(long.class, CSVSaveService.CSV_ELAPSED);
}

/**
Expand Down Expand Up @@ -243,7 +243,7 @@ public String getResponseMessage() {
* @return the latency stored in the sample
*/
public long getLatency() {
return getData(long.class, CSVSaveService.CSV_LATENCY).longValue();
return getData(long.class, CSVSaveService.CSV_LATENCY);
}

/**
Expand All @@ -253,7 +253,7 @@ public long getLatency() {
*/
public long getConnectTime() {
if(metadata.indexOf(CSVSaveService.CSV_CONNECT_TIME) >= 0) {
return getData(long.class, CSVSaveService.CSV_CONNECT_TIME).longValue();
return getData(long.class, CSVSaveService.CSV_CONNECT_TIME);
} else {
return 0L;
}
Expand All @@ -265,7 +265,7 @@ public long getConnectTime() {
* @return the success status stored in the sample
*/
public boolean getSuccess() {
return getData(boolean.class, CSVSaveService.SUCCESSFUL).booleanValue();
return getData(boolean.class, CSVSaveService.SUCCESSFUL);
}

/**
Expand All @@ -274,7 +274,7 @@ public boolean getSuccess() {
* @return the number of received bytes stored in the sample
*/
public long getReceivedBytes() {
return getData(long.class, CSVSaveService.CSV_BYTES).longValue();
return getData(long.class, CSVSaveService.CSV_BYTES);
}

/**
Expand All @@ -284,7 +284,7 @@ public long getReceivedBytes() {
*/
public long getSentBytes() {
if(metadata.indexOf(CSVSaveService.CSV_SENT_BYTES) >= 0) {
return getData(long.class, CSVSaveService.CSV_SENT_BYTES).longValue();
return getData(long.class, CSVSaveService.CSV_SENT_BYTES);
} else {
return 0L;
}
Expand All @@ -296,7 +296,7 @@ public long getSentBytes() {
* @return the number of threads in the group of this sample
*/
public int getGroupThreads() {
return getData(int.class, CSVSaveService.CSV_THREAD_COUNT1).intValue();
return getData(int.class, CSVSaveService.CSV_THREAD_COUNT1);
}

/**
Expand All @@ -305,7 +305,7 @@ public int getGroupThreads() {
* @return the overall number of threads
*/
public int getAllThreads() {
return getData(int.class, CSVSaveService.CSV_THREAD_COUNT2).intValue();
return getData(int.class, CSVSaveService.CSV_THREAD_COUNT2);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public String getColumnName(int i) {
* <code>getColumnCount()</code>)
*/
public String getColumnName(Integer i) {
return columns.get(i.intValue());
return columns.get(i);
}

/**
Expand All @@ -201,7 +201,7 @@ public String getColumnName(Integer i) {
*/
public int indexOf(String col) {
Integer out = index.get(col);
return out == null ? -1 : out.intValue();
return out == null ? -1 : out;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public EmptyGraphChecker(boolean filtersOnlySampleSeries,
public boolean checkResult(DataContext dataContext, ResultData result) {
boolean supportsControllerDiscrimination = findValue(Boolean.class,
AbstractGraphConsumer.RESULT_SUPPORTS_CONTROLLERS_DISCRIMINATION,
result).booleanValue();
result);

if (supportsControllerDiscrimination
&& showControllerSeriesOnly
Expand Down Expand Up @@ -233,7 +233,7 @@ public boolean checkResult(DataContext dataContext, ResultData result) {
// Is the current series a controller series ?
boolean isController = findValue(Boolean.class,
AbstractGraphConsumer.RESULT_SERIES_IS_CONTROLLER,
seriesData).booleanValue();
seriesData);

matches = filterPattern.matcher(name).matches();
if (matches) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void startConsuming() {
*/
@Override
public void consume(Sample sample, int channel) {
aggregator.addValue(selector.select(sample).doubleValue());
aggregator.addValue(selector.select(sample));
super.produce(sample, channel);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ protected ListResultData createDataResult(String key, Long data) {
result.addResult(new ValueResultData(key != null ? key : JMeterUtils
.getResString("reportgenerator_summary_total")));
result.addResult(new ValueResultData(data));
result.addResult(new ValueResultData((double) data.longValue() * 100 / errorCount));
result.addResult(new ValueResultData((double) data.longValue() * 100
result.addResult(new ValueResultData((double) data * 100 / errorCount));
result.addResult(new ValueResultData((double) data * 100
/ getOverallInfo().getData().doubleValue()));
return result;
}
Expand Down Expand Up @@ -120,7 +120,7 @@ protected void updateData(SummaryInfo info, Sample sample) {
if (overallData == null) {
overallData = ZERO;
}
overallInfo.setData(overallData.longValue() + 1);
overallInfo.setData(overallData + 1);

// Process only failed samples
if (!sample.getSuccess()) {
Expand All @@ -130,7 +130,7 @@ protected void updateData(SummaryInfo info, Sample sample) {
if (data == null) {
data = ZERO;
}
info.setData(data.longValue() + 1);
info.setData(data + 1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void registerError(String errorMessage) {
if (value == null) {
countPerError.put(errorMessage, ONE);
} else {
countPerError.put(errorMessage, value.longValue() + 1);
countPerError.put(errorMessage, value + 1);
}
}

Expand Down
Loading

0 comments on commit 2198304

Please sign in to comment.