Skip to content

Commit 7e9d5e8

Browse files
committed
Rename timecode min/max helpers to avoid Comparator conflicts in future Java versions
1 parent c1841c5 commit 7e9d5e8

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎stdlib/src/main/java/com/peterphi/std/types/TimecodeComparator.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static boolean le(final Timecode a, final Timecode b)
125125
*
126126
* @return
127127
*/
128-
public static Timecode max(final Timecode... timecodes)
128+
public static Timecode maxTimecode(final Timecode... timecodes)
129129
{
130130
Timecode max = null;
131131

@@ -145,7 +145,7 @@ public static Timecode max(final Timecode... timecodes)
145145
*
146146
* @return
147147
*/
148-
public static Timecode min(final Timecode... timecodes)
148+
public static Timecode minTimecode(final Timecode... timecodes)
149149
{
150150
Timecode min = null;
151151

‎stdlib/src/main/java/com/peterphi/std/types/TimecodeRange.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ else if (that.within(this.getStart()) || that.within(this.getEnd()))
182182
*/
183183
public static TimecodeRange merge(TimecodeRange a, TimecodeRange b)
184184
{
185-
final Timecode start = TimecodeComparator.min(a.getStart(), b.getStart());
186-
final Timecode end = TimecodeComparator.max(a.getEnd(), b.getEnd());
185+
final Timecode start = TimecodeComparator.minTimecode(a.getStart(), b.getStart());
186+
final Timecode end = TimecodeComparator.maxTimecode(a.getEnd(), b.getEnd());
187187

188188
return new TimecodeRange(start, end);
189189
}

‎stdlib/src/test/java/com/peterphi/std/types/TimecodeComparatorTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void testBetween()
7777
@Test
7878
public void testMin()
7979
{
80-
Timecode min = TimecodeComparator.min(Timecode.getInstance("00:00:00:00@25"),
80+
Timecode min = TimecodeComparator.minTimecode(Timecode.getInstance("00:00:00:00@25"),
8181
Timecode.getInstance("-10:10:10:10@25"),
8282
Timecode.getInstance("-10:00:00:00@25"),
8383
Timecode.getInstance("-09:09:09:09@25"),
@@ -90,7 +90,7 @@ public void testMin()
9090
@Test
9191
public void testMax()
9292
{
93-
Timecode max = TimecodeComparator.max(Timecode.getInstance("00:00:00:00@25"),
93+
Timecode max = TimecodeComparator.maxTimecode(Timecode.getInstance("00:00:00:00@25"),
9494
Timecode.getInstance("-10:10:10:10@25"),
9595
Timecode.getInstance("-10:00:00:00@25"),
9696
Timecode.getInstance("-09:09:09:09@25"),

0 commit comments

Comments
 (0)