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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
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) {
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
boolean quitRightNow = false;
String localMethodName = unMangledInterMethod.getName();
String localParameterSig = unMangledInterMethod.getParameterSignature();
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)
&& !Modifier.isPrivate(aMethod.getModifiers())) {
createBridgeMethod(weaver.getWorld(), munger, unMangledInterMethod, gen, paramTypes, aMethod);
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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);
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
bridgeMethod.setAccessFlags(bridgeMethod.getAccessFlags() | 0x00000040 /*
* BRIDGE = 0x00000040
*/);
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));
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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());
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) {
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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());
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) {
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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;
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();
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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);
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) {
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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));
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())) {
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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());
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);
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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();
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;
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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);
}
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;
}
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
}
}
}
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)) {
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());
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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());
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();
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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) {
} 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()));
}
}
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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) {
toRemove = object;
}
}
if (toRemove != null) {
currentClass.removeMethodGen(toRemove);
}
}
currentClass.addMethodGen(mg);
InstructionList body = mg.getBody();
UnresolvedType[] declaredParams = newConstructorTypeMunger.getSignature().getParameterTypes();
Type[] paramTypes = mg.getArgumentTypes();
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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();
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));
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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;
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++) {
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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();
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);
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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) {
} 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,
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
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();
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");
}
weaver.addInitializer(this);
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
Type fieldType = BcelWorld.makeBcelType(field.getType());
FieldGen fg = makeFieldGen(gen, AjcMemberMaker.interFieldInterfaceField(field, onType, aspectType));
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(), fg.getName(), fieldType, Constants.GETSTATIC));
} else {
il.append(InstructionConstants.ALOAD_0);
il.append(fact.createFieldAccess(gen.getClassName(), fg.getName(), fieldType, Constants.GETFIELD));
}
il.append(InstructionFactory.createReturn(fieldType));
mg.getBody().insert(il);
gen.addMethodGen(mg);
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
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(), fg.getName(), fieldType, Constants.PUTSTATIC));
} else {
il1.append(InstructionConstants.ALOAD_0);
il1.append(InstructionFactory.createLoad(fieldType, 1));
il1.append(fact.createFieldAccess(gen.getClassName(), fg.getName(), fieldType, Constants.PUTFIELD));
}
il1.append(InstructionFactory.createReturn(Type.VOID));
mg1.getBody().insert(il1);
gen.addMethodGen(mg1);
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
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();
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
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".
*/
|
382,189 |
Bug 382189 NPE in BcelTypeMunger.createBridgeMethod
|
Build Identifier: Since I updated to version AspectJ Development Tools 2.2.0.e37x-20120529-0900 I get during compile: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelTypeMunger.createBridgeMethod(BcelTypeMunger.java:1325) at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1272) at org.aspectj.weaver.bcel.BcelTypeMunger.mungeNewMethod(BcelTypeMunger.java:971) at org.aspectj.weaver.bcel.BcelTypeMunger.munge(BcelTypeMunger.java:108) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave ... ) Before, I had AspectJ Development Tools 2.2.0.e37x-20120507-1400 and the same project compiled without that exception. Reproducible: Always
|
resolved fixed
|
a748303
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-06-16T00:42:25Z | 2012-06-10T14:53:20Z |
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;
}
}
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
/* *******************************************************************
* Copyright (c) 2004,2010 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:
* Matthew Webster, IBM
* ******************************************************************/
package org.aspectj.weaver;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.net.URL;
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.IMessageHolder;
import org.aspectj.bridge.Version;
import org.aspectj.weaver.tools.Trace;
import org.aspectj.weaver.tools.TraceFactory;
import org.aspectj.weaver.tools.Traceable;
/**
* @author Matthew Webster
*/
public class Dump {
public final static String DUMP_CONDITION_PROPERTY = "org.aspectj.weaver.Dump.condition";
public final static String DUMP_DIRECTORY_PROPERTY = "org.aspectj.dump.directory";
private static final String FILENAME_PREFIX = "ajcore";
private static final String FILENAME_SUFFIX = "txt";
public static final String UNKNOWN_FILENAME = "Unknown";
public static final String DUMP_EXCLUDED = "Excluded";
public static final String NULL_OR_EMPTY = "Empty";
private static Class<?> exceptionClass;
private static IMessage.Kind conditionKind = IMessage.ABORT;
private static File directory = new File(".");
private String reason;
private String fileName;
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
private PrintStream print;
private static String[] savedCommandLine;
private static List<String> savedFullClasspath;
private static IMessageHolder savedMessageHolder;
private static String lastDumpFileName = UNKNOWN_FILENAME;
private static boolean preserveOnNextReset = false;
private static Trace trace = TraceFactory.getTraceFactory().getTrace(Dump.class);
/**
* for testing only, so that we can verify dump contents after compilation has completely finished
*/
public static void preserveOnNextReset() {
preserveOnNextReset = true;
}
public static void reset() {
if (preserveOnNextReset) {
preserveOnNextReset = false;
return;
} else {
savedMessageHolder = null;
}
}
/*
* Dump methods
*/
public static String dump(String reason) {
String fileName = UNKNOWN_FILENAME;
Dump dump = null;
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
try {
dump = new Dump(reason);
fileName = dump.getFileName();
dump.dumpDefault();
} finally {
if (dump != null) {
dump.close();
}
}
return fileName;
}
public static String dumpWithException(Throwable th) {
return dumpWithException(savedMessageHolder, th);
}
public static String dumpWithException(IMessageHolder messageHolder, Throwable th) {
if (trace.isTraceEnabled()) {
trace.enter("dumpWithException", null, new Object[] { messageHolder, th });
}
String fileName = UNKNOWN_FILENAME;
Dump dump = null;
try {
dump = new Dump(th.getClass().getName());
fileName = dump.getFileName();
dump.dumpException(messageHolder, th);
} finally {
if (dump != null) {
dump.close();
}
}
if (trace.isTraceEnabled()) {
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
trace.exit("dumpWithException", fileName);
}
return fileName;
}
public static String dumpOnExit() {
return dumpOnExit(savedMessageHolder, false);
}
public static String dumpOnExit(IMessageHolder messageHolder, boolean reset) {
if (trace.isTraceEnabled()) {
trace.enter("dumpOnExit", null, messageHolder);
}
String fileName = UNKNOWN_FILENAME;
if (!shouldDumpOnExit(messageHolder)) {
fileName = DUMP_EXCLUDED;
} else {
Dump dump = null;
try {
dump = new Dump(conditionKind.toString());
fileName = dump.getFileName();
dump.dumpDefault(messageHolder);
} finally {
if (dump != null) {
dump.close();
}
}
}
if (reset) {
messageHolder.clearMessages();
}
if (trace.isTraceEnabled()) {
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
trace.exit("dumpOnExit", fileName);
}
return fileName;
}
private static boolean shouldDumpOnExit(IMessageHolder messageHolder) {
if (trace.isTraceEnabled()) {
trace.enter("shouldDumpOnExit", null, messageHolder);
}
if (trace.isTraceEnabled()) {
trace.event("shouldDumpOnExit", null, conditionKind);
}
boolean result = (messageHolder == null) || messageHolder.hasAnyMessage(conditionKind, true);
if (trace.isTraceEnabled()) {
trace.exit("shouldDumpOnExit", result);
}
return result;
}
/*
* Dump configuration
*/
public static void setDumpOnException(boolean b) {
if (b) {
exceptionClass = java.lang.Throwable.class;
} else {
exceptionClass = null;
}
}
public static boolean setDumpDirectory(String directoryName) {
if (trace.isTraceEnabled()) {
trace.enter("setDumpDirectory", null, directoryName);
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
}
boolean success = false;
File newDirectory = new File(directoryName);
if (newDirectory.exists()) {
directory = newDirectory;
success = true;
}
if (trace.isTraceEnabled()) {
trace.exit("setDumpDirectory", success);
}
return success;
}
public static boolean getDumpOnException() {
return (exceptionClass != null);
}
public static boolean setDumpOnExit(IMessage.Kind condition) {
if (trace.isTraceEnabled()) {
trace.event("setDumpOnExit", null, condition);
}
conditionKind = condition;
return true;
}
public static boolean setDumpOnExit(String condition) {
for (IMessage.Kind kind : IMessage.KINDS) {
if (kind.toString().equals(condition)) {
return setDumpOnExit(kind);
}
}
return false;
}
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
public static IMessage.Kind getDumpOnExit() {
return conditionKind;
}
public static String getLastDumpFileName() {
return lastDumpFileName;
}
public static void saveCommandLine(String[] args) {
savedCommandLine = new String[args.length];
System.arraycopy(args, 0, savedCommandLine, 0, args.length);
}
public static void saveFullClasspath(List<String> list) {
savedFullClasspath = list;
}
public static void saveMessageHolder(IMessageHolder holder) {
savedMessageHolder = holder;
}
private Dump(String reason) {
if (trace.isTraceEnabled()) {
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
trace.enter("<init>", this, reason);
}
this.reason = reason;
openDump();
dumpAspectJProperties();
dumpDumpConfiguration();
if (trace.isTraceEnabled()) {
trace.exit("<init>", this);
}
}
public String getFileName() {
return fileName;
}
private void dumpDefault() {
dumpDefault(savedMessageHolder);
}
private void dumpDefault(IMessageHolder holder) {
dumpSytemProperties();
dumpCommandLine();
dumpFullClasspath();
dumpCompilerMessages(holder);
}
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
private void dumpException(IMessageHolder messageHolder, Throwable th) {
println("---- Exception Information ---");
println(th);
dumpDefault(messageHolder);
}
private void dumpAspectJProperties() {
println("---- AspectJ Properties ---");
println("AspectJ Compiler " + Version.text + " built on " + Version.time_text);
}
private void dumpDumpConfiguration() {
println("---- Dump Properties ---");
println("Dump file: " + fileName);
println("Dump reason: " + reason);
println("Dump on exception: " + (exceptionClass != null));
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
println("Dump at exit condition: " + conditionKind);
}
private void dumpFullClasspath() {
println("---- Full Classpath ---");
if (savedFullClasspath != null && savedFullClasspath.size() > 0) {
for (String fileName : savedFullClasspath) {
File file = new File(fileName);
println(file);
}
} else {
println(NULL_OR_EMPTY);
}
}
private void dumpSytemProperties() {
println("---- System Properties ---");
Properties props = System.getProperties();
println(props);
}
private void dumpCommandLine() {
println("---- Command Line ---");
println(savedCommandLine);
}
private void dumpCompilerMessages(IMessageHolder messageHolder) {
println("---- Compiler Messages ---");
if (messageHolder != null) {
for (Iterator<IMessage> i = messageHolder.getUnmodifiableListView().iterator(); i.hasNext();) {
IMessage message = i.next();
println(message.toString());
}
} else {
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
println(NULL_OR_EMPTY);
}
}
/*
* Dump output
*/
private void openDump() {
if (print != null) {
return;
}
Date now = new Date();
fileName = FILENAME_PREFIX + "." + new SimpleDateFormat("yyyyMMdd").format(now) + "."
+ new SimpleDateFormat("HHmmss.SSS").format(now) + "." + FILENAME_SUFFIX;
try {
File file = new File(directory, fileName);
print = new PrintStream(new FileOutputStream(file), true);
trace.info("Dumping to " + file.getAbsolutePath());
} catch (Exception ex) {
print = System.err;
trace.info("Dumping to stderr");
fileName = UNKNOWN_FILENAME;
}
lastDumpFileName = fileName;
}
public void close() {
print.close();
}
private void println(Object obj) {
print.println(obj);
}
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
private void println(Object[] array) {
if (array == null) {
println(NULL_OR_EMPTY);
return;
}
for (int i = 0; i < array.length; i++) {
print.println(array[i]);
}
}
private void println(Properties props) {
Iterator iter = props.keySet().iterator();
while (iter.hasNext()) {
String key = (String) iter.next();
String value = props.getProperty(key);
print.println(key + "=" + value);
}
}
private void println(Throwable th) {
th.printStackTrace(print);
}
private void println(File file) {
print.print(file.getAbsolutePath());
if (!file.exists()) {
println("(missing)");
} else if (file.isDirectory()) {
int count = file.listFiles().length;
println("(" + count + " entries)");
} else {
println("(" + file.length() + " bytes)");
}
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
}
@SuppressWarnings("rawtypes")
private void println(List list) {
if (list == null || list.isEmpty()) {
println(NULL_OR_EMPTY);
} else {
for (Iterator i = list.iterator(); i.hasNext();) {
Object o = i.next();
if (o instanceof Exception) {
println((Exception) o);
} else {
println(o.toString());
}
}
}
}
private static Object formatObj(Object obj) {
if (obj == null || obj instanceof String || obj instanceof Number || obj instanceof Boolean || obj instanceof Exception
|| obj instanceof Character || obj instanceof Class || obj instanceof File || obj instanceof StringBuffer
|| obj instanceof URL) {
return obj;
} else {
try {
if (obj instanceof Traceable) {
Traceable t = (Traceable) obj;
return t.toTraceString();
} else {
return obj.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(obj));
|
384,189 |
Bug 384189 make ajcore file creation optional
|
Although cores are useful, there may be situations where you are working around whatever they are reporting and are perhaps unable to pick up a later version of AJ that includes the fix. In these situations it might be helpful to make the creation of cores optional, through a sys prop.
|
resolved fixed
|
5d0e186
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-03T20:46:29Z | 2012-07-03T18:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/Dump.java
|
}
} catch (Exception ex) {
return obj.getClass().getName() + "@FFFFFFFF";
}
}
}
static {
String exceptionName = System.getProperty("org.aspectj.weaver.Dump.exception", "true");
if (!exceptionName.equals("false")) {
setDumpOnException(true);
}
String conditionName = System.getProperty(DUMP_CONDITION_PROPERTY);
if (conditionName != null) {
setDumpOnExit(conditionName);
}
String directoryName = System.getProperty(DUMP_DIRECTORY_PROPERTY);
if (directoryName != null) {
setDumpDirectory(directoryName);
}
}
public interface INode {
public void accept(IVisitor visior);
}
public interface IVisitor {
public void visitObject(Object s);
public void visitList(List list);
}
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.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
* Mik Kersten 2004-07-26 extended to allow overloading of
* hierarchy builder
* ******************************************************************/
package org.aspectj.ajdt.internal.compiler.lookup;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.AstUtil;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
import org.aspectj.ajdt.internal.core.builder.AjBuildManager;
import org.aspectj.bridge.IMessage.Kind;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.org.eclipse.jdt.core.Flags;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
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.CompilationUnitDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.EmptyStatement;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SyntheticFieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.WildcardBinding;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.BoundedReferenceType;
import org.aspectj.weaver.ConcreteTypeMunger;
import org.aspectj.weaver.IHasPosition;
import org.aspectj.weaver.Member;
import org.aspectj.weaver.MemberKind;
import org.aspectj.weaver.NameMangler;
import org.aspectj.weaver.NewFieldTypeMunger;
import org.aspectj.weaver.NewMethodTypeMunger;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedMemberImpl;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.ResolvedTypeMunger;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.TypeFactory;
import org.aspectj.weaver.TypeVariable;
import org.aspectj.weaver.TypeVariableDeclaringElement;
import org.aspectj.weaver.TypeVariableReference;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.UnresolvedType.TypeKind;
import org.aspectj.weaver.UnresolvedTypeVariableReferenceType;
import org.aspectj.weaver.WildcardedUnresolvedType;
import org.aspectj.weaver.World;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.DeclareParents;
/**
* @author Jim Hugunin
*/
public class EclipseFactory {
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
public static boolean DEBUG = false;
public static int debug_mungerCount = -1;
private final AjBuildManager buildManager;
private final LookupEnvironment lookupEnvironment;
private final boolean xSerializableAspects;
private final World world;
public PushinCollector pushinCollector;
public List<ConcreteTypeMunger> finishedTypeMungers = null;
private final MaptypexToBinding = new HashMap();
private final MaprawTypeXToBinding = new HashMap();
public static EclipseFactory fromLookupEnvironment(LookupEnvironment env) {
AjLookupEnvironment aenv = (AjLookupEnvironment) env;
return aenv.factory;
}
public LookupEnvironment getLookupEnvironment() {
return this.lookupEnvironment;
}
public static EclipseFactory fromScopeLookupEnvironment(Scope scope) {
return fromLookupEnvironment(AstUtil.getCompilationUnitScope(scope).environment);
}
public EclipseFactory(LookupEnvironment lookupEnvironment, AjBuildManager buildManager) {
this.lookupEnvironment = lookupEnvironment;
this.buildManager = buildManager;
this.world = buildManager.getWorld();
this.pushinCollector = PushinCollector.createInstance(this.world);
this.xSerializableAspects = buildManager.buildConfig.isXserializableAspects();
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
}
public EclipseFactory(LookupEnvironment lookupEnvironment, World world, boolean xSer) {
this.lookupEnvironment = lookupEnvironment;
this.world = world;
this.xSerializableAspects = xSer;
this.pushinCollector = PushinCollector.createInstance(this.world);
this.buildManager = null;
}
public World getWorld() {
return world;
}
public void showMessage(Kind kind, String message, ISourceLocation loc1, ISourceLocation loc2) {
getWorld().showMessage(kind, message, loc1, loc2);
}
public ResolvedType fromEclipse(ReferenceBinding binding) {
if (binding == null) {
return ResolvedType.MISSING;
}
ResolvedType ret = getWorld().resolve(fromBinding(binding));
return ret;
}
public ResolvedType fromTypeBindingToRTX(TypeBinding tb) {
if (tb == null) {
return ResolvedType.MISSING;
}
ResolvedType ret = getWorld().resolve(fromBinding(tb));
return ret;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
}
public ResolvedType[] fromEclipse(ReferenceBinding[] bindings) {
if (bindings == null) {
return ResolvedType.NONE;
}
int len = bindings.length;
ResolvedType[] ret = new ResolvedType[len];
for (int i = 0; i < len; i++) {
ret[i] = fromEclipse(bindings[i]);
}
return ret;
}
public static String getName(TypeBinding binding) {
if (binding instanceof TypeVariableBinding) {
TypeVariableBinding tvb = (TypeVariableBinding) binding;
if (tvb.firstBound != null) {
return getName(tvb.firstBound);
} else {
return getName(tvb.superclass);
}
}
if (binding instanceof ReferenceBinding) {
return new String(CharOperation.concatWith(((ReferenceBinding) binding).compoundName, '.'));
}
String packageName = new String(binding.qualifiedPackageName());
String className = new String(binding.qualifiedSourceName()).replace('.', '$');
if (packageName.length() > 0) {
className = packageName + "." + className;
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
return new String(className);
}
/**
* Some generics notes:
*
* Andy 6-May-05 We were having trouble with parameterized types in a couple of places - due to TypeVariableBindings. When we
* see a TypeVariableBinding now we default to either the firstBound if it is specified or java.lang.Object. Not sure when/if
* this gets us unstuck? It does mean we forget that it is a type variable when going back the other way from the UnresolvedType
* and that would seem a bad thing - but I've yet to see the reason we need to remember the type variable. Adrian 10-July-05
* When we forget it's a type variable we come unstuck when getting the declared members of a parameterized type - since we
* don't know it's a type variable we can't replace it with the type parameter.
*/
public UnresolvedType fromBinding(TypeBinding binding) {
if (binding instanceof HelperInterfaceBinding) {
return ((HelperInterfaceBinding) binding).getTypeX();
}
if (binding == null || binding.qualifiedSourceName() == null) {
return ResolvedType.MISSING;
}
if (binding instanceof TypeVariableBinding) {
TypeVariableBinding tb = (TypeVariableBinding) binding;
UnresolvedTypeVariableReferenceType utvrt = (UnresolvedTypeVariableReferenceType) fromTypeVariableBinding(tb);
return utvrt;
}
if (binding instanceof ArrayBinding) {
ArrayBinding aBinding = (ArrayBinding) binding;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
UnresolvedType componentType = fromBinding(aBinding.leafComponentType);
return UnresolvedType.makeArray(componentType, aBinding.dimensions);
}
if (binding instanceof WildcardBinding) {
WildcardBinding eWB = (WildcardBinding) binding;
UnresolvedType theBound = null;
if (eWB.bound instanceof TypeVariableBinding) {
theBound = fromTypeVariableBinding((TypeVariableBinding) eWB.bound);
} else {
theBound = fromBinding(eWB.bound);
}
WildcardedUnresolvedType theType = (WildcardedUnresolvedType) TypeFactory.createTypeFromSignature(CharOperation
.charToString(eWB.genericTypeSignature()));
return theType;
}
if (binding instanceof ParameterizedTypeBinding) {
if (binding instanceof RawTypeBinding) {
return UnresolvedType.forRawTypeName(getName(binding));
}
ParameterizedTypeBinding ptb = (ParameterizedTypeBinding) binding;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
UnresolvedType[] arguments = null;
if (ptb.arguments != null) {
arguments = new UnresolvedType[ptb.arguments.length];
for (int i = 0; i < arguments.length; i++) {
arguments[i] = fromBinding(ptb.arguments[i]);
}
}
String baseTypeSignature = null;
ResolvedType baseType = getWorld().resolve(UnresolvedType.forName(getName(binding)), true);
if (!baseType.isMissing()) {
baseTypeSignature = baseType.getErasureSignature();
} else {
baseTypeSignature = UnresolvedType.forName(getName(binding)).getSignature();
}
if (arguments == null) {
arguments = new UnresolvedType[0];
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
return TypeFactory.createUnresolvedParameterizedType(baseTypeSignature, arguments);
}
if (binding.isGenericType() && !binding.isParameterizedType() && !binding.isRawType()) {
TypeVariableBinding[] tvbs = binding.typeVariables();
TypeVariable[] tVars = new TypeVariable[tvbs.length];
for (int i = 0; i < tvbs.length; i++) {
TypeVariableBinding eclipseV = tvbs[i];
tVars[i] = ((TypeVariableReference) fromTypeVariableBinding(eclipseV)).getTypeVariable();
}
if (!(binding instanceof SourceTypeBinding)) {
throw new RuntimeException("Cant get the generic sig for " + binding.debugName());
}
return UnresolvedType.forGenericType(getName(binding), tVars,
CharOperation.charToString(((SourceTypeBinding) binding).genericSignature()));
}
if (binding instanceof LocalTypeBinding) {
LocalTypeBinding ltb = (LocalTypeBinding) binding;
if (ltb.constantPoolName() != null && ltb.constantPoolName().length > 0) {
return UnresolvedType.forSignature(new String(binding.signature()));
} else {
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
return UnresolvedType.forSignature(new String(ltb.enclosingType.signature()));
}
}
UnresolvedType ut = UnresolvedType.forSignature(new String(binding.signature()));
return ut;
}
/**
* Some type variables refer to themselves recursively, this enables us to avoid recursion problems.
*/
private static Map typeVariableBindingsInProgress = new HashMap();
/**
* Convert from the eclipse form of type variable (TypeVariableBinding) to the AspectJ form (TypeVariable).
*/
private UnresolvedType fromTypeVariableBinding(TypeVariableBinding aTypeVariableBinding) {
if (typeVariableBindingsInProgress.containsKey(aTypeVariableBinding)) {
return (UnresolvedType) typeVariableBindingsInProgress.get(aTypeVariableBinding);
}
if (typeVariablesForAliasRecovery != null) {
String aliasname = (String) typeVariablesForAliasRecovery.get(aTypeVariableBinding);
if (aliasname != null) {
UnresolvedTypeVariableReferenceType ret = new UnresolvedTypeVariableReferenceType();
ret.setTypeVariable(new TypeVariable(aliasname));
return ret;
}
}
if (typeVariablesForThisMember.containsKey(new String(aTypeVariableBinding.sourceName))) {
return (UnresolvedType) typeVariablesForThisMember.get(new String(aTypeVariableBinding.sourceName));
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
}
String name = CharOperation.charToString(aTypeVariableBinding.sourceName());
UnresolvedTypeVariableReferenceType ret = new UnresolvedTypeVariableReferenceType();
typeVariableBindingsInProgress.put(aTypeVariableBinding, ret);
TypeVariable tv = new TypeVariable(name);
ret.setTypeVariable(tv);
UnresolvedType superclassType = fromBinding(aTypeVariableBinding.superclass());
UnresolvedType[] superinterfaces = null;
if (aTypeVariableBinding == null || aTypeVariableBinding.superInterfaces == null) {
superinterfaces = UnresolvedType.NONE;
} else {
superinterfaces = new UnresolvedType[aTypeVariableBinding.superInterfaces.length];
for (int i = 0; i < superinterfaces.length; i++) {
superinterfaces[i] = fromBinding(aTypeVariableBinding.superInterfaces[i]);
}
}
tv.setSuperclass(superclassType);
tv.setAdditionalInterfaceBounds(superinterfaces);
tv.setRank(aTypeVariableBinding.rank);
if (aTypeVariableBinding.declaringElement instanceof MethodBinding) {
tv.setDeclaringElementKind(TypeVariable.METHOD);
} else {
tv.setDeclaringElementKind(TypeVariable.TYPE);
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
if (aTypeVariableBinding.declaringElement instanceof MethodBinding) {
typeVariablesForThisMember.put(new String(aTypeVariableBinding.sourceName), ret);
}
typeVariableBindingsInProgress.remove(aTypeVariableBinding);
return ret;
}
public UnresolvedType[] fromBindings(TypeBinding[] bindings) {
if (bindings == null) {
return UnresolvedType.NONE;
}
int len = bindings.length;
UnresolvedType[] ret = new UnresolvedType[len];
for (int i = 0; i < len; i++) {
ret[i] = fromBinding(bindings[i]);
}
return ret;
}
public static ASTNode astForLocation(IHasPosition location) {
return new EmptyStatement(location.getStart(), location.getEnd());
}
public List<DeclareParents> getDeclareParents() {
return getWorld().getDeclareParents();
}
public List<DeclareAnnotation> getDeclareAnnotationOnTypes() {
return getWorld().getDeclareAnnotationOnTypes();
}
public List<DeclareAnnotation> getDeclareAnnotationOnFields() {
return getWorld().getDeclareAnnotationOnFields();
}
public List<DeclareAnnotation> getDeclareAnnotationOnMethods() {
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
return getWorld().getDeclareAnnotationOnMethods();
}
public boolean areTypeMungersFinished() {
return finishedTypeMungers != null;
}
public void finishTypeMungers() {
List<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
List<ConcreteTypeMunger> baseTypeMungers = getWorld().getCrosscuttingMembersSet().getTypeMungers();
debug_mungerCount = baseTypeMungers.size();
for (ConcreteTypeMunger munger : baseTypeMungers) {
EclipseTypeMunger etm = makeEclipseTypeMunger(munger);
if (etm != null) {
if (munger.getMunger().getKind() == ResolvedTypeMunger.InnerClass) {
ret.add(0, etm);
} else {
ret.add(etm);
}
}
}
finishedTypeMungers = ret;
}
public EclipseTypeMunger makeEclipseTypeMunger(ConcreteTypeMunger concrete) {
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
if (concrete.getMunger() != null && EclipseTypeMunger.supportsKind(concrete.getMunger().getKind())) {
AbstractMethodDeclaration method = null;
if (concrete instanceof EclipseTypeMunger) {
method = ((EclipseTypeMunger) concrete).getSourceMethod();
}
EclipseTypeMunger ret = new EclipseTypeMunger(this, concrete.getMunger(), concrete.getAspectType(), method);
if (ret.getSourceLocation() == null) {
ret.setSourceLocation(concrete.getSourceLocation());
}
return ret;
} else {
return null;
}
}
public List<ConcreteTypeMunger> getTypeMungers() {
return finishedTypeMungers;
}
public ResolvedMemberImpl makeResolvedMember(MethodBinding binding) {
return makeResolvedMember(binding, binding.declaringClass);
}
public ResolvedMemberImpl makeResolvedMember(MethodBinding binding, Shadow.Kind shadowKind) {
MemberKind memberKind = binding.isConstructor() ? Member.CONSTRUCTOR : Member.METHOD;
if (shadowKind == Shadow.AdviceExecution) {
memberKind = Member.ADVICE;
}
return makeResolvedMember(binding, binding.declaringClass, memberKind);
}
/**
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
* Conversion from a methodbinding (eclipse) to a resolvedmember (aspectj) is now done in the scope of some type variables.
* Before converting the parts of a methodbinding (params, return type) we store the type variables in this structure, then
* should any component of the method binding refer to them, we grab them from the map.
*/
private final Map typeVariablesForThisMember = new HashMap();
/**
* This is a map from typevariablebindings (eclipsey things) to the names the user originally specified in their ITD. For
* example if the target is 'interface I<N extends Number> {}' and the ITD was 'public void I<X>.m(List<X> lxs) {}' then this
* map would contain a pointer from the eclipse type 'N extends Number' to the letter 'X'.
*/
private Map typeVariablesForAliasRecovery;
/**
* Construct a resolvedmember from a methodbinding. The supplied map tells us about any typevariablebindings that replaced
* typevariables whilst the compiler was resolving types - this only happens if it is a generic itd that shares type variables
* with its target type.
*/
public ResolvedMemberImpl makeResolvedMemberForITD(MethodBinding binding, TypeBinding declaringType, Map /*
* TypeVariableBinding >
* original alias name
*/recoveryAliases) {
ResolvedMemberImpl result = null;
try {
typeVariablesForAliasRecovery = recoveryAliases;
result = makeResolvedMember(binding, declaringType);
} finally {
typeVariablesForAliasRecovery = null;
}
return result;
}
public ResolvedMemberImpl makeResolvedMember(MethodBinding binding, TypeBinding declaringType) {
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
return makeResolvedMember(binding, declaringType, binding.isConstructor() ? Member.CONSTRUCTOR : Member.METHOD);
}
public ResolvedMemberImpl makeResolvedMember(MethodBinding binding, TypeBinding declaringType, MemberKind memberKind) {
UnresolvedType[] ajTypeRefs = null;
typeVariablesForThisMember.clear();
if (binding.typeVariables != null) {
ajTypeRefs = new UnresolvedType[binding.typeVariables.length];
for (int i = 0; i < binding.typeVariables.length; i++) {
ajTypeRefs[i] = fromBinding(binding.typeVariables[i]);
typeVariablesForThisMember.put(new String(binding.typeVariables[i].sourceName),/*
* new
* Integer(binding.typeVariables[
* i].rank),
*/ajTypeRefs[i]);
}
}
ResolvedType realDeclaringType = world.resolve(fromBinding(declaringType));
if (realDeclaringType.isRawType()) {
realDeclaringType = realDeclaringType.getGenericType();
}
ResolvedMemberImpl ret = new EclipseResolvedMember(binding, memberKind, realDeclaringType, binding.modifiers,
fromBinding(binding.returnType), new String(binding.selector), fromBindings(binding.parameters),
fromBindings(binding.thrownExceptions), this);
if (binding.isVarargs()) {
ret.setVarargsMethod();
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
if (ajTypeRefs != null) {
TypeVariable[] tVars = new TypeVariable[ajTypeRefs.length];
for (int i = 0; i < ajTypeRefs.length; i++) {
tVars[i] = ((TypeVariableReference) ajTypeRefs[i]).getTypeVariable();
}
ret.setTypeVariables(tVars);
}
typeVariablesForThisMember.clear();
ret.resolve(world);
return ret;
}
public ResolvedMember makeResolvedMember(FieldBinding binding) {
return makeResolvedMember(binding, binding.declaringClass);
}
public ResolvedMember makeResolvedMember(FieldBinding binding, TypeBinding receiverType) {
ResolvedType realDeclaringType = world.resolve(fromBinding(receiverType));
if (realDeclaringType.isRawType()) {
realDeclaringType = realDeclaringType.getGenericType();
}
ResolvedMemberImpl ret = new EclipseResolvedMember(binding, Member.FIELD, realDeclaringType, binding.modifiers,
world.resolve(fromBinding(binding.type)), new String(binding.name), UnresolvedType.NONE);
return ret;
}
public TypeBinding makeTypeBinding(UnresolvedType typeX) {
TypeBinding ret = null;
if (!typeX.isTypeVariableReference() && !isParameterizedWithTypeVariables(typeX)) {
if (typeX.isRawType()) {
ret = (TypeBinding) rawTypeXToBinding.get(typeX);
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
} else {
ret = (TypeBinding) typexToBinding.get(typeX);
}
}
if (ret == null) {
ret = makeTypeBinding1(typeX);
if (ret != null) {
if (!(typeX instanceof BoundedReferenceType) && !(typeX instanceof UnresolvedTypeVariableReferenceType)) {
if (typeX.isRawType()) {
rawTypeXToBinding.put(typeX, ret);
} else {
typexToBinding.put(typeX, ret);
}
}
}
}
return ret;
}
private boolean isParameterizedWithTypeVariables(UnresolvedType typeX) {
if (!typeX.isParameterizedType()) {
return false;
}
UnresolvedType[] typeArguments = typeX.getTypeParameters();
if (typeArguments != null) {
for (int i = 0; i < typeArguments.length; i++) {
if (typeArguments[i].isTypeVariableReference()) {
return true;
}
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
}
return false;
}
private ReferenceBinding baseTypeForParameterizedType;
private int indexOfTypeParameterBeingConverted;
private TypeBinding makeTypeBinding1(UnresolvedType typeX) {
if (typeX.isPrimitiveType()) {
if (typeX.equals(UnresolvedType.BOOLEAN)) {
return TypeBinding.BOOLEAN;
}
if (typeX.equals(UnresolvedType.BYTE)) {
return TypeBinding.BYTE;
}
if (typeX.equals(UnresolvedType.CHAR)) {
return TypeBinding.CHAR;
}
if (typeX.equals(UnresolvedType.DOUBLE)) {
return TypeBinding.DOUBLE;
}
if (typeX.equals(UnresolvedType.FLOAT)) {
return TypeBinding.FLOAT;
}
if (typeX.equals(UnresolvedType.INT)) {
return TypeBinding.INT;
}
if (typeX.equals(UnresolvedType.LONG)) {
return TypeBinding.LONG;
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
if (typeX.equals(UnresolvedType.SHORT)) {
return TypeBinding.SHORT;
}
if (typeX.equals(UnresolvedType.VOID)) {
return TypeBinding.VOID;
}
throw new RuntimeException("weird primitive type " + typeX);
} else if (typeX.isArray()) {
int dim = 0;
while (typeX.isArray()) {
dim++;
typeX = typeX.getComponentType();
}
return lookupEnvironment.createArrayType(makeTypeBinding(typeX), dim);
} else if (typeX.isParameterizedType()) {
UnresolvedType[] typeParameters = typeX.getTypeParameters();
ReferenceBinding baseTypeBinding = lookupBinding(typeX.getBaseName());
TypeBinding[] argumentBindings = new TypeBinding[typeParameters.length];
baseTypeForParameterizedType = baseTypeBinding;
for (int i = 0; i < argumentBindings.length; i++) {
indexOfTypeParameterBeingConverted = i;
argumentBindings[i] = makeTypeBinding(typeParameters[i]);
}
indexOfTypeParameterBeingConverted = 0;
baseTypeForParameterizedType = null;
ParameterizedTypeBinding ptb = lookupEnvironment.createParameterizedType(baseTypeBinding, argumentBindings,
baseTypeBinding.enclosingType());
return ptb;
} else if (typeX.isTypeVariableReference()) {
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
return makeTypeVariableBindingFromAJTypeVariable(((TypeVariableReference) typeX).getTypeVariable());
} else if (typeX.isRawType()) {
ReferenceBinding baseTypeBinding = lookupBinding(typeX.getBaseName());
RawTypeBinding rtb = lookupEnvironment.createRawType(baseTypeBinding, baseTypeBinding.enclosingType());
return rtb;
} else if (typeX.isGenericWildcard()) {
if (typeX instanceof WildcardedUnresolvedType) {
WildcardedUnresolvedType wut = (WildcardedUnresolvedType) typeX;
int boundkind = Wildcard.UNBOUND;
TypeBinding bound = null;
if (wut.isExtends()) {
boundkind = Wildcard.EXTENDS;
bound = makeTypeBinding(wut.getUpperBound());
} else if (wut.isSuper()) {
boundkind = Wildcard.SUPER;
bound = makeTypeBinding(wut.getLowerBound());
}
TypeBinding[] otherBounds = null;
WildcardBinding wb = lookupEnvironment.createWildcard(baseTypeForParameterizedType,
indexOfTypeParameterBeingConverted, bound, otherBounds, boundkind);
return wb;
} else if (typeX instanceof BoundedReferenceType) {
BoundedReferenceType brt = (BoundedReferenceType) typeX;
int boundkind = Wildcard.UNBOUND;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
TypeBinding bound = null;
if (brt.isExtends()) {
boundkind = Wildcard.EXTENDS;
bound = makeTypeBinding(brt.getUpperBound());
} else if (brt.isSuper()) {
boundkind = Wildcard.SUPER;
bound = makeTypeBinding(brt.getLowerBound());
}
TypeBinding[] otherBounds = null;
if (brt.getAdditionalBounds() != null && brt.getAdditionalBounds().length != 0) {
otherBounds = makeTypeBindings(brt.getAdditionalBounds());
}
WildcardBinding wb = lookupEnvironment.createWildcard(baseTypeForParameterizedType,
indexOfTypeParameterBeingConverted, bound, otherBounds, boundkind);
return wb;
} else {
throw new BCException("This type " + typeX + " (class " + typeX.getClass().getName()
+ ") should not be claiming to be a wildcard!");
}
} else {
return lookupBinding(typeX.getName());
}
}
private ReferenceBinding lookupBinding(String sname) {
char[][] name = CharOperation.splitOn('.', sname.toCharArray());
ReferenceBinding rb = lookupEnvironment.getType(name);
if (rb == null && !sname.equals(UnresolvedType.MISSING_NAME)) {
return new ProblemReferenceBinding(name, null, ProblemReasons.NotFound);
}
return rb;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
}
public TypeBinding[] makeTypeBindings(UnresolvedType[] types) {
int len = types.length;
TypeBinding[] ret = new TypeBinding[len];
for (int i = 0; i < len; i++) {
ret[i] = makeTypeBinding(types[i]);
}
return ret;
}
private ReferenceBinding[] makeReferenceBindings(UnresolvedType[] types) {
int len = types.length;
ReferenceBinding[] ret = new ReferenceBinding[len];
for (int i = 0; i < len; i++) {
ret[i] = (ReferenceBinding) makeTypeBinding(types[i]);
}
return ret;
}
public FieldBinding makeFieldBinding(NewFieldTypeMunger nftm) {
return internalMakeFieldBinding(nftm.getSignature(), nftm.getTypeVariableAliases());
}
/**
* Convert a resolvedmember into an eclipse field binding
*/
public FieldBinding makeFieldBinding(ResolvedMember member, List aliases) {
return internalMakeFieldBinding(member, aliases);
}
/**
* Convert a resolvedmember into an eclipse field binding
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
*/
public FieldBinding makeFieldBinding(ResolvedMember member) {
return internalMakeFieldBinding(member, null);
}
/**
* Build a new Eclipse SyntheticFieldBinding for an AspectJ ResolvedMember.
*/
public SyntheticFieldBinding createSyntheticFieldBinding(SourceTypeBinding owningType, ResolvedMember member) {
SyntheticFieldBinding sfb = new SyntheticFieldBinding(member.getName().toCharArray(),
makeTypeBinding(member.getReturnType()), member.getModifiers() | Flags.AccSynthetic, owningType,
Constant.NotAConstant, -1);
owningType.addSyntheticField(sfb);
return sfb;
}
/**
* Take a normal AJ member and convert it into an eclipse fieldBinding. Taking into account any aliases that it may include due
* to being a generic itd. Any aliases are put into the typeVariableToBinding map so that they will be substituted as
* appropriate in the returned fieldbinding.
*/
public FieldBinding internalMakeFieldBinding(ResolvedMember member, List aliases) {
typeVariableToTypeBinding.clear();
ReferenceBinding declaringType = (ReferenceBinding) makeTypeBinding(member.getDeclaringType());
if (aliases != null && aliases.size() > 0 && declaringType.typeVariables() != null
&& declaringType.typeVariables().length != 0) {
int i = 0;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
for (Iterator iter = aliases.iterator(); iter.hasNext();) {
String element = (String) iter.next();
typeVariableToTypeBinding.put(element, declaringType.typeVariables()[i++]);
}
}
currentType = declaringType;
FieldBinding fb = null;
if (member.getName().startsWith(NameMangler.PREFIX)) {
fb = new SyntheticFieldBinding(member.getName().toCharArray(), makeTypeBinding(member.getReturnType()),
member.getModifiers() | Flags.AccSynthetic, currentType, Constant.NotAConstant, -1);
} else {
fb = new FieldBinding(member.getName().toCharArray(), makeTypeBinding(member.getReturnType()), member.getModifiers(),
currentType, Constant.NotAConstant);
}
typeVariableToTypeBinding.clear();
currentType = null;
if (member.getName().startsWith(NameMangler.PREFIX)) {
fb.modifiers |= Flags.AccSynthetic;
}
return fb;
}
private ReferenceBinding currentType = null;
public MethodBinding makeMethodBinding(NewMethodTypeMunger nmtm) {
return internalMakeMethodBinding(nmtm.getSignature(), nmtm.getTypeVariableAliases());
}
/**
* Convert a resolvedmember into an eclipse method binding.
*/
public MethodBinding makeMethodBinding(ResolvedMember member, List aliases) {
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
return internalMakeMethodBinding(member, aliases);
}
/**
* Creates a method binding for a resolvedmember taking into account type variable aliases - this variant can take an
* aliasTargetType and should be used when the alias target type cannot be retrieved from the resolvedmember.
*/
public MethodBinding makeMethodBinding(ResolvedMember member, List aliases, UnresolvedType aliasTargetType) {
return internalMakeMethodBinding(member, aliases, aliasTargetType);
}
/**
* Convert a resolvedmember into an eclipse method binding.
*/
public MethodBinding makeMethodBinding(ResolvedMember member) {
return internalMakeMethodBinding(member, null);
}
public MethodBinding internalMakeMethodBinding(ResolvedMember member, List aliases) {
return internalMakeMethodBinding(member, aliases, member.getDeclaringType());
}
/**
* Take a normal AJ member and convert it into an eclipse methodBinding. Taking into account any aliases that it may include due
* to being a generic ITD. Any aliases are put into the typeVariableToBinding map so that they will be substituted as
* appropriate in the returned methodbinding
*/
public MethodBinding internalMakeMethodBinding(ResolvedMember member, List aliases, UnresolvedType aliasTargetType) {
typeVariableToTypeBinding.clear();
TypeVariableBinding[] tvbs = null;
if (member.getTypeVariables() != null) {
if (member.getTypeVariables().length == 0) {
tvbs = Binding.NO_TYPE_VARIABLES;
} else {
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
tvbs = makeTypeVariableBindingsFromAJTypeVariables(member.getTypeVariables());
}
}
ReferenceBinding declaringType = (ReferenceBinding) makeTypeBinding(member.getDeclaringType());
if (aliases != null && aliases.size() != 0 && declaringType.typeVariables() != null
&& declaringType.typeVariables().length != 0) {
int i = 0;
ReferenceBinding aliasTarget = (ReferenceBinding) makeTypeBinding(aliasTargetType);
if (aliasTarget.isRawType()) {
aliasTarget = ((RawTypeBinding) aliasTarget).genericType();
}
for (Iterator iter = aliases.iterator(); iter.hasNext();) {
String element = (String) iter.next();
typeVariableToTypeBinding.put(element, aliasTarget.typeVariables()[i++]);
}
}
currentType = declaringType;
MethodBinding mb = new MethodBinding(member.getModifiers(), member.getName().toCharArray(),
makeTypeBinding(member.getReturnType()), makeTypeBindings(member.getParameterTypes()),
makeReferenceBindings(member.getExceptions()), declaringType);
if (tvbs != null) {
mb.typeVariables = tvbs;
}
typeVariableToTypeBinding.clear();
currentType = null;
if (NameMangler.isSyntheticMethod(member.getName(), true)) {
mb.modifiers |= Flags.AccSynthetic;
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
return mb;
}
/**
* Convert a bunch of type variables in one go, from AspectJ form to Eclipse form.
*/
private TypeVariableBinding[] makeTypeVariableBindingsFromAJTypeVariables(TypeVariable[] typeVariables) {
int len = typeVariables.length;
TypeVariableBinding[] ret = new TypeVariableBinding[len];
for (int i = 0; i < len; i++) {
ret[i] = makeTypeVariableBindingFromAJTypeVariable(typeVariables[i]);
}
return ret;
}
private final Map typeVariableToTypeBinding = new HashMap();
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
private TypeVariableBinding makeTypeVariableBindingFromAJTypeVariable(TypeVariable tv) {
TypeVariableBinding tvBinding = (TypeVariableBinding) typeVariableToTypeBinding.get(tv.getName());
if (currentType != null) {
TypeVariableBinding tvb = currentType.getTypeVariable(tv.getName().toCharArray());
if (tvb != null) {
return tvb;
}
}
if (tvBinding == null) {
Binding declaringElement = null;
tvBinding = new TypeVariableBinding(tv.getName().toCharArray(), declaringElement, tv.getRank(),this.lookupEnvironment);
typeVariableToTypeBinding.put(tv.getName(), tvBinding);
if (tv.getSuperclass() != null
&& (!tv.getSuperclass().getSignature().equals("Ljava/lang/Object;") || tv.getSuperInterfaces() != null)) {
tvBinding.superclass = (ReferenceBinding) makeTypeBinding(tv.getSuperclass());
}
tvBinding.firstBound = makeTypeBinding(tv.getFirstBound());
if (tv.getSuperInterfaces() == null) {
tvBinding.superInterfaces = TypeVariableBinding.NO_SUPERINTERFACES;
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
} else {
TypeBinding tbs[] = makeTypeBindings(tv.getSuperInterfaces());
ReferenceBinding[] rbs = new ReferenceBinding[tbs.length];
for (int i = 0; i < tbs.length; i++) {
rbs[i] = (ReferenceBinding) tbs[i];
}
tvBinding.superInterfaces = rbs;
}
}
return tvBinding;
}
public MethodBinding makeMethodBindingForCall(Member member) {
return new MethodBinding(member.getModifiers() & ~Modifier.INTERFACE, member.getName().toCharArray(),
makeTypeBinding(member.getReturnType()), makeTypeBindings(member.getParameterTypes()), new ReferenceBinding[0],
(ReferenceBinding) makeTypeBinding(member.getDeclaringType()));
}
public void finishedCompilationUnit(CompilationUnitDeclaration unit) {
if ((buildManager != null) && buildManager.doGenerateModel()) {
AjBuildManager.getAsmHierarchyBuilder().buildStructureForCompilationUnit(unit, buildManager.getStructureModel(),
buildManager.buildConfig);
}
}
public void addTypeBinding(TypeBinding binding) {
typexToBinding.put(fromBinding(binding), binding);
}
public void addTypeBindingAndStoreInWorld(TypeBinding binding) {
UnresolvedType ut = fromBinding(binding);
typexToBinding.put(ut, binding);
world.lookupOrCreateName(ut);
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
public Shadow makeShadow(ASTNode location, ReferenceContext context) {
return EclipseShadow.makeShadow(this, location, context);
}
public Shadow makeShadow(ReferenceContext context) {
return EclipseShadow.makeShadow(this, (ASTNode) context, context);
}
public void addSourceTypeBinding(SourceTypeBinding binding, CompilationUnitDeclaration unit) {
TypeDeclaration decl = binding.scope.referenceContext;
UnresolvedType unresolvedRawType = null;
if (binding.isGenericType()) {
unresolvedRawType = UnresolvedType.forRawTypeName(getName(binding));
} else if (binding.isLocalType()) {
LocalTypeBinding ltb = (LocalTypeBinding) binding;
if (ltb.constantPoolName() != null && ltb.constantPoolName().length > 0) {
unresolvedRawType = UnresolvedType.forSignature(new String(binding.signature()));
} else {
unresolvedRawType = UnresolvedType.forName(getName(binding));
}
} else {
unresolvedRawType = UnresolvedType.forName(getName(binding));
}
ReferenceType resolvedRawType = getWorld().lookupOrCreateName(unresolvedRawType);
if (!binding.isRawType() && !binding.isGenericType() && resolvedRawType.getTypekind() == TypeKind.RAW) {
resolvedRawType.demoteToSimpleType();
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
}
EclipseSourceType t = new EclipseSourceType(resolvedRawType, this, binding, decl, unit);
if (binding.isGenericType()) {
UnresolvedType unresolvedGenericType = fromBinding(binding);
ResolvedType resolvedGenericType = world.resolve(unresolvedGenericType, true);
ReferenceType complexName = null;
if (!resolvedGenericType.isMissing()) {
complexName = (ReferenceType) resolvedGenericType;
complexName = (ReferenceType) complexName.getGenericType();
if (complexName == null) {
complexName = new ReferenceType(unresolvedGenericType, world);
}
} else {
complexName = new ReferenceType(unresolvedGenericType, world);
}
resolvedRawType.setGenericType(complexName);
complexName.setDelegate(t);
}
resolvedRawType.setDelegate(t);
if (decl instanceof AspectDeclaration) {
((AspectDeclaration) decl).typeX = resolvedRawType;
((AspectDeclaration) decl).concreteName = t;
}
ReferenceBinding[] memberTypes = binding.memberTypes;
for (int i = 0, length = memberTypes.length; i < length; i++) {
addSourceTypeBinding((SourceTypeBinding) memberTypes[i], unit);
}
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
|
public boolean isXSerializableAspects() {
return xSerializableAspects;
}
public ResolvedMember fromBinding(MethodBinding binding) {
return new ResolvedMemberImpl(Member.METHOD, fromBinding(binding.declaringClass), binding.modifiers,
fromBinding(binding.returnType), CharOperation.charToString(binding.selector), fromBindings(binding.parameters));
}
public TypeVariableDeclaringElement fromBinding(Binding declaringElement) {
if (declaringElement instanceof TypeBinding) {
return fromBinding(((TypeBinding) declaringElement));
} else {
return fromBinding((MethodBinding) declaringElement);
}
}
public void cleanup() {
this.typexToBinding.clear();
this.rawTypeXToBinding.clear();
this.finishedTypeMungers = null;
}
public void minicleanup() {
this.typexToBinding.clear();
this.rawTypeXToBinding.clear();
}
public int getItdVersion() {
return world.getItdVersion();
}
}
|
384,398 |
Bug 384398 Type Mismatch error when using inner classes contained in generic types within ITDs
|
Please see attached example project. I get the following (strange) compiler error: Type mismatch: cannot convert from A<T>.InnerA<> to A.InnerA BAspect.aj /AspectJInnerclassInGenericTypeBug/src/de/example line 12
|
resolved fixed
|
bf949d3
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-07-10T17:18:35Z | 2012-07-05T17:40:00Z |
tests/src/org/aspectj/systemtest/AllTests17.java
|
/*
* Created on 19-01-2005
*/
package org.aspectj.systemtest;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.aspectj.systemtest.ajc170.AllTestsAspectJ170;
public class AllTests17 {
public static Test suite() {
TestSuite suite = new TestSuite("AspectJ System Test Suite - JDK 1.7");
suite.addTest(AllTestsAspectJ170.suite());
suite.addTest(AllTests16.suite());
suite.addTest(AllTests15.suite());
return suite;
}
}
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.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
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
* http:www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PARC initial implementation
* Alexandre Vasseur @AspectJ ITDs
* ******************************************************************/
package org.aspectj.weaver;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.AjAttribute.WeaverVersionInfo;
import org.aspectj.weaver.Iterators.Getter;
import org.aspectj.weaver.patterns.Declare;
import org.aspectj.weaver.patterns.PerClause;
public abstract class ResolvedType extends UnresolvedType implements AnnotatedElement {
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
public static final ResolvedType[] EMPTY_RESOLVED_TYPE_ARRAY = new ResolvedType[0];
public static final String PARAMETERIZED_TYPE_IDENTIFIER = "P";
public ResolvedType[] temporaryAnnotationTypes;
private ResolvedType[] resolvedTypeParams;
private String binaryPath;
protected World world;
private int bits;
private static int AnnotationBitsInitialized = 0x0001;
private static int AnnotationMarkedInherited = 0x0002;
private static int MungersAnalyzed = 0x0004;
private static int HasParentMunger = 0x0008;
private static int TypeHierarchyCompleteBit = 0x0010;
private static int GroovyObjectInitialized = 0x0020;
private static int IsGroovyObject = 0x0040;
protected ResolvedType(String signature, World world) {
super(signature);
this.world = world;
}
protected ResolvedType(String signature, String signatureErasure, World world) {
super(signature, signatureErasure);
this.world = world;
}
public int 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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
return 1;
}
/**
* Returns an iterator through ResolvedType objects representing all the direct supertypes of this type. That is, through the
* superclass, if any, and all declared interfaces.
*/
public final Iterator<ResolvedType> getDirectSupertypes() {
Iterator<ResolvedType> interfacesIterator = Iterators.array(getDeclaredInterfaces());
ResolvedType superclass = getSuperclass();
if (superclass == null) {
return interfacesIterator;
} else {
return Iterators.snoc(interfacesIterator, superclass);
}
}
public abstract ResolvedMember[] getDeclaredFields();
public abstract ResolvedMember[] getDeclaredMethods();
public abstract ResolvedType[] getDeclaredInterfaces();
public abstract ResolvedMember[] getDeclaredPointcuts();
public boolean isCacheable() {
return true;
}
/**
* @return the superclass of this type, or null (if this represents a jlObject, primitive, or void)
*/
public abstract ResolvedType getSuperclass();
public abstract int getModifiers();
public boolean isMissing() {
return false;
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
public static boolean isMissing(UnresolvedType unresolved) {
if (unresolved instanceof ResolvedType) {
ResolvedType resolved = (ResolvedType) unresolved;
return resolved.isMissing();
} else {
return (unresolved == MISSING);
}
}
public ResolvedType[] getAnnotationTypes() {
return EMPTY_RESOLVED_TYPE_ARRAY;
}
public AnnotationAJ getAnnotationOfType(UnresolvedType ofType) {
return null;
}
protected static Set<String> validBoxing = new HashSet<String>();
static {
validBoxing.add("Ljava/lang/Byte;B");
validBoxing.add("Ljava/lang/Character;C");
validBoxing.add("Ljava/lang/Double;D");
validBoxing.add("Ljava/lang/Float;F");
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
validBoxing.add("Ljava/lang/Integer;I");
validBoxing.add("Ljava/lang/Long;J");
validBoxing.add("Ljava/lang/Short;S");
validBoxing.add("Ljava/lang/Boolean;Z");
validBoxing.add("BLjava/lang/Byte;");
validBoxing.add("CLjava/lang/Character;");
validBoxing.add("DLjava/lang/Double;");
validBoxing.add("FLjava/lang/Float;");
validBoxing.add("ILjava/lang/Integer;");
validBoxing.add("JLjava/lang/Long;");
validBoxing.add("SLjava/lang/Short;");
validBoxing.add("ZLjava/lang/Boolean;");
}
public ResolvedType getResolvedComponentType() {
return null;
}
public World getWorld() {
return world;
}
@Override
public boolean equals(Object other) {
if (other instanceof ResolvedType) {
return this == other;
} else {
return super.equals(other);
}
}
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
/**
* returns an iterator through all of the fields of this type, in order for checking from JVM spec 2ed 5.4.3.2. This means that
* the order is
* <p/>
* <ul>
* <li>fields from current class</li>
* <li>recur into direct superinterfaces</li>
* <li>recur into superclass</li>
* </ul>
* <p/>
* We keep a hashSet of interfaces that we've visited so we don't spiral out into 2^n land.
*/
public Iterator<ResolvedMember> getFields() {
final Iterators.Filter<ResolvedType> dupFilter = Iterators.dupFilter();
Iterators.Getter<ResolvedType, ResolvedType> typeGetter = new Iterators.Getter<ResolvedType, ResolvedType>() {
public Iterator<ResolvedType> get(ResolvedType o) {
return dupFilter.filter(o.getDirectSupertypes());
}
};
return Iterators.mapOver(Iterators.recur(this, typeGetter), FieldGetterInstance);
}
/**
* returns an iterator through all of the methods of this type, in order for checking from JVM spec 2ed 5.4.3.3. This means that
* the order is
* <p/>
* <ul>
* <li>methods from current class</li>
* <li>recur into superclass, all the way up, not touching interfaces</li>
* <li>recur into all superinterfaces, in some unspecified order (but those 'closest' to this type are first)</li>
* </ul>
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
* <p/>
*
* @param wantGenerics is true if the caller would like all generics information, otherwise those methods are collapsed to their
* erasure
*/
public Iterator<ResolvedMember> getMethods(boolean wantGenerics, boolean wantDeclaredParents) {
return Iterators.mapOver(getHierarchy(wantGenerics, wantDeclaredParents), MethodGetterInstance);
}
public Iterator<ResolvedMember> getMethodsIncludingIntertypeDeclarations(boolean wantGenerics, boolean wantDeclaredParents) {
return Iterators.mapOver(getHierarchy(wantGenerics, wantDeclaredParents), MethodGetterWithItdsInstance);
}
/**
* An Iterators.Getter that returns an iterator over all methods declared on some resolved type.
*/
private static class MethodGetter implements Iterators.Getter<ResolvedType, ResolvedMember> {
public Iterator<ResolvedMember> get(ResolvedType type) {
return Iterators.array(type.getDeclaredMethods());
}
}
/**
* An Iterators.Getter that returns an iterator over all pointcuts declared on some resolved type.
*/
private static class PointcutGetter implements Iterators.Getter<ResolvedType, ResolvedMember> {
public Iterator<ResolvedMember> get(ResolvedType o) {
return Iterators.array(o.getDeclaredPointcuts());
}
}
private static class MethodGetterIncludingItds implements Iterators.Getter<ResolvedType, ResolvedMember> {
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
public Iterator<ResolvedMember> get(ResolvedType type) {
ResolvedMember[] methods = type.getDeclaredMethods();
if (type.interTypeMungers != null) {
int additional = 0;
for (ConcreteTypeMunger typeTransformer : type.interTypeMungers) {
ResolvedMember rm = typeTransformer.getSignature();
if (rm != null) {
additional++;
}
}
if (additional > 0) {
ResolvedMember[] methods2 = new ResolvedMember[methods.length + additional];
System.arraycopy(methods, 0, methods2, 0, methods.length);
additional = methods.length;
for (ConcreteTypeMunger typeTransformer : type.interTypeMungers) {
ResolvedMember rm = typeTransformer.getSignature();
if (rm != null) {
methods2[additional++] = typeTransformer.getSignature();
}
}
methods = methods2;
}
}
return Iterators.array(methods);
}
}
/**
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
* An Iterators.Getter that returns an iterator over all fields declared on some resolved type.
*/
private static class FieldGetter implements Iterators.Getter<ResolvedType, ResolvedMember> {
public Iterator<ResolvedMember> get(ResolvedType type) {
return Iterators.array(type.getDeclaredFields());
}
}
private final static MethodGetter MethodGetterInstance = new MethodGetter();
private final static MethodGetterIncludingItds MethodGetterWithItdsInstance = new MethodGetterIncludingItds();
private final static PointcutGetter PointcutGetterInstance = new PointcutGetter();
private final static FieldGetter FieldGetterInstance = new FieldGetter();
/**
* Return an iterator over the types in this types hierarchy - starting with this type first, then all superclasses up to Object
* and then all interfaces (starting with those 'nearest' this type).
*
* @param wantGenerics true if the caller wants full generic information
* @param wantDeclaredParents true if the caller even wants those parents introduced via declare parents
* @return an iterator over all types in the hierarchy of this type
*/
public Iterator<ResolvedType> getHierarchy() {
return getHierarchy(false, false);
}
public Iterator<ResolvedType> getHierarchy(final boolean wantGenerics, final boolean wantDeclaredParents) {
final Iterators.Getter<ResolvedType, ResolvedType> interfaceGetter = new Iterators.Getter<ResolvedType, ResolvedType>() {
List<String> alreadySeen = new ArrayList<String>();
public Iterator<ResolvedType> get(ResolvedType type) {
ResolvedType[] interfaces = type.getDeclaredInterfaces();
if (!wantDeclaredParents && type.hasNewParentMungers()) {
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
List<Integer> forRemoval = new ArrayList<Integer>();
for (ConcreteTypeMunger munger : type.interTypeMungers) {
if (munger.getMunger() != null) {
ResolvedTypeMunger m = munger.getMunger();
if (m.getKind() == ResolvedTypeMunger.Parent) {
ResolvedType newType = ((NewParentTypeMunger) m).getNewParent();
if (!wantGenerics && newType.isParameterizedOrGenericType()) {
newType = newType.getRawType();
}
for (int ii = 0; ii < interfaces.length; ii++) {
ResolvedType iface = interfaces[ii];
if (!wantGenerics && iface.isParameterizedOrGenericType()) {
iface = iface.getRawType();
}
if (newType.getSignature().equals(iface.getSignature())) {
forRemoval.add(ii);
}
}
}
}
}
if (forRemoval.size() > 0) {
ResolvedType[] interfaces2 = new ResolvedType[interfaces.length - forRemoval.size()];
int p = 0;
for (int ii = 0; ii < interfaces.length; ii++) {
if (!forRemoval.contains(ii)) {
interfaces2[p++] = interfaces[ii];
}
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
interfaces = interfaces2;
}
}
return new Iterators.ResolvedTypeArrayIterator(interfaces, alreadySeen, wantGenerics);
}
};
if (this.isInterface()) {
return new SuperInterfaceWalker(interfaceGetter, this);
} else {
SuperInterfaceWalker superInterfaceWalker = new SuperInterfaceWalker(interfaceGetter);
Iterator<ResolvedType> superClassesIterator = new SuperClassWalker(this, superInterfaceWalker, wantGenerics);
return Iterators.append1(superClassesIterator, superInterfaceWalker);
}
}
/**
* Return a list of methods, first those declared on this class, then those declared on the superclass (recurse) and then those
* declared on the superinterfaces. This is expensive - use the getMethods() method if you can!
*/
public List<ResolvedMember> getMethodsWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware) {
List<ResolvedMember> methods = new ArrayList<ResolvedMember>();
Set<String> knowninterfaces = new HashSet<String>();
addAndRecurse(knowninterfaces, methods, this, includeITDs, allowMissing, genericsAware);
return methods;
}
/**
* Return a list of the types in the hierarchy of this type, starting with this type. The order in the list is the superclasses
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
* followed by the super interfaces.
*
* @param genericsAware should the list include parameterized/generic types (if not, they will be collapsed to raw)?
* @return list of resolvedtypes in this types hierarchy, including this type first
*/
public List<ResolvedType> getHierarchyWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware) {
List<ResolvedType> types = new ArrayList<ResolvedType>();
Set<String> visited = new HashSet<String>();
recurseHierarchy(visited, types, this, includeITDs, allowMissing, genericsAware);
return types;
}
private void addAndRecurse(Set<String> knowninterfaces, List<ResolvedMember> collector, ResolvedType resolvedType,
boolean includeITDs, boolean allowMissing, boolean genericsAware) {
collector.addAll(Arrays.asList(resolvedType.getDeclaredMethods()));
if (includeITDs && resolvedType.interTypeMungers != null) {
for (ConcreteTypeMunger typeTransformer : interTypeMungers) {
ResolvedMember rm = typeTransformer.getSignature();
if (rm != null) {
collector.add(typeTransformer.getSignature());
}
}
}
if (!resolvedType.isInterface() && !resolvedType.equals(ResolvedType.OBJECT)) {
ResolvedType superType = resolvedType.getSuperclass();
if (superType != null && !superType.isMissing()) {
if (!genericsAware && superType.isParameterizedOrGenericType()) {
superType = superType.getRawType();
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
addAndRecurse(knowninterfaces, collector, superType, includeITDs, allowMissing, genericsAware);
}
}
ResolvedType[] interfaces = resolvedType.getDeclaredInterfaces();
for (int i = 0; i < interfaces.length; i++) {
ResolvedType iface = interfaces[i];
if (!genericsAware && iface.isParameterizedOrGenericType()) {
iface = iface.getRawType();
}
boolean shouldSkip = false;
for (int j = 0; j < resolvedType.interTypeMungers.size(); j++) {
ConcreteTypeMunger munger = resolvedType.interTypeMungers.get(j);
if (munger.getMunger() != null && munger.getMunger().getKind() == ResolvedTypeMunger.Parent
&& ((NewParentTypeMunger) munger.getMunger()).getNewParent().equals(iface)
) {
shouldSkip = true;
break;
}
}
if (!shouldSkip && !knowninterfaces.contains(iface.getSignature())) {
knowninterfaces.add(iface.getSignature());
if (allowMissing && iface.isMissing()) {
if (iface instanceof MissingResolvedTypeWithKnownSignature) {
((MissingResolvedTypeWithKnownSignature) iface).raiseWarningOnMissingInterfaceWhilstFindingMethods();
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
} else {
addAndRecurse(knowninterfaces, collector, iface, includeITDs, allowMissing, genericsAware);
}
}
}
}
/**
* Recurse up a type hierarchy, first the superclasses then the super interfaces.
*/
private void recurseHierarchy(Set<String> knowninterfaces, List<ResolvedType> collector, ResolvedType resolvedType,
boolean includeITDs, boolean allowMissing, boolean genericsAware) {
collector.add(resolvedType);
if (!resolvedType.isInterface() && !resolvedType.equals(ResolvedType.OBJECT)) {
ResolvedType superType = resolvedType.getSuperclass();
if (superType != null && !superType.isMissing()) {
if (!genericsAware && (superType.isParameterizedType() || superType.isGenericType())) {
superType = superType.getRawType();
}
recurseHierarchy(knowninterfaces, collector, superType, includeITDs, allowMissing, genericsAware);
}
}
ResolvedType[] interfaces = resolvedType.getDeclaredInterfaces();
for (int i = 0; i < interfaces.length; i++) {
ResolvedType iface = interfaces[i];
if (!genericsAware && (iface.isParameterizedType() || iface.isGenericType())) {
iface = iface.getRawType();
}
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
boolean shouldSkip = false;
for (int j = 0; j < resolvedType.interTypeMungers.size(); j++) {
ConcreteTypeMunger munger = resolvedType.interTypeMungers.get(j);
if (munger.getMunger() != null && munger.getMunger().getKind() == ResolvedTypeMunger.Parent
&& ((NewParentTypeMunger) munger.getMunger()).getNewParent().equals(iface)
) {
shouldSkip = true;
break;
}
}
if (!shouldSkip && !knowninterfaces.contains(iface.getSignature())) {
knowninterfaces.add(iface.getSignature());
if (allowMissing && iface.isMissing()) {
if (iface instanceof MissingResolvedTypeWithKnownSignature) {
((MissingResolvedTypeWithKnownSignature) iface).raiseWarningOnMissingInterfaceWhilstFindingMethods();
}
} else {
recurseHierarchy(knowninterfaces, collector, iface, includeITDs, allowMissing, genericsAware);
}
}
}
}
public ResolvedType[] getResolvedTypeParameters() {
if (resolvedTypeParams == null) {
resolvedTypeParams = world.resolve(typeParameters);
}
return resolvedTypeParams;
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
/**
* described in JVM spec 2ed 5.4.3.2
*/
public ResolvedMember lookupField(Member field) {
Iterator<ResolvedMember> i = getFields();
while (i.hasNext()) {
ResolvedMember resolvedMember = i.next();
if (matches(resolvedMember, field)) {
return resolvedMember;
}
if (resolvedMember.hasBackingGenericMember() && field.getName().equals(resolvedMember.getName())) {
if (matches(resolvedMember.getBackingGenericMember(), field)) {
return resolvedMember;
}
}
}
return null;
}
/**
* described in JVM spec 2ed 5.4.3.3. Doesnt check ITDs.
*
* <p>
* Check the current type for the method. If it is not found, check the super class and any super interfaces. Taking care not to
* process interfaces multiple times.
*/
public ResolvedMember lookupMethod(Member m) {
List<ResolvedType> typesTolookat = new ArrayList<ResolvedType>();
typesTolookat.add(this);
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
int pos = 0;
while (pos < typesTolookat.size()) {
ResolvedType type = typesTolookat.get(pos++);
if (!type.isMissing()) {
ResolvedMember[] methods = type.getDeclaredMethods();
if (methods != null) {
for (int i = 0; i < methods.length; i++) {
ResolvedMember method = methods[i];
if (matches(method, m)) {
return method;
}
if (method.hasBackingGenericMember() && m.getName().equals(method.getName())) {
if (matches(method.getBackingGenericMember(), m)) {
return method;
}
}
}
}
}
ResolvedType superclass = type.getSuperclass();
if (superclass != null) {
typesTolookat.add(superclass);
}
ResolvedType[] superinterfaces = type.getDeclaredInterfaces();
if (superinterfaces != null) {
for (int i = 0; i < superinterfaces.length; i++) {
ResolvedType interf = superinterfaces[i];
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (!typesTolookat.contains(interf)) {
typesTolookat.add(interf);
}
}
}
}
return null;
}
/**
* @param member the member to lookup in intertype declarations affecting this type
* @return the real signature defined by any matching intertype declaration, otherwise null
*/
public ResolvedMember lookupMethodInITDs(Member member) {
for (ConcreteTypeMunger typeTransformer : interTypeMungers) {
if (matches(typeTransformer.getSignature(), member)) {
return typeTransformer.getSignature();
}
}
return null;
}
/**
* return null if not found
*/
private ResolvedMember lookupMember(Member m, ResolvedMember[] a) {
for (int i = 0; i < a.length; i++) {
ResolvedMember f = a[i];
if (matches(f, m)) {
return f;
}
}
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
return null;
}
/**
* Looks for the first member in the hierarchy matching aMember. This method differs from lookupMember(Member) in that it takes
* into account parameters which are type variables - which clearly an unresolved Member cannot do since it does not know
* anything about type variables.
*/
public ResolvedMember lookupResolvedMember(ResolvedMember aMember, boolean allowMissing, boolean eraseGenerics) {
Iterator<ResolvedMember> toSearch = null;
ResolvedMember found = null;
if ((aMember.getKind() == Member.METHOD) || (aMember.getKind() == Member.CONSTRUCTOR)) {
toSearch = getMethodsIncludingIntertypeDeclarations(!eraseGenerics, true);
} else {
assert aMember.getKind() == Member.FIELD;
toSearch = getFields();
}
while (toSearch.hasNext()) {
ResolvedMember candidate = toSearch.next();
if (eraseGenerics) {
if (candidate.hasBackingGenericMember()) {
candidate = candidate.getBackingGenericMember();
}
}
if (candidate.matches(aMember, eraseGenerics)) {
found = candidate;
break;
}
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
return found;
}
public static boolean matches(Member m1, Member m2) {
if (m1 == null) {
return m2 == null;
}
if (m2 == null) {
return false;
}
boolean equalNames = m1.getName().equals(m2.getName());
if (!equalNames) {
return false;
}
boolean equalSignatures = m1.getSignature().equals(m2.getSignature());
if (equalSignatures) {
return true;
}
boolean equalCovariantSignatures = m1.getParameterSignature().equals(m2.getParameterSignature());
if (equalCovariantSignatures) {
return true;
}
return false;
}
public static boolean conflictingSignature(Member m1, Member m2) {
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
return conflictingSignature(m1,m2,true);
}
/**
* Do the two members conflict? Due to the change in 1.7.1, field itds on interfaces now act like 'default' fields - so types implementing
* those fields get the field if they don't have it already, otherwise they keep what they have. The conflict detection below had to be
* altered. Previously (<1.7.1) it is not a conflict if the declaring types are different. With v2itds it may still be a conflict if the
* declaring types are different.
*/
public static boolean conflictingSignature(Member m1, Member m2, boolean v2itds) {
if (m1 == null || m2 == null) {
return false;
}
if (!m1.getName().equals(m2.getName())) {
return false;
}
if (m1.getKind() != m2.getKind()) {
return false;
}
if (m1.getKind() == Member.FIELD) {
if (v2itds) {
if (m1.getDeclaringType().equals(m2.getDeclaringType())) {
return true;
}
} else {
return m1.getDeclaringType().equals(m2.getDeclaringType());
}
} else if (m1.getKind() == Member.POINTCUT) {
return true;
}
UnresolvedType[] p1 = m1.getGenericParameterTypes();
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
UnresolvedType[] p2 = m2.getGenericParameterTypes();
if (p1 == null) {
p1 = m1.getParameterTypes();
}
if (p2 == null) {
p2 = m2.getParameterTypes();
}
int n = p1.length;
if (n != p2.length) {
return false;
}
for (int i = 0; i < n; i++) {
if (!p1[i].equals(p2[i])) {
return false;
}
}
return true;
}
/**
* returns an iterator through all of the pointcuts of this type, in order for checking from JVM spec 2ed 5.4.3.2 (as for
* fields). This means that the order is
* <p/>
* <ul>
* <li>pointcuts from current class</li>
* <li>recur into direct superinterfaces</li>
* <li>recur into superclass</li>
* </ul>
* <p/>
* We keep a hashSet of interfaces that we've visited so we don't spiral out into 2^n land.
*/
|
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 |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
public Iterator<ResolvedMember> getPointcuts() {
final Iterators.Filter<ResolvedType> dupFilter = Iterators.dupFilter();
Iterators.Getter<ResolvedType, ResolvedType> typeGetter = new Iterators.Getter<ResolvedType, ResolvedType>() {
public Iterator<ResolvedType> get(ResolvedType o) {
return dupFilter.filter(o.getDirectSupertypes());
}
};
return Iterators.mapOver(Iterators.recur(this, typeGetter), PointcutGetterInstance);
}
public ResolvedPointcutDefinition findPointcut(String name) {
for (Iterator<ResolvedMember> i = getPointcuts(); i.hasNext();) {
ResolvedPointcutDefinition f = (ResolvedPointcutDefinition) i.next();
if (f != null && name.equals(f.getName())) {
return f;
}
}
if (!getOutermostType().equals(this)) {
ResolvedType outerType = getOutermostType().resolve(world);
ResolvedPointcutDefinition rpd = outerType.findPointcut(name);
return rpd;
}
return null;
}
public CrosscuttingMembers crosscuttingMembers;
public CrosscuttingMembers collectCrosscuttingMembers(boolean shouldConcretizeIfNeeded) {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.