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
|
6975f84c2ed72e1e26d20190b6f318718c849008 |
|
01-Mar-2017 |
Tobias Thierer <tobiast@google.com> |
Make Android patch docs in ojluni more consistent with style guide This CL consists of an automated and a manual part (originally reviewed as separate CLs, then squashed together before submitting in order to minimize the number of times each Android-changed line is touch, since that makes future git archaeology on these simpler). Automated part: Run the following command (performs regex replacements): find ojluni -name \*\.java | xargs sed -i \ -e 's/Android[- ]changed/Android-changed/ig' \ -e 's/Android-changed :/Android-changed:/g' \ -e 's/Android-changed \(BEGIN\|END\)/\1 Android-changed/g' \ -e 's/Android-changed - /Android-changed: /g' \ -e 's/Android[- ]removed/Android-removed/ig' \ -e 's/Android-removed :/Android-removed:/g' \ -e 's/Android-removed \(BEGIN\|END\)/\1 Android-removed/g' \ -e 's/Android-removed - /Android-removed: /g' \ -e 's/Android[- ]added/Android-added/ig' \ -e 's/Android-added :/Android-added:/g' \ -e 's/Android-added \(BEGIN\|END\)/\1 Android-added/g' \ -e 's/Android-added - /Android-added: /g' \ -e 's/----- \(BEGIN\|END\) android\( -----\)\?/\1 Android-changed/g' \ -e 's/\/\* \(BEGIN\|END\) Android-changed \*\//\/\/ \1 Android-changed/g' Manual part: Move BEGIN Android-* lines out of block comments Some Android-{changed,removed,added} lines occurred inside block comments. This CL targets places in ojluni that contained the String "* BEGIN Android-" Changes made by this CL include: - Move the "BEGIN Android-" line into a line comment (the style guide mandates that "Android-" lines are always in line comments). In many cases, that line comment is immediately followed by a block comment holding commented-out upstream code. - Add corresponding "// END Android-" line comments, where missing. - Drop documented import changes altogether. These create noise for little benefit: (1.) Most import problems will be found at compile time (2.) They generally correspond to documented changes elsewhere in the file. - In most cases, the phrasing of comments and the decision whether to keep commented out upstream code was not changed by this CL. - Some additional tweaks were made in line with the style guide. No attempt was made to: - Verify that commented-out upstream code actually matches the current upstream. - Make any fixes (eg. to comments) that would have required git archaeology (looking up historic commits). Bug: 35841464 Test: make droid cts update-api Change-Id: Ibc60979cb6061cfb0e9c7096cc9dcab30ddfa733
|
29957558cf0db700bfaae360a80c42dc3871d0e5 |
|
19-Oct-2016 |
Tobias Thierer <tobiast@google.com> |
Move java.util.concurrent from JSR-166 to an OpenJDK upstream Apply diff between JSR-166 and OpenJDK to java.util.concurrent.* This affects - all classes from java.util.concurrent - all classes from java.util.concurrent.atomic - all classes from java.util.concurrent.locks This makes the license of these classes (GPLv2 with classpathi exception) consistent with the other files taken from OpenJDK. Previously, they were in the public domain (from JSR-166), with one exception: CopyOnWriteArrayList.java (COWAL) was previously Android's own implementation under Apache 2.0 license. This CL switches that file to the same upstream OpenJDK revision as the other files touched by this CL; it is therefore now under the same GPLv2+CE license. For files other than COWAL, this CL applies the difference between the old (JSR-166) and new (OpenJDK) upstream. That difference is: - OpenJDK adds an additional license header (GPLv2+CE) to each file; this CL adds those license headers. - The JSR-166 backport of AbstractQueuedSynchronizer and ReentrantLock commented out use of @ReservedStackAccess with a // OPENJDK-9 comment. In Android, this CL drops these lines entirely instead - OpenJDK and JSR-166 use a slightly different paths in doc links to Collection.html#optional-restrictions For these, Android was already using a third variant so this CL doesn't affect those. - Flow and SubmissionPublisher are not available in OpenJDK 8 nor in Android so they are missing from JSR-166's OpenJDK 8 backport and are also omitted here. Because the new upstream is based on OpenJDK, all of the files now live in the ojluni/ source directory. === Upstream OpenJDK 9 revision that this code corresponds to This corresponds to upstream revision 14076 with the changes from revision 13050 reverted ("hg backout"). Revision 14076 is between upstream mercurial tags jdk-9+113 (revision 13993) and jdk-9+114 (revision 14115). Backing out of revision 13050 was necessary in order for the code to use sun.misc.Unsafe like it did before this CL, rather than jdk.internal.misc.Unsafe which is not available on Android. This revision was obtained by running the following steps: hg clone http://hg.openjdk.java.net/jdk9/jdk9 jdk9-tmp cd jdk9-tmp sh ./get_source.sh cd jdk/src/java.base/share/classes/java/util/concurrent hg update -r 14076 hg backout -r 13050 # arbitrarily resolved merge conflicts rm Flow.java SubmissionPublisher.java # OpenJDK 9 specific zip -r ~/juc.zip . The merge conflicts in the backout step were resolved arbitrarily since they involved files from outside of java.util.concurrent.* === Android changes (difference between Android and upstream OpenJDK) The following changes are Android specific (they are not part of the difference between JSR-166 and OpenJDK) so they were all kept / (same as re-applying them on top of the new OpenJDK upstream). In the case of links to Collection.html#optional in documentation, note that JSR-166, OpenJDK and Android use three different paths, so Android's version was kept. Generally these changes come with Android-changed comments. When the changes are in documentation, those comments are sometimes omitted since they don't fit in documentation. To ensure that all of the below changes were authored by AOSP authors, I have manually verified that each of them either (a) is a removal without comment, or (b) there is an existing Android-changed, android-note or similar comment that explains the change, or (c) can be traced to the AOSP commit that introduced it I'm specifying for each change below whether it falls into categories (a), (b) or (c). For (c), I am listing the AOSP commit's SHA below. The only new Android-changed block introduced by this CL is in CopyOnWriteArrayList. -ArrayBlockingQueue (b): removed link to collections framework docs - BlockingDeque: (b) fixed framework docs link to "Collection#optional" - BlockingQueue: (b) removed link to collections framework docs (b) fixed framework docs link to "Collection#optional" - CompletableFuture: (b) @hide several methods (b) Removed sentences in toplevel documentation referring to the methods defaultExecutor(), minimalCompletionStage() and newIncompleteFuture() (explained by the @hide per above). This includes removal of a paragraph around CompletionStage's methods returning CompleteableFuture; that paragraph had been referring to the @hide methods minimalCompletionStage() and copy(). - ConcurrentHashMap: (b) removed link to collections framework docs (c) changes around keySet()'s return type from libcore commit 0ee1606ffb8586014fb3ea6e540c07d7180d9e9e - changed compile time type of keySet() return value to be Set rather than KeySetView, but add documentation guaranteeing that the value will be a KeySetView. - remove the reference to {@link #keySet()} from the links in the documentation for KeySetView (a) Remove use of annotation @jdk.internal.vm.annotation.Contended (not available on Android). - ConcurrentLinkedDeque: (b) removed link to collections framework docs - ConcurrentLinkedQueue: (b) removed link to collections framework docs - ConcurrentMap: (b) removed link to collections framework docs (b) fixed framework docs link to "Collection#optional" - ConcurrentNavigableMap: (b) removed link to collections framework docs - ConcurrentSkipListMap: (b) removed link to collections framework docs - ConcurrentSkipListSet: (b) removed link to collections framework docs (b) fixed framework docs link to "Collection#optional" - CopyOnWriteArraySet: (b) removed link to collections framework docs (b) fixed framework docs link to "Collection#optional" - CountedCompleter: (a) removed snippet "(such as {@link java.nio.channels.CompletionHandler})" from documentation (line ~ 45). - DelayQueue: (b) removed link to collections framework docs - Exchanger: (b) removed use of annotation @jdk.internal.vm.annotation.Contended (not available on Android) - ExecutorService: (b) removed security manager docs - Executors: (b) removed security manager docs & logic - ForkJoinPool: (b) removed use of annotation @jdk.internal.vm.annotation.Contended (not available on Android) - ForkJoinTask: (b) @hide pollSubmission() method (OpenJDK 9 API) - LinkedBlockingDeque: (b) removed link to collections framework docs - LinkedBlockingQueue: (b) removed link to collections framework docs - LinkedTransferQueue: (b) removed link to collections framework docs - PriorityBlockingQueue: (b) removed link to collections framework docs - ScheduledThreadPoolExecutor: (b) omit class-level docs on setRemoveOnCancelPolicy() (b) Remove security manager docs from shutdown(), shutdownNow() - SynchronousQueue: (b) removed link to collections framework docs - ThreadLocalRandom: (a) One empty line dropped around line ~ 465 - ThreadPoolExecutor: (b) removed security manager docs from shutdown(), shutdownNow() (b) change setCorePoolSize() to not throw if maximumPoolSize < corePoolSize - TimeUnit: (b) removed java 9 ChronoUnit related code - TransferQueue: (b) removed link to collections framework docs - atomic/AtomicIntegerFieldUpdater, atomic/AtomicLongFieldUpdater, atomic/AtomicReferenceFieldUpdater: (b) use of VMStack.getStackTrace1() in constructor (b) commented out legacy security code (b) commented out isAncestor() - (b) atomic/Striped64: Commented out use of annotation @jdk.internal.vm.annotation.Contended (not available on Android) For CopyOnWriteArrayList, added the following two new Android changes: - removed link to collections framework docs - fixed framework docs link to "Collection#optional" Bug: 30860904 Bug: 31028793 Test: CtsLibcoreJsr166TestCases (includes CopyOnWriteArrayListTest) Test: CtsLibcoreJavaUtilCollectionsTestCases Change-Id: I41e666d9825f6624e678b6c568326b1155b7adaf
|
cc42201b8d47d4c03a69dcf6df4e58c1a11d32e5 |
|
21-Dec-2015 |
Paul Duffin <paulduffin@google.com> |
Deleting unused or broken files The tests removed from luni/src/test are testing files that no longer exist. It's possible that they provided some coverage of the code which is not provided for the OpenJDK code. The classes removed from ojluni/src/main are the ones not explicitly mentioned in the openjdk_java_files.mk. Change-Id: Id52d65d9b1f06e1a6e7afbd93336c7d12e0c3083
|
51b1b6997fd3f980076b8081f7f1165ccc2a4008 |
|
16-Feb-2015 |
Piotr Jastrzebski <haaawk@google.com> |
Initial import of OpenJdk files. Create new libcore/ojluni directory with src/main/java and src/main/native subdirectiories. Build ojluni into core-oj jar. Use openjdk classes from java.awt.font package. Copy all files from jdk/src/share/classes and jdk/src/solaris/classes directories in openjdk into libcore/ojluni/src/main/java. Copy following native files from openjdk to libcore/ojluni/src/main/native: jdk/src/solaris/native/java/io/canonicalize_md.c build/linux-amd64/include/classfile_constants.h jdk/src/share/native/java/net/DatagramPacket.c jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c jdk/src/share/native/java/lang/Double.c jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c jdk/src/solaris/native/java/io/FileDescriptor_md.c jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c jdk/src/share/native/java/io/FileInputStream.c jdk/src/solaris/native/sun/nio/ch/FileKey.c jdk/src/solaris/native/java/io/FileOutputStream_md.c jdk/src/solaris/native/java/io/FileSystem_md.c jdk/src/share/native/java/lang/Float.c jdk/src/share/native/java/net/Inet4Address.c jdk/src/solaris/native/java/net/Inet4AddressImpl.c jdk/src/share/native/java/net/Inet6Address.c jdk/src/solaris/native/java/net/Inet6AddressImpl.c jdk/src/share/native/java/net/InetAddress.c jdk/src/solaris/native/java/net/InetAddressImplFactory.c jdk/src/share/native/java/io/io_util.c jdk/src/solaris/native/sun/nio/ch/IOUtil.c jdk/src/share/native/java/io/io_util.h jdk/src/solaris/native/java/io/io_util_md.c jdk/src/solaris/native/java/io/io_util_md.h build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/java_io_FileDescriptor.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileInputStream.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileOutputStream.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileSystem.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_ObjectStreamClass.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_UnixFileSystem.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Double.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Float.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Integer.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Long.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Runtime.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Shutdown.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_StrictMath.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_String.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_System.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Thread.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Throwable.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_DatagramPacket.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet4Address.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet4AddressImpl.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet6Address.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet6AddressImpl.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_InetAddress.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_InetAddressImplFactory.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_NetworkInterface.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_PlainDatagramSocketImpl.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_PlainSocketImpl.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketInputStream.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketOptions.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketOutputStream.h jdk/src/share/native/java/lang/java_props.h jdk/src/solaris/native/java/lang/java_props_md.c jdk/src/share/native/java/util/zip/Adler32.c as java_util_zip_Adler32.c jdk/src/share/native/java/util/zip/CRC32.c as java_util_zip_CRC32.c build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_CRC32.h jdk/src/share/native/java/util/zip/Deflater.c as java_util_zip_Deflater.c build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_Deflater.h jdk/src/share/native/java/util/zip/Inflater.c as java_util_zip_Inflater.c build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_Inflater.h jdk/src/share/native/java/util/zip/ZipFile.c as java_util_zip_ZipFile.c build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_ZipFile.h jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h jdk/src/share/native/common/jlong.h jdk/src/solaris/native/common/jlong_md.h jdk/src/share/native/common/jni_util.c jdk/src/share/native/common/jni_util.h jdk/src/solaris/native/common/jni_util_md.c jdk/src/share/javavm/export/jvm.h jdk/src/solaris/javavm/export/jvm_md.h jdk/src/solaris/native/java/net/linux_close.c jdk/src/share/native/sun/misc/NativeSignalHandler.c jdk/src/solaris/native/sun/nio/ch/NativeThread.c jdk/src/share/native/java/net/net_util.c jdk/src/share/native/java/net/net_util.h jdk/src/solaris/native/java/net/net_util_md.c jdk/src/solaris/native/java/net/net_util_md.h jdk/src/solaris/native/java/net/NetworkInterface.c jdk/src/share/native/sun/nio/ch/nio.h jdk/src/solaris/native/sun/nio/ch/nio_util.h jdk/src/share/native/java/io/ObjectStreamClass.c jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c jdk/src/solaris/native/java/net/PlainSocketImpl.c jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c jdk/src/share/native/java/lang/Runtime.c jdk/src/share/native/java/lang/Shutdown.c jdk/src/share/native/sun/misc/Signal.c jdk/src/solaris/native/java/net/SocketInputStream.c jdk/src/solaris/native/java/net/SocketOutputStream.c jdk/src/share/native/java/lang/StrictMath.c jdk/src/share/native/java/lang/String.c build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/sun_misc_NativeSignalHandler.h build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/sun_misc_Signal.h build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/sun_net_spi_DefaultProxySelector.h build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileChannelImpl.h build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileDispatcherImpl.h build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileKey.h build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_IOStatus.h build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_IOUtil.h build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_NativeThread.h jdk/src/share/native/java/lang/System.c jdk/src/share/native/java/lang/Thread.c jdk/src/share/native/java/lang/Throwable.c jdk/src/solaris/native/java/io/UnixFileSystem_md.c jdk/src/solaris/native/java/lang/UNIXProcess_md.c jdk/src/share/native/java/util/zip/zip_util.c jdk/src/share/native/java/util/zip/zip_util.h Change-Id: Ib237df4e1b7b5b4d9f12e74d189e6ec9eed3c31d
|