goxr3plus / goxr3plus/java-stream-player

Bad output from TimeTool.millisecondsToTime(millis)

Open
#27 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
158
Forks
36
PR merge metrics
No merged PRs in 30d

Description

https://github.com/goxr3plus/java-stream-player/blob/aea1720538cb972e6550a762d82345ce83a2db78/src/test/java/com/goxr3plus/streamplayer/tools/TimeToolTest.java#L45-L46

The method TimeTool.millisecondsToTime(millis) convert an integer, representing a number of milliseconds, to a string.

It's unclear from the JavaDoc of the method, what the intention was.

The JavaDoc has formatting problems; the /** before the word Returns should be removed.

The method contains commented-out code, which should be removed.

Given the name of the method, and the JavaDoc, I would expect a method that converts the milliseconds to hours:minutes:seconds (if time is over 60 minutes), or minutes:seconds otherwise.

This can be described as

```java
@CsvSource({
"0, '00:00' ",
"1, '00:00' ",
"999, '00:01' ",
"1001, '00:01' ", // Slightly over 1 second
"600001, '10:00 ", // Slightly over 10 minutes
"3601001, '60:01 ", // One hour, one second (and a rounded off millisecond)
})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.