From d8c451a9fa3ae9c65bb40ff053357aeab185fdfa Mon Sep 17 00:00:00 2001 From: bridiver Date: Wed, 15 Jan 2020 16:57:21 -0700 Subject: [PATCH 1/4] use asm for java patching --- .../chrome/browser/BraveSyncWorker.java | 2 +- .../browser/bookmarks/BraveBookmarkModel.java | 19 ++- .../BraveBookmarkModelClassAdapter.java | 33 ++++ .../org/brave/bytecode/BraveClassAdapter.java | 15 ++ .../org/brave/bytecode/BraveClassVisitor.java | 155 ++++++++++++++++++ .../BraveMainPreferenceBaseClassAdapter.java | 23 +++ build/android/bytecode/java_sources.gni | 6 + build/android/config.gni | 1 + patches/build-android-bytecode-BUILD.gn.patch | 12 ++ ...mium-bytecode-ByteCodeProcessor.java.patch | 38 +++++ ...rowser-bookmarks-BookmarkBridge.java.patch | 28 ---- 11 files changed, 302 insertions(+), 30 deletions(-) create mode 100644 build/android/bytecode/java/org/brave/bytecode/BraveBookmarkModelClassAdapter.java create mode 100644 build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java create mode 100644 build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java create mode 100644 build/android/bytecode/java/org/brave/bytecode/BraveMainPreferenceBaseClassAdapter.java create mode 100644 build/android/bytecode/java_sources.gni create mode 100644 patches/build-android-bytecode-BUILD.gn.patch create mode 100644 patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch delete mode 100644 patches/chrome-android-java-src-org-chromium-chrome-browser-bookmarks-BookmarkBridge.java.patch diff --git a/android/java/org/chromium/chrome/browser/BraveSyncWorker.java b/android/java/org/chromium/chrome/browser/BraveSyncWorker.java index 93e4e1a55d4d..054cf7d21a6d 100755 --- a/android/java/org/chromium/chrome/browser/BraveSyncWorker.java +++ b/android/java/org/chromium/chrome/browser/BraveSyncWorker.java @@ -2378,7 +2378,7 @@ public void run() { mBookmarkItems.add(bookmarkItem); } else if (mAction.equals(DELETE_RECORD)) { long defaultFolderId = (null != mDefaultFolder ? mDefaultFolder.getId() : 0); - mBookmarkItems.add(BookmarkBridge.createBookmarkItem(id, BookmarkType.NORMAL, "", "", false, + mBookmarkItems.add(BraveBookmarkModel.createBookmarkItem(id, BookmarkType.NORMAL, "", "", false, defaultFolderId, BookmarkType.NORMAL, true, true)); } } diff --git a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java index bbe36ec9065c..e34ffae34f54 100644 --- a/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java +++ b/android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkModel.java @@ -5,9 +5,11 @@ package org.chromium.chrome.browser.bookmarks; +import org.chromium.chrome.browser.bookmarks.BookmarkBridge; +import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; import org.chromium.components.bookmarks.BookmarkId; - +// see org.brave.bytecode.BraveBookmarkModelClassAdapter public class BraveBookmarkModel extends BookmarkModel { public void deleteBookmarkSilently(BookmarkId bookmark) { @@ -15,6 +17,21 @@ public void deleteBookmarkSilently(BookmarkId bookmark) { deleteBookmark(bookmark); } + public void extensiveBookmarkChangesBeginning() { + assert false; + } + + public void extensiveBookmarkChangesEnded() { + assert false; + } + + public static BookmarkItem createBookmarkItem(long id, int type, String title, String url, + boolean isFolder, long parentId, int parentIdType, boolean isEditable, + boolean isManaged) { + assert false; + return null; + } + /** * Calls {@link BookmarkBridge#moveBookmark(BookmarkId, BookmarkId, int)} for the given * bookmark. The bookmark is appended at the end. Call that method from Brave's sync only diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveBookmarkModelClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveBookmarkModelClassAdapter.java new file mode 100644 index 000000000000..947f62d5f125 --- /dev/null +++ b/build/android/bytecode/java/org/brave/bytecode/BraveBookmarkModelClassAdapter.java @@ -0,0 +1,33 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.brave.bytecode; + +import org.objectweb.asm.ClassVisitor; + +public class BraveBookmarkModelClassAdapter extends BraveClassVisitor { + + static String sBraveBookmarkModelClassName = + "org/chromium/chrome/browser/bookmarks/BraveBookmarkModel"; + + static String sBookmarksBridgeClassName = + "org/chromium/chrome/browser/bookmarks/BookmarkBridge"; + + public BraveBookmarkModelClassAdapter(ClassVisitor visitor) { + super(visitor); + deleteMethod(sBraveBookmarkModelClassName, + "extensiveBookmarkChangesBeginning"); + deleteMethod(sBraveBookmarkModelClassName, + "extensiveBookmarkChangesEnded"); + deleteMethod(sBraveBookmarkModelClassName, + "createBookmarkItem"); + makePublicMethod(sBookmarksBridgeClassName, + "extensiveBookmarkChangesBeginning"); + makePublicMethod(sBookmarksBridgeClassName, + "extensiveBookmarkChangesEnded"); + makePublicMethod(sBookmarksBridgeClassName, + "createBookmarkItem"); + } +} diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java new file mode 100644 index 000000000000..443291778fac --- /dev/null +++ b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java @@ -0,0 +1,15 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.brave.bytecode; + +import org.objectweb.asm.ClassVisitor; + +public class BraveClassAdapter { + public static ClassVisitor createAdapter(ClassVisitor chain) { + chain = new BraveBookmarkModelClassAdapter(chain); + chain = new BraveMainPreferenceBaseClassAdapter(chain); + return chain; + } +} diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java b/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java new file mode 100644 index 000000000000..a8914a9d0c81 --- /dev/null +++ b/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java @@ -0,0 +1,155 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.brave.bytecode; + +import static org.objectweb.asm.Opcodes.ACC_PRIVATE; +import static org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static org.objectweb.asm.Opcodes.ASM5; +import static org.objectweb.asm.Opcodes.INVOKESTATIC; + +import java.util.HashMap; +import java.util.Map; +import java.util.ArrayList; + +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.MethodVisitor; + +class BraveClassVisitor extends ClassVisitor { + + class Method { + public int access; + public String name; + public String desc; + public String signature; + public String[] exceptions; + + public Method(final int access, final String name, String desc, + String signature, String[] exceptions) { + this.access = access; + this.name = name; + this.desc = desc; + this.signature = signature; + this.exceptions = exceptions; + } + + public void makePublic() { + access &= ~ACC_PRIVATE; + access |= ACC_PUBLIC; + } + } + + protected String mName = ""; + protected String mSuperName = ""; + + private Map mSuperNames = new HashMap(); + private Map> mDeleteMethods = + new HashMap>(); + private Map> mMakePublicMethods = + new HashMap>(); + + public BraveClassVisitor(ClassVisitor visitor) { + super(ASM5, visitor); + } + + protected void changeSuperName(String className, String superName) { + mSuperNames.put(className, superName); + } + + private boolean shouldDeleteMethod(String methodName) { + for(Map.Entry> entry : + mDeleteMethods.entrySet()) { + String className = entry.getKey(); + ArrayList methodNames = entry.getValue(); + return mName.contains(className) && + methodNames.contains(methodName); + } + + return false; + } + + protected void deleteMethod(String className, String methodName) { + ArrayList methods = mDeleteMethods.get(className); + if (methods == null) { + methods = new ArrayList(); + mDeleteMethods.put(className, methods); + } + methods.add(methodName); + } + + private boolean shouldMakePublicMethod(String methodName) { + for(Map.Entry> entry : + mMakePublicMethods.entrySet()) { + String className = entry.getKey(); + ArrayList methodNames = entry.getValue(); + return mName.contains(className) && + methodNames.contains(methodName); + } + + return false; + } + + protected void makePublicMethod(String className, String methodName) { + ArrayList methods = mMakePublicMethods.get(className); + if (methods == null) { + methods = new ArrayList(); + mMakePublicMethods.put(className, methods); + } + methods.add(methodName); + } + + @Override + public void visit(int version, + int access, + String name, + String signature, + String superName, + String[] interfaces) { + mName = name; + if (mSuperNames.containsKey(name)) { + superName = mSuperNames.get(name); + System.out.println("change superclass of " + name + " to " + superName); + } + + visitImpl(version, access, name, signature, superName, interfaces); + } + + protected void visitImpl(int version, + int access, + String name, + String signature, + String superName, + String[] interfaces) { + super.visit(version, access, name, signature, superName, interfaces); + } + + @Override + public MethodVisitor visitMethod(final int access, + final String name, + String desc, + String signature, + String[] exceptions) { + Method method = new Method(access, name, desc, signature, exceptions); + if (shouldDeleteMethod(name)) { + System.out.println("delete " + name + " from " + mName); + return null; + } + + if (shouldMakePublicMethod(name)) { + System.out.println("make " + name + " public in " + mName); + method.makePublic(); + } + + return visitMethodImpl(method); + } + + protected MethodVisitor visitMethodImpl(Method method) { + return super.visitMethod(method.access, + method.name, + method.desc, + method.signature, + method.exceptions); + } +} diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveMainPreferenceBaseClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveMainPreferenceBaseClassAdapter.java new file mode 100644 index 000000000000..bf343cb0d957 --- /dev/null +++ b/build/android/bytecode/java/org/brave/bytecode/BraveMainPreferenceBaseClassAdapter.java @@ -0,0 +1,23 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.brave.bytecode; + +import org.objectweb.asm.ClassVisitor; + +public class BraveMainPreferenceBaseClassAdapter extends BraveClassVisitor { + + static String sMainPreferencesClassName = + "org/chromium/chrome/browser/preferences/MainPreferences"; + + static String sBraveMainPreferencesBaseClassName = + "org/chromium/chrome/browser/preferences/BraveMainPreferencesBase"; + + public BraveMainPreferenceBaseClassAdapter(ClassVisitor visitor) { + super(visitor); + changeSuperName(sMainPreferencesClassName, + sBraveMainPreferencesBaseClassName); + } +} diff --git a/build/android/bytecode/java_sources.gni b/build/android/bytecode/java_sources.gni new file mode 100644 index 000000000000..59bf4bf8a2d9 --- /dev/null +++ b/build/android/bytecode/java_sources.gni @@ -0,0 +1,6 @@ +brave_java_bytecode_files = [ + "../../../brave/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java", + "../../../brave/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java", + "../../../brave/build/android/bytecode/java/org/brave/bytecode/BraveBookmarkModelClassAdapter.java", + "../../../brave/build/android/bytecode/java/org/brave/bytecode/BraveMainPreferenceBaseClassAdapter.java", +] diff --git a/build/android/config.gni b/build/android/config.gni index c7fb6c17b361..7f1d7dc548f8 100644 --- a/build/android/config.gni +++ b/build/android/config.gni @@ -1,4 +1,5 @@ import("//brave/android/brave_java_sources.gni") +import("//brave/build/android/bytecode/java_sources.gni") declare_args() { brave_android_manifest_includes = [] diff --git a/patches/build-android-bytecode-BUILD.gn.patch b/patches/build-android-bytecode-BUILD.gn.patch new file mode 100644 index 000000000000..aa9a4291ca66 --- /dev/null +++ b/patches/build-android-bytecode-BUILD.gn.patch @@ -0,0 +1,12 @@ +diff --git a/build/android/bytecode/BUILD.gn b/build/android/bytecode/BUILD.gn +index 88517537f42e5bcea3aa7763dca9ce95b3e4d552..136410363466f1d717f1faa22bf308180e1f326e 100644 +--- a/build/android/bytecode/BUILD.gn ++++ b/build/android/bytecode/BUILD.gn +@@ -16,6 +16,7 @@ java_binary("java_bytecode_rewriter") { + "java/org/chromium/bytecode/ThreadAssertionClassAdapter.java", + "java/org/chromium/bytecode/TypeUtils.java", + ] ++ java_files += brave_java_bytecode_files + main_class = "org.chromium.bytecode.ByteCodeProcessor" + deps = [ + "//third_party/ow2_asm:asm_java", diff --git a/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch b/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch new file mode 100644 index 000000000000..f0239ee6e5c1 --- /dev/null +++ b/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch @@ -0,0 +1,38 @@ +diff --git a/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java b/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java +index 4a56332c061a775dae854a1d2946c855c2f4f66c..d036a1ea3b4f680932db276e2ec248462c76f0ea 100644 +--- a/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java ++++ b/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java +@@ -9,6 +9,9 @@ import static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES; + import org.objectweb.asm.ClassReader; + import org.objectweb.asm.ClassVisitor; + import org.objectweb.asm.ClassWriter; ++import org.objectweb.asm.Opcodes; ++import org.objectweb.asm.tree.ClassNode; ++import org.objectweb.asm.tree.MethodNode; + + import java.io.BufferedInputStream; + import java.io.BufferedOutputStream; +@@ -126,6 +129,7 @@ class ByteCodeProcessor { + chain = new TraceClassVisitor(chain, new PrintWriter(System.out)); + } + */ ++ + if (sShouldUseThreadAnnotations) { + chain = new ThreadAssertionClassAdapter(chain); + } +@@ -136,8 +140,10 @@ class ByteCodeProcessor { + chain = new CustomResourcesClassAdapter( + chain, reader.getClassName(), reader.getSuperName(), sFullClassPathClassLoader); + } ++ chain = org.brave.bytecode.BraveClassAdapter.createAdapter(chain); + reader.accept(chain, 0); + byte[] patchedByteCode = writer.toByteArray(); ++ + return EntryDataPair.create(entry.getName(), patchedByteCode); + } + +@@ -285,3 +291,4 @@ class ByteCodeProcessor { + process(inputJarPath, outputJarPath); + } + } ++ diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-bookmarks-BookmarkBridge.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-bookmarks-BookmarkBridge.java.patch deleted file mode 100644 index e526d9c8e42f..000000000000 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-bookmarks-BookmarkBridge.java.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java -index ff905abf4bfcdb3831ce6eb2a1d353688252efdf..ea32d9cfc5555462837e05996d4c4cb7eed8cd1d 100644 ---- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java -+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java -@@ -901,12 +901,12 @@ public class BookmarkBridge { - } - - @CalledByNative -- private void extensiveBookmarkChangesBeginning() { -+ public void extensiveBookmarkChangesBeginning() { - mIsDoingExtensiveChanges = true; - } - - @CalledByNative -- private void extensiveBookmarkChangesEnded() { -+ public void extensiveBookmarkChangesEnded() { - mIsDoingExtensiveChanges = false; - bookmarkModelChanged(); - } -@@ -928,7 +928,7 @@ public class BookmarkBridge { - } - - @CalledByNative -- private static BookmarkItem createBookmarkItem(long id, int type, String title, String url, -+ public static BookmarkItem createBookmarkItem(long id, int type, String title, String url, - boolean isFolder, long parentId, int parentIdType, boolean isEditable, - boolean isManaged) { - return new BookmarkItem(new BookmarkId(id, type), title, url, isFolder, From 0580578298b85e52ec88bfc4e8e0aad1fdbc9fec Mon Sep 17 00:00:00 2001 From: bridiver Date: Fri, 21 Feb 2020 15:42:19 -0700 Subject: [PATCH 2/4] remove unused import --- .../bytecode/java/org/brave/bytecode/BraveClassVisitor.java | 1 - 1 file changed, 1 deletion(-) diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java b/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java index a8914a9d0c81..c9d626e587d9 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java @@ -8,7 +8,6 @@ import static org.objectweb.asm.Opcodes.ACC_PRIVATE; import static org.objectweb.asm.Opcodes.ACC_PUBLIC; import static org.objectweb.asm.Opcodes.ASM5; -import static org.objectweb.asm.Opcodes.INVOKESTATIC; import java.util.HashMap; import java.util.Map; From 13c782f475ddf3fb30a599e373d45029e71da880 Mon Sep 17 00:00:00 2001 From: bridiver Date: Fri, 21 Feb 2020 15:48:28 -0700 Subject: [PATCH 3/4] cleanup patch --- ...mium-bytecode-ByteCodeProcessor.java.patch | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch b/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch index f0239ee6e5c1..b4d299229f21 100644 --- a/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch +++ b/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch @@ -1,18 +1,8 @@ diff --git a/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java b/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java -index 4a56332c061a775dae854a1d2946c855c2f4f66c..d036a1ea3b4f680932db276e2ec248462c76f0ea 100644 +index 4a56332c061a775dae854a1d2946c855c2f4f66c..694a5fb9d72cad2a67df0b6084e9ca8c231faf48 100644 --- a/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java +++ b/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java -@@ -9,6 +9,9 @@ import static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES; - import org.objectweb.asm.ClassReader; - import org.objectweb.asm.ClassVisitor; - import org.objectweb.asm.ClassWriter; -+import org.objectweb.asm.Opcodes; -+import org.objectweb.asm.tree.ClassNode; -+import org.objectweb.asm.tree.MethodNode; - - import java.io.BufferedInputStream; - import java.io.BufferedOutputStream; -@@ -126,6 +129,7 @@ class ByteCodeProcessor { +@@ -126,6 +126,7 @@ class ByteCodeProcessor { chain = new TraceClassVisitor(chain, new PrintWriter(System.out)); } */ @@ -20,19 +10,11 @@ index 4a56332c061a775dae854a1d2946c855c2f4f66c..d036a1ea3b4f680932db276e2ec24846 if (sShouldUseThreadAnnotations) { chain = new ThreadAssertionClassAdapter(chain); } -@@ -136,8 +140,10 @@ class ByteCodeProcessor { +@@ -136,6 +137,7 @@ class ByteCodeProcessor { chain = new CustomResourcesClassAdapter( chain, reader.getClassName(), reader.getSuperName(), sFullClassPathClassLoader); } + chain = org.brave.bytecode.BraveClassAdapter.createAdapter(chain); reader.accept(chain, 0); byte[] patchedByteCode = writer.toByteArray(); -+ return EntryDataPair.create(entry.getName(), patchedByteCode); - } - -@@ -285,3 +291,4 @@ class ByteCodeProcessor { - process(inputJarPath, outputJarPath); - } - } -+ From 6543cc529373abf924931c62a37853c8370b21a7 Mon Sep 17 00:00:00 2001 From: bridiver Date: Fri, 21 Feb 2020 15:49:44 -0700 Subject: [PATCH 4/4] fixup patches again --- ...rg-chromium-bytecode-ByteCodeProcessor.java.patch | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch b/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch index b4d299229f21..880174c6ca7d 100644 --- a/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch +++ b/patches/build-android-bytecode-java-org-chromium-bytecode-ByteCodeProcessor.java.patch @@ -1,16 +1,8 @@ diff --git a/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java b/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java -index 4a56332c061a775dae854a1d2946c855c2f4f66c..694a5fb9d72cad2a67df0b6084e9ca8c231faf48 100644 +index 4a56332c061a775dae854a1d2946c855c2f4f66c..682225913081bafd1f393ed8327240012304dfc6 100644 --- a/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java +++ b/build/android/bytecode/java/org/chromium/bytecode/ByteCodeProcessor.java -@@ -126,6 +126,7 @@ class ByteCodeProcessor { - chain = new TraceClassVisitor(chain, new PrintWriter(System.out)); - } - */ -+ - if (sShouldUseThreadAnnotations) { - chain = new ThreadAssertionClassAdapter(chain); - } -@@ -136,6 +137,7 @@ class ByteCodeProcessor { +@@ -136,6 +136,7 @@ class ByteCodeProcessor { chain = new CustomResourcesClassAdapter( chain, reader.getClassName(), reader.getSuperName(), sFullClassPathClassLoader); }