From d85087a5fd9ae194f09b69c938d32d079ea01874 Mon Sep 17 00:00:00 2001 From: Werner Keil Date: Sat, 13 Mar 2021 15:57:05 +0100 Subject: [PATCH] 335: Improve and fix JavaDoc Task-Url: https://github.com/unitsofmeasurement/indriya/issues/335 --- src/main/java/tech/units/indriya/unit/UnitDimension.java | 6 ++---- src/main/jdk9/tech/units/indriya/unit/UnitDimension.java | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/tech/units/indriya/unit/UnitDimension.java b/src/main/java/tech/units/indriya/unit/UnitDimension.java index 2e22eae1..c7b3f9fc 100644 --- a/src/main/java/tech/units/indriya/unit/UnitDimension.java +++ b/src/main/java/tech/units/indriya/unit/UnitDimension.java @@ -143,10 +143,8 @@ public class UnitDimension implements Dimension, Serializable { public static > Dimension of(Class quantityType) { // TODO: Track services and aggregate results (register custom types) Unit siUnit = Units.getInstance().getUnit(quantityType); - if (siUnit == null) { - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Quantity type: " + quantityType + " unknown"); - } + if (siUnit == null && LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Quantity type: " + quantityType + " unknown"); } return (siUnit != null) ? siUnit.getDimension() : null; } diff --git a/src/main/jdk9/tech/units/indriya/unit/UnitDimension.java b/src/main/jdk9/tech/units/indriya/unit/UnitDimension.java index 0afa8a35..d44c134f 100644 --- a/src/main/jdk9/tech/units/indriya/unit/UnitDimension.java +++ b/src/main/jdk9/tech/units/indriya/unit/UnitDimension.java @@ -147,10 +147,8 @@ public class UnitDimension implements Dimension, Serializable { public static > Dimension of(Class quantityType) { // TODO: Track services and aggregate results (register custom types) Unit siUnit = Units.getInstance().getUnit(quantityType); - if (siUnit == null) { - if (LOGGER.isLoggable(Level.DEBUG)) { - LOGGER.log(Level.DEBUG, "Quantity type: " + quantityType + " unknown"); - } + if (siUnit == null && LOGGER.isLoggable(Level.DEBUG)) { + LOGGER.log(Level.DEBUG, "Quantity type: " + quantityType + " unknown"); } return (siUnit != null) ? siUnit.getDimension() : null; } @@ -308,4 +306,4 @@ public boolean equals(Object obj) { public int hashCode() { return Objects.hashCode(pseudoUnit); } -} +} \ No newline at end of file