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
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
IMessageHandler msgHandler, boolean isCodeStyleAspect) { boolean ignoreThisClass = javaClass.getClassName().charAt(0) == 'o' && javaClass.getClassName().startsWith("org.aspectj.lang.annotation"); if (ignoreThisClass) return EMPTY_LIST; boolean containsPointcut = false; boolean containsAnnotationClassReference = false; Constant[] cpool = javaClass.getConstantPool().getConstantPool(); for (int i = 0; i < cpool.length; i++) { Constant constant = cpool[i]; if (constant != null && constant.getTag() == Constants.CONSTANT_Utf8) { String constantValue = ((ConstantUtf8) constant).getBytes(); if (constantValue.length() > 28 && constantValue.charAt(1) == 'o') { if (constantValue.startsWith("Lorg/aspectj/lang/annotation")) { containsAnnotationClassReference = true; if ("Lorg/aspectj/lang/annotation/DeclareAnnotation;".equals(constantValue)) { msgHandler.handleMessage(new Message( "Found @DeclareAnnotation while current release does not support it (see '" + type.getName() + "')", IMessage.WARNING, null, type.getSourceLocation())); } if ("Lorg/aspectj/lang/annotation/Pointcut;".equals(constantValue)) { containsPointcut = true; } } } } } if (!containsAnnotationClassReference) return EMPTY_LIST; AjAttributeStruct struct = new AjAttributeStruct(type, context, msgHandler);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
Attribute[] attributes = javaClass.getAttributes(); boolean hasAtAspectAnnotation = false; boolean hasAtPrecedenceAnnotation = false; for (int i = 0; i < attributes.length; i++) { Attribute attribute = attributes[i]; if (acceptAttribute(attribute)) { RuntimeAnnotations rvs = (RuntimeAnnotations) attribute; if (!isCodeStyleAspect && !javaClass.isInterface()) { hasAtAspectAnnotation = handleAspectAnnotation(rvs, struct); hasAtPrecedenceAnnotation = handlePrecedenceAnnotation(rvs, struct); } break; } } if (hasAtPrecedenceAnnotation && !hasAtAspectAnnotation) { msgHandler.handleMessage(new Message("Found @DeclarePrecedence on a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); return EMPTY_LIST; } if (!(hasAtAspectAnnotation || isCodeStyleAspect) && !containsPointcut) { return EMPTY_LIST; }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
for (int i = 0; i < javaClass.getMethods().length; i++) { Method method = javaClass.getMethods()[i];
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (method.getName().startsWith(NameMangler.PREFIX)) continue; AjAttributeMethodStruct mstruct = null; boolean processedPointcut = false; Attribute[] mattributes = method.getAttributes(); for (int j = 0; j < mattributes.length; j++) { Attribute mattribute = mattributes[j]; if (acceptAttribute(mattribute)) { mstruct = new AjAttributeMethodStruct(method, null, type, context, msgHandler); processedPointcut = handlePointcutAnnotation((RuntimeAnnotations) mattribute, mstruct); break; } } if (processedPointcut) { struct.ajAttributes.add(new AjAttribute.WeaverVersionInfo()); struct.ajAttributes.addAll(mstruct.ajAttributes); } } Field[] fs = javaClass.getFields(); for (int i = 0; i < fs.length; i++) { Field field = fs[i]; if (field.getName().startsWith(NameMangler.PREFIX)) continue; AjAttributeFieldStruct fstruct = new AjAttributeFieldStruct(field, null, type, context, msgHandler); Attribute[] fattributes = field.getAttributes();
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
for (int j = 0; j < fattributes.length; j++) { Attribute fattribute = fattributes[j]; if (acceptAttribute(fattribute)) { RuntimeAnnotations frvs = (RuntimeAnnotations) fattribute; if (handleDeclareErrorOrWarningAnnotation(model, frvs, fstruct) || handleDeclareParentsAnnotation(frvs, fstruct)) { if (!type.isAnnotationStyleAspect() && !isCodeStyleAspect) { msgHandler.handleMessage(new Message("Found @AspectJ annotations in a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); } } break; } } struct.ajAttributes.addAll(fstruct.ajAttributes); } return struct.ajAttributes; } /** * Extract method level annotations and turn them into AjAttributes. * * @param method * @param type * @param context * @param msgHandler * @return list of AjAttributes */
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
public static List readAj5MethodAttributes(Method method, BcelMethod bMethod, ResolvedType type, ResolvedPointcutDefinition preResolvedPointcut, ISourceContext context, IMessageHandler msgHandler) { if (method.getName().startsWith(NameMangler.PREFIX)) return Collections.EMPTY_LIST; AjAttributeMethodStruct struct = new AjAttributeMethodStruct(method, bMethod, type, context, msgHandler); Attribute[] attributes = method.getAttributes(); boolean hasAtAspectJAnnotation = false; boolean hasAtAspectJAnnotationMustReturnVoid = false; for (int i = 0; i < attributes.length; i++) { Attribute attribute = attributes[i]; try { if (acceptAttribute(attribute)) { RuntimeAnnotations rvs = (RuntimeAnnotations) attribute; hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleBeforeAnnotation(rvs, struct, preResolvedPointcut); hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleAfterAnnotation(rvs, struct, preResolvedPointcut); hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleAfterReturningAnnotation(rvs, struct, preResolvedPointcut, bMethod); hasAtAspectJAnnotationMustReturnVoid = hasAtAspectJAnnotationMustReturnVoid || handleAfterThrowingAnnotation(rvs, struct, preResolvedPointcut, bMethod); hasAtAspectJAnnotation = hasAtAspectJAnnotation || handleAroundAnnotation(rvs, struct, preResolvedPointcut);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
break; } } catch (ReturningFormalNotDeclaredInAdviceSignatureException e) { msgHandler.handleMessage(new Message(WeaverMessages.format(WeaverMessages.RETURNING_FORMAL_NOT_DECLARED_IN_ADVICE, e.getFormalName()), IMessage.ERROR, null, bMethod.getSourceLocation())); } catch (ThrownFormalNotDeclaredInAdviceSignatureException e) { msgHandler.handleMessage(new Message(WeaverMessages.format(WeaverMessages.THROWN_FORMAL_NOT_DECLARED_IN_ADVICE, e .getFormalName()), IMessage.ERROR, null, bMethod.getSourceLocation())); } } hasAtAspectJAnnotation = hasAtAspectJAnnotation || hasAtAspectJAnnotationMustReturnVoid; if (hasAtAspectJAnnotation && !type.isAspect()) { msgHandler.handleMessage(new Message("Found @AspectJ annotations in a non @Aspect type '" + type.getName() + "'", IMessage.WARNING, null, type.getSourceLocation())); } if (hasAtAspectJAnnotation && !struct.method.isPublic()) { msgHandler.handleMessage(new Message("Found @AspectJ annotation on a non public advice '" + methodToString(struct.method) + "'", IMessage.ERROR, null, type.getSourceLocation())); } if (hasAtAspectJAnnotation && struct.method.isStatic()) { msgHandler.handleMessage(MessageUtil.error("Advice cannot be declared static '" + methodToString(struct.method) + "'", type.getSourceLocation()));
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} if (hasAtAspectJAnnotationMustReturnVoid && !Type.VOID.equals(struct.method.getReturnType())) { msgHandler.handleMessage(new Message("Found @AspectJ annotation on a non around advice not returning void '" + methodToString(struct.method) + "'", IMessage.ERROR, null, type.getSourceLocation())); } return struct.ajAttributes; } /** * Extract field level annotations and turn them into AjAttributes. * * @param field * @param type * @param context * @param msgHandler * @return list of AjAttributes, always empty for now */ public static List readAj5FieldAttributes(Field field, BcelField bField, ResolvedType type, ISourceContext context, IMessageHandler msgHandler) { return Collections.EMPTY_LIST; } /** * Read @Aspect
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAspectAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeStruct struct) { AnnotationGen aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.ASPECT_ANNOTATION); if (aspect != null) { boolean extendsAspect = false; if (!"java.lang.Object".equals(struct.enclosingType.getSuperclass().getName())) { if (!struct.enclosingType.getSuperclass().isAbstract() && struct.enclosingType.getSuperclass().isAspect()) { reportError("cannot extend a concrete aspect", struct); return false; } extendsAspect = struct.enclosingType.getSuperclass().isAspect(); } ElementNameValuePairGen aspectPerClause = getAnnotationElement(aspect, VALUE); final PerClause perClause; if (aspectPerClause == null) { if (!extendsAspect) { perClause = new PerSingleton(); } else { perClause = new PerFromSuper(struct.enclosingType.getSuperclass().getPerClause().getKind()); } } else { String perX = aspectPerClause.getValue().stringifyValue(); if (perX == null || perX.length() <= 0) { perClause = new PerSingleton();
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} else { perClause = parsePerClausePointcut(perX, struct); } } if (perClause == null) { return false; } else { perClause.setLocation(struct.context, -1, -1); struct.ajAttributes.add(new AjAttribute.WeaverVersionInfo()); AjAttribute.Aspect aspectAttribute = new AjAttribute.Aspect(perClause); struct.ajAttributes.add(aspectAttribute); FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; final IScope binding; binding = new BindingScope(struct.enclosingType, struct.context, bindings); aspectAttribute.setResolutionScope(binding); return true; } } return false; } /** * Read a perClause, returns null on failure and issue messages
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* * @param perClauseString like "pertarget(.....)" * @param struct for which we are parsing the per clause * @return a PerClause instance */ private static PerClause parsePerClausePointcut(String perClauseString, AjAttributeStruct struct) { final String pointcutString; Pointcut pointcut = null; TypePattern typePattern = null; final PerClause perClause; if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERCFLOW.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERCFLOW.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerCflow(pointcut, false); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERCFLOWBELOW.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERCFLOWBELOW.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerCflow(pointcut, true); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTARGET.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTARGET.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerObject(pointcut, false); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTHIS.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTHIS.extractPointcut(perClauseString); pointcut = parsePointcut(pointcutString, struct, false); perClause = new PerObject(pointcut, true); } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTYPEWITHIN.getName())) { pointcutString = PerClause.KindAnnotationPrefix.PERTYPEWITHIN.extractPointcut(perClauseString); typePattern = parseTypePattern(pointcutString, struct); perClause = new PerTypeWithin(typePattern);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} else if (perClauseString.equalsIgnoreCase(PerClause.SINGLETON.getName() + "()")) { perClause = new PerSingleton(); } else { reportError("@Aspect per clause cannot be read '" + perClauseString + "'", struct); return null; } if (!PerClause.SINGLETON.equals(perClause.getKind()) && !PerClause.PERTYPEWITHIN.equals(perClause.getKind()) && pointcut == null) { return null; } if (PerClause.PERTYPEWITHIN.equals(perClause.getKind()) && typePattern == null) { return null; } return perClause; } /** * Read @DeclarePrecedence * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handlePrecedenceAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeStruct struct) { AnnotationGen aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPRECEDENCE_ANNOTATION); if (aspect != null) { ElementNameValuePairGen precedence = getAnnotationElement(aspect, VALUE); if (precedence != null) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
String precedencePattern = precedence.getValue().stringifyValue(); PatternParser parser = new PatternParser(precedencePattern); DeclarePrecedence ajPrecedence = parser.parseDominates(); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(ajPrecedence)); return true; } } return false; }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/** * Read @DeclareParents * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleDeclareParentsAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeFieldStruct struct) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
AnnotationGen decp = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPARENTS_ANNOTATION); if (decp != null) { ElementNameValuePairGen decpPatternNVP = getAnnotationElement(decp, VALUE); String decpPattern = decpPatternNVP.getValue().stringifyValue(); if (decpPattern != null) { TypePattern typePattern = parseTypePattern(decpPattern, struct); ResolvedType fieldType = UnresolvedType.forSignature(struct.field.getSignature()).resolve( struct.enclosingType.getWorld()); if (fieldType.isInterface()) { TypePattern parent = parseTypePattern(fieldType.getName(), struct); FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); List parents = new ArrayList(1); parents.add(parent); DeclareParents dp = new DeclareParents(typePattern, parents, false); dp.resolve(binding); typePattern = typePattern.resolveBindings(binding, Bindings.NONE, false, false); dp.setLocation(struct.context, -1, -1); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(dp));
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
String defaultImplClassName = null; ElementNameValuePairGen defaultImplNVP = getAnnotationElement(decp, "defaultImpl"); if (defaultImplNVP != null) { ClassElementValueGen defaultImpl = (ClassElementValueGen) defaultImplNVP.getValue(); defaultImplClassName = UnresolvedType.forSignature(defaultImpl.getClassString()).getName(); if (defaultImplClassName.equals("org.aspectj.lang.annotation.DeclareParents")) { defaultImplClassName = null; } else { ResolvedType impl = struct.enclosingType.getWorld().resolve(defaultImplClassName, false); ResolvedMember[] mm = impl.getDeclaredMethods(); boolean hasNoCtorOrANoArgOne = true; for (int i = 0; i < mm.length; i++) { ResolvedMember resolvedMember = mm[i]; if (resolvedMember.getName().equals("<init>")) { hasNoCtorOrANoArgOne = false; if (resolvedMember.getParameterTypes().length == 0 && resolvedMember.isPublic()) { hasNoCtorOrANoArgOne = true; } } if (hasNoCtorOrANoArgOne) { break; } } if (!hasNoCtorOrANoArgOne) { reportError("@DeclareParents: defaultImpl=\"" + defaultImplClassName + "\" has no public no-arg constructor", struct); } if (!fieldType.isAssignableFrom(impl)) { reportError("@DeclareParents: defaultImpl=\"" + defaultImplClassName
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
+ "\" does not implement the interface '" + fieldType.toString() + "'", struct); } } } boolean hasAtLeastOneMethod = false; ResolvedMember[] methods = (ResolvedMember[]) fieldType.getMethodsWithoutIterator(true, false).toArray( new ResolvedMember[0]); for (int i = 0; i < methods.length; i++) { ResolvedMember method = methods[i]; if (method.isAbstract()) { hasAtLeastOneMethod = true; MethodDelegateTypeMunger mdtm = new MethodDelegateTypeMunger(method, struct.enclosingType, defaultImplClassName, typePattern); mdtm.setSourceLocation(struct.enclosingType.getSourceLocation()); struct.ajAttributes.add(new AjAttribute.TypeMunger(mdtm)); } } if (hasAtLeastOneMethod && defaultImplClassName != null) { struct.ajAttributes.add(new AjAttribute.TypeMunger(new MethodDelegateTypeMunger.FieldHostTypeMunger( AjcMemberMaker.itdAtDeclareParentsField(null,
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
fieldType, struct.enclosingType), struct.enclosingType, typePattern))); } return true; } else { reportError("@DeclareParents: can only be used on a field whose type is an interface", struct); return false; } } } return false; } /** * Read @Before * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleBeforeAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut) { AnnotationGen before = getAnnotation(runtimeAnnotations, AjcMemberMaker.BEFORE_ANNOTATION); if (before != null) { ElementNameValuePairGen beforeAdvice = getAnnotationElement(before, VALUE); if (beforeAdvice != null) { String argumentNames = getArgNamesValue(before); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0];
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
try { bindings = extractBindings(struct); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else { pc = parsePointcut(beforeAdvice.getValue().stringifyValue(), struct, false); if (pc == null) return false; pc = pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod .getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.Before, pc, extraArgument, sl.getOffset(), sl .getOffset() + 1, struct.context)); return true; } } return false; } /**
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* Read @After * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAfterAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut) { AnnotationGen after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTER_ANNOTATION); if (after != null) { ElementNameValuePairGen afterAdvice = getAnnotationElement(after, VALUE); if (afterAdvice != null) { FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; String argumentNames = getArgNamesValue(after); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } try { bindings = extractBindings(struct); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
pc = parsePointcut(afterAdvice.getValue().stringifyValue(), struct, false); if (pc == null) return false; pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod .getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.After, pc, extraArgument, sl.getOffset(), sl .getOffset() + 1, struct.context)); return true; } } return false; } /** * Read @AfterReturning * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAfterReturningAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut, BcelMethod owningMethod) throws ReturningFormalNotDeclaredInAdviceSignatureException { AnnotationGen after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTERRETURNING_ANNOTATION); if (after != null) { ElementNameValuePairGen annValue = getAnnotationElement(after, VALUE); ElementNameValuePairGen annPointcut = getAnnotationElement(after, POINTCUT);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
ElementNameValuePairGen annReturned = getAnnotationElement(after, RETURNING); String pointcut = null; String returned = null; if ((annValue != null && annPointcut != null) || (annValue == null && annPointcut == null)) { reportError("@AfterReturning: either 'value' or 'poincut' must be provided, not both", struct); return false; } if (annValue != null) { pointcut = annValue.getValue().stringifyValue(); } else { pointcut = annPointcut.getValue().stringifyValue(); } if (isNullOrEmpty(pointcut)) { reportError("@AfterReturning: either 'value' or 'poincut' must be provided, not both", struct); return false; } if (annReturned != null) { returned = annReturned.getValue().stringifyValue(); if (isNullOrEmpty(returned)) { returned = null; } else { String[] pNames = owningMethod.getParameterNames(); if (pNames == null || pNames.length == 0 || !Arrays.asList(pNames).contains(returned)) { throw new ReturningFormalNotDeclaredInAdviceSignatureException(returned); } } } String argumentNames = getArgNamesValue(after);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; try { bindings = (returned == null ? extractBindings(struct) : extractBindings(struct, returned)); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); if (returned != null) { extraArgument |= Advice.ExtraArgument; } Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else { pc = parsePointcut(pointcut, struct, false); if (pc == null) return false; pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod .getDeclarationOffset());
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.AfterReturning, pc, extraArgument, sl.getOffset(), sl.getOffset() + 1, struct.context)); return true; } return false; } /** * Read @AfterThrowing * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAfterThrowingAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut, BcelMethod owningMethod) throws ThrownFormalNotDeclaredInAdviceSignatureException { AnnotationGen after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTERTHROWING_ANNOTATION); if (after != null) { ElementNameValuePairGen annValue = getAnnotationElement(after, VALUE); ElementNameValuePairGen annPointcut = getAnnotationElement(after, POINTCUT); ElementNameValuePairGen annThrown = getAnnotationElement(after, THROWING); String pointcut = null; String thrownFormal = null; if ((annValue != null && annPointcut != null) || (annValue == null && annPointcut == null)) { reportError("@AfterThrowing: either 'value' or 'poincut' must be provided, not both", struct); return false; } if (annValue != null) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
pointcut = annValue.getValue().stringifyValue(); } else { pointcut = annPointcut.getValue().stringifyValue(); } if (isNullOrEmpty(pointcut)) { reportError("@AfterThrowing: either 'value' or 'poincut' must be provided, not both", struct); return false; } if (annThrown != null) { thrownFormal = annThrown.getValue().stringifyValue(); if (isNullOrEmpty(thrownFormal)) { thrownFormal = null; } else { String[] pNames = owningMethod.getParameterNames(); if (pNames == null || pNames.length == 0 || !Arrays.asList(pNames).contains(thrownFormal)) { throw new ThrownFormalNotDeclaredInAdviceSignatureException(thrownFormal); } } } String argumentNames = getArgNamesValue(after); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; try { bindings = (thrownFormal == null ? extractBindings(struct) : extractBindings(struct, thrownFormal)); } catch (UnreadableDebugInfoException unreadableDebugInfoException) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); if (thrownFormal != null) { extraArgument |= Advice.ExtraArgument; } Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else { pc = parsePointcut(pointcut, struct, false); if (pc == null) return false; pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod .getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.AfterThrowing, pc, extraArgument, sl.getOffset(), sl .getOffset() + 1, struct.context)); return true; } return false; } /** * Read @Around
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleAroundAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut) { AnnotationGen around = getAnnotation(runtimeAnnotations, AjcMemberMaker.AROUND_ANNOTATION); if (around != null) { ElementNameValuePairGen aroundAdvice = getAnnotationElement(around, VALUE); if (aroundAdvice != null) { String argumentNames = getArgNamesValue(around); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0]; try { bindings = extractBindings(struct); } catch (UnreadableDebugInfoException unreadableDebugInfoException) { return false; } IScope binding = new BindingScope(struct.enclosingType, struct.context, bindings); int extraArgument = extractExtraArgument(struct.method); Pointcut pc = null; if (preResolvedPointcut != null) { pc = preResolvedPointcut.getPointcut(); } else { pc = parsePointcut(aroundAdvice.getValue().stringifyValue(), struct, false);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (pc == null) return false; pc.resolve(binding); } setIgnoreUnboundBindingNames(pc, bindings); ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod .getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.Around, pc, extraArgument, sl.getOffset(), sl .getOffset() + 1, struct.context)); return true; } } return false; } /** * Read @Pointcut and handle the resolving in a lazy way to deal with pointcut references * * @param runtimeAnnotations * @param struct * @return true if a pointcut was handled */ private static boolean handlePointcutAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct) { AnnotationGen pointcut = getAnnotation(runtimeAnnotations, AjcMemberMaker.POINTCUT_ANNOTATION); if (pointcut == null) return false; ElementNameValuePairGen pointcutExpr = getAnnotationElement(pointcut, VALUE); if (!(Type.VOID.equals(struct.method.getReturnType()) || (Type.BOOLEAN.equals(struct.method.getReturnType()) && struct.method.isStatic() && struct.method.isPublic()))) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
reportWarning("Found @Pointcut on a method not returning 'void' or not 'public static boolean'", struct); } if (struct.method.getExceptionTable() != null) { reportWarning("Found @Pointcut on a method throwing exception", struct); } String argumentNames = getArgNamesValue(pointcut); if (argumentNames != null) { struct.unparsedArgumentNames = argumentNames; } final IScope binding; try { if (struct.method.isAbstract()) { binding = null; } else { binding = new BindingScope(struct.enclosingType, struct.context, extractBindings(struct)); } } catch (UnreadableDebugInfoException e) { return false; } UnresolvedType[] argumentTypes = new UnresolvedType[struct.method.getArgumentTypes().length]; for (int i = 0; i < argumentTypes.length; i++) { argumentTypes[i] = UnresolvedType.forSignature(struct.method.getArgumentTypes()[i].getSignature()); } Pointcut pc = null; if (struct.method.isAbstract()) { if ((pointcutExpr != null && isNullOrEmpty(pointcutExpr.getValue().stringifyValue())) || pointcutExpr == null) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} else { reportError("Found defined @Pointcut on an abstract method", struct); return false; } } else { if (pointcutExpr == null || isNullOrEmpty(pointcutExpr.getValue().stringifyValue())) { } else { pc = parsePointcut(pointcutExpr.getValue().stringifyValue(), struct, true); if (pc == null) return false; pc.setLocation(struct.context, -1, -1); } } struct.ajAttributes.add(new AjAttribute.PointcutDeclarationAttribute(new LazyResolvedPointcutDefinition( struct.enclosingType, struct.method.getModifiers(), struct.method.getName(), argumentTypes, UnresolvedType .forSignature(struct.method.getReturnType().getSignature()), pc, binding ))); return true;
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} /** * Read @DeclareError, @DeclareWarning * * @param runtimeAnnotations * @param struct * @return true if found */ private static boolean handleDeclareErrorOrWarningAnnotation(AsmManager model, RuntimeAnnotations runtimeAnnotations, AjAttributeFieldStruct struct) { AnnotationGen error = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREERROR_ANNOTATION); boolean hasError = false; if (error != null) { ElementNameValuePairGen declareError = getAnnotationElement(error, VALUE); if (declareError != null) { if (!STRING_DESC.equals(struct.field.getSignature()) || struct.field.getConstantValue() == null) { reportError("@DeclareError used on a non String constant field", struct); return false; } Pointcut pc = parsePointcut(declareError.getValue().stringifyValue(), struct, false); if (pc == null) { hasError = false; } else { DeclareErrorOrWarning deow = new DeclareErrorOrWarning(true, pc, struct.field.getConstantValue().toString()); setDeclareErrorOrWarningLocation(model, deow, struct); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(deow)); hasError = true; } } }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
AnnotationGen warning = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREWARNING_ANNOTATION); boolean hasWarning = false; if (warning != null) { ElementNameValuePairGen declareWarning = getAnnotationElement(warning, VALUE); if (declareWarning != null) { if (!STRING_DESC.equals(struct.field.getSignature()) || struct.field.getConstantValue() == null) { reportError("@DeclareWarning used on a non String constant field", struct); return false; } Pointcut pc = parsePointcut(declareWarning.getValue().stringifyValue(), struct, false); if (pc == null) { hasWarning = false; } else { DeclareErrorOrWarning deow = new DeclareErrorOrWarning(false, pc, struct.field.getConstantValue().toString()); setDeclareErrorOrWarningLocation(model, deow, struct); struct.ajAttributes.add(new AjAttribute.DeclareAttribute(deow)); return hasWarning = true; } } } return hasError || hasWarning; } /** * Sets the location for the declare error / warning using the corresponding IProgramElement in the structure model. This will * only fix bug 120356 if compiled with -emacssym, however, it does mean that the cross references view in AJDT will show the * correct information. * * Other possibilities for fix: 1. using the information in ajcDeclareSoft (if this is set correctly) which will fix the problem * if compiled with ajc but not if compiled with javac. 2. creating an AjAttribute called FieldDeclarationLineNumberAttribute * (much like MethodDeclarationLineNumberAttribute) which we can ask for the offset. This will again only fix bug 120356 when
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* compiled with ajc. * * @param deow * @param struct */ private static void setDeclareErrorOrWarningLocation(AsmManager model, DeclareErrorOrWarning deow, AjAttributeFieldStruct struct) { IHierarchy top = (model == null ? null : model.getHierarchy()); if (top != null && top.getRoot() != null) { IProgramElement ipe = top.findElementForLabel(top.getRoot(), IProgramElement.Kind.FIELD, struct.field.getName()); if (ipe != null && ipe.getSourceLocation() != null) { ISourceLocation sourceLocation = ipe.getSourceLocation(); int start = sourceLocation.getOffset(); int end = start + struct.field.getName().length(); deow.setLocation(struct.context, start, end); return; } } deow.setLocation(struct.context, -1, -1); } /** * Returns a readable representation of a method. Method.toString() is not suitable. * * @param method * @return a readable representation of a method */ private static String methodToString(Method method) { StringBuffer sb = new StringBuffer(); sb.append(method.getName()); sb.append(method.getSignature()); return sb.toString();
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} /** * Build the bindings for a given method (pointcut / advice) * * @param struct * @return null if no debug info is available */ private static FormalBinding[] extractBindings(AjAttributeMethodStruct struct) throws UnreadableDebugInfoException { Method method = struct.method; String[] argumentNames = struct.getArgumentNames(); if (argumentNames.length != method.getArgumentTypes().length) { reportError( "Cannot read debug info for @Aspect to handle formal binding in pointcuts (please compile with 'javac -g' or '<javac debug='true'.../>' in Ant)", struct); throw new UnreadableDebugInfoException(); } List bindings = new ArrayList(); for (int i = 0; i < argumentNames.length; i++) { String argumentName = argumentNames[i]; UnresolvedType argumentType = UnresolvedType.forSignature(method.getArgumentTypes()[i].getSignature()); if ((AjcMemberMaker.TYPEX_JOINPOINT.equals(argumentType) || AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.equals(argumentType) || AjcMemberMaker.TYPEX_STATICJOINPOINT.equals(argumentType) || AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.equals(argumentType) || AjcMemberMaker.AROUND_CLOSURE_TYPE .equals(argumentType))) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
bindings.add(new FormalBinding.ImplicitFormalBinding(argumentType, argumentName, i)); } else { bindings.add(new FormalBinding(argumentType, argumentName, i)); } } return (FormalBinding[]) bindings.toArray(new FormalBinding[] {}); } private static FormalBinding[] extractBindings(AjAttributeMethodStruct struct, String excludeFormal) throws UnreadableDebugInfoException { FormalBinding[] bindings = extractBindings(struct); for (int i = 0; i < bindings.length; i++) { FormalBinding binding = bindings[i]; if (binding.getName().equals(excludeFormal)) { bindings[i] = new FormalBinding.ImplicitFormalBinding(binding.getType(), binding.getName(), binding.getIndex()); break; } } return bindings;
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} /** * Compute the flag for the xxxJoinPoint extra argument * * @param method * @return extra arg flag */ private static int extractExtraArgument(Method method) { Type[] methodArgs = method.getArgumentTypes(); String[] sigs = new String[methodArgs.length]; for (int i = 0; i < methodArgs.length; i++) { sigs[i] = methodArgs[i].getSignature(); } return extractExtraArgument(sigs); } /** * Compute the flag for the xxxJoinPoint extra argument * * @param argumentSignatures * @return extra arg flag */ public static int extractExtraArgument(String[] argumentSignatures) { int extraArgument = 0;
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
for (int i = 0; i < argumentSignatures.length; i++) { if (AjcMemberMaker.TYPEX_JOINPOINT.getSignature().equals(argumentSignatures[i])) { extraArgument |= Advice.ThisJoinPoint; } else if (AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.getSignature().equals(argumentSignatures[i])) { extraArgument |= Advice.ThisJoinPoint; } else if (AjcMemberMaker.TYPEX_STATICJOINPOINT.getSignature().equals(argumentSignatures[i])) { extraArgument |= Advice.ThisJoinPointStaticPart; } else if (AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.getSignature().equals(argumentSignatures[i])) { extraArgument |= Advice.ThisEnclosingJoinPointStaticPart; } } return extraArgument; } /** * Returns the runtime (RV/RIV) annotation of type annotationType or null if no such annotation * * @param rvs * @param annotationType * @return annotation */ private static AnnotationGen getAnnotation(RuntimeAnnotations rvs, UnresolvedType annotationType) { final String annotationTypeName = annotationType.getName(); for (Iterator iterator = rvs.getAnnotations().iterator(); iterator.hasNext();) { AnnotationGen rv = (AnnotationGen) iterator.next(); if (annotationTypeName.equals(rv.getTypeName())) { return rv; } } return null; }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/** * Returns the value of a given element of an annotation or null if not found Caution: Does not handles default value. * * @param annotation * @param elementName * @return annotation NVP */ private static ElementNameValuePairGen getAnnotationElement(AnnotationGen annotation, String elementName) { for (Iterator iterator1 = annotation.getValues().iterator(); iterator1.hasNext();) { ElementNameValuePairGen element = (ElementNameValuePairGen) iterator1.next(); if (elementName.equals(element.getNameString())) { return element; } } return null; } /** * Return the argNames set for an annotation or null if it is not specified. */ private static String getArgNamesValue(AnnotationGen anno) { for (Iterator iterator1 = anno.getValues().iterator(); iterator1.hasNext();) { ElementNameValuePairGen element = (ElementNameValuePairGen) iterator1.next(); if (ARGNAMES.equals(element.getNameString())) { return element.getValue().stringifyValue(); } } return null; } private static String lastbit(String fqname) { int i = fqname.lastIndexOf(".");
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
if (i == -1) return fqname; else return fqname.substring(i + 1); } /** * Extract the method argument names. First we try the debug info attached to the method (the LocalVariableTable) - if we cannot * find that we look to use the argNames value that may have been supplied on the associated annotation. If that fails we just * don't know and return an empty string. * * @param method * @param argNamesFromAnnotation * @param methodStruct * @return method argument names */ private static String[] getMethodArgumentNames(Method method, String argNamesFromAnnotation, AjAttributeMethodStruct methodStruct) { if (method.getArgumentTypes().length == 0) { return EMPTY_STRINGS; } final int startAtStackIndex = method.isStatic() ? 0 : 1; final List arguments = new ArrayList(); LocalVariableTable lt = method.getLocalVariableTable(); if (lt != null) { for (int j = 0; j < lt.getLocalVariableTable().length; j++) { LocalVariable localVariable = lt.getLocalVariableTable()[j]; if (localVariable.getStartPC() == 0) { if (localVariable.getIndex() >= startAtStackIndex) { arguments.add(new MethodArgument(localVariable.getName(), localVariable.getIndex())); }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
} } } else { if (argNamesFromAnnotation != null) { StringTokenizer st = new StringTokenizer(argNamesFromAnnotation, " ,"); List args = new ArrayList(); while (st.hasMoreTokens()) { args.add(st.nextToken()); } if (args.size() != method.getArgumentTypes().length) { StringBuffer shortString = new StringBuffer().append(lastbit(method.getReturnType().toString())).append(" ") .append(method.getName()); if (method.getArgumentTypes().length > 0) { shortString.append("("); for (int i = 0; i < method.getArgumentTypes().length; i++) { shortString.append(lastbit(method.getArgumentTypes()[i].toString())); if ((i + 1) < method.getArgumentTypes().length) shortString.append(","); } shortString.append(")"); } reportError("argNames annotation value does not specify the right number of argument names for the method '" + shortString.toString() + "'", methodStruct); return EMPTY_STRINGS; } return (String[]) args.toArray(new String[] {}); } } if (arguments.size() != method.getArgumentTypes().length) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
return EMPTY_STRINGS; } Collections.sort(arguments, new Comparator() { public int compare(Object o, Object o1) { MethodArgument mo = (MethodArgument) o; MethodArgument mo1 = (MethodArgument) o1; if (mo.indexOnStack == mo1.indexOnStack) { return 0; } else if (mo.indexOnStack > mo1.indexOnStack) { return 1; } else { return -1; } } }); String[] argumentNames = new String[arguments.size()]; int i = 0; for (Iterator iterator = arguments.iterator(); iterator.hasNext(); i++) { MethodArgument methodArgument = (MethodArgument) iterator.next(); argumentNames[i] = methodArgument.name; } return argumentNames; } /** * A method argument, used for sorting by indexOnStack (ie order in signature) * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ private static class MethodArgument {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
String name; int indexOnStack; public MethodArgument(String name, int indexOnStack) { this.name = name; this.indexOnStack = indexOnStack; } } /** * LazyResolvedPointcutDefinition lazyly resolve the pointcut so that we have time to register all pointcut referenced before * pointcut resolution happens * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ public static class LazyResolvedPointcutDefinition extends ResolvedPointcutDefinition {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private final Pointcut m_pointcutUnresolved; private final IScope m_binding; private Pointcut m_lazyPointcut = null; public LazyResolvedPointcutDefinition(UnresolvedType declaringType, int modifiers, String name, UnresolvedType[] parameterTypes, UnresolvedType returnType, Pointcut pointcut, IScope binding) { super(declaringType, modifiers, name, parameterTypes, returnType, null); m_pointcutUnresolved = pointcut; m_binding = binding; } public Pointcut getPointcut() { if (m_lazyPointcut == null) { m_lazyPointcut = m_pointcutUnresolved.resolve(m_binding); m_lazyPointcut.copyLocationFrom(m_pointcutUnresolved); } return m_lazyPointcut; } } /** * Helper to test empty strings * * @param s * @return true if empty or null */ private static boolean isNullOrEmpty(String s) { return (s == null || s.length() <= 0); } /** * Set the pointcut bindings for which to ignore unbound issues, so that we can implicitly bind xxxJoinPoint for @AJ advices * * @param pointcut
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
* @param bindings */ private static void setIgnoreUnboundBindingNames(Pointcut pointcut, FormalBinding[] bindings) { List ignores = new ArrayList(); for (int i = 0; i < bindings.length; i++) { FormalBinding formalBinding = bindings[i]; if (formalBinding instanceof FormalBinding.ImplicitFormalBinding) { ignores.add(formalBinding.getName()); } } pointcut.m_ignoreUnboundBindingForNames = (String[]) ignores.toArray(new String[ignores.size()]); } /** * A check exception when we cannot read debug info (needed for formal binding) */ private static class UnreadableDebugInfoException extends Exception { } /** * Report an error * * @param message * @param location */ private static void reportError(String message, AjAttributeStruct location) { if (!location.handler.isIgnoring(IMessage.ERROR)) { location.handler.handleMessage(new Message(message, location.enclosingType.getSourceLocation(), true)); } }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
/** * Report a warning * * @param message * @param location */ private static void reportWarning(String message, AjAttributeStruct location) { if (!location.handler.isIgnoring(IMessage.WARNING)) { location.handler.handleMessage(new Message(message, location.enclosingType.getSourceLocation(), false)); } } /** * Parse the given pointcut, return null on failure and issue an error * * @param pointcutString * @param struct * @param allowIf * @return pointcut, unresolved */ private static Pointcut parsePointcut(String pointcutString, AjAttributeStruct struct, boolean allowIf) { try { PatternParser parser = new PatternParser(pointcutString, struct.context); Pointcut pointcut = parser.parsePointcut(); parser.checkEof(); pointcut.check(null, struct.enclosingType.getWorld()); if (!allowIf && pointcutString.indexOf("if()") >= 0 && hasIf(pointcut)) { reportError("if() pointcut is not allowed at this pointcut location '" + pointcutString + "'", struct); return null; } pointcut.setLocation(struct.context, -1, -1);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
return pointcut; } catch (ParserException e) { reportError("Invalid pointcut '" + pointcutString + "': " + e.toString() + (e.getLocation() == null ? "" : " at position " + e.getLocation().getStart()), struct); return null; } } private static boolean hasIf(Pointcut pointcut) { IfFinder visitor = new IfFinder(); pointcut.accept(visitor, null); return visitor.hasIf; } /** * Parse the given type pattern, return null on failure and issue an error * * @param patternString * @param location * @return type pattern */ private static TypePattern parseTypePattern(String patternString, AjAttributeStruct location) { try { TypePattern typePattern = new PatternParser(patternString).parseTypePattern(); typePattern.setLocation(location.context, -1, -1); return typePattern; } catch (ParserException e) { reportError("Invalid type pattern'" + patternString + "' : " + e.getLocation(), location); return null; } } static class ThrownFormalNotDeclaredInAdviceSignatureException extends Exception {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
private final String formalName; public ThrownFormalNotDeclaredInAdviceSignatureException(String formalName) { this.formalName = formalName; } public String getFormalName() { return formalName; } } static class ReturningFormalNotDeclaredInAdviceSignatureException extends Exception { private final String formalName; public ReturningFormalNotDeclaredInAdviceSignatureException(String formalName) { this.formalName = formalName; } public String getFormalName() { return formalName; } } }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
/* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http:www.eclipse.org/legal/epl-v10.html * * Contributors: * PARC initial implementation * ******************************************************************/ package org.aspectj.weaver.model; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import org.aspectj.asm.AsmManager;
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
import org.aspectj.asm.IHierarchy; import org.aspectj.asm.IProgramElement; import org.aspectj.asm.IRelationship; import org.aspectj.asm.IRelationshipMap; import org.aspectj.asm.internal.ProgramElement; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.SourceLocation; import org.aspectj.weaver.Advice; import org.aspectj.weaver.AdviceKind; import org.aspectj.weaver.Checker; import org.aspectj.weaver.Lint; import org.aspectj.weaver.Member; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedPointcutDefinition; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.ResolvedTypeMunger; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.ShadowMunger; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.World; import org.aspectj.weaver.patterns.DeclareErrorOrWarning; public class AsmRelationshipProvider { protected static AsmRelationshipProvider INSTANCE = new AsmRelationshipProvider(); public static final String ADVISES = "advises"; public static final String ADVISED_BY = "advised by"; public static final String DECLARES_ON = "declares on"; public static final String DECLAREDY_BY = "declared by"; public static final String SOFTENS = "softens"; public static final String SOFTENED_BY = "softened by"; public static final String MATCHED_BY = "matched by";
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
public static final String MATCHES_DECLARE = "matches declare"; public static final String INTER_TYPE_DECLARES = "declared on"; public static final String INTER_TYPE_DECLARED_BY = "aspect declarations"; public static final String ANNOTATES = "annotates"; public static final String ANNOTATED_BY = "annotated by"; public static void checkerMunger(AsmManager asm, Shadow shadow, Checker checker) { if (asm == null) return; if (shadow.getSourceLocation() == null || checker.getSourceLocation() == null) return; if (World.createInjarHierarchy) { createHierarchy(asm, checker); } IProgramElement targetNode = getNode(asm, shadow); if (targetNode == null) return; String targetHandle = asm.getHandleProvider().createHandleIdentifier(targetNode); if (targetHandle == null) return; IProgramElement sourceNode = asm.getHierarchy().findElementForSourceLine(checker.getSourceLocation()); String sourceHandle = asm.getHandleProvider().createHandleIdentifier(sourceNode); if (sourceHandle == null) return; IRelationshipMap mapper = asm.getRelationshipMap(); IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE, MATCHED_BY, false, true); foreward.addTarget(targetHandle); IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE, MATCHES_DECLARE, false, true); if (back != null && back.getTargets() != null) { back.addTarget(sourceHandle);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
} if (sourceNode.getSourceLocation() != null) { asm.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile()); } } public void addRelationship(AsmManager asm, ResolvedType onType, ResolvedTypeMunger munger, ResolvedType originatingAspect) { if (asm == null) return; if (originatingAspect.getSourceLocation() != null) { String sourceHandle = ""; IProgramElement sourceNode = null; if (munger.getSourceLocation() != null && munger.getSourceLocation().getOffset() != -1) { sourceNode = asm.getHierarchy().findElementForSourceLine(munger.getSourceLocation()); sourceHandle = asm.getHandleProvider().createHandleIdentifier(sourceNode); } else { sourceNode = asm.getHierarchy().findElementForSourceLine(originatingAspect.getSourceLocation()); sourceHandle = asm.getHandleProvider().createHandleIdentifier(sourceNode); } if (sourceHandle == null) return; IProgramElement targetNode = asm.getHierarchy().findElementForSourceLine(onType.getSourceLocation()); String targetHandle = asm.getHandleProvider().createHandleIdentifier(targetNode); if (targetHandle == null) return; IRelationshipMap mapper = asm.getRelationshipMap(); IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, INTER_TYPE_DECLARES, false, true); foreward.addTarget(targetHandle); IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, INTER_TYPE_DECLARED_BY, false,
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
true); back.addTarget(sourceHandle); asm.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile()); } }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
} /** * Adds a declare annotation relationship, sometimes entities don't have source locs (methods/fields) so use other variants of * this method if that is the case as they will look the entities up in the structure model. */ public void addDeclareAnnotationRelationship(AsmManager asm, ISourceLocation declareAnnotationLocation, ISourceLocation annotatedLocation) { if (asm == null) return; IProgramElement sourceNode = asm.getHierarchy().findElementForSourceLine(declareAnnotationLocation); String sourceHandle = asm.getHandleProvider().createHandleIdentifier(sourceNode); if (sourceHandle == null) return; IProgramElement targetNode = asm.getHierarchy().findElementForSourceLine(annotatedLocation); String targetHandle = asm.getHandleProvider().createHandleIdentifier(targetNode); if (targetHandle == null) return; IRelationshipMap mapper = asm.getRelationshipMap(); IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES, false, true); foreward.addTarget(targetHandle); IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY, false, true); back.addTarget(sourceHandle); if (sourceNode.getSourceLocation() != null) { asm.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile()); }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
} /** * Creates the hierarchy for binary aspects */ public static void createHierarchy(AsmManager asm, ShadowMunger munger) { if (!munger.isBinary()) return; IProgramElement sourceFileNode = asm.getHierarchy().findElementForSourceLine(munger.getSourceLocation()); if (!sourceFileNode.getKind().equals(IProgramElement.Kind.FILE_JAVA)) { return; } ResolvedType aspect = munger.getDeclaringType(); IProgramElement classFileNode = new ProgramElement(asm, sourceFileNode.getName(), IProgramElement.Kind.FILE, munger .getBinarySourceLocation(aspect.getSourceLocation()), 0, null, null); IProgramElement root = asm.getHierarchy().getRoot(); IProgramElement binaries = asm.getHierarchy().findElementForLabel(root, IProgramElement.Kind.SOURCE_FOLDER, "binaries"); if (binaries == null) { binaries = new ProgramElement(asm, "binaries", IProgramElement.Kind.SOURCE_FOLDER, new ArrayList()); root.addChild(binaries); } String packagename = aspect.getPackageName() == null ? "" : aspect.getPackageName();
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
IProgramElement pkgNode = asm.getHierarchy().findElementForLabel(binaries, IProgramElement.Kind.PACKAGE, packagename); if (pkgNode == null) { pkgNode = new ProgramElement(asm, packagename, IProgramElement.Kind.PACKAGE, new ArrayList()); binaries.addChild(pkgNode); pkgNode.addChild(classFileNode); } else { pkgNode.addChild(classFileNode); for (Iterator iter = pkgNode.getChildren().iterator(); iter.hasNext();) { IProgramElement element = (IProgramElement) iter.next(); if (!element.equals(classFileNode) && element.getHandleIdentifier().equals(classFileNode.getHandleIdentifier())) { pkgNode.removeChild(classFileNode); return; } } }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
} } } classFileNode.addChild(new ProgramElement(asm, "import declarations", IProgramElement.Kind.IMPORT_REFERENCE, null, 0, null, null)); IProgramElement aspectNode = new ProgramElement(asm, aspect.getSimpleName(), IProgramElement.Kind.ASPECT, munger .getBinarySourceLocation(aspect.getSourceLocation()), aspect.getModifiers(), null, null); classFileNode.addChild(aspectNode); addChildNodes(asm, munger, aspectNode, aspect.getDeclaredPointcuts()); addChildNodes(asm, munger, aspectNode, aspect.getDeclaredAdvice()); addChildNodes(asm, munger, aspectNode, aspect.getDeclares()); } private static void addChildNodes(AsmManager asm, ShadowMunger munger, IProgramElement parent, ResolvedMember[] children) { for (int i = 0; i < children.length; i++) { ResolvedMember pcd = children[i]; if (pcd instanceof ResolvedPointcutDefinition) { ResolvedPointcutDefinition rpcd = (ResolvedPointcutDefinition) pcd; ISourceLocation sLoc = rpcd.getPointcut().getSourceLocation(); if (sLoc == null) { sLoc = rpcd.getSourceLocation(); } parent.addChild(new ProgramElement(asm, pcd.getName(), IProgramElement.Kind.POINTCUT, munger .getBinarySourceLocation(sLoc), pcd.getModifiers(), null, Collections.EMPTY_LIST)); }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
} } private static void addChildNodes(AsmManager asm, ShadowMunger munger, IProgramElement parent, Collection children) { int deCtr = 1; int dwCtr = 1; for (Iterator iter = children.iterator(); iter.hasNext();) { Object element = iter.next(); if (element instanceof DeclareErrorOrWarning) { DeclareErrorOrWarning decl = (DeclareErrorOrWarning) element; int counter = 0; if (decl.isError()) { counter = deCtr++; } else { counter = dwCtr++; } parent.addChild(createDeclareErrorOrWarningChild(asm, munger, decl, counter)); } else if (element instanceof Advice) { Advice advice = (Advice) element; parent.addChild(createAdviceChild(asm, advice)); } } } private static IProgramElement createDeclareErrorOrWarningChild(AsmManager asm, ShadowMunger munger, DeclareErrorOrWarning decl, int count) { IProgramElement deowNode = new ProgramElement(asm, decl.getName(), decl.isError() ? IProgramElement.Kind.DECLARE_ERROR : IProgramElement.Kind.DECLARE_WARNING, munger.getBinarySourceLocation(decl.getSourceLocation()), decl .getDeclaringType().getModifiers(), null, null); deowNode.setDetails("\"" + AsmRelationshipUtils.genDeclareMessage(decl.getMessage()) + "\""); if (count != -1) { deowNode.setBytecodeName(decl.getName() + "_" + count);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
} return deowNode; } private static IProgramElement createAdviceChild(AsmManager asm, Advice advice) { IProgramElement adviceNode = new ProgramElement(asm, advice.getKind().getName(), IProgramElement.Kind.ADVICE, advice .getBinarySourceLocation(advice.getSourceLocation()), advice.getSignature().getModifiers(), null, Collections.EMPTY_LIST); adviceNode.setDetails(AsmRelationshipUtils.genPointcutDetails(advice.getPointcut())); adviceNode.setBytecodeName(advice.getSignature().getName()); } return adviceNode; } public static String getHandle(Advice advice, AsmManager asm) { if (null == advice.handle) { ISourceLocation sl = advice.getSourceLocation(); if (sl != null) { IProgramElement ipe = asm.getHierarchy().findElementForSourceLine(sl); advice.handle = asm.getHandleProvider().createHandleIdentifier(ipe); } } return advice.handle; } public static void adviceMunger(AsmManager asm, Shadow shadow, ShadowMunger munger) { if (asm == null) return; if (munger instanceof Advice) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
Advice advice = (Advice) munger; if (advice.getKind().isPerEntry() || advice.getKind().isCflow()) { return; } if (World.createInjarHierarchy) { createHierarchy(asm, advice); } IRelationshipMap mapper = asm.getRelationshipMap(); IProgramElement targetNode = getNode(asm, shadow); if (targetNode == null) return; boolean runtimeTest = advice.hasDynamicTests(); IProgramElement.ExtraInformation ai = new IProgramElement.ExtraInformation(); String adviceHandle = getHandle(advice, asm); if (adviceHandle == null) return; AdviceKind ak = ((Advice) munger).getKind(); ai.setExtraAdviceInformation(ak.getName()); IProgramElement adviceElement = asm.getHierarchy().findElementForHandle(adviceHandle); if (adviceElement != null) { adviceElement.setExtraInfo(ai); } String targetHandle = targetNode.getHandleIdentifier(); if (advice.getKind().equals(AdviceKind.Softener)) { IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.DECLARE_SOFT, SOFTENS, runtimeTest, true);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
if (foreward != null) foreward.addTarget(targetHandle); IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE, SOFTENED_BY, runtimeTest, true); if (back != null) back.addTarget(adviceHandle); } else { IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.ADVICE, ADVISES, runtimeTest, true); if (foreward != null) foreward.addTarget(targetHandle); IRelationship back = mapper.get(targetHandle, IRelationship.Kind.ADVICE, ADVISED_BY, runtimeTest, true); if (back != null) back.addTarget(adviceHandle); } if (adviceElement.getSourceLocation() != null) { asm.addAspectInEffectThisBuild(adviceElement.getSourceLocation().getSourceFile()); } } } protected static IProgramElement getNode(AsmManager model, Shadow shadow) { Member enclosingMember = shadow.getEnclosingCodeSignature(); IProgramElement enclosingNode = lookupMember(model.getHierarchy(), enclosingMember); if (enclosingNode == null) { Lint.Kind err = shadow.getIWorld().getLint().shadowNotInStructure; if (err.isEnabled()) { err.signal(shadow.toString(), shadow.getSourceLocation()); }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
return null; } Member shadowSig = shadow.getSignature(); if (shadow.getKind() == Shadow.MethodCall || !shadowSig.equals(enclosingMember)) { IProgramElement bodyNode = findOrCreateCodeNode(model, enclosingNode, shadowSig, shadow); return bodyNode; } else { return enclosingNode; } } private static boolean sourceLinesMatch(ISourceLocation loc1, ISourceLocation loc2) { if (loc1.getLine() != loc2.getLine()) return false; return true; } /** * Finds or creates a code IProgramElement for the given shadow. * * The byteCodeName of the created node is set to 'shadowSig.getName() + "!" + counter', eg "println!3". The counter is the * occurence count of children within the enclosingNode which have the same name. So, for example, if a method contains two * System.out.println statements, the first one will have byteCodeName 'println!1' and the second will have byteCodeName * 'println!2'. This is to ensure the two nodes have unique handles when the handles do not depend on sourcelocations. * * Currently the shadows are examined in the sequence they appear in the source file. This means that the counters are * consistent over incremental builds. All aspects are compiled up front and any new aspect created will force a full build. * Moreover, if the body of the enclosingShadow is changed, then the model for this is rebuilt from scratch. */ private static IProgramElement findOrCreateCodeNode(AsmManager asm, IProgramElement enclosingNode, Member shadowSig, Shadow shadow) {
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
for (Iterator it = enclosingNode.getChildren().iterator(); it.hasNext();) { IProgramElement node = (IProgramElement) it.next(); int excl = node.getBytecodeName().lastIndexOf('!'); if (((excl != -1 && shadowSig.getName().equals(node.getBytecodeName().substring(0, excl))) || shadowSig.getName() .equals(node.getBytecodeName())) && shadowSig.getSignature().equals(node.getBytecodeSignature()) && sourceLinesMatch(node.getSourceLocation(), shadow.getSourceLocation())) { return node; } } ISourceLocation sl = shadow.getSourceLocation(); SourceLocation peLoc = new SourceLocation(enclosingNode.getSourceLocation().getSourceFile(), sl.getLine()); peLoc.setOffset(sl.getOffset()); IProgramElement peNode = new ProgramElement(asm, shadow.toString(), IProgramElement.Kind.CODE, peLoc, 0, null, null); int numberOfChildrenWithThisName = 0; for (Iterator it = enclosingNode.getChildren().iterator(); it.hasNext();) { IProgramElement child = (IProgramElement) it.next(); if (child.getName().equals(shadow.toString())) { numberOfChildrenWithThisName++; } } peNode.setBytecodeName(shadowSig.getName() + "!" + String.valueOf(numberOfChildrenWithThisName + 1)); peNode.setBytecodeSignature(shadowSig.getSignature()); enclosingNode.addChild(peNode);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
return peNode; } protected static IProgramElement lookupMember(IHierarchy model, Member member) { UnresolvedType declaringType = member.getDeclaringType(); IProgramElement classNode = model.findElementForType(declaringType.getPackageName(), declaringType.getClassName()); return findMemberInClass(classNode, member); } protected static IProgramElement findMemberInClass(IProgramElement classNode, Member member) { if (classNode == null) return null; for (Iterator it = classNode.getChildren().iterator(); it.hasNext();) { IProgramElement node = (IProgramElement) it.next(); if (member.getName().equals(node.getBytecodeName()) && member.getSignature().equals(node.getBytecodeSignature())) { return node; } } return classNode; }
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
} } public static AsmRelationshipProvider getDefault() { return INSTANCE; } /** * Add a relationship to the known set for a declare @method/@constructor construct. Locating the method is a messy (for messy * read 'fragile') bit of code that could break at any moment but it's working for my simple testcase. Currently just fails * silently if any of the lookup code doesn't find anything... * * @param hierarchy */ public void addDeclareAnnotationMethodRelationship(ISourceLocation sourceLocation, String typename, ResolvedMember method, AsmManager structureModel) { if (structureModel == null) return; String pkg = null;
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
String type = typename; int packageSeparator = typename.lastIndexOf("."); if (packageSeparator != -1) { pkg = typename.substring(0, packageSeparator); type = typename.substring(packageSeparator + 1); } IHierarchy hierarchy = structureModel.getHierarchy(); IProgramElement typeElem = hierarchy.findElementForType(pkg, type); if (typeElem == null) return; StringBuffer parmString = new StringBuffer("("); UnresolvedType[] args = method.getParameterTypes(); for (int i = 0; i < args.length; i++) { String s = args[i].getName(); parmString.append(s); if ((i + 1) < args.length) parmString.append(","); } parmString.append(")"); IProgramElement methodElem = null; if (method.getName().startsWith("<init>")) { methodElem = hierarchy.findElementForSignature(typeElem, IProgramElement.Kind.CONSTRUCTOR, type + parmString); if (methodElem == null && args.length == 0) methodElem = typeElem; } else { methodElem = hierarchy.findElementForSignature(typeElem, IProgramElement.Kind.METHOD, method.getName() + parmString);
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
} if (methodElem == null) return; try { String targetHandle = methodElem.getHandleIdentifier(); if (targetHandle == null) return; IProgramElement sourceNode = hierarchy.findElementForSourceLine(sourceLocation); String sourceHandle = structureModel.getHandleProvider().createHandleIdentifier(sourceNode); if (sourceHandle == null) return; IRelationshipMap mapper = structureModel.getRelationshipMap(); IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES, false, true); foreward.addTarget(targetHandle); IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY, false, true); back.addTarget(sourceHandle); } catch (Throwable t) { t.printStackTrace(); } } /** * Add a relationship to the known set for a declare @field construct. Locating the field is trickier than it might seem since * we have no line number info for it, we have to dig through the structure model under the fields' type in order to locate it. * Currently just fails silently if any of the lookup code doesn't find anything... */ public void addDeclareAnnotationFieldRelationship(AsmManager asm, ISourceLocation sourceLocation, String typename, ResolvedMember field) { if (asm == null)
185,447
Bug 185447 [plan] [ataspectj] Abstract @Aspect causing problems
Trying to use an abstract @Aspect from a library jar file is causing problems. In the (soon to be) attached zip of eclipse projects: * logging-library: defines two abstract trivial logging aspects, one in code-style and one in @AspectJ style. * sample-system: uses the code-style abstract aspect successfully * sample-system2: uses the @AspectJ style abstract aspect and won't compile in Eclipse Exception: java.lang.NullPointerException at org.aspectj.weaver.bcel.AtAjAttributes$LazyResolvedPointcutDefinition.getPointcut(AtAjAttributes.java:1632) at org.aspectj.weaver.ShadowMunger.addChildNodes(ShadowMunger.java:258) at org.aspectj.weaver.ShadowMunger.createHierarchy(ShadowMunger.java:247) at org.aspectj.weaver.AsmRelationshipProvider.adviceMunger(AsmRelationshipProvider.java:180) at org.aspectj.weaver.Shadow.implementMungers(Shadow.java:717) a ... int;)Ljava/lang/String; ARETURN end public Object run(Object[])
resolved fixed
120b47f
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-01T21:00:43Z
2007-05-03T22:06:40Z
weaver/src/org/aspectj/weaver/model/AsmRelationshipProvider.java
return; String pkg = null; String type = typename; int packageSeparator = typename.lastIndexOf("."); if (packageSeparator != -1) { pkg = typename.substring(0, packageSeparator); type = typename.substring(packageSeparator + 1); } IHierarchy hierarchy = asm.getHierarchy(); IProgramElement typeElem = hierarchy.findElementForType(pkg, type); if (typeElem == null) return; IProgramElement fieldElem = hierarchy.findElementForSignature(typeElem, IProgramElement.Kind.FIELD, field.getName()); if (fieldElem == null) return; String targetHandle = fieldElem.getHandleIdentifier(); if (targetHandle == null) return; IProgramElement sourceNode = hierarchy.findElementForSourceLine(sourceLocation); String sourceHandle = asm.getHandleProvider().createHandleIdentifier(sourceNode); if (sourceHandle == null) return; IRelationshipMap mapper = asm.getRelationshipMap(); IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES, false, true); foreward.addTarget(targetHandle); IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY, false, true); back.addTarget(sourceHandle); } }
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
/******************************************************************************* * Copyright (c) 2008 Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http:www.eclipse.org/legal/epl-v10.html * * Contributors: * Andy Clement - initial API and implementation *******************************************************************************/ package org.aspectj.systemtest.ajc163; import java.io.File; import java.util.Iterator; import java.util.List; import junit.framework.Test; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.LocalVariable; import org.aspectj.apache.bcel.classfile.LocalVariableTable; import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.asm.AsmManager; import org.aspectj.asm.IHierarchy; import org.aspectj.asm.IProgramElement; import org.aspectj.testing.Utils; import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
public void testAtTargetPlus_pr255856() { runTest("attarget with plus"); } public void testNonNullAtArgs_pr257833() { runTest("param annos and at args"); } public void testIncorrectArgOrdering_pr219419() { runTest("incorrect arg ordering anno style"); } public void testIncorrectArgOrdering_pr219419_2() { runTest("incorrect arg ordering anno style - 2"); } public void testIncorrectArgOrdering_pr219419_3() { runTest("incorrect arg ordering anno style - 3"); } public void testIncorrectArgOrdering_pr219419_4() { runTest("incorrect arg ordering anno style - 4"); } public void testIncorrectArgOrdering_pr219419_5() {
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
runTest("incorrect arg ordering anno style - 5"); } public void testDecpAnnoStyle_pr257754() { runTest("decp anno style"); } public void testDecpAnnoStyle_pr257754_2() { runTest("decp anno style - 2"); } public void testPoorAtAjIfMessage_pr256458() { runTest("poor ataj if message - 1"); } public void testPoorAtAjIfMessage_pr256458_2() { runTest("poor ataj if message - 2"); } /* * public void testInheritedAnnotations_pr128664() { runTest("inherited annotations"); } * * public void testInheritedAnnotations_pr128664_2() { runTest("inherited annotations - 2"); } */ public void testGetMethodNull_pr154427() { runTest("getMethod returning null"); } public void testItdOnAnonInner_pr171042() { runTest("itd on anonymous inner"); } public void testMixedStyles_pr213751() { runTest("mixed styles"); } public void testHandles_pr249216c24() { runTest("handles - escaped square brackets");
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); IProgramElement ipe = null; ipe = findElementAtLine(top.getRoot(), 4); assertEquals("<{Handles.java}Handles)Ship.i)\\[\\[Qjava.util.List\\<QString;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 7); assertEquals("<{Handles.java}Handles)Ship.i)\\[\\[Qjava.util.Set\\<QString;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 10); assertEquals("<{Handles.java}Handles~i~\\[\\[Qjava.util.Set\\<QString;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 13); assertEquals("<{Handles.java}Handles~i~\\[\\[Qjava.util.Set\\<QString;>;~I", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 16); assertEquals("<{Handles.java}Handles~i2~\\[\\[Qjava.util.Set\\<+QCollection\\<QString;>;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 19); assertEquals("<{Handles.java}Handles~i3~\\[\\[Qjava.util.Set\\<+QCollection\\<\\[QString;>;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 22); assertEquals("<{Handles.java}Handles~i4~Qjava.util.Set\\<+QCollection\\<QString;>;>;", ipe.getHandleIdentifier()); ipe = findElementAtLine(top.getRoot(), 25); assertEquals("<{Handles.java}Handles~i5~Qjava.util.Set\\<*>;", ipe.getHandleIdentifier()); } public void testFQType_pr256937() { runTest("fully qualified return type"); IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); IProgramElement itd = findElementAtLine(top.getRoot(), 10); String type = itd.getCorrespondingType(true); assertEquals("java.util.List<java.lang.String>", type); itd = findElementAtLine(top.getRoot(), 16); type = itd.getCorrespondingType(true); assertEquals("java.util.List<java.lang.String>", type);
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
} private IProgramElement findElementAtLine(IProgramElement whereToLook, int line) { if (whereToLook == null) { return null; } if (whereToLook.getSourceLocation() != null && whereToLook.getSourceLocation().getLine() == line) { return whereToLook; } List kids = whereToLook.getChildren(); for (Iterator iterator = kids.iterator(); iterator.hasNext();) { IProgramElement object = (IProgramElement) iterator.next(); if (object.getSourceLocation() != null && object.getSourceLocation().getLine() == line) { return object; } IProgramElement gotSomething = findElementAtLine(object, line); if (gotSomething != null) { return gotSomething; } } return null; } public void testParameterAnnotationsOnITDs_pr256669() { runTest("parameter annotations on ITDs"); } public void testParameterAnnotationsOnITDs_pr256669_2() { runTest("parameter annotations on ITDs - 2"); } public void testParameterAnnotationsOnITDs_pr256669_3() { runTest("parameter annotations on ITDs - 3"); }
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
public void testParameterAnnotationsOnITDs_pr256669_4() { runTest("parameter annotations on ITDs - 4"); } public void testOrderingIssue_1() { runTest("ordering issue"); } public void testOrderingIssue_2() { runTest("ordering issue - 2"); } public void testGenericPointcuts_1() { runTest("generic pointcuts - 1"); } public void testGenericPointcuts_2() { runTest("generic pointcuts - 2"); } public void testGenericPointcuts_3() { runTest("generic pointcuts - 3"); } public void testGenericPointcuts_4() { runTest("generic pointcuts - 4"); }
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
public void testDontAddMethodBodiesToInterface_pr163005() { runTest("do not add method bodies to an interface"); } public void testDontAddMethodBodiesToInterface_pr163005_2() { runTest("do not add method bodies to an interface - 2"); } public void testDontAddMethodBodiesToInterface_pr163005_3() { runTest("do not add method bodies to an interface - 3"); } public void testMissingLocalVariableTableEntriesOnAroundAdvice_pr173978() throws Exception { runTest("missing local variable table on around advice"); JavaClass jc = Utils.getClassFrom(ajc.getSandboxDirectory().getAbsolutePath(), "Test"); Method[] ms = jc.getMethods(); Method m = null;
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
for (int i = 0; i < ms.length; i++) { if (ms[i].getName().equals("sayHello")) { m = ms[i]; } } if (m.getLocalVariableTable() == null) { fail("Local variable table should not be null"); } assertEquals(2, m.getLocalVariableTable().getLocalVariableTable().length); LocalVariable lv = m.getLocalVariableTable().getLocalVariable(0); assertNotNull(lv); assertEquals("this", lv.getName()); assertEquals(0, lv.getStartPC(), 0); assertEquals(12, lv.getLength(), 12); assertEquals("LTest;", lv.getSignature()); lv = m.getLocalVariableTable().getLocalVariable(1); assertNotNull(lv); assertEquals("message", lv.getName()); assertEquals(0, lv.getStartPC(), 0); assertEquals(12, lv.getLength(), 12); assertEquals("Ljava/lang/String;", lv.getSignature()); } public void testTerminateAfterCompilation_pr249710() { runTest("terminateAfterCompilation"); }
251,326
Bug 251326 Anonymous inner classes declare inside an ITD method will cause IllegalAccessError
If i declare an aspect in pkgB, having an ITD method for a class in pkgA using an inner anonymous class, is created in the pkgA package, package protected, but then instantiated from pkgB causeing the error. Test case is attached.
resolved fixed
f1a83b5
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2008-12-09T19:21:17Z
2008-10-19T21:00:00Z
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
public void testItdCCE_pr250091() { runTest("itd cce"); } public void testBreakingRecovery_pr226163() { runTest("breaking recovery"); } public void testGenericMethodConversions_pr250632() { runTest("type conversion in generic itd"); } public void testGenericMethodBridging_pr250493() { runTest("bridge methods for generic itds"); } public void testGenericFieldBridging_pr252285() { runTest("bridge methods for generic itd fields"); } public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Ajc163Tests.class); } protected File getSpecFile() { return new File("../tests/src/org/aspectj/systemtest/ajc163/ajc163.xml"); } private void print(LocalVariableTable localVariableTable) { LocalVariable[] lvs = localVariableTable.getLocalVariableTable(); for (int i = 0; i < lvs.length; i++) { LocalVariable localVariable = lvs[i]; System.out.println(localVariable); } } }
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
/* ******************************************************************* * Copyright (c) 1999-2001 Xerox Corporation, * 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: * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.ajc; import java.io.BufferedReader; import java.io.File; import java.io.FileFilter; import java.io.FileReader; import java.io.IOException; import java.util.LinkedList; import java.util.List; public class ConfigParser {
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
Location location; protected File relativeDirectory = null; protected List files = new LinkedList(); private boolean fileParsed = false; protected static String CONFIG_MSG = "build config error: "; public List getFiles() { return files; } public void parseCommandLine(String[] argsArray) throws ParseException { location = new CommandLineLocation(); LinkedList args = new LinkedList(); for (int i = 0; i < argsArray.length; i++) { args.add(new Arg(argsArray[i], location)); } parseArgs(args); } public void parseConfigFile(File configFile) throws ParseException { if (fileParsed == true) { throw new ParseException(CONFIG_MSG + "The file has already been parsed.", null);
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
} else { parseConfigFileHelper(configFile); } } /** * @throws ParseException if the config file has already been prased. */ private void parseConfigFileHelper(File configFile) { if (!configFile.exists()) { showError("file does not exist: " + configFile.getPath()); return; } LinkedList args = new LinkedList(); int lineNum = 0; try { BufferedReader stream = new BufferedReader(new FileReader(configFile)); String line = null; while ((line = stream.readLine()) != null) { lineNum += 1; line = stripWhitespaceAndComments(line); if (line.length() == 0) continue; args.add(new Arg(line, new CPSourceLocation(configFile, lineNum))); } stream.close(); } catch (IOException e) { location = new CPSourceLocation(configFile, lineNum); showError("error reading config file: " + e.toString()); } File oldRelativeDirectory = relativeDirectory;
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
relativeDirectory = configFile.getParentFile(); parseArgs(args); relativeDirectory = oldRelativeDirectory; fileParsed = true; } File getCurrentDir() { return location.getDirectory(); } String stripSingleLineComment(String s, String commentString) { int commentStart = s.indexOf(commentString); if (commentStart == -1) return s; else return s.substring(0, commentStart); } String stripWhitespaceAndComments(String s) { s = stripSingleLineComment(s, "//"); s = stripSingleLineComment(s, "#"); s = s.trim(); if (s.startsWith("\"") && s.endsWith("\"")) { s = s.substring(1, s.length() - 1); } return s; } /** * ??? We would like to call a showNonFatalError method here to show all errors in config files before aborting the compilation */ protected void addFile(File sourceFile) { if (!sourceFile.isFile()) { showError("source file does not exist: " + sourceFile.getPath());
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
} files.add(sourceFile); } void addFileOrPattern(File sourceFile) { if (sourceFile.getName().charAt(0) == '*') { if (sourceFile.getName().equals("*.java")) { addFiles(sourceFile.getParentFile(), new FileFilter() { public boolean accept(File f) { return f != null && f.getName().endsWith(".java"); } }); } else if (sourceFile.getName().equals("*.aj")) { addFiles(sourceFile.getParentFile(), new FileFilter() { public boolean accept(File f) { return f != null && f.getName().endsWith(".aj"); } }); } else { addFile(sourceFile); } } else { addFile(sourceFile); } } void addFiles(File dir, FileFilter filter) { if (dir == null) dir = new File(System.getProperty("user.dir")); if (!dir.isDirectory()) { showError("can't find " + dir.getPath()); } else {
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
File[] files = dir.listFiles(filter); if (files.length == 0) { showWarning("no matching files found in: " + dir); } for (int i = 0; i < files.length; i++) { addFile(files[i]); } } } protected void parseOption(String arg, LinkedList args) { showWarning("unrecognized option: " + arg); } protected void showWarning(String message) { if (location != null) { message += " at " + location.toString(); } System.err.println(CONFIG_MSG + message); } protected void showError(String message) { throw new ParseException(CONFIG_MSG + message, location); } void parseArgs(LinkedList args) { while (args.size() > 0) parseOneArg(args); } protected Arg removeArg(LinkedList args) { if (args.size() == 0) { showError("value missing"); return null; } else {
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
return (Arg) args.removeFirst(); } } protected String removeStringArg(LinkedList args) { Arg arg = removeArg(args); if (arg == null) return null; return arg.getValue(); } boolean isSourceFileName(String s) { if (s.endsWith(".java")) return true; if (s.endsWith(".aj")) return true; return false; } void parseOneArg(LinkedList args) { Arg arg = removeArg(args); String v = arg.getValue(); location = arg.getLocation(); if (v.startsWith("@")) { parseImportedConfigFile(v.substring(1)); } else if (v.equals("-argfile")) { parseConfigFileHelper(makeFile(removeArg(args).getValue())); } else if (isSourceFileName(v)) { addFileOrPattern(makeFile(v));
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
} else { parseOption(arg.getValue(), args); } } protected void parseImportedConfigFile(String relativeFilePath) { parseConfigFileHelper(makeFile(relativeFilePath)); } public File makeFile(String name) { if (relativeDirectory != null) { return makeFile(relativeDirectory, name); } else { return makeFile(getCurrentDir(), name); } } private File makeFile(File dir, String name) { name = name.replace('/', File.separatorChar); File ret = new File(name); boolean isAbsolute = ret.isAbsolute() || (ret.exists() && ret.getPath().startsWith(File.separator)); if (!isAbsolute && (dir != null)) { ret = new File(dir, name); } try { ret = ret.getCanonicalFile(); } catch (IOException ioEx) { } return ret; } protected static class Arg {
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
private Location location; private String value; public Arg(String value, Location location) { this.value = value; this.location = location; } public void setValue(String value) { this.value = value; } public void setLocation(Location location) { this.location = location; } public String getValue() { return value; } public Location getLocation() { return location; } } static abstract class Location {
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
public abstract File getFile(); public abstract File getDirectory(); public abstract int getLine(); public abstract String toString(); } static class CPSourceLocation extends Location { private int line; private File file; public CPSourceLocation(File file, int line) { this.line = line; this.file = file; } public File getFile() { return file; } public File getDirectory() { return file.getParentFile(); } public int getLine() { return line; } public String toString() { return file.getPath() + ":" + line; } } static class CommandLineLocation extends Location {
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
public File getFile() { return new File(System.getProperty("user.dir")); } public File getDirectory() { return new File(System.getProperty("user.dir")); } public int getLine() { return -1; } public String toString() { return "command-line"; } } public static class ParseException extends RuntimeException {
260,751
Bug 260751 java.lang.StringIndexOutOfBoundsException
ava.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1938) at org.aspectj.ajdt.ajc.ConfigParser.stripWhitespaceAndComments(ConfigParser.java:103) at org.aspectj.ajdt.ajc.ConfigParser.parseConfigFileHelper(ConfigParser.java:69) at org.aspectj.ajdt.ajc.ConfigParser.parseImportedConfigFile(ConfigParser.java:224) at org.aspectj.ajdt.ajc.ConfigParser.parseOneArg(ConfigParser.java:213) at org.aspectj.ajdt.ajc.ConfigP ... 82) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
resolved fixed
d9bd46d
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-12T21:35:16Z
2009-01-12T17:06:40Z
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java
private Location location; public ParseException(String message, Location location) { super(message); this.location = location; } public int getLine() { if (location == null) return -1; return location.getLine(); } public File getFile() { if (location == null) return null; return location.getFile(); } } }
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
/* ******************************************************************* * Copyright (c) 2001-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC) * 2003-2004 Contributors. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http:www.eclipse.org/legal/epl-v10.html * * Contributors: * Xerox/PARC initial implementation * Wes Isberg 2003-2004 changes * ******************************************************************/ package org.aspectj.tools.ant.taskdefs;
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import org.apache.tools.ant.AntClassLoader; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Location; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Copy; import org.apache.tools.ant.taskdefs.Delete; import org.apache.tools.ant.taskdefs.Execute; import org.apache.tools.ant.taskdefs.Expand; import org.apache.tools.ant.taskdefs.Javac; import org.apache.tools.ant.taskdefs.LogStreamHandler; import org.apache.tools.ant.taskdefs.MatchingTask; import org.apache.tools.ant.taskdefs.Mkdir; import org.apache.tools.ant.taskdefs.PumpStreamHandler; import org.apache.tools.ant.taskdefs.Zip; import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter; import org.apache.tools.ant.types.Commandline; import org.apache.tools.ant.types.CommandlineJava; import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.PatternSet;
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
import org.apache.tools.ant.types.Reference; import org.apache.tools.ant.types.ZipFileSet; import org.apache.tools.ant.util.TaskLogger; import org.aspectj.bridge.AbortException; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.MessageHandler; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.IMessage.Kind; import org.aspectj.tools.ajc.Main; import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; /** * This runs the AspectJ 1.1 compiler, * supporting all the command-line options. * In 1.1.1, ajc copies resources from input jars, * but you can copy resources from the source directories * using sourceRootCopyFilter. * When not forking, things will be copied as needed * for each iterative compile, * but when forking things are only copied at the * completion of a successful compile. * <p> * See the development environment guide for * usage documentation. * * @since AspectJ 1.1, Ant 1.5 */ public class AjcTask extends MatchingTask {
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
/* * This task mainly converts ant specification for ajc, * verbosely ignoring improper input. * It also has some special features for non-obvious clients: * (1) Javac compiler adapter supported in * <code>setupAjc(AjcTask, Javac, File)</code> * and * <code>readArguments(String[])</code>; * (2) testing is supported by * (a) permitting the same specification to be re-run * with added flags (settings once made cannot be * removed); and * (b) permitting recycling the task with * <code>reset()</code> (untested). * * The parts that do more than convert ant specs are * (a) code for forking;
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
* (b) code for copying resources. * * If you maintain/upgrade this task, keep in mind: * (1) changes to the semantics of ajc (new options, new * values permitted, etc.) will have to be reflected here. * (2) the clients: * the iajc ant script, Javac compiler adapter, * maven clients of iajc, and testing code. */ /** * This method extracts javac arguments to ajc, * and add arguments to make ajc behave more like javac * in copying resources. * <p> * Pass ajc-specific options using compilerarg sub-element: * <pre> * &lt;javac srcdir="src"> * &lt;compilerarg compiler="..." line="-argfile src/args.lst"/> * &lt;javac> * </pre> * Some javac arguments are not supported in this component (yet): * <pre> * String memoryInitialSize; * boolean includeAntRuntime = true; * boolean includeJavaRuntime = false; * </pre> * Other javac arguments are not supported in ajc 1.1: * <pre> * boolean optimize;
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
* String forkedExecutable; * FacadeTaskHelper facade; * boolean depend; * String debugLevel; * Path compileSourcepath; * </pre> * @param javac the Javac command to implement (not null) * @param ajc the AjcTask to adapt (not null) * @param destDir the File class destination directory (may be null) * @return null if no error, or String error otherwise */ public String setupAjc(Javac javac) { if (null == javac) { return "null javac"; } AjcTask ajc = this; ajc.setProject(javac.getProject()); ajc.setLocation(javac.getLocation()); ajc.setTaskName("javac-iajc"); ajc.setDebug(javac.getDebug()); ajc.setDeprecation(javac.getDeprecation()); ajc.setFailonerror(javac.getFailonerror()); final boolean fork = javac.isForkedJavac(); ajc.setFork(fork); if (fork) { ajc.setMaxmem(javac.getMemoryMaximumSize()); } ajc.setNowarn(javac.getNowarn());
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
ajc.setListFileArgs(javac.getListfiles()); ajc.setVerbose(javac.getVerbose()); ajc.setTarget(javac.getTarget()); ajc.setSource(javac.getSource()); ajc.setEncoding(javac.getEncoding()); File javacDestDir = javac.getDestdir(); if (null != javacDestDir) { ajc.setDestdir(javacDestDir); ajc.setSourceRootCopyFilter("**/CVS/*,**/*.java,**/*.aj"); } ajc.setBootclasspath(javac.getBootclasspath()); ajc.setExtdirs(javac.getExtdirs()); ajc.setClasspath(javac.getClasspath()); ajc.addFiles(javac.getFileList()); ajc.readArguments(javac.getCurrentCompilerArgs()); return null; } /** * Find aspectjtools.jar on the task or system classpath. * Accept <code>aspectj{-}tools{...}.jar</code> * mainly to support build systems using maven-style * re-naming * (e.g., <code>aspectj-tools-1.1.0.jar</code>.
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
* Note that we search the task classpath first, * though an entry on the system classpath would be loaded first, * because it seems more correct as the more specific one. * @return readable File for aspectjtools.jar, or null if not found. */ public static File findAspectjtoolsJar() { File result = null; ClassLoader loader = AjcTask.class.getClassLoader(); if (loader instanceof AntClassLoader) { AntClassLoader taskLoader = (AntClassLoader) loader; String cp = taskLoader.getClasspath(); String[] cps = LangUtil.splitClasspath(cp); for (int i = 0; (i < cps.length) && (null == result); i++) { result = isAspectjtoolsjar(cps[i]); } } if (null == result) { final Path classpath = Path.systemClasspath; final String[] paths = classpath.list(); for (int i = 0; (i < paths.length) && (null == result); i++) { result = isAspectjtoolsjar(paths[i]); } } return (null == result? null : result.getAbsoluteFile()); } private static File isAspectjtoolsjar(String path) { if (null == path) { return null;
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
} final String prefix = "aspectj"; final String infix = "tools"; final String altInfix = "-tools"; final String suffix = ".jar"; final int prefixLength = 7; final int minLength = 16; if (!path.endsWith(suffix)) { return null; } int loc = path.lastIndexOf(prefix); if ((-1 != loc) && ((loc + minLength) <= path.length())) { String rest = path.substring(loc+prefixLength); if (-1 != rest.indexOf(File.pathSeparator)) { return null; } if (rest.startsWith(infix) || rest.startsWith(altInfix)) { File result = new File(path); if (result.canRead() && result.isFile()) { return result; } } } return null; } /** * Maximum length (in chars) of command line * before converting to an argfile when forking
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
*/ private static final int MAX_COMMANDLINE = 4096; private static final File DEFAULT_DESTDIR = new File(".") { public String toString() { return "(no destination dir specified)"; } }; private static final String USAGE_SUBSTRING = "AspectJ-specific options"; private static final List VALID_XOPTIONS; private static final List VALID_WARNINGS; private static final List VALID_DEBUG; /** * -Xlint variants (error, warning, ignore) * @see org.aspectj.weaver.Lint */ private static final List VALID_XLINT; public static final String COMMAND_EDITOR_NAME = AjcTask.class.getName() + ".COMMAND_EDITOR"; static final String[] TARGET_INPUTS = new String [] { "1.1", "1.2", "1.3", "1.4", "1.5", "1.6" }; static final String[] SOURCE_INPUTS = new String [] { "1.3", "1.4", "1.5", "1.6" }; static final String[] COMPLIANCE_INPUTS = new String []
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
{ "-1.3", "-1.4", "-1.5", "-1.6" }; private static final ICommandEditor COMMAND_EDITOR; static { String[] xs = new String[] { "serializableAspects", "incrementalFile", "lazyTjp", "reweavable", "reweavable:compress", "notReweavable", "noInline", "terminateAfterCompilation","hasMember", "ajruntimetarget:1.2", "ajruntimetarget:1.5", "addSerialVersionUID" }; VALID_XOPTIONS = Collections.unmodifiableList(Arrays.asList(xs)); xs = new String[] { "constructorName", "packageDefaultMethod", "deprecation", "maskedCatchBlocks", "unusedLocals", "unusedArguments", "unusedImports", "syntheticAccess", "assertIdentifier", "allDeprecation","allJavadoc","charConcat","conditionAssign", "emptyBlock", "fieldHiding", "finally", "indirectStatic", "intfNonInherited", "javadoc", "localHiding", "nls", "noEffectAssign",
261,808
Bug 261808 iajc-Ant-Task fails "type already defined"
null
resolved fixed
1da1f7c
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-01-31T04:33:22Z
2009-01-21T12:13:20Z
taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
"pkgDefaultMethod", "semicolon", "unqualifiedField", "unusedPrivate", "unusedThrown", "uselessTypeCheck", "specialParamHiding", "staticReceiver", "syntheticAccess", "none" }; VALID_WARNINGS = Collections.unmodifiableList(Arrays.asList(xs)); xs = new String[] {"none", "lines", "vars", "source" }; VALID_DEBUG = Collections.unmodifiableList(Arrays.asList(xs)); xs = new String[] { "error", "warning", "ignore"}; VALID_XLINT = Collections.unmodifiableList(Arrays.asList(xs)); ICommandEditor editor = null; try { String editorClassName = System.getProperty(COMMAND_EDITOR_NAME); if (null != editorClassName) { ClassLoader cl = AjcTask.class.getClassLoader(); Class editorClass = cl.loadClass(editorClassName); editor = (ICommandEditor) editorClass.newInstance(); } } catch (Throwable t) { System.err.println("Warning: unable to load command editor"); t.printStackTrace(System.err); }