Skip to content

Commit

Permalink
Spring cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Mar 4, 2019
1 parent a263cbd commit 3d0d456
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,14 @@ public int hashCode() {
@Override
protected void persist(boolean clear) {
final Preferences.Props props = new Preferences.Props();
props.set(PREF_VERSION, String.valueOf(1));
props.set(PREF_PORT_NUMBER, String.valueOf(port));

if (clear) // migration support (!)
{
props.set(PREF_VERSION, String.valueOf(1));
props.set(PREF_PORT_NUMBER, String.valueOf(port));

if (clear) // migration support (!)
{
props.clear("assistantPortNumber");
props.clear("assistantIpAddress");
}
props.clear("assistantPortNumber");
props.clear("assistantIpAddress");
}

Preferences.getPreferences().update(props); // atomic (!)
}

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/mpo/dayon/common/utils/UnitUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ public abstract class UnitUtilities {
private static final String DEC_UNIT = "%.2f %s";

public enum BitUnit {
Kbit("Kbit", "kilo", Math.pow(10, 3)),
Mbit("Mbit", "mega", Math.pow(10, 6)),
Gbit("Gbit", "giga", Math.pow(10, 9)),
Tbit("Tbit", "tera", Math.pow(10, 12)),
Pbit("Pbit", "peta", Math.pow(10, 15)),
Ebit("Ebit", "exa", Math.pow(10, 18)),
Zbit("Zbit", "zetta", Math.pow(10, 21)),
Ybit("Ybit", "yotta", Math.pow(10, 24));
KBIT("Kbit", "kilo", Math.pow(10, 3)),
MBIT("Mbit", "mega", Math.pow(10, 6)),
GBIT("Gbit", "giga", Math.pow(10, 9)),
TBIT("Tbit", "tera", Math.pow(10, 12)),
PBIT("Pbit", "peta", Math.pow(10, 15)),
EBIT("Ebit", "exa", Math.pow(10, 18)),
ZBIT("Zbit", "zetta", Math.pow(10, 21)),
YBIT("Ybit", "yotta", Math.pow(10, 24));

private final String symbol;
private final String name;
Expand Down

0 comments on commit 3d0d456

Please sign in to comment.