diff options
author | Andy Clement <aclement@pivotal.io> | 2020-07-22 14:09:06 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2020-07-22 14:09:06 -0700 |
commit | c3289ab86bfb2c97cf34147239b3dde46de92a7c (patch) | |
tree | 9c52e4420eb874ccabc8e265b9cabaaf8717f815 /org.aspectj.ajdt.core/src | |
parent | 5c82acb58e2d665a46529290ae85ae717cbf2bd3 (diff) | |
download | aspectj-c3289ab86bfb2c97cf34147239b3dde46de92a7c.tar.gz aspectj-c3289ab86bfb2c97cf34147239b3dde46de92a7c.zip |
Polish
Diffstat (limited to 'org.aspectj.ajdt.core/src')
-rw-r--r-- | org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java | 18 | ||||
-rw-r--r-- | org.aspectj.ajdt.core/src/test/java/AroundAMain.java | 33 |
2 files changed, 25 insertions, 26 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java index 47c56f939..a520124da 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java @@ -45,7 +45,7 @@ import org.aspectj.weaver.World; public class EclipseAnnotationConvertor { /** * Convert one eclipse annotation into an AnnotationX object containing an AnnotationAJ object. - * + * * This code and the helper methods used by it will go *BANG* if they encounter anything not currently supported - this is safer * than limping along with a malformed annotation. When the *BANG* is encountered the bug reporter should indicate the kind of * annotation they were working with and this code can be enhanced to support it. @@ -80,7 +80,7 @@ public class EclipseAnnotationConvertor { // is this just a marker annotation? throw new MissingImplementationException( "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation [" + annotation - + "]"); + + "]"); } else { AnnotationValue av = generateElementValue(memberValuePair.value, methodBinding.returnType); AnnotationNameValuePair anvp = new AnnotationNameValuePair(new String(memberValuePair.name), av); @@ -118,7 +118,7 @@ public class EclipseAnnotationConvertor { if (defaultValueBinding == null) { throw new MissingImplementationException( "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value [" + defaultValue - + "]"); + + "]"); } else { if (memberValuePairReturnType.isArrayType() && !defaultValueBinding.isArrayType()) { if (constant != null && constant != Constant.NotAConstant) { @@ -159,7 +159,7 @@ public class EclipseAnnotationConvertor { return new SimpleAnnotationValue(ElementValue.PRIMITIVE_INT, new Integer(iConstant.intValue())); } else if (c instanceof BooleanConstant) { BooleanConstant iConstant = (BooleanConstant) c; - return new SimpleAnnotationValue(ElementValue.PRIMITIVE_BOOLEAN, new Boolean(iConstant.booleanValue())); + return new SimpleAnnotationValue(ElementValue.PRIMITIVE_BOOLEAN, iConstant.booleanValue()); } else if (c instanceof StringConstant) { StringConstant sConstant = (StringConstant) c; return new SimpleAnnotationValue(ElementValue.STRING, sConstant.stringValue()); @@ -191,11 +191,11 @@ public class EclipseAnnotationConvertor { } throw new MissingImplementationException( "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value [" + defaultValue - + "]"); + + "]"); } else if (defaultValueBinding.isAnnotationType()) { throw new MissingImplementationException( "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value [" + defaultValue - + "]"); + + "]"); // contents[contentsOffset++] = (byte) '@'; // generateAnnotation((Annotation) defaultValue, // attributeOffset); @@ -223,16 +223,16 @@ public class EclipseAnnotationConvertor { if (defaultValue instanceof ClassLiteralAccess) { ClassLiteralAccess cla = (ClassLiteralAccess)defaultValue; ClassAnnotationValue cav = new ClassAnnotationValue(new String(cla.targetType.signature())); - return cav; + return cav; } throw new MissingImplementationException( "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value [" + defaultValue - + "]"); + + "]"); } } else { throw new MissingImplementationException( "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value [" + defaultValue - + "]"); + + "]"); // contentsOffset = attributeOffset; } } diff --git a/org.aspectj.ajdt.core/src/test/java/AroundAMain.java b/org.aspectj.ajdt.core/src/test/java/AroundAMain.java index 94f2be84f..d9a2929d0 100644 --- a/org.aspectj.ajdt.core/src/test/java/AroundAMain.java +++ b/org.aspectj.ajdt.core/src/test/java/AroundAMain.java @@ -1,45 +1,44 @@ /* ******************************************************************* * 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 + * 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 * ******************************************************************/ -import junit.framework.TestCase; - import org.aspectj.runtime.internal.AroundClosure; import org.aspectj.util.Reflection; public class AroundAMain {//extends TestCase { public AroundAMain(String name) { -// super(name); + // super(name); } public static void main(String[] args) throws ClassNotFoundException { AroundClosure closure = new AroundClosure() { + @Override public Object run(Object[] args) throws Throwable { -// System.out.println("run with: " + Arrays.asList(args)); + // System.out.println("run with: " + Arrays.asList(args)); return new Integer(10); } }; - + Object instance = Reflection.getStaticField(Class.forName("AroundA"), - "ajc$perSingletonInstance"); + "ajc$perSingletonInstance"); Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$1$73ebb943", // was $AroundA$46 - new Integer(10), new Boolean(true), closure); + new Integer(10), true, closure); Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$2$a758212d", // Was $AroundA$c5 - "hello there", closure); + "hello there", closure); Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$3$a758212d", // Was $AroundA$150 - new String[1], closure); + new String[1], closure); } } |