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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
List warnings = MyTaskListManager.getWarningMessages();
List noGuardWarnings = new ArrayList();
for (Iterator iter = warnings.iterator(); iter.hasNext();) {
IMessage element = (IMessage) iter.next();
if (element.getMessage().indexOf("Xlint:noGuardForLazyTjp") != -1) {
noGuardWarnings.add(element);
}
}
assertTrue("There should only be two Xlint:noGuardForLazyTjp warning message reported:\n"
+noGuardWarnings,noGuardWarnings.size() == 2);
}
public void testPr131505() {
configureNonStandardCompileOptions("-outxml");
initialiseProject("PR131505");
build("PR131505");
checkWasFullBuild();
checkXMLAspectCount("PR131505","",0);
alter("PR131505","inc1");
build("PR131505");
checkWasFullBuild();
checkXMLAspectCount("PR131505","",1);
checkXMLAspectCount("PR131505","A",1);
alter("PR131505","inc2");
build("PR131505");
checkWasntFullBuild();
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
checkXMLAspectCount("PR131505","",1);
checkXMLAspectCount("PR131505","A",1);
alter("PR131505","inc3");
build("PR131505");
checkWasFullBuild();
checkXMLAspectCount("PR131505","",2);
checkXMLAspectCount("PR131505","A1",1);
checkXMLAspectCount("PR131505","A",1);
File a1 = new File(getWorkingDir().getAbsolutePath()
+ File.separatorChar + "PR131505" + File.separatorChar + "A1.aj");
a1.delete();
build("PR131505");
checkWasFullBuild();
checkXMLAspectCount("PR131505","",1);
checkXMLAspectCount("PR131505","A1",0);
checkXMLAspectCount("PR131505","A",1);
alter("PR131505","inc4");
build("PR131505");
checkWasFullBuild();
checkXMLAspectCount("PR131505","",2);
checkXMLAspectCount("PR131505","A",1);
checkXMLAspectCount("PR131505","pkg.A",1);
}
public void testPr136585() {
initialiseProject("PR136585");
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
build("PR136585");
alter("PR136585","inc1");
build("PR136585");
assertTrue("There should be no errors reported:\n"+MyTaskListManager.getErrorMessages(),
MyTaskListManager.getErrorMessages().isEmpty());
}
public void testPr133532() {
initialiseProject("PR133532");
build("PR133532");
alter("PR133532","inc1");
build("PR133532");
alter("PR133532","inc2");
build("PR133532");
assertTrue("There should be no errors reported:\n"+MyTaskListManager.getErrorMessages(),
MyTaskListManager.getErrorMessages().isEmpty());
}
public void testPr133532_2() {
initialiseProject("pr133532_2");
build("pr133532_2");
alter("pr133532_2","inc2");
build("pr133532_2");
assertTrue("There should be no errors reported:\n"+MyTaskListManager.getErrorMessages(),
MyTaskListManager.getErrorMessages().isEmpty());
String decisions = AjdeInteractionTestbed.MyStateListener.getDecisions();
String expect="Need to recompile 'A.aj'";
assertTrue("Couldn't find build decision: '"+expect+"' in the list of decisions made:\n"+decisions,
decisions.indexOf(expect)!=-1);
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
public void testPr134541() {
initialiseProject("PR134541");
build("PR134541");
assertEquals("[Xlint:adviceDidNotMatch] should be associated with line 5",5,
((IMessage)MyTaskListManager.getWarningMessages().get(0)).getSourceLocation().getLine());
alter("PR134541","inc1");
build("PR134541");
if (AsmManager.getDefault().getHandleProvider().dependsOnLocation())
checkWasFullBuild();
else
checkWasntFullBuild();
assertEquals("[Xlint:adviceDidNotMatch] should now be associated with line 7",7,
((IMessage)MyTaskListManager.getWarningMessages().get(0)).getSourceLocation().getLine());
}
public void testJDTLikeHandleProviderWithLstFile_pr141730() {
IElementHandleProvider handleProvider = AsmManager.getDefault().getHandleProvider();
AsmManager.getDefault().setHandleProvider(new JDTLikeHandleProvider());
configureBuildStructureModel(true);
try {
initialiseProject("JDTLikeHandleProvider");
build("JDTLikeHandleProvider");
IHierarchy top = AsmManager.getDefault().getHierarchy();
IProgramElement pe = top.findElementForType("pkg","A");
String expectedHandle = "build<pkg*A.aj}A";
assertEquals("expected handle to be " + expectedHandle + ", but found "
+ pe.getHandleIdentifier(),expectedHandle,pe.getHandleIdentifier());
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
} finally {
AsmManager.getDefault().setHandleProvider(handleProvider);
configureBuildStructureModel(false);
}
}
public void testMovingAdviceDoesntChangeHandles_pr141730() {
IElementHandleProvider handleProvider = AsmManager.getDefault().getHandleProvider();
AsmManager.getDefault().setHandleProvider(new JDTLikeHandleProvider());
configureBuildStructureModel(true);
try {
initialiseProject("JDTLikeHandleProvider");
build("JDTLikeHandleProvider");
checkWasFullBuild();
IHierarchy top = AsmManager.getDefault().getHierarchy();
IProgramElement pe = top.findElementForLabel(top.getRoot(),
IProgramElement.Kind.ADVICE,"before(): <anonymous pointcut>");
alter("JDTLikeHandleProvider","inc1");
build("JDTLikeHandleProvider");
checkWasntFullBuild();
IHierarchy top2 = AsmManager.getDefault().getHierarchy();
IProgramElement pe2 = top.findElementForLabel(top2.getRoot(),
IProgramElement.Kind.ADVICE,"before(): <anonymous pointcut>");
assertEquals("expected advice to be on line " + pe.getSourceLocation().getLine() + 1
+ " but was on " + pe2.getSourceLocation().getLine(),
pe.getSourceLocation().getLine()+1,pe2.getSourceLocation().getLine());
assertEquals("expected advice to have handle " + pe.getHandleIdentifier()
+ " but found handle " + pe2.getHandleIdentifier(),
pe.getHandleIdentifier(),pe2.getHandleIdentifier());
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
} finally {
AsmManager.getDefault().setHandleProvider(handleProvider);
configureBuildStructureModel(false);
}
}
public void testSwappingAdviceAndHandles_pr141730() {
IElementHandleProvider handleProvider = AsmManager.getDefault().getHandleProvider();
AsmManager.getDefault().setHandleProvider(new JDTLikeHandleProvider());
configureBuildStructureModel(true);
try {
initialiseProject("JDTLikeHandleProvider");
build("JDTLikeHandleProvider");
IHierarchy top = AsmManager.getDefault().getHierarchy();
IProgramElement call = top.findElementForLabel(top.getRoot(),
IProgramElement.Kind.ADVICE, "after(): callPCD..");
IProgramElement exec = top.findElementForLabel(top.getRoot(),
IProgramElement.Kind.ADVICE, "after(): execPCD..");
alter("JDTLikeHandleProvider","inc2");
build("JDTLikeHandleProvider");
checkWasFullBuild();
IHierarchy top2 = AsmManager.getDefault().getHierarchy();
IProgramElement newCall = top2.findElementForLabel(top2.getRoot(),
IProgramElement.Kind.ADVICE, "after(): callPCD..");
IProgramElement newExec = top2.findElementForLabel(top2.getRoot(),
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
IProgramElement.Kind.ADVICE, "after(): execPCD..");
assertEquals("after swapping places, expected 'after(): callPCD..' " +
"to be on line " + newExec.getSourceLocation().getLine() +
" but was on line " + call.getSourceLocation().getLine(),
newExec.getSourceLocation().getLine(),
call.getSourceLocation().getLine());
assertEquals("after swapping places, expected 'after(): callPCD..' " +
"to have handle " + exec.getHandleIdentifier() +
" (because was full build) but had " + newCall.getHandleIdentifier(),
exec.getHandleIdentifier(), newCall.getHandleIdentifier());
} finally {
AsmManager.getDefault().setHandleProvider(handleProvider);
configureBuildStructureModel(false);
}
}
public void testInitializerCountForJDTLikeHandleProvider_pr141730() {
IElementHandleProvider handleProvider = AsmManager.getDefault().getHandleProvider();
AsmManager.getDefault().setHandleProvider(new JDTLikeHandleProvider());
configureBuildStructureModel(true);
try {
initialiseProject("JDTLikeHandleProvider");
build("JDTLikeHandleProvider");
String expected = "build<pkg*A.aj[C|1";
IHierarchy top = AsmManager.getDefault().getHierarchy();
IProgramElement init = top.findElementForLabel(top.getRoot(),
IProgramElement.Kind.INITIALIZER, "...");
assertEquals("expected initializers handle to be " + expected + "," +
" but found " + init.getHandleIdentifier(true),
expected,init.getHandleIdentifier(true));
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
alter("JDTLikeHandleProvider","inc2");
build("JDTLikeHandleProvider");
checkWasFullBuild();
IHierarchy top2 = AsmManager.getDefault().getHierarchy();
IProgramElement init2 = top2.findElementForLabel(top2.getRoot(),
IProgramElement.Kind.INITIALIZER, "...");
assertEquals("expected initializers handle to still be " + expected + "," +
" but found " + init2.getHandleIdentifier(true),
expected,init2.getHandleIdentifier(true));
} finally {
AsmManager.getDefault().setHandleProvider(handleProvider);
configureBuildStructureModel(false);
}
}
public void testPr134471_IncrementalCompilationAndModelUpdates() {
try {
configureBuildStructureModel(true);
configureNonStandardCompileOptions("-showWeaveInfo -emacssym");
initialiseProject("PR134471");
build("PR134471");
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
IProgramElement nodeForTypeA = checkForNode("pkg","A",true);
IProgramElement nodeForAdvice = findAdvice(nodeForTypeA);
List relatedElements = getRelatedElements(nodeForAdvice,1);
IProgramElement programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true)));
int line = programElement.getSourceLocation().getLine();
assertTrue("advice should be at line 7 - but is at line "+line,line==7);
alter("PR134471","inc1");
build("PR134471");
nodeForTypeA = checkForNode("pkg","A",true);
nodeForAdvice = findAdvice(nodeForTypeA);
relatedElements = getRelatedElements(nodeForAdvice,1);
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true)));
line = programElement.getSourceLocation().getLine();
assertTrue("advice should be at line 7 - but is at line "+line,line==7);
} finally {
}
}
public void testPr134471_MovingAdvice() {
configureBuildStructureModel(true);
configureNonStandardCompileOptions("-showWeaveInfo -emacssym");
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
initialiseProject("PR134471_2");
build("PR134471_2");
IProgramElement programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true)));
int line = programElement.getSourceLocation().getLine();
assertTrue("advice should be at line 7 - but is at line "+line,line==7);
alter("PR134471_2","inc1");
build("PR134471_2");
if (AsmManager.getDefault().getHandleProvider().dependsOnLocation())
checkWasFullBuild();
else
checkWasntFullBuild();
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true)));
line = programElement.getSourceLocation().getLine();
assertTrue("advice should be at line 11 - but is at line "+line,line==11);
}
public void testAddingAndRemovingDecwWithStructureModel() {
configureBuildStructureModel(true);
initialiseProject("P3");
build("P3");
alter("P3","inc1");
build("P3");
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
assertTrue("There should be no exceptions handled:\n"+MyErrorHandler.getErrorMessages(),
MyErrorHandler.getErrorMessages().isEmpty());
alter("P3","inc2");
build("P3");
assertTrue("There should be no exceptions handled:\n"+MyErrorHandler.getErrorMessages(),
MyErrorHandler.getErrorMessages().isEmpty());
configureBuildStructureModel(false);
}
public void testPr134471_IncrementallyRecompilingTheAffectedClass() {
try {
configureBuildStructureModel(true);
configureNonStandardCompileOptions("-showWeaveInfo -emacssym");
initialiseProject("PR134471");
build("PR134471");
IProgramElement programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true)));
int line = programElement.getSourceLocation().getLine();
assertTrue("advice should be at line 7 - but is at line "+line,line==7);
alter("PR134471","inc1");
build("PR134471");
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
IProgramElement nodeForTypeA = checkForNode("pkg","A",true);
IProgramElement nodeForAdvice = findAdvice(nodeForTypeA);
List relatedElements = getRelatedElements(nodeForAdvice,1);
alter("PR134471","inc2");
build("PR134471");
checkWasntFullBuild();
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true)));
line = programElement.getSourceLocation().getLine();
assertTrue("advice should be at line 7 - but is at line "+line,line==7);
} finally {
}
}
public void testPr134471_IncrementallyRecompilingAspectContainingDeclare() {
configureBuildStructureModel(true);
configureNonStandardCompileOptions("-showWeaveInfo -emacssym");
initialiseProject("PR134471_3");
build("PR134471_3");
checkWasFullBuild();
IProgramElement programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),7));
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
int line = programElement.getSourceLocation().getLine();
assertTrue("declare warning should be at line 10 - but is at line "+line,line==10);
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),6));
line = programElement.getSourceLocation().getLine();
assertTrue("advice should be at line 7 - but is at line "+line,line==7);
alter("PR134471_3","inc1");
build("PR134471_3");
if (AsmManager.getDefault().getHandleProvider().dependsOnLocation())
checkWasFullBuild();
else
checkWasntFullBuild();
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),7));
line = programElement.getSourceLocation().getLine();
assertTrue("declare warning should be at line 12 - but is at line "+line,line==12);
alter("PR134471_3","inc2");
build("PR134471_3");
checkWasntFullBuild();
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),7));
line = programElement.getSourceLocation().getLine();
assertTrue("declare warning should be at line 12 - but is at line "+line,line==12);
configureBuildStructureModel(false);
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
public void testPr134471_IncrementallyRecompilingTheClassAffectedByDeclare() {
configureBuildStructureModel(true);
configureNonStandardCompileOptions("-showWeaveInfo -emacssym");
initialiseProject("PR134471_3");
build("PR134471_3");
checkWasFullBuild();
IProgramElement programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),7));
int line = programElement.getSourceLocation().getLine();
assertTrue("declare warning should be at line 10 - but is at line "+line,line==10);
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),6));
line = programElement.getSourceLocation().getLine();
assertTrue("advice should be at line 7 - but is at line "+line,line==7);
alter("PR134471_3","inc1");
build("PR134471_3");
if (AsmManager.getDefault().getHandleProvider().dependsOnLocation())
checkWasFullBuild();
else
checkWasntFullBuild();
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),7));
line = programElement.getSourceLocation().getLine();
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
assertTrue("declare warning should be at line 12 - but is at line "+line,line==12);
alter("PR134471_3","inc2");
build("PR134471_3");
checkWasntFullBuild();
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),7));
line = programElement.getSourceLocation().getLine();
assertTrue("declare warning should be at line 12 - but is at line "+line,line==12);
alter("PR134471_3","inc3");
build("PR134471_3");
checkWasntFullBuild();
programElement = getFirstRelatedElement(findCode(checkForNode("pkg","C",true),7));
line = programElement.getSourceLocation().getLine();
assertTrue("declare warning should be at line 12 - but is at line "+line,line==12);
configureBuildStructureModel(false);
}
public void testDontLoseXlintWarnings_pr141556() {
configureNonStandardCompileOptions("-Xlint:warning");
initialiseProject("PR141556");
build("PR141556");
checkWasFullBuild();
String warningMessage = "can not build thisJoinPoint " +
"lazily for this advice since it has no suitable guard " +
"[Xlint:noGuardForLazyTjp]";
assertEquals("warning message should be '" + warningMessage + "'",
warningMessage,
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
((IMessage)MyTaskListManager.getWarningMessages().get(0))
.getMessage());
alter("PR141556","inc1");
alter("PR141556","inc2");
build("PR141556");
checkWasntFullBuild();
assertTrue("there should still be a warning message ",
!MyTaskListManager.getWarningMessages().isEmpty());
assertEquals("warning message should be '" + warningMessage + "'",
warningMessage,
((IMessage)MyTaskListManager.getWarningMessages().get(0))
.getMessage());
}
public void testLintMessage_pr141564() {
configureNonStandardCompileOptions("-Xlint:warning");
initialiseProject("PR141556");
build("PR141556");
IMessageHandler handler = AjdeManager.getMessageHandler();
assertFalse("expected the handler not to be an IMessageHolder but was ",
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
handler instanceof IMessageHolder);
List tasklistMessages = MyTaskListManager.getWarningMessages();
assertTrue("Should be one message but found "+tasklistMessages.size(),tasklistMessages.size()==1);
IMessage msg = (IMessage)tasklistMessages.get(0);
assertTrue("expected message to be a LintMessage but wasn't",
msg instanceof LintMessage);
assertTrue("expected message to be noGuardForLazyTjp xlint message but" +
" instead was " + ((LintMessage)msg).getKind().toString(),
((LintMessage)msg).getLintKind().equals("noGuardForLazyTjp"));
assertTrue("expected message to be against file in project 'PR141556' but wasn't",
msg.getSourceLocation().getSourceFile().getAbsolutePath().indexOf("PR141556") != -1);
}
public void testAdviceDidNotMatch_pr152589() {
initialiseProject("PR152589");
build("PR152589");
List warnings = MyTaskListManager.getWarningMessages();
assertTrue("There should be no warnings:\n"+warnings,
warnings.isEmpty());
alter("PR152589","inc1");
build("PR152589");
if (AsmManager.getDefault().getHandleProvider().dependsOnLocation())
checkWasFullBuild();
else
checkWasntFullBuild();
warnings = MyTaskListManager.getWarningMessages();
assertTrue("There should be no warnings after adding a whitespace:\n"
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
+warnings,warnings.isEmpty());
}
public void testNoFullBuildOnChangeInSysOutInAdviceBody_pr154054() {
initialiseProject("PR154054");
build("PR154054");
alter("PR154054","inc1");
build("PR154054");
checkWasntFullBuild();
}
public void testShouldFullBuildOnExceptionChange_pr154054() {
initialiseProject("PR154054_2");
build("PR154054_2");
alter("PR154054_2","inc1");
build("PR154054_2");
checkWasFullBuild();
}
/**
* Retrieve program elements related to this one regardless of the relationship. A JUnit assertion is
* made that the number that the 'expected' number are found.
*
* @param programElement Program element whose related elements are to be found
* @param expected the number of expected related elements
*/
private List getRelatedElements(IProgramElement programElement,int expected) {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
List relatedElements = getRelatedElements(programElement);
StringBuffer debugString = new StringBuffer();
if (relatedElements!=null) {
for (Iterator iter = relatedElements.iterator(); iter.hasNext();) {
String element = (String) iter.next();
debugString.append(AsmManager.getDefault().getHierarchy().findElementForHandle(element).toLabelString()).append("\n");
}
}
assertTrue("Should be "+expected+" element"+(expected>1?"s":"")+" related to this one '"+programElement+
"' but found :\n "+debugString,relatedElements!=null && relatedElements.size()==1);
return relatedElements;
}
private IProgramElement getFirstRelatedElement(IProgramElement programElement) {
List rels = getRelatedElements(programElement,1);
return AsmManager.getDefault().getHierarchy().findElementForHandle((String)rels.get(0));
}
private List getRelatedElements(IProgramElement advice) {
List output = null;
IRelationshipMap map = AsmManager.getDefault().getRelationshipMap();
List rels = (List)map.get(advice);
if (rels==null) fail("Did not find any related elements!");
for (Iterator iter = rels.iterator(); iter.hasNext();) {
IRelationship element = (IRelationship) iter.next();
List targets = element.getTargets();
if (output==null) output = new ArrayList();
output.addAll(targets);
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
return output;
}
private IProgramElement findAdvice(IProgramElement ipe) {
return findAdvice(ipe,1);
}
private IProgramElement findAdvice(IProgramElement ipe,int whichOne) {
if (ipe.getKind()==IProgramElement.Kind.ADVICE) {
whichOne=whichOne-1;
if (whichOne==0) return ipe;
}
List kids = ipe.getChildren();
for (Iterator iter = kids.iterator(); iter.hasNext();) {
IProgramElement kid = (IProgramElement) iter.next();
IProgramElement found = findAdvice(kid,whichOne);
if (found!=null) return found;
}
return null;
}
/**
* Finds the first 'code' program element below the element supplied - will return null if there aren't any
*/
private IProgramElement findCode(IProgramElement ipe) {
return findCode(ipe,-1);
}
/**
* Searches a hierarchy of program elements for a 'code' element at the specified line number, a line number
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
* of -1 means just return the first one you find
*/
private IProgramElement findCode(IProgramElement ipe,int linenumber) {
if (ipe.getKind()==IProgramElement.Kind.CODE) {
if (linenumber==-1 || ipe.getSourceLocation().getLine()==linenumber) return ipe;
}
List kids = ipe.getChildren();
for (Iterator iter = kids.iterator(); iter.hasNext();) {
IProgramElement kid = (IProgramElement) iter.next();
IProgramElement found = findCode(kid,linenumber);
if (found!=null) return found;
}
return null;
}
/**
* Check we compiled/wove the right number of files, passing '-1' indicates you don't care about
* that number.
*/
private void checkCompileWeaveCount(int expCompile,int expWoven) {
if (expCompile!=-1 && getCompiledFiles().size()!=expCompile)
fail("Expected compilation of "+expCompile+" files but compiled "+getCompiledFiles().size()+
"\n"+printCompiledAndWovenFiles());
if (expWoven!=-1 && getWovenClasses().size()!=expWoven)
fail("Expected weaving of "+expWoven+" files but wove "+getWovenClasses().size()+
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
"\n"+printCompiledAndWovenFiles());
}
private void checkWasntFullBuild() {
assertTrue("Shouldn't have been a full (batch) build",!wasFullBuild());
}
private void checkWasFullBuild() {
assertTrue("Should have been a full (batch) build",wasFullBuild());
}
private IProgramElement checkForNode(String packageName,String typeName,boolean shouldBeFound) {
IProgramElement ipe = AsmManager.getDefault().getHierarchy().findElementForType(packageName,typeName);
if (shouldBeFound) {
if (ipe==null) printModel();
assertTrue("Should have been able to find '"+packageName+"."+typeName+"' in the asm",ipe!=null);
} else {
if (ipe!=null) printModel();
assertTrue("Should have NOT been able to find '"+packageName+"."+typeName+"' in the asm",ipe==null);
}
return ipe;
}
private void printModel() {
try {
AsmManager.dumptree(AsmManager.getDefault().getHierarchy().getRoot(),0);
} catch (IOException e) {
e.printStackTrace();
}
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
/*
* Applies an overlay onto the project being tested - copying
* the contents of the specified overlay directory.
*/
private void alter(String projectName,String overlayDirectory) {
File projectSrc =new File(testdataSrcDir+File.separatorChar+projectName+
File.separatorChar+overlayDirectory);
File destination=new File(getWorkingDir(),projectName);
copy(projectSrc,destination);
}
private static void log(String msg) {
if (VERBOSE) System.out.println(msg);
}
/**
* Count the number of times a specified aspectName appears in the default
* aop.xml file and compare with the expected number of occurrences. If just
* want to count the number of aspects mentioned within the file then
* pass "" for the aspectName, otherwise, specify the name of the
* aspect interested in.
*/
private void checkXMLAspectCount(String projectName, String aspectName, int expectedOccurrences) {
int aspectCount = 0;
File aopXML = new File(getWorkingDir().getAbsolutePath()
+ File.separatorChar + projectName + File.separatorChar
+ "bin" + File.separatorChar + "META-INF" + File.separatorChar + "aop-ajc.xml");
if (!aopXML.exists()) {
fail("Expected file " + aopXML.getAbsolutePath() + " to exist but it doesn't");
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
|
try {
BufferedReader reader = new BufferedReader(new FileReader(aopXML));
String line = reader.readLine();
while (line != null) {
if (aspectName.equals("") && line.indexOf("aspect name=\"") != -1) {
aspectCount++;
} else if (line.indexOf("aspect name=\""+aspectName+"\"") != -1) {
aspectCount++;
}
line = reader.readLine();
}
reader.close();
} catch (IOException ie) {
ie.printStackTrace();
}
if (aspectCount != expectedOccurrences) {
fail("Expected aspect " + aspectName + " to appear " + expectedOccurrences + " times" +
" in the aop.xml file but found " + aspectCount + " occurrences");
}
}
private File getProjectRelativePath(String p,String filename) {
File projDir = new File(getWorkingDir(),p);
return new File(projDir,filename);
}
private File getProjectOutputRelativePath(String p,String filename) {
File projDir = new File(getWorkingDir(),p);
return new File(projDir,"bin"+File.separator+filename);
}
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.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
* ******************************************************************/
package org.aspectj.weaver;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.aspectj.weaver.bcel.BcelMethod;
import org.aspectj.weaver.bcel.BcelTypeMunger;
import org.aspectj.weaver.patterns.Declare;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.DeclareErrorOrWarning;
import org.aspectj.weaver.patterns.DeclareParents;
import org.aspectj.weaver.patterns.DeclarePrecedence;
import org.aspectj.weaver.patterns.DeclareSoft;
import org.aspectj.weaver.patterns.PerClause;
import org.aspectj.weaver.patterns.Pointcut;
import org.aspectj.weaver.patterns.PointcutRewriter;
/**
* This holds on to all members that have an invasive effect outside of
* there own compilation unit. These members need to be all gathered up and in
* a world before any weaving can take place.
*
* They are also important in the compilation process and need to be gathered
* up before the inter-type declaration weaving stage (unsurprisingly).
*
* All members are concrete.
*
* @author Jim Hugunin
*/
public class CrosscuttingMembers {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
private ResolvedType inAspect;
private World world;
private PerClause perClause;
private List shadowMungers = new ArrayList(4);
private List typeMungers = new ArrayList(4);
private List lateTypeMungers = new ArrayList(0);
private List declareParents = new ArrayList(4);
private List declareSofts = new ArrayList(0);
private List declareDominates = new ArrayList(4);
private List declareAnnotationsOnType = new ArrayList();
private List declareAnnotationsOnField = new ArrayList();
private List declareAnnotationsOnMethods = new ArrayList();
private boolean shouldConcretizeIfNeeded = true;
public CrosscuttingMembers(ResolvedType inAspect, boolean shouldConcretizeIfNeeded) {
this.inAspect = inAspect;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
this.world = inAspect.getWorld();
this.shouldConcretizeIfNeeded = shouldConcretizeIfNeeded;
}
public void addConcreteShadowMunger(ShadowMunger m) {
shadowMungers.add(m);
}
public void addShadowMungers(Collection c) {
for (Iterator i = c.iterator(); i.hasNext(); ) {
addShadowMunger( (ShadowMunger)i.next() );
}
}
private void addShadowMunger(ShadowMunger m) {
if (inAspect.isAbstract()) return;
addConcreteShadowMunger(m.concretize(inAspect, world, perClause));
}
public void addTypeMungers(Collection c) {
typeMungers.addAll(c);
}
public void addTypeMunger(ConcreteTypeMunger m) {
if (m == null) throw new Error("FIXME AV - should not happen or what ?");
typeMungers.add(m);
}
public void addLateTypeMungers(Collection c) {
lateTypeMungers.addAll(c);
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
}
public void addLateTypeMunger(ConcreteTypeMunger m) {
lateTypeMungers.add(m);
}
public void addDeclares(Collection c) {
for (Iterator i = c.iterator(); i.hasNext(); ) {
addDeclare( (Declare)i.next() );
}
}
public void addDeclare(Declare declare) {
if (declare instanceof DeclareErrorOrWarning) {
ShadowMunger m = new Checker((DeclareErrorOrWarning)declare);
m.setDeclaringType(declare.getDeclaringType());
addShadowMunger(m);
} else if (declare instanceof DeclarePrecedence) {
declareDominates.add(declare);
} else if (declare instanceof DeclareParents) {
DeclareParents dp = (DeclareParents)declare;
exposeTypes(dp.getParents().getExactTypes());
declareParents.add(dp);
} else if (declare instanceof DeclareSoft) {
DeclareSoft d = (DeclareSoft)declare;
ShadowMunger m = Advice.makeSoftener(world, d.getPointcut(), d.getException(),inAspect,d);
m.setDeclaringType(d.getDeclaringType());
Pointcut concretePointcut = d.getPointcut().concretize(inAspect, d.getDeclaringType(), 0,m);
m.pointcut = concretePointcut;
declareSofts.add(new DeclareSoft(d.getException(), concretePointcut));
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
addConcreteShadowMunger(m);
} else if (declare instanceof DeclareAnnotation) {
DeclareAnnotation da = (DeclareAnnotation)declare;
if (da.getAspect() == null) da.setAspect(this.inAspect);
if (da.isDeclareAtType()) {
declareAnnotationsOnType.add(da);
} else if (da.isDeclareAtField()) {
declareAnnotationsOnField.add(da);
} else if (da.isDeclareAtMethod() || da.isDeclareAtConstuctor()) {
declareAnnotationsOnMethods.add(da);
}
} else {
throw new RuntimeException("unimplemented");
}
}
public void exposeTypes(Collection typesToExpose) {
for (Iterator i = typesToExpose.iterator(); i.hasNext(); ) {
exposeType((UnresolvedType)i.next());
}
}
public void exposeType(UnresolvedType typeToExpose) {
if (ResolvedType.isMissing(typeToExpose)) return;
if (typeToExpose.isParameterizedType() || typeToExpose.isRawType()) {
if (typeToExpose instanceof ResolvedType) {
typeToExpose = ((ResolvedType)typeToExpose).getGenericType();
} else {
typeToExpose = UnresolvedType.forSignature(typeToExpose.getErasureSignature());
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
}
}
ResolvedMember member = new ResolvedMemberImpl(
Member.STATIC_INITIALIZATION, typeToExpose, 0, ResolvedType.VOID, "", UnresolvedType.NONE);
addTypeMunger(world.concreteTypeMunger(
new PrivilegedAccessMunger(member), inAspect));
}
public void addPrivilegedAccesses(Collection accessedMembers) {
for (Iterator i = accessedMembers.iterator(); i.hasNext(); ) {
addPrivilegedAccess( (ResolvedMember)i.next() );
}
}
private void addPrivilegedAccess(ResolvedMember member) {
addTypeMunger(world.concreteTypeMunger(new PrivilegedAccessMunger(member), inAspect));
}
public Collection getCflowEntries() {
ArrayList ret = new ArrayList();
for (Iterator i = shadowMungers.iterator(); i.hasNext(); ) {
ShadowMunger m = (ShadowMunger)i.next();
if (m instanceof Advice) {
Advice a = (Advice)m;
if (a.getKind().isCflow()) {
ret.add(a);
}
}
}
return ret;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
}
/**
* Updates the records if something has changed. This is called at most twice, firstly
* whilst collecting ITDs and declares. At this point the CrosscuttingMembers we're
* comparing ourselves with doesn't know about shadowmungers. Therefore a straight comparison
* with the existing list of shadowmungers would return that something has changed
* even though it might not have, so in this first round we ignore the shadowMungers.
* The second time this is called is whilst we're preparing to weave. At this point
* we know everything in the system and so we're able to compare the shadowMunger list.
* (see bug 129163)
*
* @param other
* @param careAboutShadowMungers
* @return true if something has changed since the last time this method was
* called, false otherwise
*/
public boolean replaceWith(CrosscuttingMembers other,boolean careAboutShadowMungers) {
boolean changed = false;
if (careAboutShadowMungers) {
if (perClause == null || !perClause.equals(other.perClause)) {
changed = true;
perClause = other.perClause;
}
}
if (careAboutShadowMungers) {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
Set theseShadowMungers = new HashSet();
Set theseInlinedAroundMungers = new HashSet();
for (Iterator iter = shadowMungers.iterator(); iter
.hasNext();) {
ShadowMunger munger = (ShadowMunger) iter.next();
if (munger instanceof Advice) {
Advice adviceMunger = (Advice)munger;
if (!world.isXnoInline() && adviceMunger.getKind().equals(AdviceKind.Around)) {
theseInlinedAroundMungers.add(adviceMunger);
} else {
theseShadowMungers.add(adviceMunger);
}
} else {
theseShadowMungers.add(munger);
}
}
Set tempSet = new HashSet();
tempSet.addAll(other.shadowMungers);
Set otherShadowMungers = new HashSet();
Set otherInlinedAroundMungers = new HashSet();
for (Iterator iter = tempSet.iterator(); iter.hasNext();) {
ShadowMunger munger = (ShadowMunger) iter.next();
if (munger instanceof Advice) {
Advice adviceMunger = (Advice)munger;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
if (!world.isXnoInline() && adviceMunger.getKind().equals(AdviceKind.Around)) {
otherInlinedAroundMungers.add(rewritePointcutInMunger(adviceMunger));
} else {
otherShadowMungers.add(rewritePointcutInMunger(adviceMunger));
}
} else {
otherShadowMungers.add(rewritePointcutInMunger(munger));
}
}
if (!theseShadowMungers.equals(otherShadowMungers)) {
changed = true;
}
if (!equivalent(theseInlinedAroundMungers,otherInlinedAroundMungers)) {
changed = true;
}
shadowMungers = other.shadowMungers;
}
Set theseTypeMungers = new HashSet();
Set otherTypeMungers = new HashSet();
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
if (!careAboutShadowMungers) {
for (Iterator iter = typeMungers.iterator(); iter.hasNext();) {
Object o = iter.next();
if (o instanceof BcelTypeMunger) {
BcelTypeMunger typeMunger = (BcelTypeMunger) o;
if (!typeMunger.existsToSupportShadowMunging()) {
theseTypeMungers.add(typeMunger);
}
} else {
theseTypeMungers.add(o);
}
}
for (Iterator iter = other.typeMungers.iterator(); iter.hasNext();) {
Object o = iter.next();
if (o instanceof BcelTypeMunger) {
BcelTypeMunger typeMunger = (BcelTypeMunger) o;
if (!typeMunger.existsToSupportShadowMunging()) {
otherTypeMungers.add(typeMunger);
}
} else {
otherTypeMungers.add(o);
}
}
} else {
theseTypeMungers.addAll(typeMungers);
otherTypeMungers.addAll(other.typeMungers);
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
if (!theseTypeMungers.equals(otherTypeMungers)) {
changed = true;
typeMungers = other.typeMungers;
}
if (!lateTypeMungers.equals(other.lateTypeMungers)) {
changed = true;
lateTypeMungers = other.lateTypeMungers;
}
if (!declareDominates.equals(other.declareDominates)) {
changed = true;
declareDominates = other.declareDominates;
}
if (!declareParents.equals(other.declareParents)) {
changed = true;
declareParents = other.declareParents;
}
if (!declareSofts.equals(other.declareSofts)) {
changed = true;
declareSofts = other.declareSofts;
}
if (!declareAnnotationsOnType.equals(other.declareAnnotationsOnType)) {
changed = true;
declareAnnotationsOnType = other.declareAnnotationsOnType;
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
if (!declareAnnotationsOnField.equals(other.declareAnnotationsOnField)) {
changed = true;
declareAnnotationsOnField = other.declareAnnotationsOnField;
}
if (!declareAnnotationsOnMethods.equals(other.declareAnnotationsOnMethods)) {
changed = true;
declareAnnotationsOnMethods = other.declareAnnotationsOnMethods;
}
return changed;
}
private boolean equivalent(Set theseInlinedAroundMungers, Set otherInlinedAroundMungers) {
if (theseInlinedAroundMungers.size() != otherInlinedAroundMungers.size()) {
return false;
}
for (Iterator iter = theseInlinedAroundMungers.iterator(); iter.hasNext();) {
Advice thisAdvice = (Advice) iter.next();
boolean foundIt = false;
for (Iterator iterator = otherInlinedAroundMungers.iterator(); iterator.hasNext();) {
Advice otherAdvice = (Advice) iterator.next();
if (thisAdvice.equals(otherAdvice)) {
if(thisAdvice.getSignature() instanceof BcelMethod) {
if (((BcelMethod)thisAdvice.getSignature())
.isEquivalentTo(otherAdvice.getSignature()) ) {
foundIt = true;
continue;
}
}
return false;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
}
}
if (!foundIt) {
return false;
}
}
return true;
}
private ShadowMunger rewritePointcutInMunger(ShadowMunger munger) {
PointcutRewriter pr = new PointcutRewriter();
Pointcut p = munger.getPointcut();
Pointcut newP = pr.rewrite(p);
if (p.m_ignoreUnboundBindingForNames.length!=0) {
newP.m_ignoreUnboundBindingForNames = p.m_ignoreUnboundBindingForNames;
}
munger.setPointcut(newP);
return munger;
}
public void setPerClause(PerClause perClause) {
if (this.shouldConcretizeIfNeeded) {
this.perClause = perClause.concretize(inAspect);
} else {
this.perClause = perClause;
}
}
public List getDeclareDominates() {
return declareDominates;
}
public List getDeclareParents() {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/CrosscuttingMembers.java
|
return declareParents;
}
public List getDeclareSofts() {
return declareSofts;
}
public List getShadowMungers() {
return shadowMungers;
}
public List getTypeMungers() {
return typeMungers;
}
public List getLateTypeMungers() {
return lateTypeMungers;
}
public List getDeclareAnnotationOnTypes() {
return declareAnnotationsOnType;
}
public List getDeclareAnnotationOnFields() {
return declareAnnotationsOnField;
}
/**
* includes declare @method and @constructor
*/
public List getDeclareAnnotationOnMethods() {
return declareAnnotationsOnMethods;
}
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.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 support for @AJ aspects
* ******************************************************************/
package org.aspectj.weaver.bcel;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import org.aspectj.apache.bcel.generic.InstructionConstants;
import org.aspectj.apache.bcel.generic.InstructionFactory;
import org.aspectj.apache.bcel.generic.InstructionHandle;
import org.aspectj.apache.bcel.generic.InstructionList;
import org.aspectj.apache.bcel.generic.LineNumberTag;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.weaver.Advice;
import org.aspectj.weaver.AdviceKind;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
import org.aspectj.weaver.AjAttribute;
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.IEclipseSourceContext;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.Member;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.ShadowMunger;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.patterns.ExactTypePattern;
import org.aspectj.weaver.patterns.ExposedState;
import org.aspectj.weaver.patterns.PerClause;
import org.aspectj.weaver.patterns.Pointcut;
/**
* Advice implemented for bcel.
*
* @author Erik Hilsdale
* @author Jim Hugunin
*/
public class BcelAdvice extends Advice {
private Test pointcutTest;
private ExposedState exposedState;
private boolean hasMatchedAtLeastOnce = false;
public BcelAdvice(
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
AjAttribute.AdviceAttribute attribute,
Pointcut pointcut,
Member signature,
ResolvedType concreteAspect)
{
super(attribute, pointcut, signature);
this.concreteAspect = concreteAspect;
}
public BcelAdvice(AdviceKind kind, Pointcut pointcut, Member signature,
int extraArgumentFlags,
int start, int end, ISourceContext sourceContext, ResolvedType concreteAspect)
{
this(new AjAttribute.AdviceAttribute(kind, pointcut, extraArgumentFlags, start, end, sourceContext),
pointcut, signature, concreteAspect);
thrownExceptions = Collections.EMPTY_LIST;
}
public ShadowMunger concretize(ResolvedType fromType, World world, PerClause clause) {
suppressLintWarnings(world);
ShadowMunger ret = super.concretize(fromType, world, clause);
clearLintSuppressions(world,this.suppressedLintKinds);
IfFinder ifinder = new IfFinder();
ret.getPointcut().accept(ifinder,null);
boolean hasGuardTest = ifinder.hasIf && getKind() != AdviceKind.Around;
boolean isAround = getKind() == AdviceKind.Around;
if ((getExtraParameterFlags() & ThisJoinPoint) != 0) {
if (!isAround && !hasGuardTest && world.getLint().noGuardForLazyTjp.isEnabled()) {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
world.getLint().noGuardForLazyTjp.signal("",getSourceLocation());
}
}
return ret;
}
public ShadowMunger parameterizeWith(ResolvedType declaringType,Map typeVariableMap) {
Pointcut pc = getPointcut().parameterizeWith(typeVariableMap);
BcelAdvice ret = null;
Member adviceSignature = signature;
if (signature instanceof ResolvedMember && signature.getDeclaringType().isGenericType()) {
adviceSignature = ((ResolvedMember)signature).parameterizedWith(declaringType.getTypeParameters(),declaringType,declaringType.isParameterizedType());
}
ret = new BcelAdvice(this.attribute,pc,adviceSignature,this.concreteAspect);
return ret;
}
public boolean match(Shadow shadow, World world) {
suppressLintWarnings(world);
boolean ret = super.match(shadow, world);
clearLintSuppressions(world,this.suppressedLintKinds);
return ret;
}
public void specializeOn(Shadow shadow) {
if (getKind() == AdviceKind.Around) {
((BcelShadow)shadow).initializeForAroundClosure();
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
}
if (getKind() == null) {
exposedState = new ExposedState(0);
return;
}
if (getKind().isPerEntry()) {
exposedState = new ExposedState(0);
} else if (getKind().isCflow()) {
exposedState = new ExposedState(nFreeVars);
} else if (getSignature() != null) {
exposedState = new ExposedState(getSignature());
} else {
exposedState = new ExposedState(0);
return;
}
World world = shadow.getIWorld();
suppressLintWarnings(world);
pointcutTest = getPointcut().findResidue(shadow, exposedState);
clearLintSuppressions(world,this.suppressedLintKinds);
if (getKind() == AdviceKind.PerThisEntry) {
shadow.getThisVar();
} else if (getKind() == AdviceKind.PerTargetEntry) {
shadow.getTargetVar();
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
if ((getExtraParameterFlags() & ThisJoinPointStaticPart) != 0) {
((BcelShadow)shadow).getThisJoinPointStaticPartVar();
((BcelShadow)shadow).getEnclosingClass().warnOnAddedStaticInitializer(shadow,getSourceLocation());
}
if ((getExtraParameterFlags() & ThisJoinPoint) != 0) {
boolean hasGuardTest = pointcutTest != Literal.TRUE && getKind() != AdviceKind.Around;
boolean isAround = getKind() == AdviceKind.Around;
((BcelShadow)shadow).requireThisJoinPoint(hasGuardTest,isAround);
((BcelShadow)shadow).getEnclosingClass().warnOnAddedStaticInitializer(shadow,getSourceLocation());
if (!hasGuardTest && world.getLint().multipleAdviceStoppingLazyTjp.isEnabled()) {
((BcelShadow)shadow).addAdvicePreventingLazyTjp(this);
}
}
if ((getExtraParameterFlags() & ThisEnclosingJoinPointStaticPart) != 0) {
((BcelShadow)shadow).getThisEnclosingJoinPointStaticPartVar();
((BcelShadow)shadow).getEnclosingClass().warnOnAddedStaticInitializer(shadow,getSourceLocation());
}
}
private boolean canInline(Shadow s) {
if (attribute.isProceedInInners()) return false;
if (concreteAspect == null || concreteAspect.isMissing()) return false;
if (concreteAspect.getWorld().isXnoInline()) return false;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
return BcelWorld.getBcelObjectType(concreteAspect).getLazyClassGen().isWoven();
}
public void implementOn(Shadow s) {
hasMatchedAtLeastOnce=true;
BcelShadow shadow = (BcelShadow) s;
if (!shadow.getWorld().isIgnoringUnusedDeclaredThrownException()
&& !thrownExceptions.isEmpty()) {
Member member = shadow.getSignature();
if (member instanceof BcelMethod) {
removeUnnecessaryProblems((BcelMethod)member,
((BcelMethod)member).getDeclarationLineNumber());
} else {
ResolvedMember resolvedMember = shadow.getSignature().resolve(shadow.getWorld());
if (resolvedMember instanceof BcelMethod
&& shadow.getEnclosingShadow() instanceof BcelShadow) {
Member enclosingMember = shadow.getEnclosingShadow().getSignature();
if (enclosingMember instanceof BcelMethod) {
removeUnnecessaryProblems((BcelMethod)enclosingMember,
((BcelMethod)resolvedMember).getDeclarationLineNumber());
}
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
}
}
}
if (shadow.getIWorld().isJoinpointSynchronizationEnabled() &&
shadow.getKind()==Shadow.MethodExecution &&
(s.getSignature().getModifiers() & Modifier.SYNCHRONIZED)!=0) {
Message m = new Message("advice matching the synchronized method shadow '"+shadow.toString()+
"' will be executed outside the lock rather than inside (compiler limitation)",shadow.getSourceLocation(),false,new ISourceLocation[]{getSourceLocation()});
shadow.getIWorld().getMessageHandler().handleMessage(m);
}
if (getKind() == AdviceKind.Before) {
shadow.weaveBefore(this);
} else if (getKind() == AdviceKind.AfterReturning) {
shadow.weaveAfterReturning(this);
} else if (getKind() == AdviceKind.AfterThrowing) {
UnresolvedType catchType =
hasExtraParameter()
? getExtraParameterType()
: UnresolvedType.THROWABLE;
shadow.weaveAfterThrowing(this, catchType);
} else if (getKind() == AdviceKind.After) {
shadow.weaveAfter(this);
} else if (getKind() == AdviceKind.Around) {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
if (!canInline(s)) {
shadow.weaveAroundClosure(this, hasDynamicTests());
} else {
shadow.weaveAroundInline(this, hasDynamicTests());
}
} else if (getKind() == AdviceKind.InterInitializer) {
shadow.weaveAfterReturning(this);
} else if (getKind().isCflow()) {
shadow.weaveCflowEntry(this, getSignature());
} else if (getKind() == AdviceKind.PerThisEntry) {
shadow.weavePerObjectEntry(this, (BcelVar)shadow.getThisVar());
} else if (getKind() == AdviceKind.PerTargetEntry) {
shadow.weavePerObjectEntry(this, (BcelVar)shadow.getTargetVar());
} else if (getKind() == AdviceKind.Softener) {
shadow.weaveSoftener(this, ((ExactTypePattern)exceptionType).getType());
} else if (getKind() == AdviceKind.PerTypeWithinEntry) {
shadow.weavePerTypeWithinAspectInitialization(this,shadow.getEnclosingType());
} else {
throw new BCException("unimplemented kind: " + getKind());
}
}
private void removeUnnecessaryProblems(BcelMethod method, int problemLineNumber) {
ISourceContext sourceContext = method.getSourceContext();
if (sourceContext instanceof IEclipseSourceContext) {
if (sourceContext != null
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
&& sourceContext instanceof IEclipseSourceContext) {
((IEclipseSourceContext)sourceContext).removeUnnecessaryProblems(method, problemLineNumber);
}
}
}
private Collection collectCheckedExceptions(UnresolvedType[] excs) {
if (excs == null || excs.length == 0) return Collections.EMPTY_LIST;
Collection ret = new ArrayList();
World world = concreteAspect.getWorld();
ResolvedType runtimeException = world.getCoreType(UnresolvedType.RUNTIME_EXCEPTION);
ResolvedType error = world.getCoreType(UnresolvedType.ERROR);
for (int i=0, len=excs.length; i < len; i++) {
ResolvedType t = world.resolve(excs[i],true);
if (t.isMissing()) {
world.getLint().cantFindType.signal(
WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_EXCEPTION_TYPE,excs[i].getName()),
getSourceLocation()
);
}
if (!(runtimeException.isAssignableFrom(t) || error.isAssignableFrom(t))) {
ret.add(t);
}
}
return ret;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
}
private Collection thrownExceptions = null;
public Collection getThrownExceptions() {
if (thrownExceptions == null) {
if (concreteAspect != null && concreteAspect.getWorld() != null &&
(getKind().isAfter() || getKind() == AdviceKind.Before || getKind() == AdviceKind.Around))
{
World world = concreteAspect.getWorld();
ResolvedMember m = world.resolve(signature);
if (m == null) {
thrownExceptions = Collections.EMPTY_LIST;
} else {
thrownExceptions = collectCheckedExceptions(m.getExceptions());
}
} else {
thrownExceptions = Collections.EMPTY_LIST;
}
}
return thrownExceptions;
}
/**
* The munger must not check for the advice exceptions to be declared by the shadow in the case
* of @AJ aspects so that around can throws Throwable
*
* @return
*/
public boolean mustCheckExceptions() {
if (getConcreteAspect() == null) {
return true;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
}
return !getConcreteAspect().isAnnotationStyleAspect();
}
public boolean hasDynamicTests() {
}
return pointcutTest != null &&
!(pointcutTest == Literal.TRUE);
}
/**
* get the instruction list for the really simple version of this advice.
* Is broken apart
* for other advice, but if you want it in one block, this is the method to call.
*
* @param s The shadow around which these instructions will eventually live.
* @param extraArgVar The var that will hold the return value or thrown exception
* for afterX advice
* @param ifNoAdvice The instructionHandle to jump to if the dynamic
* tests for this munger fails.
*/
InstructionList getAdviceInstructions(
BcelShadow s,
BcelVar extraArgVar,
InstructionHandle ifNoAdvice)
{
BcelShadow shadow = (BcelShadow) s;
InstructionFactory fact = shadow.getFactory();
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
BcelWorld world = shadow.getWorld();
InstructionList il = new InstructionList();
if (hasExtraParameter() && getKind() == AdviceKind.AfterReturning) {
UnresolvedType extraParameterType = getExtraParameterType();
if (! extraParameterType.equals(UnresolvedType.OBJECT)
&& ! extraParameterType.isPrimitiveType()) {
il.append(
BcelRenderer.renderTest(
fact,
world,
Test.makeInstanceof(
extraArgVar, getExtraParameterType().resolve(world)),
null,
ifNoAdvice,
null));
}
}
il.append(getAdviceArgSetup(shadow, extraArgVar, null));
il.append(getNonTestAdviceInstructions(shadow));
InstructionHandle ifYesAdvice = il.getStart();
il.insert(getTestInstructions(shadow, ifYesAdvice, ifNoAdvice, ifYesAdvice));
if (shadow.getKind()==Shadow.MethodExecution && getKind()==AdviceKind.Before) {
int lineNumber=0;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
lineNumber = shadow.getEnclosingMethod().getMemberView().getLineNumberOfFirstInstruction();
if (lineNumber>0) il.getStart().addTargeter(new LineNumberTag(lineNumber));
}
return il;
}
public InstructionList getAdviceArgSetup(
BcelShadow shadow,
BcelVar extraVar,
InstructionList closureInstantiation)
{
InstructionFactory fact = shadow.getFactory();
BcelWorld world = shadow.getWorld();
InstructionList il = new InstructionList();
if (exposedState.getAspectInstance() != null) {
il.append(BcelRenderer.renderExpr(fact, world, exposedState.getAspectInstance()));
}
boolean x = this.getDeclaringAspect().resolve(world).isAnnotationStyleAspect();
final boolean isAnnotationStyleAspect = getConcreteAspect()!=null && getConcreteAspect().isAnnotationStyleAspect() && x;
boolean previousIsClosure = false;
for (int i = 0, len = exposedState.size(); i < len; i++) {
if (exposedState.isErroneousVar(i)) continue;
BcelVar v = (BcelVar) exposedState.get(i);
if (v == null) {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
if (!isAnnotationStyleAspect) {
;
} else {
if ("Lorg/aspectj/lang/ProceedingJoinPoint;".equals(getSignature().getParameterTypes()[i].getSignature())) {
if (getKind() != AdviceKind.Around) {
previousIsClosure = false;
getConcreteAspect().getWorld().getMessageHandler().handleMessage(
new Message(
"use of ProceedingJoinPoint is allowed only on around advice ("
+ "arg " + i + " in " + toString() + ")",
this.getSourceLocation(),
true
)
);
il.append(InstructionConstants.ACONST_NULL);
} else {
if (previousIsClosure) {
il.append(InstructionConstants.DUP);
} else {
previousIsClosure = true;
il.append(closureInstantiation.copy());
}
}
} else if ("Lorg/aspectj/lang/JoinPoint$StaticPart;".equals(getSignature().getParameterTypes()[i].getSignature())) {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
previousIsClosure = false;
if ((getExtraParameterFlags() & ThisJoinPointStaticPart) != 0) {
shadow.getThisJoinPointStaticPartBcelVar().appendLoad(il, fact);
}
} else if ("Lorg/aspectj/lang/JoinPoint;".equals(getSignature().getParameterTypes()[i].getSignature())) {
previousIsClosure = false;
if ((getExtraParameterFlags() & ThisJoinPoint) != 0) {
il.append(shadow.loadThisJoinPoint());
}
} else if ("Lorg/aspectj/lang/JoinPoint$EnclosingStaticPart;".equals(getSignature().getParameterTypes()[i].getSignature())) {
previousIsClosure = false;
if ((getExtraParameterFlags() & ThisEnclosingJoinPointStaticPart) != 0) {
shadow.getThisEnclosingJoinPointStaticPartBcelVar().appendLoad(il, fact);
}
} else if (hasExtraParameter()) {
previousIsClosure = false;
extraVar.appendLoadAndConvert(
il,
fact,
getExtraParameterType().resolve(world));
} else {
previousIsClosure = false;
getConcreteAspect().getWorld().getMessageHandler().handleMessage(
new Message(
"use of ProceedingJoinPoint is allowed only on around advice ("
+ "arg " + i + " in " + toString() + ")",
this.getSourceLocation(),
true
)
);
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
il.append(InstructionConstants.ACONST_NULL);
}
}
} else {
UnresolvedType desiredTy = getBindingParameterTypes()[i];
v.appendLoadAndConvert(il, fact, desiredTy.resolve(world));
}
}
if (!isAnnotationStyleAspect) {
if (getKind() == AdviceKind.Around) {
il.append(closureInstantiation);
} else if (hasExtraParameter()) {
extraVar.appendLoadAndConvert(
il,
fact,
getExtraParameterType().resolve(world));
}
if ((getExtraParameterFlags() & ThisJoinPointStaticPart) != 0) {
shadow.getThisJoinPointStaticPartBcelVar().appendLoad(il, fact);
}
if ((getExtraParameterFlags() & ThisJoinPoint) != 0) {
il.append(shadow.loadThisJoinPoint());
}
if ((getExtraParameterFlags() & ThisEnclosingJoinPointStaticPart) != 0) {
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
shadow.getThisEnclosingJoinPointStaticPartBcelVar().appendLoad(il, fact);
}
}
return il;
}
public InstructionList getNonTestAdviceInstructions(BcelShadow shadow) {
return new InstructionList(
Utility.createInvoke(shadow.getFactory(), shadow.getWorld(), getOriginalSignature()));
}
public Member getOriginalSignature() {
Member sig = getSignature();
if (sig instanceof ResolvedMember) {
ResolvedMember rsig = (ResolvedMember)sig;
if (rsig.hasBackingGenericMember()) return rsig.getBackingGenericMember();
}
return sig;
}
public InstructionList getTestInstructions(
BcelShadow shadow,
InstructionHandle sk,
InstructionHandle fk,
InstructionHandle next)
{
return BcelRenderer.renderTest(
shadow.getFactory(),
shadow.getWorld(),
pointcutTest,
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
sk,
fk,
next);
}
public int compareTo(Object other) {
if (!(other instanceof BcelAdvice)) return 0;
BcelAdvice o = (BcelAdvice)other;
if (kind.getPrecedence() != o.kind.getPrecedence()) {
if (kind.getPrecedence() > o.kind.getPrecedence()) return +1;
else return -1;
}
if (kind.isCflow()) {
boolean isBelow = (kind == AdviceKind.CflowBelowEntry);
if (this.innerCflowEntries.contains(o)) return isBelow ? +1 : -1;
else if (o.innerCflowEntries.contains(this)) return isBelow ? -1 : +1;
else return 0;
}
if (kind.isPerEntry() || kind == AdviceKind.Softener) {
return 0;
}
World world = concreteAspect.getWorld();
int ret =
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
concreteAspect.getWorld().compareByPrecedence(
concreteAspect,
o.concreteAspect);
if (ret != 0) return ret;
ResolvedType declaringAspect = getDeclaringAspect().resolve(world);
ResolvedType o_declaringAspect = o.getDeclaringAspect().resolve(world);
if (declaringAspect == o_declaringAspect) {
if (kind.isAfter() || o.kind.isAfter()) {
return this.getStart() < o.getStart() ? -1: +1;
} else {
return this.getStart()< o.getStart() ? +1: -1;
}
} else if (declaringAspect.isAssignableFrom(o_declaringAspect)) {
return -1;
} else if (o_declaringAspect.isAssignableFrom(declaringAspect)) {
return +1;
} else {
return 0;
}
}
public BcelVar[] getExposedStateAsBcelVars(boolean isAround) {
if (isAround) {
if (getConcreteAspect()!= null && getConcreteAspect().isAnnotationStyleAspect()) {
return BcelVar.NONE;
|
158,573 |
Bug 158573 changing value of variable in aspect results in adviceDidNotMatch warning
| null |
resolved fixed
|
cd9fd11
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-09-29T14:21:57Z | 2006-09-25T16:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
|
}
}
if (exposedState == null) return BcelVar.NONE;
int len = exposedState.vars.length;
BcelVar[] ret = new BcelVar[len];
for (int i=0; i < len; i++) {
ret[i] = (BcelVar)exposedState.vars[i];
}
return ret;
}
public boolean hasMatchedSomething() {
return hasMatchedAtLeastOnce;
}
protected void suppressLintWarnings(World inWorld) {
if (suppressedLintKinds == null) {
if (signature instanceof BcelMethod) {
this.suppressedLintKinds = Utility.getSuppressedWarnings(signature.getAnnotations(), inWorld.getLint());
} else {
this.suppressedLintKinds = Collections.EMPTY_LIST;
}
}
inWorld.getLint().suppressKinds(suppressedLintKinds);
}
protected void clearLintSuppressions(World inWorld,Collection toClear) {
inWorld.getLint().clearSuppressions(toClear);
}
}
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
/*******************************************************************************
* Copyright (c) 2005 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://eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alexandre Vasseur initial implementation
*******************************************************************************/
package org.aspectj.weaver.loadtime.definition;
import java.io.InputStream;
import java.net.URL;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory;
import org.aspectj.util.LangUtil;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.XMLReaderFactory;
/**
* FIXME AV - doc, concrete aspect
*
* @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
*/
public class DocumentParser extends DefaultHandler {
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
/**
* The current DTD public id. The matching dtd will be searched as a resource.
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
*/
private final static String DTD_PUBLIC_ID = "-//AspectJ//DTD 1.5.0//EN";
/**
* The DTD alias, for better user experience.
*/
private final static String DTD_PUBLIC_ID_ALIAS = "-//AspectJ//DTD//EN";
/**
* A handler to the DTD stream so that we are only using one file descriptor
*/
private final static InputStream DTD_STREAM = DocumentParser.class.getResourceAsStream("/aspectj_1_5_0.dtd");
private final static String ASPECTJ_ELEMENT = "aspectj";
private final static String WEAVER_ELEMENT = "weaver";
private final static String DUMP_ELEMENT = "dump";
private final static String DUMP_BEFOREANDAFTER_ATTRIBUTE = "beforeandafter";
private final static String INCLUDE_ELEMENT = "include";
private final static String EXCLUDE_ELEMENT = "exclude";
private final static String OPTIONS_ATTRIBUTE = "options";
private final static String ASPECTS_ELEMENT = "aspects";
private final static String ASPECT_ELEMENT = "aspect";
private final static String CONCRETE_ASPECT_ELEMENT = "concrete-aspect";
private final static String NAME_ATTRIBUTE = "name";
private final static String EXTEND_ATTRIBUTE = "extends";
private final static String PRECEDENCE_ATTRIBUTE = "precedence";
private final static String POINTCUT_ELEMENT = "pointcut";
private final static String WITHIN_ATTRIBUTE = "within";
private final static String EXPRESSION_ATTRIBUTE = "expression";
private final Definition m_definition;
private boolean m_inAspectJ;
private boolean m_inWeaver;
private boolean m_inAspects;
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
private Definition.ConcreteAspect m_lastConcreteAspect;
private DocumentParser() {
m_definition = new Definition();
}
public static Definition parse(final URL url) throws Exception {
InputStream in = null;
try {
DocumentParser parser = new DocumentParser();
XMLReader xmlReader = getXMLReader();
xmlReader.setContentHandler(parser);
xmlReader.setErrorHandler(parser);
try {
xmlReader.setFeature("http://xml.org/sax/features/validation", false);
} catch (SAXException e) {
;
}
try {
xmlReader.setFeature("http://xml.org/sax/features/external-general-entities", false);
} catch (SAXException e) {
;
}
try {
xmlReader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
} catch (SAXException e) {
;
}
xmlReader.setEntityResolver(parser);
in = url.openStream();
xmlReader.parse(new InputSource(in));
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
return parser.m_definition;
} finally {
try {
in.close();
} catch (Throwable t) {
;
}
}
}
private static XMLReader getXMLReader() throws SAXException, ParserConfigurationException {
XMLReader xmlReader = null;
try {
xmlReader = XMLReaderFactory.createXMLReader();
}
catch (SAXException ex) {
xmlReader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
}
return xmlReader;
}
public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
if (publicId.equals(DTD_PUBLIC_ID) || publicId.equals(DTD_PUBLIC_ID_ALIAS)) {
InputStream in = DTD_STREAM;
if (in == null) {
System.err.println(
"AspectJ - WARN - could not read DTD "
+ publicId
);
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
return null;
} else {
return new InputSource(in);
}
} else {
System.err.println(
"AspectJ - WARN - unknown DTD "
+ publicId
+ " - consider using "
+ DTD_PUBLIC_ID
);
return null;
}
}
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (ASPECT_ELEMENT.equals(qName)) {
String name = attributes.getValue(NAME_ATTRIBUTE);
if (!isNull(name)) {
m_definition.getAspectClassNames().add(name);
}
} else if (WEAVER_ELEMENT.equals(qName)) {
String options = attributes.getValue(OPTIONS_ATTRIBUTE);
if (!isNull(options)) {
m_definition.appendWeaverOptions(options);
}
m_inWeaver = true;
} else if (CONCRETE_ASPECT_ELEMENT.equals(qName)) {
String name = attributes.getValue(NAME_ATTRIBUTE);
String extend = attributes.getValue(EXTEND_ATTRIBUTE);
String precedence = attributes.getValue(PRECEDENCE_ATTRIBUTE);
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
if (!isNull(name)) {
if (isNull(precedence) && !isNull(extend)) {
m_lastConcreteAspect = new Definition.ConcreteAspect(name, extend);
} else if (!isNull(precedence)) {
m_lastConcreteAspect = new Definition.ConcreteAspect(name, extend, precedence);
}
m_definition.getConcreteAspects().add(m_lastConcreteAspect);
}
} else if (POINTCUT_ELEMENT.equals(qName) && m_lastConcreteAspect != null) {
String name = attributes.getValue(NAME_ATTRIBUTE);
String expression = attributes.getValue(EXPRESSION_ATTRIBUTE);
if (!isNull(name) && !isNull(expression)) {
m_lastConcreteAspect.pointcuts.add(new Definition.Pointcut(name, replaceXmlAnd(expression)));
}
} else if (ASPECTJ_ELEMENT.equals(qName)) {
if (m_inAspectJ) {
throw new SAXException("Found nested <aspectj> element");
}
m_inAspectJ = true;
} else if (ASPECTS_ELEMENT.equals(qName)) {
m_inAspects = true;
} else if (INCLUDE_ELEMENT.equals(qName) && m_inWeaver) {
String typePattern = attributes.getValue(WITHIN_ATTRIBUTE);
if (!isNull(typePattern)) {
m_definition.getIncludePatterns().add(typePattern);
}
} else if (EXCLUDE_ELEMENT.equals(qName) && m_inWeaver) {
String typePattern = attributes.getValue(WITHIN_ATTRIBUTE);
if (!isNull(typePattern)) {
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
m_definition.getExcludePatterns().add(typePattern);
}
} else if (DUMP_ELEMENT.equals(qName) && m_inWeaver) {
String typePattern = attributes.getValue(WITHIN_ATTRIBUTE);
if (!isNull(typePattern)) {
m_definition.getDumpPatterns().add(typePattern);
}
String beforeAndAfter = attributes.getValue(DUMP_BEFOREANDAFTER_ATTRIBUTE);
if (isTrue(beforeAndAfter)) {
m_definition.setDumpBefore(true);
}
} else if (EXCLUDE_ELEMENT.equals(qName) && m_inAspects) {
String typePattern = attributes.getValue(WITHIN_ATTRIBUTE);
if (!isNull(typePattern)) {
m_definition.getAspectExcludePatterns().add(typePattern);
}
} else if (INCLUDE_ELEMENT.equals(qName) && m_inAspects) {
String typePattern = attributes.getValue(WITHIN_ATTRIBUTE);
if (!isNull(typePattern)) {
m_definition.getAspectIncludePatterns().add(typePattern);
}
} else {
throw new SAXException("Unknown element while parsing <aspectj> element: " + qName);
}
super.startElement(uri, localName, qName, attributes);
}
public void endElement(String uri, String localName, String qName) throws SAXException {
if (CONCRETE_ASPECT_ELEMENT.equals(qName)) {
m_lastConcreteAspect = null;
} else if (ASPECTJ_ELEMENT.equals(qName)) {
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
|
m_inAspectJ = false;
} else if (WEAVER_ELEMENT.equals(qName)) {
m_inWeaver = false;
} else if (ASPECTS_ELEMENT.equals(qName)) {
m_inAspects = false;
}
super.endElement(uri, localName, qName);
}
public void warning(SAXParseException e) throws SAXException {
super.warning(e);
}
public void error(SAXParseException e) throws SAXException {
super.error(e);
}
public void fatalError(SAXParseException e) throws SAXException {
super.fatalError(e);
}
private static String replaceXmlAnd(String expression) {
return LangUtil.replace(expression, " AND ", " && ");
}
private boolean isNull(String s) {
return (s == null || s.length() <= 0);
}
private boolean isTrue(String s) {
return (s != null && s.equals("true"));
}
}
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
|
/*******************************************************************************
* Copyright (c) 2005 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://eclipse.org/legal/epl-v10.html
*
* Contributors:
* Matthew Webster initial implementation
*******************************************************************************/
package org.aspectj.systemtest.ajc150.ltw;
import java.io.File;
import java.util.Enumeration;
import java.util.Properties;
import junit.framework.Test;
import org.aspectj.testing.XMLBasedAjcTestCase;
import org.aspectj.weaver.tools.WeavingAdaptor;
public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase {
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
|
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(LTWTests.class);
}
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc150/ltw/ltw.xml");
}
public void test001(){
runTest("Ensure 1st aspect is rewoven when weaving 2nd aspect");
}
public void testOutxmlFile (){
runTest("Ensure valid aop.xml file is generated");
}
public void testOutxmlJar (){
runTest("Ensure valid aop.xml is generated for -outjar");
}
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
|
public void testNoAopxml(){
setSystemProperty(WeavingAdaptor.WEAVING_ADAPTOR_VERBOSE,"true");
runTest("Ensure no weaving without visible aop.xml");
}
public void testDefineConcreteAspect(){
runTest("Define concrete sub-aspect using aop.xml");
}
public void testDeclareAbstractAspect(){
runTest("Use abstract aspect for ITD using aop.xml");
}
public void testAspectsInclude () {
runTest("Ensure a subset of inherited aspects is used for weaving");
}
public void testAspectsIncludeWithLintWarning () {
runTest("Ensure weaver lint warning issued when an aspect is not used for weaving");
}
public void testXsetEnabled () {
runTest("Set Xset properties enabled");
}
public void testXsetDisabled () {
runTest("Set Xset properties disabled");
}
public void testXlintfileEmpty () {
runTest("Empty Xlint.properties file");
}
public void testXlintfileMissing () {
runTest("Warning with missing Xlint.properties file");
}
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
|
public void testXlintWarningAdviceDidNotMatchSuppressed () {
runTest("Warning when advice doesn't match suppressed for LTW");
}
public void testXlintfile () {
runTest("Override suppressing of warning when advice doesn't match using -Xlintfile");
}
public void testXlintDefault () {
runTest("Warning when advice doesn't match using -Xlint:default");
}
public void testXlintWarning () {
runTest("Override suppressing of warning when advice doesn't match using -Xlint:warning");
}
public void testNonstandardJarFiles() {
runTest("Nonstandard jar file extensions");
}
public void testOddzipOnClasspath() {
runTest("Odd zip on classpath");
}
public void testJ14LTWWithXML() {
runTest("JDK14 LTW with XML");
}
public void testJ14LTWWithASPECTPATH() {
runTest("JDK14 LTW with ASPECTPATH");
}
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
|
public void testWeavingTargetOfCallAggressivelyInLTW_DeclareParents_pr133770() {
runTest("aggressive ltw - decp");
}
public void testWeavingTargetOfCallAggressivelyInLTW_DeclareParents_pr133770_Deactivate() {
runTest("aggressive ltw - decp - deactivate");
}
public void testWeavingTargetOfCallAggressivelyInLTW_DeclareParents_Nested_pr133770() {
runTest("aggressive ltw - decp - 2");
}
public void testWeavingTargetOfCallAggressivelyInLTW_DeclareParents_Hierarchy_pr133770() {
runTest("aggressive ltw - hierarchy");
}
public void testSeparateCompilationDeclareParentsCall_pr133770() {
runTest("separate compilation with ltw: declare parents and call");
}
public void testConfigutationSystemProperty_pr149289 () {
runTest("override default path using -Dorg.aspectj.weaver.loadtime.configuration");
}
/*
* Allow system properties to be set and restored
* TODO maw move to XMLBasedAjcTestCase or RunSpec
*/
|
152,366 |
Bug 152366 LTW Within Patterns Should Accept AND For Consistency
|
The load-time weaving definition system accepts AND in addition to && for pointcuts, but it silently accepts and then fails to work with type patterns that use AND. Such type patterns are important when creating exceptions (e.g., excluding weblogic..* && !weblogic.jdbc..*) and using AND is also helpful here. I've attached a patch to support this and tests to show it's working.
|
resolved fixed
|
7b831ff
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T14:30:21Z | 2006-07-31T18:20:00Z |
tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java
|
private final static String NULL = "null";
private Properties savedProperties;
protected void setSystemProperty (String key, String value) {
Properties systemProperties = System.getProperties();
copyProperty(key,systemProperties,savedProperties);
systemProperties.setProperty(key,value);
}
private static void copyProperty (String key, Properties from, Properties to) {
String value = from.getProperty(key,NULL);
to.setProperty(key,value);
}
protected void setUp() throws Exception {
super.setUp();
savedProperties = new Properties();
}
protected void tearDown() throws Exception {
super.tearDown();
Properties systemProperties = System.getProperties();
for (Enumeration enu = savedProperties.keys(); enu.hasMoreElements(); ) {
String key = (String)enu.nextElement();
String value = savedProperties.getProperty(key);
if (value == NULL) systemProperties.remove(key);
else systemProperties.setProperty(key,value);
}
}
}
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
|
/*******************************************************************************
* Copyright (c) 2006 IBM
* 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:
* Andy Clement - initial API and implementation
*******************************************************************************/
package org.aspectj.systemtest.ajc153;
import java.io.File;
import junit.framework.Test;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IHierarchy;
import org.aspectj.asm.IProgramElement;
import org.aspectj.testing.Utils;
import org.aspectj.testing.XMLBasedAjcTestCase;
import org.aspectj.weaver.bcel.Utility;
public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
|
public void testVisibilityProblem_pr149071() { runTest("visibility problem");}
public void testMissingLineNumbersInStacktraceAfter_pr145442() { runTest("missing line numbers in stacktrace after");}
public void testMissingLineNumbersInStacktraceAround_pr145442() { runTest("missing line numbers in stacktrace around");}
public void testGenericArrays_pr158624() { runTest("generics and arrays"); }
public void testMissingLineNumbersInStacktraceBefore_pr145442() { runTest("missing line numbers in stacktrace before");}
public void testMissingLineNumbersInStacktraceBefore_pr145442_Binary() { runTest("missing line numbers in stacktrace before - binary");}
public void testAnnotationStylePointcutNPE_pr158412() { runTest("annotation style pointcut npe"); }
public void testAnnotationStylePointcutNPE_pr158412_2() { runTest("annotation style pointcut npe - 2"); }
public void testAnnotationsCallConstructors_pr158126() { runTest("annotations, call and constructors problem");}
public void testIllegalStateExceptionGenerics_pr153845() { runTest("IllegalStateException at GenericSignatureParser.java"); }
public void testNoIllegalStateExceptionFromAsmDelegate_pr153490_1() { runTest("no illegal state exception from AsmDelegate - 1");}
public void testNoIllegalStateExceptionFromAsmDelegate_pr153490_2() { runTest("no illegal state exception from AsmDelegate - 2");}
public void testNoIllegalStateExceptionFromAsmDelegate_pr153490_3() { runTest("no illegal state exception from AsmDelegate - 3");}
public void testAnnotMethod_pr156962() { runTest("Test Annot Method");}
public void testAnnotMethodHasMember_pr156962() { runTest("Test Annot Method Has Member"); }
public void testMixingGenerics_pr152848() { runTest("mixing generics"); }
public void testIncorrectStaticinitializationWeaving_pr149560_1() { runTest("incorrect staticinitialization weaving - codestyle");}
public void testIncorrectStaticinitializationWeaving_pr149560_2() { runTest("incorrect staticinitialization weaving - annstyle");}
public void testIncorrectDeprecatedAnnotationProcessing_pr154332() { runTest("incorrect deprecated annotation processing");}
public void testPipeliningProblemWithAnnotationsDecp_pr153380_1() { runTest("pipelining decps");}
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
|
public void testUnwantedPointcutWarning_pr148219() { runTest("unwanted warning for pointcut");}
public void testDecpAndCflowadderMungerClash_pr152631() { runTest("decp and cflowadder munger clash");}
public void testGenericInheritanceDecp_pr150095() { runTest("generics, inheritance and decp");}
public void testIllegalStateException_pr148737() { runTest("illegalstateexception for non generic type");}
public void testAtajInheritance_pr149305_1() { runTest("ataj inheritance - 1");}
public void testAtajInheritance_pr149305_2() { runTest("ataj inheritance - 2");}
public void testAtajInheritance_pr149305_3() { runTest("ataj inheritance - 3");}
public void testVerificationFailureForAspectOf_pr148693() {
runTest("verification problem");
Utils.verifyClass(ajc,"mypackage.MyAspect");
}
public void testIncorrectAnnotationValue_pr148537() { runTest("incorrect annotation value");}
public void testVerifyErrNoTypeCflowField_pr145693_1() { runTest("verifyErrNoTypeCflowField"); }
public void testVerifyErrInpathNoTypeCflowField_pr145693_2() { runTest("verifyErrInpathNoTypeCflowField"); }
public void testCpathNoTypeCflowField_pr145693_3() { runTest("cpathNoTypeCflowField"); }
public void testGenericSignatures_pr148409() { runTest("generic signature problem"); }
public void testCantFindType_pr149322_01() {runTest("can't find type on interface call 1");}
public void testCantFindType_pr149322_02() {runTest("can't find type on interface call 2");}
public void testCantFindType_pr149322_03() {runTest("can't find type on interface call 3");}
public void testParsingBytecodeLess_pr152871() {
Utility.testingParseCounter=0;
runTest("parsing bytecode less");
assertTrue("Should have called parse 5 times, not "+Utility.testingParseCounter+" times",Utility.testingParseCounter==5);
}
public void testMatchVolatileField_pr150671() {runTest("match volatile field");};
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
|
public void testDuplicateJVMTIAgents_pr151938() {runTest("Duplicate JVMTI agents");};
public void testLTWWorldWithAnnotationMatching_pr153572() { runTest("LTWWorld with annotation matching");}
public void testReweavableAspectNotRegistered_pr129525 () {
runTest("reweavableAspectNotRegistered error");
}
public void testNPEinConstructorSignatureImpl_pr155972 () {
runTest("NPE in ConstructorSignatureImpl");
}
public void testNPEinFieldSignatureImpl_pr155972 () {
runTest("NPE in FieldSignatureImpl");
}
public void testNPEinInitializerSignatureImpl_pr155972 () {
runTest("NPE in InitializerSignatureImpl");
}
public void testLineNumberTableCorrectWithGenericsForEachAndContinue_pr155763() {
runTest("ensure LineNumberTable correct with generics, for each and continue");
}
public void testDeclareSoftDoesntAllowUndeclaredExInAnonInnerClass_pr151772() {
runTest("ensure declare soft doesn't allow undeclared exception in anonymous inner class");
}
public void testDeclareSoftDoesntAllowUndeclaredExInAnonInnerClass_pr151772_2() {
runTest("ensure declare soft doesn't allow undeclared exception in anonymous inner class - 2");
}
public void testDeclareSoftAndInnerClasses_pr125981() {
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
|
runTest("declare soft and inner classes");
}
public void testGetSourceSignature_pr148908() {
runTest("ensure getSourceSignature correct with static field");
IHierarchy top = AsmManager.getDefault().getHierarchy();
IProgramElement ipe = top.findElementForLabel(top.getRoot(),
IProgramElement.Kind.FIELD,"MY_COMPARATOR");
String expected = "static final Comparator MY_COMPARATOR = new Comparator() {\n" +
" public int compare(Object o1, Object o2) {\n" +
" return 0;\n" +
" }\n" +
"};";
assertEquals("expected source signature to be " + expected +
" but found " + ipe.getSourceSignature(),
expected, ipe.getSourceSignature());
}
public void testNPEWithCustomAgent_pr158005() {
runTest("NPE with custom agent");
}
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Ajc153Tests.class);
}
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc153/ajc153.xml");
}
}
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.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
* ******************************************************************/
package org.aspectj.weaver.patterns;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageUtil;
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
import org.aspectj.util.FileUtil;
import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.AjAttribute;
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.BoundedReferenceType;
import org.aspectj.weaver.IHasPosition;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.TypeFactory;
import org.aspectj.weaver.TypeVariable;
import org.aspectj.weaver.TypeVariableReference;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.UnresolvedTypeVariableReferenceType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.World;
/**
* The PatternParser always creates WildTypePatterns for type patterns in pointcut
* expressions (apart from *, which is sometimes directly turned into TypePattern.ANY).
* resolveBindings() tries to work out what we've really got and turn it into a type
* pattern that we can use for matching. This will normally be either an ExactTypePattern
* or a WildTypePattern.
*
* Here's how the process pans out for various generic and parameterized patterns:
* (see GenericsWildTypePatternResolvingTestCase)
*
* Foo where Foo exists and is generic
* Parser creates WildTypePattern namePatterns={Foo}
* resolveBindings resolves Foo to RT(Foo - raw)
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
* return ExactTypePattern(LFoo;)
*
* Foo<String> where Foo exists and String meets the bounds
* Parser creates WildTypePattern namePatterns = {Foo}, typeParameters=WTP{String}
* resolveBindings resolves typeParameters to ExactTypePattern(String)
* resolves Foo to RT(Foo)
* returns ExactTypePattern(PFoo<String>; - parameterized)
*
* Foo<Str*> where Foo exists and takes one bound
* Parser creates WildTypePattern namePatterns = {Foo}, typeParameters=WTP{Str*}
* resolveBindings resolves typeParameters to WTP{Str*}
* resolves Foo to RT(Foo)
* returns WildTypePattern(name = Foo, typeParameters = WTP{Str*} isGeneric=false)
*
* Fo*<String>
* Parser creates WildTypePattern namePatterns = {Fo*}, typeParameters=WTP{String}
* resolveBindings resolves typeParameters to ETP{String}
* returns WildTypePattern(name = Fo*, typeParameters = ETP{String} isGeneric=false)
*
*
* Foo<?>
*
* Foo<? extends Number>
*
* Foo<? extends Number+>
*
* Foo<? super Number>
*
*/
public class WildTypePattern extends TypePattern {
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
private static final String GENERIC_WILDCARD_CHARACTER = "?";
private NamePattern[] namePatterns;
int ellipsisCount;
String[] importedPrefixes;
String[] knownMatches;
int dim;
public static boolean boundscheckingoff = false;
TypePattern upperBound;
TypePattern[] additionalInterfaceBounds;
TypePattern lowerBound;
private boolean isGeneric = true;
WildTypePattern(NamePattern[] namePatterns, boolean includeSubtypes, int dim, boolean isVarArgs, TypePatternList typeParams) {
super(includeSubtypes,isVarArgs,typeParams);
this.namePatterns = namePatterns;
this.dim = dim;
ellipsisCount = 0;
for (int i=0; i<namePatterns.length; i++) {
if (namePatterns[i] == NamePattern.ELLIPSIS) ellipsisCount++;
}
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
setLocation(namePatterns[0].getSourceContext(), namePatterns[0].getStart(), namePatterns[namePatterns.length-1].getEnd());
}
public WildTypePattern(List names, boolean includeSubtypes, int dim) {
this((NamePattern[])names.toArray(new NamePattern[names.size()]), includeSubtypes, dim,false,TypePatternList.EMPTY);
}
public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos) {
this(names, includeSubtypes, dim);
this.end = endPos;
}
public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg) {
this(names, includeSubtypes, dim);
this.end = endPos;
this.isVarArgs = isVarArg;
}
public WildTypePattern(
List names,
boolean includeSubtypes,
int dim,
int endPos,
boolean isVarArg,
TypePatternList typeParams,
TypePattern upperBound,
TypePattern[] additionalInterfaceBounds,
TypePattern lowerBound) {
this((NamePattern[])names.toArray(new NamePattern[names.size()]),includeSubtypes,dim,isVarArg,typeParams);
this.end = endPos;
this.upperBound = upperBound;
this.lowerBound = lowerBound;
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
this.additionalInterfaceBounds = additionalInterfaceBounds;
}
public WildTypePattern(
List names,
boolean includeSubtypes,
int dim,
int endPos,
boolean isVarArg,
TypePatternList typeParams)
{
this((NamePattern[])names.toArray(new NamePattern[names.size()]),includeSubtypes,dim,isVarArg,typeParams);
this.end = endPos;
}
public NamePattern[] getNamePatterns() {
return namePatterns;
}
public TypePattern getUpperBound() { return upperBound; }
public TypePattern getLowerBound() { return lowerBound; }
public TypePattern[] getAdditionalIntefaceBounds() { return additionalInterfaceBounds; }
public void setIsVarArgs(boolean isVarArgs) {
this.isVarArgs = isVarArgs;
if (isVarArgs) this.dim += 1;
}
/* (non-Javadoc)
* @see org.aspectj.weaver.patterns.TypePattern#couldEverMatchSameTypesAs(org.aspectj.weaver.patterns.TypePattern)
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
*/
protected boolean couldEverMatchSameTypesAs(TypePattern other) {
if (super.couldEverMatchSameTypesAs(other)) return true;
UnresolvedType otherType = other.getExactType();
if (!ResolvedType.isMissing(otherType)) {
if (namePatterns.length > 0) {
if (!namePatterns[0].matches(otherType.getName())) return false;
}
}
if (other instanceof WildTypePattern) {
WildTypePattern owtp = (WildTypePattern) other;
String mySimpleName = namePatterns[0].maybeGetSimpleName();
String yourSimpleName = owtp.namePatterns[0].maybeGetSimpleName();
if (mySimpleName != null && yourSimpleName != null) {
return (mySimpleName.startsWith(yourSimpleName) ||
yourSimpleName.startsWith(mySimpleName));
}
}
return true;
}
public static char[][] splitNames(String s, boolean convertDollar) {
List ret = new ArrayList();
int startIndex = 0;
while (true) {
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
int breakIndex = s.indexOf('.', startIndex);
if (convertDollar && (breakIndex == -1)) breakIndex = s.indexOf('$', startIndex);
if (breakIndex == -1) break;
char[] name = s.substring(startIndex, breakIndex).toCharArray();
ret.add(name);
startIndex = breakIndex+1;
}
ret.add(s.substring(startIndex).toCharArray());
return (char[][])ret.toArray(new char[ret.size()][]);
}
/**
* @see org.aspectj.weaver.TypePattern#matchesExactly(IType)
*/
protected boolean matchesExactly(ResolvedType type) {
return matchesExactly(type,type);
}
protected boolean matchesExactly(ResolvedType type, ResolvedType annotatedType) {
String targetTypeName = type.getName();
annotationPattern.resolve(type.getWorld());
return matchesExactlyByName(targetTypeName,type.isAnonymous(),type.isNested()) &&
matchesParameters(type,STATIC) &&
matchesBounds(type,STATIC) &&
annotationPattern.matches(annotatedType).alwaysTrue();
}
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
private boolean matchesParameters(ResolvedType aType, MatchKind staticOrDynamic) {
if (!isGeneric && typeParameters.size() > 0) {
if(!aType.isParameterizedType()) return false;
return typeParameters.matches(aType.getResolvedTypeParameters(), staticOrDynamic).alwaysTrue();
}
return true;
}
private boolean matchesBounds(ResolvedType aType, MatchKind staticOrDynamic) {
if (upperBound == null && aType.getUpperBound() != null) {
if (!aType.getUpperBound().getName().equals(UnresolvedType.OBJECT.getName())) {
return false;
}
}
if (lowerBound == null && aType.getLowerBound() != null) return false;
if (upperBound != null) {
if (aType.isGenericWildcard() && aType.isSuper()) return false;
if (aType.getUpperBound() == null) return false;
return upperBound.matches((ResolvedType)aType.getUpperBound(),staticOrDynamic).alwaysTrue();
}
if (lowerBound != null) {
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
if (!(aType.isGenericWildcard() && aType.isSuper())) return false;
return lowerBound.matches((ResolvedType)aType.getLowerBound(),staticOrDynamic).alwaysTrue();
}
return true;
}
/**
* Used in conjunction with checks on 'isStar()' to tell you if this pattern represents '*' or '*[]' which are
* different !
*/
public int getDimensions() {
return dim;
}
public boolean isArray() {
return dim > 1;
}
/**
* @param targetTypeName
* @return
*/
private boolean matchesExactlyByName(String targetTypeName, boolean isAnonymous, boolean isNested) {
if (targetTypeName.indexOf('<') != -1) {
targetTypeName = targetTypeName.substring(0,targetTypeName.indexOf('<'));
}
if (targetTypeName.startsWith(GENERIC_WILDCARD_CHARACTER)) {
targetTypeName = GENERIC_WILDCARD_CHARACTER;
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
}
if (knownMatches == null && importedPrefixes == null) {
return innerMatchesExactly(targetTypeName,isAnonymous, isNested);
}
if (isNamePatternStar()) {
int numDimensionsInTargetType = 0;
if (dim > 0) {
int index;
while((index = targetTypeName.indexOf('[')) != -1) {
numDimensionsInTargetType++;
targetTypeName = targetTypeName.substring(index+1);
}
if (numDimensionsInTargetType == dim) {
return true;
} else {
return false;
}
}
}
if (namePatterns.length == 1) {
if (isAnonymous) {
return false;
}
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
for (int i=0, len=knownMatches.length; i < len; i++) {
if (knownMatches[i].equals(targetTypeName)) return true;
}
} else {
for (int i=0, len=knownMatches.length; i < len; i++) {
String knownPrefix = knownMatches[i] + "$";
if (targetTypeName.startsWith(knownPrefix)) {
int pos = lastIndexOfDotOrDollar(knownMatches[i]);
if (innerMatchesExactly(targetTypeName.substring(pos+1),isAnonymous,isNested)) {
return true;
}
}
}
}
for (int i=0, len=importedPrefixes.length; i < len; i++) {
String prefix = importedPrefixes[i];
if (targetTypeName.startsWith(prefix)) {
if (innerMatchesExactly(targetTypeName.substring(prefix.length()),isAnonymous,isNested)) {
return true;
}
}
}
return innerMatchesExactly(targetTypeName,isAnonymous,isNested);
}
private int lastIndexOfDotOrDollar(String string) {
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
int dot = string.lastIndexOf('.');
int dollar = string.lastIndexOf('$');
return Math.max(dot, dollar);
}
private boolean innerMatchesExactly(String targetTypeName, boolean isAnonymous, boolean isNested) {
char[][] names = splitNames(targetTypeName,isNested);
return innerMatchesExactly(names, isAnonymous);
}
private boolean innerMatchesExactly(char[][] names, boolean isAnonymous) {
int namesLength = names.length;
int patternsLength = namePatterns.length;
int namesIndex = 0;
int patternsIndex = 0;
if ((!namePatterns[patternsLength-1].isAny()) && isAnonymous) return false;
if (ellipsisCount == 0) {
if (namesLength != patternsLength) return false;
while (patternsIndex < patternsLength) {
if (!namePatterns[patternsIndex++].matches(names[namesIndex++])) {
return false;
}
}
return true;
} else if (ellipsisCount == 1) {
if (namesLength < patternsLength-1) return false;
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
while (patternsIndex < patternsLength) {
NamePattern p = namePatterns[patternsIndex++];
if (p == NamePattern.ELLIPSIS) {
namesIndex = namesLength - (patternsLength-patternsIndex);
} else {
if (!p.matches(names[namesIndex++])) {
return false;
}
}
}
return true;
} else {
boolean b = outOfStar(namePatterns, names, 0, 0, patternsLength - ellipsisCount, namesLength, ellipsisCount);
return b;
}
}
private static boolean outOfStar(final NamePattern[] pattern, final char[][] target,
int pi, int ti,
int pLeft, int tLeft,
final int starsLeft) {
if (pLeft > tLeft) return false;
while (true) {
if (tLeft == 0) return true;
if (pLeft == 0) {
return (starsLeft > 0);
}
if (pattern[pi] == NamePattern.ELLIPSIS) {
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
return inStar(pattern, target, pi+1, ti, pLeft, tLeft, starsLeft-1);
}
if (! pattern[pi].matches(target[ti])) {
return false;
}
pi++; ti++; pLeft--; tLeft--;
}
}
private static boolean inStar(final NamePattern[] pattern, final char[][] target,
int pi, int ti,
final int pLeft, int tLeft,
int starsLeft) {
NamePattern patternChar = pattern[pi];
while (patternChar == NamePattern.ELLIPSIS) {
starsLeft--;
patternChar = pattern[++pi];
}
while (true) {
if (pLeft > tLeft) return false;
if (patternChar.matches(target[ti])) {
if (outOfStar(pattern, target, pi+1, ti+1, pLeft-1, tLeft-1, starsLeft)) return true;
}
ti++; tLeft--;
}
}
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
/**
* @see org.aspectj.weaver.TypePattern#matchesInstanceof(IType)
*/
public FuzzyBoolean matchesInstanceof(ResolvedType type) {
if (maybeGetSimpleName() != null) return
FuzzyBoolean.NO;
type.getWorld().getMessageHandler().handleMessage(
new Message("can't do instanceof matching on patterns with wildcards",
IMessage.ERROR, null, getSourceLocation()));
return FuzzyBoolean.NO;
}
public NamePattern extractName() {
if (isIncludeSubtypes() || isVarArgs() || isArray() || (typeParameters.size() > 0)) {
return null;
}
int len = namePatterns.length;
if (len ==1 && !annotationPattern.isAny()) return null;
NamePattern ret = namePatterns[len-1];
NamePattern[] newNames = new NamePattern[len-1];
System.arraycopy(namePatterns, 0, newNames, 0, len-1);
namePatterns = newNames;
return ret;
}
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
/**
* Method maybeExtractName.
* @param string
* @return boolean
*/
public boolean maybeExtractName(String string) {
int len = namePatterns.length;
NamePattern ret = namePatterns[len-1];
String simple = ret.maybeGetSimpleName();
if (simple != null && simple.equals(string)) {
extractName();
return true;
}
return false;
}
/**
* If this type pattern has no '.' or '*' in it, then
* return a simple string
*
* otherwise, this will return null;
*/
public String maybeGetSimpleName() {
if (namePatterns.length == 1) {
return namePatterns[0].maybeGetSimpleName();
}
return null;
}
/**
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
* If this type pattern has no '*' or '..' in it
*/
public String maybeGetCleanName() {
if (namePatterns.length == 0) {
throw new RuntimeException("bad name: " + namePatterns);
}
StringBuffer buf = new StringBuffer();
for (int i=0, len=namePatterns.length; i < len; i++) {
NamePattern p = namePatterns[i];
String simpleName = p.maybeGetSimpleName();
if (simpleName == null) return null;
if (i > 0) buf.append(".");
buf.append(simpleName);
}
return buf.toString();
}
public TypePattern parameterizeWith(Map typeVariableMap) {
NamePattern[] newNamePatterns = new NamePattern[namePatterns.length];
for(int i=0; i<namePatterns.length;i++) { newNamePatterns[i] = namePatterns[i]; }
if (newNamePatterns.length == 1) {
String simpleName = newNamePatterns[0].maybeGetSimpleName();
if (simpleName != null) {
if (typeVariableMap.containsKey(simpleName)) {
String newName = ((ReferenceType)typeVariableMap.get(simpleName)).getName().replace('$','.');
StringTokenizer strTok = new StringTokenizer(newName,".");
newNamePatterns = new NamePattern[strTok.countTokens()];
int index = 0;
while(strTok.hasMoreTokens()) {
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
newNamePatterns[index++] = new NamePattern(strTok.nextToken());
}
}
}
}
WildTypePattern ret = new WildTypePattern(
newNamePatterns,
includeSubtypes,
dim,
isVarArgs,
typeParameters.parameterizeWith(typeVariableMap)
);
ret.annotationPattern = this.annotationPattern.parameterizeWith(typeVariableMap);
if (additionalInterfaceBounds == null) {
ret.additionalInterfaceBounds = null;
} else {
ret.additionalInterfaceBounds = new TypePattern[additionalInterfaceBounds.length];
for (int i = 0; i < additionalInterfaceBounds.length; i++) {
ret.additionalInterfaceBounds[i] = additionalInterfaceBounds[i].parameterizeWith(typeVariableMap);
}
}
ret.upperBound = upperBound != null ? upperBound.parameterizeWith(typeVariableMap) : null;
ret.lowerBound = lowerBound != null ? lowerBound.parameterizeWith(typeVariableMap) : null;
ret.isGeneric = isGeneric;
ret.knownMatches = knownMatches;
ret.importedPrefixes = importedPrefixes;
ret.copyLocationFrom(this);
return ret;
}
/**
|
156,904 |
Bug 156904 Incorrect warning when advising a private method of a private inner class
|
The Eclipse AJDT give an incorrect warning when you want to advise a private method of a private inner class. When I want to advise a private method in a private inner class, like this public class Outer { private class Inner { private void myMethod() } } Using the following poincut: poincut innerpointcut():execution( * Outer.Inner.myMethod() ); and advice: before():innerpointcut() { System.out.println( "executing!" ); } I get a warning "invalidAbsoluteTypeName" next to my pointcut, but next to the advice, there is a marker that points to the private method.
|
resolved fixed
|
782ade2
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2006-10-03T15:00:34Z | 2006-09-11T18:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
|
* Need to determine if I'm really a pattern or a reference to a formal
*
* We may wish to further optimize the case of pattern vs. non-pattern
*
* We will be replaced by what we return
*/
public TypePattern resolveBindings(IScope scope, Bindings bindings,
boolean allowBinding, boolean requireExactType)
{
if (isNamePatternStar()) {
TypePattern anyPattern = maybeResolveToAnyPattern(scope, bindings, allowBinding, requireExactType);
if (anyPattern != null) {
if (requireExactType) {
scope.getWorld().getMessageHandler().handleMessage(
MessageUtil.error(WeaverMessages.format(WeaverMessages.WILDCARD_NOT_ALLOWED),
getSourceLocation()));
return NO;
} else {
return anyPattern;
}
}
}
TypePattern bindingTypePattern = maybeResolveToBindingTypePattern(scope, bindings, allowBinding, requireExactType);
if (bindingTypePattern != null) return bindingTypePattern;
annotationPattern = annotationPattern.resolveBindings(scope,bindings,allowBinding);
if (typeParameters!=null && typeParameters.size()>0) {
typeParameters.resolveBindings(scope,bindings,allowBinding,requireExactType);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.