Skip to content

Commit

Permalink
Issue #14. No test anymore for SIScalar empty unit
Browse files Browse the repository at this point in the history
This now returns a dimensionless SIScalar.
  • Loading branch information
averbraeck committed Jul 23, 2023
1 parent b1408dd commit 89cd86a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ public static SIScalar valueOf(final String text)
public static SIScalar of(final double value, final String unitString)
{
Throw.whenNull(unitString, "Error parsing SIScalar: unitString is null");
Throw.when(unitString.length() == 0, IllegalArgumentException.class, "Error parsing SIScalar: empty unitString");
try
{
SIUnit unit = Unit.lookupOrCreateUnitWithSIDimensions(SIDimensions.of(unitString));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ public static FloatSIScalar valueOf(final String text)
public static FloatSIScalar of(final float value, final String unitString)
{
Throw.whenNull(unitString, "Error parsing FloatSIScalar: unitString is null");
Throw.when(unitString.length() == 0, IllegalArgumentException.class, "Error parsing FloatSIScalar: empty unitString");
try
{
SIUnit unit = Unit.lookupOrCreateUnitWithSIDimensions(SIDimensions.of(unitString));
Expand Down

0 comments on commit 89cd86a

Please sign in to comment.