History log of /libcore/luni/src/main/java/java/math/BigInteger.java
Revision Date Author Comments
e31b37859051d3902e06e4ba384995df7188917f 02-Dec-2017 Hans Boehm <hboehm@google.com> Add reachabilityFence, ReachabilitySensitive

Add the @ReachabilitySensitive annotation itself, and use it
in libcore itself, where needed.

Import OpenJDK9+181's reachabilityFence, so that it can be used in
preference to the annotation where it makes sense. Java 9's
stopgap reachabilityFence implementation doesn't work for us,
so replace it with a different stopgap.

The libcore changes correct many situations in which finalizers
could previously run prematurely according to the JLS. Or they
would correct them if we had a real implementation for
@ReachabilitySensitive.

The ZipFile constructor could close the file before notifying the
CloseGuard that it was open.

Aside from the ZipFile change, there should be no functional
change, yet.

Note that the ExemptionMechanism.java fix is the same as upstream.

Conspicuously missing:

- Any code, e.g. in ART or D8, that actually looks for the annotation.
- Uses in frameworks code, where it's probably most critical.

Bug: 63934467
Bug: 70906684
Bug: 28342794
Test: Build & boot AOSP
Change-Id: I652f0625b39b2ba9ac901d4f63e6aa6cf3b74af5
071b891828c603fdfb35c922a3873076478dfd33 10-Dec-2015 ganxiaolin <ganxiaolin@xiaomi.com> Fix multi-thread problem in BigInteger hashCode method

Don't change hashCode when calculate it, using tmp variable.

Signed-off-by: ganxiaolin <ganxiaolin@xiaomi.com>
dd9d07889d37fd2d8d5052b517150ca31ac9d95a 13-Apr-2013 Elliott Hughes <enh@google.com> Fix BigInteger small prime generation.

OpenSSL won't generate primes smaller than 16 bits, so do it ourselves
roughly the same way they would.

Also remove pure duplicate tests from OldBigIntegerTest, and add some
new tests to the modern BigIntegerTest.

Change-Id: I3000942a7a4f2359d5cbe28795b4f8dd96715ef8
ce7dd45a54788328249d11ec9b6fb6e454ca28bd 11-Apr-2013 Elliott Hughes <enh@google.com> Fix the BigDecimal documentation to not be a copy & paste of the BigInteger documentation.

Also do some other documentation clean-up. In particular, it's confusing
to use ^ to mean exponentiation when the language uses it to mean
exclusive-or.

(cherry-pick of 995e3c8d0f5dc43bc8ba5f305d1525210caaf796.)

Bug: https://code.google.com/p/android/issues/detail?id=54103
Change-Id: I704bb4d29ea27664adcba6579eabbccd3782b6b1
995e3c8d0f5dc43bc8ba5f305d1525210caaf796 11-Apr-2013 Elliott Hughes <enh@google.com> Fix the BigDecimal documentation to not be a copy & paste of the BigInteger documentation.

Also do some other documentation clean-up. In particular, it's confusing
to use ^ to mean exponentiation when the language uses it to mean
exclusive-or.

Bug: https://code.google.com/p/android/issues/detail?id=54103
Change-Id: I34871b05a986e97c814dc0a060872bda6c68d031
b5ccf74bdea2d417d9e4820945fe3ba1f636a0d2 09-Apr-2013 Elliott Hughes <enh@google.com> Fix BigInteger test failures.

We were hitting a couple of OpenSSL bugs. I've reported them upstream, and
work around them in the meantime.

Bug: 2943474
Change-Id: Ia06bcf3025f525a954d9b918669d09531631a266
fa28df0d3ecd45625ae816f07303eca0821bea46 13-Jul-2011 Elliott Hughes <enh@google.com> Fix BigInteger.hashCode.

Only the first 'numberLength' ints in 'digits' should be considered part
of the BigInteger. All other 'digits' accessors appear to be correct.

