unitsofmeasurement / indriya

JSR 385 - Reference Implementation
Other
119 stars 42 forks source link

Possible typo in SimpleUnitFormat.java #337

Closed rockyallen closed 3 years ago

rockyallen commented 3 years ago

In indriya/src/main/java/tech/units/indriya/format/SimpleUnitFormat.java

Starting at line 1056:

  asciiFormat.label(Units.GRAM, "g");
    for(MetricPrefix prefix : MetricPrefix.values()) {
        switch (prefix) {
        case KILO:
            asciiFormat.label(Units.KILOGRAM, "kg");
            break;
        case MICRO:
            asciiFormat.label(MICRO(Units.LITRE), "microg"); // instead of 'µg' -> 'microg'   ???????????
            break;
        default:
            asciiFormat.label(Units.GRAM.prefix(prefix), prefix.getSymbol()+"g");
            break;
        }
    }

Should line ??????????? be GRAM not LITRE?

Caveat: I know nothing about the code, it just looks odd.

keilw commented 3 years ago

Thanks that looks like a copy/paste mistake, seems there are not JUnit tests for every case, because they pass before and after changing it, but will fix it in 2.1.3.