int[] pcLoc = new int[2];
String perClause = getStringLiteralFor("value", aspectAnnotation, pcLoc);
- AspectDeclaration aspectDecl = new AspectDeclaration(typeDecl.compilationResult);
+ // AspectDeclaration aspectDecl = new AspectDeclaration(typeDecl.compilationResult);
try {
if (perClause != null && !perClause.equals("")) {
int[] throwingLocation = new int[2];
String thrownFormal = getStringLiteralFor("throwing", ajAnnotations.adviceAnnotation, throwingLocation);
if (thrownFormal != null) {
- Argument[] arguments = methodDeclaration.arguments;
+ // Argument[] arguments = methodDeclaration.arguments;
if (!toArgumentNames(methodDeclaration.arguments).contains(thrownFormal)) {
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart,
methodDeclaration.sourceEnd,
public AnnotationX convertEclipseAnnotation(Annotation eclipseAnnotation, World w) {
// TODO if it is sourcevisible, we shouldn't let it through!!!!!!!!! testcase!
ResolvedType annotationType = factory.fromTypeBindingToRTX(eclipseAnnotation.type.resolvedType);
- long bs = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK);
+ // long bs = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK);
boolean isRuntimeVisible = (eclipseAnnotation.bits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention;
AnnotationAJ annotationAJ = new AnnotationAJ(annotationType.getSignature(), isRuntimeVisible);
generateAnnotation(eclipseAnnotation, annotationAJ);
* the other methodMustOverride() method is used.
*/
public void methodMustOverride(AbstractMethodDeclaration method) {
- MethodBinding binding = method.binding;
// ignore ajc$ methods
if (new String(method.selector).startsWith("ajc$"))
// }
// }
- private void maybeDeleteResource(String resName, List oldResources) {
- if (resources.contains(resName)) {
- oldResources.remove(resName);
- List outputDirs = getOutputLocations(buildConfig);
- for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) {
- File dir = (File) iterator.next();
- File source = new File(dir, resName);
- if (source.exists() && (source.lastModified() >= lastSuccessfulBuildTime)) {
- resources.remove(resName); // will ensure it is re-copied
- }
- }
- }
- }
+ // private void maybeDeleteResource(String resName, List oldResources) {
+ // if (resources.contains(resName)) {
+ // oldResources.remove(resName);
+ // List outputDirs = getOutputLocations(buildConfig);
+ // for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) {
+ // File dir = (File) iterator.next();
+ // File source = new File(dir, resName);
+ // if (source.exists() && (source.lastModified() >= lastSuccessfulBuildTime)) {
+ // resources.remove(resName); // will ensure it is re-copied
+ // }
+ // }
+ // }
+ // }
// private void deleteResourcesFromDirectory(File dir, List oldResources) {
// File[] files = FileUtil.listFiles(dir, new FileFilter() {
le.factory = eFactory;
forCompiler.lookupEnvironment = le;
- AjBuildNotifier ajNotifier = (AjBuildNotifier) notifier;
+ // AjBuildNotifier ajNotifier = (AjBuildNotifier) notifier;
if (fileNameProvider == null)
fileNameProvider = new OutputFileNameProvider(getProject());
// * the set of binary source entries for this compile -- from analyzing deltas, or everything if batch
// * the full set of binary source entries for the project -- from IAspectJProject
// TODO deal with inpath, injars here...
- IBinarySourceProvider bsProvider = new NullBinarySourceProvider();
- Map fullBinarySourceEntries = new HashMap();
+ // IBinarySourceProvider bsProvider = new NullBinarySourceProvider();
+ // Map fullBinarySourceEntries = new HashMap();
// * the intermediate result set from the last batch compile
if (isBatchBuild) {
unwovenResultCollector = new UnwovenResultCollector();
}
- Collection resultSetForFullWeave = unwovenResultCollector.getIntermediateResults();
+ // Collection resultSetForFullWeave =
+ unwovenResultCollector.getIntermediateResults();
throw new UnsupportedOperationException("Is anyone actually using the AspectJBuilder class??");
// return new AjCompilerAdapter(forCompiler,isBatchBuild,myBcelWorld,
if (!(other instanceof PerTypeWithin)) {
return false;
}
- PerTypeWithin o = (PerTypeWithin) other;
+ // PerTypeWithin o = (PerTypeWithin) other;
return true; // ajh02: stub, should look at the type pattern
}
}
String text = byteArrayOut.toString();
- String text2 = byteArrayErr.toString();
+ // String text2 = byteArrayErr.toString();
assertTrue("version output does not include 'AspectJ Compiler', output was:\n'" + text + "'", text
.indexOf("AspectJ Compiler") != -1);
}
import java.io.File;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
-import org.aspectj.bridge.IMessage;
import org.aspectj.tools.ajc.AjcTestCase;
import org.aspectj.tools.ajc.CompilationResult;
-
public class JavadocTest extends AjcTestCase {
- public static final String PROJECT_DIR = "javadoc";
+ public static final String PROJECT_DIR = "javadoc";
+
+ private File baseDir;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ baseDir = new File("../org.aspectj.ajdt.core/testdata", PROJECT_DIR);
+ }
+
+ /**
+ * Aim: Check javadoc warning that appear are appropriate
+ *
+ * ajc -warn:allJavadoc World.java
+ *
+ */
+ public void testMissingJavadoc() {
+ String[] args = new String[] { "World.java", "-warn:allJavadoc" };
+
+ List warningMessages = new ArrayList();
+ // These warnings are against public textX() methods declared in the World.java
+ // type. These test methods are spread between AJ constructuts, meaning
+ // if someone messes up and the javadoc is not associated with the aspectj
+ // construct then it will associated by accident with one of the testX() methods.
+ // By checking we get a warning against every testX() method, we are verifying
+ // that the javadoc is being attached to the aspectj constructs.
+ warningMessages.add(new Message(10, "Missing comment for public declaration"));
+ warningMessages.add(new Message(18, "Missing comment for public declaration"));
+ warningMessages.add(new Message(28, "Missing comment for public declaration"));
+ warningMessages.add(new Message(36, "Missing comment for public declaration"));
+ warningMessages.add(new Message(44, "Missing comment for public declaration"));
+ warningMessages.add(new Message(53, "Missing comment for public declaration"));
+ warningMessages.add(new Message(61, "Missing comment for public declaration"));
+ warningMessages.add(new Message(69, "Missing comment for public declaration"));
+ MessageSpec spec = new MessageSpec(warningMessages, null);
+
+ CompilationResult result = ajc(baseDir, args);
+ assertMessages(result, spec);
+
+ // dump(result.getWarningMessages());
+ // System.err.println("-----------\n"+ajc.getLastCompilationResult().getStandardError());
+ // List l = result.getWarningMessages();
+ // IMessage m = ((IMessage)l.get(0));
+ }
- private File baseDir;
-
- protected void setUp() throws Exception {
- super.setUp();
- baseDir = new File("../org.aspectj.ajdt.core/testdata",PROJECT_DIR);
- }
-
- /**
- * Aim: Check javadoc warning that appear are appropriate
- *
- * ajc -warn:allJavadoc World.java
- *
- */
- public void testMissingJavadoc () {
- String[] args = new String[] {"World.java","-warn:allJavadoc"};
-
- List warningMessages = new ArrayList();
- // These warnings are against public textX() methods declared in the World.java
- // type. These test methods are spread between AJ constructuts, meaning
- // if someone messes up and the javadoc is not associated with the aspectj
- // construct then it will associated by accident with one of the testX() methods.
- // By checking we get a warning against every testX() method, we are verifying
- // that the javadoc is being attached to the aspectj constructs.
- warningMessages.add(new Message(10,"Missing comment for public declaration"));
- warningMessages.add(new Message(18,"Missing comment for public declaration"));
- warningMessages.add(new Message(28,"Missing comment for public declaration"));
- warningMessages.add(new Message(36,"Missing comment for public declaration"));
- warningMessages.add(new Message(44,"Missing comment for public declaration"));
- warningMessages.add(new Message(53,"Missing comment for public declaration"));
- warningMessages.add(new Message(61,"Missing comment for public declaration"));
- warningMessages.add(new Message(69,"Missing comment for public declaration"));
- MessageSpec spec = new MessageSpec(warningMessages,null);
-
- CompilationResult result = ajc(baseDir,args);
- assertMessages(result,spec);
-
-// dump(result.getWarningMessages());
-// System.err.println("-----------\n"+ajc.getLastCompilationResult().getStandardError());
-// List l = result.getWarningMessages();
-// IMessage m = ((IMessage)l.get(0));
- }
-
- private void dump(List l) {
- for (Iterator iter = l.iterator(); iter.hasNext();) {
- IMessage element = (IMessage) iter.next();
- System.err.println("Warning: "+element);
- }
- }
+ // private void dump(List l) {
+ // for (Iterator iter = l.iterator(); iter.hasNext();) {
+ // IMessage element = (IMessage) iter.next();
+ // System.err.println("Warning: "+element);
+ // }
+ // }
}
public void testPropertyDescriptorsForDefaultTypePattern() {
AjAST ajast = createAjAST();
- DefaultTypePattern d = ajast.newDefaultTypePattern();
+ // DefaultTypePattern d =
+ ajast.newDefaultTypePattern();
List props = DefaultTypePattern.propertyDescriptors(AST.JLS3);
assertEquals("there should be no properties for the DefaultTypePattern", 0, props.size());
}
public void testPropertyDescriptorsForSignaturePattern() {
AjAST ajast = createAjAST();
- SignaturePattern p = ajast.newSignaturePattern();
+ // SignaturePattern p =
+ ajast.newSignaturePattern();
List props = SignaturePattern.propertyDescriptors(AST.JLS3);
assertEquals("there should be no properties for the DefaultTypePattern", 0, props.size());
}
public void testPropertyDescriptorsForAjTypeDeclaration() {
AjAST ajast = createAjAST();
- AjTypeDeclaration d = ajast.newAjTypeDeclaration();
+ // AjTypeDeclaration d =
+ ajast.newAjTypeDeclaration();
List props = AjTypeDeclaration.propertyDescriptors(AST.JLS3);
boolean foundAspect = false;
for (Iterator iter = props.iterator(); iter.hasNext();) {