issue_id
int64 2.04k
425k
| title
stringlengths 9
251
| body
stringlengths 4
32.8k
⌀ | status
stringclasses 6
values | after_fix_sha
stringlengths 7
7
| project_name
stringclasses 6
values | repo_url
stringclasses 6
values | repo_name
stringclasses 6
values | language
stringclasses 1
value | issue_url
null | before_fix_sha
null | pull_url
null | commit_datetime
timestamp[us, tz=UTC] | report_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/patterns/PointcutEvaluationExpenseComparator.java
|
return HANDLER;
}
if (p instanceof IfPointcut) {
return IF;
}
if (p instanceof ThisOrTargetPointcut) {
return THIS_OR_TARGET;
}
if (p instanceof ThisOrTargetAnnotationPointcut) {
return AT_THIS_OR_TARGET;
}
if (p instanceof WithincodePointcut) {
return WITHINCODE;
}
if (p instanceof WithinCodeAnnotationPointcut) {
return ATWITHINCODE;
}
if (p instanceof NotPointcut) {
return getScore(((NotPointcut) p).getNegatedPointcut());
}
if (p instanceof AndPointcut) {
return getScore(((AndPointcut) p).getLeft());
}
if (p instanceof OrPointcut) {
return getScore(((OrPointcut) p).getLeft());
}
return OTHER;
}
}
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
/* *******************************************************************
* Copyright (c) 2004 IBM Corporation.
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* ******************************************************************/
package org.aspectj.weaver.patterns;
import java.util.Iterator;
import java.util.Set;
import java.util.StringTokenizer;
import junit.framework.TestCase;
import org.aspectj.weaver.Shadow;
/**
* @author colyer
*
* TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code
* Templates
*/
public class PointcutRewriterTest extends TestCase {
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
private PointcutRewriter prw;
public void testDistributeNot() {
Pointcut plain = getPointcut("this(Foo)");
assertEquals("Unchanged", plain, prw.rewrite(plain));
Pointcut not = getPointcut("!this(Foo)");
assertEquals("Unchanged", not, prw.rewrite(not));
Pointcut notNot = getPointcut("!!this(Foo)");
assertEquals("this(Foo)", prw.rewrite(notNot).toString());
Pointcut notNotNOT = getPointcut("!!!this(Foo)");
assertEquals("!this(Foo)", prw.rewrite(notNotNOT).toString());
Pointcut and = getPointcut("!(this(Foo) && this(Goo))");
assertEquals("(!this(Foo) || !this(Goo))", prw.rewrite(and, true).toString());
Pointcut or = getPointcut("!(this(Foo) || this(Goo))");
assertEquals("(!this(Foo) && !this(Goo))", prw.rewrite(or, true).toString());
Pointcut nestedNot = getPointcut("!(this(Foo) && !this(Goo))");
assertEquals("(!this(Foo) || this(Goo))", prw.rewrite(nestedNot, true).toString());
}
public void testPullUpDisjunctions() {
Pointcut aAndb = getPointcut("this(Foo) && this(Goo)");
assertEquals("Unchanged", aAndb, prw.rewrite(aAndb));
Pointcut aOrb = getPointcut("this(Foo) || this(Moo)");
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
assertEquals("Unchanged", aOrb, prw.rewrite(aOrb));
Pointcut leftOr = getPointcut("this(Foo) || (this(Goo) && this(Boo))");
assertEquals("or%anyorder%this(Foo)%and%anyorder%this(Boo)%this(Goo)", prw.rewrite(leftOr));
Pointcut rightOr = getPointcut("(this(Goo) && this(Boo)) || this(Foo)");
assertEquals("or%anyorder%this(Foo)%and%anyorder%this(Goo)%this(Boo)", prw.rewrite(rightOr));
Pointcut leftAnd = getPointcut("this(Foo) && (this(Goo) || this(Boo))");
assertEquals("or%anyorder%and%anyorder%this(Boo)%this(Foo)%and%anyorder%this(Foo)%this(Goo)", prw.rewrite(leftAnd));
Pointcut rightAnd = getPointcut("(this(Goo) || this(Boo)) && this(Foo)");
assertEquals("or%anyorder%and%anyorder%this(Boo)%this(Foo)%and%anyorder%this(Foo)%this(Goo)", prw.rewrite(rightAnd));
Pointcut nestedOrs = getPointcut("this(Foo) || this(Goo) || this(Boo)");
assertEquals("or%anyorder%this(Goo)%or%anyorder%this(Boo)%this(Foo)", prw.rewrite(nestedOrs));
Pointcut nestedAnds = getPointcut("(this(Foo) && (this(Boo) && (this(Goo) || this(Moo))))");
assertEquals(
"or%anyorder%and%anyorder%and%anyorder%this(Boo)%this(Foo)%this(Goo)%and%anyorder%and%anyorder%this(Boo)%this(Foo)%this(Moo)",
prw.rewrite(nestedAnds));
}
/**
* spec is reverse polish notation with operators and, or , not, anyorder, delimiter is "%" (not whitespace).
*
* @param spec
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
* @param pc
*/
private void assertEquals(String spec, Pointcut pc) {
StringTokenizer strTok = new StringTokenizer(spec, "%");
String[] tokens = new String[strTok.countTokens()];
for (int i = 0; i < tokens.length; i++) {
tokens[i] = strTok.nextToken();
}
tokenIndex = 0;
assertTrue(spec, equals(pc, tokens));
}
private int tokenIndex = 0;
private boolean equals(Pointcut pc, String[] tokens) {
if (tokens[tokenIndex].equals("and")) {
tokenIndex++;
if (!(pc instanceof AndPointcut)) {
return false;
}
AndPointcut apc = (AndPointcut) pc;
Pointcut left = apc.getLeft();
Pointcut right = apc.getRight();
if (tokens[tokenIndex].equals("anyorder")) {
tokenIndex++;
int restorePoint = tokenIndex;
boolean leftMatchFirst = equals(left, tokens) && equals(right, tokens);
if (leftMatchFirst) {
return true;
}
tokenIndex = restorePoint;
boolean rightMatchFirst = equals(right, tokens) && equals(left, tokens);
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
return rightMatchFirst;
} else {
return equals(left, tokens) && equals(right, tokens);
}
} else if (tokens[tokenIndex].equals("or")) {
tokenIndex++;
if (!(pc instanceof OrPointcut)) {
return false;
}
OrPointcut opc = (OrPointcut) pc;
Pointcut left = opc.getLeft();
Pointcut right = opc.getRight();
if (tokens[tokenIndex].equals("anyorder")) {
tokenIndex++;
int restorePoint = tokenIndex;
boolean leftMatchFirst = equals(left, tokens) && equals(right, tokens);
if (leftMatchFirst) {
return true;
}
tokenIndex = restorePoint;
boolean rightMatchFirst = equals(right, tokens) && equals(left, tokens);
return rightMatchFirst;
} else {
return equals(left, tokens) && equals(right, tokens);
}
} else if (tokens[tokenIndex].equals("not")) {
if (!(pc instanceof NotPointcut)) {
return false;
}
tokenIndex++;
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
NotPointcut np = (NotPointcut) pc;
return equals(np.getNegatedPointcut(), tokens);
} else {
return tokens[tokenIndex++].equals(pc.toString());
}
}
public void testRemoveDuplicatesInAnd() {
Pointcut dupAnd = getPointcut("this(Foo) && this(Foo)");
assertEquals("this(Foo)", prw.rewrite(dupAnd).toString());
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
Pointcut splitdupAnd = getPointcut("(this(Foo) && target(Boo)) && this(Foo)");
assertEquals("(target(Boo) && this(Foo))", prw.rewrite(splitdupAnd).toString());
}
public void testNotRemoveNearlyDuplicatesInAnd() {
Pointcut toAndto = getPointcut("this(Object+) && this(Object)");
prw.rewrite(toAndto);
}
public void testAAndNotAinAnd() {
Pointcut aAndNota = getPointcut("this(Foo)&& !this(Foo)");
assertEquals("Matches nothing", "", prw.rewrite(aAndNota).toString());
Pointcut aAndBAndNota = getPointcut("this(Foo) && execution(* *.*(..)) && !this(Foo)");
assertEquals("Matches nothing", "", prw.rewrite(aAndBAndNota).toString());
}
public void testIfFalseInAnd() {
Pointcut ifFalse = IfPointcut.makeIfFalsePointcut(Pointcut.CONCRETE);
Pointcut p = getPointcut("this(A)");
assertEquals("Matches nothing", "", prw.rewrite(new AndPointcut(ifFalse, p)).toString());
}
public void testMatchesNothinginAnd() {
Pointcut nothing = Pointcut.makeMatchesNothing(Pointcut.CONCRETE);
Pointcut p = getPointcut("this(A)");
assertEquals("Matches nothing", "", prw.rewrite(new AndPointcut(nothing, p)).toString());
}
public void testMixedKindsInAnd() {
Pointcut mixedKinds = getPointcut("call(* *(..)) && execution(* *(..))");
assertEquals("Matches nothing", "", prw.rewrite(mixedKinds).toString());
Pointcut ok = getPointcut("this(Foo) && call(* *(..))");
assertEquals(ok, prw.rewrite(ok));
}
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
public void testDetermineKindSetOfAnd() {
Pointcut oneKind = getPointcut("execution(* foo(..)) && this(Boo)");
AndPointcut rewritten = (AndPointcut) prw.rewrite(oneKind);
assertEquals("Only one kind", 1, Shadow.howMany(rewritten.couldMatchKinds()));
assertTrue("It's Shadow.MethodExecution", Shadow.MethodExecution.isSet(rewritten.couldMatchKinds()));
}
public void testKindSetOfExecution() {
Pointcut p = getPointcut("execution(* foo(..))");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.MethodExecution", Shadow.MethodExecution.isSet(p.couldMatchKinds()));
p = getPointcut("execution(new(..))");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.ConstructorExecution", Shadow.ConstructorExecution.isSet(p.couldMatchKinds()));
}
public void testKindSetOfCall() {
Pointcut p = getPointcut("call(* foo(..))");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.MethodCall", Shadow.MethodCall.isSet(p.couldMatchKinds()));
p = getPointcut("call(new(..))");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.ConstructorCall", Shadow.ConstructorCall.isSet(p.couldMatchKinds()));
}
public void testKindSetOfAdviceExecution() {
Pointcut p = getPointcut("adviceexecution()");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.AdviceExecution", Shadow.AdviceExecution.isSet(p.couldMatchKinds()));
}
public void testKindSetOfGet() {
Pointcut p = getPointcut("get(* *)");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
assertTrue("It's Shadow.FieldGet", Shadow.FieldGet.isSet(p.couldMatchKinds()));
}
public void testKindSetOfSet() {
Pointcut p = getPointcut("set(* *)");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.FieldSet", Shadow.FieldSet.isSet(p.couldMatchKinds()));
}
public void testKindSetOfHandler() {
Pointcut p = getPointcut("handler(*)");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.ExceptionHandler", Shadow.ExceptionHandler.isSet(p.couldMatchKinds()));
}
public void testKindSetOfInitialization() {
Pointcut p = getPointcut("initialization(new (..))");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.Initialization", Shadow.Initialization.isSet(p.couldMatchKinds()));
}
public void testKindSetOfPreInitialization() {
Pointcut p = getPointcut("preinitialization(new (..))");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.PreInitialization", Shadow.PreInitialization.isSet(p.couldMatchKinds()));
}
public void testKindSetOfStaticInitialization() {
Pointcut p = getPointcut("staticinitialization(*)");
assertEquals("Only one kind", 1, Shadow.howMany(p.couldMatchKinds()));
assertTrue("It's Shadow.StaticInitialization", Shadow.StaticInitialization.isSet(p.couldMatchKinds()));
}
public void testKindSetOfThis() {
Pointcut p = getPointcut("this(Foo)");
Set matches = Shadow.toSet(p.couldMatchKinds());
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
assertFalse("No kinds that don't have a this", kind.neverHasThis());
}
for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
if (!Shadow.SHADOW_KINDS[i].neverHasThis()) {
assertTrue("All kinds that do have this", matches.contains(Shadow.SHADOW_KINDS[i]));
}
}
p = getPointcut("@this(Foo)");
matches = Shadow.toSet(p.couldMatchKinds());
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
assertFalse("No kinds that don't have a this", kind.neverHasThis());
}
for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
if (!Shadow.SHADOW_KINDS[i].neverHasThis()) {
assertTrue("All kinds that do have this", matches.contains(Shadow.SHADOW_KINDS[i]));
}
}
}
public void testKindSetOfTarget() {
Pointcut p = getPointcut("target(Foo)");
Set matches = Shadow.toSet(p.couldMatchKinds());
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
assertFalse("No kinds that don't have a target", kind.neverHasTarget());
}
for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
if (!Shadow.SHADOW_KINDS[i].neverHasTarget()) {
assertTrue("All kinds that do have target", matches.contains(Shadow.SHADOW_KINDS[i]));
}
}
p = getPointcut("@target(Foo)");
matches = Shadow.toSet(p.couldMatchKinds());
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
assertFalse("No kinds that don't have a target", kind.neverHasTarget());
}
for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
if (!Shadow.SHADOW_KINDS[i].neverHasTarget()) {
assertTrue("All kinds that do have target", matches.contains(Shadow.SHADOW_KINDS[i]));
}
}
}
public void testKindSetOfArgs() {
Pointcut p = getPointcut("args(..)");
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
p = getPointcut("@args(..)");
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
}
public void testKindSetOfAnnotation() {
Pointcut p = getPointcut("@annotation(Foo)");
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
}
public void testKindSetOfWithin() {
Pointcut p = getPointcut("within(*)");
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
p = getPointcut("@within(Foo)");
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
}
public void testKindSetOfWithinCode() {
Pointcut p = getPointcut("withincode(* foo(..))");
Set matches = Shadow.toSet(p.couldMatchKinds());
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
assertFalse("No kinds that are themselves enclosing",
(kind.isEnclosingKind() && kind != Shadow.ConstructorExecution && kind != Shadow.Initialization));
}
for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
if (!Shadow.SHADOW_KINDS[i].isEnclosingKind()) {
assertTrue("All kinds that are not enclosing", matches.contains(Shadow.SHADOW_KINDS[i]));
}
}
assertTrue("Need cons-exe for inlined field inits", matches.contains(Shadow.ConstructorExecution));
assertTrue("Need init for inlined field inits", matches.contains(Shadow.Initialization));
p = getPointcut("@withincode(Foo)");
matches = Shadow.toSet(p.couldMatchKinds());
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
assertFalse("No kinds that are themselves enclosing", kind.isEnclosingKind());
}
for (int i = 0; i < Shadow.SHADOW_KINDS.length; i++) {
if (!Shadow.SHADOW_KINDS[i].isEnclosingKind()) {
assertTrue("All kinds that are not enclosing", matches.contains(Shadow.SHADOW_KINDS[i]));
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
}
}
}
public void testKindSetOfIf() {
Pointcut p = new IfPointcut(null, 0);
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
p = IfPointcut.makeIfTruePointcut(Pointcut.CONCRETE);
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
p = IfPointcut.makeIfFalsePointcut(Pointcut.CONCRETE);
assertTrue("Nothing", p.couldMatchKinds() == Shadow.NO_SHADOW_KINDS_BITS);
}
public void testKindSetOfCflow() {
Pointcut p = getPointcut("cflow(this(Foo))");
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
p = getPointcut("cflowbelow(this(Foo))");
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
}
public void testKindSetInNegation() {
Pointcut p = getPointcut("!execution(new(..))");
assertTrue("All kinds", p.couldMatchKinds() == Shadow.ALL_SHADOW_KINDS_BITS);
}
public void testKindSetOfOr() {
Pointcut p = getPointcut("execution(new(..)) || get(* *)");
Set matches = Shadow.toSet(p.couldMatchKinds());
assertEquals("2 kinds", 2, matches.size());
assertTrue("ConstructorExecution", matches.contains(Shadow.ConstructorExecution));
assertTrue("FieldGet", matches.contains(Shadow.FieldGet));
}
public void testOrderingInAnd() {
|
314,365 |
Bug 314365 pointcut rewriter can have issues for large hashcode values
|
AJDT uses a pointcut like this: (persingleton(org.eclipse.ajdt.internal.ui.ras.UIFFDC) && ((handler(java.lang.Throwable+) && args(arg1)) && ((within(org.eclipse.ajdt..*) && (!within(org.eclipse.ajdt.internal.ui.lazystart..*) && (!within(org.eclipse.ajdt.internal.ui.dialogs.OpenTypeSelectionDialog2) && !(within(org.eclipse.ajdt.internal.ui.editor.AspectJBreakpointRulerAction) && handler(org.eclipse.jface.text.BadLocationException))))) && (!(within(org.eclipse.ajdt.core.ras.FFDC+) || handler(org.eclipse.core.runtime.OperationCanceledException)) && !this(java.lang.Object))))) After the pointcut rewriter has chewed on it, it is reduced to a normal form. This is meant to be a stable form such that further rewrites of it would not change it. This turned out not to be the case. The hashcodes for some of the components were quite large and manifested as negative integers. The arithmetic in the comparator for the elements would have a problem and give unhelpful responses. For example, if the elements were C,B,A it might rewrite them to A,B,C but on a subsequent rewrite it would realise that C was less than A, giving B,C,A. Whether it went wrong was dependent on the order in which the elements were collected by the rewriter. This is now fixed. It impacts incremental compilation sometimes as two pointcuts that should be identical look different because one has been through the rewritter more times than the other...
|
resolved fixed
|
1e28b92
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-25T23:03:13Z | 2010-05-25T20:40:00Z |
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
|
Pointcut bigLongPC = getPointcut("cflow(this(Foo)) && @args(X) && args(X) && @this(Foo) && @target(Boo) && this(Moo) && target(Boo) && @annotation(Moo) && @withincode(Boo) && withincode(new(..)) && set(* *)&& @within(Foo) && within(Foo)");
Pointcut rewritten = prw.rewrite(bigLongPC);
assertEquals(
"((((((((((((within(Foo) && @within(Foo)) && set(* *)) && withincode(new(..))) && @withincode(Boo)) && target(Boo)) && this(Moo)) && @annotation(Moo)) && @target(Boo)) && @this(Foo)) && args(X)) && @args(X)) && cflow(this(Foo)))",
rewritten.toString());
}
public void testOrderingInSimpleOr() {
OrPointcut opc = (OrPointcut) getPointcut("execution(new(..)) || get(* *)");
assertEquals("reordered", "(get(* *) || execution(new(..)))", prw.rewrite(opc).toString());
}
public void testOrderingInNestedOrs() {
OrPointcut opc = (OrPointcut) getPointcut("(execution(new(..)) || get(* *)) || within(abc)");
assertEquals("reordered", "((within(abc) || get(* *)) || execution(new(..)))", prw.rewrite(opc).toString());
}
public void testOrderingInOrsWithNestedAnds() {
OrPointcut opc = (OrPointcut) getPointcut("get(* *) || (execution(new(..)) && within(abc))");
assertEquals("reordered", "((within(abc) && execution(new(..))) || get(* *))", prw.rewrite(opc).toString());
}
private Pointcut getPointcut(String s) {
return new PatternParser(s).parsePointcut();
}
/*
* @see TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
prw = new PointcutRewriter();
}
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
/* *******************************************************************
* Copyright (c) 2002 Contributors
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PARC initial implementation
* RonBodkin/AndyClement optimizations for memory consumption/speed
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
* ******************************************************************/
package org.aspectj.weaver.bcel;
import java.io.PrintStream;
import java.lang.ref.WeakReference;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.aspectj.apache.bcel.classfile.Attribute;
import org.aspectj.apache.bcel.classfile.AttributeUtils;
import org.aspectj.apache.bcel.classfile.ConstantClass;
import org.aspectj.apache.bcel.classfile.ConstantPool;
import org.aspectj.apache.bcel.classfile.Field;
import org.aspectj.apache.bcel.classfile.InnerClass;
import org.aspectj.apache.bcel.classfile.InnerClasses;
import org.aspectj.apache.bcel.classfile.JavaClass;
import org.aspectj.apache.bcel.classfile.Method;
import org.aspectj.apache.bcel.classfile.Signature;
import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen;
import org.aspectj.apache.bcel.classfile.annotation.EnumElementValue;
import org.aspectj.apache.bcel.classfile.annotation.NameValuePair;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.util.GenericSignature;
import org.aspectj.weaver.AbstractReferenceTypeDelegate;
import org.aspectj.weaver.AjAttribute;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
import org.aspectj.weaver.AjcMemberMaker;
import org.aspectj.weaver.AnnotationAJ;
import org.aspectj.weaver.AnnotationTargetKind;
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.BindingScope;
import org.aspectj.weaver.ConcreteTypeMunger;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedPointcutDefinition;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.SourceContextImpl;
import org.aspectj.weaver.TypeVariable;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.WeaverStateInfo;
import org.aspectj.weaver.World;
import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.GenericSignatureFormatException;
import org.aspectj.weaver.patterns.Declare;
import org.aspectj.weaver.patterns.DeclareErrorOrWarning;
import org.aspectj.weaver.patterns.DeclarePrecedence;
import org.aspectj.weaver.patterns.FormalBinding;
import org.aspectj.weaver.patterns.IScope;
import org.aspectj.weaver.patterns.PerClause;
public class BcelObjectType extends AbstractReferenceTypeDelegate {
public JavaClass javaClass;
private boolean artificial;
private LazyClassGen lazyClassGen = null;
private int modifiers;
private String className;
private String superclassSignature;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
private String superclassName;
private String[] interfaceSignatures;
private ResolvedMember[] fields = null;
private ResolvedMember[] methods = null;
private ResolvedType[] annotationTypes = null;
private AnnotationAJ[] annotations = null;
private TypeVariable[] typeVars = null;
private String retentionPolicy;
private AnnotationTargetKind[] annotationTargetKinds;
private AjAttribute.WeaverVersionInfo wvInfo = AjAttribute.WeaverVersionInfo.UNKNOWN;
private ResolvedPointcutDefinition[] pointcuts = null;
private ResolvedMember[] privilegedAccess = null;
private WeaverStateInfo weaverState = null;
private PerClause perClause = null;
private List<ConcreteTypeMunger> typeMungers = Collections.emptyList();
private List<Declare> declares = Collections.emptyList();
private GenericSignature.FormalTypeParameter[] formalsForResolution = null;
private String declaredSignature = null;
private boolean hasBeenWoven = false;
private boolean isGenericType = false;
private boolean isInterface;
private boolean isEnum;
private boolean isAnnotation;
private boolean isAnonymous;
private boolean isNested;
private boolean isObject = false;
private boolean isAnnotationStyleAspect = false;
private boolean isCodeStyleAspect = false;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
private WeakReference<ResolvedType> superTypeReference = new WeakReference<ResolvedType>(null);
private WeakReference<ResolvedType[]> superInterfaceReferences = new WeakReference<ResolvedType[]>(null);
private int bitflag = 0x0000;
private static final int DISCOVERED_ANNOTATION_RETENTION_POLICY = 0x0001;
private static final int UNPACKED_GENERIC_SIGNATURE = 0x0002;
private static final int UNPACKED_AJATTRIBUTES = 0x0004;
private static final int DISCOVERED_ANNOTATION_TARGET_KINDS = 0x0008;
private static final int DISCOVERED_DECLARED_SIGNATURE = 0x0010;
private static final int DISCOVERED_WHETHER_ANNOTATION_STYLE = 0x0020;
private static final int ANNOTATION_UNPACK_IN_PROGRESS = 0x0100;
private static final String[] NO_INTERFACE_SIGS = new String[] {};
/*
* Notes: note(1): in some cases (perclause inheritance) we encounter unpacked state when calling getPerClause
*
* note(2): A BcelObjectType is 'damaged' if it has been modified from what was original constructed from the bytecode. This
* currently happens if the parents are modified or an annotation is added - ideally BcelObjectType should be immutable but
* that's a bigger piece of work. XXX
*/
BcelObjectType(ReferenceType resolvedTypeX, JavaClass javaClass, boolean artificial, boolean exposedToWeaver) {
super(resolvedTypeX, exposedToWeaver);
this.javaClass = javaClass;
this.artificial = artificial;
initializeFromJavaclass();
resolvedTypeX.setDelegate(this);
ISourceContext sourceContext = resolvedTypeX.getSourceContext();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
if (sourceContext == SourceContextImpl.UNKNOWN_SOURCE_CONTEXT) {
sourceContext = new SourceContextImpl(this);
setSourceContext(sourceContext);
}
isObject = (javaClass.getSuperclassNameIndex() == 0);
ensureAspectJAttributesUnpacked();
setSourcefilename(javaClass.getSourceFileName());
}
public void setJavaClass(JavaClass newclass, boolean artificial) {
this.javaClass = newclass;
this.artificial = artificial;
resetState();
initializeFromJavaclass();
}
@Override
public boolean isCacheable() {
return true;
}
private void initializeFromJavaclass() {
isInterface = javaClass.isInterface();
isEnum = javaClass.isEnum();
isAnnotation = javaClass.isAnnotation();
isAnonymous = javaClass.isAnonymous();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
isNested = javaClass.isNested();
modifiers = javaClass.getModifiers();
superclassName = javaClass.getSuperclassName();
className = javaClass.getClassName();
cachedGenericClassTypeSignature = null;
}
public boolean isInterface() {
return isInterface;
}
public boolean isEnum() {
return isEnum;
}
public boolean isAnnotation() {
return isAnnotation;
}
public boolean isAnonymous() {
return isAnonymous;
}
public boolean isNested() {
return isNested;
}
public int getModifiers() {
return modifiers;
}
/**
* Must take into account generic signature
*/
public ResolvedType getSuperclass() {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
if (isObject) {
return null;
}
ResolvedType supertype = superTypeReference.get();
if (supertype == null) {
ensureGenericSignatureUnpacked();
if (superclassSignature == null) {
if (superclassName == null) {
superclassName = javaClass.getSuperclassName();
}
superclassSignature = getResolvedTypeX().getWorld().resolve(UnresolvedType.forName(superclassName)).getSignature();
}
World world = getResolvedTypeX().getWorld();
supertype = world.resolve(UnresolvedType.forSignature(superclassSignature));
superTypeReference = new WeakReference<ResolvedType>(supertype);
}
return supertype;
}
public World getWorld() {
return getResolvedTypeX().getWorld();
}
/**
* Retrieves the declared interfaces - this allows for the generic signature on a type. If specified then the generic signature
* is used to work out the types - this gets around the results of erasure when the class was originally compiled.
*/
public ResolvedType[] getDeclaredInterfaces() {
ResolvedType[] cachedInterfaceTypes = superInterfaceReferences.get();
if (cachedInterfaceTypes == null) {
ensureGenericSignatureUnpacked();
ResolvedType[] interfaceTypes = null;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
if (interfaceSignatures == null) {
String[] names = javaClass.getInterfaceNames();
if (names.length == 0) {
interfaceSignatures = NO_INTERFACE_SIGS;
interfaceTypes = ResolvedType.NONE;
} else {
interfaceSignatures = new String[names.length];
interfaceTypes = new ResolvedType[names.length];
for (int i = 0, len = names.length; i < len; i++) {
interfaceTypes[i] = getResolvedTypeX().getWorld().resolve(UnresolvedType.forName(names[i]));
interfaceSignatures[i] = interfaceTypes[i].getSignature();
}
}
} else {
interfaceTypes = new ResolvedType[interfaceSignatures.length];
for (int i = 0, len = interfaceSignatures.length; i < len; i++) {
interfaceTypes[i] = getResolvedTypeX().getWorld().resolve(UnresolvedType.forSignature(interfaceSignatures[i]));
}
}
superInterfaceReferences = new WeakReference<ResolvedType[]>(interfaceTypes);
return interfaceTypes;
} else {
return cachedInterfaceTypes;
}
}
public ResolvedMember[] getDeclaredMethods() {
ensureGenericSignatureUnpacked();
if (methods == null) {
Method[] ms = javaClass.getMethods();
methods = new ResolvedMember[ms.length];
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
for (int i = ms.length - 1; i >= 0; i--) {
methods[i] = new BcelMethod(this, ms[i]);
}
}
return methods;
}
public ResolvedMember[] getDeclaredFields() {
ensureGenericSignatureUnpacked();
if (fields == null) {
Field[] fs = javaClass.getFields();
fields = new ResolvedMember[fs.length];
for (int i = 0, len = fs.length; i < len; i++) {
fields[i] = new BcelField(this, fs[i]);
}
}
return fields;
}
public TypeVariable[] getTypeVariables() {
if (!isGeneric()) {
return TypeVariable.NONE;
}
if (typeVars == null) {
GenericSignature.ClassSignature classSig = getGenericClassTypeSignature();
typeVars = new TypeVariable[classSig.formalTypeParameters.length];
for (int i = 0; i < typeVars.length; i++) {
GenericSignature.FormalTypeParameter ftp = classSig.formalTypeParameters[i];
try {
typeVars[i] = BcelGenericSignatureToTypeXConverter.formalTypeParameter2TypeVariable(ftp,
classSig.formalTypeParameters, getResolvedTypeX().getWorld());
} catch (GenericSignatureFormatException e) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
throw new IllegalStateException("While getting the type variables for type " + this.toString()
+ " with generic signature " + classSig + " the following error condition was detected: "
+ e.getMessage());
}
}
}
return typeVars;
}
public Collection<ConcreteTypeMunger> getTypeMungers() {
return typeMungers;
}
public Collection<Declare> getDeclares() {
return declares;
}
public Collection<ResolvedMember> getPrivilegedAccesses() {
if (privilegedAccess == null) {
return Collections.emptyList();
}
return Arrays.asList(privilegedAccess);
}
public ResolvedMember[] getDeclaredPointcuts() {
return pointcuts;
}
public boolean isAspect() {
return perClause != null;
}
/**
* Check if the type is an @AJ aspect (no matter if used from an LTW point of view). Such aspects are annotated with @Aspect
*
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
* @return true for @AJ aspect
*/
public boolean isAnnotationStyleAspect() {
if ((bitflag & DISCOVERED_WHETHER_ANNOTATION_STYLE) == 0) {
bitflag |= DISCOVERED_WHETHER_ANNOTATION_STYLE;
isAnnotationStyleAspect = !isCodeStyleAspect && hasAnnotation(AjcMemberMaker.ASPECT_ANNOTATION);
}
return isAnnotationStyleAspect;
}
/**
* Process any org.aspectj.weaver attributes stored against the class.
*/
private void ensureAspectJAttributesUnpacked() {
if ((bitflag & UNPACKED_AJATTRIBUTES) != 0) {
return;
}
bitflag |= UNPACKED_AJATTRIBUTES;
IMessageHandler msgHandler = getResolvedTypeX().getWorld().getMessageHandler();
List<AjAttribute> l = null;
try {
l = Utility.readAjAttributes(className, javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),
getResolvedTypeX().getWorld(), AjAttribute.WeaverVersionInfo.UNKNOWN, new BcelConstantPoolReader(
javaClass.getConstantPool()));
} catch (RuntimeException re) {
throw new RuntimeException("Problem processing attributes in " + javaClass.getFileName(), re);
}
List pointcuts = new ArrayList();
typeMungers = new ArrayList();
declares = new ArrayList();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
processAttributes(l, pointcuts, false);
l = AtAjAttributes.readAj5ClassAttributes(((BcelWorld) getResolvedTypeX().getWorld()).getModelAsAsmManager(), javaClass,
getResolvedTypeX(), getResolvedTypeX().getSourceContext(), msgHandler, isCodeStyleAspect);
AjAttribute.Aspect deferredAspectAttribute = processAttributes(l, pointcuts, true);
if (pointcuts.size() == 0) {
this.pointcuts = ResolvedPointcutDefinition.NO_POINTCUTS;
} else {
this.pointcuts = (ResolvedPointcutDefinition[]) pointcuts.toArray(new ResolvedPointcutDefinition[pointcuts.size()]);
}
resolveAnnotationDeclares(l);
if (deferredAspectAttribute != null) {
perClause = deferredAspectAttribute.reifyFromAtAspectJ(this.getResolvedTypeX());
}
if (isAspect() && !Modifier.isAbstract(getModifiers()) && isGeneric()) {
msgHandler.handleMessage(MessageUtil.error("The generic aspect '" + getResolvedTypeX().getName()
+ "' must be declared abstract", getResolvedTypeX().getSourceLocation()));
}
}
private AjAttribute.Aspect processAttributes(List<AjAttribute> attributeList, List<ResolvedPointcutDefinition> pointcuts,
boolean fromAnnotations) {
AjAttribute.Aspect deferredAspectAttribute = null;
for (AjAttribute a : attributeList) {
if (a instanceof AjAttribute.Aspect) {
if (fromAnnotations) {
deferredAspectAttribute = (AjAttribute.Aspect) a;
} else {
perClause = ((AjAttribute.Aspect) a).reify(this.getResolvedTypeX());
isCodeStyleAspect = true;
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
} else if (a instanceof AjAttribute.PointcutDeclarationAttribute) {
pointcuts.add(((AjAttribute.PointcutDeclarationAttribute) a).reify());
} else if (a instanceof AjAttribute.WeaverState) {
weaverState = ((AjAttribute.WeaverState) a).reify();
} else if (a instanceof AjAttribute.TypeMunger) {
typeMungers.add(((AjAttribute.TypeMunger) a).reify(getResolvedTypeX().getWorld(), getResolvedTypeX()));
} else if (a instanceof AjAttribute.DeclareAttribute) {
declares.add(((AjAttribute.DeclareAttribute) a).getDeclare());
} else if (a instanceof AjAttribute.PrivilegedAttribute) {
AjAttribute.PrivilegedAttribute privAttribute = (AjAttribute.PrivilegedAttribute) a;
privilegedAccess = privAttribute.getAccessedMembers();
} else if (a instanceof AjAttribute.SourceContextAttribute) {
if (getResolvedTypeX().getSourceContext() instanceof SourceContextImpl) {
AjAttribute.SourceContextAttribute sca = (AjAttribute.SourceContextAttribute) a;
((SourceContextImpl) getResolvedTypeX().getSourceContext()).configureFromAttribute(sca.getSourceFileName(), sca
.getLineBreaks());
setSourcefilename(sca.getSourceFileName());
}
} else if (a instanceof AjAttribute.WeaverVersionInfo) {
wvInfo = (AjAttribute.WeaverVersionInfo) a;
} else {
throw new BCException("bad attribute " + a);
}
}
return deferredAspectAttribute;
}
/**
* Extra processing step needed because declares that come from annotations are not pre-resolved. We can't do the resolution
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
* until *after* the pointcuts have been resolved.
*
* @param attributeList
*/
private void resolveAnnotationDeclares(List attributeList) {
FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0];
IScope bindingScope = new BindingScope(getResolvedTypeX(), getResolvedTypeX().getSourceContext(), bindings);
for (Iterator iter = attributeList.iterator(); iter.hasNext();) {
AjAttribute a = (AjAttribute) iter.next();
if (a instanceof AjAttribute.DeclareAttribute) {
Declare decl = (((AjAttribute.DeclareAttribute) a).getDeclare());
if (decl instanceof DeclareErrorOrWarning) {
decl.resolve(bindingScope);
} else if (decl instanceof DeclarePrecedence) {
((DeclarePrecedence) decl).setScopeForResolution(bindingScope);
}
}
}
}
public PerClause getPerClause() {
ensureAspectJAttributesUnpacked();
return perClause;
}
public JavaClass getJavaClass() {
return javaClass;
}
public boolean isArtificial() {
return artificial;
}
public void resetState() {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
if (javaClass == null) {
throw new BCException("can't weave evicted type");
}
bitflag = 0x0000;
this.annotationTypes = null;
this.annotations = null;
this.interfaceSignatures = null;
this.superclassSignature = null;
this.superclassName = null;
this.fields = null;
this.methods = null;
this.pointcuts = null;
this.perClause = null;
this.weaverState = null;
this.lazyClassGen = null;
hasBeenWoven = false;
isObject = (javaClass.getSuperclassNameIndex() == 0);
isAnnotationStyleAspect = false;
ensureAspectJAttributesUnpacked();
}
public void finishedWith() {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
}
public WeaverStateInfo getWeaverState() {
return weaverState;
}
void setWeaverState(WeaverStateInfo weaverState) {
this.weaverState = weaverState;
}
public void printWackyStuff(PrintStream out) {
if (typeMungers.size() > 0) {
out.println(" TypeMungers: " + typeMungers);
}
if (declares.size() > 0) {
out.println(" declares: " + declares);
}
}
/**
* Return the lazyClassGen associated with this type. For aspect types, this value will be cached, since it is used to inline
* advice. For non-aspect types, this lazyClassGen is always newly constructed.
*/
public LazyClassGen getLazyClassGen() {
LazyClassGen ret = lazyClassGen;
if (ret == null) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
ret = new LazyClassGen(this);
if (isAspect()) {
lazyClassGen = ret;
}
}
return ret;
}
public boolean isSynthetic() {
return getResolvedTypeX().isSynthetic();
}
public AjAttribute.WeaverVersionInfo getWeaverVersionAttribute() {
return wvInfo;
}
public ResolvedType[] getAnnotationTypes() {
ensureAnnotationsUnpacked();
return annotationTypes;
}
public AnnotationAJ[] getAnnotations() {
ensureAnnotationsUnpacked();
return annotations;
}
public boolean hasAnnotation(UnresolvedType ofType) {
if (isUnpackingAnnotations()) {
AnnotationGen annos[] = javaClass.getAnnotations();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
if (annos == null || annos.length == 0) {
return false;
} else {
String lookingForSignature = ofType.getSignature();
for (int a = 0; a < annos.length; a++) {
AnnotationGen annotation = annos[a];
if (lookingForSignature.equals(annotation.getTypeSignature())) {
return true;
}
}
}
return false;
}
ensureAnnotationsUnpacked();
for (int i = 0, max = annotationTypes.length; i < max; i++) {
UnresolvedType ax = annotationTypes[i];
if (ax == null) {
throw new RuntimeException("Annotation entry " + i + " on type " + this.getResolvedTypeX().getName() + " is null!");
}
if (ax.equals(ofType)) {
return true;
}
}
return false;
}
public boolean isAnnotationWithRuntimeRetention() {
return (getRetentionPolicy() == null ? false : getRetentionPolicy().equals("RUNTIME"));
}
public String getRetentionPolicy() {
if ((bitflag & DISCOVERED_ANNOTATION_RETENTION_POLICY) == 0) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
bitflag |= DISCOVERED_ANNOTATION_RETENTION_POLICY;
retentionPolicy = null;
if (isAnnotation()) {
ensureAnnotationsUnpacked();
for (int i = annotations.length - 1; i >= 0; i--) {
AnnotationAJ ax = annotations[i];
if (ax.getTypeName().equals(UnresolvedType.AT_RETENTION.getName())) {
List values = ((BcelAnnotation) ax).getBcelAnnotation().getValues();
for (Iterator it = values.iterator(); it.hasNext();) {
NameValuePair element = (NameValuePair) it.next();
EnumElementValue v = (EnumElementValue) element.getValue();
retentionPolicy = v.getEnumValueString();
return retentionPolicy;
}
}
}
}
}
return retentionPolicy;
}
public boolean canAnnotationTargetType() {
AnnotationTargetKind[] targetKinds = getAnnotationTargetKinds();
if (targetKinds == null) {
return true;
}
for (int i = 0; i < targetKinds.length; i++) {
if (targetKinds[i].equals(AnnotationTargetKind.TYPE)) {
return true;
}
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
return false;
}
public AnnotationTargetKind[] getAnnotationTargetKinds() {
if ((bitflag & DISCOVERED_ANNOTATION_TARGET_KINDS) != 0) {
return annotationTargetKinds;
}
bitflag |= DISCOVERED_ANNOTATION_TARGET_KINDS;
annotationTargetKinds = null;
List<AnnotationTargetKind> targetKinds = new ArrayList<AnnotationTargetKind>();
if (isAnnotation()) {
AnnotationAJ[] annotationsOnThisType = getAnnotations();
for (int i = 0; i < annotationsOnThisType.length; i++) {
AnnotationAJ a = annotationsOnThisType[i];
if (a.getTypeName().equals(UnresolvedType.AT_TARGET.getName())) {
Set<String> targets = a.getTargets();
if (targets != null) {
for (String targetKind : targets) {
if (targetKind.equals("ANNOTATION_TYPE")) {
targetKinds.add(AnnotationTargetKind.ANNOTATION_TYPE);
} else if (targetKind.equals("CONSTRUCTOR")) {
targetKinds.add(AnnotationTargetKind.CONSTRUCTOR);
} else if (targetKind.equals("FIELD")) {
targetKinds.add(AnnotationTargetKind.FIELD);
} else if (targetKind.equals("LOCAL_VARIABLE")) {
targetKinds.add(AnnotationTargetKind.LOCAL_VARIABLE);
} else if (targetKind.equals("METHOD")) {
targetKinds.add(AnnotationTargetKind.METHOD);
} else if (targetKind.equals("PACKAGE")) {
targetKinds.add(AnnotationTargetKind.PACKAGE);
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
} else if (targetKind.equals("PARAMETER")) {
targetKinds.add(AnnotationTargetKind.PARAMETER);
} else if (targetKind.equals("TYPE")) {
targetKinds.add(AnnotationTargetKind.TYPE);
}
}
}
}
}
if (!targetKinds.isEmpty()) {
annotationTargetKinds = new AnnotationTargetKind[targetKinds.size()];
return targetKinds.toArray(annotationTargetKinds);
}
}
return annotationTargetKinds;
}
private boolean isUnpackingAnnotations() {
return (bitflag & ANNOTATION_UNPACK_IN_PROGRESS) != 0;
}
private void ensureAnnotationsUnpacked() {
if (isUnpackingAnnotations()) {
throw new BCException("Re-entered weaver instance whilst unpacking annotations on " + this.className);
}
if (annotationTypes == null) {
try {
bitflag |= ANNOTATION_UNPACK_IN_PROGRESS;
AnnotationGen annos[] = javaClass.getAnnotations();
if (annos == null || annos.length == 0) {
annotationTypes = ResolvedType.NONE;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
annotations = AnnotationAJ.EMPTY_ARRAY;
} else {
World w = getResolvedTypeX().getWorld();
annotationTypes = new ResolvedType[annos.length];
annotations = new AnnotationAJ[annos.length];
for (int i = 0; i < annos.length; i++) {
AnnotationGen annotation = annos[i];
String typeSignature = annotation.getTypeSignature();
ResolvedType rType = w.resolve(UnresolvedType.forSignature(typeSignature));
if (rType == null) {
throw new RuntimeException("Whilst unpacking annotations on '" + getResolvedTypeX().getName()
+ "', failed to resolve type '" + typeSignature + "'");
}
annotationTypes[i] = rType;
annotations[i] = new BcelAnnotation(annotation, rType);
}
}
} finally {
bitflag &= ~ANNOTATION_UNPACK_IN_PROGRESS;
}
}
}
public String getDeclaredGenericSignature() {
ensureGenericInfoProcessed();
return declaredSignature;
}
private void ensureGenericSignatureUnpacked() {
if ((bitflag & UNPACKED_GENERIC_SIGNATURE) != 0) {
return;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
}
bitflag |= UNPACKED_GENERIC_SIGNATURE;
if (!getResolvedTypeX().getWorld().isInJava5Mode()) {
return;
}
GenericSignature.ClassSignature cSig = getGenericClassTypeSignature();
if (cSig != null) {
formalsForResolution = cSig.formalTypeParameters;
if (isNested()) {
GenericSignature.FormalTypeParameter[] extraFormals = getFormalTypeParametersFromOuterClass();
if (extraFormals.length > 0) {
List allFormals = new ArrayList();
for (int i = 0; i < formalsForResolution.length; i++) {
allFormals.add(formalsForResolution[i]);
}
for (int i = 0; i < extraFormals.length; i++) {
allFormals.add(extraFormals[i]);
}
formalsForResolution = new GenericSignature.FormalTypeParameter[allFormals.size()];
allFormals.toArray(formalsForResolution);
}
}
GenericSignature.ClassTypeSignature superSig = cSig.superclassSignature;
try {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
ResolvedType rt = BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(superSig, formalsForResolution,
getResolvedTypeX().getWorld());
this.superclassSignature = rt.getSignature();
this.superclassName = rt.getName();
} catch (GenericSignatureFormatException e) {
throw new IllegalStateException("While determining the generic superclass of " + this.className
+ " with generic signature " + getDeclaredGenericSignature() + " the following error was detected: "
+ e.getMessage());
}
if (cSig.superInterfaceSignatures.length == 0) {
this.interfaceSignatures = NO_INTERFACE_SIGS;
} else {
this.interfaceSignatures = new String[cSig.superInterfaceSignatures.length];
for (int i = 0; i < cSig.superInterfaceSignatures.length; i++) {
try {
this.interfaceSignatures[i] = BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(
cSig.superInterfaceSignatures[i], formalsForResolution, getResolvedTypeX().getWorld())
.getSignature();
} catch (GenericSignatureFormatException e) {
throw new IllegalStateException("While determing the generic superinterfaces of " + this.className
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
+ " with generic signature " + getDeclaredGenericSignature()
+ " the following error was detected: " + e.getMessage());
}
}
}
}
if (isGeneric()) {
ReferenceType genericType = (ReferenceType) this.resolvedTypeX.getGenericType();
genericType.setStartPos(this.resolvedTypeX.getStartPos());
this.resolvedTypeX = genericType;
}
}
public GenericSignature.FormalTypeParameter[] getAllFormals() {
ensureGenericSignatureUnpacked();
if (formalsForResolution == null) {
return new GenericSignature.FormalTypeParameter[0];
} else {
return formalsForResolution;
}
}
public ResolvedType getOuterClass() {
if (!isNested()) {
throw new IllegalStateException("Can't get the outer class of a non-nested type");
}
for (Attribute attr : javaClass.getAttributes()) {
if (attr instanceof InnerClasses) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
InnerClass[] innerClss = ((InnerClasses) attr).getInnerClasses();
ConstantPool cpool = javaClass.getConstantPool();
for (InnerClass innerCls : innerClss) {
if (innerCls.getInnerClassIndex() == 0 || innerCls.getOuterClassIndex() == 0) {
continue;
}
ConstantClass innerClsInfo = (ConstantClass) cpool.getConstant(innerCls.getInnerClassIndex());
String innerClsName = cpool.getConstantUtf8(innerClsInfo.getNameIndex()).getValue().replace('/', '.');
if (innerClsName.compareTo(className) == 0) {
ConstantClass outerClsInfo = (ConstantClass) cpool.getConstant(innerCls.getOuterClassIndex());
String outerClsName = cpool.getConstantUtf8(outerClsInfo.getNameIndex()).getValue().replace('/', '.');
UnresolvedType outer = UnresolvedType.forName(outerClsName);
return outer.resolve(getResolvedTypeX().getWorld());
}
}
}
}
int lastDollar = className.lastIndexOf('$');
String superClassName = className.substring(0, lastDollar);
UnresolvedType outer = UnresolvedType.forName(superClassName);
return outer.resolve(getResolvedTypeX().getWorld());
}
private void ensureGenericInfoProcessed() {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
if ((bitflag & DISCOVERED_DECLARED_SIGNATURE) != 0) {
return;
}
bitflag |= DISCOVERED_DECLARED_SIGNATURE;
Signature sigAttr = AttributeUtils.getSignatureAttribute(javaClass.getAttributes());
declaredSignature = (sigAttr == null ? null : sigAttr.getSignature());
if (declaredSignature != null) {
isGenericType = (declaredSignature.charAt(0) == '<');
}
}
public boolean isGeneric() {
ensureGenericInfoProcessed();
return isGenericType;
}
@Override
public String toString() {
return (javaClass == null ? "BcelObjectType" : "BcelObjectTypeFor:" + className);
}
public void evictWeavingState() {
if (getResolvedTypeX().getWorld().couldIncrementalCompileFollow()) {
return;
}
if (javaClass != null) {
ensureAnnotationsUnpacked();
ensureGenericInfoProcessed();
getDeclaredInterfaces();
getDeclaredFields();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
getDeclaredMethods();
if (getResolvedTypeX().getWorld().isXnoInline()) {
lazyClassGen = null;
}
if (weaverState != null) {
weaverState.setReweavable(false);
weaverState.setUnwovenClassFileData(null);
}
for (int i = methods.length - 1; i >= 0; i--) {
methods[i].evictWeavingState();
}
for (int i = fields.length - 1; i >= 0; i--) {
fields[i].evictWeavingState();
}
javaClass = null;
this.artificial = true;
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
|
}
public void weavingCompleted() {
hasBeenWoven = true;
if (getResolvedTypeX().getWorld().isRunMinimalMemory()) {
evictWeavingState();
}
if (getSourceContext() != null && !getResolvedTypeX().isAspect()) {
getSourceContext().tidy();
}
}
public boolean hasBeenWoven() {
return hasBeenWoven;
}
@Override
public boolean copySourceContext() {
return false;
}
public void setExposedToWeaver(boolean b) {
exposedToWeaver = b;
}
@Override
public int getCompilerVersion() {
return wvInfo.getMajorVersion();
}
public void ensureConsistent() {
superTypeReference.clear();
superInterfaceReferences.clear();
}
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
/* *******************************************************************
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PARC initial implementation
* Alexandre Vasseur perClause support for @AJ aspects
* ******************************************************************/
package org.aspectj.weaver.bcel;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Modifier;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
import java.util.Map;
import java.util.StringTokenizer;
import org.aspectj.apache.bcel.Constants;
import org.aspectj.apache.bcel.classfile.ClassParser;
import org.aspectj.apache.bcel.classfile.ConstantPool;
import org.aspectj.apache.bcel.classfile.JavaClass;
import org.aspectj.apache.bcel.generic.FieldInstruction;
import org.aspectj.apache.bcel.generic.INVOKEINTERFACE;
import org.aspectj.apache.bcel.generic.Instruction;
import org.aspectj.apache.bcel.generic.InstructionHandle;
import org.aspectj.apache.bcel.generic.InvokeInstruction;
import org.aspectj.apache.bcel.generic.MULTIANEWARRAY;
import org.aspectj.apache.bcel.generic.ObjectType;
import org.aspectj.apache.bcel.generic.Type;
import org.aspectj.apache.bcel.util.ClassLoaderReference;
import org.aspectj.apache.bcel.util.ClassLoaderRepository;
import org.aspectj.apache.bcel.util.ClassPath;
import org.aspectj.apache.bcel.util.NonCachingClassLoaderRepository;
import org.aspectj.apache.bcel.util.Repository;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IRelationship;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.WeaveMessage;
import org.aspectj.weaver.Advice;
import org.aspectj.weaver.AdviceKind;
import org.aspectj.weaver.AnnotationAJ;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
import org.aspectj.weaver.AnnotationOnTypeMunger;
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.Checker;
import org.aspectj.weaver.ICrossReferenceHandler;
import org.aspectj.weaver.IWeavingSupport;
import org.aspectj.weaver.Member;
import org.aspectj.weaver.MemberImpl;
import org.aspectj.weaver.MemberKind;
import org.aspectj.weaver.NewParentTypeMunger;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ReferenceTypeDelegate;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedMemberImpl;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.ResolvedTypeMunger;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.ShadowMunger;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.World;
import org.aspectj.weaver.loadtime.definition.Definition;
import org.aspectj.weaver.loadtime.definition.DocumentParser;
import org.aspectj.weaver.model.AsmRelationshipProvider;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.DeclareParents;
import org.aspectj.weaver.patterns.ParserException;
import org.aspectj.weaver.patterns.PatternParser;
import org.aspectj.weaver.patterns.TypePattern;
import org.aspectj.weaver.tools.Trace;
import org.aspectj.weaver.tools.TraceFactory;
public class BcelWorld extends World implements Repository {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
private final ClassPathManager classPath;
protected Repository delegate;
private BcelWeakClassLoaderReference loaderRef;
private final BcelWeavingSupport bcelWeavingSupport = new BcelWeavingSupport();
private boolean isXmlConfiguredWorld = false;
private WeavingXmlConfig xmlConfiguration;
private static Trace trace = TraceFactory.getTraceFactory().getTrace(BcelWorld.class);
public BcelWorld() {
this("");
}
public BcelWorld(String cp) {
this(makeDefaultClasspath(cp), IMessageHandler.THROW, null);
}
public IRelationship.Kind determineRelKind(ShadowMunger munger) {
AdviceKind ak = ((Advice) munger).getKind();
if (ak.getKey() == AdviceKind.Before.getKey()) {
return IRelationship.Kind.ADVICE_BEFORE;
} else if (ak.getKey() == AdviceKind.After.getKey()) {
return IRelationship.Kind.ADVICE_AFTER;
} else if (ak.getKey() == AdviceKind.AfterThrowing.getKey()) {
return IRelationship.Kind.ADVICE_AFTERTHROWING;
} else if (ak.getKey() == AdviceKind.AfterReturning.getKey()) {
return IRelationship.Kind.ADVICE_AFTERRETURNING;
} else if (ak.getKey() == AdviceKind.Around.getKey()) {
return IRelationship.Kind.ADVICE_AROUND;
} else if (ak.getKey() == AdviceKind.CflowEntry.getKey() || ak.getKey() == AdviceKind.CflowBelowEntry.getKey()
|| ak.getKey() == AdviceKind.InterInitializer.getKey() || ak.getKey() == AdviceKind.PerCflowEntry.getKey()
|| ak.getKey() == AdviceKind.PerCflowBelowEntry.getKey() || ak.getKey() == AdviceKind.PerThisEntry.getKey()
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
|| ak.getKey() == AdviceKind.PerTargetEntry.getKey() || ak.getKey() == AdviceKind.Softener.getKey()
|| ak.getKey() == AdviceKind.PerTypeWithinEntry.getKey()) {
return null;
}
throw new RuntimeException("Shadow.determineRelKind: What the hell is it? " + ak);
}
@Override
public void reportMatch(ShadowMunger munger, Shadow shadow) {
if (getCrossReferenceHandler() != null) {
getCrossReferenceHandler().addCrossReference(munger.getSourceLocation(),
shadow.getSourceLocation(),
determineRelKind(munger).getName(),
((Advice) munger).hasDynamicTests()
);
}
if (!getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) {
reportWeavingMessage(munger, shadow);
}
if (getModel() != null) {
AsmRelationshipProvider.addAdvisedRelationship(getModelAsAsmManager(), shadow, munger);
}
}
/*
* Report a message about the advice weave that has occurred. Some messing about to make it pretty ! This code is just asking
* for an NPE to occur ...
*/
private void reportWeavingMessage(ShadowMunger munger, Shadow shadow) {
Advice advice = (Advice) munger;
AdviceKind aKind = advice.getKind();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
if (aKind == null || advice.getConcreteAspect() == null) {
return;
}
if (!(aKind.equals(AdviceKind.Before) || aKind.equals(AdviceKind.After) || aKind.equals(AdviceKind.AfterReturning)
|| aKind.equals(AdviceKind.AfterThrowing) || aKind.equals(AdviceKind.Around) || aKind.equals(AdviceKind.Softener))) {
return;
}
if (shadow.getKind() == Shadow.SynchronizationUnlock) {
if (advice.lastReportedMonitorExitJoinpointLocation == null) {
advice.lastReportedMonitorExitJoinpointLocation = shadow.getSourceLocation();
} else {
if (areTheSame(shadow.getSourceLocation(), advice.lastReportedMonitorExitJoinpointLocation)) {
advice.lastReportedMonitorExitJoinpointLocation = null;
return;
}
advice.lastReportedMonitorExitJoinpointLocation = shadow.getSourceLocation();
}
}
String description = advice.getKind().toString();
String advisedType = shadow.getEnclosingType().getName();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
String advisingType = advice.getConcreteAspect().getName();
Message msg = null;
if (advice.getKind().equals(AdviceKind.Softener)) {
msg = WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_SOFTENS, new String[] { advisedType,
beautifyLocation(shadow.getSourceLocation()), advisingType, beautifyLocation(munger.getSourceLocation()) },
advisedType, advisingType);
} else {
boolean runtimeTest = advice.hasDynamicTests();
String joinPointDescription = shadow.toString();
msg = WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ADVISES, new String[] { joinPointDescription,
advisedType, beautifyLocation(shadow.getSourceLocation()), description, advisingType,
beautifyLocation(munger.getSourceLocation()), (runtimeTest ? " [with runtime test]" : "") }, advisedType,
advisingType);
}
getMessageHandler().handleMessage(msg);
}
private boolean areTheSame(ISourceLocation locA, ISourceLocation locB) {
if (locA == null) {
return locB == null;
}
if (locB == null) {
return false;
}
if (locA.getLine() != locB.getLine()) {
return false;
}
File fA = locA.getSourceFile();
File fB = locA.getSourceFile();
if (fA == null) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
return fB == null;
}
if (fB == null) {
return false;
}
return fA.getName().equals(fB.getName());
}
/*
* Ensure we report a nice source location - particular in the case where the source info is missing (binary weave).
*/
private String beautifyLocation(ISourceLocation isl) {
StringBuffer nice = new StringBuffer();
if (isl == null || isl.getSourceFile() == null || isl.getSourceFile().getName().indexOf("no debug info available") != -1) {
nice.append("no debug info available");
} else {
int takeFrom = isl.getSourceFile().getPath().lastIndexOf('/');
if (takeFrom == -1) {
takeFrom = isl.getSourceFile().getPath().lastIndexOf('\\');
}
int binary = isl.getSourceFile().getPath().lastIndexOf('!');
if (binary != -1 && binary < takeFrom) {
String pathToBinaryLoc = isl.getSourceFile().getPath().substring(0, binary + 1);
if (pathToBinaryLoc.indexOf(".jar") != -1) {
int lastSlash = pathToBinaryLoc.lastIndexOf('/');
if (lastSlash == -1) {
lastSlash = pathToBinaryLoc.lastIndexOf('\\');
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
nice.append(pathToBinaryLoc.substring(lastSlash + 1));
}
}
nice.append(isl.getSourceFile().getPath().substring(takeFrom + 1));
if (isl.getLine() != 0) {
nice.append(":").append(isl.getLine());
}
if (isl.getSourceFileName() != null) {
nice.append("(from " + isl.getSourceFileName() + ")");
}
}
return nice.toString();
}
private static List<String> makeDefaultClasspath(String cp) {
List<String> classPath = new ArrayList<String>();
classPath.addAll(getPathEntries(cp));
classPath.addAll(getPathEntries(ClassPath.getClassPath()));
return classPath;
}
private static List<String> getPathEntries(String s) {
List<String> ret = new ArrayList<String>();
StringTokenizer tok = new StringTokenizer(s, File.pathSeparator);
while (tok.hasMoreTokens()) {
ret.add(tok.nextToken());
}
return ret;
}
public BcelWorld(List classPath, IMessageHandler handler, ICrossReferenceHandler xrefHandler) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
this.classPath = new ClassPathManager(classPath, handler);
setMessageHandler(handler);
setCrossReferenceHandler(xrefHandler);
delegate = this;
}
public BcelWorld(ClassPathManager cpm, IMessageHandler handler, ICrossReferenceHandler xrefHandler) {
classPath = cpm;
setMessageHandler(handler);
setCrossReferenceHandler(xrefHandler);
delegate = this;
}
/**
* Build a World from a ClassLoader, for LTW support
*
* @param loader
* @param handler
* @param xrefHandler
*/
public BcelWorld(ClassLoader loader, IMessageHandler handler, ICrossReferenceHandler xrefHandler) {
classPath = null;
loaderRef = new BcelWeakClassLoaderReference(loader);
setMessageHandler(handler);
setCrossReferenceHandler(xrefHandler);
}
public void ensureRepositorySetup() {
if (delegate == null) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
delegate = getClassLoaderRepositoryFor(loaderRef);
}
}
public Repository getClassLoaderRepositoryFor(ClassLoaderReference loader) {
if (bcelRepositoryCaching) {
return new ClassLoaderRepository(loader);
} else {
return new NonCachingClassLoaderRepository(loader);
}
}
public void addPath(String name) {
classPath.addPath(name, this.getMessageHandler());
}
public static Type makeBcelType(UnresolvedType type) {
return Type.getType(type.getErasureSignature());
}
static Type[] makeBcelTypes(UnresolvedType[] types) {
Type[] ret = new Type[types.length];
for (int i = 0, len = types.length; i < len; i++) {
ret[i] = makeBcelType(types[i]);
}
return ret;
}
static String[] makeBcelTypesAsClassNames(UnresolvedType[] types) {
String[] ret = new String[types.length];
for (int i = 0, len = types.length; i < len; i++) {
ret[i] = types[i].getName();
}
return ret;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
}
public static UnresolvedType fromBcel(Type t) {
return UnresolvedType.forSignature(t.getSignature());
}
static UnresolvedType[] fromBcel(Type[] ts) {
UnresolvedType[] ret = new UnresolvedType[ts.length];
for (int i = 0, len = ts.length; i < len; i++) {
ret[i] = fromBcel(ts[i]);
}
return ret;
}
public ResolvedType resolve(Type t) {
return resolve(fromBcel(t));
}
@Override
protected ReferenceTypeDelegate resolveDelegate(ReferenceType ty) {
String name = ty.getName();
ensureAdvancedConfigurationProcessed();
JavaClass jc = lookupJavaClass(classPath, name);
if (jc == null) {
return null;
} else {
return buildBcelDelegate(ty, jc, false, false);
}
}
public BcelObjectType buildBcelDelegate(ReferenceType type, JavaClass jc, boolean artificial, boolean exposedToWeaver) {
BcelObjectType ret = new BcelObjectType(type, jc, artificial, exposedToWeaver);
return ret;
}
private JavaClass lookupJavaClass(ClassPathManager classPath, String name) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
if (classPath == null) {
try {
ensureRepositorySetup();
JavaClass jc = delegate.loadClass(name);
if (trace.isTraceEnabled()) {
trace.event("lookupJavaClass", this, new Object[] { name, jc });
}
return jc;
} catch (ClassNotFoundException e) {
if (trace.isTraceEnabled()) {
trace.error("Unable to find class '" + name + "' in repository", e);
}
return null;
}
}
ClassPathManager.ClassFile file = null;
try {
file = classPath.find(UnresolvedType.forName(name));
if (file == null) {
return null;
}
ClassParser parser = new ClassParser(file.getInputStream(), file.getPath());
JavaClass jc = parser.parse();
return jc;
} catch (IOException ioe) {
return null;
} finally {
if (file != null) {
file.close();
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
}
}
public BcelObjectType addSourceObjectType(JavaClass jc, boolean artificial) {
return addSourceObjectType(jc.getClassName(), jc, artificial);
}
public BcelObjectType addSourceObjectType(String classname, JavaClass jc, boolean artificial) {
BcelObjectType ret = null;
if (!jc.getClassName().equals(classname)) {
throw new RuntimeException(jc.getClassName() + "!=" + classname);
}
String signature = UnresolvedType.forName(jc.getClassName()).getSignature();
ResolvedType fromTheMap = typeMap.get(signature);
if (fromTheMap != null && !(fromTheMap instanceof ReferenceType)) {
StringBuffer exceptionText = new StringBuffer();
exceptionText.append("Found invalid (not a ReferenceType) entry in the type map. ");
exceptionText.append("Signature=[" + signature + "] Found=[" + fromTheMap + "] Class=[" + fromTheMap.getClass() + "]");
throw new BCException(exceptionText.toString());
}
ReferenceType nameTypeX = (ReferenceType) fromTheMap;
if (nameTypeX == null) {
if (jc.isGeneric() && isInJava5Mode()) {
nameTypeX = ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()), this);
ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, ret
.getDeclaredGenericSignature()), this);
nameTypeX.setDelegate(ret);
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
genericRefType.setDelegate(ret);
nameTypeX.setGenericType(genericRefType);
typeMap.put(signature, nameTypeX);
} else {
nameTypeX = new ReferenceType(signature, this);
ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
typeMap.put(signature, nameTypeX);
}
} else {
ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
}
return ret;
}
public BcelObjectType addSourceObjectType(String classname, byte[] bytes, boolean artificial) {
BcelObjectType ret = null;
String signature = UnresolvedType.forName(classname).getSignature();
ResolvedType fromTheMap = typeMap.get(signature);
if (fromTheMap != null && !(fromTheMap instanceof ReferenceType)) {
StringBuffer exceptionText = new StringBuffer();
exceptionText.append("Found invalid (not a ReferenceType) entry in the type map. ");
exceptionText.append("Signature=[" + signature + "] Found=[" + fromTheMap + "] Class=[" + fromTheMap.getClass() + "]");
throw new BCException(exceptionText.toString());
}
ReferenceType nameTypeX = (ReferenceType) fromTheMap;
if (nameTypeX == null) {
JavaClass jc = Utility.makeJavaClass(classname, bytes);
if (jc.isGeneric() && isInJava5Mode()) {
nameTypeX = ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()), this);
ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, ret
.getDeclaredGenericSignature()), this);
nameTypeX.setDelegate(ret);
genericRefType.setDelegate(ret);
nameTypeX.setGenericType(genericRefType);
typeMap.put(signature, nameTypeX);
} else {
nameTypeX = new ReferenceType(signature, this);
ret = buildBcelDelegate(nameTypeX, jc, artificial, true);
typeMap.put(signature, nameTypeX);
}
} else {
Object o = nameTypeX.getDelegate();
if (!(o instanceof BcelObjectType)) {
throw new IllegalStateException("For " + classname + " should be BcelObjectType, but is " + o.getClass());
}
ret = (BcelObjectType) o;
if (ret.isArtificial()) {
ret = buildBcelDelegate(nameTypeX, Utility.makeJavaClass(classname, bytes), artificial, true);
} else {
ret.setExposedToWeaver(true);
}
}
return ret;
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
void deleteSourceObjectType(UnresolvedType ty) {
typeMap.remove(ty.getSignature());
}
public static Member makeFieldJoinPointSignature(LazyClassGen cg, FieldInstruction fi) {
ConstantPool cpg = cg.getConstantPool();
return MemberImpl.field(fi.getClassName(cpg),
(fi.opcode == Constants.GETSTATIC || fi.opcode == Constants.PUTSTATIC) ? Modifier.STATIC : 0, fi.getName(cpg), fi
.getSignature(cpg));
}
public Member makeJoinPointSignatureFromMethod(LazyMethodGen mg, MemberKind kind) {
Member ret = mg.getMemberView();
if (ret == null) {
int mods = mg.getAccessFlags();
if (mg.getEnclosingClass().isInterface()) {
mods |= Modifier.INTERFACE;
}
return new ResolvedMemberImpl(kind, UnresolvedType.forName(mg.getClassName()), mods, fromBcel(mg.getReturnType()), mg
.getName(), fromBcel(mg.getArgumentTypes()));
} else {
return ret;
}
}
public Member makeJoinPointSignatureForMonitorEnter(LazyClassGen cg, InstructionHandle h) {
return MemberImpl.monitorEnter();
}
public Member makeJoinPointSignatureForMonitorExit(LazyClassGen cg, InstructionHandle h) {
return MemberImpl.monitorExit();
}
public Member makeJoinPointSignatureForArrayConstruction(LazyClassGen cg, InstructionHandle handle) {
Instruction i = handle.getInstruction();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
ConstantPool cpg = cg.getConstantPool();
Member retval = null;
if (i.opcode == Constants.ANEWARRAY) {
Type ot = i.getType(cpg);
UnresolvedType ut = fromBcel(ot);
ut = UnresolvedType.makeArray(ut, 1);
retval = MemberImpl.method(ut, Modifier.PUBLIC, ResolvedType.VOID, "<init>", new ResolvedType[] { ResolvedType.INT });
} else if (i instanceof MULTIANEWARRAY) {
MULTIANEWARRAY arrayInstruction = (MULTIANEWARRAY) i;
UnresolvedType ut = null;
short dimensions = arrayInstruction.getDimensions();
ObjectType ot = arrayInstruction.getLoadClassType(cpg);
if (ot != null) {
ut = fromBcel(ot);
ut = UnresolvedType.makeArray(ut, dimensions);
} else {
Type t = arrayInstruction.getType(cpg);
ut = fromBcel(t);
}
ResolvedType[] parms = new ResolvedType[dimensions];
for (int ii = 0; ii < dimensions; ii++) {
parms[ii] = ResolvedType.INT;
}
retval = MemberImpl.method(ut, Modifier.PUBLIC, ResolvedType.VOID, "<init>", parms);
} else if (i.opcode == Constants.NEWARRAY) {
Type ot = i.getType();
UnresolvedType ut = fromBcel(ot);
retval = MemberImpl.method(ut, Modifier.PUBLIC, ResolvedType.VOID, "<init>", new ResolvedType[] { ResolvedType.INT });
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
} else {
throw new BCException("Cannot create array construction signature for this non-array instruction:" + i);
}
return retval;
}
public Member makeJoinPointSignatureForMethodInvocation(LazyClassGen cg, InvokeInstruction ii) {
ConstantPool cpg = cg.getConstantPool();
String name = ii.getName(cpg);
String declaring = ii.getClassName(cpg);
UnresolvedType declaringType = null;
String signature = ii.getSignature(cpg);
int modifier = (ii instanceof INVOKEINTERFACE) ? Modifier.INTERFACE
: (ii.opcode == Constants.INVOKESTATIC) ? Modifier.STATIC : (ii.opcode == Constants.INVOKESPECIAL && !name
.equals("<init>")) ? Modifier.PRIVATE : 0;
if (ii.opcode == Constants.INVOKESTATIC) {
ResolvedType appearsDeclaredBy = resolve(declaring);
for (Iterator<ResolvedMember> iterator = appearsDeclaredBy.getMethods(true, true); iterator.hasNext();) {
ResolvedMember method = iterator.next();
if (Modifier.isStatic(method.getModifiers())) {
if (name.equals(method.getName()) && signature.equals(method.getSignature())) {
declaringType = method.getDeclaringType();
break;
}
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
}
}
if (declaringType == null) {
if (declaring.charAt(0) == '[') {
declaringType = UnresolvedType.forSignature(declaring);
} else {
declaringType = UnresolvedType.forName(declaring);
}
}
return MemberImpl.method(declaringType, modifier, name, signature);
}
@Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("BcelWorld(");
buf.append(")");
return buf.toString();
}
/**
* Retrieve a bcel delegate for an aspect - this will return NULL if the delegate is an EclipseSourceType and not a
* BcelObjectType - this happens quite often when incrementally compiling.
*/
public static BcelObjectType getBcelObjectType(ResolvedType concreteAspect) {
if (concreteAspect == null) {
return null;
}
if (!(concreteAspect instanceof ReferenceType)) {
return null;
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
ReferenceTypeDelegate rtDelegate = ((ReferenceType) concreteAspect).getDelegate();
if (rtDelegate instanceof BcelObjectType) {
return (BcelObjectType) rtDelegate;
} else {
return null;
}
}
public void tidyUp() {
classPath.closeArchives();
typeMap.report();
ResolvedType.resetPrimitives();
}
public JavaClass findClass(String className) {
return lookupJavaClass(classPath, className);
}
public JavaClass loadClass(String className) throws ClassNotFoundException {
return lookupJavaClass(classPath, className);
}
public void storeClass(JavaClass clazz) {
}
public void removeClass(JavaClass clazz) {
throw new RuntimeException("Not implemented");
}
public JavaClass loadClass(Class clazz) throws ClassNotFoundException {
throw new RuntimeException("Not implemented");
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
public void clear() {
delegate.clear();
}
/**
* The aim of this method is to make sure a particular type is 'ok'. Some operations on the delegate for a type modify it and
* this method is intended to undo that... see pr85132
*/
@Override
public void validateType(UnresolvedType type) {
ResolvedType result = typeMap.get(type.getSignature());
if (result == null) {
return;
}
if (!result.isExposedToWeaver()) {
return;
}
result.ensureConsistent();
}
/**
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
* Apply a single declare parents - return true if we change the type
*/
private boolean applyDeclareParents(DeclareParents p, ResolvedType onType) {
boolean didSomething = false;
List newParents = p.findMatchingNewParents(onType, true);
if (!newParents.isEmpty()) {
didSomething = true;
BcelObjectType classType = BcelWorld.getBcelObjectType(onType);
for (Iterator j = newParents.iterator(); j.hasNext();) {
ResolvedType newParent = (ResolvedType) j.next();
onType.addParent(newParent);
ResolvedTypeMunger newParentMunger = new NewParentTypeMunger(newParent);
newParentMunger.setSourceLocation(p.getSourceLocation());
onType.addInterTypeMunger(new BcelTypeMunger(newParentMunger, getCrosscuttingMembersSet()
.findAspectDeclaringParents(p)), false);
}
}
return didSomething;
}
/**
* Apply a declare @type - return true if we change the type
*/
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
private boolean applyDeclareAtType(DeclareAnnotation decA, ResolvedType onType, boolean reportProblems) {
boolean didSomething = false;
if (decA.matches(onType)) {
if (onType.hasAnnotation(decA.getAnnotation().getType())) {
return false;
}
AnnotationAJ annoX = decA.getAnnotation();
boolean isOK = checkTargetOK(decA, onType, annoX);
if (isOK) {
didSomething = true;
ResolvedTypeMunger newAnnotationTM = new AnnotationOnTypeMunger(annoX);
newAnnotationTM.setSourceLocation(decA.getSourceLocation());
onType.addInterTypeMunger(new BcelTypeMunger(newAnnotationTM, decA.getAspect().resolve(this)), false);
decA.copyAnnotationTo(onType);
}
}
return didSomething;
}
/**
* Checks for an @target() on the annotation and if found ensures it allows the annotation to be attached to the target type
* that matched.
*/
private boolean checkTargetOK(DeclareAnnotation decA, ResolvedType onType, AnnotationAJ annoX) {
if (annoX.specifiesTarget()) {
if ((onType.isAnnotation() && !annoX.allowedOnAnnotationType()) || (!annoX.allowedOnRegularType())) {
return false;
}
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
return true;
}
protected void weaveInterTypeDeclarations(ResolvedType onType) {
List<DeclareParents> declareParentsList = getCrosscuttingMembersSet().getDeclareParents();
if (onType.isRawType()) {
onType = onType.getGenericType();
}
onType.clearInterTypeMungers();
List<DeclareParents> decpToRepeat = new ArrayList<DeclareParents>();
boolean aParentChangeOccurred = false;
boolean anAnnotationChangeOccurred = false;
for (Iterator<DeclareParents> i = declareParentsList.iterator(); i.hasNext();) {
DeclareParents decp = i.next();
boolean typeChanged = applyDeclareParents(decp, onType);
if (typeChanged) {
aParentChangeOccurred = true;
} else {
if (!decp.getChild().isStarAnnotation()) {
decpToRepeat.add(decp);
}
}
}
for (Iterator i = getCrosscuttingMembersSet().getDeclareAnnotationOnTypes().iterator(); i.hasNext();) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
DeclareAnnotation decA = (DeclareAnnotation) i.next();
boolean typeChanged = applyDeclareAtType(decA, onType, true);
if (typeChanged) {
anAnnotationChangeOccurred = true;
}
}
while ((aParentChangeOccurred || anAnnotationChangeOccurred) && !decpToRepeat.isEmpty()) {
anAnnotationChangeOccurred = aParentChangeOccurred = false;
List<DeclareParents> decpToRepeatNextTime = new ArrayList<DeclareParents>();
for (Iterator<DeclareParents> iter = decpToRepeat.iterator(); iter.hasNext();) {
DeclareParents decp = iter.next();
boolean typeChanged = applyDeclareParents(decp, onType);
if (typeChanged) {
aParentChangeOccurred = true;
} else {
decpToRepeatNextTime.add(decp);
}
}
for (Iterator iter = getCrosscuttingMembersSet().getDeclareAnnotationOnTypes().iterator(); iter.hasNext();) {
DeclareAnnotation decA = (DeclareAnnotation) iter.next();
boolean typeChanged = applyDeclareAtType(decA, onType, false);
if (typeChanged) {
anAnnotationChangeOccurred = true;
}
}
decpToRepeat = decpToRepeatNextTime;
}
}
@Override
public IWeavingSupport getWeavingSupport() {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
return bcelWeavingSupport;
}
@Override
public void reportCheckerMatch(Checker checker, Shadow shadow) {
IMessage iMessage = new Message(checker.getMessage(shadow), shadow.toString(), checker.isError() ? IMessage.ERROR
: IMessage.WARNING, shadow.getSourceLocation(), null, new ISourceLocation[] { checker.getSourceLocation() }, true,
0, -1, -1);
getMessageHandler().handleMessage(iMessage);
if (getCrossReferenceHandler() != null) {
getCrossReferenceHandler()
.addCrossReference(
checker.getSourceLocation(),
shadow.getSourceLocation(),
(checker.isError() ? IRelationship.Kind.DECLARE_ERROR.getName() : IRelationship.Kind.DECLARE_WARNING
.getName()), false);
}
if (getModel() != null) {
AsmRelationshipProvider.addDeclareErrorOrWarningRelationship(getModelAsAsmManager(), shadow, checker);
}
}
public AsmManager getModelAsAsmManager() {
return (AsmManager) getModel();
}
void raiseError(String message) {
getMessageHandler().handleMessage(MessageUtil.error(message));
}
/**
* These are aop.xml files that can be used to alter the aspects that actually apply from those passed in - and also their scope
* of application to other files in the system.
*
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
* @param xmlFiles list of File objects representing any aop.xml files passed in to configure the build process
*/
public void setXmlFiles(List<File> xmlFiles) {
if (!isXmlConfiguredWorld && !xmlFiles.isEmpty()) {
raiseError("xml configuration files only supported by the compiler when -xmlConfigured option specified");
return;
}
if (!xmlFiles.isEmpty()) {
xmlConfiguration = new WeavingXmlConfig(this, WeavingXmlConfig.MODE_COMPILE);
}
for (File xmlfile : xmlFiles) {
try {
Definition d = DocumentParser.parse(xmlfile.toURI().toURL());
xmlConfiguration.add(d);
} catch (MalformedURLException e) {
raiseError("Unexpected problem processing XML config file '" + xmlfile.getName() + "' :" + e.getMessage());
} catch (Exception e) {
raiseError("Unexpected problem processing XML config file '" + xmlfile.getName() + "' :" + e.getMessage());
}
}
}
/**
* Add a scoped aspects where the scoping was defined in an aop.xml file and this world is being used in a LTW configuration
*/
public void addScopedAspect(String name, String scope) {
this.isXmlConfiguredWorld = true;
if (xmlConfiguration == null) {
xmlConfiguration = new WeavingXmlConfig(this, WeavingXmlConfig.MODE_LTW);
}
xmlConfiguration.addScopedAspect(name, scope);
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
}
public void setXmlConfigured(boolean b) {
this.isXmlConfiguredWorld = b;
}
@Override
public boolean isXmlConfigured() {
return isXmlConfiguredWorld && xmlConfiguration != null;
}
public WeavingXmlConfig getXmlConfiguration() {
return xmlConfiguration;
}
@Override
public boolean isAspectIncluded(ResolvedType aspectType) {
if (!isXmlConfigured()) {
return true;
}
return xmlConfiguration.specifiesInclusionOfAspect(aspectType.getName());
}
@Override
public TypePattern getAspectScope(ResolvedType declaringType) {
return xmlConfiguration.getScopeFor(declaringType.getName());
}
/**
* A WeavingXmlConfig is initially a collection of definitions from XML files - once the world is ready and weaving is running
* it will initialize and transform those definitions into an optimized set of values (eg. resolve type patterns and string
* names to real entities). It can then answer questions quickly: (1) is this aspect included in the weaving? (2) Is there a
* scope specified for this aspect and does it include type X?
*
*/
static class WeavingXmlConfig {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
final static int MODE_COMPILE = 1;
final static int MODE_LTW = 2;
private int mode;
private boolean initialized = false;
private List<Definition> definitions = new ArrayList<Definition>();
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
private List<String> resolvedIncludedAspects = new ArrayList<String>();
private Map<String, TypePattern> scopes = new HashMap<String, TypePattern>();
private List<String> includedFastMatchPatterns = Collections.emptyList();
private List<TypePattern> includedPatterns = Collections.emptyList();
private List<String> excludedFastMatchPatterns = Collections.emptyList();
private List<TypePattern> excludedPatterns = Collections.emptyList();
private BcelWorld world;
public WeavingXmlConfig(BcelWorld bcelWorld, int mode) {
this.world = bcelWorld;
this.mode = mode;
}
public void add(Definition d) {
definitions.add(d);
}
public void addScopedAspect(String aspectName, String scope) {
ensureInitialized();
resolvedIncludedAspects.add(aspectName);
try {
TypePattern scopePattern = new PatternParser(scope).parseTypePattern();
scopePattern.resolve(world);
scopes.put(aspectName, scopePattern);
if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) {
world.getMessageHandler().handleMessage(
MessageUtil.info("Aspect '" + aspectName + "' is scoped to apply against types matching pattern '"
+ scopePattern.toString() + "'"));
}
} catch (Exception e) {
world.getMessageHandler().handleMessage(
MessageUtil.error("Unable to parse scope as type pattern. Scope was '" + scope + "': " + e.getMessage()));
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
}
}
public void ensureInitialized() {
if (!initialized) {
try {
resolvedIncludedAspects = new ArrayList<String>();
for (Definition definition : definitions) {
List<String> aspectNames = definition.getAspectClassNames();
for (String name : aspectNames) {
resolvedIncludedAspects.add(name);
String scope = definition.getScopeForAspect(name);
if (scope != null) {
try {
TypePattern scopePattern = new PatternParser(scope).parseTypePattern();
scopePattern.resolve(world);
scopes.put(name, scopePattern);
if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) {
world.getMessageHandler().handleMessage(
MessageUtil.info("Aspect '" + name
+ "' is scoped to apply against types matching pattern '"
+ scopePattern.toString() + "'"));
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
}
} catch (Exception e) {
world.getMessageHandler().handleMessage(
MessageUtil.error("Unable to parse scope as type pattern. Scope was '" + scope + "': "
+ e.getMessage()));
}
}
}
try {
List<String> includePatterns = definition.getIncludePatterns();
if (includePatterns.size() > 0) {
includedPatterns = new ArrayList<TypePattern>();
includedFastMatchPatterns = new ArrayList<String>();
}
for (String includePattern : includePatterns) {
if (includePattern.endsWith("..*")) {
includedFastMatchPatterns.add(includePattern.substring(0, includePattern.length() - 2));
} else {
TypePattern includedPattern = new PatternParser(includePattern).parseTypePattern();
includedPatterns.add(includedPattern);
}
}
List<String> excludePatterns = definition.getExcludePatterns();
if (excludePatterns.size() > 0) {
excludedPatterns = new ArrayList<TypePattern>();
excludedFastMatchPatterns = new ArrayList<String>();
}
for (String excludePattern : excludePatterns) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
if (excludePattern.endsWith("..*")) {
excludedFastMatchPatterns.add(excludePattern.substring(0, excludePattern.length() - 2));
} else {
TypePattern excludedPattern = new PatternParser(excludePattern).parseTypePattern();
excludedPatterns.add(excludedPattern);
}
}
} catch (ParserException pe) {
world.getMessageHandler().handleMessage(
MessageUtil.error("Unable to parse type pattern: " + pe.getMessage()));
}
}
} finally {
initialized = true;
}
}
}
public boolean specifiesInclusionOfAspect(String name) {
ensureInitialized();
return resolvedIncludedAspects.contains(name);
}
public TypePattern getScopeFor(String name) {
return scopes.get(name);
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java
|
public boolean excludesType(ResolvedType type) {
if (mode == MODE_LTW) {
return false;
}
String typename = type.getName();
boolean excluded = false;
for (String excludedPattern : excludedFastMatchPatterns) {
if (typename.startsWith(excludedPattern)) {
excluded = true;
break;
}
}
if (!excluded) {
for (TypePattern excludedPattern : excludedPatterns) {
if (excludedPattern.matchesStatically(type)) {
excluded = true;
break;
}
}
}
return excluded;
}
}
public TypeMap getTypeMap() {
return typeMap;
}
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
/* *******************************************************************
* Copyright (c) 2004 IBM Corporation
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http:www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Matthew Webster, Adrian Colyer,
* Martin Lippert initial implementation
* ******************************************************************/
package org.aspectj.weaver.tools;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import org.aspectj.bridge.AbortException;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.IMessageContext;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.IMessageHolder;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageHandler;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.MessageWriter;
import org.aspectj.bridge.Version;
import org.aspectj.bridge.WeaveMessage;
import org.aspectj.bridge.IMessage.Kind;
import org.aspectj.util.FileUtil;
import org.aspectj.util.LangUtil;
import org.aspectj.weaver.IClassFileProvider;
import org.aspectj.weaver.IUnwovenClassFile;
import org.aspectj.weaver.IWeaveRequestor;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.World;
import org.aspectj.weaver.bcel.BcelObjectType;
import org.aspectj.weaver.bcel.BcelWeaver;
import org.aspectj.weaver.bcel.BcelWorld;
import org.aspectj.weaver.bcel.UnwovenClassFile;
/**
* This adaptor allows the AspectJ compiler to be embedded in an existing system to facilitate load-time weaving. It provides an
* interface for a weaving class loader to provide a classpath to be woven by a set of aspects. A callback is supplied to allow a
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
* class loader to define classes generated by the compiler during the weaving process.
* <p>
* A weaving class loader should create a <code>WeavingAdaptor</code> before any classes are defined, typically during construction.
* The set of aspects passed to the adaptor is fixed for the lifetime of the adaptor although the classpath can be augmented. A
* system property can be set to allow verbose weaving messages to be written to the console.
*
*/
public class WeavingAdaptor implements IMessageContext {
/**
* System property used to turn on verbose weaving messages
*/
public static final String WEAVING_ADAPTOR_VERBOSE = "aj.weaving.verbose";
public static final String SHOW_WEAVE_INFO_PROPERTY = "org.aspectj.weaver.showWeaveInfo";
public static final String TRACE_MESSAGES_PROPERTY = "org.aspectj.tracing.messages";
private boolean enabled = false;
protected boolean verbose = getVerbose();
protected BcelWorld bcelWorld;
protected BcelWeaver weaver;
private IMessageHandler messageHandler;
private WeavingAdaptorMessageHolder messageHolder;
private boolean abortOnError = false;
protected GeneratedClassHandler generatedClassHandler;
protected Map generatedClasses = new HashMap();
public BcelObjectType delegateForCurrentClass;
private boolean haveWarnedOnJavax = false;
private int weavingSpecialTypes = 0;
private static final int INITIALIZED = 0x1;
private static final int WEAVE_JAVA_PACKAGE = 0x2;
private static final int WEAVE_JAVAX_PACKAGE = 0x4;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
private static Trace trace = TraceFactory.getTraceFactory().getTrace(WeavingAdaptor.class);
protected WeavingAdaptor() {
}
/**
* Construct a WeavingAdaptor with a reference to a weaving class loader. The adaptor will automatically search the class loader
* hierarchy to resolve classes. The adaptor will also search the hierarchy for WeavingClassLoader instances to determine the
* set of aspects to be used ofr weaving.
*
* @param loader instance of <code>ClassLoader</code>
*/
public WeavingAdaptor(WeavingClassLoader loader) {
generatedClassHandler = loader;
init(getFullClassPath((ClassLoader) loader), getFullAspectPath((ClassLoader) loader));
}
/**
* Construct a WeavingAdator with a reference to a <code>GeneratedClassHandler</code>, a full search path for resolving classes
* and a complete set of aspects. The search path must include classes loaded by the class loader constructing the
* WeavingAdaptor and all its parents in the hierarchy.
*
* @param handler <code>GeneratedClassHandler</code>
* @param classURLs the URLs from which to resolve classes
* @param aspectURLs the aspects used to weave classes defined by this class loader
*/
public WeavingAdaptor(GeneratedClassHandler handler, URL[] classURLs, URL[] aspectURLs) {
generatedClassHandler = handler;
init(FileUtil.makeClasspath(classURLs), FileUtil.makeClasspath(aspectURLs));
}
private List getFullClassPath(ClassLoader loader) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
List list = new LinkedList();
for (; loader != null; loader = loader.getParent()) {
if (loader instanceof URLClassLoader) {
URL[] urls = ((URLClassLoader) loader).getURLs();
list.addAll(0, FileUtil.makeClasspath(urls));
} else {
warn("cannot determine classpath");
}
}
list.addAll(0, makeClasspath(System.getProperty("sun.boot.class.path")));
return list;
}
private List getFullAspectPath(ClassLoader loader) {
List list = new LinkedList();
for (; loader != null; loader = loader.getParent()) {
if (loader instanceof WeavingClassLoader) {
URL[] urls = ((WeavingClassLoader) loader).getAspectURLs();
list.addAll(0, FileUtil.makeClasspath(urls));
}
}
return list;
}
private static boolean getVerbose() {
return Boolean.getBoolean(WEAVING_ADAPTOR_VERBOSE);
}
private void init(List classPath, List aspectPath) {
abortOnError = true;
createMessageHandler();
info("using classpath: " + classPath);
info("using aspectpath: " + aspectPath);
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
bcelWorld = new BcelWorld(classPath, messageHandler, null);
bcelWorld.setXnoInline(false);
bcelWorld.getLint().loadDefaultProperties();
if (LangUtil.is15VMOrGreater()) {
bcelWorld.setBehaveInJava5Way(true);
}
weaver = new BcelWeaver(bcelWorld);
registerAspectLibraries(aspectPath);
enabled = true;
}
protected void createMessageHandler() {
messageHolder = new WeavingAdaptorMessageHolder(new PrintWriter(System.err));
messageHandler = messageHolder;
if (verbose) {
messageHandler.dontIgnore(IMessage.INFO);
}
if (Boolean.getBoolean(SHOW_WEAVE_INFO_PROPERTY)) {
messageHandler.dontIgnore(IMessage.WEAVEINFO);
}
info("AspectJ Weaver Version " + Version.text + " built on " + Version.time_text);
}
protected IMessageHandler getMessageHandler() {
return messageHandler;
}
public IMessageHolder getMessageHolder() {
return messageHolder;
}
protected void setMessageHandler(IMessageHandler mh) {
if (mh instanceof ISupportsMessageContext) {
ISupportsMessageContext smc = (ISupportsMessageContext) mh;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
smc.setMessageContext(this);
}
if (mh != messageHolder) {
messageHolder.setDelegate(mh);
}
messageHolder.flushMessages();
}
protected void disable() {
if (trace.isTraceEnabled()) {
trace.enter("disable", this);
}
enabled = false;
messageHolder.flushMessages();
if (trace.isTraceEnabled()) {
trace.exit("disable");
}
}
protected void enable() {
enabled = true;
messageHolder.flushMessages();
}
protected boolean isEnabled() {
return enabled;
}
/**
* Appends URL to path used by the WeavingAdptor to resolve classes
*
* @param url to be appended to search path
*/
public void addURL(URL url) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
File libFile = new File(url.getPath());
try {
weaver.addLibraryJarFile(libFile);
} catch (IOException ex) {
warn("bad library: '" + libFile + "'");
}
}
/**
* Weave a class using aspects previously supplied to the adaptor.
*
* @param name the name of the class
* @param bytes the class bytes
* @return the woven bytes
* @exception IOException weave failed
*/
public byte[] weaveClass(String name, byte[] bytes) throws IOException {
return weaveClass(name, bytes, false);
}
private ThreadLocal<Boolean> weaverRunning = new ThreadLocal<Boolean>() {
@Override
protected Boolean initialValue() {
return Boolean.FALSE;
}
};
/**
* Weave a class using aspects previously supplied to the adaptor.
*
* @param name the name of the class
* @param bytes the class bytes
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
* @param mustWeave if true then this class *must* get woven (used for concrete aspects generated from XML)
* @return the woven bytes
* @exception IOException weave failed
*/
public byte[] weaveClass(String name, byte[] bytes, boolean mustWeave) throws IOException {
if (trace==null) {
System.err.println("AspectJ Weaver cannot continue to weave, static state has been cleared. Are you under Tomcat? In order to weave '"+name+
"' during shutdown, 'org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false' must be set (see https:bugs.eclipse.org/bugs/show_bug.cgi?id=231945).");
return bytes;
}
if (weaverRunning.get()) {
return bytes;
}
try {
weaverRunning.set(true);
if (trace.isTraceEnabled()) {
trace.enter("weaveClass", this, new Object[] { name, bytes });
}
if (!enabled) {
if (trace.isTraceEnabled()) {
trace.exit("weaveClass", false);
}
return bytes;
}
boolean debugOn = !messageHandler.isIgnoring(Message.DEBUG);
try {
delegateForCurrentClass = null;
name = name.replace('/', '.');
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
if (couldWeave(name, bytes)) {
if (accept(name, bytes)) {
if (debugOn) {
debug("weaving '" + name + "'");
}
bytes = getWovenBytes(name, bytes);
}
}
}
} else if (debugOn) {
debug("not weaving '" + name + "'");
}
} else if (debugOn) {
debug("cannot weave '" + name + "'");
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
} finally {
delegateForCurrentClass = null;
}
if (trace.isTraceEnabled()) {
trace.exit("weaveClass", bytes);
}
return bytes;
} finally {
weaverRunning.set(false);
}
}
/**
* @param name
* @return true if even valid to weave: either with an accept check or to munge it for @AspectJ aspectof support
*/
private boolean couldWeave(String name, byte[] bytes) {
return !generatedClasses.containsKey(name) && shouldWeaveName(name);
}
protected boolean accept(String name, byte[] bytes) {
return true;
}
protected boolean shouldDump(String name, boolean before) {
return false;
}
private boolean shouldWeaveName(String name) {
if ("osj".indexOf(name.charAt(0)) != -1) {
if ((weavingSpecialTypes & INITIALIZED) == 0) {
weavingSpecialTypes |= INITIALIZED;
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
Properties p = weaver.getWorld().getExtraConfiguration();
if (p != null) {
boolean b = p.getProperty(World.xsetWEAVE_JAVA_PACKAGES, "false").equalsIgnoreCase("true");
if (b) {
weavingSpecialTypes |= WEAVE_JAVA_PACKAGE;
}
b = p.getProperty(World.xsetWEAVE_JAVAX_PACKAGES, "false").equalsIgnoreCase("true");
if (b) {
weavingSpecialTypes |= WEAVE_JAVAX_PACKAGE;
}
}
}
if (name.startsWith("org.aspectj.")) {
return false;
}
if (name.startsWith("sun.reflect.")) {
return false;
}
if (name.startsWith("javax.")) {
if ((weavingSpecialTypes & WEAVE_JAVAX_PACKAGE) != 0) {
return true;
} else {
if (!haveWarnedOnJavax) {
haveWarnedOnJavax = true;
warn("javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified");
}
return false;
}
}
if (name.startsWith("java.")) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
if ((weavingSpecialTypes & WEAVE_JAVA_PACKAGE) != 0) {
return true;
} else {
return false;
}
}
}
return true;
}
/**
* We allow @AJ aspect weaving so that we can add aspectOf() as part of the weaving (and not part of the source compilation)
*
* @param name
* @param bytes bytecode (from classloader), allow to NOT lookup stuff on disk again during resolve
* @return true if @Aspect
*/
private boolean shouldWeaveAnnotationStyleAspect(String name, byte[] bytes) {
if (delegateForCurrentClass == null) {
ensureDelegateInitialized(name, bytes);
}
return (delegateForCurrentClass.isAnnotationStyleAspect());
}
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
}
}
protected void ensureDelegateInitialized(String name, byte[] bytes) {
if (delegateForCurrentClass == null) {
BcelWorld world = (BcelWorld) weaver.getWorld();
delegateForCurrentClass = world.addSourceObjectType(name, bytes, false);
}
}
/**
* Weave a set of bytes defining a class.
*
* @param name the name of the class being woven
* @param bytes the bytes that define the class
* @return byte[] the woven bytes for the class
* @throws IOException
*/
private byte[] getWovenBytes(String name, byte[] bytes) throws IOException {
WeavingClassFileProvider wcp = new WeavingClassFileProvider(name, bytes);
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
weaver.weave(wcp);
return wcp.getBytes();
}
/**
* Weave a set of bytes defining a class for only what is needed to turn @AspectJ aspect in a usefull form ie with aspectOf
* method - see #113587
*
* @param name the name of the class being woven
* @param bytes the bytes that define the class
* @return byte[] the woven bytes for the class
* @throws IOException
*/
private byte[] getAtAspectJAspectBytes(String name, byte[] bytes) throws IOException {
WeavingClassFileProvider wcp = new WeavingClassFileProvider(name, bytes);
wcp.setApplyAtAspectJMungersOnly();
weaver.weave(wcp);
return wcp.getBytes();
}
private void registerAspectLibraries(List aspectPath) {
for (Iterator i = aspectPath.iterator(); i.hasNext();) {
String libName = (String) i.next();
addAspectLibrary(libName);
}
weaver.prepareForWeave();
}
/*
* Register an aspect library with this classloader for use during weaving. This class loader will also return (unmodified) any
* of the classes in the library in response to a <code>findClass()</code> request. The library is not required to be on the
* weavingClasspath given when this classloader was constructed.
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
*
* @param aspectLibraryJarFile a jar file representing an aspect library
*
* @throws IOException
*/
private void addAspectLibrary(String aspectLibraryName) {
File aspectLibrary = new File(aspectLibraryName);
if (aspectLibrary.isDirectory() || (FileUtil.isZipFile(aspectLibrary))) {
try {
info("adding aspect library: '" + aspectLibrary + "'");
weaver.addLibraryJarFile(aspectLibrary);
} catch (IOException ex) {
error("exception adding aspect library: '" + ex + "'");
}
} else {
error("bad aspect library: '" + aspectLibrary + "'");
}
}
private static List makeClasspath(String cp) {
List ret = new ArrayList();
if (cp != null) {
StringTokenizer tok = new StringTokenizer(cp, File.pathSeparator);
while (tok.hasMoreTokens()) {
ret.add(tok.nextToken());
}
}
return ret;
}
protected boolean debug(String message) {
return MessageUtil.debug(messageHandler, message);
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
}
protected boolean info(String message) {
return MessageUtil.info(messageHandler, message);
}
protected boolean warn(String message) {
return MessageUtil.warn(messageHandler, message);
}
protected boolean warn(String message, Throwable th) {
return messageHandler.handleMessage(new Message(message, IMessage.WARNING, th, null));
}
protected boolean error(String message) {
return MessageUtil.error(messageHandler, message);
}
protected boolean error(String message, Throwable th) {
return messageHandler.handleMessage(new Message(message, IMessage.ERROR, th, null));
}
public String getContextId() {
return "WeavingAdaptor";
}
/**
* Dump the given bytcode in _dump/... (dev mode)
*
* @param name
* @param b
* @param before whether we are dumping before weaving
* @throws Throwable
*/
protected void dump(String name, byte[] b, boolean before) {
String dirName = getDumpDir();
if (before) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
dirName = dirName + File.separator + "_before";
}
String className = name.replace('.', '/');
final File dir;
if (className.indexOf('/') > 0) {
dir = new File(dirName + File.separator + className.substring(0, className.lastIndexOf('/')));
} else {
dir = new File(dirName);
}
dir.mkdirs();
String fileName = dirName + File.separator + className + ".class";
try {
FileOutputStream os = new FileOutputStream(fileName);
os.write(b);
os.close();
} catch (IOException ex) {
warn("unable to dump class " + name + " in directory " + dirName, ex);
}
}
/**
* @return the directory in which to dump - default is _ajdump but it
*/
protected String getDumpDir() {
return "_ajdump";
}
/**
* Processes messages arising from weaver operations. Tell weaver to abort on any message more severe than warning.
*/
protected class WeavingAdaptorMessageHolder extends MessageHandler {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
private IMessageHandler delegate;
private List savedMessages;
protected boolean traceMessages = Boolean.getBoolean(TRACE_MESSAGES_PROPERTY);
public WeavingAdaptorMessageHolder(PrintWriter writer) {
this.delegate = new WeavingAdaptorMessageWriter(writer);
super.dontIgnore(IMessage.WEAVEINFO);
}
private void traceMessage(IMessage message) {
if (message instanceof WeaveMessage) {
|
314,130 |
Bug 314130 [plan] [ltw] [hcr] LTW, Reweaving and Hot Code Replace changes reflected every two saves of files
| null |
resolved fixed
|
cf0ee0c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2010-05-26T22:31:02Z | 2010-05-24T16:53:20Z |
weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java
|
trace.debug(render(message));
} else if (message.isDebug()) {
trace.debug(render(message));
} else if (message.isInfo()) {
trace.info(render(message));
} else if (message.isWarning()) {
trace.warn(render(message), message.getThrown());
} else if (message.isError()) {
trace.error(render(message), message.getThrown());
} else if (message.isFailed()) {
trace.fatal(render(message), message.getThrown());
} else if (message.isAbort()) {
trace.fatal(render(message), message.getThrown());
} else {
trace.error(render(message), message.getThrown());
}
}
protected String render(IMessage message) {
return "[" + getContextId() + "] " + message.toString();
}
public void flushMessages() {
if (savedMessages == null) {
savedMessages = new ArrayList();
savedMessages.addAll(super.getUnmodifiableListView());
clearMessages();
for (Iterator iter = savedMessages.iterator(); iter.hasNext();) {
IMessage message = (IMessage) iter.next();
delegate.handleMessage(message);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.