From c47040d31cbcd8cddd5fadb552b4f0f6c94b5bd0 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Wed, 13 Nov 2019 09:33:52 -0800 Subject: Allow structural redefinition on non-final classes. This adds support for structurally redefining non-final, non-finalizable classes. The only restriction is that one cannot redefine a class at the same time as any of its supertypes, if a structural redefinition is occurring. The structural redefinition may not remove any fields or methods, change the superclass or change the implemented interfaces. Adding new methods or fields, both static or non-static, public, private, protected, or package-private, is supported. Test: ./test.py --host Bug: 134162467 Bug: 144168550 Change-Id: I32e9e854b3e56270170b10e8f5aba9de8f6bfdfa --- .../AbstractCollection.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/2000-virtual-list-structural/AbstractCollection.patch (limited to 'test/2000-virtual-list-structural/AbstractCollection.patch') diff --git a/test/2000-virtual-list-structural/AbstractCollection.patch b/test/2000-virtual-list-structural/AbstractCollection.patch new file mode 100644 index 0000000000..7507c7d862 --- /dev/null +++ b/test/2000-virtual-list-structural/AbstractCollection.patch @@ -0,0 +1,16 @@ +--- ../../../libcore/ojluni/src/main/java/java/util/AbstractCollection.java 2019-05-31 10:36:26.634361294 -0700 ++++ src-ex/java/util/AbstractCollection.java 2019-11-18 13:04:48.253575013 -0800 +@@ -63,7 +63,13 @@ + * Sole constructor. (For invocation by subclass constructors, typically + * implicit.) + */ ++ public static volatile int TOTAL_COUNT; ++ public int cnt; ++ + protected AbstractCollection() { ++ synchronized (Collection.class) { ++ cnt = ++TOTAL_COUNT; ++ } + } + + // Query Operations -- cgit v1.2.3-59-g8ed1b