| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consistently use RAII to ensure we always clean up our UResourceBundle*s.
Remove redundant allocation/copying from the UnicodeString to jstring
conversion.
Also simplify a few other repetitive bits of code.
Note that getContentImpl is still in the old style because that function
contains gotos. The right fix for that function involves changing the Java
side to work with a class containing a field for each item, rather than the
current Object[].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes creating a new NumberFormat or new SimpleDateFormat 2x faster.
Basically, the ResourceBundle mechanism is really expensive in several ways:
1. The two-level caching is unnecessary for locale data, and expensive because
it burns through a lot of temporary objects.
2. The PrivilegedAction stuff is unnecessary and expensive because it too burns
quite a few temporary objects (including an ArrayList for each call; should
we consider removing support for SecurityManager so we can remove this cruft
from our code?).
3. The caching in most cases doesn't cache anything useful; the ResourceBundles
simply forward all questions straight to native code anyway, all we're
caching is an unnecessary forwarding object (in a cache where lookups cost
more than just creating a new unnecessary forwarding object would cost).
I've left CurrencyResourceBundle on the slow (ResourceBundle.getBundle) path
because I'm not yet sure how much of that path's semantics it relies on.
I still return LocaleResourceBundle instances (albeit via a much faster path)
but we should fix that. The native code returns an array which ResourceBundle
stuffs into a Hashtable and the calling code accesses via hash table lookups.
This despite the fact that the keys are a small fixed set known in advance.
We could make the native layer and the calling layer simpler and faster by
using a "struct", and doing so would make the middle layer go away completely.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why does this idiom persist? It's ugly, and it's the least efficient way to do
it. (I found the ones in DecimalFormatSymbols while invesigating why
"new SimpleDateFormat()" burns through so many StringBuilders. grep(1) found
the rest.)
The DocumentBuilderImpl removes an unnecessary level of indirection, since we
implement Character.toString in terms of String.valueOf. (I wouldn't have
bothered except this was the only use of Character.toString in the core
libraries, and I added it myself a few weeks ago.)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The active ingredient here is the two changes to stop comparing longValue
with doubleValue and formatting the long if the two compare equal. This
causes us to lose the sign of 0 (because there's no long -0, but -0.0d == 0).
Instead, we explicitly test for boxed Double and Float arguments (because
the number of integral types is larger, they get the "else" clause).
The other changes are just minor cosmetic changes made as I followed the code.
Bug found by jtreg, so no new test.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CharsetDecoderICU and CharsetEncoderICU special-case array-backed ByteBuffers
and CharBuffers for performance reasons, but they shouldn't assume that the
backing array always has offset 0.
An external user hit this while using the jAudioTagger library.
Test cases from user submission:
http://code.google.com/p/android/issues/detail?id=4237
See also: 2234697
|
|
|
|
| |
Bugs: 2099642, 2099637
|
|
|
|
|
|
| |
We shouldn't expose internal arrays without copying.
Bug: 2102273
|
|
|
|
|
|
|
|
|
|
| |
1. Fixed the bug that DecimalFormat does not handle multiplier.
2. Fixed the bug that DecimalFormat does not handle precision.
This is a copy of the original Eclair change,
https://android-git.corp.google.com/g/26297
Bug: 1897917.
|
|
|
|
|
|
|
|
| |
In BidiWrapperInterface.c, replace check_fail with icu4jni_error for better
error reporting.
In CollationInterface.c, make sure we call icu4jni_error *after* calling
the function that may or may not return an error.
|
|
|
|
|
|
| |
Always use our best-of-breed code for throwing exceptions. The remaining
callers of Throw have good reason, and the only caller of ThrowNew is
now JNIHelp.c (jniThrowException) itself.
|
|\
| |
| |
| |
| |
| |
| | |
Merge commit 'd9f8adbfa912c24fb29d2a7e2ce7421a3f96ef82'
* commit 'd9f8adbfa912c24fb29d2a7e2ce7421a3f96ef82':
Make Resources$DefaultTimeZones preloadable again.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
http://s9/81864 was a premature optimization that stopped the timezone data
being loaded in the zygote. So instead of paying the (admittedly large) time
and space costs once in the zygote, we now pay them once per application.
Revert the problematic parts of that change. Note that this isn't simply a
reverse patch:
1. I've changed the comment to make it clear that although
this *looks* like idiomatic lazy initialization, it's actually the opposite.
A comment to that effect might have prevented this code from being broken.
2. I've left the last two hunks of the original patch stand, because they
appear reasonable but unrelated.
Bug: 1941311, 1819285.
|
| |
| |
| |
| |
| | |
For want of an 'extern "C"', we seem to have grown several duplicates of
icu4jni_error.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Note that the changes to DecimalFormatInterface.cpp and RBNFInterface.cpp
are just minor tidy-ups, fixing an issue where the early error exit wouldn't
call ReleaseStringChars to undo the earlier call to GetStringChars. Also
remove a dead function and fix a comment in ExpatParser.cpp.
Tested on sapphire-eng.
Bug: 1639287
|
|\ \
| |/
|/|
| |
| | |
* changes:
Use GetByteArrayRegion instead of GetByteArrayElements.
|
| |
| |
| |
| |
| |
| |
| |
| | |
I've also cleaned up the two calls to free(3) in ubidi_close; the former had
an unnecessary NULL check, and the latter was indented as if it belonged to the
if (but didn't).
Tested on sapphire-eng.
|
|/
|
|
|
|
| |
buffer boundary
BUG=2033986
|
|
|
|
| |
This avoids a "LOG_TAG redefined" warning from log.h.
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
CharsetDecoderICU.
Merge commit 'e406b316295f07d40679ce2372051c3b2bce5de4'
* commit 'e406b316295f07d40679ce2372051c3b2bce5de4':
Bug 1844104: Fix buffer overwrite bugs in CharsetEncoderICU and CharsetDecoderICU.
|
| |
| |
| |
| |
| |
| | |
CharsetDecoderICU.
And add unit test.
|
| | |
|
|\ \
| |/
| |
| |
| |
| |
| | |
Merge commit '08eacd482ca9988b021a9e9e6c8bec573d6e4057'
* commit '08eacd482ca9988b021a9e9e6c8bec573d6e4057':
AI 148694: Manually copied from cupcake_dcm CL 148669-p9. When resetting the
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
mode of the encoder, clear the leftover input & output buffers.
This claims to fix buffer overwriting we're seeing during account
sync and message download.
BUG=1822859
Automated import of CL 148694
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|