Skip to content

Commit

Permalink
fix errors in initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
iTitus committed Oct 19, 2021
1 parent ec6bac1 commit 17493ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/main/java/io/github/ititus/si/unit/AlternateUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ public <T extends QuantityType<T>> UnitConverter getConverterTo(Unit<T> unit) {
@Override
@SuppressWarnings("unchecked")
public <T extends QuantityType<T>> Unit<T> as(T type) {
if (!isCommensurableWith(type)) {
throw new NotCommensurableException();
} else if (getType().equals(type)) {
if (getType().equals(type)) {
return (Unit<T>) this;
}

Expand Down
4 changes: 1 addition & 3 deletions src/main/java/io/github/ititus/si/unit/ConvertedUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ public <T extends QuantityType<T>> UnitConverter getConverterTo(Unit<T> unit) {
@Override
@SuppressWarnings("unchecked")
public <T extends QuantityType<T>> Unit<T> as(T type) {
if (!isCommensurableWith(type)) {
throw new NotCommensurableException();
} else if (getType().equals(type)) {
if (getType().equals(type)) {
return (Unit<T>) this;
}

Expand Down
4 changes: 1 addition & 3 deletions src/main/java/io/github/ititus/si/unit/PrefixUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public <T extends QuantityType<T>> UnitConverter getConverterTo(Unit<T> unit) {
@Override
@SuppressWarnings("unchecked")
public <T extends QuantityType<T>> Unit<T> as(T type) {
if (!isCommensurableWith(type)) {
throw new NotCommensurableException();
} else if (getType().equals(type)) {
if (getType().equals(type)) {
return (Unit<T>) this;
}

Expand Down

0 comments on commit 17493ae

Please sign in to comment.