Sfoglia il codice sorgente

fixes and tests for 119570 (member type subaspect)

tags/V1_5_0RC1
aclement 18 anni fa
parent
commit
df3adcd182

+ 25
- 12
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java Vedi File

@@ -289,6 +289,19 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
}

public void doSupertypesFirst(ReferenceBinding rb,Collection yetToProcess) {
if (rb instanceof SourceTypeBinding) {
if (yetToProcess.contains(rb)) {
collectAllITDsAndDeclares((SourceTypeBinding)rb, yetToProcess);
}
} else if (rb instanceof ParameterizedTypeBinding) {
// If its a PTB we need to pull the SourceTypeBinding out of it.
ParameterizedTypeBinding ptb = (ParameterizedTypeBinding)rb;
if (ptb.type instanceof SourceTypeBinding && yetToProcess.contains(ptb.type)) {
collectAllITDsAndDeclares((SourceTypeBinding)ptb.type, yetToProcess);
}
}
}
/**
* Find all the ITDs and Declares, but it is important we do this from the supertypes
* down to the subtypes.
@@ -298,18 +311,18 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
private void collectAllITDsAndDeclares(SourceTypeBinding sourceType, Collection yetToProcess) {
// Look at the supertype first
ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.COLLECTING_ITDS_AND_DECLARES, sourceType.sourceName);
ReferenceBinding superType = sourceType.superclass();
if (superType instanceof SourceTypeBinding) {
if (yetToProcess.contains(superType)) {
collectAllITDsAndDeclares((SourceTypeBinding)superType, yetToProcess);
}
} else if (superType instanceof ParameterizedTypeBinding) {
// If its a PTB we need to pull the SourceTypeBinding out of it.
ParameterizedTypeBinding ptb = (ParameterizedTypeBinding)superType;
if (ptb.type instanceof SourceTypeBinding && yetToProcess.contains(ptb.type)) {
collectAllITDsAndDeclares((SourceTypeBinding)ptb.type, yetToProcess);
}
}
// look out our direct supertype
doSupertypesFirst(sourceType.superclass(),yetToProcess);
// now check our membertypes (pr119570)
ReferenceBinding[] memberTypes = sourceType.memberTypes;
for (int i = 0, length = memberTypes.length; i < length; i++) {
SourceTypeBinding rb = (SourceTypeBinding)memberTypes[i];
if (!rb.superclass().equals(sourceType))
doSupertypesFirst(rb.superclass(),yetToProcess);
}
buildInterTypeAndPerClause(sourceType.scope);
addCrosscuttingStructures(sourceType.scope);
yetToProcess.remove(sourceType);

+ 2
- 2
tests/multiIncremental/PR119570/base/bugs/ParameterizedDP.java Vedi File

@@ -22,6 +22,6 @@ class TaggedTexts {
// unneeded declare-parents duplicates one in NodeImpl
// when here, get spurious error message
// when commented out, d-p fails and get compiler error at 1) above
declare parents : Tag implements INode<Tag,Tag>;
// declare parents : Tag implements INode<Tag,Tag>;
}
}
}

+ 3
- 1
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java Vedi File

@@ -51,6 +51,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testCunningDeclareParents_pr92311() { runTest("cunning declare parents");}
public void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
*/
//public void testIncorrectSignatureMatchingWithExceptions_pr119749() { runTest("incorrect exception signature matching");}
public void testGeneratingCodeForAnOldRuntime_pr116679_1() { runTest("generating code for a 1.2.1 runtime - 1");}
public void testGeneratingCodeForAnOldRuntime_pr116679_2() { runTest("generating code for a 1.2.1 runtime - 2");}
public void testAmbiguousMethod_pr118599_1() { runTest("ambiguous method when binary weaving - 1");}
@@ -86,7 +87,8 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");}
public void testBadDecp_pr110788_3() { runTest("bad generic decp - 3");}
public void testBadDecp_pr110788_4() { runTest("bad generic decp - 4");}
public void testSpuriousOverrideMethodWarning_pr119570() { runTest("spurious override method warning");}
public void testSpuriousOverrideMethodWarning_pr119570_1() { runTest("spurious override method warning");}
public void testSpuriousOverrideMethodWarning_pr119570_2() { runTest("spurious override method warning - 2");}
public void testBrokenSwitch_pr117854() { runTest("broken switch transform");}
public void testVarargsITD_pr110906() { runTest("ITD varargs problem");}
public void testBadRenderer_pr86903() { runTest("bcelrenderer bad");}

+ 12
- 0
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml Vedi File

@@ -72,6 +72,11 @@
<ajc-test dir="bugs150/pr119570" pr="119570" title="spurious override method warning">
<compile files="NodeImpl.java,INode.java,ParameterizedDP.java" options="-1.5"/>
<run class="bugs.ParameterizedDP"/>
</ajc-test>
<ajc-test dir="bugs150/pr119570" pr="119570" title="spurious override method warning - 2">
<compile files="ParameterizedDP.java,NodeImpl.java,INode.java" options="-1.5"/>
<run class="bugs.ParameterizedDP"/>
</ajc-test>

<ajc-test dir="bugs150/pr119210" pr="119210" title="autoboxing around advice - 1">
@@ -126,6 +131,13 @@
<run class="BrokenSwitch"/>
</ajc-test>
<ajc-test dir="bugs150/pr119749" pr="119749" title="incorrect exception signature matching">
<compile files="InheritedThrows.java" options="">
<message kind="warning" line="19" text="one"/>
<message kind="warning" line="27" text="one"/>
</compile>
</ajc-test>
<ajc-test dir="bugs150/pr118599" pr="118599" title="ambiguous method when binary weaving - 1">
<!-- separate compilation was failing -->
<compile files="Attributable.java" outjar="foo.jar" options="-1.5"/>

+ 1
- 2
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java Vedi File

@@ -293,8 +293,7 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
public void testPr119570() {
initialiseProject("PR119570");
build("PR119570");
List l = MyTaskListManager.getWarningMessages();
assertTrue("Should be no warnings, but got "+l,l.size()==0);
assertTrue("Should be no errors, but got "+MyTaskListManager.getErrorMessages(),MyTaskListManager.getErrorMessages().size()==0);
}
public void testPr119570_2() {

Loading…
Annulla
Salva