From e2e8ba904b306f11dfc5b71e00ab9ac013358cd7 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 22 Oct 2010 15:29:04 -0700 Subject: [PATCH] Layoutlib_Create: Fix order of class adapters. The Transform adapter was running last, instead of running on the output of the Delegate adapter. Change-Id: I2cd777add7b0972c6bb197aaac6693d39dd5a103 --- .../android/tools/layoutlib/create/AsmGenerator.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java index a880c5605b09f..a9ede265b5d81 100644 --- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java +++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AsmGenerator.java @@ -313,6 +313,11 @@ public class AsmGenerator { rv = new RenameClassAdapter(cw, className, newName); } + ClassVisitor cv = new TransformClassAdapter(mLog, mStubMethods, + mDeleteReturns.get(className), + newName, rv, + stubNativesOnly, stubNativesOnly || hasNativeMethods); + Set delegateMethods = mDelegateMethods.get(className); if (delegateMethods != null && !delegateMethods.isEmpty()) { // If delegateMethods only contains one entry ALL_NATIVES and the class is @@ -320,14 +325,10 @@ public class AsmGenerator { if (hasNativeMethods || !(delegateMethods.size() == 1 && delegateMethods.contains(DelegateClassAdapter.ALL_NATIVES))) { - rv = new DelegateClassAdapter(mLog, rv, className, delegateMethods); + cv = new DelegateClassAdapter(mLog, cv, className, delegateMethods); } } - TransformClassAdapter cv = new TransformClassAdapter(mLog, mStubMethods, - mDeleteReturns.get(className), - newName, rv, - stubNativesOnly, stubNativesOnly || hasNativeMethods); cr.accept(cv, 0 /* flags */); return cw.toByteArray(); }