ICU-7057 bug fix: make it work when assertions are disabled

X-SVN-Rev: 35788
This commit is contained in:
Markus Scherer 2014-06-02 14:08:57 +00:00
parent 4b5a43f324
commit 98772b58a6
2 changed files with 3 additions and 2 deletions

View File

@ -202,7 +202,7 @@ public final class CollationLoader {
t.actualLocale = actualLocale;
// deserialize
UResourceBundle binary = ((ICUResourceBundle)data).get("%%CollationBin");
UResourceBundle binary = data.get("%%CollationBin");
ByteBuffer inBytes = binary.getBinary();
try {
CollationDataReader.read(root, inBytes, t);

View File

@ -223,7 +223,8 @@ public final class ICUBinary
// TODO Java 6 replace new byte[] and arraycopy(): byte[] newBytes = Arrays.copyOf(bytes, bytes.length + avail);
byte[] newBytes = new byte[bytes.length + avail];
System.arraycopy(bytes, 0, newBytes, 0, bytes.length);
assert avail == is.read(newBytes, bytes.length, avail);
int numRead = is.read(newBytes, bytes.length, avail);
assert avail == numRead;
bytes = newBytes;
}
return ByteBuffer.wrap(bytes);