aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'org.aspectj.matcher/src/main')
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java2
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java8
-rw-r--r--org.aspectj.matcher/src/main/resources/org/aspectj/weaver/XlintDefault.properties2
3 files changed, 12 insertions, 0 deletions
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java
index 3963e09f4..70d6a8b73 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Lint.java
@@ -138,6 +138,8 @@ public class Lint {
public final Kind missingAspectForReweaving = new Kind("missingAspectForReweaving",
"aspect {0} cannot be found when reweaving {1}");
+ public final Kind arrayCannotBeVoid = new Kind("arrayCannotBeVoid", "arrays cannot have a void type, but found ''{0}'' in pointcut");
+
private static final Trace trace = TraceFactory.getTraceFactory().getTrace(Lint.class);
public Lint(World world) {
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java
index 6eab96f15..c5f43da8f 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java
@@ -316,7 +316,15 @@ public abstract class World implements Dump.INode {
synchronized (buildingTypeLock) {
if (ty.isArray()) {
ResolvedType componentType = resolve(ty.getComponentType(), allowMissing);
+ if (componentType.isVoid()) {
+ if (isInJava5Mode() && getLint().adviceDidNotMatch.isEnabled()) {
+ getLint().arrayCannotBeVoid.signal(ty.toString(), null);
+ }
+ ret = new MissingResolvedTypeWithKnownSignature(signature, this);
+ }
+ else {
ret = new ArrayReferenceType(signature, "[" + componentType.getErasureSignature(), this, componentType);
+ }
} else {
ret = resolveToReferenceType(ty, allowMissing);
if (!allowMissing && ret.isMissing()) {
diff --git a/org.aspectj.matcher/src/main/resources/org/aspectj/weaver/XlintDefault.properties b/org.aspectj.matcher/src/main/resources/org/aspectj/weaver/XlintDefault.properties
index f996d040b..b7a982246 100644
--- a/org.aspectj.matcher/src/main/resources/org/aspectj/weaver/XlintDefault.properties
+++ b/org.aspectj.matcher/src/main/resources/org/aspectj/weaver/XlintDefault.properties
@@ -48,3 +48,5 @@ missingAspectForReweaving=error
cannotAdviseJoinpointInInterfaceWithAroundAdvice=warning
nonReweavableTypeEncountered=error
+
+arrayCannotBeVoid=warning