Skip to content

Commit

Permalink
fixed formatting and checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
oh-yes-0-fps committed Jan 7, 2025
1 parent 6f113bd commit b5cd08c
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public static byte[] getRaw(String key, byte[] defaultValue) {

/**
* Put a value with units in the table.
*
*
* @param key the key to be assigned to
* @param value the value that will be assigned
* @return False if the table key already exists with a different type
Expand All @@ -515,7 +515,7 @@ public static <U extends Unit> boolean putMeasure(String key, Measure<U> value,
return false;
}
String publishedUnitSymbol = entry.getTopic().getProperty("unit");
if (publishedUnitSymbol == "null") {
if (publishedUnitSymbol.equals("null")) {
entry.getTopic().setProperty("unit", unit.symbol());
} else if (!publishedUnitSymbol.equals(unit.symbol())) {
return false;
Expand All @@ -526,7 +526,7 @@ public static <U extends Unit> boolean putMeasure(String key, Measure<U> value,

/**
* Put a value with units in the table.
*
*
* @param key the key to be assigned to
* @param value the value that will be assigned
* @return False if the table key already exists with a different type
Expand All @@ -536,13 +536,13 @@ public static <U extends Unit> boolean putMeasure(String key, Measure<U> value)
}

/**
* Returns the value with units the key maps to. If the key does not exist or is of different type,
* it will return the default value.
*
* Returns the value with units the key maps to. If the key does not exist or is of different
* type, it will return the default value.
*
* @param key the key to look up
* @param defaultValue the value to be returned if no value is found
* @return the value associated with the given key or the given default value if there is no value
* associated with the key
* associated with the key
*/
@SuppressWarnings("unchecked")
public static <U extends Unit> Measure<U> getMeasure(String key, Measure<U> defaultValue) {
Expand All @@ -551,7 +551,7 @@ public static <U extends Unit> Measure<U> getMeasure(String key, Measure<U> defa
return defaultValue;
}
String publishedUnitSymbol = entry.getTopic().getProperty("unit");
if (publishedUnitSymbol == "null") {
if (publishedUnitSymbol.equals("null")) {
return defaultValue;
}
U unit = defaultValue.baseUnit();
Expand Down

0 comments on commit b5cd08c

Please sign in to comment.