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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
private void createBridge(BcelClassWeaver weaver, ResolvedMember unMangledInterMethod, LazyClassGen classGen,
ResolvedMember toBridgeTo) {
Type[] paramTypes;
Type returnType;
InstructionList body;
InstructionFactory fact;
int pos;
ResolvedMember bridgerMethod = AjcMemberMaker.bridgerToInterMethod(unMangledInterMethod, classGen.getType());
ResolvedMember bridgingSetter = AjcMemberMaker.interMethodBridger(toBridgeTo, aspectType, false);
LazyMethodGen bridgeMethod = makeMethodGen(classGen, bridgingSetter);
paramTypes = BcelWorld.makeBcelTypes(bridgingSetter.getParameterTypes());
Type[] bridgingToParms = BcelWorld.makeBcelTypes(unMangledInterMethod.getParameterTypes());
returnType = BcelWorld.makeBcelType(bridgingSetter.getReturnType());
body = bridgeMethod.getBody();
fact = classGen.getFactory();
pos = 0;
if (!Modifier.isStatic(bridgingSetter.getModifiers())) {
body.append(InstructionFactory.createThis());
pos++;
}
for (int i = 0, len = paramTypes.length; i < len; i++) {
Type paramType = paramTypes[i];
body.append(InstructionFactory.createLoad(paramType, pos));
if (!bridgingSetter.getParameterTypes()[i].getErasureSignature().equals(
unMangledInterMethod.getParameterTypes()[i].getErasureSignature())) {
body.append(fact.createCast(paramType, bridgingToParms[i]));
}
pos += paramType.getSize();
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
}
body.append(Utility.createInvoke(fact, weaver.getWorld(), bridgerMethod));
body.append(InstructionFactory.createReturn(returnType));
classGen.addMethodGen(bridgeMethod);
}
/**
* Helper method to create a signature attribute based on a string signature: e.g. "Ljava/lang/Object;LI<Ljava/lang/Double;>;"
*/
private Signature createSignatureAttribute(ConstantPool cp, String signature) {
int nameIndex = cp.addUtf8("Signature");
int sigIndex = cp.addUtf8(signature);
return new Signature(nameIndex, 2, sigIndex, cp);
}
/**
* Create any bridge method required because of covariant returns being used. This method is used in the case where an ITD is
* applied to some type and it may be in an override relationship with a method from the supertype - but due to covariance there
* is a mismatch in return values. Example of when required: Super defines: Object m(String s) Sub defines: String m(String s)
* then we need a bridge method in Sub called 'Object m(String s)' that forwards to 'String m(String s)'
*/
private void createAnyBridgeMethodsForCovariance(BcelClassWeaver weaver, NewMethodTypeMunger munger,
ResolvedMember unMangledInterMethod, ResolvedType onType, LazyClassGen gen, Type[] paramTypes) {
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
boolean quitRightNow = false;
String localMethodName = unMangledInterMethod.getName();
String erasedSig = unMangledInterMethod.getSignatureErased();
String localParameterSig = erasedSig.substring(0,erasedSig.lastIndexOf(')')+1);
String localReturnTypeESig = unMangledInterMethod.getReturnType().getErasureSignature();
boolean alreadyDone = false;
ResolvedMember[] localMethods = onType.getDeclaredMethods();
for (int i = 0; i < localMethods.length; i++) {
ResolvedMember member = localMethods[i];
if (member.getName().equals(localMethodName)) {
if (member.getParameterSignature().equals(localParameterSig)) {
alreadyDone = true;
}
}
}
if (!alreadyDone) {
ResolvedType supertype = onType.getSuperclass();
if (supertype != null) {
for (Iterator<ResolvedMember> iter = supertype.getMethods(true, true); iter.hasNext() && !quitRightNow;) {
ResolvedMember aMethod = iter.next();
if (aMethod.getName().equals(localMethodName) && aMethod.getParameterSignature().equals(localParameterSig)) {
if (!aMethod.getReturnType().getErasureSignature().equals(localReturnTypeESig)
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
&& !Modifier.isPrivate(aMethod.getModifiers())) {
createBridgeMethod(weaver.getWorld(), munger, unMangledInterMethod, gen, paramTypes, aMethod);
quitRightNow = true;
}
}
}
}
}
}
/**
* Create a bridge method for a particular munger.
*
* @param world
* @param munger
* @param unMangledInterMethod the method to bridge 'to' that we have already created in the 'subtype'
* @param clazz the class in which to put the bridge method
* @param paramTypes Parameter types for the bridge method, passed in as an optimization since the caller is likely to have
* already created them.
* @param theBridgeMethod
*/
private void createBridgeMethod(BcelWorld world, NewMethodTypeMunger munger, ResolvedMember unMangledInterMethod,
LazyClassGen clazz, Type[] paramTypes, ResolvedMember theBridgeMethod) {
InstructionList body;
InstructionFactory fact;
int pos = 0;
LazyMethodGen bridgeMethod = makeMethodGen(clazz, theBridgeMethod);
bridgeMethod.setAccessFlags(bridgeMethod.getAccessFlags() | 0x00000040 );
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
Type returnType = BcelWorld.makeBcelType(theBridgeMethod.getReturnType());
body = bridgeMethod.getBody();
fact = clazz.getFactory();
if (!Modifier.isStatic(unMangledInterMethod.getModifiers())) {
body.append(InstructionFactory.createThis());
pos++;
}
for (int i = 0, len = paramTypes.length; i < len; i++) {
Type paramType = paramTypes[i];
body.append(InstructionFactory.createLoad(paramType, pos));
pos += paramType.getSize();
}
body.append(Utility.createInvoke(fact, world, unMangledInterMethod));
body.append(InstructionFactory.createReturn(returnType));
clazz.addMethodGen(bridgeMethod);
}
private String stringifyMember(ResolvedMember member) {
StringBuffer buf = new StringBuffer();
buf.append(member.getReturnType().getName());
buf.append(' ');
buf.append(member.getName());
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (member.getKind() != Member.FIELD) {
buf.append("(");
UnresolvedType[] params = member.getParameterTypes();
if (params.length != 0) {
buf.append(params[0]);
for (int i = 1, len = params.length; i < len; i++) {
buf.append(", ");
buf.append(params[i].getName());
}
}
buf.append(")");
}
return buf.toString();
}
private boolean mungeMethodDelegate(BcelClassWeaver weaver, MethodDelegateTypeMunger munger) {
World world = weaver.getWorld();
LazyClassGen gen = weaver.getLazyClassGen();
if (gen.getType().isAnnotation() || gen.getType().isEnum()) {
return false;
}
ResolvedMember introduced = munger.getSignature();
ResolvedType fromType = world.resolve(introduced.getDeclaringType(), munger.getSourceLocation());
if (fromType.isRawType()) {
fromType = fromType.getGenericType();
}
boolean shouldApply = munger.matches(weaver.getLazyClassGen().getType(), aspectType);
if (shouldApply) {
Type bcelReturnType = BcelWorld.makeBcelType(introduced.getReturnType());
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (munger.getImplClassName() == null && !munger.specifiesDelegateFactoryMethod()) {
boolean isOK = false;
List<LazyMethodGen> existingMethods = gen.getMethodGens();
for (LazyMethodGen m : existingMethods) {
if (m.getName().equals(introduced.getName())
&& m.getParameterSignature().equals(introduced.getParameterSignature())
&& m.getReturnType().equals(bcelReturnType)) {
isOK = true;
}
}
if (!isOK) {
IMessage msg = new Message("@DeclareParents: No defaultImpl was specified but the type '" + gen.getName()
+ "' does not implement the method '" + stringifyMember(introduced) + "' defined on the interface '"
+ introduced.getDeclaringType() + "'", weaver.getLazyClassGen().getType().getSourceLocation(), true,
new ISourceLocation[] { munger.getSourceLocation() });
weaver.getWorld().getMessageHandler().handleMessage(msg);
return false;
}
return true;
}
LazyMethodGen mg = new LazyMethodGen(introduced.getModifiers() - Modifier.ABSTRACT, bcelReturnType,
introduced.getName(), BcelWorld.makeBcelTypes(introduced.getParameterTypes()),
BcelWorld.makeBcelTypesAsClassNames(introduced.getExceptions()), gen);
if (weaver.getWorld().isInJava5Mode()) {
AnnotationAJ annotationsOnRealMember[] = null;
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
ResolvedType toLookOn = weaver.getWorld().lookupOrCreateName(introduced.getDeclaringType());
if (fromType.isRawType()) {
toLookOn = fromType.getGenericType();
}
ResolvedMember[] ms = toLookOn.getDeclaredJavaMethods();
for (ResolvedMember m : ms) {
if (introduced.getName().equals(m.getName()) && introduced.getSignature().equals(m.getSignature())) {
annotationsOnRealMember = m.getAnnotations();
break;
}
}
if (annotationsOnRealMember != null) {
for (AnnotationAJ anno : annotationsOnRealMember) {
AnnotationGen a = ((BcelAnnotation) anno).getBcelAnnotation();
AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
mg.addAnnotation(new BcelAnnotation(ag, weaver.getWorld()));
}
}
}
InstructionList body = new InstructionList();
InstructionFactory fact = gen.getFactory();
body.append(InstructionConstants.ALOAD_0);
body.append(Utility.createGet(fact, munger.getDelegate(weaver.getLazyClassGen().getType())));
InstructionBranch ifNonNull = InstructionFactory.createBranchInstruction(Constants.IFNONNULL, null);
body.append(ifNonNull);
body.append(InstructionConstants.ALOAD_0);
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (munger.specifiesDelegateFactoryMethod()) {
ResolvedMember rm = munger.getDelegateFactoryMethod(weaver.getWorld());
if (rm.getArity() != 0) {
ResolvedType parameterType = rm.getParameterTypes()[0].resolve(weaver.getWorld());
if (!parameterType.isAssignableFrom(weaver.getLazyClassGen().getType())) {
signalError("For mixin factory method '" + rm + "': Instance type '" + weaver.getLazyClassGen().getType()
+ "' is not compatible with factory parameter type '" + parameterType + "'", weaver);
return false;
}
}
if (Modifier.isStatic(rm.getModifiers())) {
if (rm.getArity() != 0) {
body.append(InstructionConstants.ALOAD_0);
}
body.append(fact.createInvoke(rm.getDeclaringType().getName(), rm.getName(), rm.getSignature(),
Constants.INVOKESTATIC));
body.append(Utility.createSet(fact, munger.getDelegate(weaver.getLazyClassGen().getType())));
} else {
UnresolvedType theAspect = munger.getAspect();
body.append(fact.createInvoke(theAspect.getName(), "aspectOf", "()" + theAspect.getSignature(),
Constants.INVOKESTATIC));
if (rm.getArity() != 0) {
body.append(InstructionConstants.ALOAD_0);
}
body.append(fact.createInvoke(rm.getDeclaringType().getName(), rm.getName(), rm.getSignature(),
Constants.INVOKEVIRTUAL));
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
body.append(Utility.createSet(fact, munger.getDelegate(weaver.getLazyClassGen().getType())));
}
} else {
body.append(fact.createNew(munger.getImplClassName()));
body.append(InstructionConstants.DUP);
body.append(fact.createInvoke(munger.getImplClassName(), "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
body.append(Utility.createSet(fact, munger.getDelegate(weaver.getLazyClassGen().getType())));
}
InstructionHandle ifNonNullElse = body.append(InstructionConstants.ALOAD_0);
ifNonNull.setTarget(ifNonNullElse);
body.append(Utility.createGet(fact, munger.getDelegate(weaver.getLazyClassGen().getType())));
int pos = 0;
if (!Modifier.isStatic(introduced.getModifiers())) {
pos++;
}
Type[] paramTypes = BcelWorld.makeBcelTypes(introduced.getParameterTypes());
for (int i = 0, len = paramTypes.length; i < len; i++) {
Type paramType = paramTypes[i];
body.append(InstructionFactory.createLoad(paramType, pos));
pos += paramType.getSize();
}
body.append(Utility.createInvoke(fact, Constants.INVOKEINTERFACE, introduced));
body.append(InstructionFactory.createReturn(bcelReturnType));
mg.getBody().append(body);
weaver.addLazyMethodGen(mg);
weaver.getLazyClassGen().warnOnAddedMethod(mg.getMethod(), getSignature().getSourceLocation());
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
return true;
}
return false;
}
private boolean mungeFieldHost(BcelClassWeaver weaver, MethodDelegateTypeMunger.FieldHostTypeMunger munger) {
LazyClassGen gen = weaver.getLazyClassGen();
if (gen.getType().isAnnotation() || gen.getType().isEnum()) {
return false;
}
munger.matches(weaver.getLazyClassGen().getType(), aspectType);
ResolvedMember host = AjcMemberMaker.itdAtDeclareParentsField(weaver.getLazyClassGen().getType(), munger.getSignature()
.getType(), aspectType);
FieldGen field = makeFieldGen(weaver.getLazyClassGen(), host);
field.setModifiers(field.getModifiers() | BcelField.AccSynthetic);
weaver.getLazyClassGen().addField(field, null);
return true;
}
private ResolvedMember getRealMemberForITDFromAspect(ResolvedType aspectType, ResolvedMember lookingFor, boolean isCtorRelated) {
World world = aspectType.getWorld();
boolean debug = false;
if (debug) {
System.err.println("Searching for a member on type: " + aspectType);
System.err.println("Member we are looking for: " + lookingFor);
}
ResolvedMember aspectMethods[] = aspectType.getDeclaredMethods();
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
UnresolvedType[] lookingForParams = lookingFor.getParameterTypes();
ResolvedMember realMember = null;
for (int i = 0; realMember == null && i < aspectMethods.length; i++) {
ResolvedMember member = aspectMethods[i];
if (member.getName().equals(lookingFor.getName())) {
UnresolvedType[] memberParams = member.getGenericParameterTypes();
if (memberParams.length == lookingForParams.length) {
if (debug) {
System.err.println("Reviewing potential candidates: " + member);
}
boolean matchOK = true;
if (isCtorRelated) {
for (int j = 0; j < memberParams.length && matchOK; j++) {
ResolvedType pMember = memberParams[j].resolve(world);
ResolvedType pLookingFor = lookingForParams[j].resolve(world);
if (pMember.isTypeVariableReference()) {
pMember = ((TypeVariableReference) pMember).getTypeVariable().getFirstBound().resolve(world);
}
if (pMember.isParameterizedType() || pMember.isGenericType()) {
pMember = pMember.getRawType().resolve(aspectType.getWorld());
}
if (pLookingFor.isTypeVariableReference()) {
pLookingFor = ((TypeVariableReference) pLookingFor).getTypeVariable().getFirstBound()
.resolve(world);
}
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (pLookingFor.isParameterizedType() || pLookingFor.isGenericType()) {
pLookingFor = pLookingFor.getRawType().resolve(world);
}
if (debug) {
System.err.println("Comparing parameter " + j + " member=" + pMember + " lookingFor="
+ pLookingFor);
}
if (!pMember.equals(pLookingFor)) {
matchOK = false;
}
}
}
if (matchOK) {
realMember = member;
}
}
}
}
if (debug && realMember == null) {
System.err.println("Didn't find a match");
}
return realMember;
}
private void addNeededSuperCallMethods(BcelClassWeaver weaver, ResolvedType onType, Set<ResolvedMember> neededSuperCalls) {
LazyClassGen gen = weaver.getLazyClassGen();
for (Iterator<ResolvedMember> iter = neededSuperCalls.iterator(); iter.hasNext();) {
ResolvedMember superMethod = iter.next();
if (weaver.addDispatchTarget(superMethod)) {
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
boolean isSuper = !superMethod.getDeclaringType().equals(gen.getType());
String dispatchName;
if (isSuper) {
dispatchName = NameMangler.superDispatchMethod(onType, superMethod.getName());
} else {
dispatchName = NameMangler.protectedDispatchMethod(onType, superMethod.getName());
}
superMethod = superMethod.resolve(weaver.getWorld());
LazyMethodGen dispatcher = makeDispatcher(gen, dispatchName, superMethod, weaver.getWorld(), isSuper);
weaver.addLazyMethodGen(dispatcher);
}
}
}
private void signalError(String msgid, BcelClassWeaver weaver, UnresolvedType onType) {
IMessage msg = MessageUtil.error(WeaverMessages.format(msgid, onType.getName()), getSourceLocation());
weaver.getWorld().getMessageHandler().handleMessage(msg);
}
private void signalError(String msgString, BcelClassWeaver weaver) {
IMessage msg = MessageUtil.error(msgString, getSourceLocation());
weaver.getWorld().getMessageHandler().handleMessage(msg);
}
private boolean mungeNewConstructor(BcelClassWeaver weaver, NewConstructorTypeMunger newConstructorTypeMunger) {
final LazyClassGen currentClass = weaver.getLazyClassGen();
final InstructionFactory fact = currentClass.getFactory();
ResolvedMember newConstructorMember = newConstructorTypeMunger.getSyntheticConstructor();
ResolvedType onType = newConstructorMember.getDeclaringType().resolve(weaver.getWorld());
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (onType.isRawType()) {
onType = onType.getGenericType();
}
if (onType.isAnnotation()) {
signalError(WeaverMessages.ITDC_ON_ANNOTATION_NOT_ALLOWED, weaver, onType);
return false;
}
if (onType.isEnum()) {
signalError(WeaverMessages.ITDC_ON_ENUM_NOT_ALLOWED, weaver, onType);
return false;
}
if (!onType.equals(currentClass.getType())) {
return false;
}
ResolvedMember explicitConstructor = newConstructorTypeMunger.getExplicitConstructor();
LazyMethodGen mg = makeMethodGen(currentClass, newConstructorMember);
mg.setEffectiveSignature(newConstructorTypeMunger.getSignature(), Shadow.ConstructorExecution, true);
if (weaver.getWorld().isInJava5Mode()) {
ResolvedMember interMethodDispatcher = AjcMemberMaker.postIntroducedConstructor(aspectType, onType,
newConstructorTypeMunger.getSignature().getParameterTypes());
AnnotationAJ annotationsOnRealMember[] = null;
ResolvedMember realMember = getRealMemberForITDFromAspect(aspectType, interMethodDispatcher, true);
if (realMember == null) {
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
} else {
annotationsOnRealMember = realMember.getAnnotations();
}
if (annotationsOnRealMember != null) {
for (int i = 0; i < annotationsOnRealMember.length; i++) {
AnnotationAJ annotationX = annotationsOnRealMember[i];
AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
mg.addAnnotation(new BcelAnnotation(ag, weaver.getWorld()));
}
}
List<DeclareAnnotation> allDecams = weaver.getWorld().getDeclareAnnotationOnMethods();
for (Iterator<DeclareAnnotation> i = allDecams.iterator(); i.hasNext();) {
DeclareAnnotation decaMC = i.next();
if (decaMC.matches(explicitConstructor, weaver.getWorld()) && mg.getEnclosingClass().getType() == aspectType) {
mg.addAnnotation(decaMC.getAnnotation());
}
}
}
if (mg.getArgumentTypes().length == 0) {
LazyMethodGen toRemove = null;
for (LazyMethodGen object : currentClass.getMethodGens()) {
if (object.getName().equals("<init>") && object.getArgumentTypes().length == 0) {
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
toRemove = object;
}
}
if (toRemove != null) {
currentClass.removeMethodGen(toRemove);
}
}
currentClass.addMethodGen(mg);
InstructionList body = mg.getBody();
UnresolvedType[] declaredParams = newConstructorTypeMunger.getSignature().getParameterTypes();
Type[] paramTypes = mg.getArgumentTypes();
int frameIndex = 1;
for (int i = 0, len = declaredParams.length; i < len; i++) {
body.append(InstructionFactory.createLoad(paramTypes[i], frameIndex));
frameIndex += paramTypes[i].getSize();
}
Member preMethod = AjcMemberMaker.preIntroducedConstructor(aspectType, onType, declaredParams);
body.append(Utility.createInvoke(fact, null, preMethod));
int arraySlot = mg.allocateLocal(1);
body.append(InstructionFactory.createStore(Type.OBJECT, arraySlot));
body.append(InstructionConstants.ALOAD_0);
UnresolvedType[] superParamTypes = explicitConstructor.getParameterTypes();
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
for (int i = 0, len = superParamTypes.length; i < len; i++) {
body.append(InstructionFactory.createLoad(Type.OBJECT, arraySlot));
body.append(Utility.createConstant(fact, i));
body.append(InstructionFactory.createArrayLoad(Type.OBJECT));
body.append(Utility.createConversion(fact, Type.OBJECT, BcelWorld.makeBcelType(superParamTypes[i])));
}
body.append(Utility.createInvoke(fact, null, explicitConstructor));
body.append(InstructionConstants.ALOAD_0);
Member postMethod = AjcMemberMaker.postIntroducedConstructor(aspectType, onType, declaredParams);
UnresolvedType[] postParamTypes = postMethod.getParameterTypes();
for (int i = 1, len = postParamTypes.length; i < len; i++) {
body.append(InstructionFactory.createLoad(Type.OBJECT, arraySlot));
body.append(Utility.createConstant(fact, superParamTypes.length + i - 1));
body.append(InstructionFactory.createArrayLoad(Type.OBJECT));
body.append(Utility.createConversion(fact, Type.OBJECT, BcelWorld.makeBcelType(postParamTypes[i])));
}
body.append(Utility.createInvoke(fact, null, postMethod));
body.append(InstructionConstants.RETURN);
return true;
}
private static LazyMethodGen makeDispatcher(LazyClassGen onGen, String dispatchName, ResolvedMember superMethod,
BcelWorld world, boolean isSuper) {
Type[] paramTypes = BcelWorld.makeBcelTypes(superMethod.getParameterTypes());
Type returnType = BcelWorld.makeBcelType(superMethod.getReturnType());
int modifiers = Modifier.PUBLIC;
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (onGen.isInterface()) {
modifiers |= Modifier.ABSTRACT;
}
LazyMethodGen mg = new LazyMethodGen(modifiers, returnType, dispatchName, paramTypes, UnresolvedType.getNames(superMethod
.getExceptions()), onGen);
InstructionList body = mg.getBody();
if (onGen.isInterface()) {
return mg;
}
InstructionFactory fact = onGen.getFactory();
int pos = 0;
body.append(InstructionFactory.createThis());
pos++;
for (int i = 0, len = paramTypes.length; i < len; i++) {
Type paramType = paramTypes[i];
body.append(InstructionFactory.createLoad(paramType, pos));
pos += paramType.getSize();
}
if (isSuper) {
body.append(Utility.createSuperInvoke(fact, world, superMethod));
} else {
body.append(Utility.createInvoke(fact, world, superMethod));
}
body.append(InstructionFactory.createReturn(returnType));
return mg;
}
private boolean mungeNewField(BcelClassWeaver weaver, NewFieldTypeMunger munger) {
munger.getInitMethod(aspectType);
LazyClassGen gen = weaver.getLazyClassGen();
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
ResolvedMember field = munger.getSignature();
ResolvedType onType = weaver.getWorld().resolve(field.getDeclaringType(), munger.getSourceLocation());
if (onType.isRawType()) {
onType = onType.getGenericType();
}
boolean onInterface = onType.isInterface();
if (onType.isAnnotation()) {
signalError(WeaverMessages.ITDF_ON_ANNOTATION_NOT_ALLOWED, weaver, onType);
return false;
}
if (onType.isEnum()) {
signalError(WeaverMessages.ITDF_ON_ENUM_NOT_ALLOWED, weaver, onType);
return false;
}
ResolvedMember interMethodBody = munger.getInitMethod(aspectType);
AnnotationAJ annotationsOnRealMember[] = null;
if (weaver.getWorld().isInJava5Mode()) {
ResolvedType toLookOn = aspectType;
if (aspectType.isRawType()) {
toLookOn = aspectType.getGenericType();
}
ResolvedMember realMember = getRealMemberForITDFromAspect(toLookOn, interMethodBody, false);
if (realMember == null) {
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
} else {
annotationsOnRealMember = realMember.getAnnotations();
}
}
if (onType.equals(gen.getType())) {
if (onInterface) {
ResolvedMember itdfieldGetter = AjcMemberMaker.interFieldInterfaceGetter(field, onType, aspectType);
LazyMethodGen mg = makeMethodGen(gen, itdfieldGetter);
gen.addMethodGen(mg);
LazyMethodGen mg1 = makeMethodGen(gen, AjcMemberMaker.interFieldInterfaceSetter(field, onType, aspectType));
gen.addMethodGen(mg1);
} else {
weaver.addInitializer(this);
ResolvedMember newField = AjcMemberMaker.interFieldClassField(field, aspectType,
munger.version == NewFieldTypeMunger.VersionTwo);
FieldGen fg = makeFieldGen(gen, newField);
if (annotationsOnRealMember != null) {
for (int i = 0; i < annotationsOnRealMember.length; i++) {
AnnotationAJ annotationX = annotationsOnRealMember[i];
AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
fg.addAnnotation(ag);
}
}
if (weaver.getWorld().isInJava5Mode()) {
String basicSignature = field.getSignature();
String genericSignature = field.getReturnType().resolve(weaver.getWorld()).getSignatureForAttribute();
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (!basicSignature.equals(genericSignature)) {
fg.addAttribute(createSignatureAttribute(gen.getConstantPool(), genericSignature));
}
}
gen.addField(fg, getSourceLocation());
}
return true;
} else if (onInterface && gen.getType().isTopmostImplementor(onType)) {
if (Modifier.isStatic(field.getModifiers())) {
throw new RuntimeException("unimplemented");
}
boolean alreadyExists = false;
if (munger.version==NewFieldTypeMunger.VersionTwo) {
for (BcelField fieldgen: gen.getFieldGens()) {
if (fieldgen.getName().equals(field.getName())) {
alreadyExists=true;
break;
}
}
}
ResolvedMember newField = AjcMemberMaker.interFieldInterfaceField(field, onType, aspectType, munger.version == NewFieldTypeMunger.VersionTwo);
String fieldName = newField.getName();
Type fieldType = BcelWorld.makeBcelType(field.getType());
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (!alreadyExists) {
weaver.addInitializer(this);
FieldGen fg = makeFieldGen(gen,newField);
if (annotationsOnRealMember != null) {
for (int i = 0; i < annotationsOnRealMember.length; i++) {
AnnotationAJ annotationX = annotationsOnRealMember[i];
AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
fg.addAnnotation(ag);
}
}
gen.addField(fg, getSourceLocation());
}
ResolvedMember itdfieldGetter = AjcMemberMaker.interFieldInterfaceGetter(field, gen.getType(), aspectType);
LazyMethodGen mg = makeMethodGen(gen, itdfieldGetter);
InstructionList il = new InstructionList();
InstructionFactory fact = gen.getFactory();
if (Modifier.isStatic(field.getModifiers())) {
il.append(fact.createFieldAccess(gen.getClassName(), fieldName, fieldType, Constants.GETSTATIC));
} else {
il.append(InstructionConstants.ALOAD_0);
il.append(fact.createFieldAccess(gen.getClassName(), fieldName, fieldType, Constants.GETFIELD));
}
il.append(InstructionFactory.createReturn(fieldType));
mg.getBody().insert(il);
gen.addMethodGen(mg);
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (munger.getDeclaredSignature() != null) {
ResolvedMember toBridgeTo = munger.getDeclaredSignature().parameterizedWith(null,
munger.getSignature().getDeclaringType().resolve(getWorld()), false, munger.getTypeVariableAliases());
boolean needsbridging = false;
if (!toBridgeTo.getReturnType().getErasureSignature()
.equals(munger.getSignature().getReturnType().getErasureSignature())) {
needsbridging = true;
}
if (needsbridging) {
ResolvedMember bridgingGetter = AjcMemberMaker.interFieldInterfaceGetter(toBridgeTo, gen.getType(), aspectType);
createBridgeMethodForITDF(weaver, gen, itdfieldGetter, bridgingGetter);
}
}
ResolvedMember itdfieldSetter = AjcMemberMaker.interFieldInterfaceSetter(field, gen.getType(), aspectType);
LazyMethodGen mg1 = makeMethodGen(gen, itdfieldSetter);
InstructionList il1 = new InstructionList();
if (Modifier.isStatic(field.getModifiers())) {
il1.append(InstructionFactory.createLoad(fieldType, 0));
il1.append(fact.createFieldAccess(gen.getClassName(), fieldName, fieldType, Constants.PUTSTATIC));
} else {
il1.append(InstructionConstants.ALOAD_0);
il1.append(InstructionFactory.createLoad(fieldType, 1));
il1.append(fact.createFieldAccess(gen.getClassName(), fieldName, fieldType, Constants.PUTFIELD));
}
il1.append(InstructionFactory.createReturn(Type.VOID));
mg1.getBody().insert(il1);
gen.addMethodGen(mg1);
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (munger.getDeclaredSignature() != null) {
ResolvedMember toBridgeTo = munger.getDeclaredSignature().parameterizedWith(null,
munger.getSignature().getDeclaringType().resolve(getWorld()), false, munger.getTypeVariableAliases());
boolean needsbridging = false;
if (!toBridgeTo.getReturnType().getErasureSignature()
.equals(munger.getSignature().getReturnType().getErasureSignature())) {
needsbridging = true;
}
if (needsbridging) {
ResolvedMember bridgingSetter = AjcMemberMaker.interFieldInterfaceSetter(toBridgeTo, gen.getType(), aspectType);
createBridgeMethodForITDF(weaver, gen, itdfieldSetter, bridgingSetter);
}
}
return true;
} else {
return false;
}
}
private void createBridgeMethodForITDF(BcelClassWeaver weaver, LazyClassGen gen, ResolvedMember itdfieldSetter,
ResolvedMember bridgingSetter) {
InstructionFactory fact;
LazyMethodGen bridgeMethod = makeMethodGen(gen, bridgingSetter);
bridgeMethod.setAccessFlags(bridgeMethod.getAccessFlags() | 0x00000040);
Type[] paramTypes = BcelWorld.makeBcelTypes(bridgingSetter.getParameterTypes());
Type[] bridgingToParms = BcelWorld.makeBcelTypes(itdfieldSetter.getParameterTypes());
Type returnType = BcelWorld.makeBcelType(bridgingSetter.getReturnType());
InstructionList body = bridgeMethod.getBody();
fact = gen.getFactory();
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
int pos = 0;
if (!Modifier.isStatic(bridgingSetter.getModifiers())) {
body.append(InstructionFactory.createThis());
pos++;
}
for (int i = 0, len = paramTypes.length; i < len; i++) {
Type paramType = paramTypes[i];
body.append(InstructionFactory.createLoad(paramType, pos));
if (!bridgingSetter.getParameterTypes()[i].getErasureSignature().equals(
itdfieldSetter.getParameterTypes()[i].getErasureSignature())) {
body.append(fact.createCast(paramType, bridgingToParms[i]));
}
pos += paramType.getSize();
}
body.append(Utility.createInvoke(fact, weaver.getWorld(), itdfieldSetter));
body.append(InstructionFactory.createReturn(returnType));
gen.addMethodGen(bridgeMethod);
}
@Override
public ConcreteTypeMunger parameterizedFor(ResolvedType target) {
return new BcelTypeMunger(munger.parameterizedFor(target), aspectType);
}
@Override
public ConcreteTypeMunger parameterizeWith(Map<String, UnresolvedType> m, World w) {
return new BcelTypeMunger(munger.parameterizeWith(m, w), aspectType);
}
/**
* Returns a list of type variable aliases used in this munger. For example, if the ITD is 'int I<A,B>.m(List<A> las,List<B>
* lbs) {}' then this returns a list containing the strings "A" and "B".
*/
|
386,049
|
Bug 386049 Error "must implement abstract inter-type declaration" even though build is fine
| null |
verified fixed
|
7c6e936
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T19:43:56Z
| 2012-07-26T13:40:00Z
|
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
public List<String> getTypeVariableAliases() {
return munger.getTypeVariableAliases();
}
@Override
public boolean equals(Object other) {
if (!(other instanceof BcelTypeMunger)) {
return false;
}
BcelTypeMunger o = (BcelTypeMunger) other;
return ((o.getMunger() == null) ? (getMunger() == null) : o.getMunger().equals(getMunger()))
&& ((o.getAspectType() == null) ? (getAspectType() == null) : o.getAspectType().equals(getAspectType()));
}
private volatile int hashCode = 0;
@Override
public int hashCode() {
if (hashCode == 0) {
int result = 17;
result = 37 * result + ((getMunger() == null) ? 0 : getMunger().hashCode());
result = 37 * result + ((getAspectType() == null) ? 0 : getAspectType().hashCode());
hashCode = result;
}
return hashCode;
}
}
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.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.ajdt.internal.compiler.problem;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Modifier;
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.DeclareAnnotationDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.Proceed;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.lookup.InterTypeMethodBinding;
import org.aspectj.ajdt.internal.compiler.lookup.PrivilegedFieldBinding;
import org.aspectj.bridge.context.CompilationAndWeavingContext;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
import org.aspectj.org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
import org.aspectj.org.eclipse.jdt.internal.compiler.IProblemFactory;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IPrivilegedHandler;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.AjcMemberMaker;
import org.aspectj.weaver.ConcreteTypeMunger;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.DeclareParents;
import org.aspectj.weaver.patterns.DeclareSoft;
import org.aspectj.weaver.patterns.TypePattern;
/**
* Extends problem reporter to support compiler-side implementation of declare soft. Also overrides error reporting for the need to
* implement abstract methods to account for inter-type declarations and pointcut declarations. This second job might be better done
* directly in the SourceTypeBinding/ClassScope classes.
*
* @author Jim Hugunin
*/
public class AjProblemReporter extends ProblemReporter {
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
private static final boolean DUMP_STACK = false;
public EclipseFactory factory;
public AjProblemReporter(IErrorHandlingPolicy policy, CompilerOptions options, IProblemFactory problemFactory) {
super(policy, options, problemFactory);
}
public void unhandledException(TypeBinding exceptionType, ASTNode location) {
if (!factory.getWorld().getDeclareSoft().isEmpty()) {
Shadow callSite = factory.makeShadow(location, referenceContext);
Shadow enclosingExec = factory.makeShadow(referenceContext);
if ((callSite == null) && (enclosingExec.getKind() == Shadow.ConstructorExecution)
&& (location instanceof ExplicitConstructorCall)) {
super.unhandledException(exceptionType, location);
return;
}
for (Iterator i = factory.getWorld().getDeclareSoft().iterator(); i.hasNext();) {
DeclareSoft d = (DeclareSoft) i.next();
ResolvedType throwException = factory.fromEclipse((ReferenceBinding) exceptionType);
FuzzyBoolean isExceptionTypeOrSubtype = d.getException().matchesInstanceof(throwException);
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
if (!isExceptionTypeOrSubtype.alwaysTrue())
continue;
if (callSite != null) {
FuzzyBoolean match = d.getPointcut().match(callSite);
if (match.alwaysTrue()) {
return;
} else if (!match.alwaysFalse()) {
}
}
if (enclosingExec != null) {
FuzzyBoolean match = d.getPointcut().match(enclosingExec);
if (match.alwaysTrue()) {
return;
} else if (!match.alwaysFalse()) {
}
}
}
}
if (location instanceof Proceed) {
return;
}
super.unhandledException(exceptionType, location);
}
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
private boolean isPointcutDeclaration(MethodBinding binding) {
return CharOperation.prefixEquals(PointcutDeclaration.mangledPrefix, binding.selector);
}
private boolean isIntertypeDeclaration(MethodBinding binding) {
return (binding instanceof InterTypeMethodBinding);
}
public void abstractMethodCannotBeOverridden(SourceTypeBinding type, MethodBinding concreteMethod) {
if (isPointcutDeclaration(concreteMethod)) {
return;
}
super.abstractMethodCannotBeOverridden(type, concreteMethod);
}
public void inheritedMethodReducesVisibility(SourceTypeBinding type, MethodBinding concreteMethod,
MethodBinding[] abstractMethods) {
ResolvedType onTypeX = null;
if (!type.isAnonymousType()) {
onTypeX = factory.fromEclipse(type);
} else {
onTypeX = factory.fromEclipse(type.superclass());
}
for (Iterator i = onTypeX.getInterTypeMungersIncludingSupers().iterator(); i.hasNext();) {
ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
ResolvedMember sig = m.getSignature();
if (!Modifier.isAbstract(sig.getModifiers())) {
if (ResolvedType.matches(
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
AjcMemberMaker.interMethod(sig, m.getAspectType(), sig.getDeclaringType().resolve(factory.getWorld())
.isInterface()), factory.makeResolvedMember(concreteMethod))) {
return;
}
}
}
super.inheritedMethodReducesVisibility(type, concreteMethod, abstractMethods);
}
public void staticAndInstanceConflict(MethodBinding currentMethod, MethodBinding inheritedMethod) {
if (currentMethod instanceof InterTypeMethodBinding)
return;
if (inheritedMethod instanceof InterTypeMethodBinding)
return;
super.staticAndInstanceConflict(currentMethod, inheritedMethod);
}
public void abstractMethodMustBeImplemented(SourceTypeBinding type, MethodBinding abstractMethod) {
if (isPointcutDeclaration(abstractMethod))
return;
if (isIntertypeDeclaration(abstractMethod))
return;
if (CharOperation.prefixEquals("ajc$interField".toCharArray(), abstractMethod.selector)) {
return;
}
ResolvedType onTypeX = null;
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
if (!type.isAnonymousType()) {
onTypeX = factory.fromEclipse(type);
} else {
onTypeX = factory.fromEclipse(type.superclass());
}
if (onTypeX.isRawType())
onTypeX = onTypeX.getGenericType();
List<ConcreteTypeMunger> mungers = onTypeX.getInterTypeMungersIncludingSupers();
for (ConcreteTypeMunger m : mungers) {
ResolvedMember sig = m.getSignature();
if (sig != null && !Modifier.isAbstract(sig.getModifiers())) {
ResolvedMember abstractMember = factory.makeResolvedMember(abstractMethod);
if (abstractMember.getName().startsWith("ajc$interMethodDispatch")) {
ResolvedType dType = factory.getWorld().resolve(sig.getDeclaringType(), false);
if (ResolvedType.matches(AjcMemberMaker.interMethod(sig, m.getAspectType(), dType.isInterface()),
abstractMember)) {
return;
}
} else {
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
if (ResolvedType.matches(sig, factory.makeResolvedMember(abstractMethod)))
return;
}
}
}
super.abstractMethodMustBeImplemented(type, abstractMethod);
}
/*
* (non-Javadoc)
*
* @see
* org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter#disallowedTargetForAnnotation(org.aspectj.org.eclipse
* .jdt.internal.compiler.ast.Annotation)
*/
public void disallowedTargetForAnnotation(Annotation annotation) {
if (annotation.recipient instanceof MethodBinding) {
MethodBinding binding = (MethodBinding) annotation.recipient;
String name = new String(binding.selector);
if (name.startsWith("ajc$")) {
long metaTagBits = annotation.resolvedType.getAnnotationTagBits();
if (name.indexOf("interField") != -1) {
if ((metaTagBits & TagBits.AnnotationForField) != 0)
return;
} else if (name.indexOf("interConstructor") != -1) {
if ((metaTagBits & TagBits.AnnotationForConstructor) != 0)
return;
} else if (name.indexOf("interMethod") != -1) {
if ((metaTagBits & TagBits.AnnotationForMethod) != 0)
return;
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
} else if (name.indexOf("declare_" + DeclareAnnotation.AT_TYPE + "_") != -1) {
if ((metaTagBits & TagBits.AnnotationForAnnotationType) != 0 || (metaTagBits & TagBits.AnnotationForType) != 0)
return;
} else if (name.indexOf("declare_" + DeclareAnnotation.AT_FIELD + "_") != -1) {
if ((metaTagBits & TagBits.AnnotationForField) != 0)
return;
} else if (name.indexOf("declare_" + DeclareAnnotation.AT_CONSTRUCTOR + "_") != -1) {
if ((metaTagBits & TagBits.AnnotationForConstructor) != 0)
return;
} else if (name.indexOf("declare_eow") != -1) {
if ((metaTagBits & TagBits.AnnotationForField) != 0)
return;
}
}
}
super.disallowedTargetForAnnotation(annotation);
}
public void overridesPackageDefaultMethod(MethodBinding localMethod, MethodBinding inheritedMethod) {
if (new String(localMethod.selector).startsWith("ajc$"))
return;
super.overridesPackageDefaultMethod(localMethod, inheritedMethod);
}
public void handle(int problemId, String[] problemArguments, String[] messageArguments, int severity, int problemStartPosition,
int problemEndPosition, ReferenceContext referenceContext, CompilationResult unitResult) {
if (severity != ProblemSeverities.Ignore && DUMP_STACK) {
Thread.dumpStack();
}
super.handle(problemId, problemArguments,
0,
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
messageArguments, severity, problemStartPosition, problemEndPosition,
referenceContext, unitResult);
}
public void javadocMissingParamTag(char[] name, int sourceStart, int sourceEnd, int modifiers) {
boolean reportIt = true;
String sName = new String(name);
if (sName.startsWith("ajc$"))
reportIt = false;
if (sName.equals("thisJoinPoint"))
reportIt = false;
if (sName.equals("thisJoinPointStaticPart"))
reportIt = false;
if (sName.equals("thisEnclosingJoinPointStaticPart"))
reportIt = false;
if (sName.equals("ajc_aroundClosure"))
reportIt = false;
if (reportIt)
super.javadocMissingParamTag(name, sourceStart, sourceEnd, modifiers);
}
public void abstractMethodInAbstractClass(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) {
String abstractMethodName = new String(methodDecl.selector);
if (abstractMethodName.startsWith("ajc$pointcut")) {
return;
}
String[] arguments = new String[] { new String(type.sourceName()), abstractMethodName };
super.handle(IProblem.AbstractMethodInAbstractClass, arguments, arguments, methodDecl.sourceStart, methodDecl.sourceEnd,
this.referenceContext, this.referenceContext == null ? null : this.referenceContext.compilationResult());
}
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
/**
* Called when there is an ITD marked @override that doesn't override a supertypes method. The method and the binding are passed
* - some information is useful from each. The 'method' knows about source offsets for the message, the 'binding' has the
* signature of what the ITD is trying to be in the target class.
*/
public void itdMethodMustOverride(AbstractMethodDeclaration method, MethodBinding binding) {
this.handle(IProblem.MethodMustOverride,
new String[] { new String(binding.selector), typesAsString(binding.isVarargs(), binding.parameters, false),
new String(binding.declaringClass.readableName()), },
new String[] { new String(binding.selector), typesAsString(binding.isVarargs(), binding.parameters, true),
new String(binding.declaringClass.shortReadableName()), }, method.sourceStart, method.sourceEnd,
this.referenceContext, this.referenceContext == null ? null : this.referenceContext.compilationResult());
}
/**
* Overrides the implementation in ProblemReporter and is ITD aware. To report a *real* problem with an ITD marked @override,
* the other methodMustOverride() method is used.
*/
public void methodMustOverride(AbstractMethodDeclaration method, long complianceLevel) {
if (new String(method.selector).startsWith("ajc$"))
return;
ResolvedMember possiblyErroneousRm = factory.makeResolvedMember(method.binding);
ResolvedType onTypeX = factory.fromEclipse(method.binding.declaringClass);
ResolvedType supertypeToLookAt = onTypeX.getSuperclass();
while (supertypeToLookAt != null) {
List itMungers = supertypeToLookAt.getInterTypeMungers();
for (Iterator i = itMungers.iterator(); i.hasNext();) {
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
ResolvedMember sig = m.getSignature();
if (sig == null)
continue;
UnresolvedType dType = sig.getDeclaringType();
if (dType == null)
continue;
ResolvedType resolvedDeclaringType = dType.resolve(factory.getWorld());
ResolvedMember rm = AjcMemberMaker.interMethod(sig, m.getAspectType(), resolvedDeclaringType.isInterface());
if (ResolvedType.matches(rm, possiblyErroneousRm)) {
return;
}
}
supertypeToLookAt = supertypeToLookAt.getSuperclass();
}
super.methodMustOverride(method,complianceLevel);
}
private String typesAsString(boolean isVarargs, TypeBinding[] types, boolean makeShort) {
StringBuffer buffer = new StringBuffer(10);
for (int i = 0, length = types.length; i < length; i++) {
if (i != 0)
buffer.append(", ");
TypeBinding type = types[i];
boolean isVarargType = isVarargs && i == length - 1;
if (isVarargType)
type = ((ArrayBinding) type).elementsType();
buffer.append(new String(makeShort ? type.shortReadableName() : type.readableName()));
if (isVarargType)
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
buffer.append("...");
}
return buffer.toString();
}
public void visibilityConflict(MethodBinding currentMethod, MethodBinding inheritedMethod) {
if (isIntertypeDeclaration(currentMethod) && isIntertypeDeclaration(inheritedMethod)
&& Modifier.isPrivate(currentMethod.modifiers) && Modifier.isPrivate(inheritedMethod.modifiers)) {
return;
}
super.visibilityConflict(currentMethod, inheritedMethod);
}
public void unusedPrivateType(TypeDeclaration typeDecl) {
if (typeDecl instanceof AspectDeclaration)
return;
if (typeDecl.enclosingType != null && (typeDecl.enclosingType instanceof AspectDeclaration)) {
AspectDeclaration ad = (AspectDeclaration) typeDecl.enclosingType;
if (ad.concreteName != null) {
List declares = ad.concreteName.declares;
for (Iterator iter = declares.iterator(); iter.hasNext();) {
Object dec = iter.next();
if (dec instanceof DeclareParents) {
DeclareParents decp = (DeclareParents) dec;
TypePattern[] newparents = decp.getParents().getTypePatterns();
for (int i = 0; i < newparents.length; i++) {
TypePattern pattern = newparents[i];
UnresolvedType ut = pattern.getExactType();
if (ut == null)
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
continue;
if (CharOperation.compareWith(typeDecl.binding.signature(), ut.getSignature().toCharArray()) == 0)
return;
}
}
}
}
}
super.unusedPrivateType(typeDecl);
}
public void abstractMethodInConcreteClass(SourceTypeBinding type) {
if (type.scope!=null && type.scope.referenceContext instanceof AspectDeclaration) {
return;
}
super.abstractMethodInConcreteClass(type);
}
public void unusedPrivateField(FieldDeclaration fieldDecl) {
if (fieldDecl!=null && fieldDecl.binding != null && fieldDecl.binding.declaringClass != null) {
ReferenceBinding type = fieldDecl.binding.declaringClass;
ResolvedType weaverType = null;
if (!type.isAnonymousType()) {
weaverType = factory.fromEclipse(type);
} else {
weaverType = factory.fromEclipse(type.superclass());
}
Set checked = new HashSet();
for (Iterator i = weaverType.getInterTypeMungersIncludingSupers().iterator(); i.hasNext();) {
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
ResolvedType theAspect = m.getAspectType();
if (!checked.contains(theAspect)) {
TypeBinding tb = factory.makeTypeBinding(m.getAspectType());
if (tb instanceof SourceTypeBinding) {
IPrivilegedHandler privilegedHandler = ((SourceTypeBinding) tb).privilegedHandler;
if (privilegedHandler != null) {
if (privilegedHandler.definesPrivilegedAccessToField(fieldDecl.binding)) {
return;
}
} else if (theAspect instanceof ReferenceType) {
String fname = new String(fieldDecl.name);
Collectionprivvies = ((ReferenceType) theAspect).getPrivilegedAccesses();
if (privvies != null) {
for (Iterator iterator = privvies.iterator(); iterator.hasNext();) {
ResolvedMember priv = (ResolvedMember) iterator.next();
if (priv.getName().equals(fname)) {
return;
}
}
}
}
}
checked.add(theAspect);
}
}
}
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
super.unusedPrivateField(fieldDecl);
}
public void unusedPrivateMethod(AbstractMethodDeclaration methodDecl) {
if (!(methodDecl instanceof PointcutDeclaration))
super.unusedPrivateMethod(methodDecl);
}
public void caseExpressionMustBeConstant(Expression expression) {
if (expression instanceof QualifiedNameReference) {
QualifiedNameReference qnr = (QualifiedNameReference) expression;
if (qnr.otherBindings != null && qnr.otherBindings.length > 0 && qnr.otherBindings[0] instanceof PrivilegedFieldBinding) {
super.signalError(expression.sourceStart, expression.sourceEnd,
"Fields accessible due to an aspect being privileged can not be used in switch statements");
referenceContext.tagAsHavingErrors();
return;
}
}
super.caseExpressionMustBeConstant(expression);
}
public void unusedArgument(LocalDeclaration localDecl) {
String argType = new String(localDecl.type.resolvedType.signature());
if (argType.startsWith("Lorg/aspectj/runtime/internal"))
return;
if (localDecl instanceof Argument) {
Argument arg = (Argument) localDecl;
if (arg.binding != null && arg.binding.declaringScope != null) {
ReferenceContext context = arg.binding.declaringScope.referenceContext();
if (context != null && context instanceof PointcutDeclaration)
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
return;
}
}
if (new String(localDecl.name).startsWith("ajc$")) {
return;
}
super.unusedArgument(localDecl);
}
/**
* A side-effect of the way that we handle itds on default methods on top-most implementors of interfaces is that a class
* acquiring a final default ITD will erroneously report that it can't override its own member. This method detects that
* situation.
*/
public void finalMethodCannotBeOverridden(MethodBinding currentMethod, MethodBinding inheritedMethod) {
if (currentMethod == inheritedMethod)
return;
super.finalMethodCannotBeOverridden(currentMethod, inheritedMethod);
}
/**
* The method verifier is a bit 'keen' and doesn't cope well with ITDMs which are of course to be considered a 'default'
* implementation if the target type doesn't supply one. This test may not be complete - it is possible that it should read if
* *either* is an ITD...but I dont have a testcase that shows that is required. yet. (pr115788)
*/
public void duplicateInheritedMethods(SourceTypeBinding type, MethodBinding inheritedMethod1, MethodBinding inheritedMethod2) {
if (inheritedMethod1 instanceof InterTypeMethodBinding || inheritedMethod2 instanceof InterTypeMethodBinding)
return;
if ((inheritedMethod1 instanceof ParameterizedMethodBinding)
&& ((ParameterizedMethodBinding) inheritedMethod1).original() instanceof InterTypeMethodBinding)
return;
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
if ((inheritedMethod2 instanceof ParameterizedMethodBinding)
&& ((ParameterizedMethodBinding) inheritedMethod2).original() instanceof InterTypeMethodBinding)
return;
super.duplicateInheritedMethods(type, inheritedMethod1, inheritedMethod2);
}
/**
* All problems end up routed through here at some point...
*/
public IProblem createProblem(char[] fileName, int problemId, String[] problemArguments, String[] messageArguments,
int severity, int problemStartPosition, int problemEndPosition, int lineNumber) {
IProblem problem = super.createProblem(fileName, problemId, problemArguments, messageArguments, severity,
problemStartPosition, problemEndPosition, lineNumber, 0);
if (factory.getWorld().isInPinpointMode()) {
MessageIssued ex = new MessageIssued();
ex.fillInStackTrace();
StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw));
StringBuffer sb = new StringBuffer();
sb.append(CompilationAndWeavingContext.getCurrentContext());
sb.append(sw.toString());
problem = new PinpointedProblem(problem, sb.toString());
}
return problem;
}
private static class MessageIssued extends RuntimeException {
public String getMessage() {
return "message issued...";
}
}
private static class PinpointedProblem implements IProblem {
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
private IProblem delegate;
private String message;
public PinpointedProblem(IProblem aProblem, String pinpoint) {
this.delegate = aProblem;
if (delegate.getMessage().indexOf("message issued...") == -1) {
this.message = delegate.getMessage() + "\n" + pinpoint;
} else {
this.message = delegate.getMessage();
}
}
public String[] getArguments() {
return delegate.getArguments();
}
public int getID() {
return delegate.getID();
}
public String getMessage() {
return message;
}
public char[] getOriginatingFileName() {
return delegate.getOriginatingFileName();
}
public int getSourceEnd() {
return delegate.getSourceEnd();
}
public int getSourceLineNumber() {
return delegate.getSourceLineNumber();
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
}
public int getSourceStart() {
return delegate.getSourceStart();
}
public boolean isError() {
return delegate.isError();
}
public boolean isWarning() {
return delegate.isWarning();
}
public void setSourceEnd(int sourceEnd) {
delegate.setSourceEnd(sourceEnd);
}
public void setSourceLineNumber(int lineNumber) {
delegate.setSourceLineNumber(lineNumber);
}
public void setSourceStart(int sourceStart) {
delegate.setSourceStart(sourceStart);
}
public void setSeeAlsoProblems(IProblem[] problems) {
delegate.setSeeAlsoProblems(problems);
}
public IProblem[] seeAlso() {
return delegate.seeAlso();
}
public void setSupplementaryMessageInfo(String msg) {
delegate.setSupplementaryMessageInfo(msg);
}
public String getSupplementaryMessageInfo() {
return delegate.getSupplementaryMessageInfo();
|
387,718
|
Bug 387718 RuntimeException when trying to compile broken code
|
java.lang.RuntimeException at org.aspectj.weaver.NameMangler.makeVisibilityName(NameMangler.java:297) at org.aspectj.weaver.NameMangler.interMethod(NameMangler.java:242) at org.aspectj.weaver.AjcMemberMaker.interMethod(AjcMemberMaker.java:538) at org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter.methodMustOverride(AjProblemReporter.java:385) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(M ... dJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: RuntimeException thrown: protected inter-types not allowed
|
resolved fixed
|
cbb6f5a
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-22T20:13:54Z
| 2012-08-21T17:26:40Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
}
}
public void duplicateMethodInType(SourceTypeBinding type, AbstractMethodDeclaration methodDecl, boolean equalParameters, int severity) {
if (new String(methodDecl.selector).startsWith("ajc$interMethod")) {
return;
}
super.duplicateMethodInType(type, methodDecl, equalParameters, severity);
}
public void parseErrorInsertAfterToken(int start, int end, int currentKind, char[] errorTokenSource, String errorTokenName,
String expectedToken) {
if (expectedToken.equals("privileged")) {
super.parseErrorNoSuggestion(start, end, currentKind, errorTokenSource, errorTokenName);
} else {
super.parseErrorInsertAfterToken(start, end, currentKind, errorTokenSource, errorTokenName, expectedToken);
}
}
public void missingValueForAnnotationMember(Annotation annotation, char[] memberName) {
if (referenceContext instanceof DeclareAnnotationDeclaration) {
if (((DeclareAnnotationDeclaration) referenceContext).isRemover()) {
return;
}
}
super.missingValueForAnnotationMember(annotation, memberName);
}
}
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.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.ajdt.internal.compiler.problem;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Modifier;
import java.util.Collection;
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.DeclareAnnotationDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.Proceed;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.lookup.InterTypeMethodBinding;
import org.aspectj.ajdt.internal.compiler.lookup.PrivilegedFieldBinding;
import org.aspectj.bridge.context.CompilationAndWeavingContext;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
import org.aspectj.org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
import org.aspectj.org.eclipse.jdt.internal.compiler.IProblemFactory;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IPrivilegedHandler;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.AjcMemberMaker;
import org.aspectj.weaver.ConcreteTypeMunger;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.ResolvedTypeMunger;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.DeclareParents;
import org.aspectj.weaver.patterns.DeclareSoft;
import org.aspectj.weaver.patterns.TypePattern;
/**
* Extends problem reporter to support compiler-side implementation of declare soft. Also overrides error reporting for the need to
* implement abstract methods to account for inter-type declarations and pointcut declarations. This second job might be better done
* directly in the SourceTypeBinding/ClassScope classes.
*
* @author Jim Hugunin
*/
public class AjProblemReporter extends ProblemReporter {
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
private static final boolean DUMP_STACK = false;
public EclipseFactory factory;
public AjProblemReporter(IErrorHandlingPolicy policy, CompilerOptions options, IProblemFactory problemFactory) {
super(policy, options, problemFactory);
}
public void unhandledException(TypeBinding exceptionType, ASTNode location) {
if (!factory.getWorld().getDeclareSoft().isEmpty()) {
Shadow callSite = factory.makeShadow(location, referenceContext);
Shadow enclosingExec = factory.makeShadow(referenceContext);
if ((callSite == null) && (enclosingExec.getKind() == Shadow.ConstructorExecution)
&& (location instanceof ExplicitConstructorCall)) {
super.unhandledException(exceptionType, location);
return;
}
for (Iterator i = factory.getWorld().getDeclareSoft().iterator(); i.hasNext();) {
DeclareSoft d = (DeclareSoft) i.next();
ResolvedType throwException = factory.fromEclipse((ReferenceBinding) exceptionType);
FuzzyBoolean isExceptionTypeOrSubtype = d.getException().matchesInstanceof(throwException);
if (!isExceptionTypeOrSubtype.alwaysTrue())
continue;
if (callSite != null) {
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
FuzzyBoolean match = d.getPointcut().match(callSite);
if (match.alwaysTrue()) {
return;
} else if (!match.alwaysFalse()) {
}
}
if (enclosingExec != null) {
FuzzyBoolean match = d.getPointcut().match(enclosingExec);
if (match.alwaysTrue()) {
return;
} else if (!match.alwaysFalse()) {
}
}
}
}
if (location instanceof Proceed) {
return;
}
super.unhandledException(exceptionType, location);
}
private boolean isPointcutDeclaration(MethodBinding binding) {
return CharOperation.prefixEquals(PointcutDeclaration.mangledPrefix, binding.selector);
}
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
private boolean isIntertypeDeclaration(MethodBinding binding) {
return (binding instanceof InterTypeMethodBinding);
}
public void abstractMethodCannotBeOverridden(SourceTypeBinding type, MethodBinding concreteMethod) {
if (isPointcutDeclaration(concreteMethod)) {
return;
}
super.abstractMethodCannotBeOverridden(type, concreteMethod);
}
public void inheritedMethodReducesVisibility(SourceTypeBinding type, MethodBinding concreteMethod,
MethodBinding[] abstractMethods) {
ResolvedType onTypeX = null;
if (!type.isAnonymousType()) {
onTypeX = factory.fromEclipse(type);
} else {
onTypeX = factory.fromEclipse(type.superclass());
}
for (Iterator i = onTypeX.getInterTypeMungersIncludingSupers().iterator(); i.hasNext();) {
ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
ResolvedMember sig = m.getSignature();
if (!Modifier.isAbstract(sig.getModifiers())) {
if (ResolvedType.matches(
AjcMemberMaker.interMethod(sig, m.getAspectType(), sig.getDeclaringType().resolve(factory.getWorld())
.isInterface()), factory.makeResolvedMember(concreteMethod))) {
return;
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
}
}
}
super.inheritedMethodReducesVisibility(type, concreteMethod, abstractMethods);
}
public void staticAndInstanceConflict(MethodBinding currentMethod, MethodBinding inheritedMethod) {
if (currentMethod instanceof InterTypeMethodBinding)
return;
if (inheritedMethod instanceof InterTypeMethodBinding)
return;
super.staticAndInstanceConflict(currentMethod, inheritedMethod);
}
public void abstractMethodMustBeImplemented(SourceTypeBinding type, MethodBinding abstractMethod) {
if (isPointcutDeclaration(abstractMethod))
return;
if (isIntertypeDeclaration(abstractMethod))
return;
if (CharOperation.prefixEquals("ajc$interField".toCharArray(), abstractMethod.selector)) {
return;
}
ResolvedType onTypeX = null;
if (!type.isAnonymousType()) {
onTypeX = factory.fromEclipse(type);
} else {
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
onTypeX = factory.fromEclipse(type.superclass());
}
if (onTypeX.isRawType())
onTypeX = onTypeX.getGenericType();
List<ConcreteTypeMunger> mungers = onTypeX.getInterTypeMungersIncludingSupers();
for (ConcreteTypeMunger m : mungers) {
ResolvedMember sig = m.getSignature();
if (sig != null && !Modifier.isAbstract(sig.getModifiers())) {
ResolvedMember abstractMember = factory.makeResolvedMember(abstractMethod);
if (abstractMember.getName().startsWith("ajc$interMethodDispatch")) {
ResolvedType dType = factory.getWorld().resolve(sig.getDeclaringType(), false);
if (ResolvedType.matches(AjcMemberMaker.interMethod(sig, m.getAspectType(), dType.isInterface()),
abstractMember)) {
return;
}
} else {
if (ResolvedType.matches(sig, factory.makeResolvedMember(abstractMethod)))
return;
}
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
}
}
super.abstractMethodMustBeImplemented(type, abstractMethod);
}
/*
* (non-Javadoc)
*
* @see
* org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter#disallowedTargetForAnnotation(org.aspectj.org.eclipse
* .jdt.internal.compiler.ast.Annotation)
*/
public void disallowedTargetForAnnotation(Annotation annotation) {
if (annotation.recipient instanceof MethodBinding) {
MethodBinding binding = (MethodBinding) annotation.recipient;
String name = new String(binding.selector);
if (name.startsWith("ajc$")) {
long metaTagBits = annotation.resolvedType.getAnnotationTagBits();
if (name.indexOf("interField") != -1) {
if ((metaTagBits & TagBits.AnnotationForField) != 0)
return;
} else if (name.indexOf("interConstructor") != -1) {
if ((metaTagBits & TagBits.AnnotationForConstructor) != 0)
return;
} else if (name.indexOf("interMethod") != -1) {
if ((metaTagBits & TagBits.AnnotationForMethod) != 0)
return;
} else if (name.indexOf("declare_" + DeclareAnnotation.AT_TYPE + "_") != -1) {
if ((metaTagBits & TagBits.AnnotationForAnnotationType) != 0 || (metaTagBits & TagBits.AnnotationForType) != 0)
return;
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
} else if (name.indexOf("declare_" + DeclareAnnotation.AT_FIELD + "_") != -1) {
if ((metaTagBits & TagBits.AnnotationForField) != 0)
return;
} else if (name.indexOf("declare_" + DeclareAnnotation.AT_CONSTRUCTOR + "_") != -1) {
if ((metaTagBits & TagBits.AnnotationForConstructor) != 0)
return;
} else if (name.indexOf("declare_eow") != -1) {
if ((metaTagBits & TagBits.AnnotationForField) != 0)
return;
}
}
}
super.disallowedTargetForAnnotation(annotation);
}
public void overridesPackageDefaultMethod(MethodBinding localMethod, MethodBinding inheritedMethod) {
if (new String(localMethod.selector).startsWith("ajc$"))
return;
super.overridesPackageDefaultMethod(localMethod, inheritedMethod);
}
public void handle(int problemId, String[] problemArguments, String[] messageArguments, int severity, int problemStartPosition,
int problemEndPosition, ReferenceContext referenceContext, CompilationResult unitResult) {
if (severity != ProblemSeverities.Ignore && DUMP_STACK) {
Thread.dumpStack();
}
super.handle(problemId, problemArguments,
0,
messageArguments, severity, problemStartPosition, problemEndPosition,
referenceContext, unitResult);
}
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
public void javadocMissingParamTag(char[] name, int sourceStart, int sourceEnd, int modifiers) {
boolean reportIt = true;
String sName = new String(name);
if (sName.startsWith("ajc$"))
reportIt = false;
if (sName.equals("thisJoinPoint"))
reportIt = false;
if (sName.equals("thisJoinPointStaticPart"))
reportIt = false;
if (sName.equals("thisEnclosingJoinPointStaticPart"))
reportIt = false;
if (sName.equals("ajc_aroundClosure"))
reportIt = false;
if (reportIt)
super.javadocMissingParamTag(name, sourceStart, sourceEnd, modifiers);
}
public void abstractMethodInAbstractClass(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) {
String abstractMethodName = new String(methodDecl.selector);
if (abstractMethodName.startsWith("ajc$pointcut")) {
return;
}
String[] arguments = new String[] { new String(type.sourceName()), abstractMethodName };
super.handle(IProblem.AbstractMethodInAbstractClass, arguments, arguments, methodDecl.sourceStart, methodDecl.sourceEnd,
this.referenceContext, this.referenceContext == null ? null : this.referenceContext.compilationResult());
}
/**
* Called when there is an ITD marked @override that doesn't override a supertypes method. The method and the binding are passed
* - some information is useful from each. The 'method' knows about source offsets for the message, the 'binding' has the
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
* signature of what the ITD is trying to be in the target class.
*/
public void itdMethodMustOverride(AbstractMethodDeclaration method, MethodBinding binding) {
this.handle(IProblem.MethodMustOverride,
new String[] { new String(binding.selector), typesAsString(binding.isVarargs(), binding.parameters, false),
new String(binding.declaringClass.readableName()), },
new String[] { new String(binding.selector), typesAsString(binding.isVarargs(), binding.parameters, true),
new String(binding.declaringClass.shortReadableName()), }, method.sourceStart, method.sourceEnd,
this.referenceContext, this.referenceContext == null ? null : this.referenceContext.compilationResult());
}
/**
* Overrides the implementation in ProblemReporter and is ITD aware. To report a *real* problem with an ITD marked @override,
* the other methodMustOverride() method is used.
*/
public void methodMustOverride(AbstractMethodDeclaration method, long complianceLevel) {
if (new String(method.selector).startsWith("ajc$"))
return;
ResolvedMember possiblyErroneousRm = factory.makeResolvedMember(method.binding);
ResolvedType onTypeX = factory.fromEclipse(method.binding.declaringClass);
ResolvedType supertypeToLookAt = onTypeX.getSuperclass();
while (supertypeToLookAt != null) {
List<ConcreteTypeMunger> itMungers = supertypeToLookAt.getInterTypeMungers();
for (Iterator<ConcreteTypeMunger> i = itMungers.iterator(); i.hasNext();) {
ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
if (m.getMunger()!=null && m.getMunger().getKind()== ResolvedTypeMunger.PrivilegedAccess) {
continue;
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
}
ResolvedMember sig = m.getSignature();
if (sig == null)
continue;
UnresolvedType dType = sig.getDeclaringType();
if (dType == null)
continue;
ResolvedType resolvedDeclaringType = dType.resolve(factory.getWorld());
ResolvedMember rm = AjcMemberMaker.interMethod(sig, m.getAspectType(), resolvedDeclaringType.isInterface());
if (ResolvedType.matches(rm, possiblyErroneousRm)) {
return;
}
}
supertypeToLookAt = supertypeToLookAt.getSuperclass();
}
super.methodMustOverride(method,complianceLevel);
}
private String typesAsString(boolean isVarargs, TypeBinding[] types, boolean makeShort) {
StringBuffer buffer = new StringBuffer(10);
for (int i = 0, length = types.length; i < length; i++) {
if (i != 0)
buffer.append(", ");
TypeBinding type = types[i];
boolean isVarargType = isVarargs && i == length - 1;
if (isVarargType)
type = ((ArrayBinding) type).elementsType();
buffer.append(new String(makeShort ? type.shortReadableName() : type.readableName()));
if (isVarargType)
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
buffer.append("...");
}
return buffer.toString();
}
public void visibilityConflict(MethodBinding currentMethod, MethodBinding inheritedMethod) {
if (isIntertypeDeclaration(currentMethod) && isIntertypeDeclaration(inheritedMethod)
&& Modifier.isPrivate(currentMethod.modifiers) && Modifier.isPrivate(inheritedMethod.modifiers)) {
return;
}
super.visibilityConflict(currentMethod, inheritedMethod);
}
public void unusedPrivateType(TypeDeclaration typeDecl) {
if (typeDecl instanceof AspectDeclaration)
return;
if (typeDecl.enclosingType != null && (typeDecl.enclosingType instanceof AspectDeclaration)) {
AspectDeclaration ad = (AspectDeclaration) typeDecl.enclosingType;
if (ad.concreteName != null) {
List declares = ad.concreteName.declares;
for (Iterator iter = declares.iterator(); iter.hasNext();) {
Object dec = iter.next();
if (dec instanceof DeclareParents) {
DeclareParents decp = (DeclareParents) dec;
TypePattern[] newparents = decp.getParents().getTypePatterns();
for (int i = 0; i < newparents.length; i++) {
TypePattern pattern = newparents[i];
UnresolvedType ut = pattern.getExactType();
if (ut == null)
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
continue;
if (CharOperation.compareWith(typeDecl.binding.signature(), ut.getSignature().toCharArray()) == 0)
return;
}
}
}
}
}
super.unusedPrivateType(typeDecl);
}
public void abstractMethodInConcreteClass(SourceTypeBinding type) {
if (type.scope!=null && type.scope.referenceContext instanceof AspectDeclaration) {
return;
}
super.abstractMethodInConcreteClass(type);
}
public void unusedPrivateField(FieldDeclaration fieldDecl) {
if (fieldDecl!=null && fieldDecl.binding != null && fieldDecl.binding.declaringClass != null) {
ReferenceBinding type = fieldDecl.binding.declaringClass;
ResolvedType weaverType = null;
if (!type.isAnonymousType()) {
weaverType = factory.fromEclipse(type);
} else {
weaverType = factory.fromEclipse(type.superclass());
}
Set checked = new HashSet();
for (Iterator i = weaverType.getInterTypeMungersIncludingSupers().iterator(); i.hasNext();) {
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
ConcreteTypeMunger m = (ConcreteTypeMunger) i.next();
ResolvedType theAspect = m.getAspectType();
if (!checked.contains(theAspect)) {
TypeBinding tb = factory.makeTypeBinding(m.getAspectType());
if (tb instanceof SourceTypeBinding) {
IPrivilegedHandler privilegedHandler = ((SourceTypeBinding) tb).privilegedHandler;
if (privilegedHandler != null) {
if (privilegedHandler.definesPrivilegedAccessToField(fieldDecl.binding)) {
return;
}
} else if (theAspect instanceof ReferenceType) {
String fname = new String(fieldDecl.name);
Collectionprivvies = ((ReferenceType) theAspect).getPrivilegedAccesses();
if (privvies != null) {
for (Iterator iterator = privvies.iterator(); iterator.hasNext();) {
ResolvedMember priv = (ResolvedMember) iterator.next();
if (priv.getName().equals(fname)) {
return;
}
}
}
}
}
checked.add(theAspect);
}
}
}
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
super.unusedPrivateField(fieldDecl);
}
public void unusedPrivateMethod(AbstractMethodDeclaration methodDecl) {
if (!(methodDecl instanceof PointcutDeclaration))
super.unusedPrivateMethod(methodDecl);
}
public void caseExpressionMustBeConstant(Expression expression) {
if (expression instanceof QualifiedNameReference) {
QualifiedNameReference qnr = (QualifiedNameReference) expression;
if (qnr.otherBindings != null && qnr.otherBindings.length > 0 && qnr.otherBindings[0] instanceof PrivilegedFieldBinding) {
super.signalError(expression.sourceStart, expression.sourceEnd,
"Fields accessible due to an aspect being privileged can not be used in switch statements");
referenceContext.tagAsHavingErrors();
return;
}
}
super.caseExpressionMustBeConstant(expression);
}
public void unusedArgument(LocalDeclaration localDecl) {
String argType = new String(localDecl.type.resolvedType.signature());
if (argType.startsWith("Lorg/aspectj/runtime/internal"))
return;
if (localDecl instanceof Argument) {
Argument arg = (Argument) localDecl;
if (arg.binding != null && arg.binding.declaringScope != null) {
ReferenceContext context = arg.binding.declaringScope.referenceContext();
if (context != null && context instanceof PointcutDeclaration)
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
return;
}
}
if (new String(localDecl.name).startsWith("ajc$")) {
return;
}
super.unusedArgument(localDecl);
}
/**
* A side-effect of the way that we handle itds on default methods on top-most implementors of interfaces is that a class
* acquiring a final default ITD will erroneously report that it can't override its own member. This method detects that
* situation.
*/
public void finalMethodCannotBeOverridden(MethodBinding currentMethod, MethodBinding inheritedMethod) {
if (currentMethod == inheritedMethod)
return;
super.finalMethodCannotBeOverridden(currentMethod, inheritedMethod);
}
/**
* The method verifier is a bit 'keen' and doesn't cope well with ITDMs which are of course to be considered a 'default'
* implementation if the target type doesn't supply one. This test may not be complete - it is possible that it should read if
* *either* is an ITD...but I dont have a testcase that shows that is required. yet. (pr115788)
*/
public void duplicateInheritedMethods(SourceTypeBinding type, MethodBinding inheritedMethod1, MethodBinding inheritedMethod2) {
if (inheritedMethod1 instanceof InterTypeMethodBinding || inheritedMethod2 instanceof InterTypeMethodBinding)
return;
if ((inheritedMethod1 instanceof ParameterizedMethodBinding)
&& ((ParameterizedMethodBinding) inheritedMethod1).original() instanceof InterTypeMethodBinding)
return;
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
if ((inheritedMethod2 instanceof ParameterizedMethodBinding)
&& ((ParameterizedMethodBinding) inheritedMethod2).original() instanceof InterTypeMethodBinding)
return;
super.duplicateInheritedMethods(type, inheritedMethod1, inheritedMethod2);
}
/**
* All problems end up routed through here at some point...
*/
public IProblem createProblem(char[] fileName, int problemId, String[] problemArguments, String[] messageArguments,
int severity, int problemStartPosition, int problemEndPosition, int lineNumber) {
IProblem problem = super.createProblem(fileName, problemId, problemArguments, messageArguments, severity,
problemStartPosition, problemEndPosition, lineNumber, 0);
if (factory.getWorld().isInPinpointMode()) {
MessageIssued ex = new MessageIssued();
ex.fillInStackTrace();
StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw));
StringBuffer sb = new StringBuffer();
sb.append(CompilationAndWeavingContext.getCurrentContext());
sb.append(sw.toString());
problem = new PinpointedProblem(problem, sb.toString());
}
return problem;
}
private static class MessageIssued extends RuntimeException {
public String getMessage() {
return "message issued...";
}
}
private static class PinpointedProblem implements IProblem {
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
private IProblem delegate;
private String message;
public PinpointedProblem(IProblem aProblem, String pinpoint) {
this.delegate = aProblem;
if (delegate.getMessage().indexOf("message issued...") == -1) {
this.message = delegate.getMessage() + "\n" + pinpoint;
} else {
this.message = delegate.getMessage();
}
}
public String[] getArguments() {
return delegate.getArguments();
}
public int getID() {
return delegate.getID();
}
public String getMessage() {
return message;
}
public char[] getOriginatingFileName() {
return delegate.getOriginatingFileName();
}
public int getSourceEnd() {
return delegate.getSourceEnd();
}
public int getSourceLineNumber() {
return delegate.getSourceLineNumber();
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
}
public int getSourceStart() {
return delegate.getSourceStart();
}
public boolean isError() {
return delegate.isError();
}
public boolean isWarning() {
return delegate.isWarning();
}
public void setSourceEnd(int sourceEnd) {
delegate.setSourceEnd(sourceEnd);
}
public void setSourceLineNumber(int lineNumber) {
delegate.setSourceLineNumber(lineNumber);
}
public void setSourceStart(int sourceStart) {
delegate.setSourceStart(sourceStart);
}
public void setSeeAlsoProblems(IProblem[] problems) {
delegate.setSeeAlsoProblems(problems);
}
public IProblem[] seeAlso() {
return delegate.seeAlso();
}
public void setSupplementaryMessageInfo(String msg) {
delegate.setSupplementaryMessageInfo(msg);
}
public String getSupplementaryMessageInfo() {
return delegate.getSupplementaryMessageInfo();
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
|
}
}
public void duplicateMethodInType(SourceTypeBinding type, AbstractMethodDeclaration methodDecl, boolean equalParameters, int severity) {
if (new String(methodDecl.selector).startsWith("ajc$interMethod")) {
return;
}
super.duplicateMethodInType(type, methodDecl, equalParameters, severity);
}
public void parseErrorInsertAfterToken(int start, int end, int currentKind, char[] errorTokenSource, String errorTokenName,
String expectedToken) {
if (expectedToken.equals("privileged")) {
super.parseErrorNoSuggestion(start, end, currentKind, errorTokenSource, errorTokenName);
} else {
super.parseErrorInsertAfterToken(start, end, currentKind, errorTokenSource, errorTokenName, expectedToken);
}
}
public void missingValueForAnnotationMember(Annotation annotation, char[] memberName) {
if (referenceContext instanceof DeclareAnnotationDeclaration) {
if (((DeclareAnnotationDeclaration) referenceContext).isRemover()) {
return;
}
}
super.missingValueForAnnotationMember(annotation, memberName);
}
}
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java
|
/*******************************************************************************
* Copyright (c) 2012 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:
* Andy Clement - initial API and implementation
*******************************************************************************/
package org.aspectj.systemtest.ajc171;
import java.io.File;
import junit.framework.Test;
import org.aspectj.testing.XMLBasedAjcTestCase;
/**
* @author Andy Clement
*/
public class Ajc171Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testUnresolvableEnum_pr387568() {
runTest("unresolvable enum");
}
public void testAbstractItds_pr386049() {
runTest("itd abstract");
}
public void testPublicITDFs_pr73507_1() {
|
387,444
|
Bug 387444 Softening exception in try-with-resources
| null |
resolved fixed
|
76d695f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T19:19:58Z
| 2012-08-16T23:33:20Z
|
tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java
|
runTest("public ITDfs - 1");
}
public void testPublicITDFs_pr73507_2() {
runTest("public ITDfs - 2");
}
public void testPublicITDFs_pr73507_3() {
runTest("public ITDfs - 3");
}
public void testPublicITDFs_pr73507_4() {
runTest("public ITDfs - 4");
}
public void testPublicITDFs_pr73507_5() {
runTest("public ITDfs - 5");
}
public void testGenerics_384398() {
runTest("generics itds");
}
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Ajc171Tests.class);
}
@Override
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc171/ajc171.xml");
}
}
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
/* *******************************************************************
* Copyright (c) 2005 IBM Corporation Ltd
* 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:
* Adrian Colyer initial implementation
* ******************************************************************/
package org.aspectj.ajdt.internal.compiler.ast;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseScope;
import org.aspectj.ajdt.internal.core.builder.EclipseSourceContext;
import org.aspectj.bridge.context.CompilationAndWeavingContext;
import org.aspectj.bridge.context.ContextToken;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NormalAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleTypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.StringLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.weaver.AdviceKind;
import org.aspectj.weaver.AjAttribute;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.ResolvedPointcutDefinition;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.patterns.AbstractPatternNodeVisitor;
import org.aspectj.weaver.patterns.FormalBinding;
import org.aspectj.weaver.patterns.IfPointcut;
import org.aspectj.weaver.patterns.ParserException;
import org.aspectj.weaver.patterns.PatternParser;
import org.aspectj.weaver.patterns.Pointcut;
public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
private static final char[] beforeAdviceSig = "Lorg/aspectj/lang/annotation/Before;".toCharArray();
private static final char[] afterAdviceSig = "Lorg/aspectj/lang/annotation/After;".toCharArray();
private static final char[] afterReturningAdviceSig = "Lorg/aspectj/lang/annotation/AfterReturning;".toCharArray();
private static final char[] afterThrowingAdviceSig = "Lorg/aspectj/lang/annotation/AfterThrowing;".toCharArray();
private static final char[] aroundAdviceSig = "Lorg/aspectj/lang/annotation/Around;".toCharArray();
private static final char[] pointcutSig = "Lorg/aspectj/lang/annotation/Pointcut;".toCharArray();
private static final char[] aspectSig = "Lorg/aspectj/lang/annotation/Aspect;".toCharArray();
private static final char[] declareParentsSig = "Lorg/aspectj/lang/annotation/DeclareParents;".toCharArray();
private static final char[] adviceNameSig = "Lorg/aspectj/lang/annotation/AdviceName;".toCharArray();
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
private static final char[] voidType = "void".toCharArray();
private static final char[] booleanType = "boolean".toCharArray();
private static final char[] joinPoint = "Lorg/aspectj/lang/JoinPoint;".toCharArray();
private static final char[] joinPointStaticPart = "Lorg/aspectj/lang/JoinPoint$StaticPart;".toCharArray();
private static final char[] joinPointEnclosingStaticPart = "Lorg/aspectj/lang/JoinPoint$EnclosingStaticPart;".toCharArray();
private static final char[] proceedingJoinPoint = "Lorg/aspectj/lang/ProceedingJoinPoint;".toCharArray();
private final CompilationUnitDeclaration unit;
private final Stack typeStack = new Stack();
private AspectJAnnotations ajAnnotations;
public ValidateAtAspectJAnnotationsVisitor(CompilationUnitDeclaration unit) {
this.unit = unit;
}
public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) {
typeStack.push(localTypeDeclaration);
ajAnnotations = new AspectJAnnotations(localTypeDeclaration.annotations);
checkTypeDeclaration(localTypeDeclaration);
return true;
}
public void endVisit(TypeDeclaration localTypeDeclaration, BlockScope scope) {
typeStack.pop();
}
public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) {
typeStack.push(memberTypeDeclaration);
ajAnnotations = new AspectJAnnotations(memberTypeDeclaration.annotations);
checkTypeDeclaration(memberTypeDeclaration);
return true;
}
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
public void endVisit(TypeDeclaration memberTypeDeclaration, ClassScope scope) {
typeStack.pop();
}
public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) {
typeStack.push(typeDeclaration);
ajAnnotations = new AspectJAnnotations(typeDeclaration.annotations);
checkTypeDeclaration(typeDeclaration);
return true;
}
public void endVisit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) {
typeStack.pop();
}
private void checkTypeDeclaration(TypeDeclaration typeDecl) {
ContextToken tok = CompilationAndWeavingContext.enteringPhase(
CompilationAndWeavingContext.VALIDATING_AT_ASPECTJ_ANNOTATIONS, typeDecl.name);
if (!(typeDecl instanceof AspectDeclaration)) {
if (ajAnnotations.hasAspectAnnotation) {
validateAspectDeclaration(typeDecl);
} else {
TypeReference parentRef = typeDecl.superclass;
if (parentRef != null) {
TypeBinding parentBinding = parentRef.resolvedType;
if (parentBinding instanceof SourceTypeBinding) {
SourceTypeBinding parentSTB = (SourceTypeBinding) parentBinding;
if (parentSTB.scope != null) {
TypeDeclaration parentDecl = parentSTB.scope.referenceContext;
if (isAspect(parentDecl)) {
typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart, typeDecl.sourceEnd,
"a class cannot extend an aspect");
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
}
}
}
}
}
} else {
if (ajAnnotations.hasMultipleAspectAnnotations) {
typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart, typeDecl.sourceEnd,
"aspects cannot have @Aspect annotation");
}
}
CompilationAndWeavingContext.leavingPhase(tok);
}
public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
ajAnnotations = new AspectJAnnotations(fieldDeclaration.annotations);
if (ajAnnotations.hasDeclareParents && !insideAspect()) {
scope.problemReporter().signalError(fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd,
"DeclareParents can only be used inside an aspect type");
}
return true;
}
public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
if (methodDeclaration.hasErrors()) {
return false;
}
ContextToken tok = CompilationAndWeavingContext.enteringPhase(
CompilationAndWeavingContext.VALIDATING_AT_ASPECTJ_ANNOTATIONS, methodDeclaration.selector);
ajAnnotations = new AspectJAnnotations(methodDeclaration.annotations);
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
if (!methodDeclaration.getClass().equals(AjMethodDeclaration.class)) {
if (methodDeclaration instanceof PointcutDeclaration) {
if (ajAnnotations.hasMultiplePointcutAnnotations || ajAnnotations.hasAdviceAnnotation
|| ajAnnotations.hasAspectAnnotation || ajAnnotations.hasAdviceNameAnnotation) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart,
methodDeclaration.sourceEnd, "@AspectJ annotations cannot be declared on this aspect member");
}
} else if (methodDeclaration instanceof AdviceDeclaration) {
if (ajAnnotations.hasMultipleAdviceAnnotations || ajAnnotations.hasAspectAnnotation
|| ajAnnotations.hasPointcutAnnotation) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart,
methodDeclaration.sourceEnd, "Only @AdviceName AspectJ annotation allowed on advice");
}
} else {
if (ajAnnotations.hasAspectJAnnotations()) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart,
methodDeclaration.sourceEnd, "@AspectJ annotations cannot be declared on this aspect member");
}
}
CompilationAndWeavingContext.leavingPhase(tok);
return false;
}
if (ajAnnotations.hasAdviceAnnotation) {
validateAdvice(methodDeclaration);
} else if (ajAnnotations.hasPointcutAnnotation) {
convertToPointcutDeclaration(methodDeclaration, scope);
}
CompilationAndWeavingContext.leavingPhase(tok);
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
return false;
}
private boolean insideAspect() {
if (typeStack.empty())
return false;
TypeDeclaration typeDecl = (TypeDeclaration) typeStack.peek();
return isAspect(typeDecl);
}
private boolean isAspect(TypeDeclaration typeDecl) {
if (typeDecl instanceof AspectDeclaration)
return true;
return new AspectJAnnotations(typeDecl.annotations).hasAspectAnnotation;
}
/**
* aspect must be public nested aspect must be static cannot extend a concrete aspect pointcut in perclause must be good.
*/
private void validateAspectDeclaration(TypeDeclaration typeDecl) {
if (typeStack.size() > 1) {
if (!Modifier.isStatic(typeDecl.modifiers)) {
typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart, typeDecl.sourceEnd,
"inner aspects must be static");
return;
}
}
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
SourceTypeBinding binding = typeDecl.binding;
if (binding != null) {
if (binding.isEnum() || binding.isInterface() || binding.isAnnotationType()) {
typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart, typeDecl.sourceEnd,
"only classes can have an @Aspect annotation");
}
}
TypeReference parentRef = typeDecl.superclass;
if (parentRef != null) {
TypeBinding parentBinding = parentRef.resolvedType;
if (parentBinding instanceof SourceTypeBinding) {
SourceTypeBinding parentSTB = (SourceTypeBinding) parentBinding;
if (parentSTB.scope != null) {
TypeDeclaration parentDecl = parentSTB.scope.referenceContext;
if (isAspect(parentDecl) && !Modifier.isAbstract(parentDecl.modifiers)) {
typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart, typeDecl.sourceEnd,
"cannot extend a concrete aspect");
}
}
}
}
Annotation aspectAnnotation = ajAnnotations.aspectAnnotation;
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
int[] pcLoc = new int[2];
String perClause = getStringLiteralFor("value", aspectAnnotation, pcLoc);
try {
if (perClause != null && !perClause.equals("")) {
ISourceContext context = new EclipseSourceContext(unit.compilationResult, pcLoc[0]);
Pointcut pc = new PatternParser(perClause, context).maybeParsePerClause();
FormalBinding[] bindings = new FormalBinding[0];
if (pc != null)
pc.resolve(new EclipseScope(bindings, typeDecl.scope));
}
} catch (ParserException pEx) {
typeDecl.scope.problemReporter().parseError(pcLoc[0] + pEx.getLocation().getStart(),
pcLoc[0] + pEx.getLocation().getEnd(), -1, perClause.toCharArray(), perClause,
new String[] { pEx.getMessage() });
}
}
/**
* 1) Advice must be public 2) Advice must have a void return type if not around advice 3) Advice must not have any other @AspectJ
* annotations 4) After throwing advice must declare the thrown formal 5) After returning advice must declare the returning
* formal 6) Advice must not be static
*/
private void validateAdvice(MethodDeclaration methodDeclaration) {
if (!insideAspect()) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart, methodDeclaration.sourceEnd,
"Advice must be declared inside an aspect type");
}
if (!Modifier.isPublic(methodDeclaration.modifiers)) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart, methodDeclaration.sourceEnd,
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
"advice must be public");
}
if (Modifier.isStatic(methodDeclaration.modifiers)) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart, methodDeclaration.sourceEnd,
"advice can not be declared static");
}
if (ajAnnotations.hasMultipleAdviceAnnotations) {
methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.duplicateAdviceAnnotation);
}
if (ajAnnotations.hasPointcutAnnotation) {
methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.pointcutAnnotation);
}
if (ajAnnotations.hasAspectAnnotation) {
methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.aspectAnnotation);
}
if (ajAnnotations.hasAdviceNameAnnotation) {
methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.adviceNameAnnotation);
}
if (ajAnnotations.adviceKind != AdviceKind.Around) {
ensureVoidReturnType(methodDeclaration);
}
if (ajAnnotations.adviceKind == AdviceKind.AfterThrowing) {
int[] throwingLocation = new int[2];
String thrownFormal = getStringLiteralFor("throwing", ajAnnotations.adviceAnnotation, throwingLocation);
if (thrownFormal != null) {
if (!toArgumentNames(methodDeclaration.arguments).contains(thrownFormal)) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart,
methodDeclaration.sourceEnd,
"throwing formal '" + thrownFormal + "' must be declared as a parameter in the advice signature");
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
}
}
}
if (ajAnnotations.adviceKind == AdviceKind.AfterReturning) {
int[] throwingLocation = new int[2];
String returningFormal = getStringLiteralFor("returning", ajAnnotations.adviceAnnotation, throwingLocation);
if (returningFormal != null) {
if (!toArgumentNames(methodDeclaration.arguments).contains(returningFormal)) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart,
methodDeclaration.sourceEnd,
"returning formal '" + returningFormal + "' must be declared as a parameter in the advice signature");
}
}
}
resolveAndSetPointcut(methodDeclaration, ajAnnotations.adviceAnnotation);
}
/**
* Get the argument names as a string list
*
* @param arguments
* @return argument names (possibly empty)
*/
private List toArgumentNames(Argument[] arguments) {
List names = new ArrayList();
if (arguments == null) {
return names;
} else {
for (int i = 0; i < arguments.length; i++) {
names.add(new String(arguments[i].name));
}
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
return names;
}
}
private void resolveAndSetPointcut(MethodDeclaration methodDeclaration, Annotation adviceAnn) {
int[] pcLocation = new int[2];
String pointcutExpression = getStringLiteralFor("pointcut", adviceAnn, pcLocation);
if (pointcutExpression == null)
pointcutExpression = getStringLiteralFor("value", adviceAnn, pcLocation);
try {
ISourceContext context = new EclipseSourceContext(unit.compilationResult, pcLocation[0] + 1);
PatternParser pp = new PatternParser(pointcutExpression, context);
Pointcut pc = pp.parsePointcut();
pp.checkEof();
FormalBinding[] bindings = buildFormalAdviceBindingsFrom(methodDeclaration);
pc.resolve(new EclipseScope(bindings, methodDeclaration.scope));
EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(methodDeclaration.scope);
UnresolvedType[] paramTypes = new UnresolvedType[bindings.length];
for (int i = 0; i < paramTypes.length; i++)
paramTypes[i] = bindings[i].getType();
ResolvedPointcutDefinition resPcutDef = new ResolvedPointcutDefinition(factory.fromBinding(((TypeDeclaration) typeStack
.peek()).binding), methodDeclaration.modifiers, "anonymous", paramTypes, pc);
AjAttribute attr = new AjAttribute.PointcutDeclarationAttribute(resPcutDef);
((AjMethodDeclaration) methodDeclaration).addAttribute(new EclipseAttributeAdapter(attr));
} catch (ParserException pEx) {
methodDeclaration.scope.problemReporter().parseError(pcLocation[0] + pEx.getLocation().getStart(),
pcLocation[0] + pEx.getLocation().getEnd(), -1, pointcutExpression.toCharArray(), pointcutExpression,
new String[] { pEx.getMessage() });
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
}
}
private void ensureVoidReturnType(MethodDeclaration methodDeclaration) {
boolean returnsVoid = true;
if ((methodDeclaration.returnType instanceof SingleTypeReference)) {
SingleTypeReference retType = (SingleTypeReference) methodDeclaration.returnType;
if (!CharOperation.equals(voidType, retType.token)) {
returnsVoid = false;
}
} else {
returnsVoid = false;
}
if (!returnsVoid) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.returnType.sourceStart,
methodDeclaration.returnType.sourceEnd, "This advice must return void");
}
}
private FormalBinding[] buildFormalAdviceBindingsFrom(MethodDeclaration mDecl) {
if (mDecl.arguments == null)
return new FormalBinding[0];
if (mDecl.binding == null)
return new FormalBinding[0];
EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(mDecl.scope);
String extraArgName = maybeGetExtraArgName();
if (extraArgName == null)
extraArgName = "";
FormalBinding[] ret = new FormalBinding[mDecl.arguments.length];
for (int i = 0; i < mDecl.arguments.length; i++) {
Argument arg = mDecl.arguments[i];
String name = new String(arg.name);
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
TypeBinding argTypeBinding = mDecl.binding.parameters[i];
UnresolvedType type = factory.fromBinding(argTypeBinding);
if (CharOperation.equals(joinPoint, argTypeBinding.signature())
|| CharOperation.equals(joinPointStaticPart, argTypeBinding.signature())
|| CharOperation.equals(joinPointEnclosingStaticPart, argTypeBinding.signature())
|| CharOperation.equals(proceedingJoinPoint, argTypeBinding.signature()) || name.equals(extraArgName)) {
ret[i] = new FormalBinding.ImplicitFormalBinding(type, name, i);
} else {
ret[i] = new FormalBinding(type, name, i, arg.sourceStart, arg.sourceEnd);
}
}
return ret;
}
private String maybeGetExtraArgName() {
String argName = null;
if (ajAnnotations.adviceKind == AdviceKind.AfterReturning) {
argName = getStringLiteralFor("returning", ajAnnotations.adviceAnnotation, new int[2]);
} else if (ajAnnotations.adviceKind == AdviceKind.AfterThrowing) {
argName = getStringLiteralFor("throwing", ajAnnotations.adviceAnnotation, new int[2]);
}
return argName;
}
private String getStringLiteralFor(String memberName, Annotation inAnnotation, int[] location) {
if (inAnnotation instanceof SingleMemberAnnotation && memberName.equals("value")) {
SingleMemberAnnotation sma = (SingleMemberAnnotation) inAnnotation;
if (sma.memberValue instanceof StringLiteral) {
StringLiteral sv = (StringLiteral) sma.memberValue;
location[0] = sv.sourceStart;
location[1] = sv.sourceEnd;
return new String(sv.source());
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
} else if (sma.memberValue instanceof NameReference
&& (((NameReference) sma.memberValue).binding instanceof FieldBinding)) {
Binding b = ((NameReference) sma.memberValue).binding;
Constant c = ((FieldBinding) b).constant;
return c.stringValue();
}
}
if (!(inAnnotation instanceof NormalAnnotation))
return null;
NormalAnnotation ann = (NormalAnnotation) inAnnotation;
MemberValuePair[] mvps = ann.memberValuePairs;
if (mvps == null)
return null;
for (int i = 0; i < mvps.length; i++) {
if (CharOperation.equals(memberName.toCharArray(), mvps[i].name)) {
if (mvps[i].value instanceof StringLiteral) {
StringLiteral sv = (StringLiteral) mvps[i].value;
location[0] = sv.sourceStart;
location[1] = sv.sourceEnd;
return new String(sv.source());
}
}
}
return null;
}
private void convertToPointcutDeclaration(MethodDeclaration methodDeclaration, ClassScope scope) {
TypeDeclaration typeDecl = (TypeDeclaration) typeStack.peek();
if (typeDecl.binding != null) {
if (!typeDecl.binding.isClass()) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart, methodDeclaration.sourceEnd,
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
"pointcuts can only be declared in a class or an aspect");
}
}
if (methodDeclaration.thrownExceptions != null && methodDeclaration.thrownExceptions.length > 0) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart, methodDeclaration.sourceEnd,
"pointcuts cannot throw exceptions!");
}
PointcutDeclaration pcDecl = new PointcutDeclaration(unit.compilationResult);
copyAllFields(methodDeclaration, pcDecl);
if (ajAnnotations.hasAdviceAnnotation) {
methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.adviceAnnotation);
}
if (ajAnnotations.hasAspectAnnotation) {
methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.aspectAnnotation);
}
if (ajAnnotations.hasAdviceNameAnnotation) {
methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.adviceNameAnnotation);
}
boolean noValueSupplied = true;
boolean containsIfPcd = false;
int[] pcLocation = new int[2];
String pointcutExpression = getStringLiteralFor("value", ajAnnotations.pointcutAnnotation, pcLocation);
try {
ISourceContext context = new EclipseSourceContext(unit.compilationResult, pcLocation[0]);
Pointcut pc = null;
if (pointcutExpression == null || pointcutExpression.length() == 0) {
noValueSupplied = true;
} else {
noValueSupplied = false;
pc = new PatternParser(pointcutExpression, context).parsePointcut();
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
}
pcDecl.pointcutDesignator = (pc == null) ? null : new PointcutDesignator(pc);
pcDecl.setGenerateSyntheticPointcutMethod();
TypeDeclaration onType = (TypeDeclaration) typeStack.peek();
pcDecl.postParse(onType);
FormalBinding[] bindings = buildFormalAdviceBindingsFrom(methodDeclaration);
swap(onType, methodDeclaration, pcDecl);
if (pc != null) {
EclipseScope eScope = new EclipseScope(bindings, methodDeclaration.scope);
char[] packageName = null;
if (typeDecl.binding != null && typeDecl.binding.getPackage() != null) {
packageName = typeDecl.binding.getPackage().readableName();
}
eScope.setLimitedImports(packageName);
pc.resolve(eScope);
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
HasIfPCDVisitor ifFinder = new HasIfPCDVisitor();
pc.traverse(ifFinder, null);
containsIfPcd = ifFinder.containsIfPcd;
}
} catch (ParserException pEx) {
methodDeclaration.scope.problemReporter().parseError(pcLocation[0] + pEx.getLocation().getStart(),
pcLocation[0] + pEx.getLocation().getEnd(), -1, pointcutExpression.toCharArray(), pointcutExpression,
new String[] { pEx.getMessage() });
}
boolean returnsVoid = false;
boolean returnsBoolean = false;
if ((methodDeclaration.returnType instanceof SingleTypeReference)) {
SingleTypeReference retType = (SingleTypeReference) methodDeclaration.returnType;
if (CharOperation.equals(voidType, retType.token))
returnsVoid = true;
if (CharOperation.equals(booleanType, retType.token))
returnsBoolean = true;
}
if (!returnsVoid && !containsIfPcd) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.returnType.sourceStart,
methodDeclaration.returnType.sourceEnd,
"Methods annotated with @Pointcut must return void unless the pointcut contains an if() expression");
}
if (!returnsBoolean && containsIfPcd) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.returnType.sourceStart,
methodDeclaration.returnType.sourceEnd,
"Methods annotated with @Pointcut must return boolean when the pointcut contains an if() expression");
}
if (methodDeclaration.statements != null && methodDeclaration.statements.length > 0 && !containsIfPcd) {
methodDeclaration.scope.problemReporter()
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
.signalError(methodDeclaration.returnType.sourceStart, methodDeclaration.returnType.sourceEnd,
"Pointcuts without an if() expression should have an empty method body");
}
if (pcDecl.pointcutDesignator == null) {
if (Modifier.isAbstract(methodDeclaration.modifiers) || noValueSupplied
) {
} else {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.returnType.sourceStart,
methodDeclaration.returnType.sourceEnd,
"Method annotated with @Pointcut() for abstract pointcut must be abstract");
}
} else if (Modifier.isAbstract(methodDeclaration.modifiers)) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.returnType.sourceStart,
methodDeclaration.returnType.sourceEnd,
"Method annotated with non abstract @Pointcut(\"" + pointcutExpression + "\") is abstract");
}
}
private void copyAllFields(MethodDeclaration from, MethodDeclaration to) {
to.annotations = from.annotations;
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
to.arguments = from.arguments;
to.binding = from.binding;
to.bits = from.bits;
to.bodyEnd = from.bodyEnd;
to.bodyStart = from.bodyStart;
to.declarationSourceEnd = from.declarationSourceEnd;
to.declarationSourceStart = from.declarationSourceStart;
to.explicitDeclarations = from.explicitDeclarations;
to.ignoreFurtherInvestigation = from.ignoreFurtherInvestigation;
to.javadoc = from.javadoc;
to.modifiers = from.modifiers;
to.modifiersSourceStart = from.modifiersSourceStart;
to.returnType = from.returnType;
to.scope = from.scope;
to.selector = from.selector;
to.sourceEnd = from.sourceEnd;
to.sourceStart = from.sourceStart;
to.statements = from.statements;
to.thrownExceptions = from.thrownExceptions;
to.typeParameters = from.typeParameters;
}
private void swap(TypeDeclaration inType, MethodDeclaration thisDeclaration, MethodDeclaration forThatDeclaration) {
for (int i = 0; i < inType.methods.length; i++) {
if (inType.methods[i] == thisDeclaration) {
inType.methods[i] = forThatDeclaration;
break;
}
}
}
private static class AspectJAnnotations {
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
boolean hasAdviceAnnotation = false;
boolean hasPointcutAnnotation = false;
boolean hasAspectAnnotation = false;
boolean hasAdviceNameAnnotation = false;
boolean hasDeclareParents = false;
boolean hasMultipleAdviceAnnotations = false;
boolean hasMultiplePointcutAnnotations = false;
boolean hasMultipleAspectAnnotations = false;
AdviceKind adviceKind = null;
Annotation adviceAnnotation = null;
Annotation pointcutAnnotation = null;
Annotation aspectAnnotation = null;
Annotation adviceNameAnnotation = null;
Annotation duplicateAdviceAnnotation = null;
Annotation duplicatePointcutAnnotation = null;
Annotation duplicateAspectAnnotation = null;
public AspectJAnnotations(Annotation[] annotations) {
if (annotations == null)
return;
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].resolvedType == null)
continue;
char[] sig = annotations[i].resolvedType.signature();
if (CharOperation.equals(afterAdviceSig, sig)) {
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
adviceKind = AdviceKind.After;
addAdviceAnnotation(annotations[i]);
} else if (CharOperation.equals(afterReturningAdviceSig, sig)) {
adviceKind = AdviceKind.AfterReturning;
addAdviceAnnotation(annotations[i]);
} else if (CharOperation.equals(afterThrowingAdviceSig, sig)) {
adviceKind = AdviceKind.AfterThrowing;
addAdviceAnnotation(annotations[i]);
} else if (CharOperation.equals(beforeAdviceSig, sig)) {
adviceKind = AdviceKind.Before;
addAdviceAnnotation(annotations[i]);
} else if (CharOperation.equals(aroundAdviceSig, sig)) {
adviceKind = AdviceKind.Around;
addAdviceAnnotation(annotations[i]);
} else if (CharOperation.equals(adviceNameSig, sig)) {
hasAdviceNameAnnotation = true;
adviceNameAnnotation = annotations[i];
} else if (CharOperation.equals(declareParentsSig, sig)) {
hasDeclareParents = true;
} else if (CharOperation.equals(aspectSig, sig)) {
if (hasAspectAnnotation) {
hasMultipleAspectAnnotations = true;
duplicateAspectAnnotation = annotations[i];
} else {
hasAspectAnnotation = true;
aspectAnnotation = annotations[i];
}
} else if (CharOperation.equals(pointcutSig, sig)) {
if (hasPointcutAnnotation) {
hasMultiplePointcutAnnotations = true;
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
|
duplicatePointcutAnnotation = annotations[i];
} else {
hasPointcutAnnotation = true;
pointcutAnnotation = annotations[i];
}
}
}
}
public boolean hasAspectJAnnotations() {
return hasAdviceAnnotation || hasPointcutAnnotation || hasAdviceNameAnnotation || hasAspectAnnotation;
}
private void addAdviceAnnotation(Annotation annotation) {
if (!hasAdviceAnnotation) {
hasAdviceAnnotation = true;
adviceAnnotation = annotation;
} else {
hasMultipleAdviceAnnotations = true;
duplicateAdviceAnnotation = annotation;
}
}
}
private static class HasIfPCDVisitor extends AbstractPatternNodeVisitor {
public boolean containsIfPcd = false;
public Object visit(IfPointcut node, Object data) {
containsIfPcd = true;
return data;
}
}
}
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java
|
/*******************************************************************************
* Copyright (c) 2012 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:
* Andy Clement - initial API and implementation
*******************************************************************************/
package org.aspectj.systemtest.ajc171;
import java.io.File;
import junit.framework.Test;
import org.aspectj.testing.XMLBasedAjcTestCase;
/**
* @author Andy Clement
*/
public class Ajc171Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testUnresolvableEnum_pr387568() {
runTest("unresolvable enum");
}
public void testAbstractItds_pr386049() {
runTest("itd abstract");
}
public void testPublicITDFs_pr73507_1() {
|
384,401
|
Bug 384401 NPE when no pointcut in afterthrowing annotation style advice
|
From the mailing list: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; @Aspect public class X { // @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") @AfterThrowing(throwing = "e") public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { // .....// do some stuff } } class BizLoggable {}
|
resolved fixed
|
55ebaa1
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-08-23T20:05:24Z
| 2012-07-05T17:40:00Z
|
tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java
|
runTest("public ITDfs - 1");
}
public void testPublicITDFs_pr73507_2() {
runTest("public ITDfs - 2");
}
public void testPublicITDFs_pr73507_3() {
runTest("public ITDfs - 3");
}
public void testPublicITDFs_pr73507_4() {
runTest("public ITDfs - 4");
}
public void testPublicITDFs_pr73507_5() {
runTest("public ITDfs - 5");
}
public void testGenerics_384398() {
runTest("generics itds");
}
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Ajc171Tests.class);
}
@Override
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc171/ajc171.xml");
}
}
|
388,971
|
Bug 388971 Double Synthetic attributes on some around advice members
|
Some of the support members in aspects were getting Synthetic attributes added twice (once when compiled, once when used as an aspect library). Some JVMs appear to flag this as a verify error. The fix is simply to check before adding to make sure the attribute isn't added twice.
|
resolved fixed
|
c2ff74f
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-09-06T16:37:31Z
| 2012-09-06T16:46:40Z
|
weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.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.bcel;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.lang.reflect.Modifier;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.