ICU-21349 ICU4J units cleanup: eclipse warnings, unsuppress one warning

toString() now uses category, so @SuppressWarnings("unused") is no
longer needed.
This commit is contained in:
Hugo van der Merwe 2021-03-01 20:10:02 +01:00
parent 86d06eca8b
commit c231cf7c4f
5 changed files with 4 additions and 7 deletions

View file

@ -86,7 +86,7 @@ class U_I18N_API ComplexUnitsConverter : public UMemory {
*
* @param inputUnit represents the source unit. (should be single or compound unit).
* @param outputUnits represents the output unit. could be any type. (single, compound or mixed).
* @param ratesInfo
* @param ratesInfo a ConversionRates instance containing the unit conversion rates.
* @param status
*/
ComplexUnitsConverter(const MeasureUnitImpl &inputUnit, const MeasureUnitImpl &outputUnits,

View file

@ -2,12 +2,9 @@
// License & terms of use: http://www.unicode.org/copyright.html
package com.ibm.icu.impl.number;
import java.util.List;
import com.ibm.icu.impl.units.ComplexUnitsConverter;
import com.ibm.icu.impl.units.ConversionRates;
import com.ibm.icu.impl.units.MeasureUnitImpl;
import com.ibm.icu.util.Measure;
import com.ibm.icu.util.MeasureUnit;
/**

View file

@ -86,6 +86,7 @@ public class ComplexUnitsConverter {
* @param outputUnits
* represents the output unit. could be any type. (single, compound or mixed).
* @param conversionRates
* a ConversionRates instance containing the unit conversion rates.
*/
public ComplexUnitsConverter(MeasureUnitImpl inputUnit, MeasureUnitImpl outputUnits,
ConversionRates conversionRates) {

View file

@ -9,7 +9,6 @@ import java.util.List;
import com.ibm.icu.impl.IllegalIcuArgumentException;
import com.ibm.icu.impl.number.MicroProps;
import com.ibm.icu.number.Precision;
import com.ibm.icu.util.Measure;
import com.ibm.icu.util.MeasureUnit;
/**

View file

@ -64,7 +64,7 @@ public class UnitsTest {
for (Measure measure : measures) {
double accuracy = 0.0;
if (i == expected.length - 1) {
accuracy = accuracy;
accuracy = this.accuracy;
}
assertTrue("input " + value + ", output measure " + i + ": expected " +
expected[i] + ", expected unit " +
@ -572,7 +572,6 @@ public class UnitsTest {
/**
* Test Case Data
*/
@SuppressWarnings("unused")
String category;
String usage;
String region;
@ -622,6 +621,7 @@ public class UnitsTest {
}
}
@Override
public String toString() {
ArrayList<MeasureUnitImpl> outputUnits = new ArrayList<>();
for (Pair<String, MeasureUnitImpl> unit : outputUnitInOrder) {