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
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
/* ******************************************************************* * Copyright (c) 2005-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://eclipse.org/legal/epl-v10.html * ******************************************************************/ package org.aspectj.weaver; import java.util.ArrayList; import java.util.List; /** * @author Adrian Colyer * @author Andy Clement */ public class TypeFactory {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
/** * Create a parameterized version of a generic type. * * @param aGenericType * @param someTypeParameters note, in the case of an inner type of a parameterized type, this parameter may legitimately be null * @param inAWorld * @return */ public static ReferenceType createParameterizedType(ResolvedType aBaseType, UnresolvedType[] someTypeParameters, World inAWorld) { ResolvedType baseType = aBaseType; if (!aBaseType.isGenericType()) { if (someTypeParameters != null && someTypeParameters.length > 0) { if (!aBaseType.isRawType()) { throw new IllegalStateException("Expecting raw type, not: " + aBaseType); } baseType = baseType.getGenericType(); if (baseType == null) {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
throw new IllegalStateException("Raw type does not have generic type set"); } } } ResolvedType[] resolvedParameters = inAWorld.resolve(someTypeParameters); ReferenceType pType = new ReferenceType(baseType, resolvedParameters, inAWorld); return (ReferenceType) pType.resolve(inAWorld); } /** * Create an *unresolved* parameterized version of a generic type. */ public static UnresolvedType createUnresolvedParameterizedType(String sig, String erasuresig, UnresolvedType[] arguments) { return new UnresolvedType(sig, erasuresig, arguments); } /** * Creates a sensible unresolvedtype from some signature, for example: signature = LIGuard<TT;>; bound = toString=IGuard<T> * sig=PIGuard<TT;>; sigErasure=LIGuard; kind=parameterized
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
*/ static UnresolvedType convertSigToType(String aSignature) { UnresolvedType bound = null; int startOfParams = aSignature.indexOf('<'); if (startOfParams == -1) { bound = UnresolvedType.forSignature(aSignature); } else { int endOfParams = aSignature.lastIndexOf('>'); String signatureErasure = "L" + aSignature.substring(1, startOfParams) + ";"; UnresolvedType[] typeParams = createTypeParams(aSignature.substring(startOfParams + 1, endOfParams)); bound = new UnresolvedType("P" + aSignature.substring(1), signatureErasure, typeParams); } return bound; } /** * Used by UnresolvedType.read, creates a type from a full signature. */ public static UnresolvedType createTypeFromSignature(String signature) { char firstChar = signature.charAt(0); if (firstChar == 'P') { int startOfParams = signature.indexOf('<'); if (startOfParams == -1) {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
String signatureErasure = "L" + signature.substring(1); return new UnresolvedType(signature, signatureErasure, UnresolvedType.NONE); } else { int endOfParams = locateMatchingEndAngleBracket(signature, startOfParams); StringBuffer erasureSig = new StringBuffer(signature); erasureSig.setCharAt(0, 'L'); while (startOfParams != -1) { erasureSig.delete(startOfParams, endOfParams + 1); startOfParams = locateFirstBracket(erasureSig); if (startOfParams != -1) { endOfParams = locateMatchingEndAngleBracket(erasureSig, startOfParams); } } String signatureErasure = erasureSig.toString(); String lastType = null; int nestedTypePosition = signature.indexOf("$", endOfParams); if (nestedTypePosition != -1) { lastType = signature.substring(nestedTypePosition + 1); } else { lastType = new String(signature); } startOfParams = lastType.indexOf("<"); UnresolvedType[] typeParams = UnresolvedType.NONE; if (startOfParams != -1) { endOfParams = locateMatchingEndAngleBracket(lastType, startOfParams); typeParams = createTypeParams(lastType.substring(startOfParams + 1, endOfParams)); } StringBuilder s = new StringBuilder();
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
int firstAngleBracket = signature.indexOf('<'); s.append("P").append(signature.substring(1, firstAngleBracket)); s.append('<'); for (UnresolvedType typeParameter : typeParams) { s.append(typeParameter.getSignature()); } s.append(">;"); signature = s.toString(); return new UnresolvedType(signature, signatureErasure, typeParams); } } else if ((firstChar == '?' || firstChar == '*') && signature.length() == 1) { return WildcardedUnresolvedType.QUESTIONMARK; } else if (firstChar == '+') { UnresolvedType upperBound = convertSigToType(signature.substring(1)); WildcardedUnresolvedType wildcardedUT = new WildcardedUnresolvedType(signature, upperBound, null); return wildcardedUT; } else if (firstChar == '-') { UnresolvedType lowerBound = convertSigToType(signature.substring(1)); WildcardedUnresolvedType wildcardedUT = new WildcardedUnresolvedType(signature, null, lowerBound); return wildcardedUT; } else if (firstChar == 'T') { String typeVariableName = signature.substring(1); if (typeVariableName.endsWith(";")) { typeVariableName = typeVariableName.substring(0, typeVariableName.length() - 1); } return new UnresolvedTypeVariableReferenceType(new TypeVariable(typeVariableName)); } else if (firstChar == '[') {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
int dims = 0; while (signature.charAt(dims) == '[') { dims++; } UnresolvedType componentType = createTypeFromSignature(signature.substring(dims)); return new UnresolvedType(signature, signature.substring(0, dims) + componentType.getErasureSignature()); } else if (signature.length() == 1) { switch (firstChar) { case 'V': return UnresolvedType.VOID; case 'Z': return UnresolvedType.BOOLEAN; case 'B': return UnresolvedType.BYTE; case 'C': return UnresolvedType.CHAR; case 'D': return UnresolvedType.DOUBLE; case 'F': return UnresolvedType.FLOAT; case 'I': return UnresolvedType.INT; case 'J': return UnresolvedType.LONG; case 'S': return UnresolvedType.SHORT; } } else if (firstChar == '@') { return ResolvedType.MISSING;
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
} else if (firstChar == 'L') { int leftAngleBracket = signature.indexOf('<'); if (leftAngleBracket == -1) { return new UnresolvedType(signature); } else { int endOfParams = locateMatchingEndAngleBracket(signature, leftAngleBracket); StringBuffer erasureSig = new StringBuffer(signature); erasureSig.setCharAt(0, 'L'); while (leftAngleBracket != -1) { erasureSig.delete(leftAngleBracket, endOfParams + 1); leftAngleBracket = locateFirstBracket(erasureSig); if (leftAngleBracket != -1) { endOfParams = locateMatchingEndAngleBracket(erasureSig, leftAngleBracket); } } String signatureErasure = erasureSig.toString(); String lastType = null; int nestedTypePosition = signature.indexOf("$", endOfParams); if (nestedTypePosition != -1) { lastType = signature.substring(nestedTypePosition + 1); } else { lastType = new String(signature); } leftAngleBracket = lastType.indexOf("<"); UnresolvedType[] typeParams = UnresolvedType.NONE; if (leftAngleBracket != -1) {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
endOfParams = locateMatchingEndAngleBracket(lastType, leftAngleBracket); typeParams = createTypeParams(lastType.substring(leftAngleBracket + 1, endOfParams)); } StringBuilder s = new StringBuilder(); int firstAngleBracket = signature.indexOf('<'); s.append("P").append(signature.substring(1, firstAngleBracket)); s.append('<'); for (UnresolvedType typeParameter : typeParams) { s.append(typeParameter.getSignature()); } s.append(">;"); signature = s.toString(); return new UnresolvedType(signature, signatureErasure, typeParams); } } return new UnresolvedType(signature); } private static int locateMatchingEndAngleBracket(CharSequence signature, int startOfParams) { if (startOfParams == -1) { return -1; } int count = 1; int idx = startOfParams; int max = signature.length(); while (idx < max) { char ch = signature.charAt(++idx); if (ch == '<') { count++; } else if (ch == '>') { if (count == 1) {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
break; } count--; } } return idx; } private static int locateFirstBracket(StringBuffer signature) { int idx = 0; int max = signature.length(); while (idx < max) { if (signature.charAt(idx) == '<') { return idx; } idx++; } return -1; } private static UnresolvedType[] createTypeParams(String typeParameterSpecification) { String remainingToProcess = typeParameterSpecification; List<UnresolvedType> types = new ArrayList<UnresolvedType>(); while (remainingToProcess.length() != 0) { int endOfSig = 0; int anglies = 0; boolean hadAnglies = false; boolean sigFound = false; for (endOfSig = 0; (endOfSig < remainingToProcess.length()) && !sigFound; endOfSig++) { char thisChar = remainingToProcess.charAt(endOfSig); switch (thisChar) { case '<':
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
anglies++; hadAnglies = true; break; case '>': anglies--; break; case '[': if (anglies == 0) { int nextChar = endOfSig + 1; while (remainingToProcess.charAt(nextChar) == '[') { nextChar++; } if ("BCDFIJSZ".indexOf(remainingToProcess.charAt(nextChar)) != -1) { sigFound = true; endOfSig = nextChar; break; } } break; case ';': if (anglies == 0) { sigFound = true; break; } } } String forProcessing = remainingToProcess.substring(0, endOfSig); if (hadAnglies && forProcessing.charAt(0) == 'L') {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
forProcessing = "P" + forProcessing.substring(1); } types.add(createTypeFromSignature(forProcessing)); remainingToProcess = remainingToProcess.substring(endOfSig); } UnresolvedType[] typeParams = new UnresolvedType[types.size()]; types.toArray(typeParams); return typeParams; } /** * Create a signature then delegate to the other factory method. Same input/output: baseTypeSignature="LSomeType;" arguments[0]= * something with sig "Pcom/Foo<Ljava/lang/String;>;" signature created = "PSomeType<Pcom/Foo<Ljava/lang/String;>;>;" */ public static UnresolvedType createUnresolvedParameterizedType(String baseTypeSignature, UnresolvedType[] arguments) { StringBuffer parameterizedSig = new StringBuffer(); parameterizedSig.append(ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER); parameterizedSig.append(baseTypeSignature.substring(1, baseTypeSignature.length() - 1)); if (arguments.length > 0) { parameterizedSig.append("<"); for (int i = 0; i < arguments.length; i++) { parameterizedSig.append(arguments[i].getSignature()); } parameterizedSig.append(">"); } parameterizedSig.append(";"); return createUnresolvedParameterizedType(parameterizedSig.toString(), baseTypeSignature, arguments); } }
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
/******************************************************************************* * Copyright (c) 2008 Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http:www.eclipse.org/legal/epl-v10.html * * Contributors: * Andy Clement - initial API and implementation *******************************************************************************/ package org.aspectj.systemtest.ajc170; import java.io.File; import junit.framework.Test; import org.aspectj.testing.XMLBasedAjcTestCase; /** * @author Andy Clement */ public class Ajc170Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
public void testPerThis() { runTest("perthis"); } public void testPerTarget() { runTest("pertarget"); } public void testPerCflow() { runTest("percflow"); } public void testPerTypeWithin() { runTest("pertypewithin"); } public void testDiamond1() { runTest("diamond 1"); } public void testDiamond2() { runTest("diamond 2"); } public void testDiamondItd1() {
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
runTest("diamond itd 1"); } public void testLiterals1() { runTest("literals 1"); } public void testLiterals2() { runTest("literals 2"); } public void testLiteralsItd1() { runTest("literals itd 1"); } public void testStringSwitch1() { runTest("string switch 1"); } public void testStringSwitch2() { runTest("string switch 2"); } public void testMultiCatch1() { runTest("multi catch 1"); } public void testMultiCatch2() { runTest("multi catch 2"); } public void testMultiCatchWithHandler1() { runTest("multi catch with handler 1"); } public void testMultiCatchAspect1() { runTest("multi catch aspect 1"); }
371,684
Bug 371684 type construction for signature makes mistakes with wildcards
If you have a type with multiple type params, like this: Foo<?,T> the signature is: LFoo<*TT;>; and the handling of * is not working in TypeFactory. If that signature is passed in it will actually build: Foo<?> having lost the second type parameter, this breaks code later that has expectations on the number of params. (e.g. ArrayIndexOutOfBoundsException when building parameterization map)
resolved fixed
89756cd
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-02-15T22:25:02Z
2012-02-15T21:06:40Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
public void testSanity1() { runTest("sanity 1"); } public void testMissingImpl_363979() { runTest("missing impl"); } public void testMissingImpl_363979_2() { runTest("missing impl 2"); } public void testStackOverflow_364380() { runTest("stackoverflow"); } public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Ajc170Tests.class); } @Override protected File getSpecFile() { return new File("../tests/src/org/aspectj/systemtest/ajc170/ajc170.xml"); } }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
/******************************************************************************* * Copyright (c) 2008 Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http:www.eclipse.org/legal/epl-v10.html * * Contributors: * Andy Clement - initial API and implementation *******************************************************************************/ package org.aspectj.systemtest.ajc170; import java.io.File; import java.util.List; import junit.framework.Test; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.testing.XMLBasedAjcTestCase; import org.aspectj.weaver.CrosscuttingMembers; import org.aspectj.weaver.ReferenceType; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.TypeFactory; import org.aspectj.weaver.TypeVariable; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.World; import org.aspectj.weaver.bcel.BcelWorld; /** * @author Andy Clement */ public class Ajc170Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
public void testGenericsWithTwoTypeParamsOneWildcard() { UnresolvedType ut; ut = TypeFactory.createTypeFromSignature("LFoo<**>;"); assertEquals(2,ut.getTypeParameters().length); ut = TypeFactory.createTypeFromSignature("LFoo<***>;"); assertEquals(3,ut.getTypeParameters().length); ut = TypeFactory.createTypeFromSignature("LFoo<TP;*+Ljava/lang/String;>;"); assertEquals(2,ut.getTypeParameters().length); ut = TypeFactory.createTypeFromSignature("LFoo<*+Ljava/lang/String;TP;>;"); assertEquals(2,ut.getTypeParameters().length); ut = TypeFactory.createTypeFromSignature("LFoo<*+Ljava/lang/String;TP;>;"); assertEquals(2,ut.getTypeParameters().length);
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
ut = TypeFactory.createTypeFromSignature("LFoo<*TT;>;"); assertEquals(2,ut.getTypeParameters().length); ut = TypeFactory.createTypeFromSignature("LFoo<[I>;"); assertEquals(1,ut.getTypeParameters().length); ut = TypeFactory.createTypeFromSignature("LFoo<[I[Z>;"); assertEquals(2,ut.getTypeParameters().length); } public void testPerThis() { runTest("perthis"); } public void testPerTarget() { runTest("pertarget"); } public void testPerCflow() { runTest("percflow"); } public void testPerTypeWithin() { runTest("pertypewithin"); } public void testDiamond1() { runTest("diamond 1"); } public void testDiamond2() { runTest("diamond 2"); } public void testDiamondItd1() {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
runTest("diamond itd 1"); } public void testLiterals1() { runTest("literals 1"); } public void testLiterals2() { runTest("literals 2"); } public void testLiteralsItd1() { runTest("literals itd 1"); } public void testStringSwitch1() { runTest("string switch 1"); } public void testStringSwitch2() { runTest("string switch 2"); } public void testMultiCatch1() { runTest("multi catch 1"); } public void testMultiCatch2() { runTest("multi catch 2"); } public void testMultiCatchWithHandler1() { runTest("multi catch with handler 1"); } public void testMultiCatchAspect1() { runTest("multi catch aspect 1"); }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
public void testSanity1() { runTest("sanity 1"); } public void testMissingImpl_363979() { runTest("missing impl"); } public void testMissingImpl_363979_2() { runTest("missing impl 2"); } public void testStackOverflow_364380() { runTest("stackoverflow"); } public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Ajc170Tests.class); } @Override protected File getSpecFile() { return new File("../tests/src/org/aspectj/systemtest/ajc170/ajc170.xml"); } }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/******************************************************************************* * Copyright (c) 2005 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:eclipse.org/legal/epl-v10.html * * Contributors: * initial implementation Alexandre Vasseur *******************************************************************************/ package org.aspectj.weaver.bcel; import java.io.ByteArrayInputStream; import java.io.IOException; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; import org.aspectj.apache.bcel.classfile.Constant; import org.aspectj.apache.bcel.classfile.ConstantUtf8; import org.aspectj.apache.bcel.classfile.Field; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.LocalVariable;
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
import org.aspectj.apache.bcel.classfile.LocalVariableTable; import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.apache.bcel.classfile.Unknown; import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen; import org.aspectj.apache.bcel.classfile.annotation.ArrayElementValue; import org.aspectj.apache.bcel.classfile.annotation.ClassElementValue; import org.aspectj.apache.bcel.classfile.annotation.ElementValue; import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.RuntimeAnnos; import org.aspectj.apache.bcel.classfile.annotation.RuntimeVisAnnos; import org.aspectj.apache.bcel.generic.Type; import org.aspectj.asm.AsmManager; import org.aspectj.asm.IHierarchy; import org.aspectj.asm.IProgramElement; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; import org.aspectj.weaver.Advice; import org.aspectj.weaver.AdviceKind; import org.aspectj.weaver.AjAttribute; import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; import org.aspectj.weaver.AjcMemberMaker; import org.aspectj.weaver.BindingScope; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.MethodDelegateTypeMunger; import org.aspectj.weaver.NameMangler; import org.aspectj.weaver.ReferenceType; import org.aspectj.weaver.ReferenceTypeDelegate;
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedPointcutDefinition; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.World; import org.aspectj.weaver.patterns.Bindings; import org.aspectj.weaver.patterns.DeclareErrorOrWarning; import org.aspectj.weaver.patterns.DeclareParents; import org.aspectj.weaver.patterns.DeclareParentsMixin; import org.aspectj.weaver.patterns.DeclarePrecedence; import org.aspectj.weaver.patterns.FormalBinding; import org.aspectj.weaver.patterns.IScope; import org.aspectj.weaver.patterns.ParserException; import org.aspectj.weaver.patterns.PatternParser; import org.aspectj.weaver.patterns.PerCflow; import org.aspectj.weaver.patterns.PerClause; import org.aspectj.weaver.patterns.PerFromSuper; import org.aspectj.weaver.patterns.PerObject; import org.aspectj.weaver.patterns.PerSingleton; import org.aspectj.weaver.patterns.PerTypeWithin; import org.aspectj.weaver.patterns.Pointcut; import org.aspectj.weaver.patterns.TypePattern; /** * Annotation defined aspect reader. Reads the Java 5 annotations and turns them into AjAttributes * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ public class AtAjAttributes {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private final static List<AjAttribute> NO_ATTRIBUTES = Collections.emptyList(); private final static String[] EMPTY_STRINGS = new String[0]; private final static String VALUE = "value"; private final static String ARGNAMES = "argNames"; private final static String POINTCUT = "pointcut"; private final static String THROWING = "throwing"; private final static String RETURNING = "returning"; private final static String STRING_DESC = "Ljava/lang/String;"; /** * A struct that allows to add extra arguments without always breaking the API */ private static class AjAttributeStruct {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/** * The list of AjAttribute.XXX that we are populating from the @AJ read */ List<AjAttribute> ajAttributes = new ArrayList<AjAttribute>(); /** * The resolved type (class) for which we are reading @AJ for (be it class, method, field annotations) */ final ResolvedType enclosingType; final ISourceContext context; final IMessageHandler handler; public AjAttributeStruct(ResolvedType type, ISourceContext sourceContext, IMessageHandler messageHandler) { enclosingType = type; context = sourceContext; handler = messageHandler; } } /** * A struct when we read @AJ on method * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ private static class AjAttributeMethodStruct extends AjAttributeStruct {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private String[] m_argumentNamesLazy = null; public String unparsedArgumentNames = null; final Method method; final BcelMethod bMethod; public AjAttributeMethodStruct(Method method, BcelMethod bMethod, ResolvedType type, ISourceContext sourceContext, IMessageHandler messageHandler) { super(type, sourceContext, messageHandler); this.method = method; this.bMethod = bMethod; } public String[] getArgumentNames() { if (m_argumentNamesLazy == null) { m_argumentNamesLazy = getMethodArgumentNames(method, unparsedArgumentNames, this); } return m_argumentNamesLazy; } } /** * A struct when we read @AJ on field */ private static class AjAttributeFieldStruct extends AjAttributeStruct {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
final Field field; public AjAttributeFieldStruct(Field field, BcelField bField, ResolvedType type, ISourceContext sourceContext, IMessageHandler messageHandler) { super(type, sourceContext, messageHandler); this.field = field; } } /** * Annotations are RuntimeVisible only. This allow us to not visit RuntimeInvisible ones. * * @param attribute * @return true if runtime visible annotation */ public static boolean acceptAttribute(Attribute attribute) { return (attribute instanceof RuntimeVisAnnos); } /** * Extract class level annotations and turn them into AjAttributes. * * @param javaClass
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* @param type * @param context * @param msgHandler * @return list of AjAttributes */ public static List<AjAttribute> readAj5ClassAttributes(AsmManager model, JavaClass javaClass, ReferenceType type, ISourceContext context, IMessageHandler msgHandler, boolean isCodeStyleAspect) { boolean ignoreThisClass = javaClass.getClassName().charAt(0) == 'o' && javaClass.getClassName().startsWith("org.aspectj.lang.annotation"); if (ignoreThisClass) { return NO_ATTRIBUTES; } boolean containsPointcut = false; boolean containsAnnotationClassReference = false; Constant[] cpool = javaClass.getConstantPool().getConstantPool(); for (int i = 0; i < cpool.length; i++) { Constant constant = cpool[i]; if (constant != null && constant.getTag() == Constants.CONSTANT_Utf8) { String constantValue = ((ConstantUtf8) constant).getValue(); if (constantValue.length() > 28 && constantValue.charAt(1) == 'o') { if (constantValue.startsWith("Lorg/aspectj/lang/annotation")) { containsAnnotationClassReference = true; if ("Lorg/aspectj/lang/annotation/DeclareAnnotation;".equals(constantValue)) { msgHandler.handleMessage(new Message( "Found @DeclareAnnotation while current release does not support it (see '" + type.getName() + "')", IMessage.WARNING, null, type.getSourceLocation())); } if ("Lorg/aspectj/lang/annotation/Pointcut;".equals(constantValue)) { containsPointcut = true; }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} } } } if (!containsAnnotationClassReference) { return NO_ATTRIBUTES; } AjAttributeStruct struct = new AjAttributeStruct(type, context, msgHandler); Attribute[] attributes = javaClass.getAttributes(); boolean hasAtAspectAnnotation = false; boolean hasAtPrecedenceAnnotation = false; WeaverVersionInfo wvinfo = null; for (int i = 0; i < attributes.length; i++) { Attribute attribute = attributes[i]; if (acceptAttribute(attribute)) { RuntimeAnnos rvs = (RuntimeAnnos) attribute; if (!isCodeStyleAspect && !javaClass.isInterface()) { hasAtAspectAnnotation = handleAspectAnnotation(rvs, struct); hasAtPrecedenceAnnotation = handlePrecedenceAnnotation(rvs, struct); } break; } } for (int i = attributes.length - 1; i >= 0; i--) { Attribute attribute = attributes[i];
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (attribute.getName().equals(WeaverVersionInfo.AttributeName)) { try { VersionedDataInputStream s = new VersionedDataInputStream(new ByteArrayInputStream( ((Unknown) attribute).getBytes()), null); wvinfo = WeaverVersionInfo.read(s); struct.ajAttributes.add(0, wvinfo); } catch (IOException ioe) { ioe.printStackTrace(); } } } if (wvinfo == null) { ReferenceTypeDelegate delegate = type.getDelegate(); if (delegate instanceof BcelObjectType) { wvinfo = ((BcelObjectType) delegate).getWeaverVersionAttribute(); if (wvinfo != null) { if (wvinfo.getMajorVersion() != WeaverVersionInfo.WEAVER_VERSION_MAJOR_UNKNOWN) { struct.ajAttributes.add(0, wvinfo); } else { wvinfo = null; } } } if (wvinfo == null) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
struct.ajAttributes.add(0, wvinfo = new AjAttribute.WeaverVersionInfo()); } } if (hasAtPrecedenceAnnotation && !hasAtAspectAnnotation) { msgHandler.handleMessage(new Message("Found @DeclarePrecedence on a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); return NO_ATTRIBUTES; } if (!(hasAtAspectAnnotation || isCodeStyleAspect) && !containsPointcut) { return NO_ATTRIBUTES; }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
for (int i = 0; i < javaClass.getMethods().length; i++) { Method method = javaClass.getMethods()[i]; if (method.getName().startsWith(NameMangler.PREFIX)) { continue; } AjAttributeMethodStruct mstruct = null; boolean processedPointcut = false; Attribute[] mattributes = method.getAttributes(); for (int j = 0; j < mattributes.length; j++) { Attribute mattribute = mattributes[j];
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (acceptAttribute(mattribute)) { mstruct = new AjAttributeMethodStruct(method, null, type, context, msgHandler); processedPointcut = handlePointcutAnnotation((RuntimeAnnos) mattribute, mstruct); if (!processedPointcut) { processedPointcut = handleDeclareMixinAnnotation((RuntimeAnnos) mattribute, mstruct); } break; } } if (processedPointcut) { struct.ajAttributes.addAll(mstruct.ajAttributes); } } Field[] fs = javaClass.getFields(); for (int i = 0; i < fs.length; i++) { Field field = fs[i]; if (field.getName().startsWith(NameMangler.PREFIX)) { continue; } AjAttributeFieldStruct fstruct = new AjAttributeFieldStruct(field, null, type, context, msgHandler); Attribute[] fattributes = field.getAttributes(); for (int j = 0; j < fattributes.length; j++) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
Attribute fattribute = fattributes[j]; if (acceptAttribute(fattribute)) { RuntimeAnnos frvs = (RuntimeAnnos) fattribute; if (handleDeclareErrorOrWarningAnnotation(model, frvs, fstruct) || handleDeclareParentsAnnotation(frvs, fstruct)) { if (!type.isAnnotationStyleAspect() && !isCodeStyleAspect) { msgHandler.handleMessage(new Message("Found @AspectJ annotations in a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); } } break; } } struct.ajAttributes.addAll(fstruct.ajAttributes); } return struct.ajAttributes; } /** * Extract method level annotations and turn them into AjAttributes. * * @param method * @param type * @param context * @param msgHandler * @return list of AjAttributes */
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
public static List<AjAttribute> readAj5MethodAttributes(Method method, BcelMethod bMethod, ResolvedType type, ResolvedPointcutDefinition preResolvedPointcut, ISourceContext context, IMessageHandler msgHandler) { if (method.getName().startsWith(NameMangler.PREFIX)) { return Collections.emptyList(); } AjAttributeMethodStruct struct = new AjAttributeMethodStruct(method, bMethod, type, context, msgHandler); Attribute[] attributes = method.getAttributes(); boolean hasAtAspectJAnnotation = false; boolean hasAtAspectJAnnotationMustReturnVoid = false; for (int i = 0; i < attributes.length; i++) { Attribute attribute = attributes[i]; try { if (acceptAttribute(attribute)) { RuntimeAnnos rvs = (RuntimeAnnos) attribute; hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleBeforeAnnotation(rvs, struct, preResolvedPointcut); hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleAfterAnnotation(rvs, struct, preResolvedPointcut); hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
|| handleAfterReturningAnnotation(rvs, struct, preResolvedPointcut, bMethod); hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleAfterThrowingAnnotation(rvs, struct, preResolvedPointcut, bMethod); hasAtAspectJAnnotation = hasAtAspectJAnnotation || handleAroundAnnotation(rvs, struct, preResolvedPointcut); break; } } catch (ReturningFormalNotDeclaredInAdviceSignatureException e) { msgHandler.handleMessage(new Message(WeaverMessages.format(WeaverMessages.RETURNING_FORMAL_NOT_DECLARED_IN_ADVICE, e.getFormalName()), IMessage.ERROR, null, bMethod.getSourceLocation())); } catch (ThrownFormalNotDeclaredInAdviceSignatureException e) { msgHandler.handleMessage(new Message(WeaverMessages.format(WeaverMessages.THROWN_FORMAL_NOT_DECLARED_IN_ADVICE, e.getFormalName()), IMessage.ERROR, null, bMethod.getSourceLocation())); } } hasAtAspectJAnnotation = hasAtAspectJAnnotation || hasAtAspectJAnnotationMustReturnVoid; if (hasAtAspectJAnnotation && !type.isAspect()) { msgHandler.handleMessage(new Message("Found @AspectJ annotations in a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); } if (hasAtAspectJAnnotation && !struct.method.isPublic()) { msgHandler.handleMessage(new Message("Found @AspectJ annotation on a non public advice '" + methodToString(struct.method) + "'", IMessage.ERROR, null, type.getSourceLocation())); }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (hasAtAspectJAnnotation && struct.method.isStatic()) { msgHandler.handleMessage(MessageUtil.error("Advice cannot be declared static '" + methodToString(struct.method) + "'", type.getSourceLocation())); } if (hasAtAspectJAnnotationMustReturnVoid && !Type.VOID.equals(struct.method.getReturnType())) { msgHandler.handleMessage(new Message("Found @AspectJ annotation on a non around advice not returning void '" + methodToString(struct.method) + "'", IMessage.ERROR, null, type.getSourceLocation())); } return struct.ajAttributes; } /** * Extract field level annotations and turn them into AjAttributes. * * @param field * @param type * @param context * @param msgHandler * @return list of AjAttributes, always empty for now
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
*/ public static List<AjAttribute> readAj5FieldAttributes(Field field, BcelField bField, ResolvedType type, ISourceContext context, IMessageHandler msgHandler) { return Collections.emptyList(); } /** * Read @Aspect * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAspectAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeStruct struct) { AnnotationGen aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.ASPECT_ANNOTATION); if (aspect != null) { boolean extendsAspect = false; if (!"java.lang.Object".equals(struct.enclosingType.getSuperclass().getName())) { if (!struct.enclosingType.getSuperclass().isAbstract() && struct.enclosingType.getSuperclass().isAspect()) { reportError("cannot extend a concrete aspect", struct); return false; } extendsAspect = struct.enclosingType.getSuperclass().isAspect(); } NameValuePair aspectPerClause = getAnnotationElement(aspect, VALUE); final PerClause perClause; if (aspectPerClause == null) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (!extendsAspect) { perClause = new PerSingleton(); } else { perClause = new PerFromSuper(struct.enclosingType.getSuperclass().getPerClause().getKind()); } } else { String perX = aspectPerClause.getValue().stringifyValue(); if (perX == null || perX.length() <= 0) { perClause = new PerSingleton(); } else { perClause = parsePerClausePointcut(perX, struct); } } if (perClause == null) { return false; } else { perClause.setLocation(struct.context, -1, -1); AjAttribute.Aspect aspectAttribute = new AjAttribute.Aspect(perClause); struct.ajAttributes.add(aspectAttribute); FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; final IScope binding; binding = new BindingScope(struct.enclosingType, struct.context, bindings);
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
aspectAttribute.setResolutionScope(binding); return true; } } return false; } /** * Read a perClause, returns null on failure and issue messages * * @param perClauseString like "pertarget(.....)" * @param struct for which we are parsing the per clause * @return a PerClause instance */ private static PerClause parsePerClausePointcut(String perClauseString, AjAttributeStruct struct) { final String pointcutString; Pointcut pointcut = null; TypePattern typePattern = null; final PerClause perClause; if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERCFLOW.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERCFLOW.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerCflow(pointcut, false); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERCFLOWBELOW.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERCFLOWBELOW.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerCflow(pointcut, true);
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTARGET.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTARGET.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerObject(pointcut, false); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTHIS.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTHIS.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerObject(pointcut, true); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTYPEWITHIN.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTYPEWITHIN.extractPointcut(perClauseString); typePattern = parseTypePattern(pointcutString, struct); perClause = new PerTypeWithin(typePattern); } else if (perClauseString.equalsIgnoreCase(PerClause.SINGLETON.getName() + "()")) { perClause = new PerSingleton(); } else { reportError("@Aspect per clause cannot be read '" + perClauseString + "'", struct); return null; } if (!PerClause.SINGLETON.equals(perClause.getKind()) && !PerClause.PERTYPEWITHIN.equals(perClause.getKind()) && pointcut == null) { return null; } if (PerClause.PERTYPEWITHIN.equals(perClause.getKind()) && typePattern == null) { return null; } return perClause;
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} /** * Read @DeclarePrecedence * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handlePrecedenceAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeStruct struct) { AnnotationGen aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPRECEDENCE_ANNOTATION); if (aspect != null) { NameValuePair precedence = getAnnotationElement(aspect, VALUE); if (precedence != null) { String precedencePattern = precedence.getValue().stringifyValue(); PatternParser parser = new PatternParser(precedencePattern); DeclarePrecedence ajPrecedence = parser.parseDominates(); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(ajPrecedence)); return true; } } return false; }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/** * Read @DeclareParents * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleDeclareParentsAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeFieldStruct struct) { AnnotationGen decp = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPARENTS_ANNOTATION); if (decp != null) { NameValuePair decpPatternNVP = getAnnotationElement(decp, VALUE); String decpPattern = decpPatternNVP.getValue().stringifyValue(); if (decpPattern != null) { TypePattern typePattern = parseTypePattern(decpPattern, struct); ResolvedType fieldType = UnresolvedType.forSignature(struct.field.getSignature()).resolve(
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
struct.enclosingType.getWorld()); if (fieldType.isInterface()) { TypePattern parent = parseTypePattern(fieldType.getName(), struct); FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); List<TypePattern> parents = new ArrayList<TypePattern>(1); parents.add(parent); DeclareParents dp = new DeclareParents(typePattern, parents, false); dp.resolve(binding); typePattern = typePattern.resolveBindings(binding, Bindings.NONE, false, false); dp.setLocation(struct.context, -1, -1); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(dp)); String defaultImplClassName = null; NameValuePair defaultImplNVP = getAnnotationElement(decp, "defaultImpl"); if (defaultImplNVP != null) { ClassElementValue defaultImpl = (ClassElementValue) defaultImplNVP.getValue(); defaultImplClassName = UnresolvedType.forSignature(defaultImpl.getClassString()).getName();
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (defaultImplClassName.equals("org.aspectj.lang.annotation.DeclareParents")) { defaultImplClassName = null; } else { ResolvedType impl = struct.enclosingType.getWorld().resolve(defaultImplClassName, false); ResolvedMember[] mm = impl.getDeclaredMethods(); int implModifiers = impl.getModifiers(); boolean defaultVisibilityImpl = !(Modifier.isPrivate(implModifiers) || Modifier.isProtected(implModifiers) || Modifier.isPublic(implModifiers)); boolean hasNoCtorOrANoArgOne = true; ResolvedMember foundOneOfIncorrectVisibility = null; for (int i = 0; i < mm.length; i++) { ResolvedMember resolvedMember = mm[i]; if (resolvedMember.getName().equals("<init>")) { hasNoCtorOrANoArgOne = false; if (resolvedMember.getParameterTypes().length == 0) { if (defaultVisibilityImpl) { if (resolvedMember.isPublic() || resolvedMember.isDefault()) { hasNoCtorOrANoArgOne = true; } else { foundOneOfIncorrectVisibility = resolvedMember; } } else if (Modifier.isPublic(implModifiers)) { if (resolvedMember.isPublic()) { hasNoCtorOrANoArgOne = true; } else { foundOneOfIncorrectVisibility = resolvedMember;
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} } } } if (hasNoCtorOrANoArgOne) { break; } } if (!hasNoCtorOrANoArgOne) { if (foundOneOfIncorrectVisibility != null) { reportError( "@DeclareParents: defaultImpl=\"" + defaultImplClassName + "\" has a no argument constructor, but it is of incorrect visibility. It must be at least as visible as the type.", struct); } else { reportError("@DeclareParents: defaultImpl=\"" + defaultImplClassName + "\" has no public no-arg constructor", struct); } } if (!fieldType.isAssignableFrom(impl)) { reportError("@DeclareParents: defaultImpl=\"" + defaultImplClassName + "\" does not implement the interface '" + fieldType.toString() + "'", struct); } } } boolean hasAtLeastOneMethod = false; Iterator<ResolvedMember> methodIterator = fieldType.getMethodsIncludingIntertypeDeclarations(false, true); while (methodIterator.hasNext()) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
ResolvedMember method = methodIterator.next(); if (method.isAbstract()) { hasAtLeastOneMethod = true; MethodDelegateTypeMunger mdtm = new MethodDelegateTypeMunger(method, struct.enclosingType,
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
defaultImplClassName, typePattern); mdtm.setFieldType(fieldType); mdtm.setSourceLocation(struct.enclosingType.getSourceLocation()); struct.ajAttributes.add(new AjAttribute.TypeMunger(mdtm)); } } if (hasAtLeastOneMethod && defaultImplClassName != null) { ResolvedMember fieldHost = AjcMemberMaker.itdAtDeclareParentsField(null, fieldType, struct.enclosingType); struct.ajAttributes.add(new AjAttribute.TypeMunger(new MethodDelegateTypeMunger.FieldHostTypeMunger( fieldHost, struct.enclosingType, typePattern))); } return true; } else { reportError("@DeclareParents: can only be used on a field whose type is an interface", struct); return false; } } } return false; } /** * Return a nicely formatted method string, for example: int X.foo(java.lang.String) */ public static String getMethodForMessage(AjAttributeMethodStruct methodstructure) { StringBuffer sb = new StringBuffer(); sb.append("Method '"); sb.append(methodstructure.method.getReturnType().toString());
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
sb.append(" ").append(methodstructure.enclosingType).append(".").append(methodstructure.method.getName()); sb.append("("); Type[] args = methodstructure.method.getArgumentTypes(); if (args != null) { for (int t = 0; t < args.length; t++) { if (t > 0) { sb.append(","); } sb.append(args[t].toString()); } } sb.append(")'"); return sb.toString(); } /** * Process any @DeclareMixin annotation. * * Example Declaration <br> * * @DeclareMixin("Foo+") public I createImpl(Object o) { return new Impl(o); } * * <br> * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleDeclareMixinAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeMethodStruct struct) { AnnotationGen declareMixinAnnotation = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREMIXIN_ANNOTATION); if (declareMixinAnnotation == null) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
return false; } Method annotatedMethod = struct.method; World world = struct.enclosingType.getWorld(); NameValuePair declareMixinPatternNameValuePair = getAnnotationElement(declareMixinAnnotation, VALUE); String declareMixinPattern = declareMixinPatternNameValuePair.getValue().stringifyValue(); TypePattern targetTypePattern = parseTypePattern(declareMixinPattern, struct); ResolvedType methodReturnType = UnresolvedType.forSignature(annotatedMethod.getReturnType().getSignature()).resolve(world); if (methodReturnType.isPrimitiveType()) { reportError(getMethodForMessage(struct) + ": factory methods for a mixin cannot return void or a primitive type", struct); return false; } if (annotatedMethod.getArgumentTypes().length > 1) { reportError(getMethodForMessage(struct) + ": factory methods for a mixin can take a maximum of one parameter", struct); return false; } NameValuePair interfaceListSpecified = getAnnotationElement(declareMixinAnnotation, "interfaces"); List<TypePattern> newParents = new ArrayList<TypePattern>(1); List<ResolvedType> newInterfaceTypes = new ArrayList<ResolvedType>(1); if (interfaceListSpecified != null) { ArrayElementValue arrayOfInterfaceTypes = (ArrayElementValue) interfaceListSpecified.getValue(); int numberOfTypes = arrayOfInterfaceTypes.getElementValuesArraySize(); ElementValue[] theTypes = arrayOfInterfaceTypes.getElementValuesArray();
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
for (int i = 0; i < numberOfTypes; i++) { ClassElementValue interfaceType = (ClassElementValue) theTypes[i]; ResolvedType ajInterfaceType = UnresolvedType.forSignature(interfaceType.getClassString().replace("/", ".")) .resolve(world); if (ajInterfaceType.isMissing() || !ajInterfaceType.isInterface()) { reportError( "Types listed in the 'interfaces' DeclareMixin annotation value must be valid interfaces. This is invalid: " + ajInterfaceType.getName(), struct); return false; } if (!ajInterfaceType.isAssignableFrom(methodReturnType)) { reportError(getMethodForMessage(struct) + ": factory method does not return something that implements '" + ajInterfaceType.getName() + "'", struct); return false; } newInterfaceTypes.add(ajInterfaceType); TypePattern newParent = parseTypePattern(ajInterfaceType.getName(), struct); newParents.add(newParent); } } else { if (methodReturnType.isClass()) { reportError( getMethodForMessage(struct) + ": factory methods for a mixin must either return an interface type or specify interfaces in the annotation and return a class", struct); return false; }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
TypePattern newParent = parseTypePattern(methodReturnType.getName(), struct); newInterfaceTypes.add(methodReturnType); newParents.add(newParent); } if (newParents.size() == 0) { return false; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); DeclareParents dp = new DeclareParentsMixin(targetTypePattern, newParents); dp.resolve(binding); targetTypePattern = dp.getChild(); dp.setLocation(struct.context, -1, -1); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(dp)); boolean hasAtLeastOneMethod = false; for (Iterator<ResolvedType> iterator = newInterfaceTypes.iterator(); iterator.hasNext();) { ResolvedType typeForDelegation = iterator.next(); ResolvedMember[] methods = typeForDelegation.getMethodsWithoutIterator(true, false, false).toArray( new ResolvedMember[0]); for (int i = 0; i < methods.length; i++) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
ResolvedMember method = methods[i]; if (method.isAbstract()) { hasAtLeastOneMethod = true; if (method.hasBackingGenericMember()) { method = method.getBackingGenericMember(); } MethodDelegateTypeMunger mdtm = new MethodDelegateTypeMunger(method, struct.enclosingType, "", targetTypePattern, struct.method.getName(), struct.method.getSignature()); mdtm.setFieldType(methodReturnType); mdtm.setSourceLocation(struct.enclosingType.getSourceLocation()); struct.ajAttributes.add(new AjAttribute.TypeMunger(mdtm)); } } } if (hasAtLeastOneMethod) { ResolvedMember fieldHost = AjcMemberMaker.itdAtDeclareParentsField(null, methodReturnType, struct.enclosingType); struct.ajAttributes.add(new AjAttribute.TypeMunger(new MethodDelegateTypeMunger.FieldHostTypeMunger(fieldHost, struct.enclosingType, targetTypePattern))); } return true; } /** * Read @Before * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleBeforeAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeMethodStruct struct,
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
ResolvedPointcutDefinition preResolvedPointcut) { AnnotationGen before = getAnnotation(runtimeAnnotations, AjcMemberMaker.BEFORE_ANNOTATION); if (before != null) { NameValuePair beforeAdvice = getAnnotationElement(before, VALUE); if (beforeAdvice != null) { String argumentNames = getArgNamesValue(before); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; try { bindings = extractBindings(struct); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else { pc = parsePointcut(beforeAdvice.getValue().stringifyValue(), struct, false); if (pc == null) { return false; } pc = pc.resolve(binding); }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.Before, pc, extraArgument, sl.getOffset(), sl .getOffset() + 1, struct.context)); return true; } } return false; } /** * Read @After * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAfterAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut) { AnnotationGen after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTER_ANNOTATION); if (after != null) { NameValuePair afterAdvice = getAnnotationElement(after, VALUE); if (afterAdvice != null) { FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; String argumentNames = getArgNamesValue(after); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
try { bindings = extractBindings(struct); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else { pc = parsePointcut(afterAdvice.getValue().stringifyValue(), struct, false); if (pc == null) { return false; } pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.After, pc, extraArgument, sl.getOffset(), sl .getOffset() + 1, struct.context)); return true; } } return false; } /**
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* Read @AfterReturning * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAfterReturningAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut, BcelMethod owningMethod) throws ReturningFormalNotDeclaredInAdviceSignatureException { AnnotationGen after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTERRETURNING_ANNOTATION); if (after != null) { NameValuePair annValue = getAnnotationElement(after, VALUE); NameValuePair annPointcut = getAnnotationElement(after, POINTCUT); NameValuePair annReturned = getAnnotationElement(after, RETURNING); String pointcut = null; String returned = null; if ((annValue != null && annPointcut != null) || (annValue == null && annPointcut == null)) { reportError("@AfterReturning: either 'value' or 'poincut' must be provided, not both", struct); return false; } if (annValue != null) { pointcut = annValue.getValue().stringifyValue(); } else { pointcut = annPointcut.getValue().stringifyValue(); } if (isNullOrEmpty(pointcut)) { reportError("@AfterReturning: either 'value' or 'poincut' must be provided, not both", struct); return false; }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (annReturned != null) { returned = annReturned.getValue().stringifyValue(); if (isNullOrEmpty(returned)) { returned = null; } else { String[] pNames = owningMethod.getParameterNames(); if (pNames == null || pNames.length == 0 || !Arrays.asList(pNames).contains(returned)) { throw new ReturningFormalNotDeclaredInAdviceSignatureException(returned); } } } String argumentNames = getArgNamesValue(after); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; try { bindings = (returned == null ? extractBindings(struct) : extractBindings(struct, returned)); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method);
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (returned != null) { extraArgument |= Advice.ExtraArgument; } Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else { pc = parsePointcut(pointcut, struct, false); if (pc == null) { return false; } pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.AfterReturning, pc, extraArgument, sl.getOffset(), sl.getOffset() + 1, struct.context)); return true; } return false; } /** * Read @AfterThrowing * * @param runtimeAnnotations * @param struct * @return true if found */
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private static boolean handleAfterThrowingAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut, BcelMethod owningMethod) throws ThrownFormalNotDeclaredInAdviceSignatureException { AnnotationGen after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTERTHROWING_ANNOTATION); if (after != null) { NameValuePair annValue = getAnnotationElement(after, VALUE); NameValuePair annPointcut = getAnnotationElement(after, POINTCUT); NameValuePair annThrown = getAnnotationElement(after, THROWING); String pointcut = null; String thrownFormal = null; if ((annValue != null && annPointcut != null) || (annValue == null && annPointcut == null)) { reportError("@AfterThrowing: either 'value' or 'poincut' must be provided, not both", struct); return false; } if (annValue != null) { pointcut = annValue.getValue().stringifyValue(); } else { pointcut = annPointcut.getValue().stringifyValue(); } if (isNullOrEmpty(pointcut)) { reportError("@AfterThrowing: either 'value' or 'poincut' must be provided, not both", struct); return false; } if (annThrown != null) { thrownFormal = annThrown.getValue().stringifyValue(); if (isNullOrEmpty(thrownFormal)) { thrownFormal = null; } else {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
String[] pNames = owningMethod.getParameterNames(); if (pNames == null || pNames.length == 0 || !Arrays.asList(pNames).contains(thrownFormal)) { throw new ThrownFormalNotDeclaredInAdviceSignatureException(thrownFormal); } } } String argumentNames = getArgNamesValue(after); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; try { bindings = (thrownFormal == null ? extractBindings(struct) : extractBindings(struct, thrownFormal)); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); if (thrownFormal != null) { extraArgument |= Advice.ExtraArgument; } Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut();
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} else { pc = parsePointcut(pointcut, struct, false); if (pc == null) { return false; } pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.AfterThrowing, pc, extraArgument, sl.getOffset(), sl .getOffset() + 1, struct.context)); return true; } return false; } /** * Read @Around * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAroundAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut) { AnnotationGen around = getAnnotation(runtimeAnnotations, AjcMemberMaker.AROUND_ANNOTATION); if (around != null) { NameValuePair aroundAdvice = getAnnotationElement(around, VALUE); if (aroundAdvice != null) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
String argumentNames = getArgNamesValue(around); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; try { bindings = extractBindings(struct); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else { pc = parsePointcut(aroundAdvice.getValue().stringifyValue(), struct, false); if (pc == null) { return false; } pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.Around, pc, extraArgument, sl.getOffset(), sl .getOffset() + 1, struct.context)); return true;
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} } return false; } /** * Read @Pointcut and handle the resolving in a lazy way to deal with pointcut references * * @param runtimeAnnotations * @param struct * @return true if a pointcut was handled */ private static boolean handlePointcutAnnotation(RuntimeAnnos runtimeAnnotations, AjAttributeMethodStruct struct) { AnnotationGen pointcut = getAnnotation(runtimeAnnotations, AjcMemberMaker.POINTCUT_ANNOTATION); if (pointcut == null) { return false; } NameValuePair pointcutExpr = getAnnotationElement(pointcut, VALUE); if (!(Type.VOID.equals(struct.method.getReturnType()) || (Type.BOOLEAN.equals(struct.method.getReturnType()) && struct.method.isStatic() && struct.method.isPublic()))) { reportWarning("Found @Pointcut on a method not returning 'void' or not 'public static boolean'", struct); } if (struct.method.getExceptionTable() != null) { reportWarning("Found @Pointcut on a method throwing exception", struct); } String argumentNames = getArgNamesValue(pointcut);
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } final IScope binding; try { if (struct.method.isAbstract()) { binding = null; } else { binding = new BindingScope(struct.enclosingType, struct.context, extractBindings(struct)); } } catch (UnreadableDebugInfoException e) { return false; } UnresolvedType[] argumentTypes = new UnresolvedType[struct.method.getArgumentTypes().length]; for (int i = 0; i < argumentTypes.length; i++) { argumentTypes[i] = UnresolvedType.forSignature(struct.method.getArgumentTypes()[i].getSignature()); } Pointcut pc = null; if (struct.method.isAbstract()) { if ((pointcutExpr != null && isNullOrEmpty(pointcutExpr.getValue().stringifyValue())) || pointcutExpr == null) { } else { reportError("Found defined @Pointcut on an abstract method", struct); return false; } } else { if (pointcutExpr == null || isNullOrEmpty(pointcutExpr.getValue().stringifyValue())) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} else { pc = parsePointcut(pointcutExpr.getValue().stringifyValue(), struct, true); if (pc == null) { return false; } pc.setLocation(struct.context, -1, -1); } } struct.ajAttributes.add(new AjAttribute.PointcutDeclarationAttribute(new LazyResolvedPointcutDefinition( struct.enclosingType, struct.method.getModifiers(), struct.method.getName(), argumentTypes, UnresolvedType .forSignature(struct.method.getReturnType().getSignature()), pc, binding
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
))); return true; } /** * Read @DeclareError, @DeclareWarning * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleDeclareErrorOrWarningAnnotation(AsmManager model, RuntimeAnnos runtimeAnnotations, AjAttributeFieldStruct struct) { AnnotationGen error = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREERROR_ANNOTATION); boolean hasError = false; if (error != null) { NameValuePair declareError = getAnnotationElement(error, VALUE); if (declareError != null) { if (!STRING_DESC.equals(struct.field.getSignature()) || struct.field.getConstantValue() == null) { reportError("@DeclareError used on a non String constant field", struct); return false; } Pointcut pc = parsePointcut(declareError.getValue().stringifyValue(), struct, false); if (pc == null) { hasError = false; } else { DeclareErrorOrWarning deow = new DeclareErrorOrWarning(true, pc, struct.field.getConstantValue().toString()); setDeclareErrorOrWarningLocation(model, deow, struct); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(deow)); hasError = true; }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} } AnnotationGen warning = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREWARNING_ANNOTATION); boolean hasWarning = false; if (warning != null) { NameValuePair declareWarning = getAnnotationElement(warning, VALUE); if (declareWarning != null) { if (!STRING_DESC.equals(struct.field.getSignature()) || struct.field.getConstantValue() == null) { reportError("@DeclareWarning used on a non String constant field", struct); return false; } Pointcut pc = parsePointcut(declareWarning.getValue().stringifyValue(), struct, false); if (pc == null) { hasWarning = false; } else { DeclareErrorOrWarning deow = new DeclareErrorOrWarning(false, pc, struct.field.getConstantValue().toString()); setDeclareErrorOrWarningLocation(model, deow, struct); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(deow)); return hasWarning = true; } } } return hasError || hasWarning; } /** * Sets the location for the declare error / warning using the corresponding IProgramElement in the structure model. This will * only fix bug 120356 if compiled with -emacssym, however, it does mean that the cross references view in AJDT will show the * correct information. * * Other possibilities for fix: 1. using the information in ajcDeclareSoft (if this is set correctly) which will fix the problem
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* if compiled with ajc but not if compiled with javac. 2. creating an AjAttribute called FieldDeclarationLineNumberAttribute * (much like MethodDeclarationLineNumberAttribute) which we can ask for the offset. This will again only fix bug 120356 when * compiled with ajc. * * @param deow * @param struct */ private static void setDeclareErrorOrWarningLocation(AsmManager model, DeclareErrorOrWarning deow, AjAttributeFieldStruct struct) { IHierarchy top = (model == null ? null : model.getHierarchy()); if (top != null && top.getRoot() != null) { IProgramElement ipe = top.findElementForLabel(top.getRoot(), IProgramElement.Kind.FIELD, struct.field.getName()); if (ipe != null && ipe.getSourceLocation() != null) { ISourceLocation sourceLocation = ipe.getSourceLocation(); int start = sourceLocation.getOffset(); int end = start + struct.field.getName().length(); deow.setLocation(struct.context, start, end); return; } } deow.setLocation(struct.context, -1, -1); } /** * Returns a readable representation of a method. Method.toString() is not suitable. * * @param method * @return a readable representation of a method */ private static String methodToString(Method method) { StringBuffer sb = new StringBuffer(); sb.append(method.getName());
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
sb.append(method.getSignature()); return sb.toString(); } /** * Build the bindings for a given method (pointcut / advice) * * @param struct * @return null if no debug info is available */ private static FormalBinding[] extractBindings(AjAttributeMethodStruct struct) throws UnreadableDebugInfoException { Method method = struct.method; String[] argumentNames = struct.getArgumentNames(); if (argumentNames.length != method.getArgumentTypes().length) { reportError( "Cannot read debug info for @Aspect to handle formal binding in pointcuts (please compile with 'javac -g' or '<javac debug='true'.../>' in Ant)", struct); throw new UnreadableDebugInfoException(); } List<FormalBinding> bindings = new ArrayList<FormalBinding>(); for (int i = 0; i < argumentNames.length; i++) { String argumentName = argumentNames[i]; UnresolvedType argumentType = UnresolvedType.forSignature(method.getArgumentTypes()[i].getSignature()); if ((AjcMemberMaker.TYPEX_JOINPOINT.equals(argumentType) || AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.equals(argumentType)
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
|| AjcMemberMaker.TYPEX_STATICJOINPOINT.equals(argumentType) || AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.equals(argumentType) || AjcMemberMaker.AROUND_CLOSURE_TYPE .equals(argumentType))) { bindings.add(new FormalBinding.ImplicitFormalBinding(argumentType, argumentName, i)); } else { bindings.add(new FormalBinding(argumentType, argumentName, i)); } } return bindings.toArray(new FormalBinding[] {}); } private static FormalBinding[] extractBindings(AjAttributeMethodStruct struct, String excludeFormal) throws UnreadableDebugInfoException { FormalBinding[] bindings = extractBindings(struct); for (int i = 0; i < bindings.length; i++) { FormalBinding binding = bindings[i]; if (binding.getName().equals(excludeFormal)) { bindings[i] = new FormalBinding.ImplicitFormalBinding(binding.getType(), binding.getName(), binding.getIndex()); break; } } return bindings;
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} /** * Compute the flag for the xxxJoinPoint extra argument * * @param method * @return extra arg flag */ private static int extractExtraArgument(Method method) { Type[] methodArgs = method.getArgumentTypes(); String[] sigs = new String[methodArgs.length]; for (int i = 0; i < methodArgs.length; i++) { sigs[i] = methodArgs[i].getSignature(); } return extractExtraArgument(sigs); } /** * Compute the flag for the xxxJoinPoint extra argument
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* * @param argumentSignatures * @return extra arg flag */ public static int extractExtraArgument(String[] argumentSignatures) { int extraArgument = 0; for (int i = 0; i < argumentSignatures.length; i++) { if (AjcMemberMaker.TYPEX_JOINPOINT.getSignature().equals(argumentSignatures[i])) { extraArgument |= Advice.ThisJoinPoint; } else if (AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.getSignature().equals(argumentSignatures[i])) { extraArgument |= Advice.ThisJoinPoint; } else if (AjcMemberMaker.TYPEX_STATICJOINPOINT.getSignature().equals(argumentSignatures[i])) { extraArgument |= Advice.ThisJoinPointStaticPart; } else if (AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.getSignature().equals(argumentSignatures[i])) { extraArgument |= Advice.ThisEnclosingJoinPointStaticPart; } } return extraArgument; } /** * Returns the runtime (RV/RIV) annotation of type annotationType or null if no such annotation * * @param rvs * @param annotationType * @return annotation */ private static AnnotationGen getAnnotation(RuntimeAnnos rvs, UnresolvedType annotationType) { final String annotationTypeName = annotationType.getName(); for (AnnotationGen rv : rvs.getAnnotations()) { if (annotationTypeName.equals(rv.getTypeName())) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
return rv; } } return null; } /** * Returns the value of a given element of an annotation or null if not found Caution: Does not handles default value. * * @param annotation * @param elementName * @return annotation NVP */ private static NameValuePair getAnnotationElement(AnnotationGen annotation, String elementName) { for (NameValuePair element : annotation.getValues()) { if (elementName.equals(element.getNameString())) { return element; } } return null; } /** * Return the argNames set for an annotation or null if it is not specified. */ private static String getArgNamesValue(AnnotationGen anno) { List<NameValuePair> elements = anno.getValues(); for (NameValuePair element : elements) { if (ARGNAMES.equals(element.getNameString())) { return element.getValue().stringifyValue(); } }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
return null; } private static String lastbit(String fqname) { int i = fqname.lastIndexOf("."); if (i == -1) { return fqname; } else { return fqname.substring(i + 1); } } /** * Extract the method argument names. First we try the debug info attached to the method (the LocalVariableTable) - if we cannot * find that we look to use the argNames value that may have been supplied on the associated annotation. If that fails we just * don't know and return an empty string. * * @param method * @param argNamesFromAnnotation * @param methodStruct * @return method argument names */ private static String[] getMethodArgumentNames(Method method, String argNamesFromAnnotation, AjAttributeMethodStruct methodStruct) { if (method.getArgumentTypes().length == 0) { return EMPTY_STRINGS; } final int startAtStackIndex = method.isStatic() ? 0 : 1; final List<MethodArgument> arguments = new ArrayList<MethodArgument>(); LocalVariableTable lt = method.getLocalVariableTable(); if (lt != null) { LocalVariable[] lvt = lt.getLocalVariableTable();
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
for (int j = 0; j < lvt.length; j++) { LocalVariable localVariable = lvt[j]; if (localVariable != null) { if (localVariable.getStartPC() == 0) { if (localVariable.getIndex() >= startAtStackIndex) { arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex())); } } } else { String typename = (methodStruct.enclosingType != null ? methodStruct.enclosingType.getName() : ""); System.err.println("AspectJ: 348488 debug: unusual local variable table for method " + typename + "." + method.getName()); } } if (arguments.size() == 0) { LocalVariable localVariable = lvt[0]; if (localVariable != null) { if (localVariable.getStartPC() != 0) { for (int j = 0; j < lvt.length && arguments.size() < method.getArgumentTypes().length; j++) { localVariable = lvt[j]; if (localVariable.getIndex() >= startAtStackIndex) { arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex())); }
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} } } } } else { if (argNamesFromAnnotation != null) { StringTokenizer st = new StringTokenizer(argNamesFromAnnotation, " ,"); List<String> args = new ArrayList<String>(); while (st.hasMoreTokens()) { args.add(st.nextToken()); } if (args.size() != method.getArgumentTypes().length) { StringBuffer shortString = new StringBuffer().append(lastbit(method.getReturnType().toString())).append(" ") .append(method.getName()); if (method.getArgumentTypes().length > 0) { shortString.append("("); for (int i = 0; i < method.getArgumentTypes().length; i++) { shortString.append(lastbit(method.getArgumentTypes()[i].toString())); if ((i + 1) < method.getArgumentTypes().length) { shortString.append(","); } } shortString.append(")"); } reportError("argNames annotation value does not specify the right number of argument names for the method '" + shortString.toString() + "'", methodStruct); return EMPTY_STRINGS; } return args.toArray(new String[] {});
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} } if (arguments.size() != method.getArgumentTypes().length) { return EMPTY_STRINGS; } Collections.sort(arguments, new Comparator<MethodArgument>() { public int compare(MethodArgument mo, MethodArgument mo1) { if (mo.indexOnStack == mo1.indexOnStack) { return 0; } else if (mo.indexOnStack > mo1.indexOnStack) { return 1; } else { return -1; } } }); String[] argumentNames = new String[arguments.size()]; int i = 0; for (MethodArgument methodArgument : arguments) { argumentNames[i++] = methodArgument.name; } return argumentNames; } /** * A method argument, used for sorting by indexOnStack (ie order in signature) * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ private static class MethodArgument {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
String name; int indexOnStack; public MethodArgument(String name, int indexOnStack) { this.name = name; this.indexOnStack = indexOnStack; } } /** * LazyResolvedPointcutDefinition lazyly resolve the pointcut so that we have time to register all pointcut referenced before * pointcut resolution happens * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ public static class LazyResolvedPointcutDefinition extends ResolvedPointcutDefinition {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private final Pointcut m_pointcutUnresolved; private final IScope m_binding; private Pointcut m_lazyPointcut = null; public LazyResolvedPointcutDefinition(UnresolvedType declaringType, int modifiers, String name, UnresolvedType[] parameterTypes, UnresolvedType returnType, Pointcut pointcut, IScope binding) { super(declaringType, modifiers, name, parameterTypes, returnType, Pointcut.makeMatchesNothing(Pointcut.RESOLVED)); m_pointcutUnresolved = pointcut; m_binding = binding; } @Override public Pointcut getPointcut() { if (m_lazyPointcut == null && m_pointcutUnresolved == null) { m_lazyPointcut = Pointcut.makeMatchesNothing(Pointcut.CONCRETE); } if (m_lazyPointcut == null && m_pointcutUnresolved != null) { m_lazyPointcut = m_pointcutUnresolved.resolve(m_binding); m_lazyPointcut.copyLocationFrom(m_pointcutUnresolved); } return m_lazyPointcut; } } /**
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* Helper to test empty strings * * @param s * @return true if empty or null */ private static boolean isNullOrEmpty(String s) { return (s == null || s.length() <= 0); } /** * Set the pointcut bindings for which to ignore unbound issues, so that we can implicitly bind xxxJoinPoint for @AJ advices * * @param pointcut * @param bindings */ private static void setIgnoreUnboundBindingNames(Pointcut pointcut, FormalBinding[] bindings) { List<String> ignores = new ArrayList<String>(); for (int i = 0; i < bindings.length; i++) { FormalBinding formalBinding = bindings[i]; if (formalBinding instanceof FormalBinding.ImplicitFormalBinding) { ignores.add(formalBinding.getName()); } } pointcut.m_ignoreUnboundBindingForNames = ignores.toArray(new String[ignores.size()]); } /** * A check exception when we cannot read debug info (needed for formal binding) */ private static class UnreadableDebugInfoException extends Exception {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} /** * Report an error * * @param message * @param location */ private static void reportError(String message, AjAttributeStruct location) { if (!location.handler.isIgnoring(IMessage.ERROR)) { location.handler.handleMessage(new Message(message, location.enclosingType.getSourceLocation(), true)); } } /** * Report a warning *
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* @param message * @param location */ private static void reportWarning(String message, AjAttributeStruct location) { if (!location.handler.isIgnoring(IMessage.WARNING)) { location.handler.handleMessage(new Message(message, location.enclosingType.getSourceLocation(), false)); } } /** * Parse the given pointcut, return null on failure and issue an error * * @param pointcutString * @param struct * @param allowIf * @return pointcut, unresolved */ private static Pointcut parsePointcut(String pointcutString, AjAttributeStruct struct, boolean allowIf) { try { PatternParser parser = new PatternParser(pointcutString, struct.context); Pointcut pointcut = parser.parsePointcut(); parser.checkEof(); pointcut.check(null, struct.enclosingType.getWorld()); if (!allowIf && pointcutString.indexOf("if()") >= 0 && hasIf(pointcut)) { reportError("if() pointcut is not allowed at this pointcut location '" + pointcutString + "'", struct); return null; } pointcut.setLocation(struct.context, -1, -1); return pointcut; } catch (ParserException e) {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
reportError("Invalid pointcut '" + pointcutString + "': " + e.toString() + (e.getLocation() == null ? "" : " at position " + e.getLocation().getStart()), struct); return null; } } private static boolean hasIf(Pointcut pointcut) { IfFinder visitor = new IfFinder(); pointcut.accept(visitor, null); return visitor.hasIf; } /** * Parse the given type pattern, return null on failure and issue an error * * @param patternString * @param location * @return type pattern */ private static TypePattern parseTypePattern(String patternString, AjAttributeStruct location) { try { TypePattern typePattern = new PatternParser(patternString).parseTypePattern(); typePattern.setLocation(location.context, -1, -1); return typePattern; } catch (ParserException e) { reportError("Invalid type pattern'" + patternString + "' : " + e.getLocation(), location); return null; } } static class ThrownFormalNotDeclaredInAdviceSignatureException extends Exception {
371,998
Bug 371998 org.aspectj.weaver.BCException compiling @DeclareParents with value using "||"
Build Identifier: 20110916-0149 Using: import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class AspectTest { private interface X {} private static class XImpl {} @DeclareParents(value="java.lang.Runnable || java.util.concurrent.Callable", defaultImpl=XImpl.class) private X xImpl; } Throws: org.aspectj.weaver.BCException at org.aspectj.weaver.patterns.ExactTypePattern.resolveBindings(ExactTypePattern.java:312) at org.aspectj.weaver.patterns.OrTypePattern.resolveBindings(OrTypePattern.java:121) at org.aspectj.weaver.bcel.AtAjAttributes.handleDeclareParentsAnnotation(AtAjAttributes.java:746) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:384) at org.aspectj.weaver.bcel.BcelObjectType.ens ... \Program Files\Java\jre6\lib\ext\sunjce_provider.jar;C:\Users\xxx\software\eclipse-j2ee\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar; Current workaround is to use multiple DeclareParents annotations on different variables. Reproducible: Always Steps to Reproduce: 1. Create new class given the code in the details. 2. Save and compile in Eclipse.
resolved fixed
f37c56e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-02T16:17:44Z
2012-02-19T19:33:20Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private final String formalName; public ThrownFormalNotDeclaredInAdviceSignatureException(String formalName) { this.formalName = formalName; } public String getFormalName() { return formalName; } } static class ReturningFormalNotDeclaredInAdviceSignatureException extends Exception { private final String formalName; public ReturningFormalNotDeclaredInAdviceSignatureException(String formalName) { this.formalName = formalName; } public String getFormalName() { return formalName; } } }
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
/* ******************************************************************* * Copyright (c) 2005 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://eclipse.org/legal/epl-v10.html * * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.bridge.context; import java.lang.ref.WeakReference; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Stack; /** * @author colyer This class is responsible for tracking progress through the various phases of compilation and weaving. When an * exception occurs (or a message is issued, if desired), you can ask this class for a "stack trace" that gives information * about what the compiler was doing at the time. The trace will say something like: * * when matching pointcut xyz when matching shadow sss when weaving type ABC when weaving shadow mungers * * Since we can't use ThreadLocal (have to work on 1.3), we use a map from Thread -> ContextStack. */ public class CompilationAndWeavingContext {
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
private static int nextTokenId = 1; public static final int BATCH_BUILD = 0;
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
public static final int INCREMENTAL_BUILD = 1; public static final int PROCESSING_COMPILATION_UNIT = 2; public static final int RESOLVING_COMPILATION_UNIT = 3; public static final int ANALYSING_COMPILATION_UNIT = 4; public static final int GENERATING_UNWOVEN_CODE_FOR_COMPILATION_UNIT = 5; public static final int COMPLETING_TYPE_BINDINGS = 6; public static final int PROCESSING_DECLARE_PARENTS = 7; public static final int CHECK_AND_SET_IMPORTS = 8; public static final int CONNECTING_TYPE_HIERARCHY = 9; public static final int BUILDING_FIELDS_AND_METHODS = 10; public static final int COLLECTING_ITDS_AND_DECLARES = 11; public static final int PROCESSING_DECLARE_ANNOTATIONS = 12; public static final int WEAVING_INTERTYPE_DECLARATIONS = 13; public static final int RESOLVING_POINTCUT_DECLARATIONS = 14; public static final int ADDING_DECLARE_WARNINGS_AND_ERRORS = 15; public static final int VALIDATING_AT_ASPECTJ_ANNOTATIONS = 16; public static final int ACCESS_FOR_INLINE = 17; public static final int ADDING_AT_ASPECTJ_ANNOTATIONS = 18; public static final int FIXING_SUPER_CALLS_IN_ITDS = 19; public static final int FIXING_SUPER_CALLS = 20; public static final int OPTIMIZING_THIS_JOIN_POINT_CALLS = 21; public static final int WEAVING = 22; public static final int PROCESSING_REWEAVABLE_STATE = 23; public static final int PROCESSING_TYPE_MUNGERS = 24; public static final int WEAVING_ASPECTS = 25; public static final int WEAVING_CLASSES = 26; public static final int WEAVING_TYPE = 27; public static final int MATCHING_SHADOW = 28; public static final int IMPLEMENTING_ON_SHADOW = 29;
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
public static final int MATCHING_POINTCUT = 30; public static final int MUNGING_WITH = 31; public static final int PROCESSING_ATASPECTJTYPE_MUNGERS_ONLY = 32; public static final String[] PHASE_NAMES = new String[] { "batch building", "incrementally building", "processing compilation unit", "resolving types defined in compilation unit", "analysing types defined in compilation unit", "generating unwoven code for type defined in compilation unit", "completing type bindings", "processing declare parents", "checking and setting imports", "connecting type hierarchy", "building fields and methods", "collecting itds and declares", "processing declare annotations", "weaving intertype declarations", "resolving pointcut declarations", "adding declare warning and errors", "validating @AspectJ annotations", "creating accessors for inlining", "adding @AspectJ annotations", "fixing super calls in ITDs in interface context", "fixing super calls in ITDs", "optimizing thisJoinPoint calls", "weaving", "processing reweavable state", "processing type mungers", "weaving aspects", "weaving classes", "weaving type", "matching shadow", "implementing on shadow", "matching pointcut", "type munging with", "type munging for @AspectJ aspectOf" }; private static Map<Thread, Stack<ContextStackEntry>> contextMap = Collections .synchronizedMap(new HashMap<Thread, Stack<ContextStackEntry>>()); private static Stack<ContextStackEntry> contextStack = new Stack<ContextStackEntry>(); private static Map<Integer, ContextFormatter> formatterMap = new HashMap<Integer, ContextFormatter>(); private static ContextFormatter defaultFormatter = new DefaultFormatter(); private static boolean multiThreaded = true; /** * this is a static service */ private CompilationAndWeavingContext() {
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
} public static void reset() { if (!multiThreaded) { contextMap.clear(); contextStack.clear(); formatterMap.clear(); nextTokenId = 1; } else { contextMap.remove(Thread.currentThread()); } } public static void setMultiThreaded(boolean mt) { multiThreaded = mt; } public static void registerFormatter(int phaseId, ContextFormatter aFormatter) { formatterMap.put(new Integer(phaseId), aFormatter); } /** * Returns a string description of what the compiler/weaver is currently doing */ public static String getCurrentContext() { Stack<ContextStackEntry> contextStack = getContextStack(); Stack<String> explanationStack = new Stack<String>(); for (ContextStackEntry entry : contextStack) { Object data = entry.getData(); if (data != null) { explanationStack.push(getFormatter(entry).formatEntry(entry.phaseId, data)); }
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
} StringBuffer sb = new StringBuffer(); while (!explanationStack.isEmpty()) { sb.append("when "); sb.append(explanationStack.pop().toString()); sb.append("\n"); } return sb.toString(); } public static ContextToken enteringPhase(int phaseId, Object data) { Stack<ContextStackEntry> contextStack = getContextStack(); ContextTokenImpl nextToken = nextToken(); contextStack.push(new ContextStackEntry(nextToken, phaseId, new WeakReference<Object>(data))); return nextToken; } /** * Exit a phase, all stack entries from the one with the given token down will be removed. */ public static void leavingPhase(ContextToken aToken) { Stack contextStack = getContextStack(); while (!contextStack.isEmpty()) { ContextStackEntry entry = (ContextStackEntry) contextStack.pop(); if (entry.contextToken == aToken) { break; } } } /** * Forget about the context for the current thread */
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
public static void resetForThread() { if (!multiThreaded) { return; } contextMap.remove(Thread.currentThread()); } private static Stack<ContextStackEntry> getContextStack() { if (!multiThreaded) { return contextStack; } else { Stack<ContextStackEntry> contextStack = contextMap.get(Thread.currentThread()); if (contextStack == null) { contextStack = new Stack<ContextStackEntry>(); contextMap.put(Thread.currentThread(), contextStack); } return contextStack; } } private static ContextTokenImpl nextToken() { return new ContextTokenImpl(nextTokenId++); } private static ContextFormatter getFormatter(ContextStackEntry entry) { Integer key = new Integer(entry.phaseId); if (formatterMap.containsKey(key)) { return formatterMap.get(key); } else { return defaultFormatter; } } private static class ContextTokenImpl implements ContextToken {
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
public int tokenId; public ContextTokenImpl(int id) { this.tokenId = id; } } private static class ContextStackEntry { public ContextTokenImpl contextToken; public int phaseId; private WeakReference<Object> dataRef; public ContextStackEntry(ContextTokenImpl ct, int phase, WeakReference<Object> data) { this.contextToken = ct; this.phaseId = phase; this.dataRef = data; } public Object getData() { return dataRef.get(); } public String toString() { Object data = getData(); if (data == null) { return "referenced context entry has gone out of scope"; } else { return CompilationAndWeavingContext.getFormatter(this).formatEntry(phaseId, data); } } } private static class DefaultFormatter implements ContextFormatter {
373,195
Bug 373195 Memory leak in CompilationAndWeavingContext leading to PermGen OOME
Build Identifier: 1.6.11 The static contextMap in CompilationAndWeavingContext keeps strong references to Thread instances (which in turn strongly reference their contextClassLoader which prevents all kinds of stuff from unloading). In my particular use case I am running unit tests, each in their own WeavingURLClassLoader, but these ClassLoaders are never released, and running several unit tests at once leads to PermGen OutOfMemoryError. Using -XX:+HeapDumpOnOutOfMemory and analyzing the resulting heap dump in Eclipse Memory Analyzer points to CompilationAndWeavingContext.contextMap. I am able to work around this issue by executing the following at the end of each unit test to clear out this contextMap: CompilationAndWeavingContext.setMultiThreaded(false); CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.setMultiThreaded(true); I am also able to resolve this issue (more satisfactorily) by patching CompilationAndWeavingContext and changing contextMap into a ThreadLocal. Reproducible: Always
resolved fixed
6defb4e
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-06T16:33:16Z
2012-03-04T05:46:40Z
bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
public String formatEntry(int phaseId, Object data) { StringBuffer sb = new StringBuffer(); sb.append(PHASE_NAMES[phaseId]); sb.append(" "); if (data instanceof char[]) { sb.append(new String((char[]) data)); } else { try { sb.append(data.toString()); } catch (RuntimeException ex) { sb.append("** broken toString in data object **"); } } return sb.toString(); } } }
374,745
Bug 374745 Performance regression in 1.6.12
null
resolved fixed
549d227
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-23T23:57:10Z
2012-03-20T10: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;
374,745
Bug 374745 Performance regression in 1.6.12
null
resolved fixed
549d227
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-23T23:57:10Z
2012-03-20T10: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;
374,745
Bug 374745 Performance regression in 1.6.12
null
resolved fixed
549d227
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-23T23:57:10Z
2012-03-20T10: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 {
374,745
Bug 374745 Performance regression in 1.6.12
null
resolved fixed
549d227
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-23T23:57:10Z
2012-03-20T10: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();
374,745
Bug 374745 Performance regression in 1.6.12
null
resolved fixed
549d227
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2012-03-23T23:57:10Z
2012-03-20T10: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;