Bug: http://code.google.com/p/android/issues/detail?id=18452
Change-Id: Icb0ffeedc92b15a2ef9dacedf79ec6a1584f60f3
fb0ec0e650bf8be35acb0d47da0311a7c446aa33 14-Jan-2011 Elliott Hughes <enh@google.com> Remove useless android-changed comments.

I've changed useful ones to regular comments or TODOs, as appropriate.

I've left ones in code like java.util.concurrent where we really are
tracking an upstream source, making the change markers useful.

I've left a handful of others where I intend to actually investigate
the implied TODOs before deciding how to resolve them.

Change-Id: Iaf71059b818596351cf8ee5a3cf3c85586051fa6
1f07ea29bc2d334c55c16227582a7795b8c117c1 18-Oct-2010 Elliott Hughes <enh@google.com> Give every NumberFormatException a useful detail message.

Bug: 3095335
Change-Id: If0409c6328c2fa2a35e5027e20b4786fe87e693b
99d9f92a991cbbfc58b103b3f1c114fbac5d1188 08-Sep-2010 Elliott Hughes <enh@google.com> Fix off-by-one error in BigInteger.valueOf.

Bug: 2981072
Change-Id: Ic85aea22fc4e519355c537376b1526828e2375c5
171dc20afe5071d5cbfad7103903bfa2c1f8d00f 02-Sep-2010 Elliott Hughes <enh@google.com> Use idiomatic Java "type[] id" syntax instead of "type id[]".

I've left xalan and the other xml filth alone, as usual.

Change-Id: I6be274501fff73e67ca6b3c872704988e0e30486
172531a275b620d879126a2d24d0074fe4f084a0 25-Aug-2010 Jesse Wilson <jessewilson@google.com> Fix several code hygiene problems in BigInteger.

These were pointed out in the code review for change 62669.

Change-Id: Icf0bb27d826988765c6d49f4887ac86f9b52dc6e
fd3f1748b8627e8b6ee907bdaad4cbf2abd7403b 24-Aug-2010 Jesse Wilson <jessewilson@google.com> Fix concurrency issues in BigInteger.

Also go over the class documentation and formatting and give it some long overdue
attention. The docs are still far from perfect! But this should get rid of the
most obvious problems.

See http://b/issue?id=2785595

Change-Id: Iea40975b95a850702a4cdc693f65e4eaff0dd8b0
7365de1056414750d0a7d1fdd26025fd247f0d04 12-Aug-2010 Jesse Wilson <jessewilson@google.com> Sorting imports.

Change-Id: I8347bc625480a1c37a1ed9976193ddfedeb00bbc
63710430c17f7c0a1e74b926cd21248fde8e9589 11-Jun-2010 Elliott Hughes <enh@google.com> Make BigInteger thread-safe.

We were sharing an openssl BN_CTX between threads, which is unsafe. Stop
doing that, creating BN_CTXes on demand (which seems to be what openssl
does internally). For 1024-bit integers, this makes division faster,
multiplication slower, and makes no convincing difference to gcd. I
instrumented a build to report any time one of the methods that needs
a BN_CTX gets called, and couldn't find anywhere they're used during
boot or https browser usage. (These things do use BigInteger; they just
don't use the methods this change affects.)

Bug: 2652542
Change-Id: I98c94b41df95566cb4c8598f299911e641f72f63
f33eae7e84eb6d3b0f4e86b59605bb3de73009f3 13-May-2010 Elliott Hughes <enh@google.com> Remove all trailing whitespace from the dalvik team-maintained parts of libcore.

Gentlemen, you may now set your editors to "strip trailing whitespace"...

Change-Id: I85b2f6c80e5fbef1af6cab11789790b078c11b1b
cec4dd4b1d33f78997603d0f89c0d0e56e64dbcd 26-Apr-2010 Peter Hallam <peterhal@google.com> merge more modules into luni