/**
* Utility class for building a structure model for a given compile. Typical command-line usage: <BR>
- * > <TT>java org.aspectj.tools.ajde.StructureManager @<config-file>.lst</TT>
+ * > {@code java org.aspectj.tools.ajde.StructureManager @<config-file>.lst}
*/
public class StructureUtilities {
* the list or relationships is uniquely identified by a kind and a relationship name. For example, the advice affecting a
* particular shadow (e.g. method call) can be retrieved by calling <CODE>get</CODE> on the handle for that method. Symmetrically
* the method call shadows that an advice affects can be retrieved.
- * <p>
*
* <p>
* The elements can be stored and looked up as IProgramElement(s), in which cases the element corresponding to the handle is looked
* up in the containment hierarchy.
+ * </p>
*
* <p>
* put/get methods taking IProgramElement as a parameter are for convenience only. They work identically to calling their
* counterparts with IProgramElement.getIdentifierHandle()
+ * </p>
*
* @author Mik Kersten
* @author Andy Clement
* Adapter between the generic class pre processor interface and the AspectJ weaver Load time weaving consistency relies on
* Bcel.setRepository
*
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public class Aj implements ClassPreProcessor {
import org.aspectj.bridge.IMessageHandler;
/**
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public class DefaultMessageHandler implements IMessageHandler {
* A class that hanldes LTW options. Note: AV - I choosed to not reuse AjCompilerOptions and alike since those implies too many
* dependancies on jdt and ajdt modules.
*
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public class Options {
* <li>Collections are unioned</li>
* <li>values takes local value unless default and global set</li>
* <li>this only sets one of outputDir and outputJar as needed</li>
- * <ul>
- * This also configures super if javaOptions change.
+ * </ul>
+ * <p>This also configures super if javaOptions change.</p>
*
* @param global the AjBuildConfig to read globals from
*/
* fine for generating debug print strings.
* <p>
* Example usage:
- * <code>
+ * </p>
* <pre>
+ * <code>
* NaiveASTFlattener p = new NaiveASTFlattener();
* node.accept(p);
* String result = p.getResult();
- * </pre>
* </code>
+ * </pre>
+ * <p>
* Call the <code>reset</code> method to clear the previous result before reusing an
* existing instance.
* </p>
/**
* returns true if the ITD target type used type variables, for example I<T>. When they are specified like this, the ITDs
* 'share' type variables with the generic type. Usually this method is called because we need to know whether to tailor the
- * munger for addition to a particular type. For example: <code>
+ * munger for addition to a particular type. For example: <pre><code>
* interface I<T> {}
*
* aspect X implements I<String> {
* List<T> I<T>.foo { return null; }
* }
- * </code> In this case the munger matches X but it matches with the form <code>
+ * </code></pre> In this case the munger matches X but it matches with the form <code>
* List<String> foo() { return null; }
* </code>
*/
/**
* returns an iterator through all of the fields of this type, in order for checking from JVM spec 2ed 5.4.3.2. This means that
* the order is
- * <p/>
* <ul>
* <li>fields from current class</li>
* <li>recur into direct superinterfaces</li>
* <li>recur into superclass</li>
* </ul>
- * <p/>
+ * <p>
* We keep a hashSet of interfaces that we've visited so we don't spiral out into 2^n land.
+ * </p>
*/
public Iterator<ResolvedMember> getFields() {
final Iterators.Filter<ResolvedType> dupFilter = Iterators.dupFilter();
/**
* returns an iterator through all of the methods of this type, in order for checking from JVM spec 2ed 5.4.3.3. This means that
* the order is
- * <p/>
* <ul>
* <li>methods from current class</li>
* <li>recur into superclass, all the way up, not touching interfaces</li>
* <li>recur into all superinterfaces, in some unspecified order (but those 'closest' to this type are first)</li>
* </ul>
- * <p/>
*
* @param wantGenerics is true if the caller would like all generics information, otherwise those methods are collapsed to their
* erasure
/**
* returns an iterator through all of the pointcuts of this type, in order for checking from JVM spec 2ed 5.4.3.2 (as for
* fields). This means that the order is
- * <p/>
* <ul>
* <li>pointcuts from current class</li>
* <li>recur into direct superinterfaces</li>
* <li>recur into superclass</li>
* </ul>
- * <p/>
+ * <p>
* We keep a hashSet of interfaces that we've visited so we don't spiral out into 2^n land.
+ * </p>
*/
public Iterator<ResolvedMember> getPointcuts() {
final Iterators.Filter<ResolvedType> dupFilter = Iterators.dupFilter();
/**
* Returns a ResolvedType object representing the declaring type of this type, or null if this type does not represent a
* non-package-level-type.
- * <p/>
+ * <p>
* <strong>Warning</strong>: This is guaranteed to work for all member types. For anonymous/local types, the only guarantee is
* given in JLS 13.1, where it guarantees that if you call getDeclaringType() repeatedly, you will eventually get the top-level
* class, but it does not say anything about classes in between.
+ * </p>
*
* @return the declaring type, or null if it is not an nested type.
*/
/**
* Determines if values of another type could possibly be cast to this type. The rules followed are from JLS 2ed 5.5,
* "Casting Conversion".
- * <p/>
* <p>
* This method should be commutative, i.e., for all UnresolvedType a, b and all World w:
- * <p/>
+ * </p>
* <blockquote>
*
* <pre>
import org.aspectj.weaver.World;
/**
- * Represents an attempt to bind the field of an annotation within a pointcut. For example:<br>
- * <code><pre>
+ * Represents an attempt to bind the field of an annotation within a pointcut. For example:
+ * <pre><code>
* before(Level lev): execution(* *(..)) && @annotation(TraceAnnotation(lev))
- * </pre></code><br>
- * This binding annotation type pattern will be for 'lev'.
+ * </code></pre>
+ * <p>This binding annotation type pattern will be for 'lev'.</p>
*/
public class BindingAnnotationFieldTypePattern extends ExactAnnotationTypePattern implements BindingPattern {
import org.aspectj.weaver.World;
/**
- * Represents an attempt to bind the field of an annotation within a pointcut. For example:<br>
- * <code><pre>
+ * Represents an attempt to bind the field of an annotation within a pointcut. For example:
+ * <pre><code>
* before(Level lev): execution(* *(..)) && @annotation(TraceAnnotation(lev))
- * </pre></code><br>
- * This binding annotation type pattern will be for 'lev'.
+ * </code></pre>
+ * <p>This binding annotation type pattern will be for 'lev'.</p>
*/
public class ExactAnnotationFieldTypePattern extends ExactAnnotationTypePattern {
* A marker class for bindings for which we want to ignore unbound issue and consider them as implicit binding - f.e. to handle
* JoinPoint in @AJ advices
*
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public static class ImplicitFormalBinding extends FormalBinding {
public ImplicitFormalBinding(UnresolvedType type, String name, int index) {
import org.aspectj.weaver.ResolvedType;
/**
- * pr354470. This is a special subtype of HasMemberTypePattern. In order to optimize this situation: <br>
- * <code><pre>
+ * pr354470. This is a special subtype of HasMemberTypePattern. In order to optimize this situation:
+ * <pre><code>
* aspect X perthis(transactional()) {<br>
* pointcut transactional: execution(@Foo * *(..));<br>
- * </pre></code>
+ * </code></pre>
* <p>
* When this occurs we obviously only want an aspect instance when there is a method annotated with @Foo. For a regular execution
* pointcut we couldn't really do this due to the multiple joinpoint signatures for each joinpoint (and so lots of types get the
* subclass is created to say 'if the supertype thinks it is a match, great, but if it doesnt then if there are ITDs on the target,
* they might match so just say 'true''. Note that returning true is just confirming whether the 'mightHaveAspect' interface (and
* friends) are getting added.
+ * </p>
*
* @author Andy Clement
*/
/**
* A Pointcut or TypePattern visitor
*
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public interface PatternNodeVisitor {
* Foo+ (this one is a special case..) - pertarget(execution(* Foo.do()) → Foo - perthis(call(* Foo.do()) → * - perthis(!call(*
* Foo.do()) → * (see how the ! has been absorbed here..)
*
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public class PerThisOrTargetPointcutVisitor extends AbstractPatternNodeVisitor {
* requires all the files every time. To work around this,
* set the global property CLEAN ("build.compiler.clean") to delete
* all .class files in the destination directory before compiling.
+ * </p>
*
- * <p><u>Warnings</u>:
+ * <p><u>Warnings</u>:</p>
* <ol>
* <li>cleaning will not work if no destination directory
* is specified in the javac task.
* <li>If no files are out of date, then the adapter is <b>never</b> called
* and thus cannot gain control to clean out the destination dir.
* </li>
- * <p>
+ * </ol>
*
* @author Wes Isberg
* @since AspectJ 1.1, Ant 1.5.1
}
/**
- * -Xlint - set default level of -Xlint messages to warning (same as </code>-Xlint:warning</code>)
+ * -Xlint - set default level of -Xlint messages to warning (same as <code>-Xlint:warning</code>)
*/
public void setXlintwarnings(boolean xlintwarnings) {
cmd.addFlag("-Xlint", xlintwarnings);
/**
* Checks the command line for arguments allowed only in AJC and
- * disallowed by AJC and then calls the <code>compile()<code> method.
+ * disallowed by AJC and then calls the <code>compile()</code> method.
*
* @return true if a good compile, false otherwise.
* @throws org.apache.tools.ant.BuildException
/**
* Annotation defined aspect reader. Reads the Java 5 annotations and turns them into AjAttributes
*
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public class AtAjAttributes {
* 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>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public static class LazyResolvedPointcutDefinition extends ResolvedPointcutDefinition {
private final Pointcut m_pointcutUnresolved; // null for abstract
/**
* Looks for all access to method or field that are not public within the body of the around advices and replace the invocations to
* a wrapper call so that the around advice can further be inlined.
- * <p/>
+ * <p>
* This munger is used for @AJ aspects for which inlining wrapper is not done at compile time.
- * <p/>
+ * </p>
+ * <p>
* Specific state and logic is kept in the munger ala ITD so that call/get/set pointcuts can still be matched on the wrapped member
* thanks to the EffectiveSignature attribute.
+ * </p>
*
* @author Alexandre Vasseur
* @author Andy Clement
/**
* In an OSGi environment, determin which bundle a URL originated from.
- * In a non-OSGi environment, implementors should return <code>null<code>.
+ * In a non-OSGi environment, implementors should return <code>null</code>.
* @param url
* @return
* @deprecated use getFile() or getClassLoaderName()
/**
* A POJO that contains raw strings from the XML (sort of XMLBean for our simple LTW DTD)
*
- * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ * @author Alexandre Vasseur (alex AT gnilux DOT com)
*/
public class Definition {
* to signal to a background thread various actions required to "synchronize"
* the in-memory cache with the persisted copy. Whenever there is a cache miss
* from the {@link #get(CachedClassReference)} call, the weaver issues a
- * {@link #put(CachedClassEntry)} call. This call has 2 side-effects:</BR>
+ * {@link #put(CachedClassEntry)} call. This call has 2 side-effects:
* <UL>
* <LI>
* The in-memory cache is updated so that subsequent calls to {@link #get(CachedClassReference)}
/**
* Interface for the backing to the cache; usually a file,
* but could be an in-memory backing for testing.
- * <p/>
+ * <p>
* aspectj and jvmti provide no suitable guarantees
* on locking for class redefinitions, so every implementation
* must have a some locking mechanism to prevent invalid reads.
+ * </p>
*/
public interface CacheBacking {
/**
* a reasonable naive implementation, the management and invalidation
* of the cache may be more usefully accomplished at the Application
* or Container level.
- * <p/>
+ * <p>
* The key is not a one-way hash; it must be convertible back to a
* className and must match the regex for the type of key it is
* (generated or weaved).
+ * </p>
*/
public interface CacheKeyResolver {
/**
* cache entry is a simple string, but that string may contain
* some specialized encoding. This class handles all of that
* encoding.
- * <p/>
+ * <p>
* External users of the cache should not be able to create these
* objects manually.
+ * </p>
*/
public class CachedClassReference {
enum EntryType {
/**
* Naive default class and classloader hashing implementation useful
* for some multi-classloader environments.
- * <p/>
- * This implementation creates classloader scopes of the form:<br/>
+ * <p>
+ * This implementation creates classloader scopes of the form:<br>
* "ExampleClassLoaderName.[crc hash]"
- * <p/>
- * And weaved class keys of the form:<br/>
+ * </p>
+ * <p>
+ * And weaved class keys of the form:<br>
* "com.foo.BarClassName.[bytes len][crc].weaved"
- * <p/>
- * And generated class keys of the form:<br/>
+ * </p>
+ * <p>
+ * And generated class keys of the form:<br>
* "com.foo.BarClassName$AjClosure.generated
+ * </p>
*/
public class DefaultCacheKeyResolver implements CacheKeyResolver {
public static final String GENERATED_SUFFIX = ".generated";
/**
* Naive File-Backed Class Cache with no expiry or application
* centric invalidation.
- * <p/>
+ * <p>
* Enabled with the system property, "aj.weaving.cache.dir"
* If this system property is not set, no caching will be
* performed.
- * <p/>
+ * </p>
+ * <p>
* A CRC checksum is stored alongside the class file to verify
* the bytes on read. If for some reason there is an error
* reading either the class or crc file, or if the crc does not
* match the class data the cache entry is deleted.
- * <p/>
+ * </p>
+ * <p>
* An alternate implementation of this could store the class file
* as a jar/zip directly, which would have the required crc; as
* a first pass however it is somewhat useful to view these files
* in expanded form for debugging.
+ * </p>
*/
public class DefaultFileCacheBacking extends AbstractIndexedFileCacheBacking {
private final Map<String, IndexEntry> index;
* except designed to operate across multiple restarts of the JVM and with one
* cache per classloader; allowing URLClassLoaders with the same set of URI
* paths to share the same cache (with the default configuration).
- * <p/>
+ * <p>
* To enable the default configuration two system properties must be set:
+ * </p>
* <pre>
* "-Daj.weaving.cache.enabled=true"
* "-Daj.weaving.cache.dir=/some/directory"
* </pre>
- * <p/>
+ * <p>
* The class cache is often something that application developers or
* containers would like to manage, so there are a few interfaces for overriding the
* default behavior and performing other management functions.
+ * </p>
* <p/>
- * {@link CacheBacking} <br/>
+ * {@link CacheBacking} <br>
* Provides an interface for implementing a custom backing store
* for the cache; The default implementation in {@link DefaultFileCacheBacking}
* provides a naive file-backed cache. An alternate implementation may ignore
* caching until signaled explicitly by the application, or only cache files
* for a specific duration. This class delegates the locking and synchronization
* requirements to the CacheBacking implementation.
- * <p/>
- * {@link CacheKeyResolver} <br/>
+ * </p>
+ * <p>
+ * {@link CacheKeyResolver} <br>
* Provides methods for creating keys from classes to be cached and for
* creating the "scope" of the cache itself for a given classloader and aspect
* list. The default implementation is provided by {@link DefaultCacheKeyResolver}
* but an alternate implementation may want to associate a cache with a particular
* application running underneath a container.
- * <p/>
+ * </p>
+ * <p>
* This naive cache does not normally invalidate *any* classes; the interfaces above
* must be used to implement more intelligent behavior. Cache invalidation
* problems may occur in at least three scenarios:
- * <pre>
- * 1. New aspects are added dynamically somewhere in the classloader hierarchy; affecting
- * other classes elsewhere.
- * 2. Use of declare parent in aspects to change the type hierarchy; if the cache
+ * </p>
+ * <ol>
+ * <li>New aspects are added dynamically somewhere in the classloader hierarchy; affecting
+ * other classes elsewhere.</li>
+ * <li>Use of declare parent in aspects to change the type hierarchy; if the cache
* has not invalidated the right classes in the type hierarchy aspectj may not
- * be reconstruct the class incorrectly.
- * 3. Similarly to (2), the addition of fields or methods on classes which have
- * already been weaved and cached could have inter-type conflicts.
- * </pre>
+ * be reconstruct the class incorrectly.</li>
+ * <li>Similarly to (2), the addition of fields or methods on classes which have
+ * already been weaved and cached could have inter-type conflicts.</li>
+ * </ol>
*/
public class WeavedClassCache {
public static final String WEAVED_CLASS_CACHE_ENABLED = "aj.weaving.cache.enabled";