diff options
Diffstat (limited to 'runtime')
11 files changed, 286 insertions, 286 deletions
diff --git a/runtime/src/main/java/org/aspectj/lang/JoinPoint.java b/runtime/src/main/java/org/aspectj/lang/JoinPoint.java index 78ffce265..03c834e7a 100644 --- a/runtime/src/main/java/org/aspectj/lang/JoinPoint.java +++ b/runtime/src/main/java/org/aspectj/lang/JoinPoint.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * 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 + * 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 * ******************************************************************/ @@ -56,7 +56,7 @@ public interface JoinPoint { * * <p> Returns null when there is no currently executing object available. * This includes all join points that occur in a static context.</p> - * + * * @return the currently executing object (or null if not available - e.g. static context) */ Object getThis(); @@ -69,7 +69,7 @@ public interface JoinPoint { * get at this object for better static typing and performance. * * Returns null when there is no target object - * + * * @return the target object (or null if there isn't one) */ Object getTarget(); @@ -85,21 +85,21 @@ public interface JoinPoint { */ Signature getSignature(); - /** + /** * * <p>If there is no source location available, returns null.</p> * * <p>Returns the SourceLocation of the defining class for default constructors.</p> * * <p> <code>getStaticPart().getSourceLocation()</code> returns the same object. </p> - * + * * @return the source location corresponding to the join point. */ SourceLocation getSourceLocation(); /** This string is guaranteed to be interned. * <code>getStaticPart().getKind()</code> returns the same object. - * + * * @return a string representing the kind of join point. */ String getKind(); @@ -129,7 +129,7 @@ public interface JoinPoint { * * @see JoinPoint#getStaticPart() */ - public interface StaticPart { + interface StaticPart { /** @return the signature at the join point. */ Signature getSignature(); @@ -145,14 +145,14 @@ public interface JoinPoint { * is guaranteed to be interned */ String getKind(); - + /** * Return the id for this JoinPoint.StaticPart. All JoinPoint.StaticPart - * instances are assigned an id number upon creation. For each advised type + * instances are assigned an id number upon creation. For each advised type * the id numbers start at 0. * <br> - * The id is guaranteed to remain constant across repeated executions - * of a program but may change if the code is recompiled. + * The id is guaranteed to remain constant across repeated executions + * of a program but may change if the code is recompiled. * <br> * The benefit of having an id is that it can be used for array index * purposes which can be quicker than using the JoinPoint.StaticPart @@ -162,7 +162,7 @@ public interface JoinPoint { * the same id, then if the id is being used to index some joinpoint specific * state then that state must be maintained on a pertype basis - either by * using pertypewithin() or an ITD. - * + * * @return the id of this joinpoint */ int getId(); @@ -180,7 +180,7 @@ public interface JoinPoint { String toLongString(); } - public interface EnclosingStaticPart extends StaticPart {} + interface EnclosingStaticPart extends StaticPart {} /** * @return an object that encapsulates the static parts of this join point. @@ -191,19 +191,19 @@ public interface JoinPoint { /** * The legal return values from getKind() */ - static String METHOD_EXECUTION = "method-execution"; - static String METHOD_CALL = "method-call"; - static String CONSTRUCTOR_EXECUTION = "constructor-execution"; - static String CONSTRUCTOR_CALL = "constructor-call"; - static String FIELD_GET = "field-get"; - static String FIELD_SET = "field-set"; - static String STATICINITIALIZATION = "staticinitialization"; - static String PREINITIALIZATION = "preinitialization"; - static String INITIALIZATION = "initialization"; - static String EXCEPTION_HANDLER = "exception-handler"; - static String SYNCHRONIZATION_LOCK = "lock"; - static String SYNCHRONIZATION_UNLOCK = "unlock"; - - static String ADVICE_EXECUTION = "adviceexecution"; + String METHOD_EXECUTION = "method-execution"; + String METHOD_CALL = "method-call"; + String CONSTRUCTOR_EXECUTION = "constructor-execution"; + String CONSTRUCTOR_CALL = "constructor-call"; + String FIELD_GET = "field-get"; + String FIELD_SET = "field-set"; + String STATICINITIALIZATION = "staticinitialization"; + String PREINITIALIZATION = "preinitialization"; + String INITIALIZATION = "initialization"; + String EXCEPTION_HANDLER = "exception-handler"; + String SYNCHRONIZATION_LOCK = "lock"; + String SYNCHRONIZATION_UNLOCK = "unlock"; + + String ADVICE_EXECUTION = "adviceexecution"; } diff --git a/runtime/src/main/java/org/aspectj/lang/ProceedingJoinPoint.java b/runtime/src/main/java/org/aspectj/lang/ProceedingJoinPoint.java index ac85681ef..8d4d2fe57 100644 --- a/runtime/src/main/java/org/aspectj/lang/ProceedingJoinPoint.java +++ b/runtime/src/main/java/org/aspectj/lang/ProceedingJoinPoint.java @@ -48,31 +48,31 @@ public interface ProceedingJoinPoint extends JoinPoint { * @return the result of proceeding * @throws Throwable if the invoked proceed throws anything */ - public Object proceed() throws Throwable; + Object proceed() throws Throwable; /** * Proceed with the next advice or target method invocation. * - * Unlike code style, proceed(..) in annotation style places different requirements on the + * Unlike code style, proceed(..) in annotation style places different requirements on the * parameters passed to it. The proceed(..) call takes, in this order: * <ul> * <li> If 'this()' was used in the pointcut for binding, it must be passed first in proceed(..). - * <li> If 'target()' was used in the pointcut for binding, it must be passed next in proceed(..) - + * <li> If 'target()' was used in the pointcut for binding, it must be passed next in proceed(..) - * it will be the first argument to proceed(..) if this() was not used for binding. - * <li> Finally come all the arguments expected at the join point, in the order they are supplied - * at the join point. Effectively the advice signature is ignored - it doesn't matter - * if a subset of arguments were bound or the ordering was changed in the advice signature, - * the proceed(..) calls takes all of them in the right order for the join point. + * <li> Finally come all the arguments expected at the join point, in the order they are supplied + * at the join point. Effectively the advice signature is ignored - it doesn't matter + * if a subset of arguments were bound or the ordering was changed in the advice signature, + * the proceed(..) calls takes all of them in the right order for the join point. * </ul> - * Since proceed(..) in this case takes an Object array, AspectJ cannot do as much - * compile time checking as it can for code style. If the rules above aren't obeyed - * then it will unfortunately manifest as a runtime error. + * Since proceed(..) in this case takes an Object array, AspectJ cannot do as much + * compile time checking as it can for code style. If the rules above aren't obeyed + * then it will unfortunately manifest as a runtime error. * * @param args the arguments to proceed with * @return the result of proceeding * @throws Throwable if the invoked proceed throws anything */ - public Object proceed(Object[] args) throws Throwable; + Object proceed(Object[] args) throws Throwable; } diff --git a/runtime/src/main/java/org/aspectj/lang/annotation/Aspect.java b/runtime/src/main/java/org/aspectj/lang/annotation/Aspect.java index 7e50fa75b..7db0814ad 100644 --- a/runtime/src/main/java/org/aspectj/lang/annotation/Aspect.java +++ b/runtime/src/main/java/org/aspectj/lang/annotation/Aspect.java @@ -29,5 +29,5 @@ public @interface Aspect { * @return the per clause expression, defaults to singleton aspect. * Valid values are "" (singleton), "perthis(...)", etc */ - public String value() default ""; + String value() default ""; } diff --git a/runtime/src/main/java/org/aspectj/lang/annotation/DeclareAnnotation.java b/runtime/src/main/java/org/aspectj/lang/annotation/DeclareAnnotation.java index f0c564dd3..d6b730be6 100644 --- a/runtime/src/main/java/org/aspectj/lang/annotation/DeclareAnnotation.java +++ b/runtime/src/main/java/org/aspectj/lang/annotation/DeclareAnnotation.java @@ -1,11 +1,11 @@ /******************************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * * Contributors: * Alexandre Vasseur initial implementation *******************************************************************************/ @@ -26,6 +26,6 @@ public @interface DeclareAnnotation { /** * @return the pointcut (type pattern for type, or method/ctor/field signature pattern) */ - public String value(); - + String value(); + } diff --git a/runtime/src/main/java/org/aspectj/lang/reflect/AjType.java b/runtime/src/main/java/org/aspectj/lang/reflect/AjType.java index 2ceddb952..a4b3aab4c 100644 --- a/runtime/src/main/java/org/aspectj/lang/reflect/AjType.java +++ b/runtime/src/main/java/org/aspectj/lang/reflect/AjType.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.lang.reflect; @@ -23,134 +23,134 @@ import java.lang.reflect.TypeVariable; * program. */ public interface AjType<T> extends Type, AnnotatedElement { - + /** * @return the name of this type, in the same format as returned by Class.getName() */ - public String getName(); - + String getName(); + /** * @return the package in which this type is declared */ - public Package getPackage(); - + Package getPackage(); + /** * @return the interfaces implemented by this type */ - public AjType<?>[] getInterfaces(); - + AjType<?>[] getInterfaces(); + /** * @return the modifiers declared for this type. The return value can be interpreted * using java.lang.reflect.Modifier */ - public int getModifiers(); - + int getModifiers(); + /** * @return the java.lang.Class that corresponds to this AjType */ - public Class<T> getJavaClass(); + Class<T> getJavaClass(); // scope - + /** * @return the supertype of this type. If this type represents Object or a primitive type * then null is returned. */ - public AjType<?> getSupertype(); + AjType<?> getSupertype(); /** * @return the generic supertype of this type, as defined by Class.getGenericSupertype */ - public Type getGenericSupertype(); + Type getGenericSupertype(); /** * @return the enclosing Method if this type represents a local or anonymous type declared within a method */ - public Method getEnclosingMethod(); - + Method getEnclosingMethod(); + /** * @return the enclosing Method if this type represents a local or anonymous type declared within a constructor */ - public Constructor getEnclosingConstructor(); + Constructor getEnclosingConstructor(); /** * @return the immediately enclosing type of this type. */ - public AjType<?> getEnclosingType(); - + AjType<?> getEnclosingType(); + /** * @return the AjType representing the typei n which it was declared (if this type is a member of another type) */ - public AjType<?> getDeclaringType(); + AjType<?> getDeclaringType(); /** * @return the per-clause if this is an aspect, otherwise null */ - public PerClause getPerClause(); - + PerClause getPerClause(); + // inner types /** * @return an array containing all the public types that are members of this type */ - public AjType<?>[] getAjTypes(); - + AjType<?>[] getAjTypes(); + /** * @return an array containing all the types declared by this type */ - public AjType<?>[] getDeclaredAjTypes(); - + AjType<?>[] getDeclaredAjTypes(); + // constructors - + /** * @param parameterTypes the types of the constructor parameters * @return the constructor object for the specified public constructor of this type * @throws NoSuchMethodException if constructor not found */ - public Constructor getConstructor(AjType<?>... parameterTypes) throws NoSuchMethodException; - + Constructor getConstructor(AjType<?>... parameterTypes) throws NoSuchMethodException; + /** * @return all of the public constructors of this type */ - public Constructor[] getConstructors(); - + Constructor[] getConstructors(); + /** * @param parameterTypes the types of the constructor parameters * @return the constructor object for the specified constructor of this type * @throws NoSuchMethodException if constructor not found */ - public Constructor getDeclaredConstructor(AjType<?>... parameterTypes) throws NoSuchMethodException; + Constructor getDeclaredConstructor(AjType<?>... parameterTypes) throws NoSuchMethodException; /** * @return all the constructors declared in this type */ - public Constructor[] getDeclaredConstructors(); - + Constructor[] getDeclaredConstructors(); + // fields - + /** * @param name the field name * @return the declared field * @throws NoSuchFieldException if no field of that name is found */ - public Field getDeclaredField(String name) throws NoSuchFieldException; - - /** + Field getDeclaredField(String name) throws NoSuchFieldException; + + /** * @return all the fields declared in this type */ - public Field[] getDeclaredFields(); - + Field[] getDeclaredFields(); + /** * @param name the field name - * @return the public field with the given name + * @return the public field with the given name * @throws NoSuchFieldException if field not found */ - public Field getField(String name) throws NoSuchFieldException; - + Field getField(String name) throws NoSuchFieldException; + /** * @return the public fields declared by this type */ - public Field[] getFields(); - + Field[] getFields(); + // methods /** @@ -159,52 +159,52 @@ public interface AjType<T> extends Type, AnnotatedElement { * @return the method object for the specified method declared in this type * @throws NoSuchMethodException if the method cannot be found */ - public Method getDeclaredMethod(String name, AjType<?>... parameterTypes) throws NoSuchMethodException; - + Method getDeclaredMethod(String name, AjType<?>... parameterTypes) throws NoSuchMethodException; + /** * @param name the method name * @param parameterTypes the types of the method parameters - * @return the method object for the specified public method declared in this type + * @return the method object for the specified public method declared in this type * @throws NoSuchMethodException if the method cannot be found */ - public Method getMethod(String name, AjType<?>... parameterTypes) throws NoSuchMethodException; - + Method getMethod(String name, AjType<?>... parameterTypes) throws NoSuchMethodException; + /** * @return all the methods declared by this type */ - public Method[] getDeclaredMethods(); - + Method[] getDeclaredMethods(); + /** * @return all the public methods of this type */ - public Method[] getMethods(); - + Method[] getMethods(); + // pointcuts - + /** * @param name the pointcut name * @return the pointcut object representing the specified pointcut declared by this type * @throws NoSuchPointcutException if no pointcut of that name can be found */ - public Pointcut getDeclaredPointcut(String name) throws NoSuchPointcutException; - + Pointcut getDeclaredPointcut(String name) throws NoSuchPointcutException; + /** * @param name the pointcut name * @return the pointcut object representing the specified public pointcut * @throws NoSuchPointcutException if no pointcut of that name can be found */ - public Pointcut getPointcut(String name) throws NoSuchPointcutException; + Pointcut getPointcut(String name) throws NoSuchPointcutException; /** * @return all of the pointcuts declared by this type */ - public Pointcut[] getDeclaredPointcuts(); + Pointcut[] getDeclaredPointcuts(); /** * @return all of the public pointcuts of this type */ - public Pointcut[] getPointcuts(); - + Pointcut[] getPointcuts(); + // advice /** @@ -212,38 +212,38 @@ public interface AjType<T> extends Type, AnnotatedElement { * @return all of the advice declared by this type, of an advice kind contained in the * parameter list. */ - public Advice[] getDeclaredAdvice(AdviceKind... ofTypes); - + Advice[] getDeclaredAdvice(AdviceKind... ofTypes); + /** * @param ofTypes the {@link AdviceKind}s of interest * @return all of the advice for this type, of an advice kind contained in the parameter - * list. + * list. */ - public Advice[] getAdvice(AdviceKind... ofTypes); - + Advice[] getAdvice(AdviceKind... ofTypes); + /** * For an annotation style advice member, * this is the name of the annotated method. For a code-style advice declaration, this * is the name given in the @AdviceName annotation if present. - * + * * @param name the advice name * @return the advice with the given name. * @throws NoSuchAdviceException if no advice can be found with that name */ - public Advice getAdvice(String name) throws NoSuchAdviceException; - + Advice getAdvice(String name) throws NoSuchAdviceException; + /** For an annotation style advice member, * this is the name of the annotated method. For a code-style advice declaration, this * is the name given in the @AdviceName annotation if present. - * + * * @param name the advice name * @return the advice declared in this type with the given name. * @throws NoSuchAdviceException if no advice can be found with that name */ - public Advice getDeclaredAdvice(String name) throws NoSuchAdviceException; - + Advice getDeclaredAdvice(String name) throws NoSuchAdviceException; + // inter-type declarations - + /** * @param name the method name * @param target the target of the inter-type declaration @@ -251,12 +251,12 @@ public interface AjType<T> extends Type, AnnotatedElement { * @return the inter-type method declared by this type matching the given specification * @throws NoSuchMethodException if the inter-type declaration cannot be found */ - public InterTypeMethodDeclaration getDeclaredITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException; - + InterTypeMethodDeclaration getDeclaredITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException; + /** * @return all of the inter-type methods declared by this type */ - public InterTypeMethodDeclaration[] getDeclaredITDMethods(); + InterTypeMethodDeclaration[] getDeclaredITDMethods(); /** * @param name the method name @@ -265,25 +265,25 @@ public interface AjType<T> extends Type, AnnotatedElement { * @return the public inter-type method of this type matching the given specification * @throws NoSuchMethodException if the inter-type declaration cannot be found */ - public InterTypeMethodDeclaration getITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException; - + InterTypeMethodDeclaration getITDMethod(String name, AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException; + /** * @return all of the public inter-type declared methods of this type */ - public InterTypeMethodDeclaration[] getITDMethods(); - + InterTypeMethodDeclaration[] getITDMethods(); + /** * @param target the target of the inter-type constructor of interest * @param parameterTypes the types of the parameter of the inter-type constructor of interest * @return the inter-type constructor declared by this type matching the given specification * @throws NoSuchMethodException if the inter-type declaration cannot be found */ - public InterTypeConstructorDeclaration getDeclaredITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException; - + InterTypeConstructorDeclaration getDeclaredITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException; + /** * @return all of the inter-type constructors declared by this type */ - public InterTypeConstructorDeclaration[] getDeclaredITDConstructors(); + InterTypeConstructorDeclaration[] getDeclaredITDConstructors(); /** * @param target the target of the inter-type constructor of interest @@ -291,12 +291,12 @@ public interface AjType<T> extends Type, AnnotatedElement { * @return the public inter-type constructor matching the given specification * @throws NoSuchMethodException if the inter-type declaration cannot be found */ - public InterTypeConstructorDeclaration getITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException; + InterTypeConstructorDeclaration getITDConstructor(AjType<?> target, AjType<?>... parameterTypes) throws NoSuchMethodException; /** * @return all of the public inter-type constructors of this type */ - public InterTypeConstructorDeclaration[] getITDConstructors(); + InterTypeConstructorDeclaration[] getITDConstructors(); /** * @param name the field name @@ -304,12 +304,12 @@ public interface AjType<T> extends Type, AnnotatedElement { * @return the inter-type field declared in this type with the given specification * @throws NoSuchFieldException if the inter-type declaration cannot be found */ - public InterTypeFieldDeclaration getDeclaredITDField(String name, AjType<?> target) throws NoSuchFieldException; + InterTypeFieldDeclaration getDeclaredITDField(String name, AjType<?> target) throws NoSuchFieldException; /** * @return all of the inter-type fields declared in this type */ - public InterTypeFieldDeclaration[] getDeclaredITDFields(); + InterTypeFieldDeclaration[] getDeclaredITDFields(); /** * @param name the field name @@ -317,108 +317,108 @@ public interface AjType<T> extends Type, AnnotatedElement { * @return the public inter-type field matching the given specification * @throws NoSuchFieldException if the inter-type declaration cannot be found */ - public InterTypeFieldDeclaration getITDField(String name, AjType<?> target) throws NoSuchFieldException; + InterTypeFieldDeclaration getITDField(String name, AjType<?> target) throws NoSuchFieldException; /** * @return all of the public inter-type fields for this type */ - public InterTypeFieldDeclaration[] getITDFields(); - + InterTypeFieldDeclaration[] getITDFields(); + // declare statements /** * @return all of the declare error and declare warning members of this type, * including declare error/warning members inherited from super-types */ - public DeclareErrorOrWarning[] getDeclareErrorOrWarnings(); - + DeclareErrorOrWarning[] getDeclareErrorOrWarnings(); + /** * @return all of the declare parents members of this type, including * declare parent members inherited from super-types */ - public DeclareParents[] getDeclareParents(); - + DeclareParents[] getDeclareParents(); + /** * @return all of the declare soft members of this type, including declare * soft members inherited from super-types */ - public DeclareSoft[] getDeclareSofts(); + DeclareSoft[] getDeclareSofts(); /** * @return all of the declare annotation members of this type, including declare * annotation members inherited from super-types */ - public DeclareAnnotation[] getDeclareAnnotations(); - + DeclareAnnotation[] getDeclareAnnotations(); + /** * @return all of the declare precedence members of this type, including declare * precedence members inherited from super-types */ - public DeclarePrecedence[] getDeclarePrecedence(); - + DeclarePrecedence[] getDeclarePrecedence(); + // misc - + /** * @return the elements of this enum class, or null if this type does not represent * an enum type. */ - public T[] getEnumConstants(); - + T[] getEnumConstants(); + /** * @return an array of TypeVariable objects that represent the type variables declared by * this type (if any) */ - public TypeVariable<Class<T>>[] getTypeParameters(); + TypeVariable<Class<T>>[] getTypeParameters(); /** * @return true if this is an enum type */ - public boolean isEnum(); + boolean isEnum(); /** * @param o the object to check for assignment compatibility * @return true if the given object is assignment-compatible with an object of the type represented * by this AjType */ - public boolean isInstance(Object o); + boolean isInstance(Object o); /** * @return true if this is an interface type */ - public boolean isInterface(); + boolean isInterface(); /** * @return true if and only if the underlying type is a local class */ - public boolean isLocalClass(); - + boolean isLocalClass(); + /** * @return true if and only if the underlying type is a member class */ - public boolean isMemberClass(); - + boolean isMemberClass(); + /** * @return true if this is an array type */ - public boolean isArray(); + boolean isArray(); /** * @return true if this object represents a primitive type */ - public boolean isPrimitive(); + boolean isPrimitive(); /** * @return true if this is an aspect type */ - public boolean isAspect(); - + boolean isAspect(); + /** * @return true if and only if the underlying type is a member aspect */ - public boolean isMemberAspect(); + boolean isMemberAspect(); /** * @return true if and only if the underlying type is a privileged aspect */ - public boolean isPrivileged(); - + boolean isPrivileged(); + } diff --git a/runtime/src/main/java/org/aspectj/lang/reflect/DeclareAnnotation.java b/runtime/src/main/java/org/aspectj/lang/reflect/DeclareAnnotation.java index 1d7ba34a7..17f8637d7 100644 --- a/runtime/src/main/java/org/aspectj/lang/reflect/DeclareAnnotation.java +++ b/runtime/src/main/java/org/aspectj/lang/reflect/DeclareAnnotation.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.lang.reflect; @@ -18,39 +18,39 @@ import java.lang.annotation.Annotation; * */ public interface DeclareAnnotation { - - public enum Kind { Field, Method, Constructor, Type }; - + + enum Kind { Field, Method, Constructor, Type }; + /** * @return the aspect that declared this member. */ AjType<?> getDeclaringType(); - + /** * @return the target element kind */ Kind getKind(); - + /** - * @return the target signature pattern. Returns null if getKind() == Type + * @return the target signature pattern. Returns null if getKind() == Type */ SignaturePattern getSignaturePattern(); - + /** * @return the target type pattern. Returns null if getKind() != Type */ TypePattern getTypePattern(); - + /** * @return the declared annotation. If the declared annotation does not have runtime retention, * this method returns null. */ Annotation getAnnotation(); - + /** * @return the text of the annotation as declared in this member. Available for * both runtime and class-file retention annotations */ String getAnnotationAsText(); - + } diff --git a/runtime/src/main/java/org/aspectj/lang/reflect/FieldSignature.java b/runtime/src/main/java/org/aspectj/lang/reflect/FieldSignature.java index df1c57656..5e4c4a55f 100644 --- a/runtime/src/main/java/org/aspectj/lang/reflect/FieldSignature.java +++ b/runtime/src/main/java/org/aspectj/lang/reflect/FieldSignature.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * 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 + * 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 * ******************************************************************/ @@ -16,6 +16,6 @@ package org.aspectj.lang.reflect; import java.lang.reflect.Field; public interface FieldSignature extends MemberSignature { - public Class getFieldType(); - public Field getField(); + Class getFieldType(); + Field getField(); } diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounter.java b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounter.java index 1fa064cee..f4a34260e 100644 --- a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounter.java +++ b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadCounter.java @@ -1,22 +1,22 @@ /* ******************************************************************* * Copyright (c) 2004 IBM Corporation - * - * 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 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: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.runtime.internal.cflowstack; public interface ThreadCounter { - public void inc(); - public void dec(); - public boolean isNotZero(); - public void removeThreadCounter(); -}
\ No newline at end of file + void inc(); + void dec(); + boolean isNotZero(); + void removeThreadCounter(); +} diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStack.java b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStack.java index 7290163d2..3ae58d97d 100644 --- a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStack.java +++ b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStack.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2004 IBM Corporation - * - * 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 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: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.runtime.internal.cflowstack; @@ -17,7 +17,7 @@ import java.util.Stack; public interface ThreadStack { - public Stack getThreadStack(); - public void removeThreadStack(); + Stack getThreadStack(); + void removeThreadStack(); } diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactory.java b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactory.java index 38ba0ccbd..a752aef67 100644 --- a/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactory.java +++ b/runtime/src/main/java/org/aspectj/runtime/internal/cflowstack/ThreadStackFactory.java @@ -1,20 +1,20 @@ /* ******************************************************************* * Copyright (c) 2004 IBM Corporation - * - * 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 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: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.runtime.internal.cflowstack; public interface ThreadStackFactory { - - public ThreadStack getNewThreadStack(); - public ThreadCounter getNewThreadCounter(); - + + ThreadStack getNewThreadStack(); + ThreadCounter getNewThreadCounter(); + } diff --git a/runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java b/runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java index 68079b444..0f9232bdd 100644 --- a/runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java +++ b/runtime/src/main/java/org/aspectj/runtime/reflect/SignatureImpl.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * 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 + * 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 * ******************************************************************/ @@ -21,21 +21,21 @@ import java.util.StringTokenizer; abstract class SignatureImpl implements Signature { private static boolean useCache = true; - + int modifiers = -1; String name; String declaringTypeName; Class declaringType; Cache stringCache; - + SignatureImpl(int modifiers, String name, Class declaringType) { this.modifiers = modifiers; this.name = name; this.declaringType = declaringType; } - + protected abstract String createToString (StringMaker sm); - + /* Use a soft cache for the short, middle and long String representations */ String toString (StringMaker sm) { String result = null; @@ -58,7 +58,7 @@ abstract class SignatureImpl implements Signature { } return result; } - + public final String toString() { return toString(StringMaker.middleStringMaker); } public final String toShortString() { return toString(StringMaker.shortStringMaker); } public final String toLongString() { return toString(StringMaker.longStringMaker); } @@ -81,64 +81,64 @@ abstract class SignatureImpl implements Signature { } return declaringTypeName; } - + String fullTypeName(Class type) { if (type == null) return "ANONYMOUS"; if (type.isArray()) return fullTypeName(type.getComponentType()) + "[]"; return type.getName().replace('$', '.'); } - + String stripPackageName(String name) { int dot = name.lastIndexOf('.'); if (dot == -1) return name; return name.substring(dot+1); } - + String shortTypeName(Class type) { if (type == null) return "ANONYMOUS"; if (type.isArray()) return shortTypeName(type.getComponentType()) + "[]"; return stripPackageName(type.getName()).replace('$', '.'); } - + void addFullTypeNames(StringBuffer buf, Class[] types) { for (int i = 0; i < types.length; i++) { if (i > 0) buf.append(", "); buf.append(fullTypeName(types[i])); } - } + } void addShortTypeNames(StringBuffer buf, Class[] types) { for (int i = 0; i < types.length; i++) { if (i > 0) buf.append(", "); buf.append(shortTypeName(types[i])); } } - + void addTypeArray(StringBuffer buf, Class[] types) { addFullTypeNames(buf, types); } - + // lazy version private String stringRep; ClassLoader lookupClassLoader = null; - + public void setLookupClassLoader(ClassLoader loader) { this.lookupClassLoader = loader; } - + private ClassLoader getLookupClassLoader() { if (lookupClassLoader == null) lookupClassLoader = this.getClass().getClassLoader(); return lookupClassLoader; } - + public SignatureImpl(String stringRep) { this.stringRep = stringRep; } - + static final char SEP = '-'; - + String extractString(int n) { - //System.out.println(n + ": from " + stringRep); - + //System.out.println(n + ": from " + stringRep); + int startIndex = 0; int endIndex = stringRep.indexOf(SEP); while (n-- > 0) { @@ -146,29 +146,29 @@ abstract class SignatureImpl implements Signature { endIndex = stringRep.indexOf(SEP, startIndex); } if (endIndex == -1) endIndex = stringRep.length(); - + //System.out.println(" " + stringRep.substring(startIndex, endIndex)); - - return stringRep.substring(startIndex, endIndex); + + return stringRep.substring(startIndex, endIndex); } - + int extractInt(int n) { String s = extractString(n); return Integer.parseInt(s, 16); } - + Class extractType(int n) { String s = extractString(n); return Factory.makeClass(s,getLookupClassLoader()); } - - - + + + static String[] EMPTY_STRING_ARRAY = new String[0]; static Class[] EMPTY_CLASS_ARRAY = new Class[0]; - + static final String INNER_SEP = ":"; - + String[] extractStrings(int n) { String s = extractString(n); StringTokenizer st = new StringTokenizer(s, INNER_SEP); @@ -197,14 +197,14 @@ abstract class SignatureImpl implements Signature { return useCache; } - private static interface Cache { + private interface Cache { String get(int cacheOffset); - void set(int cacheOffset, String result); - + void set(int cacheOffset, String result); + } - + // separate implementation so we don't need SoftReference to hold the field... private static final class CacheImpl implements Cache { private java.lang.ref.SoftReference toStringCacheRef; |