8199773: (bf) XXXBuffer:compareTo method is not working as expected

Reviewed-by: alanb
This commit is contained in:
Paul Sandoz 2018-03-22 09:07:08 -07:00
parent 917c015610
commit a2ea38d2c9
3 changed files with 52 additions and 49 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2018, 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
@ -149,7 +149,7 @@ class StringCharBuffer // package-private
that, that.position(),
Math.min(this.remaining(), that.remaining()));
if (i >= 0) {
return Character.compare(this.get(this.position() + i), that.get(this.position() + i));
return Character.compare(this.get(this.position() + i), that.get(that.position() + i));
}
return this.remaining() - that.remaining();
}