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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
237,962 |
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
|
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
|
resolved fixed
|
be03167
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-06-20T17:15:52Z | 2008-06-20T16:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
|
s.writeUTF(k);
s.writeUTF((String)annotationValues.get(k));
}
}
}
public static AnnotationTypePattern read(VersionedDataInputStream s,ISourceContext context) throws IOException {
WildAnnotationTypePattern ret;
byte version = s.readByte();
if (version > VERSION) {
throw new BCException("ExactAnnotationTypePattern was written by a newer version of AspectJ");
}
TypePattern t = TypePattern.read(s,context);
ret = new WildAnnotationTypePattern(t);
ret.readLocation(context,s);
if (s.getMajorVersion()>=WeaverVersionInfo.WEAVER_VERSION_MINOR_AJ160) {
if (s.readBoolean()) ret.setForParameterAnnotationMatch();
}
if (s.getMajorVersion()>=WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ160M2) {
int annotationValueCount = s.readInt();
if (annotationValueCount>0) {
Map aValues = new HashMap();
for (int i=0;i<annotationValueCount;i++) {
String key = s.readUTF();
String val = s.readUTF();
aValues.put(key,val);
}
ret.annotationValues = aValues;
}
}
return ret;
|
237,962 |
Bug 237962 [migration] Unexpected problem loading an aspect built with 1.5.4
|
We always support processing of old aspects. It doesn't matter what level of AspectJ was used to build an aspect, as long as you use that version or a later version of the weaver, we can unpack it and don't require it to be rebuilt from source. However, I've just encountered a .class apparently built with 1.5.4 that 1.6.1 cannot load. It crashes deserializing a PointcutDeclaration. In the data stream we have just read the numbers 1 and 3 indicating 'kinded pointcut' and then 'method-execution' and the next digit is a 0 when it should be 1-9. We crash with a: org.aspectj.weaver.BCException: weird kind 0 when batch building BuildConfig[null] #Files=43 at org.aspectj.weaver.MemberKind.read(MemberKind.java:35) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:682) The memberkind is a typesafeenum and so can never be other than 1-9. It is the first part of a signaturepattern so hard to see how it got written out 'wrong' right now. I've been told 1.5.4 can load this, so about to try that. Wow....1.5.4 did load it back in, how the hell. I suspect we aren't consuming enough in 1.6.1 which then leaves us some extra that we interpret as a rogue pointcut. Ok, in a comparison we consume one extra byte from the stream when reading it with 1.6.1 that we do not consume with 1.6.0 - at position 260. As I got closer to it, I knew what it would be - especially when I knew it was just one byte difference. The version check for whether the byte for 'annotation pattern relates to a parameter match' was wrong (urgh).
|
resolved fixed
|
be03167
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-06-20T17:15:52Z | 2008-06-20T16:40:00Z |
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
|
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object obj) {
if (!(obj instanceof WildAnnotationTypePattern)) return false;
WildAnnotationTypePattern other = (WildAnnotationTypePattern) obj;
return other.typePattern.equals(typePattern) &&
this.isForParameterAnnotationMatch()==other.isForParameterAnnotationMatch() &&
(annotationValues==null?other.annotationValues==null:annotationValues.equals(other.annotationValues));
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return (((17 + 37*typePattern.hashCode())*37+(isForParameterAnnotationMatch()?0:1))*37)+(annotationValues==null?0:annotationValues.hashCode());
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
return "@(" + typePattern.toString() + ")";
}
public Object accept(PatternNodeVisitor visitor, Object data) {
return visitor.visit(this, data);
}
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.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 support for @AJ perClause
* ******************************************************************/
package org.aspectj.ajdt.internal.compiler.lookup;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.aspectj.ajdt.internal.compiler.ast.AdviceDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.DeclareAnnotationDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.DeclareDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.InterTypeDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
import org.aspectj.ajdt.internal.core.builder.EclipseSourceContext;
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
import org.aspectj.bridge.IMessage;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NormalAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.StringLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.weaver.AbstractReferenceTypeDelegate;
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
import org.aspectj.weaver.AnnotationAJ;
import org.aspectj.weaver.AnnotationNameValuePair;
import org.aspectj.weaver.AnnotationTargetKind;
import org.aspectj.weaver.AnnotationValue;
import org.aspectj.weaver.AnnotationX;
import org.aspectj.weaver.ArrayAnnotationValue;
import org.aspectj.weaver.BCException;
import org.aspectj.weaver.EnumAnnotationValue;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedPointcutDefinition;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.TypeVariable;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.WeaverStateInfo;
import org.aspectj.weaver.World;
import org.aspectj.weaver.bcel.AtAjAttributes.LazyResolvedPointcutDefinition;
import org.aspectj.weaver.patterns.FormalBinding;
import org.aspectj.weaver.patterns.ParserException;
import org.aspectj.weaver.patterns.PatternParser;
import org.aspectj.weaver.patterns.PerClause;
import org.aspectj.weaver.patterns.PerFromSuper;
import org.aspectj.weaver.patterns.PerSingleton;
import org.aspectj.weaver.patterns.Pointcut;
/**
* Supports viewing eclipse TypeDeclarations/SourceTypeBindings as a ResolvedType
*
* @author Jim Hugunin
*/
public class EclipseSourceType extends AbstractReferenceTypeDelegate {
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
private static final char[] pointcutSig = "Lorg/aspectj/lang/annotation/Pointcut;".toCharArray();
private static final char[] aspectSig = "Lorg/aspectj/lang/annotation/Aspect;".toCharArray();
protected ResolvedPointcutDefinition[] declaredPointcuts = null;
protected ResolvedMember[] declaredMethods = null;
protected ResolvedMember[] declaredFields = null;
public List declares = new ArrayList();
public List typeMungers = new ArrayList();
private EclipseFactory factory;
private SourceTypeBinding binding;
private TypeDeclaration declaration;
private CompilationUnitDeclaration unit;
private boolean annotationsResolved = false;
private ResolvedType[] resolvedAnnotations = null;
private boolean discoveredAnnotationTargetKinds = false;
private AnnotationTargetKind[] annotationTargetKinds;
private AnnotationX[] annotations = null;
private final static ResolvedType[] NO_ANNOTATION_TYPES = new ResolvedType[0];
private final static AnnotationX[] NO_ANNOTATIONS = new AnnotationX[0];
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
protected EclipseFactory eclipseWorld() {
return factory;
}
public EclipseSourceType(ReferenceType resolvedTypeX, EclipseFactory factory,
SourceTypeBinding binding, TypeDeclaration declaration,
CompilationUnitDeclaration unit)
{
super(resolvedTypeX, true);
this.factory = factory;
this.binding = binding;
this.declaration = declaration;
this.unit = unit;
setSourceContext(new EclipseSourceContext(declaration.compilationResult));
resolvedTypeX.setStartPos(declaration.sourceStart);
resolvedTypeX.setEndPos(declaration.sourceEnd);
}
public boolean isAspect() {
final boolean isCodeStyle = declaration instanceof AspectDeclaration;
return isCodeStyle?isCodeStyle:isAnnotationStyleAspect();
}
public boolean isAnonymous() {
if (declaration.binding != null)
return declaration.binding.isAnonymousType();
return ((declaration.modifiers & (ASTNode.IsAnonymousType | ASTNode.IsLocalType)) != 0);
}
public boolean isNested() {
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
if (declaration.binding!=null) return (declaration.binding.isMemberType());
return ((declaration.modifiers & ASTNode.IsMemberType) != 0);
}
public ResolvedType getOuterClass() {
if (declaration.enclosingType==null) return null;
return eclipseWorld().fromEclipse(declaration.enclosingType.binding);
}
public boolean isAnnotationStyleAspect() {
if (declaration.annotations == null) {
return false;
}
ResolvedType[] annotations = getAnnotationTypes();
for (int i = 0; i < annotations.length; i++) {
if ("org.aspectj.lang.annotation.Aspect".equals(annotations[i].getName())) {
return true;
}
}
return false;
}
private String getPointcutStringFromAnnotationStylePointcut(AbstractMethodDeclaration amd) {
Annotation[] ans = amd.annotations;
if (ans == null) return "";
for (int i = 0; i < ans.length; i++) {
if (ans[i].resolvedType == null) continue;
char[] sig = ans[i].resolvedType.signature();
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
if (CharOperation.equals(pointcutSig,sig)) {
if (ans[i].memberValuePairs().length==0) return "";
Expression expr = ans[i].memberValuePairs()[0].value;
if (expr instanceof StringLiteral) {
StringLiteral sLit = ((StringLiteral)expr);
return new String(sLit.source());
} else if (expr instanceof NameReference && (((NameReference)expr).binding instanceof FieldBinding)) {
Binding b = ((NameReference)expr).binding;
Constant c = ((FieldBinding)b).constant;
return c.stringValue();
} else {
throw new BCException("Do not know how to recover pointcut definition from "+expr+" (type "+expr.getClass().getName()+")");
}
}
}
return "";
}
private boolean isAnnotationStylePointcut(Annotation[] annotations) {
if (annotations == null) return false;
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].resolvedType == null) continue;
char[] sig = annotations[i].resolvedType.signature();
if (CharOperation.equals(pointcutSig,sig)) {
return true;
}
}
return false;
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
public WeaverStateInfo getWeaverState() {
return null;
}
public ResolvedType getSuperclass() {
if (binding.isInterface()) return getResolvedTypeX().getWorld().getCoreType(UnresolvedType.OBJECT);
return eclipseWorld().fromEclipse(binding.superclass());
}
public ResolvedType[] getDeclaredInterfaces() {
return eclipseWorld().fromEclipse(binding.superInterfaces());
}
protected void fillDeclaredMembers() {
List declaredPointcuts = new ArrayList();
List declaredMethods = new ArrayList();
List declaredFields = new ArrayList();
binding.methods();
AbstractMethodDeclaration[] methods = declaration.methods;
if (methods != null) {
for (int i=0, len=methods.length; i < len; i++) {
AbstractMethodDeclaration amd = methods[i];
if (amd == null || amd.ignoreFurtherInvestigation) continue;
if (amd instanceof PointcutDeclaration) {
PointcutDeclaration d = (PointcutDeclaration)amd;
ResolvedPointcutDefinition df = d.makeResolvedPointcutDefinition(factory);
declaredPointcuts.add(df);
} else if (amd instanceof InterTypeDeclaration) {
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
continue;
} else if (amd instanceof DeclareDeclaration &&
!(amd instanceof DeclareAnnotationDeclaration)) {
continue;
} else if (amd instanceof AdviceDeclaration) {
continue;
} else if ((amd.annotations != null) && isAnnotationStylePointcut(amd.annotations)) {
ResolvedPointcutDefinition df = makeResolvedPointcutDefinition(amd);
if (df!=null) declaredPointcuts.add(df);
} else {
if (amd.binding == null || !amd.binding.isValidBinding()) continue;
ResolvedMember member = factory.makeResolvedMember(amd.binding);
if (unit != null) {
member.setSourceContext(new EclipseSourceContext(unit.compilationResult,amd.binding.sourceStart()));
member.setPosition(amd.binding.sourceStart(),amd.binding.sourceEnd());
}
declaredMethods.add(member);
}
}
}
FieldBinding[] fields = binding.fields();
for (int i=0, len=fields.length; i < len; i++) {
FieldBinding f = fields[i];
declaredFields.add(factory.makeResolvedMember(f));
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
this.declaredPointcuts = (ResolvedPointcutDefinition[])
declaredPointcuts.toArray(new ResolvedPointcutDefinition[declaredPointcuts.size()]);
this.declaredMethods = (ResolvedMember[])
declaredMethods.toArray(new ResolvedMember[declaredMethods.size()]);
this.declaredFields = (ResolvedMember[])
declaredFields.toArray(new ResolvedMember[declaredFields.size()]);
}
private ResolvedPointcutDefinition makeResolvedPointcutDefinition(AbstractMethodDeclaration md) {
if (md.binding==null) return null;
EclipseSourceContext eSourceContext = new EclipseSourceContext(md.compilationResult);
Pointcut pc = null;
if (!md.isAbstract()) {
String expression = getPointcutStringFromAnnotationStylePointcut(md);
try {
pc = new PatternParser(expression,eSourceContext).parsePointcut();
} catch (ParserException pe) {
pc = Pointcut.makeMatchesNothing(Pointcut.SYMBOLIC);
}
}
FormalBinding[] bindings = buildFormalAdviceBindingsFrom(md);
ResolvedPointcutDefinition rpd = new LazyResolvedPointcutDefinition(
factory.fromBinding(md.binding.declaringClass),
md.modifiers,
new String(md.selector),
factory.fromBindings(md.binding.parameters),
factory.fromBinding(md.binding.returnType),
pc,new EclipseScope(bindings,md.scope));
rpd.setPosition(md.sourceStart, md.sourceEnd);
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
rpd.setSourceContext(eSourceContext);
return rpd;
}
private static final char[] joinPoint = "Lorg/aspectj/lang/JoinPoint;".toCharArray();
private static final char[] joinPointStaticPart = "Lorg/aspectj/lang/JoinPoint$StaticPart;".toCharArray();
private static final char[] joinPointEnclosingStaticPart = "Lorg/aspectj/lang/JoinPoint$EnclosingStaticPart;".toCharArray();
private static final char[] proceedingJoinPoint = "Lorg/aspectj/lang/ProceedingJoinPoint;".toCharArray();
private FormalBinding[] buildFormalAdviceBindingsFrom(AbstractMethodDeclaration mDecl) {
if (mDecl.arguments == null) return new FormalBinding[0];
if (mDecl.binding == null) return new FormalBinding[0];
EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(mDecl.scope);
String extraArgName = null;
if (extraArgName == null) extraArgName = "";
FormalBinding[] ret = new FormalBinding[mDecl.arguments.length];
for (int i = 0; i < mDecl.arguments.length; i++) {
Argument arg = mDecl.arguments[i];
String name = new String(arg.name);
TypeBinding argTypeBinding = mDecl.binding.parameters[i];
UnresolvedType type = factory.fromBinding(argTypeBinding);
if (CharOperation.equals(joinPoint,argTypeBinding.signature()) ||
CharOperation.equals(joinPointStaticPart,argTypeBinding.signature()) ||
CharOperation.equals(joinPointEnclosingStaticPart,argTypeBinding.signature()) ||
CharOperation.equals(proceedingJoinPoint,argTypeBinding.signature()) ||
name.equals(extraArgName)) {
ret[i] = new FormalBinding.ImplicitFormalBinding(type,name,i);
} else {
ret[i] = new FormalBinding(type, name, i, arg.sourceStart, arg.sourceEnd, "unknown");
}
}
return ret;
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
}
/**
* This method may not return all fields, for example it may
* not include the ajc$initFailureCause or ajc$perSingletonInstance
* fields - see bug 129613
*/
public ResolvedMember[] getDeclaredFields() {
if (declaredFields == null) fillDeclaredMembers();
return declaredFields;
}
/**
* This method may not return all methods, for example it may
* not include clinit, aspectOf, hasAspect or ajc$postClinit
* methods - see bug 129613
*/
public ResolvedMember[] getDeclaredMethods() {
if (declaredMethods == null) fillDeclaredMembers();
return declaredMethods;
}
public ResolvedMember[] getDeclaredPointcuts() {
if (declaredPointcuts == null) fillDeclaredMembers();
return declaredPointcuts;
}
public int getModifiers() {
return binding.modifiers & ExtraCompilerModifiers.AccJustFlag;
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
public String toString() {
return "EclipseSourceType(" + new String(binding.sourceName()) + ")";
}
public void checkPointcutDeclarations() {
ResolvedMember[] pointcuts = getDeclaredPointcuts();
boolean sawError = false;
for (int i=0, len=pointcuts.length; i < len; i++) {
if (pointcuts[i].isAbstract()) {
if (!this.isAspect()) {
eclipseWorld().showMessage(IMessage.ERROR,
"abstract pointcut only allowed in aspect" + pointcuts[i].getName(),
pointcuts[i].getSourceLocation(), null);
sawError = true;
} else if (!binding.isAbstract()) {
eclipseWorld().showMessage(IMessage.ERROR,
"abstract pointcut in concrete aspect" + pointcuts[i],
pointcuts[i].getSourceLocation(), null);
sawError = true;
}
}
for (int j=i+1; j < len; j++) {
if (pointcuts[i].getName().equals(pointcuts[j].getName())) {
eclipseWorld().showMessage(IMessage.ERROR,
"duplicate pointcut name: " + pointcuts[j].getName(),
pointcuts[i].getSourceLocation(), pointcuts[j].getSourceLocation());
sawError = true;
}
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
}
if (sawError || !isAspect()) return;
getResolvedTypeX().getExposedPointcuts();
}
???
}
}
public boolean isInterface() {
return binding.isInterface();
}
public final static short ACC_ANNOTATION = 0x2000;
public final static short ACC_ENUM = 0x4000;
public boolean isEnum() {
return (binding.getAccessFlags() & ACC_ENUM)!=0;
}
public boolean isAnnotation() {
return (binding.getAccessFlags() & ACC_ANNOTATION)!=0;
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
public void addAnnotation(AnnotationX annotationX) {
throw new RuntimeException("EclipseSourceType.addAnnotation() not implemented");
}
public boolean isAnnotationWithRuntimeRetention() {
if (!isAnnotation()) {
return false;
} else {
return (binding.getAnnotationTagBits() & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention;
}
}
public String getRetentionPolicy() {
if (isAnnotation()) {
if ((binding.getAnnotationTagBits() & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention) return "RUNTIME";
if ((binding.getAnnotationTagBits() & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationSourceRetention) return "SOURCE";
if ((binding.getAnnotationTagBits() & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention) return "CLASS";
}
return null;
}
public boolean canAnnotationTargetType() {
if (isAnnotation()) {
return ((binding.getAnnotationTagBits() & TagBits.AnnotationForType) != 0 );
}
return false;
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
}
public AnnotationTargetKind[] getAnnotationTargetKinds() {
if (discoveredAnnotationTargetKinds) return annotationTargetKinds;
discoveredAnnotationTargetKinds = true;
annotationTargetKinds = null;
}
if (isAnnotation()) {
List targetKinds = new ArrayList();
if ((binding.getAnnotationTagBits() & TagBits.AnnotationForAnnotationType) != 0) targetKinds.add(AnnotationTargetKind.ANNOTATION_TYPE);
if ((binding.getAnnotationTagBits() & TagBits.AnnotationForConstructor) != 0) targetKinds.add(AnnotationTargetKind.CONSTRUCTOR);
if ((binding.getAnnotationTagBits() & TagBits.AnnotationForField) != 0) targetKinds.add(AnnotationTargetKind.FIELD);
if ((binding.getAnnotationTagBits() & TagBits.AnnotationForLocalVariable) != 0) targetKinds.add(AnnotationTargetKind.LOCAL_VARIABLE);
if ((binding.getAnnotationTagBits() & TagBits.AnnotationForMethod) != 0) targetKinds.add(AnnotationTargetKind.METHOD);
if ((binding.getAnnotationTagBits() & TagBits.AnnotationForPackage) != 0) targetKinds.add(AnnotationTargetKind.PACKAGE);
if ((binding.getAnnotationTagBits() & TagBits.AnnotationForParameter) != 0) targetKinds.add(AnnotationTargetKind.PARAMETER);
if ((binding.getAnnotationTagBits() & TagBits.AnnotationForType) != 0) targetKinds.add(AnnotationTargetKind.TYPE);
if (!targetKinds.isEmpty()) {
annotationTargetKinds = new AnnotationTargetKind[targetKinds.size()];
return (AnnotationTargetKind[]) targetKinds.toArray(annotationTargetKinds);
}
}
return annotationTargetKinds;
}
public boolean hasAnnotation(UnresolvedType ofType) {
if (!annotationsResolved) {
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
TypeDeclaration.resolveAnnotations(declaration.staticInitializerScope, declaration.annotations, binding);
annotationsResolved = true;
}
Annotation[] as = declaration.annotations;
if (as == null) return false;
for (int i = 0; i < as.length; i++) {
Annotation annotation = as[i];
if (annotation.resolvedType == null) {
return false;
}
String tname = CharOperation.charToString(annotation.resolvedType.constantPoolName());
if (UnresolvedType.forName(tname).equals(ofType)) {
return true;
}
}
return false;
}
/**
* WARNING: This method does not have a complete implementation.
*
* The aim is that it converts Eclipse annotation objects to the AspectJ form of
* annotations (the type AnnotationAJ). The AnnotationX objects returned are wrappers
* over either a Bcel annotation type or the AspectJ AnnotationAJ type.
* The minimal implementation provided here is for processing the RetentionPolicy and
* Target annotation types - these are the only ones which the weaver will attempt to
* process from an EclipseSourceType.
*
* More notes:
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
* The pipeline has required us to implement this. With the pipeline we can be weaving
* a type and asking questions of annotations before they have been turned into Bcel
* objects - ie. when they are still in EclipseSourceType form. Without the pipeline we
* would have converted everything to Bcel objects before proceeding with weaving.
* Because the pipeline won't start weaving until all aspects have been compiled and
* the fact that no AspectJ constructs match on the values within annotations, this code
* only needs to deal with converting system annotations that the weaver needs to process
* (RetentionPolicy, Target).
*/
public AnnotationX[] getAnnotations() {
if (annotations!=null) return annotations;
getAnnotationTypes();
Annotation[] as = declaration.annotations;
if (as==null || as.length==0) {
annotations = NO_ANNOTATIONS;
} else {
annotations = new AnnotationX[as.length];
for (int i = 0; i < as.length; i++) {
annotations[i]=convertEclipseAnnotation(as[i],factory.getWorld());
}
}
return annotations;
}
/**
* Convert one eclipse annotation into an AnnotationX object containing an AnnotationAJ object.
*
* This code and the helper methods used by it will go *BANG* if they encounter anything
* not currently supported - this is safer than limping along with a malformed annotation. When
* the *BANG* is encountered the bug reporter should indicate the kind of annotation they
* were working with and this code can be enhanced to support it.
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
*/
public AnnotationX convertEclipseAnnotation(Annotation eclipseAnnotation,World w) {
ResolvedType annotationType = factory.fromTypeBindingToRTX(eclipseAnnotation.type.resolvedType);
long bs = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK);
boolean isRuntimeVisible = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention;
AnnotationAJ annotationAJ = new AnnotationAJ(annotationType.getSignature(),isRuntimeVisible);
generateAnnotation(eclipseAnnotation,annotationAJ);
return new AnnotationX(annotationAJ,w);
}
static class MissingImplementationException extends RuntimeException {
MissingImplementationException(String reason) {
super(reason);
}
}
private void generateAnnotation(Annotation annotation,AnnotationAJ annotationAJ) {
if (annotation instanceof NormalAnnotation) {
NormalAnnotation normalAnnotation = (NormalAnnotation) annotation;
MemberValuePair[] memberValuePairs = normalAnnotation.memberValuePairs;
if (memberValuePairs != null) {
int memberValuePairsLength = memberValuePairs.length;
for (int i = 0; i < memberValuePairsLength; i++) {
MemberValuePair memberValuePair = memberValuePairs[i];
MethodBinding methodBinding = memberValuePair.binding;
if (methodBinding == null) {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation ["+annotation+"]");
} else {
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
AnnotationValue av = generateElementValue(memberValuePair.value, methodBinding.returnType);
AnnotationNameValuePair anvp = new AnnotationNameValuePair(new String(memberValuePair.name),av);
annotationAJ.addNameValuePair(anvp);
}
}
} else {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation ["+annotation+"]");
}
} else if (annotation instanceof SingleMemberAnnotation) {
SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
if (methodBinding == null) {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation ["+annotation+"]");
} else {
AnnotationValue av = generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType);
annotationAJ.addNameValuePair(
new AnnotationNameValuePair(new String(singleMemberAnnotation.memberValuePairs()[0].name),av));
}
} else if (annotation instanceof MarkerAnnotation) {
return;
} else {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation ["+annotation+"]");
}
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
private AnnotationValue generateElementValue(Expression defaultValue,TypeBinding memberValuePairReturnType) {
Constant constant = defaultValue.constant;
TypeBinding defaultValueBinding = defaultValue.resolvedType;
if (defaultValueBinding == null) {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
} else {
if (memberValuePairReturnType.isArrayType() && !defaultValueBinding.isArrayType()) {
if (constant != null && constant != Constant.NotAConstant) {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
} else {
AnnotationValue av = generateElementValueForNonConstantExpression(defaultValue, defaultValueBinding);
return new ArrayAnnotationValue(new AnnotationValue[]{av});
}
} else {
if (constant != null && constant != Constant.NotAConstant) {
AnnotationValue av = EclipseAnnotationConvertor.generateElementValueForConstantExpression(defaultValue,defaultValueBinding);
if (av==null) {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
}
return av;
} else {
AnnotationValue av = generateElementValueForNonConstantExpression(defaultValue, defaultValueBinding);
return av;
}
}
}
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
private AnnotationValue generateElementValueForNonConstantExpression(Expression defaultValue, TypeBinding defaultValueBinding) {
if (defaultValueBinding != null) {
if (defaultValueBinding.isEnum()) {
FieldBinding fieldBinding = null;
if (defaultValue instanceof QualifiedNameReference) {
QualifiedNameReference nameReference = (QualifiedNameReference) defaultValue;
fieldBinding = (FieldBinding) nameReference.binding;
} else if (defaultValue instanceof SingleNameReference) {
SingleNameReference nameReference = (SingleNameReference) defaultValue;
fieldBinding = (FieldBinding) nameReference.binding;
} else {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
}
if (fieldBinding != null) {
String sig = new String(fieldBinding.type.signature());
AnnotationValue enumValue = new EnumAnnotationValue(sig,new String(fieldBinding.name));
return enumValue;
}
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
} else if (defaultValueBinding.isAnnotationType()) {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
} else if (defaultValueBinding.isArrayType()) {
if (defaultValue instanceof ArrayInitializer) {
ArrayInitializer arrayInitializer = (ArrayInitializer) defaultValue;
int arrayLength = arrayInitializer.expressions != null ? arrayInitializer.expressions.length : 0;
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
AnnotationValue[] values = new AnnotationValue[arrayLength];
for (int i = 0; i < arrayLength; i++) {
values[i] = generateElementValue(arrayInitializer.expressions[i], defaultValueBinding.leafComponentType());
}
ArrayAnnotationValue aav = new ArrayAnnotationValue(values);
return aav;
} else {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
}
} else {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
}
} else {
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
}
}
public ResolvedType[] getAnnotationTypes() {
if (resolvedAnnotations!=null) return resolvedAnnotations;
if (!annotationsResolved) {
TypeDeclaration.resolveAnnotations(declaration.staticInitializerScope, declaration.annotations, binding);
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
annotationsResolved = true;
}
if (declaration.annotations == null) {
resolvedAnnotations = NO_ANNOTATION_TYPES;
} else {
resolvedAnnotations = new ResolvedType[declaration.annotations.length];
Annotation[] as = declaration.annotations;
for (int i = 0; i < as.length; i++) {
Annotation annotation = as[i];
resolvedAnnotations[i] =factory.fromTypeBindingToRTX(annotation.type.resolvedType);
}
}
return resolvedAnnotations;
}
public PerClause getPerClause() {
if (!isAnnotationStyleAspect()) {
if(declaration instanceof AspectDeclaration) {
PerClause pc = ((AspectDeclaration)declaration).perClause;
if (pc != null) return pc;
}
return new PerSingleton();
} else {
PerClause pc = null;
if (declaration instanceof AspectDeclaration)
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
pc = ((AspectDeclaration)declaration).perClause;
if (pc==null) {
PerClause.Kind kind = getPerClauseForTypeDeclaration(declaration);
return new PerFromSuper(kind);
}
return pc;
}
}
PerClause.Kind getPerClauseForTypeDeclaration(TypeDeclaration typeDeclaration) {
Annotation[] annotations = typeDeclaration.annotations;
for (int i = 0; i < annotations.length; i++) {
Annotation annotation = annotations[i];
if (CharOperation.equals(aspectSig, annotation.resolvedType.signature())) {
if (annotation.memberValuePairs() == null || annotation.memberValuePairs().length == 0) {
PerClause.Kind kind = lookupPerClauseKind(typeDeclaration.binding.superclass);
if (kind == null) {
return PerClause.SINGLETON;
} else {
return kind;
}
} else if (annotation instanceof SingleMemberAnnotation) {
SingleMemberAnnotation theAnnotation = (SingleMemberAnnotation)annotation;
String clause = new String(((StringLiteral)theAnnotation.memberValue).source());
return determinePerClause(typeDeclaration, clause);
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
} else if (annotation instanceof NormalAnnotation) {
NormalAnnotation theAnnotation = (NormalAnnotation)annotation;
if (theAnnotation.memberValuePairs==null || theAnnotation.memberValuePairs.length<1) return PerClause.SINGLETON;
String clause = new String(((StringLiteral)theAnnotation.memberValuePairs[0].value).source());
return determinePerClause(typeDeclaration, clause);
} else {
eclipseWorld().showMessage(IMessage.ABORT,
"@Aspect annotation is expected to be SingleMemberAnnotation with 'String value()' as unique element",
new EclipseSourceLocation(typeDeclaration.compilationResult, typeDeclaration.sourceStart, typeDeclaration.sourceEnd), null);
return PerClause.SINGLETON;
}
}
}
return null;
}
private PerClause.Kind determinePerClause(TypeDeclaration typeDeclaration, String clause) {
if (clause.startsWith("perthis(")) {
return PerClause.PEROBJECT;
} else if (clause.startsWith("pertarget(")) {
return PerClause.PEROBJECT;
} else if (clause.startsWith("percflow(")) {
return PerClause.PERCFLOW;
} else if (clause.startsWith("percflowbelow(")) {
return PerClause.PERCFLOW;
} else if (clause.startsWith("pertypewithin(")) {
return PerClause.PERTYPEWITHIN;
} else if (clause.startsWith("issingleton(")) {
return PerClause.SINGLETON;
} else {
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
eclipseWorld().showMessage(IMessage.ABORT,
"cannot determine perClause '" + clause + "'",
new EclipseSourceLocation(typeDeclaration.compilationResult, typeDeclaration.sourceStart, typeDeclaration.sourceEnd), null);
return PerClause.SINGLETON;
}
}
private PerClause.Kind lookupPerClauseKind(ReferenceBinding binding) {
final PerClause.Kind kind;
if (binding instanceof BinaryTypeBinding) {
ResolvedType superTypeX = factory.fromEclipse(binding);
PerClause perClause = superTypeX.getPerClause();
if (perClause != null) {
kind = superTypeX.getPerClause().getKind();
} else {
kind = null;
}
} else if (binding instanceof SourceTypeBinding ) {
SourceTypeBinding sourceSc = (SourceTypeBinding)binding;
if (sourceSc.scope.referenceContext instanceof AspectDeclaration) {
kind = ((AspectDeclaration)sourceSc.scope.referenceContext).perClause.getKind();
} else if (sourceSc.scope.referenceContext instanceof TypeDeclaration) {
kind = getPerClauseForTypeDeclaration((TypeDeclaration)(sourceSc.scope.referenceContext));
} else {
kind = null;
}
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
} else {
kind = null;
}
return kind;
}
public Collection getDeclares() {
return declares;
}
public Collection getPrivilegedAccesses() {
return Collections.EMPTY_LIST;
}
public Collection getTypeMungers() {
return typeMungers;
}
public boolean doesNotExposeShadowMungers() {
return true;
}
public String getDeclaredGenericSignature() {
return CharOperation.charToString(binding.genericSignature());
}
public boolean isGeneric() {
return binding.isGenericType();
}
public TypeVariable[] getTypeVariables() {
if (declaration.typeParameters == null) return new TypeVariable[0];
TypeVariable[] typeVariables = new TypeVariable[declaration.typeParameters.length];
|
229,829 |
Bug 229829 SourceTypeBinding.sourceStart() NPE
|
java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1514) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:988) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:243) at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredFiel ... IRETURN end public boolean isTracingModifications() end public class com.centricsoftware.pi.core.data.reflection.Attribute
|
resolved fixed
|
e9823aa
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-07-29T16:55:49Z | 2008-05-01T16:40:00Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
|
for (int i = 0; i < typeVariables.length; i++) {
typeVariables[i] = typeParameter2TypeVariable(declaration.typeParameters[i]);
}
return typeVariables;
}
private TypeVariable typeParameter2TypeVariable(TypeParameter aTypeParameter) {
String name = new String(aTypeParameter.name);
ReferenceBinding superclassBinding = aTypeParameter.binding.superclass;
UnresolvedType superclass = UnresolvedType.forSignature(new String(superclassBinding.signature()));
UnresolvedType[] superinterfaces = null;
ReferenceBinding[] superInterfaceBindings = aTypeParameter.binding.superInterfaces;
if (superInterfaceBindings != null) {
superinterfaces = new UnresolvedType[superInterfaceBindings.length];
for (int i = 0; i < superInterfaceBindings.length; i++) {
superinterfaces[i] = UnresolvedType.forSignature(new String(superInterfaceBindings[i].signature()));
}
}
TypeVariable tv = new TypeVariable(name,superclass,superinterfaces);
tv.setDeclaringElement(factory.fromBinding(aTypeParameter.binding.declaringElement));
tv.setRank(aTypeParameter.binding.rank);
return tv;
}
public void ensureDelegateConsistent() {
}
}
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
/*******************************************************************************
* Copyright (c) 2005 Contributors.
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alexandre Vasseur initial implementation
* David Knibb weaving context enhancments
*******************************************************************************/
package org.aspectj.weaver.loadtime;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import org.aspectj.bridge.AbortException;
import org.aspectj.bridge.Constants;
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
import org.aspectj.util.LangUtil;
import org.aspectj.weaver.Lint;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.WeakClassLoaderReference;
import org.aspectj.weaver.World;
import org.aspectj.weaver.Lint.Kind;
import org.aspectj.weaver.bcel.BcelWeaver;
import org.aspectj.weaver.bcel.BcelWorld;
import org.aspectj.weaver.bcel.Utility;
import org.aspectj.weaver.loadtime.definition.Definition;
import org.aspectj.weaver.loadtime.definition.DocumentParser;
import org.aspectj.weaver.ltw.LTWWorld;
import org.aspectj.weaver.patterns.PatternParser;
import org.aspectj.weaver.patterns.TypePattern;
import org.aspectj.weaver.tools.GeneratedClassHandler;
import org.aspectj.weaver.tools.Trace;
import org.aspectj.weaver.tools.TraceFactory;
import org.aspectj.weaver.tools.WeavingAdaptor;
/**
* @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
*/
public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
private final static String AOP_XML = Constants.AOP_USER_XML + ";" + Constants.AOP_AJC_XML + ";" + Constants.AOP_OSGI_XML;
private boolean initialized;
private List m_dumpTypePattern = new ArrayList();
private boolean m_dumpBefore = false;
private List m_includeTypePattern = new ArrayList();
private List m_excludeTypePattern = new ArrayList();
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
private List m_includeStartsWith = new ArrayList();
private List m_excludeStartsWith = new ArrayList();
private List m_aspectExcludeTypePattern = new ArrayList();
private List m_aspectExcludeStartsWith = new ArrayList();
private List m_aspectIncludeTypePattern = new ArrayList();
private List m_aspectIncludeStartsWith = new ArrayList();
private StringBuffer namespace;
private IWeavingContext weavingContext;
private List concreteAspects = new ArrayList();
private static Trace trace = TraceFactory.getTraceFactory().getTrace(ClassLoaderWeavingAdaptor.class);
public ClassLoaderWeavingAdaptor() {
super();
if (trace.isTraceEnabled()) trace.enter("<init>",this);
if (trace.isTraceEnabled()) trace.exit("<init>");
}
/**
* We don't need a reference to the class loader and using it during
* construction can cause problems with recursion. It also makes sense
* to supply the weaving context during initialization to.
* @deprecated
*/
public ClassLoaderWeavingAdaptor(final ClassLoader deprecatedLoader, final IWeavingContext deprecatedContext) {
super();
if (trace.isTraceEnabled()) trace.enter("<init>",this,new Object[] { deprecatedLoader, deprecatedContext });
if (trace.isTraceEnabled()) trace.exit("<init>");
}
class SimpleGeneratedClassHandler implements GeneratedClassHandler {
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
private WeakClassLoaderReference loaderRef;
SimpleGeneratedClassHandler(ClassLoader loader) {
loaderRef = new WeakClassLoaderReference(loader);
}
/**
* Callback when we need to define a Closure in the JVM
*
*/
public void acceptClass(String name, byte[] bytes) {
try {
if (shouldDump(name.replace('/', '.'), false)) {
dump(name, bytes, false);
}
} catch (Throwable throwable) {
throwable.printStackTrace();
}
defineClass(loaderRef.getClassLoader(), name, bytes);
}
};
protected void initialize (final ClassLoader classLoader, IWeavingContext context) {
if (initialized) return;
boolean success = true;
this.weavingContext = context;
if (weavingContext == null) {
weavingContext = new DefaultWeavingContext(classLoader);
}
createMessageHandler();
this.generatedClassHandler =
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
new SimpleGeneratedClassHandler(classLoader);
List definitions = weavingContext.getDefinitions(classLoader,this);
if (definitions.isEmpty()) {
disable();
if (trace.isTraceEnabled()) trace.exit("initialize",definitions);
return;
}
bcelWorld = new LTWWorld(
classLoader, weavingContext,
getMessageHandler(), null);
weaver = new BcelWeaver(bcelWorld);
success = registerDefinitions(weaver, classLoader, definitions);
if (success) {
weaver.prepareForWeave();
enable();
success = weaveAndDefineConceteAspects();
}
if (success) {
enable();
}
else {
disable();
bcelWorld = null;
weaver = null;
}
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
initialized = true;
if (trace.isTraceEnabled()) trace.exit("initialize",isEnabled());
}
/**
* Load and cache the aop.xml/properties according to the classloader visibility rules
*
* @param weaver
* @param loader
*/
List parseDefinitions(final ClassLoader loader) {
if (trace.isTraceEnabled()) trace.enter("parseDefinitions", this);
List definitions = new ArrayList();
try {
info("register classloader " + getClassLoaderName(loader));
if (loader.equals(ClassLoader.getSystemClassLoader())) {
String file = System.getProperty("aj5.def", null);
if (file != null) {
info("using (-Daj5.def) " + file);
definitions.add(DocumentParser.parse((new File(file)).toURL()));
}
}
String resourcePath = System.getProperty("org.aspectj.weaver.loadtime.configuration",AOP_XML);
if (trace.isTraceEnabled()) trace.event("parseDefinitions",this,resourcePath);
StringTokenizer st = new StringTokenizer(resourcePath,";");
while(st.hasMoreTokens()){
Enumeration xmls = weavingContext.getResources(st.nextToken());
Set seenBefore = new HashSet();
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
while (xmls.hasMoreElements()) {
URL xml = (URL) xmls.nextElement();
if (trace.isTraceEnabled()) trace.event("parseDefinitions",this,xml);
if (!seenBefore.contains(xml)) {
info("using configuration " + weavingContext.getFile(xml));
definitions.add(DocumentParser.parse(xml));
seenBefore.add(xml);
}
else {
warn("ignoring duplicate definition: " + xml);
}
}
}
if (definitions.isEmpty()) {
info("no configuration found. Disabling weaver for class loader " + getClassLoaderName(loader));
}
} catch (Exception e) {
definitions.clear();
warn("parse definitions failed",e);
}
if (trace.isTraceEnabled()) trace.exit("parseDefinitions",definitions);
return definitions;
}
private boolean registerDefinitions(final BcelWeaver weaver, final ClassLoader loader, List definitions) {
if (trace.isTraceEnabled()) trace.enter("registerDefinitions",this,definitions);
boolean success = true;
try {
registerOptions(weaver, loader, definitions);
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
registerAspectExclude(weaver, loader, definitions);
registerAspectInclude(weaver, loader, definitions);
success = registerAspects(weaver, loader, definitions);
registerIncludeExclude(weaver, loader, definitions);
registerDump(weaver, loader, definitions);
} catch (Exception ex) {
trace.error("register definition failed",ex);
success = false;
warn("register definition failed",(ex instanceof AbortException)?null:ex);
}
if (trace.isTraceEnabled()) trace.exit("registerDefinitions",success);
return success;
}
private String getClassLoaderName (ClassLoader loader) {
return weavingContext.getClassLoaderName();
}
/**
* Configure the weaver according to the option directives
* TODO av - don't know if it is that good to reuse, since we only allow a small subset of options in LTW
*
* @param weaver
* @param loader
* @param definitions
*/
private void registerOptions(final BcelWeaver weaver, final ClassLoader loader, final List definitions) {
StringBuffer allOptions = new StringBuffer();
for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
Definition definition = (Definition) iterator.next();
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
allOptions.append(definition.getWeaverOptions()).append(' ');
}
Options.WeaverOption weaverOption = Options.parse(allOptions.toString(), loader, getMessageHandler());
World world = weaver.getWorld();
setMessageHandler(weaverOption.messageHandler);
world.setXlazyTjp(weaverOption.lazyTjp);
world.setXHasMemberSupportEnabled(weaverOption.hasMember);
world.setOptionalJoinpoints(weaverOption.optionalJoinpoints);
world.setPinpointMode(weaverOption.pinpoint);
weaver.setReweavableMode(weaverOption.notReWeavable);
world.performExtraConfiguration(weaverOption.xSet);
world.setXnoInline(weaverOption.noInline);
world.setBehaveInJava5Way(LangUtil.is15VMOrGreater());
world.setAddSerialVerUID(weaverOption.addSerialVersionUID);
bcelWorld.getLint().loadDefaultProperties();
bcelWorld.getLint().adviceDidNotMatch.setKind(null);
if (weaverOption.lintFile != null) {
InputStream resource = null;
try {
resource = loader.getResourceAsStream(weaverOption.lintFile);
Exception failure = null;
if (resource != null) {
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
try {
Properties properties = new Properties();
properties.load(resource);
world.getLint().setFromProperties(properties);
} catch (IOException e) {
failure = e;
}
}
if (failure != null || resource == null) {
warn("Cannot access resource for -Xlintfile:"+weaverOption.lintFile,failure);
}
} finally {
try { resource.close(); } catch (Throwable t) {;}
}
}
if (weaverOption.lint != null) {
if (weaverOption.lint.equals("default")) {
bcelWorld.getLint().loadDefaultProperties();
} else {
bcelWorld.getLint().setAll(weaverOption.lint);
}
}
}
private void registerAspectExclude(final BcelWeaver weaver, final ClassLoader loader, final List definitions) {
String fastMatchInfo = null;
for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
Definition definition = (Definition) iterator.next();
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
for (Iterator iterator1 = definition.getAspectExcludePatterns().iterator(); iterator1.hasNext();) {
String exclude = (String) iterator1.next();
TypePattern excludePattern = new PatternParser(exclude).parseTypePattern();
m_aspectExcludeTypePattern.add(excludePattern);
fastMatchInfo = looksLikeStartsWith(exclude);
if (fastMatchInfo != null) {
m_aspectExcludeStartsWith.add(fastMatchInfo);
}
}
}
}
private void registerAspectInclude(final BcelWeaver weaver, final ClassLoader loader, final List definitions) {
String fastMatchInfo = null;
for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
Definition definition = (Definition) iterator.next();
for (Iterator iterator1 = definition.getAspectIncludePatterns().iterator(); iterator1.hasNext();) {
String include = (String) iterator1.next();
TypePattern includePattern = new PatternParser(include).parseTypePattern();
m_aspectIncludeTypePattern.add(includePattern);
fastMatchInfo = looksLikeStartsWith(include);
if (fastMatchInfo != null) {
m_aspectIncludeStartsWith.add(fastMatchInfo);
}
}
}
}
protected void lint (String name, String[] infos) {
Lint lint = bcelWorld.getLint();
Kind kind = lint.getLintKind(name);
kind.signal(infos,null,null);
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
}
public String getContextId () {
return weavingContext.getId();
}
/**
* Register the aspect, following include / exclude rules
*
* @param weaver
* @param loader
* @param definitions
*/
private boolean registerAspects(final BcelWeaver weaver, final ClassLoader loader, final List definitions) {
if (trace.isTraceEnabled()) trace.enter("registerAspects",this, new Object[] { weaver, loader, definitions} );
boolean success = true;
for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
Definition definition = (Definition) iterator.next();
for (Iterator aspects = definition.getAspectClassNames().iterator(); aspects.hasNext();) {
String aspectClassName = (String) aspects.next();
if (acceptAspect(aspectClassName)) {
info("register aspect " + aspectClassName);
weaver.addLibraryAspect(aspectClassName);
if(namespace==null){
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
namespace=new StringBuffer(aspectClassName);
}else{
namespace = namespace.append(";"+aspectClassName);
}
}
else {
lint("aspectExcludedByConfiguration", new String[] { aspectClassName, getClassLoaderName(loader) });
}
}
}
for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
Definition definition = (Definition) iterator.next();
for (Iterator aspects = definition.getConcreteAspects().iterator(); aspects.hasNext();) {
Definition.ConcreteAspect concreteAspect = (Definition.ConcreteAspect) aspects.next();
if (acceptAspect(concreteAspect.name)) {
info("define aspect " + concreteAspect.name);
ConcreteAspectCodeGen gen = new ConcreteAspectCodeGen(concreteAspect, weaver.getWorld());
if (!gen.validate()) {
error("Concrete-aspect '"+concreteAspect.name+"' could not be registered");
success = false;
break;
}
((BcelWorld)weaver.getWorld()).addSourceObjectType(Utility.makeJavaClass(concreteAspect.name, gen.getBytes()));
concreteAspects.add(gen);
weaver.addLibraryAspect(concreteAspect.name);
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
if(namespace==null){
namespace=new StringBuffer(concreteAspect.name);
}else{
namespace = namespace.append(";"+concreteAspect.name);
}
}
}
}
if (!success) {
warn("failure(s) registering aspects. Disabling weaver for class loader " + getClassLoaderName(loader));
}
else if (namespace == null) {
success = false;
info("no aspects registered. Disabling weaver for class loader " + getClassLoaderName(loader));
}
if (trace.isTraceEnabled()) trace.exit("registerAspects",success);
return success;
}
private boolean weaveAndDefineConceteAspects () {
if (trace.isTraceEnabled()) trace.enter("weaveAndDefineConceteAspects",this,concreteAspects);
boolean success = true;
for (Iterator iterator = concreteAspects.iterator(); iterator.hasNext();) {
ConcreteAspectCodeGen gen = (ConcreteAspectCodeGen)iterator.next();
String name = gen.getClassName();
byte[] bytes = gen.getBytes();
try {
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
byte[] newBytes = weaveClass(name, bytes,true);
this.generatedClassHandler.acceptClass(name,newBytes);
}
catch (IOException ex) {
trace.error("weaveAndDefineConceteAspects",ex);
error("exception weaving aspect '" + name + "'",ex);
}
}
if (trace.isTraceEnabled()) trace.exit("weaveAndDefineConceteAspects",success);
return success;
}
/**
* Register the include / exclude filters
* We duplicate simple patterns in startWith filters that will allow faster matching without ResolvedType
*
* @param weaver
* @param loader
* @param definitions
*/
private void registerIncludeExclude(final BcelWeaver weaver, final ClassLoader loader, final List definitions) {
String fastMatchInfo = null;
for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
Definition definition = (Definition) iterator.next();
for (Iterator iterator1 = definition.getIncludePatterns().iterator(); iterator1.hasNext();) {
String include = (String) iterator1.next();
TypePattern includePattern = new PatternParser(include).parseTypePattern();
m_includeTypePattern.add(includePattern);
fastMatchInfo = looksLikeStartsWith(include);
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
if (fastMatchInfo != null) {
m_includeStartsWith.add(fastMatchInfo);
}
}
for (Iterator iterator1 = definition.getExcludePatterns().iterator(); iterator1.hasNext();) {
String exclude = (String) iterator1.next();
TypePattern excludePattern = new PatternParser(exclude).parseTypePattern();
m_excludeTypePattern.add(excludePattern);
fastMatchInfo = looksLikeStartsWith(exclude);
if (fastMatchInfo != null) {
m_excludeStartsWith.add(fastMatchInfo);
}
}
}
}
/**
* Checks if the type pattern can be handled as a startswith check
*
* TODO AV - enhance to support "char.sss" ie FQN direclty (match iff equals)
* we could also add support for "*..*charss" endsWith style?
*
* @param typePattern
* @return null if not possible, or the startWith sequence to test against
*/
private String looksLikeStartsWith(String typePattern) {
if (typePattern.indexOf('@') >= 0
|| typePattern.indexOf('+') >= 0
|| typePattern.indexOf(' ') >= 0
|| typePattern.charAt(typePattern.length()-1) != '*') {
return null;
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
}
int length = typePattern.length();
if (typePattern.endsWith("..*") && length > 3) {
if (typePattern.indexOf("..") == length-3
&& typePattern.indexOf('*') == length-1) {
return typePattern.substring(0, length-2).replace('$', '.');
}
}
return null;
}
/**
* Register the dump filter
*
* @param weaver
* @param loader
* @param definitions
*/
private void registerDump(final BcelWeaver weaver, final ClassLoader loader, final List definitions) {
for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
Definition definition = (Definition) iterator.next();
for (Iterator iterator1 = definition.getDumpPatterns().iterator(); iterator1.hasNext();) {
String dump = (String) iterator1.next();
TypePattern pattern = new PatternParser(dump).parseTypePattern();
m_dumpTypePattern.add(pattern);
}
if (definition.shouldDumpBefore()) {
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
m_dumpBefore = true;
}
}
}
protected boolean accept(String className, byte[] bytes) {
if (m_excludeTypePattern.isEmpty() && m_includeTypePattern.isEmpty()) {
return true;
}
String fastClassName = className.replace('/', '.').replace('$', '.');
for (int i = 0; i < m_excludeStartsWith.size(); i++) {
if (fastClassName.startsWith((String)m_excludeStartsWith.get(i))) {
return false;
}
}
/*
* Bug 120363
* If we have an exclude pattern that cannot be matched using "starts with"
* then we cannot fast accept
*/
if (m_excludeTypePattern.isEmpty()) {
boolean fastAccept = false;
for (int i = 0; i < m_includeStartsWith.size(); i++) {
fastAccept = fastClassName.startsWith((String)m_includeStartsWith.get(i));
if (fastAccept) {
break;
}
}
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
}
ensureDelegateInitialized(className,bytes);
ResolvedType classInfo = delegateForCurrentClass.getResolvedTypeX();
for (Iterator iterator = m_excludeTypePattern.iterator(); iterator.hasNext();) {
TypePattern typePattern = (TypePattern) iterator.next();
if (typePattern.matchesStatically(classInfo)) {
return false;
}
}
boolean accept = true;
for (Iterator iterator = m_includeTypePattern.iterator(); iterator.hasNext();) {
TypePattern typePattern = (TypePattern) iterator.next();
accept = typePattern.matchesStatically(classInfo);
if (accept) {
break;
}
}
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
return accept;
}
private boolean acceptAspect(String aspectClassName) {
if (m_aspectExcludeTypePattern.isEmpty() && m_aspectIncludeTypePattern.isEmpty()) {
return true;
}
String fastClassName = aspectClassName.replace('/', '.').replace('.', '$');
for (int i = 0; i < m_aspectExcludeStartsWith.size(); i++) {
if (fastClassName.startsWith((String)m_aspectExcludeStartsWith.get(i))) {
return false;
}
}
for (int i = 0; i < m_aspectIncludeStartsWith.size(); i++) {
if (fastClassName.startsWith((String)m_aspectIncludeStartsWith.get(i))) {
return true;
}
}
ResolvedType classInfo = weaver.getWorld().resolve(UnresolvedType.forName(aspectClassName), true);
for (Iterator iterator = m_aspectExcludeTypePattern.iterator(); iterator.hasNext();) {
TypePattern typePattern = (TypePattern) iterator.next();
if (typePattern.matchesStatically(classInfo)) {
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
return false;
}
}
boolean accept = true;
for (Iterator iterator = m_aspectIncludeTypePattern.iterator(); iterator.hasNext();) {
TypePattern typePattern = (TypePattern) iterator.next();
accept = typePattern.matchesStatically(classInfo);
if (accept) {
break;
}
}
return accept;
}
protected boolean shouldDump(String className, boolean before) {
if (before && !m_dumpBefore) {
return false;
}
if (m_dumpTypePattern.isEmpty()) {
return false;
}
ResolvedType classInfo = weaver.getWorld().resolve(UnresolvedType.forName(className), true);
for (Iterator iterator = m_dumpTypePattern.iterator(); iterator.hasNext();) {
TypePattern typePattern = (TypePattern) iterator.next();
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
if (typePattern.matchesStatically(classInfo)) {
return true;
}
}
return false;
}
/*
* shared classes methods
*/
/**
* @return Returns the key.
*/
public String getNamespace() {
if(namespace==null) return "";
else return new String(namespace);
}
/**
* Check to see if any classes are stored in the generated classes cache.
* Then flush the cache if it is not empty
* @param className TODO
* @return true if a class has been generated and is stored in the cache
*/
public boolean generatedClassesExistFor (String className) {
if (className == null) return !generatedClasses.isEmpty();
else return generatedClasses.containsKey(className);
}
/**
* Flush the generated classes cache
*/
|
238,666 |
Bug 238666 Allow the ltw configuration to be directly specified rather than discovered on the classpath
|
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
|
resolved fixed
|
df49b5c
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-06T18:10:47Z | 2008-06-26T19:53:20Z |
loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
|
public void flushGeneratedClasses() {
generatedClasses = new HashMap();
}
private void defineClass(ClassLoader loader, String name, byte[] bytes) {
if (trace.isTraceEnabled()) trace.enter("defineClass",this,new Object[] {loader,name,bytes});
Object clazz = null;
debug("generating class '" + name + "'");
try {
Method defineClass = ClassLoader.class.getDeclaredMethod(
"defineClass", new Class[] { String.class,
bytes.getClass(), int.class, int.class });
defineClass.setAccessible(true);
clazz = defineClass.invoke(loader, new Object[] { name, bytes,
new Integer(0), new Integer(bytes.length) });
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof LinkageError) {
warn("define generated class failed",e.getTargetException());
} else {
warn("define generated class failed",e.getTargetException());
}
} catch (Exception e) {
warn("define generated class failed",e);
}
if (trace.isTraceEnabled()) trace.exit("defineClass",clazz);
}
}
|
216,067 |
Bug 216067 Typo in point example
| null |
resolved fixed
|
6d906dc
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-20T19:31:42Z | 2008-01-22T02:46:40Z |
docs/dist/doc/examples/introduction/Point.java
|
/*
Copyright (c) Xerox Corporation 1998-2002. All rights reserved.
Use and copying of this software and preparation of derivative works based
upon this software are permitted. Any distribution of this software or
derivative works must comply with all applicable United States export control
laws.
This software is made available AS IS, and Xerox Corporation makes no warranty
about the software, its performance or its conformity to any specification.
*/
package introduction;
public class Point {
protected double x = 0;
protected double y = 0;
protected double theta = 0;
protected double rho = 0;
protected boolean polar = true;
protected boolean rectangular = true;
public double getX(){
makeRectangular();
return x;
}
|
216,067 |
Bug 216067 Typo in point example
| null |
resolved fixed
|
6d906dc
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-20T19:31:42Z | 2008-01-22T02:46:40Z |
docs/dist/doc/examples/introduction/Point.java
|
public double getY(){
makeRectangular();
return y;
}
public double getTheta(){
makePolar();
return theta;
}
public double getRho(){
makePolar();
return rho;
}
public void setRectangular(double newX, double newY){
x = newX;
y = newY;
rectangular = true;
polar = false;
}
public void setPolar(double newTheta, double newRho){
theta = newTheta;
rho = newRho;
rectangular = false;
polar = true;
}
public void rotate(double angle){
setPolar(theta + angle, rho);
}
public void offset(double deltaX, double deltaY){
setRectangular(x + deltaX, y + deltaY);
}
|
216,067 |
Bug 216067 Typo in point example
| null |
resolved fixed
|
6d906dc
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-20T19:31:42Z | 2008-01-22T02:46:40Z |
docs/dist/doc/examples/introduction/Point.java
|
protected void makePolar(){
if (!polar){
theta = Math.atan2(y,x);
rho = y / Math.sin(theta);
polar = true;
}
}
protected void makeRectangular(){
if (!rectangular) {
x = rho * Math.sin(theta);
y = rho * Math.cos(theta);
rectangular = true;
}
}
public String toString(){
return "(" + getX() + ", " + getY() + ")["
+ getTheta() + " : " + getRho() + "]";
}
public static void main(String[] args){
Point p1 = new Point();
System.out.println("p1 =" + p1);
p1.setRectangular(5,2);
System.out.println("p1 =" + p1);
p1.setPolar( Math.PI / 4.0 , 1.0);
System.out.println("p1 =" + p1);
p1.setPolar( 0.3805 , 5.385);
System.out.println("p1 =" + p1);
}
}
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.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
* Adrian Colyer added constructor to populate javaOptions with
* default settings - 01.20.2003
* Bugzilla #29768, 29769
* ******************************************************************/
package org.aspectj.ajdt.internal.core.builder;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager;
import org.aspectj.util.FileUtil;
/**
* All configuration information needed to run the AspectJ compiler. Compiler options (as opposed to path information) are held in
* an AjCompilerOptions instance
*/
public class AjBuildConfig implements CompilerConfigurationChangeFlags {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
private boolean shouldProceed = true;
public static final String AJLINT_IGNORE = "ignore";
public static final String AJLINT_WARN = "warn";
public static final String AJLINT_ERROR = "error";
public static final String AJLINT_DEFAULT = "default";
private File outputDir;
private File outputJar;
private String outxmlName;
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
private CompilationResultDestinationManager compilationResultDestinationManager = null;
private ListsourceRoots = new ArrayList();
private ListchangedFiles;
private Listfiles = new ArrayList();
private List binaryFiles = new ArrayList();
private ListinJars = new ArrayList();
private ListinPath = new ArrayList();
private MapsourcePathResources = new HashMap();
private Listaspectpath = new ArrayList();
private Listclasspath = new ArrayList();
private Listbootclasspath = new ArrayList();
private File configFile;
private String lintMode = AJLINT_DEFAULT;
private File lintSpecFile = null;
private int changes = EVERYTHING;
private AjCompilerOptions options;
private boolean override = true;
private boolean incrementalMode;
private File incrementalFile;
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("BuildConfig[" + (configFile == null ? "null" : configFile.getAbsoluteFile().toString()) + "] #Files="
+ files.size());
return sb.toString();
}
public static class BinarySourceFile {
public BinarySourceFile(File dir, File src) {
this.fromInPathDirectory = dir;
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
this.binSrc = src;
}
public File fromInPathDirectory;
public File binSrc;
public boolean equals(Object obj) {
if (obj != null && (obj instanceof BinarySourceFile)) {
BinarySourceFile other = (BinarySourceFile) obj;
return (binSrc.equals(other.binSrc));
}
return false;
}
public int hashCode() {
return binSrc != null ? binSrc.hashCode() : 0;
}
}
/**
* Intialises the javaOptions Map to hold the default JDT Compiler settings. Added by AMC 01.20.2003 in reponse to bug #29768
* and enh. 29769. The settings here are duplicated from those set in org.eclipse.jdt.internal.compiler.batch.Main, but I've
* elected to copy them rather than refactor the JDT class since this keeps integration with future JDT releases easier (?).
*/
public AjBuildConfig() {
options = new AjCompilerOptions();
}
/**
* returned files includes
* <ul>
* <li>files explicitly listed on command-line</li>
* <li>files listed by reference in argument list files</li>
* <li>files contained in sourceRootDir if that exists</li>
* </ul>
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
*
* @return all source files that should be compiled.
*/
public ListgetFiles() {
return files;
}
/**
* returned files includes all .class files found in a directory on the inpath, but does not include .class files contained
* within jars.
*/
public ListgetBinaryFiles() {
return binaryFiles;
}
public File getOutputDir() {
return outputDir;
}
public CompilationResultDestinationManager getCompilationResultDestinationManager() {
return this.compilationResultDestinationManager;
}
public void setCompilationResultDestinationManager(CompilationResultDestinationManager mgr) {
this.compilationResultDestinationManager = mgr;
}
public void setFiles(List files) {
this.files = files;
}
public void setOutputDir(File outputDir) {
this.outputDir = outputDir;
}
public AjCompilerOptions getOptions() {
return options;
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
}
/**
* This does not include -bootclasspath but includes -extdirs and -classpath
*/
public List getClasspath() {
return classpath;
}
public void setClasspath(List classpath) {
this.classpath = classpath;
}
public List getBootclasspath() {
return bootclasspath;
}
public void setBootclasspath(List bootclasspath) {
this.bootclasspath = bootclasspath;
}
public File getOutputJar() {
return outputJar;
}
public String getOutxmlName() {
return outxmlName;
}
public ListgetInpath() {
return inPath;
}
public ListgetInJars() {
return inJars;
}
public Map getSourcePathResources() {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
return sourcePathResources;
}
public void setOutputJar(File outputJar) {
this.outputJar = outputJar;
}
public void setOutxmlName(String name) {
this.outxmlName = name;
}
public void setInJars(List sourceJars) {
this.inJars = sourceJars;
}
public void setInPath(List dirsOrJars) {
inPath = dirsOrJars;
binaryFiles = new ArrayList();
FileFilter filter = new FileFilter() {
public boolean accept(File pathname) {
return pathname.getPath().endsWith(".class");
}
};
for (Iterator iter = dirsOrJars.iterator(); iter.hasNext();) {
File inpathElement = (File) iter.next();
if (inpathElement.isDirectory()) {
File[] files = FileUtil.listFiles(inpathElement, filter);
for (int i = 0; i < files.length; i++) {
binaryFiles.add(new BinarySourceFile(inpathElement, files[i]));
}
}
}
}
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
public List getSourceRoots() {
return sourceRoots;
}
public void setSourceRoots(List sourceRootDir) {
this.sourceRoots = sourceRootDir;
}
public File getConfigFile() {
return configFile;
}
public void setConfigFile(File configFile) {
this.configFile = configFile;
}
public void setIncrementalMode(boolean incrementalMode) {
this.incrementalMode = incrementalMode;
}
public boolean isIncrementalMode() {
return incrementalMode;
}
public void setIncrementalFile(File incrementalFile) {
this.incrementalFile = incrementalFile;
}
public boolean isIncrementalFileMode() {
return (null != incrementalFile);
}
/**
* @return List (String) classpath of bootclasspath, injars, inpath, aspectpath entries, specified classpath (extdirs, and
* classpath), and output dir or jar
*/
public List getFullClasspath() {
List full = new ArrayList();
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
full.addAll(getBootclasspath());
for (Iterator i = inJars.iterator(); i.hasNext();) {
full.add(((File) i.next()).getAbsolutePath());
}
for (Iterator i = inPath.iterator(); i.hasNext();) {
full.add(((File) i.next()).getAbsolutePath());
}
for (Iterator i = aspectpath.iterator(); i.hasNext();) {
full.add(((File) i.next()).getAbsolutePath());
}
full.addAll(getClasspath());
return full;
}
public File getLintSpecFile() {
return lintSpecFile;
}
public void setLintSpecFile(File lintSpecFile) {
this.lintSpecFile = lintSpecFile;
}
public List getAspectpath() {
return aspectpath;
}
public void setAspectpath(List aspectpath) {
this.aspectpath = aspectpath;
}
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
public boolean hasSources() {
return ((null != configFile) || (0 < sourceRoots.size()) || (0 < files.size()) || (0 < inJars.size()) || (0 < inPath.size()));
}
/**
* Install global values into local config unless values conflict:
* <ul>
* <li>Collections are unioned</li>
* <li>values takes local value unless default and global set</li>
* <li>this only sets one of outputDir and outputJar as needed</li>
* <ul>
* This also configures super if javaOptions change.
*
* @param global the AjBuildConfig to read globals from
*/
public void installGlobals(AjBuildConfig global) {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
join(aspectpath, global.aspectpath);
join(classpath, global.classpath);
if (null == configFile) {
configFile = global.configFile;
}
if (!isEmacsSymMode() && global.isEmacsSymMode()) {
setEmacsSymMode(true);
}
join(files, global.files);
if (!isGenerateModelMode() && global.isGenerateModelMode()) {
setGenerateModelMode(true);
}
if (null == incrementalFile) {
incrementalFile = global.incrementalFile;
}
if (!incrementalMode && global.incrementalMode) {
incrementalMode = true;
}
if (isCheckRuntimeVersion() && !global.isCheckRuntimeVersion()) {
setCheckRuntimeVersion(false);
}
join(inJars, global.inJars);
join(inPath, global.inPath);
if ((null == lintMode) || (AJLINT_DEFAULT.equals(lintMode))) {
setLintMode(global.lintMode);
}
if (null == lintSpecFile) {
lintSpecFile = global.lintSpecFile;
}
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
if (!isTerminateAfterCompilation() && global.isTerminateAfterCompilation()) {
setTerminateAfterCompilation(true);
}
if ((null == outputDir) && (null == outputJar)) {
if (null != global.outputDir) {
outputDir = global.outputDir;
}
if (null != global.outputJar) {
outputJar = global.outputJar;
}
}
join(sourceRoots, global.sourceRoots);
if (!isXnoInline() && global.isXnoInline()) {
setXnoInline(true);
}
if (!isXserializableAspects() && global.isXserializableAspects()) {
setXserializableAspects(true);
}
if (!isXlazyTjp() && global.isXlazyTjp()) {
setXlazyTjp(true);
}
if (!getProceedOnError() && global.getProceedOnError()) {
setProceedOnError(true);
}
setTargetAspectjRuntimeLevel(global.getTargetAspectjRuntimeLevel());
setXJoinpoints(global.getXJoinpoints());
if (!isXHasMemberEnabled() && global.isXHasMemberEnabled()) {
setXHasMemberSupport(true);
}
if (!isXNotReweavable() && global.isXNotReweavable()) {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
setXnotReweavable(true);
}
setOutxmlName(global.getOutxmlName());
setXconfigurationInfo(global.getXconfigurationInfo());
setAddSerialVerUID(global.isAddSerialVerUID());
}
void join(Collection local, Collection global) {
for (Iterator iter = global.iterator(); iter.hasNext();) {
Object next = iter.next();
if (!local.contains(next)) {
local.add(next);
}
}
}
void join(Map local, Map global) {
for (Iterator iter = global.keySet().iterator(); iter.hasNext();) {
Object key = iter.next();
if (override || (null == local.get(key))) {
Object value = global.get(key);
if (null != value) {
local.put(key, value);
}
}
}
}
public void setSourcePathResources(Map map) {
sourcePathResources = map;
}
/**
* used to indicate whether to proceed after parsing config
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
*/
public boolean shouldProceed() {
return shouldProceed;
}
public void doNotProceed() {
shouldProceed = false;
}
public String getLintMode() {
return lintMode;
}
public void setLintMode(String lintMode) {
this.lintMode = lintMode;
String lintValue = null;
if (AJLINT_IGNORE.equals(lintMode)) {
lintValue = AjCompilerOptions.IGNORE;
} else if (AJLINT_WARN.equals(lintMode)) {
lintValue = AjCompilerOptions.WARNING;
} else if (AJLINT_ERROR.equals(lintMode)) {
lintValue = AjCompilerOptions.ERROR;
}
if (lintValue != null) {
Map lintOptions = new HashMap();
lintOptions.put(AjCompilerOptions.OPTION_ReportInvalidAbsoluteTypeName, lintValue);
lintOptions.put(AjCompilerOptions.OPTION_ReportInvalidWildcardTypeName, lintValue);
lintOptions.put(AjCompilerOptions.OPTION_ReportUnresolvableMember, lintValue);
lintOptions.put(AjCompilerOptions.OPTION_ReportTypeNotExposedToWeaver, lintValue);
lintOptions.put(AjCompilerOptions.OPTION_ReportShadowNotInStructure, lintValue);
lintOptions.put(AjCompilerOptions.OPTION_ReportUnmatchedSuperTypeInCall, lintValue);
lintOptions.put(AjCompilerOptions.OPTION_ReportCannotImplementLazyTJP, lintValue);
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
lintOptions.put(AjCompilerOptions.OPTION_ReportNeedSerialVersionUIDField, lintValue);
lintOptions.put(AjCompilerOptions.OPTION_ReportIncompatibleSerialVersion, lintValue);
options.set(lintOptions);
}
}
public boolean isTerminateAfterCompilation() {
return options.terminateAfterCompilation;
}
public void setTerminateAfterCompilation(boolean b) {
options.terminateAfterCompilation = b;
}
public boolean isXserializableAspects() {
return options.xSerializableAspects;
}
public void setXserializableAspects(boolean xserializableAspects) {
options.xSerializableAspects = xserializableAspects;
}
public void setXJoinpoints(String jps) {
options.xOptionalJoinpoints = jps;
}
public String getXJoinpoints() {
return options.xOptionalJoinpoints;
}
public boolean isXnoInline() {
return options.xNoInline;
}
public void setXnoInline(boolean xnoInline) {
options.xNoInline = xnoInline;
}
public boolean isXlazyTjp() {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
return options.xLazyThisJoinPoint;
}
public void setXlazyTjp(boolean b) {
options.xLazyThisJoinPoint = b;
}
public void setXnotReweavable(boolean b) {
options.xNotReweavable = b;
}
public void setXconfigurationInfo(String info) {
options.xConfigurationInfo = info;
}
public String getXconfigurationInfo() {
return options.xConfigurationInfo;
}
public void setXHasMemberSupport(boolean enabled) {
options.xHasMember = enabled;
}
public boolean isXHasMemberEnabled() {
return options.xHasMember;
}
public void setXdevPinpointMode(boolean enabled) {
options.xdevPinpoint = enabled;
}
public boolean isXdevPinpoint() {
return options.xdevPinpoint;
}
public void setAddSerialVerUID(boolean b) {
options.addSerialVerUID = b;
}
public boolean isAddSerialVerUID() {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
return options.addSerialVerUID;
}
public boolean isXNotReweavable() {
return options.xNotReweavable;
}
public boolean isGenerateJavadocsInModelMode() {
return options.generateJavaDocsInModel;
}
public void setGenerateJavadocsInModelMode(boolean generateJavadocsInModelMode) {
options.generateJavaDocsInModel = generateJavadocsInModelMode;
}
public boolean isGenerateCrossRefsMode() {
return options.generateCrossRefs;
}
public void setGenerateCrossRefsMode(boolean on) {
options.generateCrossRefs = on;
}
public boolean isCheckRuntimeVersion() {
return options.checkRuntimeVersion;
}
public void setCheckRuntimeVersion(boolean on) {
options.checkRuntimeVersion = on;
}
public boolean isEmacsSymMode() {
return options.generateEmacsSymFiles;
}
public void setEmacsSymMode(boolean emacsSymMode) {
options.generateEmacsSymFiles = emacsSymMode;
}
public boolean isGenerateModelMode() {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
return options.generateModel;
}
public void setGenerateModelMode(boolean structureModelMode) {
options.generateModel = structureModelMode;
}
public boolean isNoAtAspectJAnnotationProcessing() {
return options.noAtAspectJProcessing;
}
public void setNoAtAspectJAnnotationProcessing(boolean noProcess) {
options.noAtAspectJProcessing = noProcess;
}
public void setShowWeavingInformation(boolean b) {
options.showWeavingInformation = true;
}
public boolean getShowWeavingInformation() {
return options.showWeavingInformation;
}
public void setProceedOnError(boolean b) {
options.proceedOnError = b;
}
public boolean getProceedOnError() {
return options.proceedOnError;
}
public void setBehaveInJava5Way(boolean b) {
options.behaveInJava5Way = b;
}
public boolean getBehaveInJava5Way() {
return options.behaveInJava5Way;
}
public void setTargetAspectjRuntimeLevel(String level) {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
|
options.targetAspectjRuntimeLevel = level;
}
public String getTargetAspectjRuntimeLevel() {
return options.targetAspectjRuntimeLevel;
}
/**
* Indicates what has changed in this configuration compared to the last time it was used, allowing the state management logic
* to make intelligent optimizations and skip unnecessary work.
*
* @param changes set of bitflags, see {@link CompilerConfigurationChangeFlags} for flags
*/
public void setChanged(int changes) {
this.changes = changes;
}
/**
* Return the bit flags indicating what has changed since the last time this config was used.
*
* @return the bitflags according too {@link CompilerConfigurationChangeFlags}
*/
public int getChanged() {
return this.changes;
}
public void setModifiedFiles(List projectSourceFilesChanged) {
this.changedFiles = projectSourceFilesChanged;
}
public List getModifiedFiles() {
return this.changedFiles;
}
}
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
/* *******************************************************************
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http:www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PARC initial implementation
* ******************************************************************/
package org.aspectj.ajdt.internal.core.builder;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
import java.util.Map;
import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import org.aspectj.ajdt.internal.compiler.AjCompilerAdapter;
import org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter;
import org.aspectj.ajdt.internal.compiler.IBinarySourceProvider;
import org.aspectj.ajdt.internal.compiler.ICompilerAdapter;
import org.aspectj.ajdt.internal.compiler.ICompilerAdapterFactory;
import org.aspectj.ajdt.internal.compiler.IIntermediateResultsRequestor;
import org.aspectj.ajdt.internal.compiler.IOutputClassFileNameProvider;
import org.aspectj.ajdt.internal.compiler.InterimCompilationResult;
import org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment;
import org.aspectj.ajdt.internal.compiler.lookup.AnonymousClassPublisher;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.problem.AjProblemReporter;
import org.aspectj.asm.AsmManager;
import org.aspectj.asm.IHierarchy;
import org.aspectj.asm.IProgramElement;
import org.aspectj.asm.internal.ProgramElement;
import org.aspectj.bridge.AbortException;
import org.aspectj.bridge.CountingMessageHandler;
import org.aspectj.bridge.ILifecycleAware;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.IProgressListener;
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.SourceLocation;
import org.aspectj.bridge.Version;
import org.aspectj.bridge.context.CompilationAndWeavingContext;
import org.aspectj.bridge.context.ContextFormatter;
import org.aspectj.bridge.context.ContextToken;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
import org.aspectj.org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
import org.aspectj.org.eclipse.jdt.internal.compiler.ICompilerRequestor;
import org.aspectj.org.eclipse.jdt.internal.compiler.IProblemFactory;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.CompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
import org.aspectj.tools.ajc.Main;
import org.aspectj.util.FileUtil;
import org.aspectj.weaver.CustomMungerFactory;
import org.aspectj.weaver.Dump;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.World;
import org.aspectj.weaver.bcel.BcelWeaver;
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
import org.aspectj.weaver.bcel.BcelWorld;
import org.aspectj.weaver.bcel.UnwovenClassFile;
import org.eclipse.core.runtime.OperationCanceledException;
public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourceProvider,ICompilerAdapterFactory {
private static final String CROSSREFS_FILE_NAME = "build.lst";
private static final String CANT_WRITE_RESULT = "unable to write compilation result";
private static final String MANIFEST_NAME = "META-INF/MANIFEST.MF";
public static boolean COPY_INPATH_DIR_RESOURCES = false;
private static boolean DO_RUNTIME_VERSION_CHECK = false;
static final boolean FAIL_IF_RUNTIME_NOT_FOUND = false;
private static final FileFilter binarySourceFilter =
new FileFilter() {
public boolean accept(File f) {
return f.getName().endsWith(".class");
}};
/**
* This builder is static so that it can be subclassed and reset. However, note
* that there is only one builder present, so if two extendsion reset it, only
* the latter will get used.
*/
public static AsmHierarchyBuilder asmHierarchyBuilder = new AsmHierarchyBuilder();
static {
CompilationAndWeavingContext.setMultiThreaded(false);
CompilationAndWeavingContext.registerFormatter(
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
CompilationAndWeavingContext.BATCH_BUILD, new AjBuildContexFormatter());
CompilationAndWeavingContext.registerFormatter(
CompilationAndWeavingContext.INCREMENTAL_BUILD, new AjBuildContexFormatter());
}
private IProgressListener progressListener = null;
private boolean environmentSupportsIncrementalCompilation = false;
private int compiledCount;
private int sourceFileCount;
private JarOutputStream zos;
private boolean batchCompile = true;
private INameEnvironment environment;
private Map binarySourcesForTheNextCompile = new HashMap();
private IHierarchy structureModel;
public AjBuildConfig buildConfig;
private boolean ignoreOutxml;
private boolean wasFullBuild = true;
AjState state = new AjState(this);
/**
* Enable check for runtime version, used only by Ant/command-line Main.
* @param main Main unused except to limit to non-null clients.
*/
public static void enableRuntimeVersionCheck(Main caller) {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
DO_RUNTIME_VERSION_CHECK = null != caller;
}
public BcelWeaver getWeaver() { return state.getWeaver();}
public BcelWorld getBcelWorld() { return state.getBcelWorld();}
public CountingMessageHandler handler;
private CustomMungerFactory customMungerFactory;
public AjBuildManager(IMessageHandler holder) {
super();
this.handler = CountingMessageHandler.makeCountingMessageHandler(holder);
}
public void environmentSupportsIncrementalCompilation(boolean itDoes) {
this.environmentSupportsIncrementalCompilation = itDoes;
}
public boolean doGenerateModel() {
return buildConfig.isGenerateModelMode();
}
public boolean batchBuild(
AjBuildConfig buildConfig,
IMessageHandler baseHandler)
throws IOException, AbortException {
return doBuild(buildConfig, baseHandler, true);
}
public boolean incrementalBuild(
AjBuildConfig buildConfig,
IMessageHandler baseHandler)
throws IOException, AbortException {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
return doBuild(buildConfig, baseHandler, false);
}
protected boolean doBuild(
AjBuildConfig buildConfig,
IMessageHandler baseHandler,
boolean batch) throws IOException, AbortException {
boolean ret = true;
batchCompile = batch;
wasFullBuild = batch;
if (baseHandler instanceof ILifecycleAware) {
((ILifecycleAware)baseHandler).buildStarting(!batch);
}
CompilationAndWeavingContext.reset();
int phase = batch ? CompilationAndWeavingContext.BATCH_BUILD : CompilationAndWeavingContext.INCREMENTAL_BUILD;
ContextToken ct = CompilationAndWeavingContext.enteringPhase(phase ,buildConfig);
try {
if (batch) {
this.state = new AjState(this);
}
this.state.setCouldBeSubsequentIncrementalBuild(this.environmentSupportsIncrementalCompilation);
boolean canIncremental = state.prepareForNextBuild(buildConfig);
if (!canIncremental && !batch) {
CompilationAndWeavingContext.leavingPhase(ct);
if (state.listenerDefined()) state.getListener().recordDecision("Falling back to batch compilation");
return doBuild(buildConfig, baseHandler, true);
}
this.handler =
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
CountingMessageHandler.makeCountingMessageHandler(baseHandler);
if (buildConfig==null || buildConfig.isCheckRuntimeVersion()) {
if (DO_RUNTIME_VERSION_CHECK) {
String check = checkRtJar(buildConfig);
if (check != null) {
if (FAIL_IF_RUNTIME_NOT_FOUND) {
MessageUtil.error(handler, check);
CompilationAndWeavingContext.leavingPhase(ct);
return false;
} else {
MessageUtil.warn(handler, check);
}
}
}
}
setBuildConfig(buildConfig);
}
if (batch || !AsmManager.attemptIncrementalModelRepairs) {
setupModel(buildConfig);
}
if (batch) {
initBcelWorld(handler);
}
if (handler.hasErrors()) {
CompilationAndWeavingContext.leavingPhase(ct);
return false;
}
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
if (buildConfig.getOutputJar() != null) {
if (!openOutputStream(buildConfig.getOutputJar())) {
CompilationAndWeavingContext.leavingPhase(ct);
return false;
}
}
if (batch) {
if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode()) {
getWorld().setModel(AsmManager.getDefault().getHierarchy());
}
binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(true);
performCompilation(buildConfig.getFiles());
state.clearBinarySourceFiles();
if (!proceedOnError() && handler.hasErrors()) {
CompilationAndWeavingContext.leavingPhase(ct);
if (AsmManager.isReporting())
AsmManager.getDefault().reportModelInfo("After a batch build");
return false;
}
if (AsmManager.isReporting())
AsmManager.getDefault().reportModelInfo("After a batch build");
} else {
binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(true);
Set files = state.getFilesToCompile(true);
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode())
if (AsmManager.attemptIncrementalModelRepairs)
AsmManager.getDefault().processDelta(files,state.getAddedFiles(),state.getDeletedFiles());
boolean hereWeGoAgain = !(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty());
for (int i = 0; (i < 5) && hereWeGoAgain; i++) {
if (state.listenerDefined())
state.getListener().recordInformation("Starting incremental compilation loop "+(i+1)+" of possibly 5");
performCompilation(files);
if ((!proceedOnError() && handler.hasErrors()) || (progressListener!=null && progressListener.isCancelledRequested())) {
CompilationAndWeavingContext.leavingPhase(ct);
return false;
}
if (state.requiresFullBatchBuild()) {
if (state.listenerDefined())
state.getListener().recordInformation(" Dropping back to full build");
return batchBuild(buildConfig, baseHandler);
}
binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(false);
files = state.getFilesToCompile(false);
hereWeGoAgain = !(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty());
if (hereWeGoAgain) {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode())
if (AsmManager.attemptIncrementalModelRepairs)
AsmManager.getDefault().processDelta(files,state.getAddedFiles(),state.getDeletedFiles());
}
}
if (!files.isEmpty()) {
CompilationAndWeavingContext.leavingPhase(ct);
return batchBuild(buildConfig, baseHandler);
} else {
if (AsmManager.isReporting())
AsmManager.getDefault().reportModelInfo("After an incremental build");
}
}
if (buildConfig.isEmacsSymMode()) {
new org.aspectj.ajdt.internal.core.builder.EmacsStructureModelManager().externalizeModel();
}
if (buildConfig.isGenerateCrossRefsMode()) {
File configFileProxy = new File(buildConfig.getOutputDir(),CROSSREFS_FILE_NAME);
AsmManager.getDefault().writeStructureModel(configFileProxy.getAbsolutePath());
}
state.successfulCompile(buildConfig,batch);
if (batch) {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
copyResourcesToDestination();
}
if (buildConfig.getOutxmlName() != null) {
writeOutxmlFile();
}
if (buildConfig.isGenerateModelMode()) {
AsmManager.getDefault().fireModelUpdated();
}
CompilationAndWeavingContext.leavingPhase(ct);
} finally {
if (baseHandler instanceof ILifecycleAware) {
((ILifecycleAware)baseHandler).buildFinished(!batch);
}
if (zos != null) {
closeOutputStream(buildConfig.getOutputJar());
}
ret = !handler.hasErrors();
if (getBcelWorld()!=null) getBcelWorld().tidyUp();
if (getWeaver()!=null) getWeaver().tidyUp();
}
return ret;
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
}
private boolean openOutputStream(File outJar) {
try {
OutputStream os = FileUtil.makeOutputStream(buildConfig.getOutputJar());
zos = new JarOutputStream(os,getWeaver().getManifest(true));
} catch (IOException ex) {
IMessage message =
new Message("Unable to open outjar "
+ outJar.getPath()
+ "(" + ex.getMessage()
+ ")",
new SourceLocation(outJar,0),
true);
handler.handleMessage(message);
return false;
}
return true;
}
private void closeOutputStream(File outJar) {
try {
if (zos != null) zos.close();
zos = null;
if (handler.hasErrors()) {
outJar.delete();
}
} catch (IOException ex) {
IMessage message =
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
new Message("Unable to write outjar "
+ outJar.getPath()
+ "(" + ex.getMessage()
+ ")",
new SourceLocation(outJar,0),
true);
handler.handleMessage(message);
}
}
private void copyResourcesToDestination() throws IOException {
for (Iterator i = buildConfig.getInJars().iterator(); i.hasNext(); ) {
File inJar = (File)i.next();
copyResourcesFromJarFile(inJar);
}
for (Iterator i = buildConfig.getInpath().iterator(); i.hasNext(); ) {
File inPathElement = (File)i.next();
if (inPathElement.isDirectory()) {
copyResourcesFromDirectory(inPathElement);
} else {
copyResourcesFromJarFile(inPathElement);
}
}
if (buildConfig.getSourcePathResources() != null) {
for (Iterator i = buildConfig.getSourcePathResources().keySet().iterator(); i.hasNext(); ) {
String resource = (String)i.next();
File from = (File)buildConfig.getSourcePathResources().get(resource);
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
copyResourcesFromFile(from,resource,from);
}
}
writeManifest();
}
private void copyResourcesFromJarFile(File jarFile) throws IOException {
JarInputStream inStream = null;
try {
inStream = new JarInputStream(new FileInputStream(jarFile));
while (true) {
ZipEntry entry = inStream.getNextEntry();
if (entry == null) break;
String filename = entry.getName();
if (entry.isDirectory()) {
writeDirectory(filename,jarFile);
} else if (acceptResource(filename,false)) {
byte[] bytes = FileUtil.readAsByteArray(inStream);
writeResource(filename,bytes,jarFile);
}
inStream.closeEntry();
}
} finally {
if (inStream != null) inStream.close();
}
}
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
private void copyResourcesFromDirectory(File dir) throws IOException {
if (!COPY_INPATH_DIR_RESOURCES) return;
File[] files = FileUtil.listFiles(dir,new FileFilter() {
public boolean accept(File f) {
boolean accept = !(f.isDirectory() || f.getName().endsWith(".class")) ;
return accept;
}
});
for (int i = 0; i < files.length; i++) {
String filename = files[i].getAbsolutePath().substring(
dir.getAbsolutePath().length()+1);
copyResourcesFromFile(files[i],filename,dir);
}
}
private void copyResourcesFromFile(File f,String filename,File src) throws IOException {
if (!acceptResource(filename,true)) return;
FileInputStream fis = null;
try {
fis = new FileInputStream(f);
byte[] bytes = FileUtil.readAsByteArray(fis);
writeResource(filename,bytes,src);
} finally {
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
if (fis != null) fis.close();
}
}
/**
* Add a directory entry to the output zip file. Don't do anything if not writing out to
* a zip file. A directory entry is one whose filename ends with '/'
*
* @param directory the directory path
* @param srcloc the src of the directory entry, for use when creating a warning message
* @throws IOException if something goes wrong creating the new zip entry
*/
private void writeDirectory(String directory, File srcloc) throws IOException {
if (state.hasResource(directory)) {
IMessage msg = new Message("duplicate resource: '" + directory + "'",
IMessage.WARNING,
null,
new SourceLocation(srcloc,0));
handler.handleMessage(msg);
return;
}
if (zos != null) {
ZipEntry newEntry = new ZipEntry(directory);
zos.putNextEntry(newEntry);
zos.closeEntry();
state.recordResource(directory);
}
}
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
private void writeResource(String filename, byte[] content, File srcLocation) throws IOException {
if (state.hasResource(filename)) {
IMessage msg = new Message("duplicate resource: '" + filename + "'",
IMessage.WARNING,
null,
new SourceLocation(srcLocation,0));
handler.handleMessage(msg);
return;
}
if (filename.equals(buildConfig.getOutxmlName())) {
ignoreOutxml = true;
IMessage msg = new Message("-outxml/-outxmlfile option ignored because resource already exists: '" + filename + "'",
IMessage.WARNING,
null,
new SourceLocation(srcLocation,0));
handler.handleMessage(msg);
}
if (zos != null) {
ZipEntry newEntry = new ZipEntry(filename);
zos.putNextEntry(newEntry);
zos.write(content);
zos.closeEntry();
} else {
File destDir = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
destDir = buildConfig.getCompilationResultDestinationManager().getOutputLocationForResource(srcLocation);
}
try {
OutputStream fos =
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
FileUtil.makeOutputStream(new File(destDir,filename));
fos.write(content);
fos.close();
} catch (FileNotFoundException fnfe) {
IMessage msg = new Message("unable to copy resource to output folder: '" + filename + "' - reason: "+fnfe.getMessage(),
IMessage.ERROR,
null,
new SourceLocation(srcLocation,0));
handler.handleMessage(msg);
}
}
state.recordResource(filename);
}
/*
* If we are writing to an output directory copy the manifest but only
* if we already have one
*/
private void writeManifest () throws IOException {
Manifest manifest = getWeaver().getManifest(false);
if (manifest != null && zos == null) {
File outputDir = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
}
if (outputDir == null) return;
OutputStream fos = FileUtil.makeOutputStream(new File(outputDir,MANIFEST_NAME));
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
manifest.write(fos);
fos.close();
}
}
private boolean acceptResource(String resourceName,boolean fromFile) {
if (
(resourceName.startsWith("CVS/")) ||
(resourceName.indexOf("/CVS/") != -1) ||
(resourceName.endsWith("/CVS")) ||
(resourceName.endsWith(".class")) ||
(resourceName.startsWith(".svn/")) ||
(resourceName.indexOf("/.svn/")!=-1) ||
(resourceName.endsWith("/.svn")) ||
(resourceName.toUpperCase().equals(MANIFEST_NAME) && (!fromFile || zos!=null))
)
{
return false;
} else {
return true;
}
}
private void writeOutxmlFile () throws IOException {
if (ignoreOutxml) return;
String filename = buildConfig.getOutxmlName();
Map outputDirsAndAspects = findOutputDirsForAspects();
Set outputDirs = outputDirsAndAspects.entrySet();
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
File outputDir = (File) entry.getKey();
List aspects = (List) entry.getValue();
ByteArrayOutputStream baos = getOutxmlContents(aspects);
if (zos != null) {
ZipEntry newEntry = new ZipEntry(filename);
zos.putNextEntry(newEntry);
zos.write(baos.toByteArray());
zos.closeEntry();
} else {
OutputStream fos = FileUtil.makeOutputStream(new File(outputDir, filename));
fos.write(baos.toByteArray());
fos.close();
}
}
}
private ByteArrayOutputStream getOutxmlContents(List aspectNames) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
ps.println("<aspectj>");
ps.println("<aspects>");
if (aspectNames != null) {
for (Iterator i = aspectNames.iterator(); i.hasNext();) {
String name = (String) i.next();
ps.println("<aspect name=\"" + name + "\"/>");
}
}
ps.println("</aspects>");
ps.println("</aspectj>");
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
ps.println();
ps.close();
return baos;
}
/**
* Returns a map where the keys are File objects corresponding to
* all the output directories and the values are a list of aspects
* which are sent to that ouptut directory
*/
private Map findOutputDirsForAspects() {
Map outputDirsToAspects = new HashMap();
Map aspectNamesToFileNames = state.getAspectNamesToFileNameMap();
if (buildConfig.getCompilationResultDestinationManager() == null
|| buildConfig.getCompilationResultDestinationManager().getAllOutputLocations().size() == 1) {
File outputDir = buildConfig.getOutputDir();
if (buildConfig.getCompilationResultDestinationManager() != null) {
outputDir = buildConfig.getCompilationResultDestinationManager().getDefaultOutputLocation();
}
List aspectNames = new ArrayList();
if (aspectNamesToFileNames != null) {
Set keys = aspectNamesToFileNames.keySet();
for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
String name = (String) iterator.next();
aspectNames.add(name);
}
}
outputDirsToAspects.put(outputDir, aspectNames);
} else {
List outputDirs = buildConfig.getCompilationResultDestinationManager().getAllOutputLocations();
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) {
File outputDir = (File) iterator.next();
outputDirsToAspects.put(outputDir,new ArrayList());
}
Set entrySet = aspectNamesToFileNames.entrySet();
for (Iterator iterator = entrySet.iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
String aspectName = (String) entry.getKey();
char[] fileName = (char[]) entry.getValue();
File outputDir = buildConfig.getCompilationResultDestinationManager()
.getOutputLocationForClass(new File(new String(fileName)));
if(!outputDirsToAspects.containsKey(outputDir)) {
outputDirsToAspects.put(outputDir,new ArrayList());
}
((List)outputDirsToAspects.get(outputDir)).add(aspectName);
}
}
return outputDirsToAspects;
}
}
}
/**
* Responsible for managing the ASM model between builds. Contains the policy for
* maintaining the persistance of elements in the model.
*
* This code is driven before each 'fresh' (batch) build to create
* a new model.
|
244,321 |
Bug 244321 I cannot aspect code written in SJPP-based encoding
| null |
resolved fixed
|
d5c2ead
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2008-08-29T20:08:59Z | 2008-08-15T17:06:40Z |
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
|
*/
private void setupModel(AjBuildConfig config) {
AsmManager.setCreatingModel(config.isEmacsSymMode() || config.isGenerateModelMode());
if (!AsmManager.isCreatingModel()) return;
AsmManager.getDefault().createNewASM();
IHierarchy model = AsmManager.getDefault().getHierarchy();
String rootLabel = "<root>";
IProgramElement.Kind kind = IProgramElement.Kind.FILE_JAVA;
if (buildConfig.getConfigFile() != null) {
rootLabel = buildConfig.getConfigFile().getName();
model.setConfigFile(buildConfig.getConfigFile().getAbsolutePath());
kind = IProgramElement.Kind.FILE_LST;
}
model.setRoot(new ProgramElement(rootLabel, kind, new ArrayList()));
model.setFileMap(new HashMap());
setStructureModel(model);
state.setStructureModel(model);
state.setRelationshipMap(AsmManager.getDefault().getRelationshipMap());
}
public void setCustomMungerFactory(Object o) {
customMungerFactory = (CustomMungerFactory)o;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.