Skip to content

Commit

Permalink
JRE reflection stripping: making method name more specific (isReflect…
Browse files Browse the repository at this point in the history
…ionStripped to isJreReflectionStripped).

	Change on 2018/09/13 by antoniocortes <antoniocortes@google.com>

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212868324
  • Loading branch information
antonio-cortes-perez authored and Tom Ball committed Oct 9, 2018
1 parent ca5073e commit 5d5e56c
Show file tree
Hide file tree
Showing 37 changed files with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static long getSerialVersionUID(Class<? extends Serializable> clazz) {
}
}

public static boolean isReflectionStripped() {
public static boolean isJreReflectionStripped() {
// When reflection metadata is present, the name of the class is java.lang.Boolean.
// For more details about this behavior see {@link #matchClassNamePrefix}.
return Boolean.TRUE.getClass().getName().equals("JavaLangBoolean");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ public void testToString() {
*/
public void testSerialization() {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Mutex sync = new Mutex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ public void testToString() {
*/
public void testSerialization() {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Mutex sync = new Mutex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ public void realRun() throws InterruptedException {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedQueue(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ public void testToString() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedDeque(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void testGetAndSet() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
AtomicBoolean x = new AtomicBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public void testCountingInMultipleThreads() throws InterruptedException {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
AtomicIntegerArray x = new AtomicIntegerArray(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void testIncrementAndGet() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
AtomicInteger x = new AtomicInteger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void testCountingInMultipleThreads() throws InterruptedException {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
AtomicLongArray x = new AtomicLongArray(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public void testIncrementAndGet() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
AtomicLong x = new AtomicLong();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public void testGetAndSet() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
AtomicReferenceArray x = new AtomicReferenceArray(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void testGetAndSet() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
AtomicReference x = new AtomicReference();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ public void testRemove3() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Map x = map5();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ public void testToString() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedDeque(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ public void testToString() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedQueue(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ public void testRemove3() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableMap x = map5();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ public void testToString() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableSet x = populatedSet(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ public void testRemove2_NullPointerException() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableMap x = map5();
Expand Down Expand Up @@ -1287,7 +1287,7 @@ public void testDescendingRemove2_NullPointerException() {
*/
public void testDescendingSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableMap x = dmap5();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public void testToString() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableSet x = populatedSet(SIZE);
Expand Down Expand Up @@ -990,7 +990,7 @@ public void testDescendingToString() {
*/
public void testDescendingSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableSet x = dset5();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public void testSubList3_IndexOutOfBoundsException() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
List x = populatedArray(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public void testToArray_ArrayStoreException() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Set x = populatedSet(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ public void realRun() throws InterruptedException {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedDeque(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ public void realRun() throws InterruptedException {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedQueue(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public void realRun() throws InterruptedException {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedQueue(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public void realRun() throws InterruptedException {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedQueue(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public void testToString() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
Queue x = populatedQueue(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ public void realRun() throws InterruptedException {
public void testSerialization_fair() { testSerialization(true); }
public void testSerialization(boolean fair) {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
ReentrantLock lock = new ReentrantLock(fair);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ public void realRun() throws InterruptedException {
public void testSerialization_fair() { testSerialization(true); }
public void testSerialization(boolean fair) {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
ReentrantReadWriteLock lock = new ReentrantReadWriteLock(fair);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ public void realRun() throws InterruptedException {
*/
public void testSerialization() {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
final SynchronousQueue x = new SynchronousQueue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public void realRun() throws InterruptedException {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
for (TimeUnit x : TimeUnit.values())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ public void testRemove1_NullPointerException() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableMap x = map5();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public void testToString() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableSet x = populatedSet(SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public void testRemove1_NullPointerException() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableMap x = map5();
Expand Down Expand Up @@ -975,7 +975,7 @@ public void testDescendingPut1_NullPointerException() {
*/
public void testDescendingSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableMap x = dmap5();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public void testToString() {
*/
public void testSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableSet x = populatedSet(SIZE);
Expand Down Expand Up @@ -976,7 +976,7 @@ public void testDescendingToString() {
*/
public void testDescendingSerialization() throws Exception {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
NavigableSet x = dset5();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
static {
try {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
ARRAY = 0;
} else {
ARRAY = U.objectFieldOffset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public void testListIterator() {

public void testSerialize() {
// J2ObjC reflection-stripping change.
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
return;
}
String s = "aced0005737200296a6176612e7574696c2e636f6e63757272656e742e436f70"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ public void readConfiguration(InputStream ins) throws IOException {

// Load the properties
Properties.load0(props, new Properties.LineReader(ins));
if (ReflectionUtil.isReflectionStripped()) {
if (ReflectionUtil.isJreReflectionStripped()) {
reflectionStrippedProcessing();
}
// Instantiate new configuration objects.
Expand Down

0 comments on commit 5d5e56c

Please sign in to comment.