From 7eab0b78df5c048339609816d1e5013c9d172ad3 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 7 Jul 2010 16:47:02 +0000 Subject: [PATCH] generics --- bridge/src/org/aspectj/bridge/IMessage.java | 81 ++++++++++----------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/bridge/src/org/aspectj/bridge/IMessage.java b/bridge/src/org/aspectj/bridge/IMessage.java index e0daa21a2..4f4728295 100644 --- a/bridge/src/org/aspectj/bridge/IMessage.java +++ b/bridge/src/org/aspectj/bridge/IMessage.java @@ -11,7 +11,6 @@ * Xerox/PARC initial implementation * ******************************************************************/ - package org.aspectj.bridge; import java.util.Arrays; @@ -20,32 +19,31 @@ import java.util.Comparator; import java.util.List; /** - * Wrap message with any associated throwable or source location. - */ + * Wrap message with any associated throwable or source location. + */ public interface IMessage { /** no messages */ public static final IMessage[] RA_IMessage = new IMessage[0]; // int values must sync with KINDS order below - public static final Kind WEAVEINFO = new Kind("weaveinfo",5); + public static final Kind WEAVEINFO = new Kind("weaveinfo", 5); public static final Kind INFO = new Kind("info", 10); public static final Kind DEBUG = new Kind("debug", 20); - public static final Kind TASKTAG = new Kind("task",25); // represents a 'TODO' from eclipse - producted by the compiler and consumed by AJDT + public static final Kind TASKTAG = new Kind("task", 25); // represents a 'TODO' from eclipse - producted by the compiler and + // consumed by AJDT public static final Kind WARNING = new Kind("warning", 30); public static final Kind ERROR = new Kind("error", 40); public static final Kind FAIL = new Kind("fail", 50); public static final Kind ABORT = new Kind("abort", 60); // XXX prefer another Kind to act as selector for "any", // but can't prohibit creating messages with it. - //public static final Kind ANY = new Kind("any-selector", 0); + // public static final Kind ANY = new Kind("any-selector", 0); - /** list of Kind in precedence order. 0 is less than - * IMessage.Kind.COMPARATOR.compareTo(KINDS.get(i), KINDS.get(i + 1)) + /** + * list of Kind in precedence order. 0 is less than IMessage.Kind.COMPARATOR.compareTo(KINDS.get(i), KINDS.get(i + 1)) */ - public static final List KINDS = - Collections.unmodifiableList( - Arrays.asList( - new Kind[] { WEAVEINFO, INFO, DEBUG, TASKTAG, WARNING, ERROR, FAIL, ABORT })); + public static final List KINDS = Collections.unmodifiableList(Arrays.asList(new Kind[] { WEAVEINFO, INFO, DEBUG, TASKTAG, + WARNING, ERROR, FAIL, ABORT })); /** @return non-null String with simple message */ String getMessage(); @@ -62,30 +60,30 @@ public interface IMessage { /** @return true if this is an internal debug message */ boolean isDebug(); - /** @return true if this is information for the user */ + /** @return true if this is information for the user */ boolean isInfo(); - /** @return true if the process is aborting */ + /** @return true if the process is aborting */ boolean isAbort(); // XXX ambiguous /** @return true if this is a task tag message */ boolean isTaskTag(); - - /** @return true if something failed */ + + /** @return true if something failed */ boolean isFailed(); /** Caller can verify if this message came about because of a DEOW */ boolean getDeclared(); - + /** Return the ID of the message where applicable, see IProblem for list of valid IDs */ int getID(); - + /** Return the start position of the problem (inclusive), or -1 if unknown. */ int getSourceStart(); - + /** Return the end position of the problem (inclusive), or -1 if unknown. */ int getSourceEnd(); - + /** @return Throwable associated with this message, or null if none */ Throwable getThrown(); @@ -108,17 +106,15 @@ public interface IMessage { } } }; - - /** - * @param kind the Kind floor - * @return false if kind is null or this - * has less precedence than kind, - * true otherwise. - */ + + /** + * @param kind the Kind floor + * @return false if kind is null or this has less precedence than kind, true otherwise. + */ public boolean isSameOrLessThan(Kind kind) { - return (0 >= COMPARATOR.compare(this, kind)); + return (0 >= COMPARATOR.compare(this, kind)); } - + public int compareTo(Object other) { return COMPARATOR.compare(this, other); } @@ -130,30 +126,27 @@ public interface IMessage { this.name = name; this.precedence = precedence; } + public String toString() { return name; } } /** - * @return Detailed information about the message. For example, for declare - * error/warning messages this returns information about the corresponding - * join point's static part. + * @return Detailed information about the message. For example, for declare error/warning messages this returns information + * about the corresponding join point's static part. */ public String getDetails(); - - - /** - * @return List of ISourceLocation instances that indicate - * additional source locations relevent to this message as specified by the - * message creator. The list should not include the primary source location - * associated with the message which can be obtained from - * getSourceLocation(). + + /** + * @return List of ISourceLocation instances that indicate additional source locations relevent to this message as + * specified by the message creator. The list should not include the primary source location associated with the message + * which can be obtained from getSourceLocation(). *

* An example of using extra locations would be in a warning message that * flags all shadow locations that will go unmatched due to a pointcut definition - * being based on a subtype of a defining type. - * @see AspectJ bug 41952 - */ - public List getExtraSourceLocations(); + * being based on a subtype of a defining type. + * @see AspectJ bug 41952 + */ + public List getExtraSourceLocations(); } -- 2.39.5