8277868: Use Comparable.compare() instead of surrogate code

Reviewed-by: rriggs, aivanov
This commit is contained in:
Sergey Tsypanov 2021-12-16 21:39:08 +00:00 committed by Roger Riggs
parent 937126b140
commit 20db7800a6
12 changed files with 23 additions and 75 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -79,7 +79,7 @@ public final class GraphicsPrimitiveMgr {
int id1 = o1.getUniqueID();
int id2 = o2.getUniqueID();
return (id1 == id2 ? 0 : (id1 < id2 ? -1 : 1));
return Integer.compare(id1, id2);
}
};
@ -88,7 +88,7 @@ public final class GraphicsPrimitiveMgr {
int id1 = ((GraphicsPrimitive) o1).getUniqueID();
int id2 = ((PrimitiveSpec) o2).uniqueID;
return (id1 == id2 ? 0 : (id1 < id2 ? -1 : 1));
return Integer.compare(id1, id2);
}
};