summaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2015-08-10 11:35:19 -0700
committerAndy Clement <aclement@pivotal.io>2015-08-10 11:35:19 -0700
commit5219b4af2c6ed2c477d91d3ea0a364a0e5fc3652 (patch)
tree609c1ee2fb67dd238154f582273f54bec6de9b3c /org.aspectj.matcher
parent7a61a0d50d7371ef0a8e9904e8da7e93922fe8e4 (diff)
downloadaspectj-5219b4af2c6ed2c477d91d3ea0a364a0e5fc3652.tar.gz
aspectj-5219b4af2c6ed2c477d91d3ea0a364a0e5fc3652.zip
Add option not to generate local variable tables in some scenarios
New Xset option generateNewLocalVariableTables defaults to true but can be set to false. In some situations incoming bytecode for weaving doesn't want them adding (e.g. android situations where the bytecode is a bit funky). Issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=470658
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r--org.aspectj.matcher/src/org/aspectj/weaver/World.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/World.java b/org.aspectj.matcher/src/org/aspectj/weaver/World.java
index 83dac2da4..329fef88d 100644
--- a/org.aspectj.matcher/src/org/aspectj/weaver/World.java
+++ b/org.aspectj.matcher/src/org/aspectj/weaver/World.java
@@ -142,6 +142,7 @@ public abstract class World implements Dump.INode {
public boolean forDEBUG_structuralChangesCode = false;
public boolean forDEBUG_bridgingCode = false;
public boolean optimizedMatching = true;
+ public boolean generateNewLvts = true;
protected long timersPerJoinpoint = 25000;
protected long timersPerType = 250;
@@ -959,6 +960,12 @@ public abstract class World implements Dump.INode {
public final static String xsetITD_VERSION_DEFAULT = xsetITD_VERSION_2NDGEN;
public final static String xsetMINIMAL_MODEL = "minimalModel";
public final static String xsetTARGETING_RUNTIME_1610 = "targetRuntime1_6_10";
+
+ // This option allows you to prevent AspectJ adding local variable tables - some tools (e.g. dex) may
+ // not like what gets created because even though it is valid, the bytecode they are processing has
+ // unexpected quirks that mean the table entries are violated in the code. See issue:
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=470658
+ public final static String xsetGENERATE_NEW_LVTS="generateNewLocalVariableTables";
public boolean isInJava5Mode() {
return behaveInJava5Way;
@@ -1621,6 +1628,12 @@ public abstract class World implements Dump.INode {
s = p.getProperty(xsetDEBUG_BRIDGING, "false");
forDEBUG_bridgingCode = s.equalsIgnoreCase("true");
+ s = p.getProperty(xsetGENERATE_NEW_LVTS,"true");
+ generateNewLvts = s.equalsIgnoreCase("true");
+ if (!generateNewLvts) {
+ getMessageHandler().handleMessage(MessageUtil.info("[generateNewLvts=false] for methods without an incoming local variable table, do not generate one"));
+ }
+
s = p.getProperty(xsetOPTIMIZED_MATCHING, "true");
optimizedMatching = s.equalsIgnoreCase("true");
if (!optimizedMatching) {