Improve exception detail in Mac.update

Change-Id: I51667af9b054afe202d98474e219f04eb5267370
Manually update the libcore native code.

Cherry-picking all the individual tiny cleanups from the internal branch was
too hard.

Change-Id: Ib97643d3502295685390854c9edd97c93c4c2ecf
Track redundant ops when opening the cache.

See https://github.com/JakeWharton/DiskLruCache/issues/28

Change-Id: I4815aed3b40f0d2599ff12a42853a4947feffbca
Add Unsafe.allocateInstance.

At the moment, mockers are writing dalvik-specific code that pokes
around with our internals and breaks when we change stuff. They're
also supporting Unsafe so they can run on the RI. Everyone's better
off if we just implement the missing Unsafe call.

Bug: 8297640
Change-Id: Ib647e27d920be548009f26ced3b74bad7400a590
Implement Package.getAnnotations.

This doesn't require modifications to the dex file format after all.

Bug: https://code.google.com/p/android/issues/detail?id=16149
Change-Id: Iebde55f175a23c5c7e644067148a73d3b1018398
Fix Method.equals.

The old Method.equals implementation was ridiculously slow, and
incorrect too if you have the same-named class loaded by different
ClassLoaders.

Bug: https://code.google.com/p/android/issues/detail?id=37380
Change-Id: Ife93f61b55391d9a7bcbe6492864776df88bbfd5
Performance improvement in DiskLruCache.readJournalLine().

Speed up DiskLruCache.readJournalLine() by avoiding memory
allocations from String.split(). For non-CLEAN lines, we
avoid using String.split() altogether and find separators
explicitly, for CLEAN lines we defer to String.split() and
we optimize the underlying Splitter.fastSplit() overload to
avoid unnecessary allocations itself.

On a test journal with 7347 entries (1099 CLEAN) this saves
about 45-50% from ~250ms. On a test journal with 272 entries
(86 CLEAN) this saves about 35-40% from ~10ms. Measured
loadJournal on GN in a tight loop (file contents cached).

If used without the other DiskLruCache.readJournalLine()
improvements, the Splitter.fastSplit() optimization alone
would provide about 60% of the savings. It should also
speed up other code outside the DiskLruCache.

Change-Id: I1d6c6b13d54d8fcba3081f2bb9df701b58f5e143
Fixed possible file handle leak
Fix handle leak in rebuildJournal and add rename check

Conflicts:
	luni/src/test/java/libcore/io/DiskLruCacheTest.java
Make sure writer enforces the same encoder
Automatically flush the cache when an edit is completed.

This will remove the need for applications to manually flush
the cache.
Synchronize isClosed.

See https://github.com/square/okhttp/issues/151

Conflicts:
	src/main/java/com/jakewharton/disklrucache/DiskLruCache.java
Java 5 does have these and IntelliJ keeps complaining.
Add `abortUnlessCommitted` method for use in `finally` blocks.
Allow cache size adjustment.

Conflicts:
	luni/src/test/java/libcore/io/DiskLruCacheTest.java
Add getLength method to Snapshot
Fix compilation of Enum on JDK 7

Change-Id: I2e58b6a527e4ef1fc7ed3359b8aea88d01a031fb
libcore: Better Enum fix for JDK 7

 * Jerome Pilliet suggests using a cast in the compareTo method instead of
   changing the field visibility. This is a much better fix.

Change-Id: I334105e0922225512a4d0a2d4b6c9c6ec71b9c51
libcore/luni: Use -fno-strict-aliasing for now

This will be reverted once we have a proper fix.

Change-Id: Iab4663a5f96ff9770371f54697aa872260037ac1
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Revert "Allow cache size adjustment."

This reverts commit 66f25e9d3f89e1b70462d940fc6aa7f147283e3a.