Bugzilla Bug 30663 lame error message: "negation doesn't allow binding" and Bugzilla Bug 36329 The compiler crashes when using aspect libraries created without using -noweavetags/V1_1_0_RC2
@@ -5878,4 +5878,24 @@ | |||
<run class="CflowConcrete"/> | |||
</ajc-test> | |||
<ajc-test dir="new/options11" pr="36329" | |||
comment="the line number might change, we're really interested only in the files here" | |||
title="The compiler crashes when using aspect libraries created without using -noweave"> | |||
<compile files="Main.java,injar.jar,Aspect.java,aspectlib1.jar,aspectlib2.jar"> | |||
<message kind="error" line="0"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="bugs" title="lame error message: negation doesn't allow binding" | |||
pr="30663"> | |||
<compile files="BadBindingError.java"> | |||
<message kind="error" line="7"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="bugs/interSpecials" pr="36936" | |||
title="Error when introducing members of type Class"> | |||
<compile files="Trg.java,Asp.java"/> | |||
<run class="Trg"/> | |||
</ajc-test> | |||
</suite> |
@@ -0,0 +1,8 @@ | |||
// Bugzilla Bug 30663 | |||
//lame error message: "negation doesn't allow binding" | |||
import org.aspectj.testing.Tester; | |||
public aspect BadBindingError { | |||
pointcut p(int i): call(void f(i)); | |||
} |
@@ -1,11 +1,16 @@ | |||
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"> | |||
<suite> | |||
<suite> | |||
<!-- | |||
<ajc-test dir="options/injars/simple" | |||
title="options -injars"> | |||
<compile files="Simple.java,main.jar" | |||
options="!eclipse"/> | |||
<run class="Main"/> | |||
</ajc-test> | |||
<ajc-test dir="new" pr="885" |
@@ -46,6 +46,7 @@ import org.apache.bcel.generic.RET; | |||
import org.apache.bcel.generic.ReturnInstruction; | |||
import org.apache.bcel.generic.Select; | |||
import org.apache.bcel.generic.Type; | |||
import org.aspectj.bridge.IMessage; | |||
import org.aspectj.util.PartialOrder; | |||
import org.aspectj.weaver.AjAttribute; | |||
import org.aspectj.weaver.AjcMemberMaker; | |||
@@ -241,7 +242,10 @@ class BcelClassWeaver implements IClassWeaver { | |||
public boolean weave() { | |||
if (clazz.getWeaverState().isWoven()) { | |||
throw new RuntimeException("already woven: " + clazz); | |||
world.showMessage(IMessage.ERROR, | |||
"class \'" + clazz.getType().getName() + "\' is already woven", | |||
ty.getSourceLocation(), null); | |||
return false; | |||
} | |||
boolean isChanged = false; |
@@ -67,6 +67,9 @@ public abstract class TypePattern extends PatternNode { | |||
public final FuzzyBoolean matches(ResolvedTypeX type, MatchKind kind) { | |||
//??? This is part of gracefully handling missing references | |||
if (type == ResolvedTypeX.MISSING) return FuzzyBoolean.NO; | |||
if (kind == STATIC) { | |||
return FuzzyBoolean.fromBoolean(matchesStatically(type)); | |||
} else if (kind == DYNAMIC) { |
@@ -306,10 +306,16 @@ public class WildTypePattern extends TypePattern { | |||
if (simpleName != null) { | |||
FormalBinding formalBinding = scope.lookupFormal(simpleName); | |||
if (formalBinding != null) { | |||
if (!allowBinding || bindings == null) { | |||
if (bindings == null) { | |||
scope.message(IMessage.ERROR, this, "negation doesn't allow binding"); | |||
return this; | |||
} | |||
if (!allowBinding) { | |||
scope.message(IMessage.ERROR, this, | |||
"name binding only allowed in target, this, and args pcds"); | |||
return this; | |||
} | |||
BindingTypePattern binding = new BindingTypePattern(formalBinding); | |||
binding.copyLocationFrom(this); | |||
bindings.register(binding, scope); |