diff options
author | Andy Clement <aclement@pivotal.io> | 2020-08-12 15:20:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 15:20:29 -0700 |
commit | 29f947156e58f3f0c60e721d42e7f3e98de7180a (patch) | |
tree | 01fb5493dc348d42e4fb9fb6ce1cd41e361d666b | |
parent | 93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad (diff) | |
parent | cacc9d5602b7bbe6192d5ff1351605dc180cc108 (diff) | |
download | aspectj-29f947156e58f3f0c60e721d42e7f3e98de7180a.tar.gz aspectj-29f947156e58f3f0c60e721d42e7f3e98de7180a.zip |
Merge branch 'master' into feature/java5
-rw-r--r-- | org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractReferenceTypeDelegate.java | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractReferenceTypeDelegate.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractReferenceTypeDelegate.java index bdddec51e..ce3b6aa60 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractReferenceTypeDelegate.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractReferenceTypeDelegate.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * 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 * Andy Clement - June 2005 - separated out from ResolvedType * ******************************************************************/ package org.aspectj.weaver; @@ -18,6 +18,7 @@ import java.util.List; import org.aspectj.bridge.ISourceLocation; import org.aspectj.util.GenericSignature; import org.aspectj.util.GenericSignature.ClassSignature; +import org.aspectj.util.GenericSignature.FormalTypeParameter; import org.aspectj.util.GenericSignatureParser; import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; @@ -38,10 +39,12 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele this.exposedToWeaver = exposedToWeaver; } + @Override public final boolean isClass() { return !isAspect() && !isInterface(); } + @Override public boolean isCacheable() { return false; } @@ -49,18 +52,22 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele /** * Designed to be overriden by EclipseType to disable collection of shadow mungers during pre-weave compilation phase */ + @Override public boolean doesNotExposeShadowMungers() { return false; } + @Override public boolean isExposedToWeaver() { return exposedToWeaver; } + @Override public ReferenceType getResolvedTypeX() { return resolvedTypeX; } + @Override public final String getSourcefilename() { return sourcefilename; } @@ -84,6 +91,7 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele return getSourceContext().makeSourceLocation(0, 0); } + @Override public ISourceContext getSourceContext() { return sourceContext; } @@ -110,9 +118,16 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele if (outerClassType == null) { return GenericSignature.FormalTypeParameter.NONE; } else { - throw new BCException("Whilst processing type '" + this.resolvedTypeX.getSignature() - + "' - cannot cast the outer type to a reference type. Signature=" + outerClassType.getSignature() - + " toString()=" + outerClassType.toString()+" class=" + outerClassType.getClassName()); + if (System.getProperty("aspectj.debug565713","false").toLowerCase().equals("true")) { + System.out.println("DEBUG 565713: Whilst processing type '" + this.resolvedTypeX.getSignature()+ + "' - cannot cast the outer type to a reference type. Signature=" + outerClassType.getSignature() + + " toString()=" + outerClassType.toString()+" class=" + outerClassType.getClassName()); + return GenericSignature.FormalTypeParameter.NONE; + } else { + throw new BCException("Whilst processing type '" + this.resolvedTypeX.getSignature() + + "' - cannot cast the outer type to a reference type. Signature=" + outerClassType.getSignature() + + " toString()=" + outerClassType.toString()+" class=" + outerClassType.getClassName()); + } } } ReferenceType outer = (ReferenceType) outerClassType; @@ -126,8 +141,8 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele } GenericSignature.ClassSignature outerSig = outerObjectType.getGenericClassTypeSignature(); if (outerSig != null) { - for (int i = 0; i < outerSig.formalTypeParameters.length; i++) { - typeParameters.add(outerSig.formalTypeParameters[i]); + for (FormalTypeParameter formalTypeParameter : outerSig.formalTypeParameters) { + typeParameters.add(formalTypeParameter); } } @@ -136,22 +151,27 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele return ret; } + @Override public boolean copySourceContext() { return true; } + @Override public int getCompilerVersion() { return WeaverVersionInfo.getCurrentWeaverMajorVersion(); } + @Override public void ensureConsistent() { } + @Override public boolean isWeavable() { return false; } + @Override public boolean hasBeenWoven() { return false; } |