Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Haraldsen committed Feb 19, 2025
1 parent 3e9db3d commit 35a5077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/ethlo/time/internal/ItuDurationParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ private void assertNonFractional(final char unit, final String chars, final int

public void validate(String chars, int index)
{
if (afterT && hFound == 0 && mFound == 0 && sFound == 0)
if (afterT && hFound + mFound + sFound == 0)
{
error("Expected at least value and unit after the 'T'", chars, index);

Check warning on line 335 in src/main/java/com/ethlo/time/internal/ItuDurationParser.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/ethlo/time/internal/ItuDurationParser.java#L335

Added line #L335 was not covered by tests
}
Expand All @@ -345,7 +345,7 @@ public void validate(String chars, int index)
error("Expected 'S' after fractional number", chars, index);

Check warning on line 345 in src/main/java/com/ethlo/time/internal/ItuDurationParser.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/ethlo/time/internal/ItuDurationParser.java#L345

Added line #L345 was not covered by tests
}

if (wFound == 0 && dFound == 0 && hFound == 0 && mFound == 0 && sFound == 0)
if (wFound + dFound + hFound + mFound + sFound == 0)
{
error("Expected at least one value and unit", chars, index);

Check warning on line 350 in src/main/java/com/ethlo/time/internal/ItuDurationParser.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/ethlo/time/internal/ItuDurationParser.java#L350

Added line #L350 was not covered by tests
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* #L%
*/

import static com.ethlo.time.ItuDurationParser.NANOS_IN_SECOND;
import static com.ethlo.time.internal.ItuDurationParser.NANOS_IN_SECOND;

import com.ethlo.time.Duration;

Expand Down

0 comments on commit 35a5077

Please sign in to comment.