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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
isParameterizedType());
}
return parameterizedPointcuts;
} else {
return getDelegate().getDeclaredPointcuts();
}
}
private UnresolvedType[] getTypesForMemberParameterization() {
UnresolvedType[] parameters = null;
if (isParameterizedType()) {
parameters = getTypeParameters();
} else if (isRawType()) {
TypeVariable[] tvs = getGenericType().getTypeVariables();
parameters = new UnresolvedType[tvs.length];
for (int i = 0; i < tvs.length; i++) {
parameters[i] = tvs[i].getFirstBound();
}
}
return parameters;
}
@Override
public TypeVariable[] getTypeVariables() {
if (typeVariables == null) {
typeVariables = getDelegate().getTypeVariables();
for (int i = 0; i < this.typeVariables.length; i++) {
typeVariables[i].resolve(world);
}
}
return typeVariables;
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
}
@Override
public PerClause getPerClause() {
PerClause pclause = getDelegate().getPerClause();
if (pclause != null && isParameterizedType()) {
Map<String, UnresolvedType> parameterizationMap = getAjMemberParameterizationMap();
pclause = (PerClause) pclause.parameterizeWith(parameterizationMap, world);
}
return pclause;
}
@Override
public Collection<Declare> getDeclares() {
if (parameterizedDeclares != null) {
return parameterizedDeclares;
}
Collection<Declare> declares = null;
if (ajMembersNeedParameterization()) {
Collection<Declare> genericDeclares = getDelegate().getDeclares();
parameterizedDeclares = new ArrayList<Declare>();
Map<String, UnresolvedType> parameterizationMap = getAjMemberParameterizationMap();
for (Declare declareStatement : genericDeclares) {
parameterizedDeclares.add(declareStatement.parameterizeWith(parameterizationMap, world));
}
declares = parameterizedDeclares;
} else {
declares = getDelegate().getDeclares();
}
for (Declare d : declares) {
d.setDeclaringType(this);
}
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
return declares;
}
@Override
public Collection<ConcreteTypeMunger> getTypeMungers() {
return getDelegate().getTypeMungers();
}
@Override
public Collection<ResolvedMember> getPrivilegedAccesses() {
return getDelegate().getPrivilegedAccesses();
}
@Override
public int getModifiers() {
return getDelegate().getModifiers();
}
WeakReference<ResolvedType> superclassReference = new WeakReference<ResolvedType>(null);
@Override
public ResolvedType getSuperclass() {
ResolvedType ret = null;
if (newSuperclass != null) {
if (this.isParameterizedType() && newSuperclass.isParameterizedType()) {
return newSuperclass.parameterize(getMemberParameterizationMap()).resolve(getWorld());
}
if (getDelegate().isCacheable()) {
superclassReference = new WeakReference<ResolvedType>(ret);
}
return newSuperclass;
}
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
try {
world.setTypeVariableLookupScope(this);
ret = getDelegate().getSuperclass();
} finally {
world.setTypeVariableLookupScope(null);
}
if (this.isParameterizedType() && ret.isParameterizedType()) {
ret = ret.parameterize(getMemberParameterizationMap()).resolve(getWorld());
}
if (getDelegate().isCacheable()) {
superclassReference = new WeakReference<ResolvedType>(ret);
}
return ret;
}
public ReferenceTypeDelegate getDelegate() {
return delegate;
}
public void setDelegate(ReferenceTypeDelegate delegate) {
if (this.delegate != null && this.delegate.copySourceContext()
&& this.delegate.getSourceContext() != SourceContextImpl.UNKNOWN_SOURCE_CONTEXT) {
((AbstractReferenceTypeDelegate) delegate).setSourceContext(this.delegate.getSourceContext());
}
this.delegate = delegate;
List<WeakReference<ReferenceType>> forRemoval = new ArrayList<WeakReference<ReferenceType>>();
for (WeakReference<ReferenceType> derivativeRef : derivativeTypes) {
ReferenceType derivative = derivativeRef.get();
if (derivative!=null) {
derivative.setDelegate(delegate);
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
} else {
forRemoval.add(derivativeRef);
}
}
derivativeTypes.removeAll(forRemoval);
if (isRawType() && getGenericType() != null) {
ReferenceType genType = (ReferenceType) getGenericType();
if (genType.getDelegate() != delegate) {
genType.setDelegate(delegate);
}
}
clearParameterizationCaches();
ensureConsistent();
}
private void clearParameterizationCaches() {
parameterizedFields = null;
parameterizedInterfaces.clear();
parameterizedMethods = null;
parameterizedPointcuts = null;
superclassReference = new WeakReference<ResolvedType>(null);
}
public int getEndPos() {
return endPos;
}
public int getStartPos() {
return startPos;
}
public void setEndPos(int endPos) {
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
this.endPos = endPos;
}
public void setStartPos(int startPos) {
this.startPos = startPos;
}
@Override
public boolean doesNotExposeShadowMungers() {
return getDelegate().doesNotExposeShadowMungers();
}
public String getDeclaredGenericSignature() {
return getDelegate().getDeclaredGenericSignature();
}
public void setGenericType(ReferenceType rt) {
genericType = rt;
if (typeKind == TypeKind.SIMPLE) {
typeKind = TypeKind.RAW;
signatureErasure = signature;
if (newInterfaces != null) {
throw new IllegalStateException(
"Simple type promoted to raw, but simple type had new interfaces/superclass. Type is "
+ this.getName());
}
}
if (typeKind == TypeKind.RAW) {
genericType.addDependentType(this);
}
if (isRawType()) {
genericType.rawType = this;
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
}
if (this.isRawType() && rt.isRawType()) {
new RuntimeException("PR341926 diagnostics: Incorrect setup for a generic type, raw type should not point to raw: "
+ this.getName()).printStackTrace();
}
}
public void demoteToSimpleType() {
genericType = null;
typeKind = TypeKind.SIMPLE;
signatureErasure = null;
}
@Override
public ReferenceType getGenericType() {
if (isGenericType()) {
return this;
}
return genericType;
}
/**
* a parameterized signature starts with a "P" in place of the "L", see the comment on signatures in UnresolvedType.
*
* @param aGenericType
* @param someParameters
* @return
*/
private static String makeParameterizedSignature(ResolvedType aGenericType, ResolvedType[] someParameters) {
String rawSignature = aGenericType.getErasureSignature();
StringBuffer ret = new StringBuffer();
ret.append(PARAMETERIZED_TYPE_IDENTIFIER);
ret.append(rawSignature.substring(1, rawSignature.length() - 1));
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
ret.append("<");
for (int i = 0; i < someParameters.length; i++) {
ret.append(someParameters[i].getSignature());
}
ret.append(">;");
return ret.toString();
}
private static String makeDeclaredSignature(ResolvedType aGenericType, UnresolvedType[] someParameters) {
StringBuffer ret = new StringBuffer();
String rawSig = aGenericType.getErasureSignature();
ret.append(rawSig.substring(0, rawSig.length() - 1));
ret.append("<");
for (int i = 0; i < someParameters.length; i++) {
if (someParameters[i] instanceof ReferenceType) {
ret.append(((ReferenceType)someParameters[i]).getSignatureForAttribute());
} else if (someParameters[i] instanceof Primitive) {
ret.append(((Primitive)someParameters[i]).getSignatureForAttribute());
} else {
throw new IllegalStateException("DebugFor325731: expected a ReferenceType or Primitive but was " + someParameters[i]
+ " of type " + someParameters[i].getClass().getName());
}
}
ret.append(">;");
return ret.toString();
}
@Override
public void ensureConsistent() {
annotations = null;
annotationTypes = null;
newSuperclass = null;
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
newInterfaces = null;
typeVariables = null;
parameterizedInterfaces.clear();
superclassReference = new WeakReference<ResolvedType>(null);
if (getDelegate() != null) {
delegate.ensureConsistent();
}
}
@Override
public void addParent(ResolvedType newParent) {
if (this.isRawType()) {
throw new IllegalStateException(
"The raw type should never be accumulating new interfaces, they should be on the generic type. Type is "
+ this.getName());
}
if (newParent.isClass()) {
newSuperclass = newParent;
superclassReference = new WeakReference<ResolvedType>(null);
} else {
if (newInterfaces == null) {
newInterfaces = new ResolvedType[1];
newInterfaces[0] = newParent;
} else {
ResolvedType[] existing = getDelegate().getDeclaredInterfaces();
if (existing != null) {
for (int i = 0; i < existing.length; i++) {
if (existing[i].equals(newParent)) {
return;
}
}
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
}
ResolvedType[] newNewInterfaces = new ResolvedType[newInterfaces.length + 1];
System.arraycopy(newInterfaces, 0, newNewInterfaces, 1, newInterfaces.length);
newNewInterfaces[0] = newParent;
newInterfaces = newNewInterfaces;
}
if (this.isGenericType()) {
for (WeakReference<ReferenceType> derivativeTypeRef : derivativeTypes) {
ReferenceType derivativeType = derivativeTypeRef.get();
if (derivativeType!=null) {
derivativeType.parameterizedInterfaces.clear();
}
}
}
parameterizedInterfaces.clear();
}
}
private boolean equal(UnresolvedType[] typeParameters, ResolvedType[] resolvedParameters) {
if (typeParameters.length!=resolvedParameters.length) {
return false;
}
int len = typeParameters.length;
for (int p=0;p<len;p++) {
if (!typeParameters[p].equals(resolvedParameters[p])) {
return false;
}
}
return true;
}
|
408,721 |
Bug 408721 java.util.ConcurrentModificationException when multiple threads enter the weaver
|
I am using AspectJ 1.7.1. Occasionally I see the following exception, which I believe is related to multiple threads initializing some internal state. java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(Unknown Source) ~[na:1.7.0_11] at java.util.ArrayList$Itr.next(Unknown Source) ~[na:1.7.0_11] at org.aspectj.weaver.ReferenceType.findDerivativeType(ReferenceType.java:1122) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:44) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.parameterize(ResolvedType.java:2479) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:673) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:82) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:178) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:130) ~[aspectjweaver.jar:1.7.1] at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:84) ~[aspectjweaver.jar:1.7.1] at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:250) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294) ~[spring-aop.jar:3.2.1.RELEASE] at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118) ~[spring-aop.jar:3.2.1.RELEASE]
|
resolved fixed
|
3f6e166
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-26T22:08:06Z | 2013-05-22T16:26:40Z |
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
|
/**
* Look for a derivative type with the specified type parameters. This can avoid creating an
* unnecessary new (duplicate) with the same information in it. This method also cleans up
* any reference entries that have been null'd by a GC.
*
* @param typeParameters the type parameters to use when searching for the derivative type.
* @return an existing derivative type or null if there isn't one
*/
public ReferenceType findDerivativeType(ResolvedType[] typeParameters) {
List<WeakReference<ReferenceType>> forRemoval = new ArrayList<WeakReference<ReferenceType>>();
for (WeakReference<ReferenceType> derivativeTypeRef: derivativeTypes) {
ReferenceType derivativeType = derivativeTypeRef.get();
if (derivativeType==null) {
forRemoval.add(derivativeTypeRef);
} else {
if (derivativeType.isRawType()) {
continue;
}
if (equal(derivativeType.typeParameters,typeParameters)) {
return derivativeType;
}
}
}
derivativeTypes.removeAll(forRemoval);
return null;
}
public boolean hasNewInterfaces() {
return newInterfaces!=null;
}
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.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
* Andy Clement overhauled
* ******************************************************************/
package org.aspectj.ajdt.internal.core.builder;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager;
import org.aspectj.ajdt.internal.compiler.InterimCompilationResult;
import org.aspectj.ajdt.internal.core.builder.AjBuildConfig.BinarySourceFile;
import org.aspectj.apache.bcel.classfile.ClassParser;
import org.aspectj.asm.AsmManager;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.SourceLocation;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryField;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.aspectj.org.eclipse.jdt.internal.core.builder.ReferenceCollection;
import org.aspectj.org.eclipse.jdt.internal.core.builder.StringSet;
import org.aspectj.util.FileUtil;
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.CompressingDataOutputStream;
import org.aspectj.weaver.ReferenceType;
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
import org.aspectj.weaver.ReferenceTypeDelegate;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.bcel.BcelWeaver;
import org.aspectj.weaver.bcel.BcelWorld;
import org.aspectj.weaver.bcel.TypeDelegateResolver;
import org.aspectj.weaver.bcel.UnwovenClassFile;
/**
* Maintains state needed for incremental compilation
*/
public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateResolver {
public static boolean CHECK_STATE_FIRST = true;
public static IStateListener stateListener = null;
public static boolean FORCE_INCREMENTAL_DURING_TESTING = false;
static int PATHID_CLASSPATH = 0;
static int PATHID_ASPECTPATH = 1;
static int PATHID_INPATH = 2;
private static int CLASS_FILE_NO_CHANGES = 0;
private static int CLASS_FILE_CHANGED_THAT_NEEDS_INCREMENTAL_BUILD = 1;
private static int CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD = 2;
private static final char[][] EMPTY_CHAR_ARRAY = new char[0][];
/**
* When looking at changes on the classpath, this set accumulates files in our state instance that affected by those changes.
* Then if we can do an incremental build - these must be compiled.
*/
private final Set<File> affectedFiles = new HashSet<File>();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
private StringSet qualifiedStrings = new StringSet(3);
private StringSet simpleStrings = new StringSet(3);
private Set<File> addedFiles;
private Set<File> deletedFiles;
private Set<BinarySourceFile> addedBinaryFiles;
private Set<BinarySourceFile> deletedBinaryFiles;
public final Set<String> deltaAddedClasses = new HashSet<String>();
private final AjBuildManager buildManager;
private INameEnvironment nameEnvironment;
private boolean couldBeSubsequentIncrementalBuild = false;
private boolean batchBuildRequiredThisTime = false;
private AjBuildConfig buildConfig;
private long lastSuccessfulFullBuildTime = -1;
private final Hashtable<String, Long> structuralChangesSinceLastFullBuild = new Hashtable<String, Long>();
private long lastSuccessfulBuildTime = -1;
private long currentBuildTime = -1;
private AsmManager structureModel;
/**
* For a given source file, records the ClassFiles (which contain a fully qualified name and a file name) that were created when
* the source file was compiled. Populated in noteResult and used in addDependentsOf(File)
*/
private final Map<File, List<ClassFile>> fullyQualifiedTypeNamesResultingFromCompilationUnit = new HashMap<File, List<ClassFile>>();
/**
* Source files defining aspects Populated in noteResult and used in processDeletedFiles
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
*/
private final Set<File> sourceFilesDefiningAspects = new HashSet<File>();
/**
* Populated in noteResult to record the set of types that should be recompiled if the given file is modified or deleted.
* Referred to during addAffectedSourceFiles when calculating incremental compilation set.
*/
private final Map<File, ReferenceCollection> references = new HashMap<File, ReferenceCollection>();
/**
* Holds UnwovenClassFiles (byte[]s) originating from the given file source. This could be a jar file, a directory, or an
* individual .class file. This is an *expensive* map. It is cleared immediately following a batch build, and the cheaper
* inputClassFilesBySource map is kept for processing of any subsequent incremental builds.
*
* Populated during AjBuildManager.initBcelWorld().
*
* Passed into AjCompiler adapter as the set of binary input files to reweave if the weaver determines a full weave is required.
*
* Cleared during initBcelWorld prior to repopulation.
*
* Used when a file is deleted during incremental compilation to delete all of the class files in the output directory that
* resulted from the weaving of File.
*
* Used during getBinaryFilesToCompile when compiling incrementally to determine which files should be recompiled if a given
* input file has changed.
*
*/
private Map<String, List<UnwovenClassFile>> binarySourceFiles = new HashMap<String, List<UnwovenClassFile>>();
/**
* Initially a duplicate of the information held in binarySourceFiles, with the key difference that the values are ClassFiles
* (type name, File) not UnwovenClassFiles (which also have all the byte code in them). After a batch build, binarySourceFiles
* is cleared, leaving just this much lighter weight map to use in processing subsequent incremental builds.
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
*/
private final Map<String, List<ClassFile>> inputClassFilesBySource = new HashMap<String, List<ClassFile>>();
/**
* A list of the .class files created by this state that contain aspects.
*/
private final List<String> aspectClassFiles = new ArrayList<String>();
/**
* Holds structure information on types as they were at the end of the last build. It would be nice to get rid of this too, but
* can't see an easy way to do that right now.
*/
private final Map<String, CompactTypeStructureRepresentation> resolvedTypeStructuresFromLastBuild = new HashMap<String, CompactTypeStructureRepresentation>();
/**
* Populated in noteResult to record the set of UnwovenClassFiles (intermediate results) that originated from compilation of the
* class with the given fully-qualified name.
*
* Used in removeAllResultsOfLastBuild to remove .class files from output directory.
*
* Passed into StatefulNameEnvironment during incremental compilation to support findType lookups.
*/
private final Map<String, File> classesFromName = new HashMap<String, File>();
/**
* Populated by AjBuildManager to record the aspects with the file name in which they're contained. This is later used when
* writing the outxml file in AjBuildManager. Need to record the file name because want to write an outxml file for each of the
* output directories and in order to ask the OutputLocationManager for the output location for a given aspect we need the file
* in which it is contained.
*/
private Map<String, char[]> aspectsFromFileNames;
private Set<File> compiledSourceFiles = new HashSet<File>();
private final Map<String, File> resources = new HashMap<String, File>();
SoftHashMapfileToClassNameMap = new SoftHashMap();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
private BcelWeaver weaver;
private BcelWorld world;
public AjState(AjBuildManager buildManager) {
this.buildManager = buildManager;
}
public void setCouldBeSubsequentIncrementalBuild(boolean yesThereCould) {
this.couldBeSubsequentIncrementalBuild = yesThereCould;
}
void successfulCompile(AjBuildConfig config, boolean wasFullBuild) {
buildConfig = config;
lastSuccessfulBuildTime = currentBuildTime;
if (stateListener != null) {
stateListener.buildSuccessful(wasFullBuild);
}
if (wasFullBuild) {
lastSuccessfulFullBuildTime = currentBuildTime;
}
}
/**
* Returns false if a batch build is needed.
*/
public boolean prepareForNextBuild(AjBuildConfig newBuildConfig) {
currentBuildTime = System.currentTimeMillis();
if (!maybeIncremental()) {
if (listenerDefined()) {
getListener().recordDecision(
"Preparing for build: not going to be incremental because either not in AJDT or incremental deactivated");
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return false;
}
if (this.batchBuildRequiredThisTime) {
this.batchBuildRequiredThisTime = false;
if (listenerDefined()) {
getListener().recordDecision(
"Preparing for build: not going to be incremental this time because batch build explicitly forced");
}
return false;
}
if (lastSuccessfulBuildTime == -1 || buildConfig == null) {
structuralChangesSinceLastFullBuild.clear();
if (listenerDefined()) {
getListener().recordDecision(
"Preparing for build: not going to be incremental because no successful previous full build");
}
return false;
}
if (newBuildConfig.getOutputJar() != null) {
structuralChangesSinceLastFullBuild.clear();
if (listenerDefined()) {
getListener().recordDecision("Preparing for build: not going to be incremental because outjar being used");
}
return false;
}
affectedFiles.clear();
if (pathChange(buildConfig, newBuildConfig)) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
removeAllResultsOfLastBuild();
if (stateListener != null) {
stateListener.pathChangeDetected();
}
structuralChangesSinceLastFullBuild.clear();
if (listenerDefined()) {
getListener()
.recordDecision(
"Preparing for build: not going to be incremental because path change detected (one of classpath/aspectpath/inpath/injars)");
}
return false;
}
if (simpleStrings.elementSize > 20) {
simpleStrings = new StringSet(3);
} else {
simpleStrings.clear();
}
if (qualifiedStrings.elementSize > 20) {
qualifiedStrings = new StringSet(3);
} else {
qualifiedStrings.clear();
}
if ((newBuildConfig.getChanged() & PROJECTSOURCEFILES_CHANGED) == 0) {
addedFiles = Collections.emptySet();
deletedFiles = Collections.emptySet();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
} else {
Set<File> oldFiles = new HashSet<File>(buildConfig.getFiles());
Set<File> newFiles = new HashSet<File>(newBuildConfig.getFiles());
addedFiles = new HashSet<File>(newFiles);
addedFiles.removeAll(oldFiles);
deletedFiles = new HashSet<File>(oldFiles);
deletedFiles.removeAll(newFiles);
}
Set<BinarySourceFile> oldBinaryFiles = new HashSet<BinarySourceFile>(buildConfig.getBinaryFiles());
Set<BinarySourceFile> newBinaryFiles = new HashSet<BinarySourceFile>(newBuildConfig.getBinaryFiles());
addedBinaryFiles = new HashSet<BinarySourceFile>(newBinaryFiles);
addedBinaryFiles.removeAll(oldBinaryFiles);
deletedBinaryFiles = new HashSet<BinarySourceFile>(oldBinaryFiles);
deletedBinaryFiles.removeAll(newBinaryFiles);
boolean couldStillBeIncremental = processDeletedFiles(deletedFiles);
if (!couldStillBeIncremental) {
if (listenerDefined()) {
getListener().recordDecision("Preparing for build: not going to be incremental because an aspect was deleted");
}
return false;
}
if (listenerDefined()) {
getListener().recordDecision("Preparing for build: planning to be an incremental build");
}
return true;
}
/**
* Checks if any of the files in the set passed in contains an aspect declaration. If one is found then we start the process of
* batch building, i.e. we remove all the results of the last build, call any registered listener to tell them whats happened
* and return false.
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
*
* @return false if we discovered an aspect declaration
*/
private boolean processDeletedFiles(Set<File> deletedFiles) {
for (File deletedFile : deletedFiles) {
if (this.sourceFilesDefiningAspects.contains(deletedFile)) {
removeAllResultsOfLastBuild();
if (stateListener != null) {
stateListener.detectedAspectDeleted(deletedFile);
}
return false;
}
List<ClassFile> classes = fullyQualifiedTypeNamesResultingFromCompilationUnit.get(deletedFile);
if (classes != null) {
for (ClassFile cf : classes) {
resolvedTypeStructuresFromLastBuild.remove(cf.fullyQualifiedTypeName);
}
}
}
return true;
}
private Collection<File> getModifiedFiles() {
return getModifiedFiles(lastSuccessfulBuildTime);
}
Collection<File> getModifiedFiles(long lastBuildTime) {
Set<File> ret = new HashSet<File>();
List<File> modifiedFiles = buildConfig.getModifiedFiles();
if (modifiedFiles == null) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
for (Iterator<File> i = buildConfig.getFiles().iterator(); i.hasNext();) {
File file = i.next();
if (!file.exists()) {
continue;
}
long modTime = file.lastModified();
if (modTime + 1000 > lastBuildTime) {
ret.add(file);
}
}
} else {
ret.addAll(modifiedFiles);
}
ret.addAll(affectedFiles);
return ret;
}
private Collection<BinarySourceFile> getModifiedBinaryFiles() {
return getModifiedBinaryFiles(lastSuccessfulBuildTime);
}
Collection<BinarySourceFile> getModifiedBinaryFiles(long lastBuildTime) {
List<BinarySourceFile> ret = new ArrayList<BinarySourceFile>();
for (Iterator<BinarySourceFile> i = buildConfig.getBinaryFiles().iterator(); i.hasNext();) {
AjBuildConfig.BinarySourceFile bsfile = i.next();
File file = bsfile.binSrc;
if (!file.exists()) {
continue;
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
long modTime = file.lastModified();
if (modTime + 1000 >= lastBuildTime) {
ret.add(bsfile);
}
}
return ret;
}
private void recordDecision(String decision) {
getListener().recordDecision(decision);
}
/**
* Analyse .class files in the directory specified, if they have changed since the last successful build then see if we can
* determine which source files in our project depend on the change. If we can then we can still do an incremental build, if we
* can't then we have to do a full build.
*
*/
private int classFileChangedInDirSinceLastBuildRequiringFullBuild(File dir, int pathid) {
if (!dir.isDirectory()) {
if (listenerDefined()) {
recordDecision("ClassFileChangeChecking: not a directory so forcing full build: '" + dir.getPath() + "'");
}
return CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD;
}
AjState state = IncrementalStateManager.findStateManagingOutputLocation(dir);
if (listenerDefined()) {
if (state != null) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
recordDecision("ClassFileChangeChecking: found state instance managing output location : " + dir);
} else {
recordDecision("ClassFileChangeChecking: failed to find a state instance managing output location : " + dir);
}
}
if (state != null && !state.hasAnyStructuralChangesSince(lastSuccessfulBuildTime)) {
if (listenerDefined()) {
getListener().recordDecision("ClassFileChangeChecking: no reported changes in that state");
}
return CLASS_FILE_NO_CHANGES;
}
if (state == null) {
CompilationResultDestinationManager crdm = buildConfig.getCompilationResultDestinationManager();
if (crdm != null) {
int i = crdm.discoverChangesSince(dir, lastSuccessfulBuildTime);
if (i == 1) {
if (listenerDefined()) {
getListener().recordDecision(
"ClassFileChangeChecking: queried JDT and '" + dir
+ "' is apparently unchanged so not performing timestamp check");
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return CLASS_FILE_NO_CHANGES;
}
}
}
List<File> classFiles = FileUtil.listClassFiles(dir);
for (Iterator<File> iterator = classFiles.iterator(); iterator.hasNext();) {
File classFile = iterator.next();
if (CHECK_STATE_FIRST && state != null) {
if (state.isAspect(classFile)) {
boolean hasStructuralChanges = state.hasStructuralChangedSince(classFile, lastSuccessfulBuildTime);
if (hasStructuralChanges || isTypeWeReferTo(classFile)) {
if (hasStructuralChanges) {
if (listenerDefined()) {
getListener().recordDecision(
"ClassFileChangeChecking: aspect found that has structurally changed : " + classFile);
}
return CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD;
} else {
if (pathid == PATHID_CLASSPATH) {
if (listenerDefined()) {
getListener().recordDecision(
"ClassFileChangeChecking: aspect found that this project refers to : " + classFile
+ " but only referred to via classpath");
}
} else {
if (listenerDefined()) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
getListener().recordDecision(
"ClassFileChangeChecking: aspect found that this project refers to : " + classFile
+ " from either inpath/aspectpath, switching to full build");
}
return CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD;
}
}
} else {
if (pathid == PATHID_CLASSPATH) {
if (listenerDefined()) {
getListener()
.recordDecision(
"ClassFileChangeChecking: found aspect on classpath but this project doesn't reference it, continuing to try for incremental build : "
+ classFile);
}
} else {
if (listenerDefined()) {
getListener().recordDecision(
"ClassFileChangeChecking: found aspect on aspectpath/inpath - can't determine if this project is affected, must full build: "
+ classFile);
}
return CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD;
}
}
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
if (state.hasStructuralChangedSince(classFile, lastSuccessfulBuildTime)) {
if (listenerDefined()) {
getListener().recordDecision("ClassFileChangeChecking: structural change detected in : " + classFile);
}
isTypeWeReferTo(classFile);
}
} else {
long modTime = classFile.lastModified();
if ((modTime + 1000) >= lastSuccessfulBuildTime) {
if (state != null) {
if (state.isAspect(classFile)) {
if (state.hasStructuralChangedSince(classFile, lastSuccessfulBuildTime) || isTypeWeReferTo(classFile)) {
if (listenerDefined()) {
getListener().recordDecision(
"ClassFileChangeChecking: aspect found that has structurally changed or that this project depends upon : "
+ classFile);
}
return CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD;
} else {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
if (pathid == PATHID_CLASSPATH) {
if (listenerDefined()) {
getListener()
.recordDecision(
"ClassFileChangeChecking: found aspect on classpath but this project doesn't reference it, continuing to try for incremental build : "
+ classFile);
}
} else {
if (listenerDefined()) {
getListener().recordDecision(
"ClassFileChangeChecking: found aspect on aspectpath/inpath - can't determine if this project is affected, must full build: "
+ classFile);
}
return CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD;
}
}
}
if (state.hasStructuralChangedSince(classFile, lastSuccessfulBuildTime)) {
if (listenerDefined()) {
getListener().recordDecision(
"ClassFileChangeChecking: structural change detected in : " + classFile);
}
isTypeWeReferTo(classFile);
} else {
if (listenerDefined()) {
getListener().recordDecision(
"ClassFileChangeChecking: change detected in " + classFile + " but it is not structural");
}
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
} else {
if (isTypeWeReferTo(classFile)) {
return CLASS_FILE_CHANGED_THAT_NEEDS_INCREMENTAL_BUILD;
} else {
return CLASS_FILE_NO_CHANGES;
}
}
}
}
}
return CLASS_FILE_NO_CHANGES;
}
private boolean isAspect(File file) {
return aspectClassFiles.contains(file.getAbsolutePath());
}
@SuppressWarnings("rawtypes")
public static class SoftHashMap extends AbstractMap {
private final Map map;
private final ReferenceQueue rq = new ReferenceQueue();
public SoftHashMap(Map map) {
this.map = map;
}
public SoftHashMap() {
this(new HashMap());
}
public SoftHashMap(Map map, boolean b) {
this(map);
}
class SoftReferenceKnownKey extends SoftReference {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
private final Object key;
@SuppressWarnings("unchecked")
SoftReferenceKnownKey(Object k, Object v) {
super(v, rq);
this.key = k;
}
}
private void processQueue() {
SoftReferenceKnownKey sv = null;
while ((sv = (SoftReferenceKnownKey) rq.poll()) != null) {
map.remove(sv.key);
}
}
public Object get(Object key) {
SoftReferenceKnownKey value = (SoftReferenceKnownKey) map.get(key);
if (value == null) {
return null;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
if (value.get() == null) {
map.remove(value.key);
return null;
} else {
return value.get();
}
}
public Object put(Object k, Object v) {
processQueue();
return map.put(k, new SoftReferenceKnownKey(k, v));
}
public Set entrySet() {
return map.entrySet();
}
public void clear() {
processQueue();
map.clear();
}
public int size() {
processQueue();
return map.size();
}
public Object remove(Object k) {
processQueue();
SoftReferenceKnownKey value = (SoftReferenceKnownKey) map.remove(k);
if (value == null) {
return null;
}
if (value.get() != null) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return value.get();
}
return null;
}
}
/**
* If a class file has changed in a path on our classpath, it may not be for a type that any of our source files care about.
* This method checks if any of our source files have a dependency on the class in question and if not, we don't consider it an
* interesting change.
*/
private boolean isTypeWeReferTo(File file) {
String fpath = file.getAbsolutePath();
int finalSeparator = fpath.lastIndexOf(File.separator);
String baseDir = fpath.substring(0, finalSeparator);
String theFile = fpath.substring(finalSeparator + 1);
SoftHashMap classNames = (SoftHashMap) fileToClassNameMap.get(baseDir);
if (classNames == null) {
classNames = new SoftHashMap();
fileToClassNameMap.put(baseDir, classNames);
}
char[] className = (char[]) classNames.get(theFile);
if (className == null) {
ClassFileReader cfr;
try {
cfr = ClassFileReader.read(file);
} catch (ClassFormatException e) {
return true;
} catch (IOException e) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return true;
}
className = cfr.getName();
classNames.put(theFile, className);
}
char[][][] qualifiedNames = null;
char[][] simpleNames = null;
if (CharOperation.indexOf('/', className) != -1) {
qualifiedNames = new char[1][][];
qualifiedNames[0] = CharOperation.splitOn('/', className);
qualifiedNames = ReferenceCollection.internQualifiedNames(qualifiedNames);
} else {
simpleNames = new char[1][];
simpleNames[0] = className;
simpleNames = ReferenceCollection.internSimpleNames(simpleNames, true);
}
int newlyAffectedFiles = 0;
for (Iterator<Map.Entry<File, ReferenceCollection>> i = references.entrySet().iterator(); i.hasNext();) {
Map.Entry<File, ReferenceCollection> entry = i.next();
ReferenceCollection refs = entry.getValue();
if (refs != null && refs.includes(qualifiedNames, simpleNames)) {
if (listenerDefined()) {
getListener().recordDecision(
toString() + ": type " + new String(className) + " is depended upon by '" + entry.getKey() + "'");
}
newlyAffectedFiles++;
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
affectedFiles.add(entry.getKey());
}
}
if (newlyAffectedFiles > 0) {
return true;
}
if (listenerDefined()) {
getListener().recordDecision(toString() + ": type " + new String(className) + " is not depended upon by this state");
}
return false;
}
public String toString() {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
StringBuffer sb = new StringBuffer();
sb.append("AjState(").append((buildConfig == null ? "NULLCONFIG" : buildConfig.getConfigFile().toString())).append(")");
return sb.toString();
}
/**
* Determine if a file has changed since a given time, using the local information recorded in the structural changes data
* structure.
*
* @param file the file we are wondering about
* @param lastSuccessfulBuildTime the last build time for the state asking the question
*/
private boolean hasStructuralChangedSince(File file, long lastSuccessfulBuildTime) {
Long l = structuralChangesSinceLastFullBuild.get(file.getAbsolutePath());
long strucModTime = -1;
if (l != null) {
strucModTime = l.longValue();
} else {
strucModTime = this.lastSuccessfulFullBuildTime;
}
return (strucModTime > lastSuccessfulBuildTime);
}
/**
* Determine if anything has changed since a given time.
*/
private boolean hasAnyStructuralChangesSince(long lastSuccessfulBuildTime) {
Set<Map.Entry<String, Long>> entries = structuralChangesSinceLastFullBuild.entrySet();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
for (Iterator<Map.Entry<String, Long>> iterator = entries.iterator(); iterator.hasNext();) {
Map.Entry<String, Long> entry = iterator.next();
Long l = entry.getValue();
if (l != null) {
long lvalue = l.longValue();
if (lvalue > lastSuccessfulBuildTime) {
if (listenerDefined()) {
getListener().recordDecision(
"Seems this has changed " + entry.getKey() + "modtime=" + lvalue + " lsbt="
+ this.lastSuccessfulFullBuildTime + " incoming check value=" + lastSuccessfulBuildTime);
}
return true;
}
}
}
return (this.lastSuccessfulFullBuildTime > lastSuccessfulBuildTime);
}
/**
* Determine if something has changed on the classpath/inpath/aspectpath and a full build is required rather than an incremental
* one.
*
* @param previousConfig the previous configuration used
* @param newConfig the new configuration being used
* @return true if full build required
*/
private boolean pathChange(AjBuildConfig previousConfig, AjBuildConfig newConfig) {
int changes = newConfig.getChanged();
if ((changes & (CLASSPATH_CHANGED | ASPECTPATH_CHANGED | INPATH_CHANGED | OUTPUTDESTINATIONS_CHANGED | INJARS_CHANGED)) != 0) {
List<File> oldOutputLocs = getOutputLocations(previousConfig);
Set<String> alreadyAnalysedPaths = new HashSet<String>();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
List<String> oldClasspath = previousConfig.getClasspath();
List<String> newClasspath = newConfig.getClasspath();
if (stateListener != null) {
stateListener.aboutToCompareClasspaths(oldClasspath, newClasspath);
}
if (classpathChangedAndNeedsFullBuild(oldClasspath, newClasspath, true, oldOutputLocs, alreadyAnalysedPaths)) {
return true;
}
List<File> oldAspectpath = previousConfig.getAspectpath();
List<File> newAspectpath = newConfig.getAspectpath();
if (changedAndNeedsFullBuild(oldAspectpath, newAspectpath, true, oldOutputLocs, alreadyAnalysedPaths, PATHID_ASPECTPATH)) {
return true;
}
List<File> oldInPath = previousConfig.getInpath();
List<File> newInPath = newConfig.getInpath();
if (changedAndNeedsFullBuild(oldInPath, newInPath, false, oldOutputLocs, alreadyAnalysedPaths, PATHID_INPATH)) {
return true;
}
List<File> oldInJars = previousConfig.getInJars();
List<File> newInJars = newConfig.getInJars();
if (changedAndNeedsFullBuild(oldInJars, newInJars, false, oldOutputLocs, alreadyAnalysedPaths, PATHID_INPATH)) {
return true;
}
} else if (newConfig.getClasspathElementsWithModifiedContents() != null) {
List<String> modifiedCpElements = newConfig.getClasspathElementsWithModifiedContents();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
for (Iterator<String> iterator = modifiedCpElements.iterator(); iterator.hasNext();) {
File cpElement = new File(iterator.next());
if (cpElement.exists() && !cpElement.isDirectory()) {
if (cpElement.lastModified() > lastSuccessfulBuildTime) {
return true;
}
} else {
int classFileChanges = classFileChangedInDirSinceLastBuildRequiringFullBuild(cpElement, PATHID_CLASSPATH);
if (classFileChanges == CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD) {
return true;
}
}
}
}
return false;
}
/**
* Return a list of the output locations - this includes any 'default' output location and then any known by a registered
* CompilationResultDestinationManager.
*
* @param config the build configuration for which the output locations should be determined
* @return a list of file objects
*/
private List<File> getOutputLocations(AjBuildConfig config) {
List<File> outputLocs = new ArrayList<File>();
if (config.getOutputDir() != null) {
try {
outputLocs.add(config.getOutputDir().getCanonicalFile());
} catch (IOException e) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
}
if (config.getCompilationResultDestinationManager() != null) {
List<File> dirs = config.getCompilationResultDestinationManager().getAllOutputLocations();
for (Iterator<File> iterator = dirs.iterator(); iterator.hasNext();) {
File f = iterator.next();
try {
File cf = f.getCanonicalFile();
if (!outputLocs.contains(cf)) {
outputLocs.add(cf);
}
} catch (IOException e) {
}
}
}
return outputLocs;
}
private File getOutputLocationFor(AjBuildConfig config, File aResourceFile) {
if (config.getCompilationResultDestinationManager() != null) {
File outputLoc = config.getCompilationResultDestinationManager().getOutputLocationForResource(aResourceFile);
if (outputLoc != null) {
return outputLoc;
}
}
if (config.getOutputDir() != null) {
return config.getOutputDir();
}
return null;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
/**
* Check the old and new paths, if they vary by length or individual elements then that is considered a change. Or if the last
* modified time of a path entry has changed (or last modified time of a classfile in that path entry has changed) then return
* true. The outputlocations are supplied so they can be 'ignored' in the comparison.
*
* @param oldPath
* @param newPath
* @param checkClassFiles whether to examine individual class files within directories
* @param outputLocs the output locations that should be ignored if they occur on the paths being compared
* @return true if a change is detected that requires a full build
*/
private boolean changedAndNeedsFullBuild(List oldPath, List newPath, boolean checkClassFiles, List<File> outputLocs,
Set<String> alreadyAnalysedPaths, int pathid) {
if (oldPath.size() != newPath.size()) {
return true;
}
for (int i = 0; i < oldPath.size(); i++) {
if (!oldPath.get(i).equals(newPath.get(i))) {
return true;
}
Object o = oldPath.get(i);
File f = null;
if (o instanceof String) {
f = new File((String) o);
} else {
f = (File) o;
}
if (f.exists() && !f.isDirectory() && (f.lastModified() >= lastSuccessfulBuildTime)) {
return true;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
if (checkClassFiles && f.exists() && f.isDirectory()) {
boolean foundMatch = false;
for (Iterator<File> iterator = outputLocs.iterator(); !foundMatch && iterator.hasNext();) {
File dir = iterator.next();
if (f.equals(dir)) {
foundMatch = true;
}
}
if (!foundMatch) {
if (!alreadyAnalysedPaths.contains(f.getAbsolutePath())) {
alreadyAnalysedPaths.add(f.getAbsolutePath());
int classFileChanges = classFileChangedInDirSinceLastBuildRequiringFullBuild(f, pathid);
if (classFileChanges == CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD) {
return true;
}
}
}
}
}
return false;
}
/**
* Check the old and new paths, if they vary by length or individual elements then that is considered a change. Or if the last
* modified time of a path entry has changed (or last modified time of a classfile in that path entry has changed) then return
* true. The outputlocations are supplied so they can be 'ignored' in the comparison.
*
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
* @param oldPath
* @param newPath
* @param checkClassFiles whether to examine individual class files within directories
* @param outputLocs the output locations that should be ignored if they occur on the paths being compared
* @return true if a change is detected that requires a full build
*/
private boolean classpathChangedAndNeedsFullBuild(List<String> oldPath, List<String> newPath, boolean checkClassFiles,
List<File> outputLocs, Set<String> alreadyAnalysedPaths) {
if (oldPath.size() != newPath.size()) {
return true;
}
for (int i = 0; i < oldPath.size(); i++) {
if (!oldPath.get(i).equals(newPath.get(i))) {
return true;
}
File f = new File(oldPath.get(i));
if (f.exists() && !f.isDirectory() && (f.lastModified() >= lastSuccessfulBuildTime)) {
return true;
}
if (checkClassFiles && f.exists() && f.isDirectory()) {
boolean foundMatch = false;
for (Iterator<File> iterator = outputLocs.iterator(); !foundMatch && iterator.hasNext();) {
File dir = iterator.next();
if (f.equals(dir)) {
foundMatch = true;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
if (!foundMatch) {
if (!alreadyAnalysedPaths.contains(f.getAbsolutePath())) {
alreadyAnalysedPaths.add(f.getAbsolutePath());
int classFileChanges = classFileChangedInDirSinceLastBuildRequiringFullBuild(f, PATHID_CLASSPATH);
if (classFileChanges == CLASS_FILE_CHANGED_THAT_NEEDS_FULL_BUILD) {
return true;
}
}
}
}
}
return false;
}
public Set<File> getFilesToCompile(boolean firstPass) {
Set<File> thisTime = new HashSet<File>();
if (firstPass) {
compiledSourceFiles = new HashSet<File>();
Collection<File> modifiedFiles = getModifiedFiles();
thisTime.addAll(modifiedFiles);
if (addedFiles != null) {
for (Iterator<File> fIter = addedFiles.iterator(); fIter.hasNext();) {
File o = fIter.next();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
if (!thisTime.contains(o)) {
thisTime.add(o);
}
}
}
deleteClassFiles();
addAffectedSourceFiles(thisTime, thisTime);
} else {
addAffectedSourceFiles(thisTime, compiledSourceFiles);
}
compiledSourceFiles = thisTime;
return thisTime;
}
private boolean maybeIncremental() {
return (FORCE_INCREMENTAL_DURING_TESTING || this.couldBeSubsequentIncrementalBuild);
}
public Map<String, List<UnwovenClassFile>> getBinaryFilesToCompile(boolean firstTime) {
if (lastSuccessfulBuildTime == -1 || buildConfig == null || !maybeIncremental()) {
return binarySourceFiles;
}
Map<String, List<UnwovenClassFile>> toWeave = new HashMap<String, List<UnwovenClassFile>>();
if (firstTime) {
List<BinarySourceFile> addedOrModified = new ArrayList<BinarySourceFile>();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
addedOrModified.addAll(addedBinaryFiles);
addedOrModified.addAll(getModifiedBinaryFiles());
for (Iterator<BinarySourceFile> iter = addedOrModified.iterator(); iter.hasNext();) {
AjBuildConfig.BinarySourceFile bsf = iter.next();
UnwovenClassFile ucf = createUnwovenClassFile(bsf);
if (ucf == null) {
continue;
}
List<UnwovenClassFile> ucfs = new ArrayList<UnwovenClassFile>();
ucfs.add(ucf);
recordTypeChanged(ucf.getClassName());
binarySourceFiles.put(bsf.binSrc.getPath(), ucfs);
List<ClassFile> cfs = new ArrayList<ClassFile>(1);
cfs.add(getClassFileFor(ucf));
this.inputClassFilesBySource.put(bsf.binSrc.getPath(), cfs);
toWeave.put(bsf.binSrc.getPath(), ucfs);
}
deleteBinaryClassFiles();
} else {
}
return toWeave;
}
/**
* Called when a path change is about to trigger a full build, but we haven't cleaned up from the last incremental build...
*/
private void removeAllResultsOfLastBuild() {
for (Iterator<List<ClassFile>> iter = this.inputClassFilesBySource.values().iterator(); iter.hasNext();) {
List<ClassFile> cfs = iter.next();
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
for (ClassFile cf : cfs) {
cf.deleteFromFileSystem(buildConfig);
}
}
for (Iterator<File> iterator = classesFromName.values().iterator(); iterator.hasNext();) {
File f = iterator.next();
new ClassFile("", f).deleteFromFileSystem(buildConfig);
}
Set<Map.Entry<String, File>> resourceEntries = resources.entrySet();
for (Iterator<Map.Entry<String, File>> iter = resourceEntries.iterator(); iter.hasNext();) {
Map.Entry<String, File> resourcePair = iter.next();
File sourcePath = resourcePair.getValue();
File outputLoc = getOutputLocationFor(buildConfig, sourcePath);
if (outputLoc != null) {
outputLoc = new File(outputLoc, resourcePair.getKey());
if (!outputLoc.getPath().equals(sourcePath.getPath()) && outputLoc.exists()) {
outputLoc.delete();
if (buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileRemove(outputLoc.getPath(),
CompilationResultDestinationManager.FILETYPE_RESOURCE);
}
}
}
}
}
private void deleteClassFiles() {
if (deletedFiles == null) {
return;
}
for (File deletedFile : deletedFiles) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
addDependentsOf(deletedFile);
List<ClassFile> cfs = this.fullyQualifiedTypeNamesResultingFromCompilationUnit.get(deletedFile);
this.fullyQualifiedTypeNamesResultingFromCompilationUnit.remove(deletedFile);
if (cfs != null) {
for (ClassFile cf : cfs) {
deleteClassFile(cf);
}
}
}
}
private void deleteBinaryClassFiles() {
for (BinarySourceFile deletedFile : deletedBinaryFiles) {
List<ClassFile> cfs = this.inputClassFilesBySource.get(deletedFile.binSrc.getPath());
for (Iterator<ClassFile> iterator = cfs.iterator(); iterator.hasNext();) {
deleteClassFile(iterator.next());
}
this.inputClassFilesBySource.remove(deletedFile.binSrc.getPath());
}
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
private void deleteClassFile(ClassFile cf) {
classesFromName.remove(cf.fullyQualifiedTypeName);
weaver.deleteClassFile(cf.fullyQualifiedTypeName);
cf.deleteFromFileSystem(buildConfig);
}
private UnwovenClassFile createUnwovenClassFile(AjBuildConfig.BinarySourceFile bsf) {
UnwovenClassFile ucf = null;
try {
File outputDir = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
}
ucf = weaver.addClassFile(bsf.binSrc, bsf.fromInPathDirectory, outputDir);
} catch (IOException ex) {
IMessage msg = new Message("can't read class file " + bsf.binSrc.getPath(), new SourceLocation(bsf.binSrc, 0), false);
buildManager.handler.handleMessage(msg);
}
return ucf;
}
public void noteResult(InterimCompilationResult result) {
if (!maybeIncremental()) {
return;
}
File sourceFile = new File(result.fileName());
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
CompilationResult cr = result.result();
references.put(sourceFile, new ReferenceCollection(cr.qualifiedReferences, cr.simpleNameReferences,cr.rootReferences));
UnwovenClassFile[] unwovenClassFiles = result.unwovenClassFiles();
for (int i = 0; i < unwovenClassFiles.length; i++) {
File lastTimeRound = classesFromName.get(unwovenClassFiles[i].getClassName());
recordClassFile(unwovenClassFiles[i], lastTimeRound);
String name = unwovenClassFiles[i].getClassName();
if (lastTimeRound == null) {
deltaAddedClasses.add(name);
}
classesFromName.put(name, new File(unwovenClassFiles[i].getFilename()));
}
recordWhetherCompilationUnitDefinedAspect(sourceFile, cr);
deleteTypesThatWereInThisCompilationUnitLastTimeRoundButHaveBeenDeletedInThisIncrement(sourceFile, unwovenClassFiles);
recordFQNsResultingFromCompilationUnit(sourceFile, result);
}
public void noteNewResult(CompilationResult cr) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
/**
* @param sourceFile
* @param unwovenClassFiles
*/
private void deleteTypesThatWereInThisCompilationUnitLastTimeRoundButHaveBeenDeletedInThisIncrement(File sourceFile,
UnwovenClassFile[] unwovenClassFiles) {
List<ClassFile> classFiles = this.fullyQualifiedTypeNamesResultingFromCompilationUnit.get(sourceFile);
if (classFiles != null) {
for (int i = 0; i < unwovenClassFiles.length; i++) {
removeFromClassFilesIfPresent(unwovenClassFiles[i].getClassName(), classFiles);
}
for (ClassFile cf : classFiles) {
recordTypeChanged(cf.fullyQualifiedTypeName);
resolvedTypeStructuresFromLastBuild.remove(cf.fullyQualifiedTypeName);
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
deleteClassFile(cf);
}
}
}
private void removeFromClassFilesIfPresent(String className, List<ClassFile> classFiles) {
ClassFile victim = null;
for (ClassFile cf : classFiles) {
if (cf.fullyQualifiedTypeName.equals(className)) {
victim = cf;
break;
}
}
if (victim != null) {
classFiles.remove(victim);
}
}
/**
* Record the fully-qualified names of the types that were declared in the given source file.
*
* @param sourceFile, the compilation unit
* @param icr, the CompilationResult from compiling it
*/
private void recordFQNsResultingFromCompilationUnit(File sourceFile, InterimCompilationResult icr) {
List<ClassFile> classFiles = new ArrayList<ClassFile>();
UnwovenClassFile[] types = icr.unwovenClassFiles();
for (int i = 0; i < types.length; i++) {
classFiles.add(new ClassFile(types[i].getClassName(), new File(types[i].getFilename())));
}
this.fullyQualifiedTypeNamesResultingFromCompilationUnit.put(sourceFile, classFiles);
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
/**
* If this compilation unit defined an aspect, we need to know in case it is modified in a future increment.
*
* @param sourceFile
* @param cr
*/
private void recordWhetherCompilationUnitDefinedAspect(File sourceFile, CompilationResult cr) {
this.sourceFilesDefiningAspects.remove(sourceFile);
if (cr != null) {
Map compiledTypes = cr.compiledTypes;
if (compiledTypes != null) {
for (Iterator<char[]> iterator = compiledTypes.keySet().iterator(); iterator.hasNext();) {
char[] className = iterator.next();
String typeName = new String(className).replace('/', '.');
if (typeName.indexOf(BcelWeaver.SYNTHETIC_CLASS_POSTFIX) == -1) {
ResolvedType rt = world.resolve(typeName);
if (rt.isMissing()) {
} else if (rt.isAspect()) {
this.sourceFilesDefiningAspects.add(sourceFile);
break;
}
}
}
}
}
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
private void recordClassFile(UnwovenClassFile thisTime, File lastTime) {
if (simpleStrings == null) {
ResolvedType rType = world.resolve(thisTime.getClassName());
if (!rType.isMissing()) {
try {
ClassFileReader reader = new ClassFileReader(thisTime.getBytes(), null);
boolean isAspect = false;
if (rType instanceof ReferenceType && ((ReferenceType) rType).getDelegate() != null) {
isAspect = ((ReferenceType) rType).isAspect();
}
this.resolvedTypeStructuresFromLastBuild.put(thisTime.getClassName(), new CompactTypeStructureRepresentation(
reader, isAspect));
} catch (ClassFormatException cfe) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
throw new BCException("Unexpected problem processing class", cfe);
}
}
return;
}
CompactTypeStructureRepresentation existingStructure = this.resolvedTypeStructuresFromLastBuild
.get(thisTime.getClassName());
ResolvedType newResolvedType = world.resolve(thisTime.getClassName());
if (!newResolvedType.isMissing()) {
try {
ClassFileReader reader = new ClassFileReader(thisTime.getBytes(), null);
boolean isAspect = false;
if (newResolvedType instanceof ReferenceType && ((ReferenceType) newResolvedType).getDelegate() != null) {
isAspect = ((ReferenceType) newResolvedType).isAspect();
}
this.resolvedTypeStructuresFromLastBuild.put(thisTime.getClassName(), new CompactTypeStructureRepresentation(
reader, isAspect));
} catch (ClassFormatException cfe) {
try {
String s = System.getProperty("aspectj.debug377096","false");
if (s.equalsIgnoreCase("true")) {
String location = System.getProperty("java.io.tmpdir","/tmp");
String name = thisTime.getClassName();
File f = File.createTempFile(location+File.separator+name, ".class");
StringBuilder debug = new StringBuilder();
debug.append("Debug377096: Dumping class called "+name+" to "+f.getName()+" size:"+thisTime.getBytes().length);
DataOutputStream dos = new DataOutputStream(new FileOutputStream(f));
dos.write(thisTime.getBytes());
dos.close();
throw new BCException(debug.toString(), cfe);
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
} catch (Exception e) {
e.printStackTrace();
}
throw new BCException("Unexpected problem processing class", cfe);
}
}
if (lastTime == null) {
recordTypeChanged(thisTime.getClassName());
return;
}
if (newResolvedType.isMissing()) {
return;
}
world.ensureAdvancedConfigurationProcessed();
byte[] newBytes = thisTime.getBytes();
try {
ClassFileReader reader = new ClassFileReader(newBytes, lastTime.getAbsolutePath().toCharArray());
if (!(reader.isLocal() || reader.isAnonymous())) {
if (hasStructuralChanges(reader, existingStructure)) {
if (world.forDEBUG_structuralChangesCode) {
System.err.println("Detected a structural change in " + thisTime.getFilename());
}
structuralChangesSinceLastFullBuild.put(thisTime.getFilename(), new Long(currentBuildTime));
recordTypeChanged(new String(reader.getName()).replace('/', '.'));
}
}
} catch (ClassFormatException e) {
recordTypeChanged(thisTime.getClassName());
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
}
/**
* Compare the class structure of the new intermediate (unwoven) class with the existingResolvedType of the same class that we
* have in the world, looking for any structural differences (and ignoring aj members resulting from weaving....)
*
* Some notes from Andy... lot of problems here, which I've eventually resolved by building the compactstructure based on a
* classfilereader, rather than on a ResolvedType. There are accessors for inner types and funky fields that the compiler
* creates to support the language - for non-static inner types it also mangles ctors to be prefixed with an instance of the
* surrounding type.
*
* @param reader
* @param existingType
* @return
*/
private boolean hasStructuralChanges(ClassFileReader reader, CompactTypeStructureRepresentation existingType) {
if (existingType == null) {
return true;
}
if (!modifiersEqual(reader.getModifiers(), existingType.modifiers)) {
return true;
}
if (!CharOperation.equals(reader.getGenericSignature(), existingType.genericSignature)) {
return true;
}
if (!CharOperation.equals(reader.getSuperclassName(), existingType.superclassName)) {
return true;
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
IBinaryAnnotation[] newAnnos = reader.getAnnotations();
if (newAnnos == null || newAnnos.length == 0) {
if (existingType.annotations != null && existingType.annotations.length != 0) {
return true;
}
} else {
IBinaryAnnotation[] existingAnnos = existingType.annotations;
if (existingAnnos == null || existingAnnos.length != newAnnos.length) {
return true;
}
for (int i = 0; i < newAnnos.length; i++) {
if (!CharOperation.equals(newAnnos[i].getTypeName(), existingAnnos[i].getTypeName())) {
return true;
}
}
}
char[][] existingIfs = existingType.interfaces;
char[][] newIfsAsChars = reader.getInterfaceNames();
if (newIfsAsChars == null) {
newIfsAsChars = EMPTY_CHAR_ARRAY;
}
if (existingIfs == null) {
existingIfs = EMPTY_CHAR_ARRAY;
}
if (existingIfs.length != newIfsAsChars.length) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return true;
}
new_interface_loop: for (int i = 0; i < newIfsAsChars.length; i++) {
for (int j = 0; j < existingIfs.length; j++) {
if (CharOperation.equals(existingIfs[j], newIfsAsChars[i])) {
continue new_interface_loop;
}
}
return true;
}
IBinaryField[] newFields = reader.getFields();
if (newFields == null) {
newFields = CompactTypeStructureRepresentation.NoField;
}
IBinaryField[] existingFs = existingType.binFields;
if (newFields.length != existingFs.length) {
return true;
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
new_field_loop: for (int i = 0; i < newFields.length; i++) {
IBinaryField field = newFields[i];
char[] fieldName = field.getName();
for (int j = 0; j < existingFs.length; j++) {
if (CharOperation.equals(existingFs[j].getName(), fieldName)) {
IBinaryField existing = existingFs[j];
if (!modifiersEqual(field.getModifiers(), existing.getModifiers())) {
return true;
}
if (!CharOperation.equals(existing.getTypeName(), field.getTypeName())) {
return true;
}
char[] existingGSig = existing.getGenericSignature();
char[] fieldGSig = field.getGenericSignature();
if ((existingGSig == null && fieldGSig != null) || (existingGSig != null && fieldGSig == null)) {
return true;
}
if (existingGSig != null) {
if (!CharOperation.equals(existingGSig, fieldGSig)) {
return true;
}
}
continue new_field_loop;
}
}
return true;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
IBinaryMethod[] newMethods = reader.getMethods();
if (newMethods == null) {
newMethods = CompactTypeStructureRepresentation.NoMethod;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
IBinaryMethod[] existingMs = existingType.binMethods;
if (newMethods.length != existingMs.length) {
return true;
}
new_method_loop: for (int i = 0; i < newMethods.length; i++) {
IBinaryMethod method = newMethods[i];
char[] methodName = method.getSelector();
for (int j = 0; j < existingMs.length; j++) {
if (CharOperation.equals(existingMs[j].getSelector(), methodName)) {
if (!CharOperation.equals(method.getMethodDescriptor(), existingMs[j].getMethodDescriptor())) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
continue;
} else {
IBinaryMethod existing = existingMs[j];
if (!modifiersEqual(method.getModifiers(), existing.getModifiers())) {
return true;
}
if (exceptionClausesDiffer(existing, method)) {
return true;
}
char[] existingGSig = existing.getGenericSignature();
char[] methodGSig = method.getGenericSignature();
if ((existingGSig == null && methodGSig != null) || (existingGSig != null && methodGSig == null)) {
return true;
}
if (existingGSig != null) {
if (!CharOperation.equals(existingGSig, methodGSig)) {
return true;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
}
continue new_method_loop;
}
}
}
return true;
}
IBinaryNestedType[] binaryNestedTypes = reader.getMemberTypes();
IBinaryNestedType[] existingBinaryNestedTypes = existingType.getMemberTypes();
if ((binaryNestedTypes == null && existingBinaryNestedTypes != null)
|| (binaryNestedTypes != null && existingBinaryNestedTypes == null)) {
return true;
}
if (binaryNestedTypes != null) {
int bnLength = binaryNestedTypes.length;
if (existingBinaryNestedTypes.length != bnLength) {
return true;
}
for (int m = 0; m < bnLength; m++) {
IBinaryNestedType bnt = binaryNestedTypes[m];
IBinaryNestedType existingBnt = existingBinaryNestedTypes[m];
if (!CharOperation.equals(bnt.getName(), existingBnt.getName())) {
return true;
}
}
}
return false;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
/**
* For two methods, discover if there has been a change in the exception types specified.
*
* @return true if the exception types have changed
*/
private boolean exceptionClausesDiffer(IBinaryMethod lastMethod, IBinaryMethod newMethod) {
char[][] previousExceptionTypeNames = lastMethod.getExceptionTypeNames();
char[][] newExceptionTypeNames = newMethod.getExceptionTypeNames();
int pLength = previousExceptionTypeNames.length;
int nLength = newExceptionTypeNames.length;
if (pLength != nLength) {
return true;
}
if (pLength == 0) {
return false;
}
for (int i = 0; i < pLength; i++) {
if (!CharOperation.equals(previousExceptionTypeNames[i], newExceptionTypeNames[i])) {
return true;
}
}
return false;
}
private boolean modifiersEqual(int eclipseModifiers, int resolvedTypeModifiers) {
resolvedTypeModifiers = resolvedTypeModifiers & ExtraCompilerModifiers.AccJustFlag;
eclipseModifiers = eclipseModifiers & ExtraCompilerModifiers.AccJustFlag;
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return (eclipseModifiers == resolvedTypeModifiers);
}
private String stringifySet(Set<?> l) {
StringBuffer sb = new StringBuffer();
sb.append("{");
for (Iterator<?> iter = l.iterator(); iter.hasNext();) {
Object el = iter.next();
sb.append(el);
if (iter.hasNext()) {
sb.append(",");
}
}
sb.append("}");
return sb.toString();
}
protected void addAffectedSourceFiles(Set<File> addTo, Set<File> lastTimeSources) {
if (qualifiedStrings.elementSize == 0 && simpleStrings.elementSize == 0) {
return;
}
if (listenerDefined()) {
getListener().recordDecision(
"Examining whether any other files now need compilation based on just compiling: '"
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
+ stringifySet(lastTimeSources) + "'");
}
char[][][] qualifiedNames = ReferenceCollection.internQualifiedNames(qualifiedStrings);
if (qualifiedNames.length < qualifiedStrings.elementSize) {
qualifiedNames = null;
}
char[][] simpleNames = ReferenceCollection.internSimpleNames(simpleStrings);
if (simpleNames.length < simpleStrings.elementSize) {
simpleNames = null;
}
for (Iterator<Map.Entry<File, ReferenceCollection>> i = references.entrySet().iterator(); i.hasNext();) {
Map.Entry<File, ReferenceCollection> entry = i.next();
ReferenceCollection refs = entry.getValue();
if (refs != null && refs.includes(qualifiedNames, simpleNames)) {
File file = entry.getKey();
if (file.exists()) {
if (!lastTimeSources.contains(file)) {
if (listenerDefined()) {
getListener().recordDecision("Need to recompile '" + file.getName().toString() + "'");
}
addTo.add(file);
}
}
}
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
if (addTo.size() > 0) {
addTo.addAll(lastTimeSources);
}
qualifiedStrings.clear();
simpleStrings.clear();
}
/**
* Record that a particular type has been touched during a compilation run. Information is used to ensure any types depending
* upon this one are also recompiled.
*
* @param typename (possibly qualified) type name
*/
protected void recordTypeChanged(String typename) {
int lastDot = typename.lastIndexOf('.');
String typeName;
if (lastDot != -1) {
String packageName = typename.substring(0, lastDot).replace('.', '/');
qualifiedStrings.add(packageName);
typeName = typename.substring(lastDot + 1);
} else {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
qualifiedStrings.add("");
typeName = typename;
}
int memberIndex = typeName.indexOf('$');
if (memberIndex > 0) {
typeName = typeName.substring(0, memberIndex);
}
simpleStrings.add(typeName);
}
/**
* Record some additional dependencies between types. When any of the types specified in fullyQualifiedTypeNames changes, we
* need to recompile the file named in the CompilationResult. This method patches that information into the existing data
* structures.
*/
public boolean recordDependencies(File file, String[] typeNameDependencies) {
try {
File sourceFile = new File(new String(file.getCanonicalPath()));
ReferenceCollection existingCollection = references.get(sourceFile);
if (existingCollection != null) {
existingCollection.addDependencies(typeNameDependencies);
return true;
} else {
ReferenceCollection rc = new ReferenceCollection(null, null, null);
rc.addDependencies(typeNameDependencies);
references.put(sourceFile, rc);
return true;
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return false;
}
protected void addDependentsOf(File sourceFile) {
List<ClassFile> cfs = this.fullyQualifiedTypeNamesResultingFromCompilationUnit.get(sourceFile);
if (cfs != null) {
for (ClassFile cf : cfs) {
recordTypeChanged(cf.fullyQualifiedTypeName);
}
}
}
public void setStructureModel(AsmManager structureModel) {
this.structureModel = structureModel;
}
public AsmManager getStructureModel() {
return structureModel;
}
public void setWeaver(BcelWeaver bw) {
weaver = bw;
}
public BcelWeaver getWeaver() {
return weaver;
}
public void setWorld(BcelWorld bw) {
world = bw;
world.addTypeDelegateResolver(this);
}
public BcelWorld getBcelWorld() {
return world;
}
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
public int getNumberOfStructuralChangesSinceLastFullBuild() {
return structuralChangesSinceLastFullBuild.size();
}
public long getLastBuildTime() {
return lastSuccessfulBuildTime;
}
public long getLastFullBuildTime() {
return lastSuccessfulFullBuildTime;
}
/**
* @return Returns the buildConfig.
*/
public AjBuildConfig getBuildConfig() {
return this.buildConfig;
}
public void clearBinarySourceFiles() {
this.binarySourceFiles = new HashMap<String, List<UnwovenClassFile>>();
}
public void recordBinarySource(String fromPathName, List<UnwovenClassFile> unwovenClassFiles) {
this.binarySourceFiles.put(fromPathName, unwovenClassFiles);
if (this.maybeIncremental()) {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
List<ClassFile> simpleClassFiles = new LinkedList<ClassFile>();
for (UnwovenClassFile ucf : unwovenClassFiles) {
ClassFile cf = getClassFileFor(ucf);
simpleClassFiles.add(cf);
}
this.inputClassFilesBySource.put(fromPathName, simpleClassFiles);
}
}
/**
* @param ucf
* @return
*/
private ClassFile getClassFileFor(UnwovenClassFile ucf) {
return new ClassFile(ucf.getClassName(), new File(ucf.getFilename()));
}
public Map<String, List<UnwovenClassFile>> getBinarySourceMap() {
return this.binarySourceFiles;
}
public Map<String, File> getClassNameToFileMap() {
return this.classesFromName;
}
public boolean hasResource(String resourceName) {
return this.resources.keySet().contains(resourceName);
}
public void recordResource(String resourceName, File resourceSourceLocation) {
this.resources.put(resourceName, resourceSourceLocation);
}
/**
* @return Returns the addedFiles.
*/
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
public Set<File> getAddedFiles() {
return this.addedFiles;
}
/**
* @return Returns the deletedFiles.
*/
public Set<File> getDeletedFiles() {
return this.deletedFiles;
}
public void forceBatchBuildNextTimeAround() {
this.batchBuildRequiredThisTime = true;
}
public boolean requiresFullBatchBuild() {
return this.batchBuildRequiredThisTime;
}
private static class ClassFile {
public String fullyQualifiedTypeName;
public File locationOnDisk;
public ClassFile(String fqn, File location) {
this.fullyQualifiedTypeName = fqn;
this.locationOnDisk = location;
}
public String toString() {
StringBuilder s = new StringBuilder();
s.append("ClassFile(type=").append(fullyQualifiedTypeName).append(",location=").append(locationOnDisk).append(")");
return s.toString();
}
public void deleteFromFileSystem(AjBuildConfig buildConfig) {
String namePrefix = locationOnDisk.getName();
namePrefix = namePrefix.substring(0, namePrefix.lastIndexOf('.'));
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
final String targetPrefix = namePrefix + BcelWeaver.CLOSURE_CLASS_PREFIX;
File dir = locationOnDisk.getParentFile();
if (dir != null) {
File[] weaverGenerated = dir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.startsWith(targetPrefix);
}
});
if (weaverGenerated != null) {
for (int i = 0; i < weaverGenerated.length; i++) {
weaverGenerated[i].delete();
if (buildConfig != null && buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileRemove(weaverGenerated[i].getPath(),
CompilationResultDestinationManager.FILETYPE_CLASS);
}
}
}
}
locationOnDisk.delete();
if (buildConfig != null && buildConfig.getCompilationResultDestinationManager() != null) {
buildConfig.getCompilationResultDestinationManager().reportFileRemove(locationOnDisk.getPath(),
CompilationResultDestinationManager.FILETYPE_CLASS);
}
}
}
public void wipeAllKnowledge() {
buildManager.state = null;
}
public Map<String, char[]> getAspectNamesToFileNameMap() {
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
return aspectsFromFileNames;
}
public void initializeAspectNamesToFileNameMap() {
this.aspectsFromFileNames = new HashMap<String, char[]>();
}
public boolean listenerDefined() {
return stateListener != null;
}
public IStateListener getListener() {
return stateListener;
}
public IBinaryType checkPreviousBuild(String name) {
return resolvedTypeStructuresFromLastBuild.get(name);
}
public AjBuildManager getAjBuildManager() {
return buildManager;
}
public INameEnvironment getNameEnvironment() {
return this.nameEnvironment;
}
public void setNameEnvironment(INameEnvironment nameEnvironment) {
this.nameEnvironment = nameEnvironment;
}
/**
* Record an aspect that came in on the aspect path. When a .class file changes on the aspect path we can then recognize it as
* an aspect and know to do more than just a tiny incremental build. <br>
* TODO but this doesn't allow for a new aspect created on the aspectpath?
*
* @param aspectFile path to the file, eg. c:/temp/foo/Fred.class
|
407,017 |
Bug 407017 Stack trace being printed, but want to mute it
|
In org.aspectj.ajdt.internal.core.builder.AjState.getDelegate(ReferenceType), there is a call to printStackTrace(). On the AJDT build server, this exception is being printed and causing some noise. Can you replace that call with a call to the IMessageHandler for the build?
|
resolved fixed
|
e6cb508
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-06-28T23:30:34Z | 2013-05-01T20:26:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java
|
*/
public void recordAspectClassFile(String aspectFile) {
aspectClassFiles.add(aspectFile);
}
public void write(CompressingDataOutputStream dos) throws IOException {
weaver.write(dos);
}
/**
* See if we can create a delegate from a CompactTypeStructure - TODO better comment
*/
public ReferenceTypeDelegate getDelegate(ReferenceType referenceType) {
File f = classesFromName.get(referenceType.getName());
if (f == null) {
return null;
}
try {
ClassParser parser = new ClassParser(f.toString());
return world.buildBcelDelegate(referenceType, parser.parse(), true, false);
} catch (IOException e) {
System.err.println("Failed to recover " + referenceType);
e.printStackTrace();
}
return null;
}
}
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
tests/src/org/aspectj/systemtest/AllTests17.java
|
/*
* Created on 19-01-2005
*/
package org.aspectj.systemtest;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.aspectj.systemtest.ajc170.AllTestsAspectJ170;
import org.aspectj.systemtest.ajc171.AllTestsAspectJ171;
import org.aspectj.systemtest.ajc172.AllTestsAspectJ172;
import org.aspectj.systemtest.ajc173.AllTestsAspectJ173;
public class AllTests17 {
public static Test suite() {
TestSuite suite = new TestSuite("AspectJ System Test Suite - 1.7");
suite.addTest(AllTestsAspectJ173.suite());
suite.addTest(AllTestsAspectJ172.suite());
suite.addTest(AllTestsAspectJ171.suite());
suite.addTest(AllTestsAspectJ170.suite());
suite.addTest(AllTests16.suite());
suite.addTest(AllTests15.suite());
return suite;
}
}
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.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
* Alexandre Vasseur @AspectJ ITDs
* ******************************************************************/
package org.aspectj.weaver.bcel;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.aspectj.apache.bcel.Constants;
import org.aspectj.apache.bcel.classfile.ClassFormatException;
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
import org.aspectj.apache.bcel.classfile.ConstantPool;
import org.aspectj.apache.bcel.classfile.Signature;
import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen;
import org.aspectj.apache.bcel.generic.FieldGen;
import org.aspectj.apache.bcel.generic.InstructionBranch;
import org.aspectj.apache.bcel.generic.InstructionConstants;
import org.aspectj.apache.bcel.generic.InstructionFactory;
import org.aspectj.apache.bcel.generic.InstructionHandle;
import org.aspectj.apache.bcel.generic.InstructionList;
import org.aspectj.apache.bcel.generic.InvokeInstruction;
import org.aspectj.apache.bcel.generic.Type;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IProgramElement;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.WeaveMessage;
import org.aspectj.bridge.context.CompilationAndWeavingContext;
import org.aspectj.bridge.context.ContextToken;
import org.aspectj.weaver.AjcMemberMaker;
import org.aspectj.weaver.AnnotationAJ;
import org.aspectj.weaver.AnnotationOnTypeMunger;
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.ConcreteTypeMunger;
import org.aspectj.weaver.Member;
import org.aspectj.weaver.MemberUtils;
import org.aspectj.weaver.MethodDelegateTypeMunger;
import org.aspectj.weaver.NameMangler;
import org.aspectj.weaver.NewConstructorTypeMunger;
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
import org.aspectj.weaver.NewFieldTypeMunger;
import org.aspectj.weaver.NewMemberClassTypeMunger;
import org.aspectj.weaver.NewMethodTypeMunger;
import org.aspectj.weaver.NewParentTypeMunger;
import org.aspectj.weaver.PerObjectInterfaceTypeMunger;
import org.aspectj.weaver.PrivilegedAccessMunger;
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.TypeVariableReference;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.WeaverStateInfo;
import org.aspectj.weaver.World;
import org.aspectj.weaver.model.AsmRelationshipProvider;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.Pointcut;
public class BcelTypeMunger extends ConcreteTypeMunger {
public BcelTypeMunger(ResolvedTypeMunger munger, ResolvedType aspectType) {
super(munger, aspectType);
}
@Override
public String toString() {
return "(BcelTypeMunger " + getMunger() + ")";
}
@Override
public boolean shouldOverwrite() {
return false;
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
}
public boolean munge(BcelClassWeaver weaver) {
ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.MUNGING_WITH, this);
boolean changed = false;
boolean worthReporting = true;
if (weaver.getWorld().isOverWeaving()) {
WeaverStateInfo typeWeaverState = weaver.getLazyClassGen().getType().getWeaverState();
if (typeWeaverState != null && typeWeaverState.isAspectAlreadyApplied(getAspectType())) {
return false;
}
}
if (munger.getKind() == ResolvedTypeMunger.Field) {
changed = mungeNewField(weaver, (NewFieldTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.Method) {
changed = mungeNewMethod(weaver, (NewMethodTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.InnerClass) {
changed = mungeNewMemberType(weaver, (NewMemberClassTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.MethodDelegate2) {
changed = mungeMethodDelegate(weaver, (MethodDelegateTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.FieldHost) {
changed = mungeFieldHost(weaver, (MethodDelegateTypeMunger.FieldHostTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.PerObjectInterface) {
changed = mungePerObjectInterface(weaver, (PerObjectInterfaceTypeMunger) munger);
worthReporting = false;
} else if (munger.getKind() == ResolvedTypeMunger.PerTypeWithinInterface) {
changed = mungePerTypeWithinTransformer(weaver);
worthReporting = false;
} else if (munger.getKind() == ResolvedTypeMunger.PrivilegedAccess) {
changed = mungePrivilegedAccess(weaver, (PrivilegedAccessMunger) munger);
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
worthReporting = false;
} else if (munger.getKind() == ResolvedTypeMunger.Constructor) {
changed = mungeNewConstructor(weaver, (NewConstructorTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.Parent) {
changed = mungeNewParent(weaver, (NewParentTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.AnnotationOnType) {
changed = mungeNewAnnotationOnType(weaver, (AnnotationOnTypeMunger) munger);
worthReporting = false;
} else {
throw new RuntimeException("unimplemented");
}
if (changed && munger.changesPublicSignature()) {
WeaverStateInfo info = weaver.getLazyClassGen().getOrCreateWeaverStateInfo(weaver.getReweavableMode());
info.addConcreteMunger(this);
}
if (changed && worthReporting) {
ResolvedType declaringAspect = null;
AsmManager model = ((BcelWorld) getWorld()).getModelAsAsmManager();
if (model != null) {
if (munger instanceof NewParentTypeMunger) {
NewParentTypeMunger nptMunger = (NewParentTypeMunger) munger;
declaringAspect = nptMunger.getDeclaringType();
if (declaringAspect.isParameterizedOrGenericType()) {
declaringAspect = declaringAspect.getRawType();
}
ResolvedType thisAspect = getAspectType();
AsmRelationshipProvider.addRelationship(model, weaver.getLazyClassGen().getType(), munger, thisAspect);
if (!thisAspect.equals(declaringAspect)) {
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
ResolvedType target = weaver.getLazyClassGen().getType();
ResolvedType newParent = nptMunger.getNewParent();
IProgramElement thisAspectNode = model.getHierarchy().findElementForType(thisAspect.getPackageName(),
thisAspect.getClassName());
Map<String, List<String>> declareParentsMap = thisAspectNode.getDeclareParentsMap();
if (declareParentsMap == null) {
declareParentsMap = new HashMap<String, List<String>>();
thisAspectNode.setDeclareParentsMap(declareParentsMap);
}
String tname = target.getName();
String pname = newParent.getName();
List<String> newparents = declareParentsMap.get(tname);
if (newparents == null) {
newparents = new ArrayList<String>();
declareParentsMap.put(tname, newparents);
}
newparents.add(pname);
AsmRelationshipProvider.addRelationship(model, weaver.getLazyClassGen().getType(), munger, declaringAspect);
}
} else {
declaringAspect = getAspectType();
AsmRelationshipProvider.addRelationship(model, weaver.getLazyClassGen().getType(), munger, declaringAspect);
}
}
}
if (changed && worthReporting && munger != null && !weaver.getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) {
String tName = weaver.getLazyClassGen().getType().getSourceLocation().getSourceFile().getName();
if (tName.indexOf("no debug info available") != -1) {
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
tName = "no debug info available";
} else {
tName = getShortname(weaver.getLazyClassGen().getType().getSourceLocation().getSourceFile().getPath());
}
String fName = getShortname(getAspectType().getSourceLocation().getSourceFile().getPath());
if (munger.getKind().equals(ResolvedTypeMunger.Parent)) {
NewParentTypeMunger parentTM = (NewParentTypeMunger) munger;
if (parentTM.isMixin()) {
weaver.getWorld()
.getMessageHandler()
.handleMessage(
WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_MIXIN, new String[] {
parentTM.getNewParent().getName(), fName, weaver.getLazyClassGen().getType().getName(),
tName }, weaver.getLazyClassGen().getClassName(), getAspectType().getName()));
} else {
if (parentTM.getNewParent().isInterface()) {
weaver.getWorld()
.getMessageHandler()
.handleMessage(
WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_DECLAREPARENTSIMPLEMENTS,
new String[] { weaver.getLazyClassGen().getType().getName(), tName,
parentTM.getNewParent().getName(), fName }, weaver.getLazyClassGen()
.getClassName(), getAspectType().getName()));
} else {
weaver.getWorld()
.getMessageHandler()
.handleMessage(
WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_DECLAREPARENTSEXTENDS,
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
new String[] { weaver.getLazyClassGen().getType().getName(), tName,
parentTM.getNewParent().getName(), fName }));
}
}
} else if (munger.getKind().equals(ResolvedTypeMunger.FieldHost)) {
} else {
ResolvedMember declaredSig = munger.getSignature();
String fromString = fName + ":'" + declaredSig + "'";
String kindString = munger.getKind().toString().toLowerCase();
if (kindString.equals("innerclass")) {
kindString = "member class";
fromString = fName;
}
weaver.getWorld()
.getMessageHandler()
.handleMessage(
WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ITD, new String[] {
weaver.getLazyClassGen().getType().getName(), tName, kindString, getAspectType().getName(),
fromString }, weaver.getLazyClassGen().getClassName(), getAspectType().getName()));
}
}
CompilationAndWeavingContext.leavingPhase(tok);
return changed;
}
private String getShortname(String path) {
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
int takefrom = path.lastIndexOf('/');
if (takefrom == -1) {
takefrom = path.lastIndexOf('\\');
}
return path.substring(takefrom + 1);
}
private boolean mungeNewAnnotationOnType(BcelClassWeaver weaver, AnnotationOnTypeMunger munger) {
try {
BcelAnnotation anno = (BcelAnnotation) munger.getNewAnnotation();
weaver.getLazyClassGen().addAnnotation(anno.getBcelAnnotation());
} catch (ClassCastException cce) {
throw new IllegalStateException("DiagnosticsFor318237: The typemunger "+munger+" contains an annotation of type "+
munger.getNewAnnotation().getClass().getName()+" when it should be a BcelAnnotation",cce);
}
return true;
}
/**
* For a long time, AspectJ did not allow binary weaving of declare parents. This restriction is now lifted but could do with
* more testing!
*/
private boolean mungeNewParent(BcelClassWeaver weaver, NewParentTypeMunger typeTransformer) {
LazyClassGen newParentTarget = weaver.getLazyClassGen();
ResolvedType newParent = typeTransformer.getNewParent();
boolean performChange = true;
performChange = enforceDecpRule1_abstractMethodsImplemented(weaver, typeTransformer.getSourceLocation(), newParentTarget,
newParent);
performChange = enforceDecpRule2_cantExtendFinalClass(weaver, typeTransformer.getSourceLocation(), newParentTarget,
newParent) && performChange;
List<ResolvedMember> methods = newParent.getMethodsWithoutIterator(false, true, false);
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
for (ResolvedMember method : methods) {
if (!method.getName().equals("<init>")) {
LazyMethodGen subMethod = findMatchingMethod(newParentTarget, method);
if (subMethod != null && !subMethod.isBridgeMethod()) {
if (!(subMethod.isSynthetic() && method.isSynthetic())) {
if (!(subMethod.isStatic() && subMethod.getName().startsWith("access$"))) {
performChange = enforceDecpRule3_visibilityChanges(weaver, newParent, method, subMethod)
&& performChange;
performChange = enforceDecpRule4_compatibleReturnTypes(weaver, method, subMethod) && performChange;
performChange = enforceDecpRule5_cantChangeFromStaticToNonstatic(weaver,
typeTransformer.getSourceLocation(), method, subMethod)
&& performChange;
}
}
}
}
}
if (!performChange) {
return false;
}
if (newParent.isClass()) {
if (!attemptToModifySuperCalls(weaver, newParentTarget, newParent)) {
return false;
}
newParentTarget.setSuperClass(newParent);
} else {
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
newParentTarget.addInterface(newParent, getSourceLocation());
}
return true;
}
/**
* Rule 1: For the declare parents to be allowed, the target type must override and implement inherited abstract methods (if the
* type is not declared abstract)
*/
private boolean enforceDecpRule1_abstractMethodsImplemented(BcelClassWeaver weaver, ISourceLocation mungerLoc,
LazyClassGen newParentTarget, ResolvedType newParent) {
if (newParentTarget.isAbstract() || newParentTarget.isInterface()) {
return true;
}
boolean ruleCheckingSucceeded = true;
List<ResolvedMember> newParentMethods = newParent.getMethodsWithoutIterator(false, true, false);
for (ResolvedMember newParentMethod : newParentMethods) {
String newParentMethodName = newParentMethod.getName();
if (newParentMethod.isAbstract() && !newParentMethodName.startsWith("ajc$interField")) {
ResolvedMember discoveredImpl = null;
List<ResolvedMember> targetMethods = newParentTarget.getType().getMethodsWithoutIterator(false, true, false);
for (ResolvedMember targetMethod : targetMethods) {
if (!targetMethod.isAbstract() && targetMethod.getName().equals(newParentMethodName)) {
String newParentMethodSig = newParentMethod.getParameterSignature();
String targetMethodSignature = targetMethod.getParameterSignature();
if (targetMethodSignature.equals(newParentMethodSig)) {
discoveredImpl = targetMethod;
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
} else {
if (targetMethod.hasBackingGenericMember()
&& targetMethod.getBackingGenericMember().getParameterSignature().equals(newParentMethodSig)) {
discoveredImpl = targetMethod;
} else if (newParentMethod.hasBackingGenericMember()) {
if (newParentMethod.getBackingGenericMember().getParameterSignature().equals(targetMethodSignature)) {
discoveredImpl = targetMethod;
}
}
}
if (discoveredImpl != null) {
break;
}
}
}
if (discoveredImpl == null) {
boolean satisfiedByITD = false;
for (ConcreteTypeMunger m : newParentTarget.getType().getInterTypeMungersIncludingSupers()) {
if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.Method) {
ResolvedMember sig = m.getSignature();
if (!Modifier.isAbstract(sig.getModifiers())) {
if (m.isTargetTypeParameterized()) {
ResolvedType genericOnType = getWorld().resolve(sig.getDeclaringType()).getGenericType();
m = m.parameterizedFor(newParent.discoverActualOccurrenceOfTypeInHierarchy(genericOnType));
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
sig = m.getSignature();
}
if (ResolvedType.matches(
AjcMemberMaker.interMethod(sig, m.getAspectType(),
sig.getDeclaringType().resolve(weaver.getWorld()).isInterface()), newParentMethod)) {
satisfiedByITD = true;
}
}
} else if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate2) {
satisfiedByITD = true;
}
}
if (!satisfiedByITD) {
error(weaver,
"The type " + newParentTarget.getName() + " must implement the inherited abstract method "
+ newParentMethod.getDeclaringType() + "." + newParentMethodName
+ newParentMethod.getParameterSignature(), newParentTarget.getType().getSourceLocation(),
new ISourceLocation[] { newParentMethod.getSourceLocation(), mungerLoc });
ruleCheckingSucceeded = false;
}
}
}
}
return ruleCheckingSucceeded;
}
/**
* Rule 2. Can't extend final types
*/
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
private boolean enforceDecpRule2_cantExtendFinalClass(BcelClassWeaver weaver, ISourceLocation transformerLoc,
LazyClassGen targetType, ResolvedType newParent) {
if (newParent.isFinal()) {
error(weaver, "Cannot make type " + targetType.getName() + " extend final class " + newParent.getName(), targetType
.getType().getSourceLocation(), new ISourceLocation[] { transformerLoc });
return false;
}
return true;
}
/**
* Rule 3. Can't narrow visibility of methods when overriding
*/
private boolean enforceDecpRule3_visibilityChanges(BcelClassWeaver weaver, ResolvedType newParent, ResolvedMember superMethod,
LazyMethodGen subMethod) {
boolean cont = true;
if (Modifier.isPublic(superMethod.getModifiers())) {
if (subMethod.isProtected() || subMethod.isDefault() || subMethod.isPrivate()) {
weaver.getWorld()
.getMessageHandler()
.handleMessage(
MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod
+ "' from " + newParent.getName(), superMethod.getSourceLocation()));
cont = false;
}
} else if (Modifier.isProtected(superMethod.getModifiers())) {
if (subMethod.isDefault() || subMethod.isPrivate()) {
weaver.getWorld()
.getMessageHandler()
.handleMessage(
MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
+ "' from " + newParent.getName(), superMethod.getSourceLocation()));
cont = false;
}
} else if (superMethod.isDefault()) {
if (subMethod.isPrivate()) {
weaver.getWorld()
.getMessageHandler()
.handleMessage(
MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod
+ "' from " + newParent.getName(), superMethod.getSourceLocation()));
cont = false;
}
}
return cont;
}
/**
* Rule 4. Can't have incompatible return types
*/
private boolean enforceDecpRule4_compatibleReturnTypes(BcelClassWeaver weaver, ResolvedMember superMethod,
LazyMethodGen subMethod) {
boolean cont = true;
String superReturnTypeSig = superMethod.getGenericReturnType().getSignature();
String subReturnTypeSig = subMethod.getGenericReturnTypeSignature();
superReturnTypeSig = superReturnTypeSig.replace('.', '/');
subReturnTypeSig = subReturnTypeSig.replace('.', '/');
if (!superReturnTypeSig.equals(subReturnTypeSig)) {
ResolvedType subType = weaver.getWorld().resolve(subMethod.getReturnType());
ResolvedType superType = weaver.getWorld().resolve(superMethod.getReturnType());
if (!superType.isAssignableFrom(subType)) {
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
weaver.getWorld()
.getMessageHandler()
.handleMessage(
MessageUtil.error("The return type is incompatible with " + superMethod.getDeclaringType() + "."
+ superMethod.getName() + superMethod.getParameterSignature(),
subMethod.getSourceLocation()));
cont = false;
}
}
return cont;
}
/**
* Rule5. Method overrides can't change the staticality (word?) - you can't override and make an instance method static or
* override and make a static method an instance method.
*/
private boolean enforceDecpRule5_cantChangeFromStaticToNonstatic(BcelClassWeaver weaver, ISourceLocation mungerLoc,
ResolvedMember superMethod, LazyMethodGen subMethod) {
boolean superMethodStatic = Modifier.isStatic(superMethod.getModifiers());
if (superMethodStatic && !subMethod.isStatic()) {
error(weaver, "This instance method " + subMethod.getName() + subMethod.getParameterSignature()
+ " cannot override the static method from " + superMethod.getDeclaringType().getName(),
subMethod.getSourceLocation(), new ISourceLocation[] { mungerLoc });
return false;
} else if (!superMethodStatic && subMethod.isStatic()) {
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
error(weaver, "The static method " + subMethod.getName() + subMethod.getParameterSignature()
+ " cannot hide the instance method from " + superMethod.getDeclaringType().getName(),
subMethod.getSourceLocation(), new ISourceLocation[] { mungerLoc });
return false;
}
return true;
}
public void error(BcelClassWeaver weaver, String text, ISourceLocation primaryLoc, ISourceLocation[] extraLocs) {
IMessage msg = new Message(text, primaryLoc, true, extraLocs);
weaver.getWorld().getMessageHandler().handleMessage(msg);
}
/**
* Search the specified type for a particular method - do not use the return value in the comparison as it is not considered for
* overriding.
*/
private LazyMethodGen findMatchingMethod(LazyClassGen type, ResolvedMember searchMethod) {
String searchName = searchMethod.getName();
String searchSig = searchMethod.getParameterSignature();
for (LazyMethodGen method : type.getMethodGens()) {
if (method.getName().equals(searchName) && method.getParameterSignature().equals(searchSig)) {
return method;
}
}
return null;
}
/**
* The main part of implementing declare parents extends. Modify super ctor calls to target the new type.
*/
public boolean attemptToModifySuperCalls(BcelClassWeaver weaver, LazyClassGen newParentTarget, ResolvedType newParent) {
ResolvedType currentParentType = newParentTarget.getSuperClass();
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (currentParentType.getGenericType() != null) {
currentParentType = currentParentType.getGenericType();
}
String currentParent = currentParentType.getName();
if (newParent.getGenericType() != null) {
newParent = newParent.getGenericType();
}
List<LazyMethodGen> mgs = newParentTarget.getMethodGens();
for (LazyMethodGen aMethod : mgs) {
if (LazyMethodGen.isConstructor(aMethod)) {
InstructionList insList = aMethod.getBody();
InstructionHandle handle = insList.getStart();
while (handle != null) {
if (handle.getInstruction().opcode == Constants.INVOKESPECIAL) {
ConstantPool cpg = newParentTarget.getConstantPool();
InvokeInstruction invokeSpecial = (InvokeInstruction) handle.getInstruction();
if (invokeSpecial.getClassName(cpg).equals(currentParent)
&& invokeSpecial.getMethodName(cpg).equals("<init>")) {
ResolvedMember newCtor = getConstructorWithSignature(newParent, invokeSpecial.getSignature(cpg));
if (newCtor == null) {
boolean satisfiedByITDC = false;
for (Iterator<ConcreteTypeMunger> ii = newParentTarget.getType()
.getInterTypeMungersIncludingSupers().iterator(); ii.hasNext() && !satisfiedByITDC;) {
ConcreteTypeMunger m = ii.next();
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
if (m.getMunger() instanceof NewConstructorTypeMunger) {
if (m.getSignature().getSignature().equals(invokeSpecial.getSignature(cpg))) {
satisfiedByITDC = true;
}
}
}
if (!satisfiedByITDC) {
String csig = createReadableCtorSig(newParent, cpg, invokeSpecial);
weaver.getWorld()
.getMessageHandler()
.handleMessage(
MessageUtil.error(
"Unable to modify hierarchy for " + newParentTarget.getClassName()
+ " - the constructor " + csig + " is missing",
this.getSourceLocation()));
return false;
}
}
int idx = cpg.addMethodref(newParent.getName(), invokeSpecial.getMethodName(cpg),
invokeSpecial.getSignature(cpg));
invokeSpecial.setIndex(idx);
}
}
handle = handle.getNext();
}
}
}
return true;
}
/**
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
* Creates a nice signature for the ctor, something like "(int,Integer,String)"
*/
private String createReadableCtorSig(ResolvedType newParent, ConstantPool cpg, InvokeInstruction invokeSpecial) {
StringBuffer sb = new StringBuffer();
Type[] ctorArgs = invokeSpecial.getArgumentTypes(cpg);
sb.append(newParent.getClassName());
sb.append("(");
for (int i = 0; i < ctorArgs.length; i++) {
String argtype = ctorArgs[i].toString();
if (argtype.lastIndexOf(".") != -1) {
sb.append(argtype.substring(argtype.lastIndexOf(".") + 1));
} else {
sb.append(argtype);
}
if (i + 1 < ctorArgs.length) {
sb.append(",");
}
}
sb.append(")");
return sb.toString();
}
private ResolvedMember getConstructorWithSignature(ResolvedType type, String searchSig) {
for (ResolvedMember method : type.getDeclaredJavaMethods()) {
if (MemberUtils.isConstructor(method)) {
if (method.getSignature().equals(searchSig)) {
return method;
}
}
}
return null;
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
}
private boolean mungePrivilegedAccess(BcelClassWeaver weaver, PrivilegedAccessMunger munger) {
LazyClassGen gen = weaver.getLazyClassGen();
ResolvedMember member = munger.getMember();
ResolvedType onType = weaver.getWorld().resolve(member.getDeclaringType(), munger.getSourceLocation());
if (onType.isRawType()) {
onType = onType.getGenericType();
}
if (onType.equals(gen.getType())) {
if (member.getKind() == Member.FIELD) {
addFieldGetter(gen, member,
AjcMemberMaker.privilegedAccessMethodForFieldGet(aspectType, member, munger.shortSyntax));
addFieldSetter(gen, member,
AjcMemberMaker.privilegedAccessMethodForFieldSet(aspectType, member, munger.shortSyntax));
return true;
} else if (member.getKind() == Member.METHOD) {
addMethodDispatch(gen, member, AjcMemberMaker.privilegedAccessMethodForMethod(aspectType, member));
return true;
} else if (member.getKind() == Member.CONSTRUCTOR) {
for (Iterator<LazyMethodGen> i = gen.getMethodGens().iterator(); i.hasNext();) {
LazyMethodGen m = i.next();
if (m.getMemberView() != null && m.getMemberView().getKind() == Member.CONSTRUCTOR) {
m.forcePublic();
}
}
return true;
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
} else if (member.getKind() == Member.STATIC_INITIALIZATION) {
gen.forcePublic();
return true;
} else {
throw new RuntimeException("unimplemented");
}
}
return false;
}
private void addFieldGetter(LazyClassGen gen, ResolvedMember field, ResolvedMember accessMethod) {
LazyMethodGen mg = makeMethodGen(gen, accessMethod);
InstructionList il = new InstructionList();
InstructionFactory fact = gen.getFactory();
if (Modifier.isStatic(field.getModifiers())) {
il.append(fact.createFieldAccess(gen.getClassName(), field.getName(), BcelWorld.makeBcelType(field.getType()),
Constants.GETSTATIC));
} else {
il.append(InstructionConstants.ALOAD_0);
il.append(fact.createFieldAccess(gen.getClassName(), field.getName(), BcelWorld.makeBcelType(field.getType()),
Constants.GETFIELD));
}
il.append(InstructionFactory.createReturn(BcelWorld.makeBcelType(field.getType())));
mg.getBody().insert(il);
gen.addMethodGen(mg, getSignature().getSourceLocation());
}
private void addFieldSetter(LazyClassGen gen, ResolvedMember field, ResolvedMember accessMethod) {
LazyMethodGen mg = makeMethodGen(gen, accessMethod);
InstructionList il = new InstructionList();
|
413,378 |
Bug 413378 A constructor added by ITD cannot invoke the method of its super class
|
AspectJ Development Tools 2.2.0.e37x-RELEASE-20120704-0900 It seems *super.someMethod()* can not be correctly resolved in the constructor added by ITD It can be compiled with no problem, but* at runtime, exception is raised.* The class which I'll add a new constructor to: public class Child extends Parent{ public String mParent = "John"; public Child(String parent) { this.mParent = parent; } public String getParent() { return this.mParent; } } As we can see, *Child * extends *Parent* class Parent has a method getAge() public class Parent { private String mName = "John"; private int mAge = 50; public int getAge(){ return mAge; } } If I add a new constructor for the *Child * in my aspect. public aspect MyTest { public Child.new(String parent, int age) { this(parent); System.out.println("Get Age:" + super.getAge()); System.out.println("Child Name:" + this.mParent); } } The above aspect code will trigger an exception. Exception in thread "main" java.lang.NoSuchMethodError: com.test.Child.ajc$superDispatch$com_test_Child$getAge()I at MyTest.ajc$postInterConstructor$MyTest$com_test_Child(MyTest.aj:13) at com.test.Child.<init>(Child.java:1) at MainProgram.main(MainProgram.java:14) Is this a limitation of AspectJ? Is this the only way to resolve this issue? I also attach the src & compiled binary files
|
resolved fixed
|
302c14e
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2013-07-22T21:50:14Z | 2013-07-20T06:00:00Z |
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
|
InstructionFactory fact = gen.getFactory();
Type fieldType = BcelWorld.makeBcelType(field.getType());
if (Modifier.isStatic(field.getModifiers())) {
il.append(InstructionFactory.createLoad(fieldType, 0));
il.append(fact.createFieldAccess(gen.getClassName(), field.getName(), fieldType, Constants.PUTSTATIC));
} else {
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionFactory.createLoad(fieldType, 1));
il.append(fact.createFieldAccess(gen.getClassName(), field.getName(), fieldType, Constants.PUTFIELD));
}
il.append(InstructionFactory.createReturn(Type.VOID));
mg.getBody().insert(il);
gen.addMethodGen(mg, getSignature().getSourceLocation());
}
private void addMethodDispatch(LazyClassGen gen, ResolvedMember method, ResolvedMember accessMethod) {
LazyMethodGen mg = makeMethodGen(gen, accessMethod);
InstructionList il = new InstructionList();
InstructionFactory fact = gen.getFactory();
Type[] paramTypes = BcelWorld.makeBcelTypes(method.getParameterTypes());
int pos = 0;
if (!Modifier.isStatic(method.getModifiers())) {
il.append(InstructionConstants.ALOAD_0);
pos++;
}
for (int i = 0, len = paramTypes.length; i < len; i++) {
Type paramType = paramTypes[i];
il.append(InstructionFactory.createLoad(paramType, pos));
pos += paramType.getSize();
}
il.append(Utility.createInvoke(fact, (BcelWorld) aspectType.getWorld(), method));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.