diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-06-04 07:58:52 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-06-04 07:58:52 +0700 |
commit | 49cb924f5402c9d24379ae1af62def6fa5892649 (patch) | |
tree | 69844405209043e2e18aa9eef0f01f287bc1ae52 /org.aspectj.ajdt.core/src | |
parent | 82df3f0fc9842758f15f12299c9113e48f1ccb5c (diff) | |
download | aspectj-49cb924f5402c9d24379ae1af62def6fa5892649.tar.gz aspectj-49cb924f5402c9d24379ae1af62def6fa5892649.zip |
Upgrade license from CPLv1/EPLv1 to EPLv2
This was required by the Eclipse team as one precondition for the next
release.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'org.aspectj.ajdt.core/src')
211 files changed, 3079 insertions, 3079 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/AjdtCommand.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/AjdtCommand.java index c5f4df474..23c32ebb4 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/AjdtCommand.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/AjdtCommand.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -23,15 +23,15 @@ import org.aspectj.org.eclipse.jdt.internal.core.builder.MissingSourceFileExcept * Not thread-safe. */ public class AjdtCommand implements ICommand { - + /** Message String for any AbortException thrown from ICommand API's */ public static final String ABORT_MESSAGE = "ABORT"; - + // private boolean canRepeatCommand = true; - + AjBuildManager buildManager = null; String[] savedArgs = null; - + /** * Run AspectJ compiler, wrapping any exceptions thrown as * ABORT messages (containing ABORT_MESSAGE String). @@ -41,7 +41,7 @@ public class AjdtCommand implements ICommand { * @return false if handler has errors or the command failed */ public boolean runCommand(String[] args, IMessageHandler handler) { - buildManager = new AjBuildManager(handler); + buildManager = new AjBuildManager(handler); savedArgs = new String[args.length]; System.arraycopy(args, 0, savedArgs, 0, savedArgs.length); return doCommand(handler, false); @@ -57,16 +57,16 @@ public class AjdtCommand implements ICommand { public boolean repeatCommand(IMessageHandler handler) { if (null == buildManager) { MessageUtil.abort(handler, "repeatCommand called before runCommand"); - return false; + return false; } return doCommand(handler, true); } - - /** + + /** * Delegate of both runCommand and repeatCommand. * This invokes the argument parser each time * (even when repeating). - * If the parser detects errors, this signals an + * If the parser detects errors, this signals an * abort with the usage message and returns false. * @param handler the IMessageHandler sink for any messages * @param repeat if true, do incremental build, else do batch build @@ -97,8 +97,8 @@ public class AjdtCommand implements ICommand { // MessageUtil.abort(handler, usage); return false; } - //System.err.println("errs: " + counter.hasErrors()); - boolean result = ((repeat + //System.err.println("errs: " + counter.hasErrors()); + boolean result = ((repeat ? buildManager.incrementalBuild(config, handler) : buildManager.batchBuild(config, handler)) && !counter.hasErrors()); @@ -110,16 +110,16 @@ public class AjdtCommand implements ICommand { } else { MessageUtil.abort(handler, ABORT_MESSAGE, ae); } - } catch (MissingSourceFileException t) { + } catch (MissingSourceFileException t) { MessageUtil.error(handler, t.getMessage()); } catch (Throwable t) { MessageUtil.abort(handler, ABORT_MESSAGE, t); Dump.dumpWithException(t); - } + } return false; } - - /** + + /** * This creates a build configuration for the arguments. * Errors reported to the handler: * <ol> @@ -137,24 +137,24 @@ public class AjdtCommand implements ICommand { ISourceLocation location = null; if (config.getConfigFile() != null) { - location = new SourceLocation(config.getConfigFile(), 0); + location = new SourceLocation(config.getConfigFile(), 0); } String message = parser.getOtherMessages(true); - if (null != message) { + if (null != message) { IMessage.Kind kind = inferKind(message); - IMessage m = new Message(message, kind, null, location); + IMessage m = new Message(message, kind, null, location); handler.handleMessage(m); - } + } // message = config.configErrors(); // if (null != message) { // IMessage.Kind kind = inferKind(message); -// IMessage m = new Message(message, kind, null, location); +// IMessage m = new Message(message, kind, null, location); // handler.handleMessage(m); // } return config; } - + /** * Heuristically infer the type of output message logged by the AspectJ compiler. This is a simple keyword matcher * looking for substrings like "[error]", "[warning]", "AspectJ-specific options:", "AspectJ-specific non-standard diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java index e078ba7fb..574f1e71e 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.java index f290d910a..f2dab9a8f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/ConfigParser.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.ajc; @@ -264,7 +264,7 @@ public class ConfigParser { } else if (isSourceFileName(v)) { addFileOrPattern(makeFile(v)); if (v.endsWith("module-info.java")) { - parseOption(arg.getValue(), args); + parseOption(arg.getValue(), args); } } else if (isXml(v)) { addXmlFile(makeFile(v)); @@ -309,7 +309,7 @@ public class ConfigParser { public String toString() { return "Arg[location="+location+" value="+value+"]"; } - + public Arg(String value, Location location) { this.value = value; this.location = location; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/compiler/IAjTerminalSymbols.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/compiler/IAjTerminalSymbols.java index 2c6480e97..74acbd1db 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/compiler/IAjTerminalSymbols.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/compiler/IAjTerminalSymbols.java @@ -1,20 +1,20 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.compiler; import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens; - + /** * This should contain a list of symbols unique to AspectJ grammar, but * getting jikespg to do that is too much work right now. diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/AspectJCore.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/AspectJCore.java index 45a4c4b17..8099f292a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/AspectJCore.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/AspectJCore.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -29,21 +29,21 @@ public class AspectJCore extends JavaCore { public static final String COMPILER_PB_CANNOT_IMPLEMENT_LAZY_TJP = AjCompilerOptions.OPTION_ReportCannotImplementLazyTJP; public static final String COMPILER_PB_NEED_SERIAL_VERSION_UID = AjCompilerOptions.OPTION_ReportNeedSerialVersionUIDField; public static final String COMPILER_PB_INCOMPATIBLE_SERIAL_VERSION = AjCompilerOptions.OPTION_ReportIncompatibleSerialVersion; - + public static final String COMPILER_TERMINATE_AFTER_COMPILATION = AjCompilerOptions.OPTION_TerminateAfterCompilation; public static final String COMPILER_SERIALIZABLE_ASPECTS = AjCompilerOptions.OPTION_XSerializableAspects; public static final String COMPILER_LAZY_TJP = AjCompilerOptions.OPTION_XLazyThisJoinPoint; public static final String COMPILER_NO_ADVICE_INLINE = AjCompilerOptions.OPTION_XNoInline; public static final String COMPILER_NOT_REWEAVABLE = AjCompilerOptions.OPTION_XNotReweavable; - + public AspectJCore() { super(); } - + public static AspectJCore getAspectJCore() { return (AspectJCore) getPlugin(); } - + /* (non-Javadoc) * @see org.eclipse.jdt.core.JavaCore#getCompilerOptions() */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjASTConverterFactory.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjASTConverterFactory.java index 121e55f4f..0dbdce885 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjASTConverterFactory.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjASTConverterFactory.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjASTFactory.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjASTFactory.java index 5ee3cdbbf..c1e49e972 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjASTFactory.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjASTFactory.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2006 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjTypeDeclFactory.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjTypeDeclFactory.java index b2d1788dd..a9f371165 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjTypeDeclFactory.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/core/dom/AjTypeDeclFactory.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AbstractCompilerAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AbstractCompilerAdapter.java index 52b468278..0933c63d2 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AbstractCompilerAdapter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AbstractCompilerAdapter.java @@ -2,9 +2,9 @@ * Copyright (c) 2006 Contributors * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Andy Clement initial implementation @@ -18,14 +18,14 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclarat import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit; /** - * + * * @author AndyClement * */ public abstract class AbstractCompilerAdapter implements ICompilerAdapter { - + public abstract List /*InterimResult*/ getResultsPendingWeave(); - + public abstract void acceptResult(CompilationResult result); public abstract void afterAnalysing(CompilationUnitDeclaration unit); @@ -43,7 +43,7 @@ public abstract class AbstractCompilerAdapter implements ICompilerAdapter { public abstract void beforeAnalysing(CompilationUnitDeclaration unit); public abstract void beforeCompiling(ICompilationUnit[] sourceUnits); - + public abstract void beforeGenerating(CompilationUnitDeclaration unit); public abstract void beforeProcessing(CompilationUnitDeclaration unit); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjClassFile.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjClassFile.java index 1276bffae..86d9194dc 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjClassFile.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjClassFile.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -26,7 +26,7 @@ public class AjClassFile extends ClassFile { this.filename = fileName; bytes = byteCodes; } - + public char[] fileName() { return filename; } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompiler.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompiler.java index b726e7e02..f5aa911ab 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompiler.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompiler.java @@ -1,13 +1,13 @@ ///* ******************************************************************* // * 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 v 2.0 +// * which accompanies this distribution and is available at +// * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt +// * +// * Contributors: +// * PARC initial implementation // * ******************************************************************/ // // @@ -53,7 +53,7 @@ // // //public class AjCompiler extends Compiler { -// +// // private List /*InterimResult*/ resultsPendingWeave = new ArrayList(); // private BcelWorld bcelWorld; // private BcelWeaver bcelWeaver; @@ -65,15 +65,15 @@ // private WeaverMessageHandler wmHandler; // private boolean isBatchCompile = false; // private Collection /*InterimResult*/ resultSetForFullWeave = Collections.EMPTY_LIST; -// +// // public interface IIntermediateResultsRequestor { // void acceptResult(InterimResult intRes); // } -// +// // public interface IOutputClassFileNameProvider { // String getOutputClassFileName(char[] eclipseClassFileName, CompilationResult result); // } -// +// // public AjCompiler( // INameEnvironment environment, // IErrorHandlingPolicy policy, @@ -98,8 +98,8 @@ // problemFactory, // parseLiteralExpressionsAsConstants); // } -// -// +// +// // public void setWeaver(BcelWeaver weaver) { // this.bcelWeaver = weaver; // } @@ -114,29 +114,29 @@ // public void prepareForBatchCompilation() { // isBatchCompile = true; // } -// +// // public void setIntermediateResultsRequestor(IIntermediateResultsRequestor intReq) { // this.intermediateResultRequestor = intReq; // } -// +// // public void setNoWeave(boolean noWeave) { // skipTheWeavePhase = noWeave; // } -// +// // public void setFullWeaveResults(Collection compilationResults) { // resultSetForFullWeave = compilationResults; // } -// +// // public void setOutputFileNameProvider(IOutputClassFileNameProvider p) { // this.nameProvider = p; // } -// +// // public void addBinarySourceFiles(Map binarySourceEntries) { // // Map is fileName |-> List<UnwovenClassFile> // for (Iterator binIter = binarySourceEntries.keySet().iterator(); binIter.hasNext();) { // String sourceFileName = (String) binIter.next(); // List unwovenClassFiles = (List) binarySourceEntries.get(sourceFileName); -// +// // CompilationResult result = new CompilationResult(sourceFileName.toCharArray(),0,0,20); // result.noSourceAvailable(); // InterimResult binarySource = new InterimResult(result,nameProvider); @@ -147,33 +147,33 @@ // binarySource.unwovenClassFiles[index] = element; // AjClassFile ajcf = new AjClassFile(element.getClassName().replace('.', '/').toCharArray(), // element.getBytes()); -// result.record(ajcf.fileName(),ajcf); +// result.record(ajcf.fileName(),ajcf); // index++; // } // binarySources.add(binarySource); // } // } -// -// +// +// // /** -// * In addition to processing each compilation unit in the normal ways, +// * In addition to processing each compilation unit in the normal ways, // * we also need to do weaving for inter-type declarations. This // * must be done before we use the signatures of these types to do any // * name binding. // */ // public void process(CompilationUnitDeclaration unit, int i) { -// EclipseFactory world = +// EclipseFactory world = // EclipseFactory.fromLookupEnvironment(lookupEnvironment); // world.showMessage(IMessage.INFO, "compiling " + new String(unit.getFileName()), null, null); // super.process(unit, i); -// +// // world.finishedCompilationUnit(unit); // } -// -// +// +// // /* (non-Javadoc) // * @see org.eclipse.jdt.internal.compiler.Compiler#compile(org.eclipse.jdt.internal.compiler.env.ICompilationUnit[]) -// * We override this method to defer handing of results to the caller until the weave phase has +// * We override this method to defer handing of results to the caller until the weave phase has // * completed too. That way the class files are in final form and all error messages relating to the // * compilation unit have been reported (which is the contract the JDT expects from this method). // */ @@ -198,8 +198,8 @@ // cleanup(); // } // } -// -// +// +// // /* (non-Javadoc) // * @see org.eclipse.jdt.internal.compiler.Compiler#registerCompilationResult(org.eclipse.jdt.internal.compiler.CompilationResult) // */ @@ -211,7 +211,7 @@ // intermediateResultRequestor.acceptResult(intRes); // } // } -// +// // /* (non-Javadoc) // * @see org.eclipse.jdt.internal.compiler.Compiler#reset() // * Super does this too early for us... @@ -219,7 +219,7 @@ // public void reset() { // // no-op, super calls this too early for us... // } -// +// // /* (non-Javadoc) // * @see org.eclipse.jdt.internal.compiler.Compiler#resolve(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration, org.eclipse.jdt.internal.compiler.env.ICompilationUnit, boolean, boolean, boolean) // */ @@ -230,8 +230,8 @@ // return super.resolve(unit, sourceUnit, verifyMethods, analyzeCode, // generateCode); // } -// -// +// +// // // AspectJ helper methods, called from compile... // private void weaveResults() throws IOException { // // ensure weaver state is set up correctly @@ -239,13 +239,13 @@ // InterimResult iresult = (InterimResult) iter.next(); // for (int i = 0; i < iresult.unwovenClassFiles.length; i++) { // bcelWeaver.addClassFile(iresult.unwovenClassFiles[i]); -// } +// } // } // Pause.pause("After adding class files to weaver"); // bcelWeaver.prepareForWeave(); // Pause.pause("After preparing for weave"); // if (isBatchCompile) { -// resultsPendingWeave.addAll(binarySources); +// resultsPendingWeave.addAll(binarySources); // // passed into the compiler, the set of classes in injars and inpath... // } else if (bcelWeaver.needToReweaveWorld()) { // addAllKnownClassesToWeaveList(); @@ -253,14 +253,14 @@ // Pause.pause("After adding binary sources to weaver"); // bcelWeaver.weave(new WeaverAdaptor(this)); // } -// +// // private void notifyRequestor() { // for (Iterator iter = resultsPendingWeave.iterator(); iter.hasNext();) { // InterimResult iresult = (InterimResult) iter.next(); // requestor.acceptResult(iresult.result.tagAsAccepted()); // } // } -// +// // private void cleanup() { // resultsPendingWeave = null; // isBatchCompile = false; @@ -269,7 +269,7 @@ // super.reset(); // Pause.pause("After notify and cleanup"); // } -// +// // private void addAllKnownClassesToWeaveList() { // // results pending weave already has some results from this (incremental) compile // // add in results from any other source @@ -278,14 +278,14 @@ // if (!resultsPendingWeave.contains(ir)) { // equality based on source file name... // ir.result.hasBeenAccepted = false; // it may have been accepted before, start again // resultsPendingWeave.add(ir); -// } +// } // } // } -// +// // // Helper class that feeds input to the weaver, and accepts results // // ======================================================================================= // private static class WeaverAdaptor implements IClassFileProvider, IWeaveRequestor, Iterator { -// +// // private AjCompiler compiler; // private Iterator resultIterator; // private int classFileIndex = 0; @@ -293,10 +293,10 @@ // private InterimResult lastReturnedResult; //// private CompilationResult lastAcceptedResult; // private boolean finalPhase = false; -// -// +// +// // public WeaverAdaptor(AjCompiler forCompiler) { this.compiler = forCompiler; } -// +// // /* (non-Javadoc) // * @see org.aspectj.weaver.IClassFileProvider#getClassFileIterator() // */ @@ -330,7 +330,7 @@ //// } //// lastAcceptedResult = lastReturnedResult.result; // } -// +// // private void finishedWith(InterimResult result) { // compiler.requestor.acceptResult(result.result.tagAsAccepted()); // for (int i = 0; i < compiler.unitsToProcess.length; i++) { @@ -341,7 +341,7 @@ // } // } // } -// +// // /* (non-Javadoc) // * @see java.util.Iterator#hasNext() // */ @@ -364,7 +364,7 @@ // while (nowProcessing.unwovenClassFiles.length == 0 ) { // if (!resultIterator.hasNext()) return false; // nowProcessing = (InterimResult) resultIterator.next(); -// } +// } // } // return true; // } @@ -389,7 +389,7 @@ // public void remove() { // throw new UnsupportedOperationException(); // } -// +// // public void processingReweavableState() {} // public void addingTypeMungers() {} // public void weavingAspects() {} @@ -399,7 +399,7 @@ // finishedWith(lastReturnedResult); // } // } -// +// // private void removeFromHashtable(Hashtable table, char[] key) { // // jdt uses char[] as a key in the hashtable, which is not very useful as equality is based on being // // the same array, not having the same content. @@ -417,7 +417,7 @@ // } // } //} -// +// // // Holder for intermediate form (class files) // // ======================================================================================= // public static class InterimResult { @@ -433,11 +433,11 @@ // nameGen = np; // unwovenClassFiles = ClassFileBasedByteCodeProvider.unwovenClassFilesFor(result,nameGen); // } -// +// // public String fileName() { // return new String(result.fileName); // } -// +// // public boolean equals(Object other) { // if( other == null || !(other instanceof InterimResult)) { // return false; @@ -449,22 +449,22 @@ // return fileName().hashCode(); // } // }; -// -// -// +// +// +// // // XXX lightweight subclass of ClassFile that only genuinely supports fileName and getBytes // // operations. // // ========================================================================================= // private static class AjClassFile extends ClassFile { -// +// // char[] filename; // byte[] bytes; -// +// // public AjClassFile(char[] fileName, byte[] byteCodes) { // this.filename = fileName; // bytes = byteCodes; // } -// +// // public char[] fileName() { // return filename; // } @@ -473,24 +473,24 @@ // return bytes; // } // }; -// -// +// +// // // Adaptor for ClassFiles that lets them act as the bytecode repository -// // for UnwovenClassFiles (asking a ClassFile for its bytes causes a +// // for UnwovenClassFiles (asking a ClassFile for its bytes causes a // // copy to be made). -// private static class ClassFileBasedByteCodeProvider +// private static class ClassFileBasedByteCodeProvider // implements UnwovenClassFileWithThirdPartyManagedBytecode.IByteCodeProvider { // private ClassFile cf; -// +// // public ClassFileBasedByteCodeProvider(ClassFile cf) { // this.cf = cf; // } -// +// // public byte[] getBytes() { // return cf.getBytes(); // } -// -// public static UnwovenClassFile[] unwovenClassFilesFor(CompilationResult result, +// +// public static UnwovenClassFile[] unwovenClassFilesFor(CompilationResult result, // AjCompiler.IOutputClassFileNameProvider nameProvider) { // ClassFile[] cfs = result.getClassFiles(); // UnwovenClassFile[] ret = new UnwovenClassFile[cfs.length]; @@ -501,20 +501,20 @@ // } // return ret; // } -// +// // } -// +// // // Inner class for handling messages produced by the weaver // // ========================================================== -// +// // private class WeaverMessageHandler implements IMessageHandler { // IMessageHandler sink; // CompilationResult currentlyWeaving; -// +// // public WeaverMessageHandler(IMessageHandler handler) { // this.sink = handler; // } -// +// // public void setCurrentResult(CompilationResult result) { // currentlyWeaving = result; // } @@ -559,7 +559,7 @@ // problemSource // ); // IProblem[] seeAlso = buildSeeAlsoProblems(message.getExtraSourceLocations(), -// problemSource, +// problemSource, // usedBinarySourceFileName); // problem.setSeeAlsoProblems(seeAlso); // if (message.getDetails() != null) { @@ -568,7 +568,7 @@ // problemReporter.record(problem, problemSource, referenceContext); // return true; //// if (weavingPhase) { -//// return sink.handleMessage(message); +//// return sink.handleMessage(message); //// } else { //// return true; // message will be reported back in compilation result later... //// } @@ -577,7 +577,7 @@ // public boolean isIgnoring(Kind kind) { // return sink.isIgnoring(kind); // } -// +// // private int getStartPos(ISourceLocation sLoc,CompilationResult result) { // int pos = 0; // if (sLoc == null) return 0; @@ -587,7 +587,7 @@ // } else { // if (line <= 1) return 0; // if (result != null) { -// if ((result.lineSeparatorPositions != null) && +// if ((result.lineSeparatorPositions != null) && // (result.lineSeparatorPositions.length >= (line-1))) { // pos = result.lineSeparatorPositions[line-2] + 1; // } @@ -605,7 +605,7 @@ // pos = ((EclipseSourceLocation)sLoc).getEndPos(); // } else { // if (result != null) { -// if ((result.lineSeparatorPositions != null) && +// if ((result.lineSeparatorPositions != null) && // (result.lineSeparatorPositions.length >= line)) { // pos = result.lineSeparatorPositions[line -1] -1; // } @@ -613,7 +613,7 @@ // } // return pos; // } -// +// // private ReferenceContext findReferenceContextFor(CompilationResult result) { // ReferenceContext context = null; // if (unitsToProcess == null) return null; @@ -622,11 +622,11 @@ // (unitsToProcess[i].compilationResult == result)) { // context = unitsToProcess[i]; // break; -// } +// } // } // return context; // } -// +// // private IProblem[] buildSeeAlsoProblems(List sourceLocations, // CompilationResult problemSource, // boolean usedBinarySourceFileName) { @@ -652,5 +652,5 @@ // return ret; // } // } -// +// //} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java index dd9d9c0a9..2f4aba23a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -36,7 +36,7 @@ import org.aspectj.weaver.bcel.BcelWorld; /** * @author colyer - * + * * Adapts standard JDT Compiler to add in AspectJ specific behaviours. */ public class AjCompilerAdapter extends AbstractCompilerAdapter { @@ -69,7 +69,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter { /** * Create an adapter, and tell it everything it needs to now to drive the AspectJ parts of a compile cycle. - * + * * @param compiler the JDT compiler that produces class files from source * @param isBatchCompile true if this is a full build (non-incremental) * @param world the bcelWorld used for type resolution during weaving @@ -344,4 +344,4 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter { return resultsPendingWeave; } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java index eb6bb92da..2be73a629 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Andy Clement - initial implementation 26Jul06 *******************************************************************************/ @@ -49,20 +49,20 @@ import org.aspectj.weaver.bcel.UnwovenClassFile; * and then woven immediately, unlike AjCompilerAdapter which compiles everything then weaves everything. (One small note: because * all aspects have to be known before weaving can take place, the weaving pipeline is 'stalled' until all aspects have been * compiled). - * + * * The basic strategy is this: - * + * * 1. diet parse all input source files - this is enough for us to implement ITD matching - this enables us to determine which are * aspects 2. sort the input files, aspects first - keep a note of how many files contain aspects 3. if there are aspects, mark the * pipeline as 'stalled' 3. repeat 3a. compile a file 3b. have we now compiled all aspects? NO - put file in a weave pending queue * YES- unstall the 'pipeline' 3c. is the pipeline stalled? NO - weave all pending files and this one YES- do nothing - * + * * Complexities arise because of: - what does -XterminateAfterCompilation mean? since there is no stage where everything is compiled * and nothing is woven - * - * + * + * * Here is the compiler loop difference when pipelining. - * + * * the old way: Finished diet parsing [C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java] Finished diet parsing * [C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java] > AjLookupEnvironment.completeTypeBindings() < * AjLookupEnvironment.completeTypeBindings() compiling C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java @@ -74,7 +74,7 @@ import org.aspectj.weaver.bcel.UnwovenClassFile; * >BcelWeaver.prepareForWeave <BcelWeaver.prepareForWeave woven class ClassOne (from * C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java) woven class ClassTwo (from * C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java) <AjCompilerAdapter.weave() - * + * * the new way (see the compiling/weaving mixed up): Finished diet parsing * [C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java] Finished diet parsing * [C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java] >AjLookupEnvironment.completeTypeBindings() @@ -87,8 +87,8 @@ import org.aspectj.weaver.bcel.UnwovenClassFile; * >Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java) * <Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java) >AjCompilerAdapter.weave() woven class ClassTwo * (from C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java) <AjCompilerAdapter.weave() - * - * + * + * */ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { @@ -128,7 +128,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { /** * Create an adapter, and tell it everything it needs to now to drive the AspectJ parts of a compile cycle. - * + * * @param compiler the JDT compiler that produces class files from source * @param isBatchCompile true if this is a full build (non-incremental) * @param world the bcelWorld used for type resolution during weaving @@ -665,7 +665,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter { // Keys into pipelineOutput: // compileOrder "[XXX,YYY]" a list of the order in which files will be woven (aspects should be first) // filesContainingAspects "NNN" how many input source files have aspects inside - // + // public static String getPipelineDebugOutput(String key) { if (pipelineOutput == null) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java index c14539c8d..7a8915baf 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ClassFileBasedByteCodeProvider.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -19,23 +19,23 @@ import org.aspectj.weaver.bcel.UnwovenClassFileWithThirdPartyManagedBytecode; * @author colyer * * Adaptor for ClassFiles that lets them act as the bytecode repository - * for UnwovenClassFiles (asking a ClassFile for its bytes causes a + * for UnwovenClassFiles (asking a ClassFile for its bytes causes a * copy to be made). */ -public class ClassFileBasedByteCodeProvider +public class ClassFileBasedByteCodeProvider implements UnwovenClassFileWithThirdPartyManagedBytecode.IByteCodeProvider{ - + private ClassFile cf; - + public ClassFileBasedByteCodeProvider(ClassFile cf) { this.cf = cf; } - + public byte[] getBytes() { return cf.getBytes(); } - - public static UnwovenClassFile[] unwovenClassFilesFor(CompilationResult result, + + public static UnwovenClassFile[] unwovenClassFilesFor(CompilationResult result, IOutputClassFileNameProvider nameProvider) { ClassFile[] cfs = result.getClassFiles(); UnwovenClassFile[] ret = new UnwovenClassFile[result.compiledTypes.size()]; @@ -50,5 +50,5 @@ public class ClassFileBasedByteCodeProvider } return ret; } - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/CommonPrinter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/CommonPrinter.java index 9ba3a697a..43f98336d 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/CommonPrinter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/CommonPrinter.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Andy Clement - SpringSource * ******************************************************************/ package org.aspectj.ajdt.internal.compiler; @@ -603,7 +603,7 @@ public class CommonPrinter { printIndent(indent); IfStatement is = (IfStatement) statement; printIndent(indent).append("if ("); //$NON-NLS-1$ - printExpression(is.condition).append(")\n"); //$NON-NLS-1$ + printExpression(is.condition).append(")\n"); //$NON-NLS-1$ printStatement(is.thenStatement, indent + 2); if (is.elseStatement != null) { output.append('\n'); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java index aa2d7fb3f..ec265ea78 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/CompilationResultDestinationManager.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2006 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler; @@ -17,9 +17,9 @@ import java.util.Map; /** * acts as a bridge from ajde's OutputLocationManager interface to the compiler internals - * + * * @author adrian - * + * */ public interface CompilationResultDestinationManager { @@ -27,7 +27,7 @@ public interface CompilationResultDestinationManager { * Return the directory root under which the results of compiling the given source file. For example, if the source file * contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to * "target/classes/a/b/C.class" - * + * * @param compilationUnit the compilation unit that has been compiled * @return a File object representing the root directory under which compilation results for this unit should be written */ @@ -36,7 +36,7 @@ public interface CompilationResultDestinationManager { /** * Return the source folder where this source file came from, relative to the project root. For example 'src' or 'src/main/java' * or 'src/test/java' - * + * * @param sourceFile the file for which the source folder should be determined * @return the source folder */ @@ -45,7 +45,7 @@ public interface CompilationResultDestinationManager { /** * When copying resources from source folders to output location, return the root directory under which the resource should be * copied. - * + * * @param resource the resource to be copied * @return a File object representing the root directory under which this resource should be copied */ @@ -64,14 +64,14 @@ public interface CompilationResultDestinationManager { /** * Report that a class file is being written to the specified location. - * + * * @param outputfile the output file (including .class suffix) */ void reportFileWrite(String outputfile, int filetype); /** * Report that a class file is being deleted from the specified location. - * + * * @param outputfile the output file (including .class suffix) */ void reportFileRemove(String outputfile, int filetype); @@ -85,5 +85,5 @@ public interface CompilationResultDestinationManager { int FILETYPE_CLASS = 1; int FILETYPE_OUTJAR = 2; int FILETYPE_RESOURCE = 3; - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/DeclareAnnotationsPrinter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/DeclareAnnotationsPrinter.java index 7e087ae0b..5df2002a6 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/DeclareAnnotationsPrinter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/DeclareAnnotationsPrinter.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Andy Clement - SpringSource * ******************************************************************/ //package org.aspectj.ajdt.internal.compiler; @@ -47,4 +47,4 @@ // } // return output.toString(); // } -// }
\ No newline at end of file +// } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IBinarySourceProvider.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IBinarySourceProvider.java index 98fedb197..b9b4351c7 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IBinarySourceProvider.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IBinarySourceProvider.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -17,11 +17,11 @@ import java.util.Map; * * Implementors of this interface are called by the CompilerAdapter just before * it does a weave, and should return the set of binary source files (ie. those - * resources from injars and inpath) that are to be included in the weave. + * resources from injars and inpath) that are to be included in the weave. * Used to manage incremental compilation of binary sources. */ public interface IBinarySourceProvider { - + Map /* fileName |-> List<UnwovenClassFile> */ getBinarySourcesForThisWeave(); - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IIntermediateResultsRequestor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IIntermediateResultsRequestor.java index 09f4a6b63..2349c38ef 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IIntermediateResultsRequestor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IIntermediateResultsRequestor.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IOutputClassFileNameProvider.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IOutputClassFileNameProvider.java index 84938d788..3e3c1dfb1 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IOutputClassFileNameProvider.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/IOutputClassFileNameProvider.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -14,7 +14,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult; /** * @author colyer - * + * * Implementors of this interface know how to create an output destination name * for a given compilation result and class file. This interface capures the variation * in strategy between ajc command-line compiles and an AJDT driven compilation. diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDConstructorPrinter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDConstructorPrinter.java index 0a5ca697a..76c5b1e42 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDConstructorPrinter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDConstructorPrinter.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Andy Clement - SpringSource * ******************************************************************/ package org.aspectj.ajdt.internal.compiler; @@ -20,7 +20,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope; /** * Prints the declaration for an intertype declared constructor. - * + * * @author Andy Clement */ class ITDConstructorPrinter extends CommonPrinter { @@ -98,4 +98,4 @@ class ITDConstructorPrinter extends CommonPrinter { } return printExpression(constructorDeclaration.returnType).append(' '); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDFieldPrinter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDFieldPrinter.java index cf1f5249f..3fb2042b8 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDFieldPrinter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDFieldPrinter.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Andy Clement - SpringSource * ******************************************************************/ package org.aspectj.ajdt.internal.compiler; @@ -17,7 +17,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope; /** * Prints the declaration for an intertype declared field, including initializer. - * + * * @author Andy Clement */ class ITDFieldPrinter extends CommonPrinter { @@ -74,4 +74,4 @@ class ITDFieldPrinter extends CommonPrinter { } return printExpression(fieldDeclaration.returnType).append(' '); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDMethodPrinter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDMethodPrinter.java index 55b1eb725..a5f8de0d9 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDMethodPrinter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ITDMethodPrinter.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Andy Clement - SpringSource * ******************************************************************/ package org.aspectj.ajdt.internal.compiler; @@ -19,7 +19,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope; /** * Prints the declaration for an intertype declared method. - * + * * @author Andy Clement */ class ITDMethodPrinter extends CommonPrinter { @@ -92,4 +92,4 @@ class ITDMethodPrinter extends CommonPrinter { printBody(tab + 1); return output.toString(); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/InterimCompilationResult.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/InterimCompilationResult.java index 7236237a1..ceb1231db 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/InterimCompilationResult.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/InterimCompilationResult.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java index 83d528a90..a247f78eb 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -55,7 +55,7 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.IClassFileProvider#getClassFileIterator() */ public Iterator getClassFileIterator() { @@ -69,7 +69,7 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.IClassFileProvider#getRequestor() */ public IWeaveRequestor getRequestor() { @@ -85,7 +85,7 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera /* * (non-Javadoc) - * + * * @see java.util.Iterator#hasNext() */ public boolean hasNext() { @@ -118,7 +118,7 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera /* * (non-Javadoc) - * + * * @see java.util.Iterator#next() */ public Object next() { @@ -139,7 +139,7 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera /* * (non-Javadoc) - * + * * @see java.util.Iterator#remove() */ public void remove() { @@ -190,7 +190,7 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.IWeaveRequestor#acceptResult(org.aspectj.weaver.bcel.UnwovenClassFile) */ public void acceptResult(IUnwovenClassFile result) { @@ -255,4 +255,4 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera progressListener.setText(message); } } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java index 364aea401..0de3a5780 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -31,7 +31,7 @@ import org.aspectj.weaver.LintMessage; /** * @author colyer - * + * * To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and * Comments */ @@ -139,7 +139,7 @@ public class WeaverMessageHandler implements IMessageHandler { /** * No-op - * + * * @see org.aspectj.bridge.IMessageHandler#isIgnoring(org.aspectj.bridge.IMessage.Kind) * @param kind */ @@ -149,7 +149,7 @@ public class WeaverMessageHandler implements IMessageHandler { /** * No-op - * + * * @see org.aspectj.bridge.IMessageHandler#ignore(org.aspectj.bridge.IMessage.Kind) * @param kind */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java index a8be5eee7..b71eddae9 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -52,13 +52,13 @@ import org.aspectj.weaver.ResolvedMember; /** * Walks the body of around advice - * + * * Makes sure that all member accesses are to public members. Will convert to use access methods when needed to ensure that. This * makes it much simpler (and more modular) to inline the body of an around. - * + * * ??? constructors are handled different and require access to the target type. changes to * org.eclipse.jdt.internal.compiler.ast.AllocationExpression would be required to fix this issue. - * + * * @author Jim Hugunin */ @@ -130,7 +130,7 @@ public class AccessForInlineVisitor extends ASTVisitor { } } - + private boolean isCloneMethod(MethodBinding binding) { return (CharOperation.equals(binding.selector, TypeConstants.CLONE)) && (CharOperation.equals(binding.declaringClass.compoundName, TypeConstants.JAVA_LANG_OBJECT)); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AddAtAspectJAnnotationsVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AddAtAspectJAnnotationsVisitor.java index 79447f0ae..02fd32be7 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AddAtAspectJAnnotationsVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AddAtAspectJAnnotationsVisitor.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 IBM Corporation Ltd - * 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: - * Adrian Colyer initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Adrian Colyer initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -21,9 +21,9 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope /** * Adds runtime visible annotations to code-style aspect declarations so that the MAP can provide aspect information at runtime. - * + * * Done: - AspectDeclaration - AdviceDeclaration - PointcutDeclaration - * + * * To Do: - DeclareDeclaration - Inter-Type Declaration */ public class AddAtAspectJAnnotationsVisitor extends ASTVisitor { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java index 675f0656f..d3cd40be4 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java index 247c7618f..279c389c1 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: - * IBM Corporation + * IBM Corporation *******************************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -42,17 +42,17 @@ public class AjConstructorDeclaration extends ConstructorDeclaration { addDeclarationStartLineAttribute(extras,classFile); return classFile.generateMethodInfoAttributes(binding,extras); } - + protected void addDeclarationStartLineAttribute(List extraAttributeList, ClassFile classFile) { if ((classFile.codeStream.generateAttributes & ClassFileConstants.ATTR_LINES)==0) return; - + int[] separators = compilationResult().lineSeparatorPositions; int declarationStartLine = 1; for (int separator : separators) { if (sourceStart < separator) break; declarationStartLine++; } - + extraAttributeList.add( new EclipseAttributeAdapter(new AjAttribute.MethodDeclarationLineNumberAttribute(declarationStartLine, this.sourceStart()))); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java index 8130d3ef4..994eda80a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: - * IBM Corporation + * IBM Corporation *******************************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -28,7 +28,7 @@ import org.aspectj.weaver.AjAttribute; public class AjMethodDeclaration extends MethodDeclaration { private List attributes = null; - + /** * @param compilationResult */ @@ -42,7 +42,7 @@ public class AjMethodDeclaration extends MethodDeclaration { if (attributes==null) attributes = new ArrayList(); attributes.add(eaa); } - + /** * Overridden to add extra AJ stuff, also adds synthetic if boolean is true. */ @@ -55,22 +55,22 @@ public class AjMethodDeclaration extends MethodDeclaration { } return classFile.generateMethodInfoAttributes(binding,extras); } - + @Override protected int generateInfoAttributes(ClassFile classFile) { return generateInfoAttributes(classFile,false); - } - + } + protected void addDeclarationStartLineAttribute(List extraAttributeList, ClassFile classFile) { if ((classFile.codeStream.generateAttributes & ClassFileConstants.ATTR_LINES)==0) return; - + int[] separators = compilationResult().lineSeparatorPositions; int declarationStartLine = 1; for (int separator : separators) { if (sourceStart < separator) break; declarationStartLine++; } - + extraAttributeList.add( new EclipseAttributeAdapter(new AjAttribute.MethodDeclarationLineNumberAttribute(declarationStartLine, this.sourceStart()))); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectClinit.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectClinit.java index f151fd21b..a3e2e7263 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectClinit.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectClinit.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -29,7 +29,7 @@ import org.aspectj.weaver.AjcMemberMaker; public class AspectClinit extends Clinit { private boolean hasPre, hasPost; private FieldBinding initFailureField; - + public AspectClinit(Clinit old, CompilationResult compilationResult, boolean hasPre, boolean hasPost, FieldBinding initFailureField) { super(compilationResult); // CHECK do we need all the bits or just the needfreereturn bit? @@ -39,23 +39,23 @@ public class AspectClinit extends Clinit { this.sourceStart = old.sourceStart; this.declarationSourceEnd = old.declarationSourceEnd; this.declarationSourceStart = old.declarationSourceStart; - + this.hasPre = hasPre; this.hasPost = hasPost; this.initFailureField = initFailureField; } - + private ExceptionLabel handlerLabel; protected void generateSyntheticCode( ClassScope classScope, - CodeStream codeStream) + CodeStream codeStream) { if (initFailureField != null) { - handlerLabel = new ExceptionLabel(codeStream, classScope.getJavaLangThrowable()); + handlerLabel = new ExceptionLabel(codeStream, classScope.getJavaLangThrowable()); handlerLabel.placeStart(); } - + if (hasPre) { final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope); codeStream.invoke(Opcodes.OPC_invokestatic,world.makeMethodBindingForCall( @@ -65,7 +65,7 @@ public class AspectClinit extends Clinit { } super.generateSyntheticCode(classScope, codeStream); } - + protected void generatePostSyntheticCode( ClassScope classScope, CodeStream codeStream) @@ -78,12 +78,12 @@ public class AspectClinit extends Clinit { world.fromBinding(classScope.referenceContext.binding) )),null); } - - + + boolean creatingStackMap = (codeStream.generateAttributes & ( ClassFileConstants.ATTR_STACK_MAP_TABLE | ClassFileConstants.ATTR_STACK_MAP))!=0; - + if (initFailureField != null) { // Changes to this exception handling code may require changes to // BcelClassWeaver.isInitFailureHandler() @@ -110,7 +110,7 @@ public class AspectClinit extends Clinit { codeStream.fieldAccess(Opcodes.OPC_putstatic, initFailureField, null); endLabel.place(); } - + } } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java index b24012963..f1155fe2f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java @@ -2,9 +2,9 @@ * Copyright (c) 2002-2010 Contributors * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC, Andy Clement (SpringSource) diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java index 04693fd86..8607626a5 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -253,7 +253,7 @@ public class AstUtil { System.arraycopy(rest, 0, ret, 1, len); return ret; } - + public static TypeParameter[] insert(TypeParameter first, TypeParameter[] rest) { if (rest == null) { return new TypeParameter[]{first}; @@ -264,7 +264,7 @@ public class AstUtil { System.arraycopy(rest, 0, ret, 1, len); return ret; } - + public static TypeVariableBinding[] insert(TypeVariableBinding first, TypeVariableBinding[] rest) { if (rest == null) { return new TypeVariableBinding[]{first}; @@ -275,7 +275,7 @@ public class AstUtil { System.arraycopy(rest, 0, ret, 1, len); return ret; } - + public static TypeVariableBinding[] insert(TypeVariableBinding[] first, TypeVariableBinding[] rest) { if (rest == null) { TypeVariableBinding[] ret = new TypeVariableBinding[first.length]; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AtAspectJAnnotationFactory.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AtAspectJAnnotationFactory.java index 3a9d499f9..64e2448ee 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AtAspectJAnnotationFactory.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AtAspectJAnnotationFactory.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -29,14 +29,14 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits; * Creates @AspectJ annotations for use by AtAspectJVisitor */ public class AtAspectJAnnotationFactory { - + static final char[] org = "org".toCharArray(); static final char[] aspectj = "aspectj".toCharArray(); static final char[] lang = "lang".toCharArray(); static final char[] internal = "internal".toCharArray(); static final char[] annotation = "annotation".toCharArray(); static final char[] value = "value".toCharArray(); - + static final char[] aspect = "Aspect".toCharArray(); static final char[] privileged = "ajcPrivileged".toCharArray(); static final char[] before = "Before".toCharArray(); @@ -44,7 +44,7 @@ public class AtAspectJAnnotationFactory { static final char[] afterReturning = "AfterReturning".toCharArray(); static final char[] afterThrowing = "AfterThrowing".toCharArray(); static final char[] around = "Around".toCharArray(); - static final char[] pointcut = "Pointcut".toCharArray(); + static final char[] pointcut = "Pointcut".toCharArray(); static final char[] declareErrorOrWarning = "ajcDeclareEoW".toCharArray(); static final char[] declareParents = "ajcDeclareParents".toCharArray(); static final char[] declareSoft = "ajcDeclareSoft".toCharArray(); @@ -70,7 +70,7 @@ public class AtAspectJAnnotationFactory { } return atAspectAnnotation; } - + public static Annotation createPrivilegedAnnotation(int pos) { char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,privileged}; long[] positions = new long[] {pos,pos,pos,pos,pos,pos}; @@ -164,7 +164,7 @@ public class AtAspectJAnnotationFactory { Expression argExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1); mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argExpr); ann.memberValuePairs = mvps; - return ann; + return ann; } public static Annotation createDeclareErrorOrWarningAnnotation(String pointcutExpression, String message, boolean isError, int pos) { @@ -188,7 +188,7 @@ public class AtAspectJAnnotationFactory { ann.memberValuePairs = mvps; return ann; } - + public static Annotation createDeclareParentsAnnotation(String childPattern, String parentPatterns, boolean isExtends, int pos) { char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareParents}; long[] positions = new long[typeName.length]; @@ -210,7 +210,7 @@ public class AtAspectJAnnotationFactory { ann.memberValuePairs = mvps; return ann; } - + public static Annotation createDeclareSoftAnnotation(String pointcutExpression, String exceptionType, int pos) { char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareSoft}; long[] positions = new long[typeName.length]; @@ -225,7 +225,7 @@ public class AtAspectJAnnotationFactory { ann.memberValuePairs = mvps; return ann; } - + public static Annotation createDeclareAnnAnnotation(String patternString, String annString, String kind, int pos) { char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareAnnotation}; long[] positions = new long[typeName.length]; @@ -242,7 +242,7 @@ public class AtAspectJAnnotationFactory { ann.memberValuePairs = mvps; return ann; } - + public static Annotation createITDAnnotation(char[] targetTypeName, int modifiers, char[] name, int pos) { char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,itdAnnotation}; long[] positions = new long[typeName.length]; @@ -257,15 +257,15 @@ public class AtAspectJAnnotationFactory { mvps[1] = new MemberValuePair("name".toCharArray(),pos,pos,nameExpr); mvps[2] = new MemberValuePair("modifiers".toCharArray(),pos,pos,modsExpr); ann.memberValuePairs = mvps; - return ann; + return ann; } - + public static Annotation createDeclarePrecedenceAnnotation(String pointcutExpression, int pos) { char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declarePrecedence}; return makeSingleStringMemberAnnotation(typeName, pos, pointcutExpression); } - + private static Annotation makeSingleStringMemberAnnotation(char[][] name, int pos, String annValue) { long[] positions = new long[name.length]; for (int i = 0; i < positions.length; i++) positions[i] = pos; @@ -275,7 +275,7 @@ public class AtAspectJAnnotationFactory { MemberValuePair[] mvps = new MemberValuePair[1]; mvps[0] = new MemberValuePair(value,pos,pos,valueExpr); ann.memberValuePairs = mvps; - return ann; + return ann; } public static void addAnnotation(AjMethodDeclaration decl, Annotation annotation, BlockScope scope) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareAnnotationDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareAnnotationDeclaration.java index 758f99eb5..57e5e5238 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareAnnotationDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareAnnotationDeclaration.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 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: - * Adrian Colyer initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Adrian Colyer initial implementation * Andy Clement wired up to back end * ******************************************************************/ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java index 71ebea209..fb1a81c87 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/EclipseAttributeAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/EclipseAttributeAdapter.java index a6539247a..cbd1ceff2 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/EclipseAttributeAdapter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/EclipseAttributeAdapter.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/EclipseConstantPoolWriter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/EclipseConstantPoolWriter.java index 87d32ed2f..c94ffae06 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/EclipseConstantPoolWriter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/EclipseConstantPoolWriter.java @@ -1,11 +1,11 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Andy Clement (SpringSource) * ******************************************************************/ @@ -16,7 +16,7 @@ import org.aspectj.weaver.ConstantPoolWriter; /** * An implementation of the constant pool writer that speaks Eclipse. - * + * * @author Andy Clement */ public class EclipseConstantPoolWriter implements ConstantPoolWriter { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IfMethodDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IfMethodDeclaration.java index 24e463fe3..81251ccae 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IfMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IfMethodDeclaration.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IfPseudoToken.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IfPseudoToken.java index 9be61f117..67b97374f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IfPseudoToken.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IfPseudoToken.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -42,17 +42,17 @@ import org.aspectj.weaver.patterns.Pointcut; /** * (formals*): ... if(expr) ... - * + * * generates the following: public static final boolean ajc$if_N(formals*, * [thisJoinPoints as needed]) { return expr; } - * + * * Here's the complicated bit, it deals with cflow: (a): ... this(a) && cflow(if * (a == foo)) is an error. The way we capture this is: We generate the ajc$if * method with an (a) parameter, we let eclipse do the proper name binding. We * then, as a post pass (that we need to do anyway) look for the used * parameters. If a is used, we signal an error because a was not one of the * cflow variables. XXX we'll do this part after we do cflow - * + * * The IfPointcut pcd then generates itself always as a dynamic test, it has to * get the right parameters through any named pointcut references... */ @@ -98,15 +98,15 @@ public class IfPseudoToken extends PseudoToken { private final static char[] CodeGenerationHint = "CodeGenerationHint".toCharArray(); private final static char[] FullyQualifiedCodeGenerationHint = "org.aspectj.lang.annotation.control.CodeGenerationHint".toCharArray(); private final static char[] IfNameSuffix = "ifNameSuffix".toCharArray(); - + // XXX todo: make sure that errors in Arguments only get displayed once private MethodDeclaration makeIfMethod(CompilationResult result, MethodDeclaration enclosingDec, TypeDeclaration containingTypeDec, int counter) { MethodDeclaration ret = new IfMethodDeclaration(result, pointcut); ret.modifiers = ClassFileConstants.AccStatic | ClassFileConstants.AccFinal | ClassFileConstants.AccPublic; ret.returnType = AstUtil.makeTypeReference(TypeBinding.BOOLEAN); - + String nameSuffix = null; - + if (enclosingDec!=null && enclosingDec.annotations!=null) { NormalAnnotation interestingAnnotation = null; Annotation[] as = enclosingDec.annotations; @@ -136,8 +136,8 @@ public class IfPseudoToken extends PseudoToken { } } } - - + + // create a more stable name 277508 StringBuffer ifSelector = new StringBuffer(); ifSelector.append("ajc$if$"); @@ -176,7 +176,7 @@ public class IfPseudoToken extends PseudoToken { ifSelector.append(nameSuffix); } - + ret.selector = ifSelector.toString().toCharArray(); ret.arguments = makeArguments(enclosingDec, containingTypeDec); ret.statements = new Statement[] { new ReturnStatement(expr, diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterSuperFixerVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterSuperFixerVisitor.java index 27aaf3050..9e8fec812 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterSuperFixerVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterSuperFixerVisitor.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -30,7 +30,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding; /** * Walks the body of inter-type declarations and replaces SuperReference with InterSuperReference - * + * * @author Jim Hugunin */ @@ -40,7 +40,7 @@ public class InterSuperFixerVisitor extends ASTVisitor { TypeBinding superType; private int depthCounter = 0; // Keeps track of whether we are inside any nested local type declarations - EclipseFactory world; + EclipseFactory world; public InterSuperFixerVisitor(InterTypeDeclaration dec, EclipseFactory world, Scope scope) { this.dec = dec; this.onType = dec.onTypeBinding; @@ -66,8 +66,8 @@ public class InterSuperFixerVisitor extends ASTVisitor { public void endVisit(MessageSend send, BlockScope scope) { send.receiver = fixReceiver(send.receiver, scope); } - - + + public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) { depthCounter++; return super.visit(localTypeDeclaration, scope); @@ -75,7 +75,7 @@ public class InterSuperFixerVisitor extends ASTVisitor { public void endVisit(TypeDeclaration localTypeDeclaration,BlockScope scope) { depthCounter--; - } + } private Expression fixReceiver(Expression expression, BlockScope scope) { if (depthCounter!=0) return expression; // Don't mess with super calls down in nested local type declarations (pr90143) @@ -85,16 +85,16 @@ public class InterSuperFixerVisitor extends ASTVisitor { ISourceLocation location = new EclipseSourceLocation(scope.problemReporter().referenceContext.compilationResult(), expression.sourceStart, expression.sourceEnd); - + world.showMessage(IMessage.ERROR, "multiple supertypes for this interface", location, null); dec.ignoreFurtherInvestigation = true; } //FIXME ??? note error - expression = new InterSuperReference(superRef, superType); + expression = new InterSuperReference(superRef, superType); } return expression; } - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterSuperReference.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterSuperReference.java index 1b78aeef0..0ef316cb1 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterSuperReference.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterSuperReference.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -21,7 +21,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding; /** * Used to represent super references inside of inter-type declarations. Special mechanism * needed for handling in an interface context. - * + * * @author Jim Hugunin */ public class InterSuperReference extends SuperReference { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java index 1afb46a7c..5a2038f75 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -59,10 +59,10 @@ import org.aspectj.weaver.UnresolvedType; /** * An inter-type constructor declaration. - * + * * This will generate two implementation methods in the aspect, the main one for the body of the constructor, and an additional * <code>preMethod</code> for the code that runs before the super constructor is called. - * + * * @author Jim Hugunin */ public class InterTypeConstructorDeclaration extends InterTypeDeclaration { @@ -125,7 +125,7 @@ public class InterTypeConstructorDeclaration extends InterTypeDeclaration { /** * true iff constructor has @SuppressAjWarnings or @SuppressAjWarnings("xyz,noExplicitConstructorCall,def,...") - * + * * @return */ private boolean suppressingNoExplicitConstructorCall() { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java index 92455be5c..ff765515a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -57,22 +57,22 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { protected ResolvedTypeMunger munger; public int declaredModifiers; // so others can see (these differ from the modifiers in the superclass) protected char[] declaredSelector; - - /** + + /** * If targetting a generic type and wanting to use its type variables, an ITD can use an alternative name for * them. This is a list of strings representing the alternative names - the position in the list is used to * match it to the real type variable in the target generic type. */ - protected List<String> typeVariableAliases; - + protected List<String> typeVariableAliases; + protected InterTypeScope interTypeScope; - + /** * When set to true, the scope hierarchy for the field/method declaration has been correctly modified to * include an intertypescope which resolves things relative to the targetted type. */ private boolean scopeSetup = false; - + // XXXAJ5 - When the compiler is changed, these will exist somewhere in it... private final static short ACC_ANNOTATION = 0x2000; private final static short ACC_ENUM = 0x4000; @@ -88,21 +88,21 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { this.onType = onType; determineTypeVariableAliases(); } - + public void setDeclaredModifiers(int modifiers) { this.declaredModifiers = modifiers; } - + public void setSelector(char[] selector) { declaredSelector = selector; this.selector = CharOperation.concat(selector, Integer.toHexString(sourceStart).toCharArray()); this.selector = CharOperation.concat(getPrefix(),this.selector); } - + // return the selector prefix for this itd that is to be used before resolution replaces it with a "proper" name protected abstract char[] getPrefix(); - - + + public void addAtAspectJAnnotations() { if (munger == null) return; Annotation ann = AtAspectJAnnotationFactory.createITDAnnotation( @@ -117,7 +117,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { * kind is 'constructor', 'field', 'method' */ public boolean isTargetAnnotation(ClassScope classScope,String kind) { - if ((onTypeBinding.getAccessFlags() & ACC_ANNOTATION)!=0) { + if ((onTypeBinding.getAccessFlags() & ACC_ANNOTATION)!=0) { classScope.problemReporter().signalError(sourceStart,sourceEnd, "can't make inter-type "+kind+" declarations on annotation types."); ignoreFurtherInvestigation = true; @@ -125,13 +125,13 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { } return false; } - + /** * Checks that the target for the ITD is not an enum. If it is, an error message * is signaled. We return true if it is enum so the caller knows to stop processing. */ public boolean isTargetEnum(ClassScope classScope,String kind) { - if ((onTypeBinding.getAccessFlags() & ACC_ENUM)!=0) { + if ((onTypeBinding.getAccessFlags() & ACC_ENUM)!=0) { classScope.problemReporter().signalError(sourceStart,sourceEnd, "can't make inter-type "+kind+" declarations on enum types."); ignoreFurtherInvestigation = true; @@ -139,11 +139,11 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { } return false; } - + @Override public void resolve(ClassScope upperScope) { if (ignoreFurtherInvestigation) return; - + if (!scopeSetup) { interTypeScope = new InterTypeScope(upperScope, onTypeBinding,typeVariableAliases); scope.parent = interTypeScope; @@ -152,7 +152,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { } fixSuperCallsForInterfaceContext(upperScope); if (ignoreFurtherInvestigation) return; - + super.resolve((ClassScope)scope.parent);//newParent); fixSuperCallsInBody(); } @@ -161,7 +161,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { if (onTypeBinding.isInterface()) { ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.FIXING_SUPER_CALLS, selector); InterSuperFixerVisitor v = - new InterSuperFixerVisitor(this, + new InterSuperFixerVisitor(this, EclipseFactory.fromScopeLookupEnvironment(scope), scope); this.traverse(v, scope); CompilationAndWeavingContext.leavingPhase(tok); @@ -183,9 +183,9 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { protected void resolveOnType(ClassScope classScope) { checkSpec(); - + if (onType==null) return; // error reported elsewhere. - + // If they did supply a parameterized single type reference, we need to do // some extra checks... if (onType instanceof ParameterizedSingleTypeReference || onType instanceof ParameterizedQualifiedTypeReference) { @@ -209,7 +209,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { } /** - * Transform the parameterized type binding (e.g. SomeType<A,B,C>) to a + * Transform the parameterized type binding (e.g. SomeType<A,B,C>) to a * real type (e.g. SomeType). The only kind of parameterization allowed * is with type variables and those are references to type variables on * the target type. Once we have worked out the base generic type intended @@ -226,22 +226,22 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) onType; long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd; onType = new QualifiedTypeReference(pref.tokens,new long[]{pos}); - + } - - onTypeBinding = (ReferenceBinding)onType.getTypeBindingPublic(classScope); + + onTypeBinding = (ReferenceBinding)onType.getTypeBindingPublic(classScope); if (!onTypeBinding.isValidBinding()) { classScope.problemReporter().invalidType(onType, onTypeBinding); ignoreFurtherInvestigation = true; } - + if (onTypeBinding.isRawType()) { onTypeBinding = ((RawTypeBinding)onTypeBinding).type; } - + int aliasCount = (typeVariableAliases==null?0:typeVariableAliases.size()); - + // Cannot specify a parameterized target type for the ITD if the target // type is not generic. if (aliasCount!=0 && !onTypeBinding.isGenericType()) { @@ -250,7 +250,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { ignoreFurtherInvestigation = true; return; } - + // Check they have supplied the right number of type parameters on the ITD target type if (aliasCount>0) { if (onTypeBinding.typeVariables().length != aliasCount) { // typeParameters.length) { phantom contains the fake ones from the ontype, typeparameters will also include extra things if it is a generic method @@ -261,7 +261,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { return; } } - + // check if they used stupid names for type variables if (aliasCount>0) { for (int i = 0; i < aliasCount; i++) { @@ -274,7 +274,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { array_element+"' cannot be used as a type parameter, since it refers to a real type."); ignoreFurtherInvestigation = true; return; - + } } } @@ -284,12 +284,12 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { // if (targs!=null) { // for (int i = 0; i < targs.length; i++) { // TypeReference tref = targs[i]; -// typeVariableAliases.add(CharOperation.toString(tref.getTypeName()));//tVarsInGenericType[i]); +// typeVariableAliases.add(CharOperation.toString(tref.getTypeName()));//tVarsInGenericType[i]); // } // } } - - + + protected void checkSpec() { if (Modifier.isProtected(declaredModifiers)) { scope.problemReporter().signalError(sourceStart, sourceEnd, @@ -297,7 +297,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { ignoreFurtherInvestigation = true; } } - + protected List makeEffectiveSignatureAttribute( ResolvedMember sig, Shadow.Kind kind, @@ -308,13 +308,13 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { new AjAttribute.EffectiveSignatureAttribute(sig, kind, weaveBody))); return l; } - + protected void setMunger(ResolvedTypeMunger munger) { munger.getSignature().setPosition(sourceStart, sourceEnd); munger.getSignature().setSourceContext(new EclipseSourceContext(compilationResult)); this.munger = munger; } - + @Override protected int generateInfoAttributes(ClassFile classFile) { List l; @@ -330,22 +330,22 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { } protected abstract Shadow.Kind getShadowKindForBody(); - - public ResolvedMember getSignature() { + + public ResolvedMember getSignature() { if (munger==null) return null; // Can be null in an erroneous program I think - return munger.getSignature(); + return munger.getSignature(); } public char[] getDeclaredSelector() { return declaredSelector; } - + public TypeReference getOnType() { return onType; } - - /** + + /** * Create the list of aliases based on what was supplied as parameters for the ontype. * For example, if the declaration is 'List<N> SomeType<N>.foo' then the alias list * will simply contain 'N' and 'N' will mean 'the first type variable declared for @@ -372,7 +372,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { } } } - } + } /** * Called just before the compiler is going to start resolving elements of a declaration, this method @@ -384,10 +384,10 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { public void ensureScopeSetup() { if (scopeSetup) return; // don't do it again MethodScope scope = this.scope; - + TypeReference ot = onType; ReferenceBinding rb = null; - + if (ot instanceof ParameterizedQualifiedTypeReference) { // pr132349 ParameterizedQualifiedTypeReference pref = (ParameterizedQualifiedTypeReference) ot; if (pref.typeArguments!=null && pref.typeArguments.length!=0) { @@ -400,7 +400,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { if (!tb.isTypeVariable() && !(tb instanceof ProblemReferenceBinding)) { usingNonTypeVariableInITD = true; } - + } } if (usingNonTypeVariableInITD) { @@ -409,14 +409,14 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { // to prevent disgusting cascading errors after this problem - lets null out what leads to them (pr105038) this.arguments=null; this.returnType=new SingleTypeReference(TypeReference.VOID,0L); - + this.ignoreFurtherInvestigation=true; ReferenceBinding closestMatch = null; - rb = new ProblemReferenceBinding(ot.getParameterizedTypeName(),closestMatch,0); + rb = new ProblemReferenceBinding(ot.getParameterizedTypeName(),closestMatch,0); onType=null; } } - + } // Work out the real base type @@ -429,25 +429,25 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { long pos = (((long)pref.sourceStart) << 32) | pref.sourceEnd; ot = new QualifiedTypeReference(pref.tokens,new long[]{pos});//SingleTypeReference(pref.Quatoken,pos); } - + // resolve it if (rb==null) { rb = (ReferenceBinding)ot.getTypeBindingPublic(scope.parent); } - + // pr203646 - if we have ended up with the raw type, get back to the underlying generic one. if (rb.isRawType() && rb.isMemberType()) { // if the real target type used a type variable alias then we can do this OK, but need to switch things around, we want the generic type rb = ((RawTypeBinding)rb).type; } - + if (rb instanceof TypeVariableBinding) { scope.problemReporter().signalError(sourceStart,sourceEnd, "Cannot make inter-type declarations on type variables, use an interface and declare parents"); // to prevent disgusting cascading errors after this problem - lets null out what leads to them (pr105038) this.arguments=null; this.returnType=new SingleTypeReference(TypeReference.VOID,0L); - + this.ignoreFurtherInvestigation=true; ReferenceBinding closestMatch = null; if (((TypeVariableBinding)rb).firstBound!=null) { @@ -456,15 +456,15 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration { rb = new ProblemReferenceBinding(rb.compoundName,closestMatch,0); } - + // if resolution failed, give up - someone else is going to report an error if (rb instanceof ProblemReferenceBinding) return; - + interTypeScope = new InterTypeScope(scope.parent, rb, typeVariableAliases); // FIXME asc verify the choice of lines here... - // Two versions of this next line. + // Two versions of this next line. // First one tricks the JDT variable processing code so that it won't complain if - // you refer to a type variable from a static ITD - it *is* a problem and it *will* be caught, but later and + // you refer to a type variable from a static ITD - it *is* a problem and it *will* be caught, but later and // by the AJDT code so we can put out a much nicer message. scope.isStatic = (typeVariableAliases!=null?false:Modifier.isStatic(declaredModifiers)); // this is the original version in case tricking the JDT causes grief (if you reinstate this variant, you diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java index 89e066df5..be76db385 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeFieldDeclaration.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java index 70811e090..52fa2d332 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java index 6b079949d..fe95dd53e 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Andy Clement - SpringSource * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -36,7 +36,7 @@ import org.aspectj.weaver.ResolvedTypeMunger; /** * Represents an intertype member class declaration. - * + * * @author Andy Clement * @since 1.6.9 */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java index d0a61e248..4ac3ac0af 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/KnownFieldReference.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -28,18 +28,18 @@ public class KnownFieldReference extends QualifiedNameReference { this.binding = /*this.codegenBinding = */binding; this.constant = Constant.NotAConstant; this.actualReceiverType = binding.declaringClass; - + this.bits = Binding.FIELD; //this.receiver = AstUtil.makeTypeReference(binding.declaringClass); } - + //XXX handle source locations public KnownFieldReference(FieldBinding binding, long pos) { super(new char[][] {binding.name},new long[1], 0, 0); this.binding = /*this.codegenBinding = */binding; this.constant = Constant.NotAConstant; this.actualReceiverType = binding.declaringClass; - + this.bits = Binding.FIELD; //this.receiver = AstUtil.makeTypeReference(binding.declaringClass); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java index 5869d31ad..ac03aa46e 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -43,7 +43,7 @@ public class KnownMessageSend extends MessageSend { TypeBinding[] argumentTypes) { // we've already resolved this } - + public String toStringExpression() { return "KnownMessageSend"; } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java index f7fc86dac..3022dae67 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/MakeDeclsPublicVisitor.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -32,18 +32,18 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope; public class MakeDeclsPublicVisitor extends ASTVisitor { public void endVisit(ConstructorDeclaration decl, ClassScope scope) { - if (decl.binding==null) return; + if (decl.binding==null) return; decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers); } public void endVisit(FieldDeclaration decl, MethodScope scope) { - if (decl.binding==null) return; + if (decl.binding==null) return; decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers); } public void endVisit(MethodDeclaration decl, ClassScope scope) { - if (decl.binding==null) return; + if (decl.binding==null) return; decl.binding.modifiers = AstUtil.makePublic(decl.binding.modifiers); } @@ -53,7 +53,7 @@ public class MakeDeclsPublicVisitor extends ASTVisitor { public void endVisit( TypeDeclaration localTypeDeclaration, BlockScope scope) { - if (localTypeDeclaration.binding==null) return; + if (localTypeDeclaration.binding==null) return; localTypeDeclaration.binding.modifiers = AstUtil.makePublic(localTypeDeclaration.binding.modifiers); } @@ -63,7 +63,7 @@ public class MakeDeclsPublicVisitor extends ASTVisitor { public void endVisit( TypeDeclaration memberTypeDeclaration, ClassScope scope) { - if (memberTypeDeclaration.binding==null) return; + if (memberTypeDeclaration.binding==null) return; memberTypeDeclaration.binding.modifiers = AstUtil.makePublic(memberTypeDeclaration.binding.modifiers); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java index f714ffe55..d7e1423bc 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PointcutDeclaration.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -38,11 +38,11 @@ import org.aspectj.weaver.patterns.Pointcut; /** * pointcut [declaredModifiers] [declaredName]([arguments]): [pointcutDesignator]; - * + * * <p> * No method will actually be generated for this node but an attribute will be added to the enclosing class. * </p> - * + * * @author Jim Hugunin */ public class PointcutDeclaration extends AjMethodDeclaration { @@ -116,7 +116,7 @@ public class PointcutDeclaration extends AjMethodDeclaration { /** * Called from the AtAspectJVisitor to create the @Pointcut annotation (and corresponding method) for this pointcut - * + * */ public void addAtAspectJAnnotations() { String argNames = buildArgNameRepresentation(); @@ -162,7 +162,7 @@ public class PointcutDeclaration extends AjMethodDeclaration { generateSyntheticPointcutMethod = true; // mangleSelector = false; } - + private static char[] ASPECT_CHARS = "Lorg/aspectj/lang/annotation/Aspect;".toCharArray(); public void resolve(ClassScope upperScope) { @@ -171,7 +171,7 @@ public class PointcutDeclaration extends AjMethodDeclaration { if (binding != null) { binding.tagBits -= TagBits.AnnotationResolved; resolveAnnotations(scope, this.annotations, this.binding); - + TypeDeclaration typeDec = upperScope.referenceContext; if (Modifier.isAbstract(this.declaredModifiers)) { if (!(typeDec instanceof AspectDeclaration)) { @@ -179,7 +179,7 @@ public class PointcutDeclaration extends AjMethodDeclaration { typeDec.scope.problemReporter().signalError(sourceStart, sourceEnd, "The abstract pointcut " + new String(declaredName) + " can only be defined in an aspect"); ignoreFurtherInvestigation = true; - return; + return; } } } @@ -221,7 +221,7 @@ public class PointcutDeclaration extends AjMethodDeclaration { return resolvedPointcutDeclaration; if (binding == null) { // other errors exist that will be reported separately - return null; + return null; } // System.out.println("pc: " + getPointcut() + ", " + getPointcut().state); ReferenceBinding declaringClass = binding.declaringClass; @@ -285,7 +285,7 @@ public class PointcutDeclaration extends AjMethodDeclaration { /* * (non-Javadoc) - * + * * @see org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration#printBody(int, java.lang.StringBuffer) */ public StringBuffer printBody(int indent, StringBuffer output) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PointcutDesignator.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PointcutDesignator.java index d9e6094fa..1a46cb9a0 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PointcutDesignator.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PointcutDesignator.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -112,7 +112,7 @@ public class PointcutDesignator extends ASTNode { /* * (non-Javadoc) - * + * * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer) */ public StringBuffer print(int indent, StringBuffer output) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/Proceed.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/Proceed.java index 743e8c204..c81eab22b 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/Proceed.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/Proceed.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 2002-2014 Palo Alto Research Center, Incorporated (PARC) + * Copyright (c) 2002-2014 Palo Alto Research Center, Incorporated (PARC) * and 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * PARC initial implementation - * IBM ongoing maintenance + * IBM ongoing maintenance * ******************************************************************/ @@ -30,18 +30,18 @@ import org.aspectj.weaver.AdviceKind; /** * Used to represent any method call to a method named <code>proceed</code>. During * <code>resolvedType</code> it will be determined if this is actually in the body - * of an <code>around</code> advice and has no receiver (must be a bare proceed call, + * of an <code>around</code> advice and has no receiver (must be a bare proceed call, * see pr 53981), and if not this will be treated like any other * MessageSend. - * + * * @author Jim Hugunin */ public class Proceed extends MessageSend { public boolean inInner = false; - + public Proceed(MessageSend parent) { super(); - + this.receiver = parent.receiver; this.selector = parent.selector; this.arguments = parent.arguments; @@ -53,11 +53,11 @@ public class Proceed extends MessageSend { this.nameSourcePosition = parent.nameSourcePosition; this.actualReceiverType = parent.actualReceiverType; //this.qualifyingType = parent.qualifyingType; - + this.valueCast = parent.valueCast; this.typeArguments = parent.typeArguments; this.genericTypeArguments = parent.genericTypeArguments; - + this.sourceStart = parent.sourceStart; this.sourceEnd = parent.sourceEnd; } @@ -66,16 +66,16 @@ public class Proceed extends MessageSend { // find out if I'm really in an around body or not //??? this could in theory be done by the parser, but that appears to be hard AdviceDeclaration aroundDecl = findEnclosingAround(scope); - + if (aroundDecl == null) { return super.resolveType(scope); } - + constant = Constant.NotAConstant; binding =/* codegenBinding = */aroundDecl.proceedMethodBinding; - + this.actualReceiverType = binding.declaringClass; - + int baseArgCount = 0; if (arguments != null) { baseArgCount = arguments.length; @@ -85,19 +85,19 @@ public class Proceed extends MessageSend { } else { arguments = new Expression[1]; } - + arguments[baseArgCount] = AstUtil.makeLocalVariableReference(aroundDecl.extraArgument.binding); - + int declaredParameterCount = aroundDecl.getDeclaredParameterCount(); if (baseArgCount < declaredParameterCount) { - scope.problemReporter().signalError(this.sourceStart, this.sourceEnd, + scope.problemReporter().signalError(this.sourceStart, this.sourceEnd, "too few arguments to proceed, expected " + declaredParameterCount); aroundDecl.ignoreFurtherInvestigation = true; return null; //binding.returnType; } - + if (baseArgCount > declaredParameterCount) { - scope.problemReporter().signalError(this.sourceStart, this.sourceEnd, + scope.problemReporter().signalError(this.sourceStart, this.sourceEnd, "too many arguments to proceed, expected " + declaredParameterCount); aroundDecl.ignoreFurtherInvestigation = true; return null; //binding.returnType; @@ -110,7 +110,7 @@ public class Proceed extends MessageSend { } // TypeBinding[] argumentTypes = Binding.NO_PARAMETERS; // if (this.arguments != null) { -// boolean argHasError = false; // typeChecks all arguments +// boolean argHasError = false; // typeChecks all arguments // int length = this.arguments.length; // argumentTypes = new TypeBinding[length]; // for (int i = 0; i < length; i++){ @@ -129,7 +129,7 @@ public class Proceed extends MessageSend { // TypeBinding[] pseudoArgs = new TypeBinding[length]; // for (int i = length; --i >= 0;) // pseudoArgs[i] = argumentTypes[i] == null ? TypeBinding.NULL : argumentTypes[i]; // replace args with errors with null type -// this.binding = +// this.binding = // this.receiver.isImplicitThis() // ? scope.getImplicitMethod(this.selector, pseudoArgs, this) // : scope.findMethod((ReferenceBinding) this.actualReceiverType, this.selector, pseudoArgs, this); @@ -178,7 +178,7 @@ public class Proceed extends MessageSend { private AdviceDeclaration findEnclosingAround(Scope scope) { if (scope == null) return null; - + if (scope instanceof MethodScope) { MethodScope methodScope = (MethodScope)scope; ReferenceContext context = methodScope.referenceContext; @@ -196,7 +196,7 @@ public class Proceed extends MessageSend { } else if (scope instanceof ClassScope) { inInner = true; } - + return findEnclosingAround(scope.parent); } } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java index d633ebba2..d90feb773 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ProceedVisitor.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -42,19 +42,19 @@ public class ProceedVisitor extends ASTVisitor { LocalVariableBinding thisJoinPointDec; LocalVariableBinding thisJoinPointStaticPartDec; LocalVariableBinding thisEnclosingJoinPointStaticPartDec; - + LocalVariableBinding thisJoinPointDecLocal; LocalVariableBinding thisJoinPointStaticPartDecLocal; LocalVariableBinding thisEnclosingJoinPointStaticPartDecLocal; boolean replaceEffectivelyStaticRefs = false; - + AbstractMethodDeclaration method; ProceedVisitor(AbstractMethodDeclaration method) { this.method = method; int index = method.arguments.length - 3; - + thisJoinPointStaticPartDecLocal = method.scope.locals[index]; thisJoinPointStaticPartDec = method.arguments[index++].binding; thisJoinPointDecLocal = method.scope.locals[index]; @@ -176,30 +176,30 @@ public class ProceedVisitor extends ASTVisitor { public int removeUnusedExtraArguments() { int extraArgumentFlags = 0; - + this.computeJoinPointParams(); MethodBinding binding = method.binding; - - + + int index = binding.parameters.length - 3; if (needsStaticEnclosing) { extraArgumentFlags |= Advice.ThisEnclosingJoinPointStaticPart; } else { removeParameter(index+2); } - + if (needsDynamic) { extraArgumentFlags |= Advice.ThisJoinPoint; } else { removeParameter(index+1); } - + if (needsStatic) { extraArgumentFlags |= Advice.ThisJoinPointStaticPart; } else { removeParameter(index+0); } - + return extraArgumentFlags; } @@ -209,7 +209,7 @@ public class ProceedVisitor extends ASTVisitor { method.binding.parameters = removeParameter(indexToRemove, method.binding.parameters); } - + private static TypeBinding[] removeParameter(int index, TypeBinding[] bindings) { int len = bindings.length; TypeBinding[] ret = new TypeBinding[len-1]; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoToken.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoToken.java index ac679ad1a..3b3a61bd8 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoToken.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoToken.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -52,34 +52,34 @@ public class PseudoToken extends ASTNode implements IToken { public boolean isIdentifier() { return isIdentifier; } - + /** * returns null if this isn't a literal */ public String getLiteralKind() { return literalKind; } - + public Pointcut maybeGetParsedPointcut() { return null; } - - + + public int getStart() { return sourceStart; } - + /** - * + * */ public int getEnd() { return sourceEnd; } - + public String getFileName() { return "unknown"; } - + public int postParse(TypeDeclaration typeDec, MethodDeclaration enclosingDec, int tokenNumber) { // nothing to do typically return 0; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java index 8e0f2a635..5cd976441 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -35,7 +35,7 @@ public class PseudoTokens extends ASTNode { BasicTokenSource tokenSource; PseudoToken[] tokens; //XXX this is redundant with the field above String endToken; - + public PseudoTokens(PseudoToken[] tokens, ISourceContext sourceContext) { super(); @@ -45,7 +45,7 @@ public class PseudoTokens extends ASTNode { sourceStart = tokens[0].sourceStart; sourceEnd = tokens[tokens.length-2].sourceEnd; } - + public Pointcut parsePointcut(Parser parser) { PatternParser patternParser = new PatternParser(tokenSource); try { @@ -69,7 +69,7 @@ public class PseudoTokens extends ASTNode { } } - + private void reportError(Parser parser, ParserException pe) { IHasPosition tok = pe.getLocation(); int start, end; @@ -84,15 +84,15 @@ public class PseudoTokens extends ASTNode { if (tok instanceof IToken) { found = ((IToken)tok).getString(); } - + parser.problemReporter().parseError(start, end, TerminalTokens.TokenNameIdentifier, found.toCharArray(), found, new String[] {pe.getMessage()}); } - - + + public TypePattern maybeParseDominatesPattern(Parser parser) { PatternParser patternParser = new PatternParser(tokenSource); try { @@ -106,9 +106,9 @@ public class PseudoTokens extends ASTNode { reportError(parser, pe); return null; } - } - - + } + + public PerClause parsePerClause(Parser parser) { PatternParser patternParser = new PatternParser(tokenSource); try { @@ -120,13 +120,13 @@ public class PseudoTokens extends ASTNode { reportError(parser, pe); return new PerSingleton(); } - + } - - + + // public TypePattern parseTypePattern(Parser parser) { // } -// +// public Declare parseDeclare(Parser parser) { PatternParser patternParser = new PatternParser(tokenSource); try { @@ -138,7 +138,7 @@ public class PseudoTokens extends ASTNode { return null; } } - + public Declare parseAnnotationDeclare(Parser parser) { PatternParser patternParser = new PatternParser(tokenSource); try { @@ -149,15 +149,15 @@ public class PseudoTokens extends ASTNode { reportError(parser, pe); return null; } } - - + + public void postParse(TypeDeclaration typeDec, MethodDeclaration enclosingDec) { int counter = 0; // Counter can be used by postParse as a value to compute uniqueness (if required) for (PseudoToken token : tokens) { counter += token.postParse(typeDec, enclosingDec, counter); } } - + /* (non-Javadoc) * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer) */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java index 79f31f94e..470a617c6 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -54,7 +54,7 @@ public class SuperFixerVisitor extends ASTVisitor { this.method = method; this.targetClass = targetClass; } - + private static final char[] ctor = "<init>".toCharArray(); public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java index 994be09f3..b1189d9dc 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java index 6698787f0..cbac1619c 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 IBM Corporation Ltd - * 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: - * Adrian Colyer initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Adrian Colyer initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.ast; @@ -361,7 +361,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { /** * Get the argument names as a string list - * + * * @param arguments * @return argument names (possibly empty) */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java index beea71dc9..19e39b07a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; @@ -121,7 +121,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC INameEnvironment nameEnvironment) { super(typeRequestor, options, problemReporter, nameEnvironment); } - + public AjLookupEnvironment(LookupEnvironment env, ModuleBinding moduleBinding) { super(env, moduleBinding); } @@ -1485,7 +1485,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC this.factory.cleanup(); super.reset(); } - + @Override public LookupEnvironment wrapInModuleEnvironment(ModuleBinding moduleBinding) { AjLookupEnvironment newAjLookupEnvironment = new AjLookupEnvironment(this, moduleBinding); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjTypeConstants.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjTypeConstants.java index 347a6431b..ea44e4657 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjTypeConstants.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjTypeConstants.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -27,24 +27,24 @@ public class AjTypeConstants { public static final char[] RUNTIME = "runtime".toCharArray(); public static final char[] LANG = "lang".toCharArray(); public static final char[] INTERNAL = "internal".toCharArray(); - + // Constant compound names public static final char[][] ORG_ASPECTJ_LANG_JOINPOINT = new char[][] {ORG, ASPECTJ, LANG, "JoinPoint".toCharArray()}; - + public static final char[][] ORG_ASPECTJ_LANG_JOINPOINT_STATICPART = new char[][] {ORG, ASPECTJ, LANG, "JoinPoint".toCharArray(), "StaticPart".toCharArray()}; - + public static final char[][] ORG_ASPECTJ_RUNTIME_INTERNAL_AROUNDCLOSURE = new char[][] {ORG, ASPECTJ, RUNTIME, INTERNAL, "AroundClosure".toCharArray()}; - + public static final char[][] ORG_ASPECTJ_RUNTIME_INTERNAL_CONVERSIONS = new char[][] {ORG, ASPECTJ, RUNTIME, INTERNAL, "Conversions".toCharArray()}; - + public static TypeReference getJoinPointType() { return new QualifiedTypeReference(ORG_ASPECTJ_LANG_JOINPOINT, new long[10]); } - + public static TypeReference getJoinPointStaticPartType() { return new QualifiedTypeReference(ORG_ASPECTJ_LANG_JOINPOINT_STATICPART, new long[10]); } @@ -63,7 +63,7 @@ public class AjTypeConstants { String name = new String(fromType.sourceName()) + "Object"; return getConversionsType(scope).getMethods(name.toCharArray())[0]; } - + public static MethodBinding getConversionMethodFromObject(Scope scope, TypeBinding toType) { String name = new String(toType.sourceName()) + "Value"; return getConversionsType(scope).getMethods(name.toCharArray())[0]; 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 93a5019f3..a4547d0b6 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 @@ -2,9 +2,9 @@ * Copyright (c) 2006 Contributors * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Andy Clement initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index a990767af..5f8b1f2f7 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -1,14 +1,14 @@ /* ******************************************************************* * 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 - * Mik Kersten 2004-07-26 extended to allow overloading of + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation + * Mik Kersten 2004-07-26 extended to allow overloading of * hierarchy builder * ******************************************************************/ @@ -142,7 +142,7 @@ public class EclipseFactory { if (binding == null) { return ResolvedType.MISSING; } - // ??? this seems terribly inefficient + // ??? this seems terribly inefficient // System.err.println("resolving: " + binding.getClass() + ", name = " + getName(binding)); ResolvedType ret = getWorld().resolve(fromBinding(binding)); // System.err.println(" got: " + ret); @@ -195,7 +195,7 @@ public class EclipseFactory { /** * Some generics notes: - * + * * Andy 6-May-05 We were having trouble with parameterized types in a couple of places - due to TypeVariableBindings. When we * see a TypeVariableBinding now we default to either the firstBound if it is specified or java.lang.Object. Not sure when/if * this gets us unstuck? It does mean we forget that it is a type variable when going back the other way from the UnresolvedType @@ -280,7 +280,7 @@ public class EclipseFactory { // baseTypeSignature = ttt.getSignature(); // baseTypeSignature= baseTypeSignature.substring(0,baseTypeSignature.length()-1); // baseTypeSignature = baseTypeSignature + "."+new String(ptb.sourceName)+";"; -// } else { +// } else { baseTypeSignature = baseType.getErasureSignature(); // } } else { @@ -936,14 +936,14 @@ public class EclipseFactory { // If there are aliases, place them in the map if (aliases != null && aliases.size() != 0 - + // Not sure what this check is trying to check for? // In latest JDT (2-Feb-2018) there seem to be some code (in LookupEnvironment ~860 and // TypeSystem ~340) related to avoiding raw'ifying the enclosing type if the type to // be rawed is static. These changes cause these checks to fail and the sophisticated // test variant V fails. It checks declaring type typevariables and then // uses aliasTargetType ... I'm switching it to check aliasTargetType - + // && declaringType.typeVariables() != null // && declaringType.typeVariables().length != 0 && aliasTargetType != null @@ -1104,7 +1104,7 @@ public class EclipseFactory { UnresolvedType ut = fromBinding(binding); typexToBinding.put(ut, binding); ReferenceType rt = world.lookupOrCreateName(ut); - // Ensure a delegate is set (#558995) + // Ensure a delegate is set (#558995) // TODO the delegate is perhaps not 100% ideal as the decl is the aspect? TypeDeclaration decl = binding.scope.referenceContext; CompilationUnitDeclaration referenceCompilationUnit = binding.scope.referenceCompilationUnit(); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java index b4330978d..34d8d13c1 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java @@ -2,9 +2,9 @@ * Copyright (c) 2006 Contributors * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Andy Clement initial implementation @@ -313,7 +313,7 @@ public class EclipseResolvedMember extends ResolvedMemberImpl { /** * Discover the (eclipse form) annotations on this resolved member. This is done by going to the type declaration, looking up * the member (field/method) then grabbing the annotations. - * + * * @return an array of (eclipse form) annotations on this member */ private Annotation[] getEclipseAnnotations() { @@ -430,7 +430,7 @@ public class EclipseResolvedMember extends ResolvedMemberImpl { /** * Return true if this is the default constructor. The default constructor is the one generated if there isn't one in the * source. Eclipse helpfully uses a bit to indicate the default constructor. - * + * * @return true if this is the default constructor. */ public boolean isDefaultConstructor() { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java index 74805b9c6..9f1af6a04 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseScope.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; @@ -37,7 +37,7 @@ import org.aspectj.weaver.patterns.WildTypePattern; /** * Adaptor from org.eclipse.jdt.internal.compiler.lookup.Scope to * org.aspectj.weaver.IScope - * + * * @author Jim Hugunin */ public class EclipseScope implements IScope { @@ -92,10 +92,10 @@ public class EclipseScope implements IScope { /* * computeImports(); - * + * * // System.out.println("lookup: " + name + " in " + // * Arrays.asList(importedPrefixes)); - * + * * ResolvedType ret = null; String dotName = "." + name; for (int i=0; * i<importedNames.length; i++) { String importedName = * importedNames[i]; //??? can this be right if @@ -106,15 +106,15 @@ public class EclipseScope implements IScope { * message(IMessage.ERROR, location, "ambiguous type reference, both " + * ret.getName() + " and " + importedName); return ResolvedType.MISSING; * } else { ret = found; } } } - * + * * if (ret != null) return ret; - * + * * //XXX need to handle ambiguous references here for (int i=0; * i<importedPrefixes.length; i++) { String importedPrefix = * importedPrefixes[i]; ResolvedType tryType = * resolveVisible(importedPrefix + name); if (tryType != * ResolvedType.MISSING) { return tryType; } } - * + * * return resolveVisible(name); */ } @@ -136,8 +136,8 @@ public class EclipseScope implements IScope { // } else { // binding = scope.getType(namePieces); // } - // - // + // + // // if (!binding.isValidBinding()) { // //XXX do we do this always or sometimes // System.err.println("error: " + binding); @@ -149,7 +149,7 @@ public class EclipseScope implements IScope { // // if (AstNode.isTypeUseDeprecated(binding, scope)) // // scope.problemReporter().deprecatedType(binding, // EclipseWorld.astForLocation(location)); - // + // // return EclipseWorld.fromBinding(binding); // } @@ -297,7 +297,7 @@ public class EclipseScope implements IScope { * resolved against import statements. They won't be if javac is used (and * the resulting .class file will contain 'bad pointcuts') so this method * enables it to also be policed when compiling with ajc. - * + * * @param validPackage unqualified references can be resolved if the type is * in the same package as the type containing the pointcut * declaration. diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java index e4de168e0..210c93b18 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; @@ -38,7 +38,7 @@ import org.aspectj.weaver.ast.Var; /** * This is only used for declare soft right now. - * + * * It might be used for other compile-time matching, but in all such cases this and target pcds can't be used. We might not behave * correctly in such cases. */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java index b1c9c2108..50f91611c 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceLocation.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -24,7 +24,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util; public class EclipseSourceLocation implements ISourceLocation { private static String NO_CONTEXT = "USE_NULL--NO_CONTEXT_AVAILABLE"; - CompilationResult result; + CompilationResult result; // EclipseSourceContext eclipseContext; int startPos, endPos; String filename; @@ -34,7 +34,7 @@ public class EclipseSourceLocation implements ISourceLocation { int endLine = -1; int column = -1; String context; - + public EclipseSourceLocation(CompilationResult result, int startPos, int endPos) { super(); this.result = result; @@ -42,19 +42,19 @@ public class EclipseSourceLocation implements ISourceLocation { this.startPos = startPos; this.endPos = endPos; } - + public CompilationResult getCompilationResult() { return result; } - + public int getOffset() { return startPos; } - + public int getStartPos() { return startPos; } - + public int getEndPos() { return endPos; } @@ -62,12 +62,12 @@ public class EclipseSourceLocation implements ISourceLocation { public File getSourceFile() { if (null == file) { if (filename==null) { -// if ((null == result) +// if ((null == result) // || (null == result.fileName) // || (0 == result.fileName.length)) { file = ISourceLocation.NO_FILE; } else { - file = new File(filename);//new String(result.fileName)); + file = new File(filename);//new String(result.fileName)); } } return file; @@ -87,7 +87,7 @@ public class EclipseSourceLocation implements ISourceLocation { if (0 < lineNumber && lineNumber < result.lineSeparatorPositions.length) { int lineStart = result.lineSeparatorPositions[lineNumber]; int col = startPos - lineStart; // 1-based - if (0 <= col) { + if (0 <= col) { column = col; } else { column = 0; @@ -105,7 +105,7 @@ public class EclipseSourceLocation implements ISourceLocation { } return endLine; } - + public String getContext() { if (null == context) { ICompilationUnit compilationUnit = result.compilationUnit; @@ -119,12 +119,12 @@ public class EclipseSourceLocation implements ISourceLocation { } return (NO_CONTEXT == context ? null : context); } - - + + /** @return String {file:}line{:column} */ public String toString() { StringBuffer sb = new StringBuffer(); - + if (getSourceFile() != ISourceLocation.NO_FILE) { sb.append(getSourceFile().getPath()); sb.append(":"); @@ -136,7 +136,7 @@ public class EclipseSourceLocation implements ISourceLocation { if (getOffset()>=0) { sb.append("::").append(getOffset()); } return sb.toString(); } - + private volatile int hashCode = -1; public int hashCode() { if (hashCode == -1) { @@ -145,15 +145,15 @@ public class EclipseSourceLocation implements ISourceLocation { result = 37*result + getLine(); result = 37*result + getOffset(); result = 37*result + (filename==null?0:filename.hashCode()); - hashCode = result; + hashCode = result; } return hashCode; } - + public boolean equals(Object other) { if (! (other instanceof EclipseSourceLocation)) return super.equals(other); EclipseSourceLocation o = (EclipseSourceLocation) other; - return + return getLine()==o.getLine() && getOffset()==o.getOffset() && ((filename==null)?(o.filename==null):o.filename.equals(filename)); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java index 4731a86ed..49c80e318 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java @@ -2,9 +2,9 @@ * Copyright (c) 2002,2010 Contributors * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation @@ -90,7 +90,7 @@ import org.aspectj.weaver.patterns.Pointcut; /** * Supports viewing eclipse TypeDeclarations/SourceTypeBindings as a ResolvedType - * + * * @author Jim Hugunin * @author Andy Clement */ @@ -322,7 +322,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { } } } - + if (isEnum()) { // The bindings for the eclipse binding will include values/valueof for (MethodBinding mb : ms) { @@ -353,11 +353,11 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { this.declaredMethods = declaredMethods.toArray(new ResolvedMember[0]); this.declaredFields = declaredFields.toArray(new ResolvedMember[0]); } - + private final static char[] valuesCharArray = "values".toCharArray(); private final static char[] valueOfCharArray = "valueOf".toCharArray(); private final static char[] jlString = "Ljava/lang/String;".toCharArray(); - + private ResolvedPointcutDefinition makeResolvedPointcutDefinition(AbstractMethodDeclaration md) { if (md.binding == null) { @@ -684,12 +684,12 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { /** * WARNING: This method does not have a complete implementation. - * + * * The aim is that it converts Eclipse annotation objects to the AspectJ form of annotations (the type AnnotationAJ). The * AnnotationX objects returned are wrappers over either a Bcel annotation type or the AspectJ AnnotationAJ type. The minimal * implementation provided here is for processing the RetentionPolicy and Target annotation types - these are the only ones * which the weaver will attempt to process from an EclipseSourceType. - * + * * More notes: The pipeline has required us to implement this. With the pipeline we can be weaving a type and asking questions * of annotations before they have been turned into Bcel objects - ie. when they are still in EclipseSourceType form. Without * the pipeline we would have converted everything to Bcel objects before proceeding with weaving. Because the pipeline won't @@ -718,7 +718,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { } return annotations; } - + @Override public boolean hasAnnotations() { return (declaration.annotations != null && declaration.annotations.length != 0); @@ -726,7 +726,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { /** * 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. @@ -750,7 +750,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { /** * Use the information in the supplied eclipse based annotation to fill in the standard annotation. - * + * * @param annotation eclipse based annotation representation * @param annotationAJ AspectJ based annotation representation */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java index 0a26fafd9..9e334d57b 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; @@ -147,7 +147,7 @@ public class EclipseTypeMunger extends ConcreteTypeMunger { // If sourceType is a BinaryTypeBinding, this can indicate we are re-applying the ITDs to the target // as we 'pull it in' to resolve something. This means the clash here is with itself ! So if the ITD // was final when initially added to the target this error logic will trigger. We can't easily - // identify it was added via ITD, so I'm going to make this quick change to say avoid this error for + // identify it was added via ITD, so I'm going to make this quick change to say avoid this error for // BinaryTypeBindings CompilationUnitScope cuScope = sourceType.scope.compilationUnitScope(); MethodBinding offendingBinding = sourceType.getExactMethod(binding.selector, binding.parameters, cuScope); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java index e8423c2a4..e8cd45c28 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/HelperInterfaceBinding.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InlineAccessFieldBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InlineAccessFieldBinding.java index afdd460b0..b7d54700f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InlineAccessFieldBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InlineAccessFieldBinding.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -28,19 +28,19 @@ import org.aspectj.weaver.ResolvedMember; * Used for field references within the body of an around advice * to force the use of public access methods. This makes it possible * for around advice to be inlined into any shadow to which it applies. - * + * * ??? this is very similar to PrivilegedFieldBinding and is somewhat related * to InterTypeFieldBinding. Maybe they have a common supertype? - * + * * @author Jim Hugunin */ public class InlineAccessFieldBinding extends FieldBinding { public SimpleSyntheticAccessMethodBinding reader; public SimpleSyntheticAccessMethodBinding writer; - - + + public FieldBinding baseField; - + public InlineAccessFieldBinding(AspectDeclaration inAspect, FieldBinding baseField, ResolvedMember resolvedField) { super(baseField, baseField.declaringClass); @@ -53,7 +53,7 @@ public class InlineAccessFieldBinding extends FieldBinding { AjcMemberMaker.inlineAccessMethodForFieldSet( inAspect.typeX, resolvedField ))); - + this.constant = Constant.NotAConstant; this.baseField = baseField; } @@ -67,7 +67,7 @@ public class InlineAccessFieldBinding extends FieldBinding { if (isReadAccess) return reader; else return writer; } - + public boolean alwaysNeedsAccessMethod(boolean isReadAccess) { return true; } public FieldBinding getFieldBindingForLookup() { return baseField; } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeFieldBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeFieldBinding.java index b47978f62..58ee0760c 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeFieldBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeFieldBinding.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java index 1953265c8..b998b78f8 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002,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://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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * Andy Clement - upgrade to support fields targetting generic types * ******************************************************************/ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMethodBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMethodBinding.java index 213c41d40..c5b0f50cd 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMethodBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMethodBinding.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; @@ -104,7 +104,7 @@ public class InterTypeMethodBinding extends MethodBinding { // it is a privileged aspect return true; } - + if (isProtected()) { throw new RuntimeException("unimplemented"); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java index 7f78e0bea..017ba6682 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java index 3ee6368e5..4d73f3cc9 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java @@ -1,11 +1,11 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Andy Clement - SpringSource * ******************************************************************/ @@ -22,7 +22,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; /** * The member finder looks after intertype declared inner classes on a type, there is one member finder per type that was hit by an * new inner type declaration. - * + * * @author Andy Clement * @since 1.6.9 */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PointcutBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PointcutBinding.java index 02225618a..5e32a0511 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PointcutBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PointcutBinding.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java index 5cd04f6d2..05afd1931 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedFieldBinding.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java index 0885475b3..163681fde 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java index 2730b5b58..66e94b0c5 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PushinCollector.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2010 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Andy Clement - SpringSource * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.lookup; @@ -42,7 +42,7 @@ import org.aspectj.weaver.patterns.TypePattern; * <li>itd ctor * <li>declare parents * </ul> - * + * * @author Andy Clement * @since 1.6.9 */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/SimpleSyntheticAccessMethodBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/SimpleSyntheticAccessMethodBinding.java index b8fcfc3da..3f1c89019 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/SimpleSyntheticAccessMethodBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/SimpleSyntheticAccessMethodBinding.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -25,7 +25,7 @@ public class SimpleSyntheticAccessMethodBinding extends SyntheticMethodBinding { // this.parameters = method.parameters; // this.returnType = method.returnType; // } - + public SimpleSyntheticAccessMethodBinding(MethodBinding binding) { super(binding); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/parser/DeclarationFactory.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/parser/DeclarationFactory.java index 5cc6bd37c..31890fcdb 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/parser/DeclarationFactory.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/parser/DeclarationFactory.java @@ -1,14 +1,14 @@ /******************************************************************************* * Copyright (c) 2002,2003 Palo Alto Research Center, Incorporated (PARC). * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: - * PARC initial implementation - * IBM Corporation + * PARC initial implementation + * IBM Corporation *******************************************************************************/ package org.aspectj.ajdt.internal.compiler.parser; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java index f563d913b..69170118b 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.problem; @@ -78,7 +78,7 @@ import org.aspectj.weaver.patterns.TypePattern; * Extends problem reporter to support compiler-side implementation of declare soft. Also overrides error reporting for the need to * implement abstract methods to account for inter-type declarations and pointcut declarations. This second job might be better done * directly in the SourceTypeBinding/ClassScope classes. - * + * * @author Jim Hugunin */ public class AjProblemReporter extends ProblemReporter { @@ -144,7 +144,7 @@ public class AjProblemReporter extends ProblemReporter { super.unhandledException(exceptionType, location); } - + public void unhandledExceptionFromAutoClose(TypeBinding exceptionType, ASTNode location) { if (!factory.getWorld().getDeclareSoft().isEmpty()) { Shadow callSite = factory.makeShadow(location, referenceContext); @@ -312,7 +312,7 @@ public class AjProblemReporter extends ProblemReporter { /* * (non-Javadoc) - * + * * @see * org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter#disallowedTargetForAnnotation(org.aspectj.org.eclipse * .jdt.internal.compiler.ast.Annotation) @@ -364,7 +364,7 @@ public class AjProblemReporter extends ProblemReporter { if (severity != ProblemSeverities.Ignore && DUMP_STACK) { Thread.dumpStack(); } - super.handle(problemId, problemArguments, + super.handle(problemId, problemArguments, 0, // no message elaboration messageArguments, severity, problemStartPosition, problemEndPosition, referenceContext, unitResult); @@ -506,7 +506,7 @@ public class AjProblemReporter extends ProblemReporter { } super.unusedPrivateType(typeDecl); } - + private final static char[] thisJoinPointName = "thisJoinPoint".toCharArray(); private final static char[] thisJoinPointStaticPartName = "thisJoinPointStaticPart".toCharArray(); private final static char[] thisEnclosingJoinPointStaticPartName = "thisEnclosingJoinPointStaticPart".toCharArray(); @@ -516,22 +516,22 @@ public class AjProblemReporter extends ProblemReporter { public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode location, Scope scope) { if (CharOperation.equals(binding.name, thisJoinPointName) || CharOperation.equals(binding.name, thisJoinPointStaticPartName) || - CharOperation.equals(binding.name, thisAspectInstanceName) || + CharOperation.equals(binding.name, thisAspectInstanceName) || CharOperation.equals(binding.name, thisEnclosingJoinPointStaticPartName)) { // If in advice, this is not a problem if (binding.declaringScope!=null && (binding.declaringScope.referenceContext() instanceof AdviceDeclaration || binding.declaringScope.referenceContext() instanceof IfMethodDeclaration)) { return; } - } + } super.uninitializedLocalVariable(binding, location, scope); } - + public void abstractMethodInConcreteClass(SourceTypeBinding type) { if (type.scope!=null && type.scope.referenceContext instanceof AspectDeclaration) { // TODO could put out an Aspect specific message here return; - } + } super.abstractMethodInConcreteClass(type); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AbstractStateListener.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AbstractStateListener.java index 6b1115b65..961c6cbde 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AbstractStateListener.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AbstractStateListener.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2005 IBM and other 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://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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.core.builder; @@ -16,7 +16,7 @@ import java.util.List; /** * Subtypes can override whatever they want... - * + * * @author AndyClement * */ @@ -31,9 +31,9 @@ public abstract class AbstractStateListener implements IStateListener { public void detectedAspectDeleted(File f) { } public void buildSuccessful(boolean wasFullBuild) { } - + public void recordDecision(String decision) {} - + public void recordInformation(String info) {} } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBatchImageBuilder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBatchImageBuilder.java index ce61a4704..8f49a0b9a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBatchImageBuilder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBatchImageBuilder.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -21,11 +21,11 @@ import org.aspectj.org.eclipse.jdt.internal.core.builder.SourceFile; * BatchImageBuilder used by IDEs (AJDT) */ public class AjBatchImageBuilder extends BatchImageBuilder { - + public AjBatchImageBuilder(AspectJBuilder builder) { super(builder, true, CompilationGroup.MAIN); } - + @Override public void acceptResult(CompilationResult result) { if ((result.getCompilationUnit() != null) && (result.getCompilationUnit() instanceof SourceFile)) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java index 9f497df36..0b2ab939f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java @@ -1,17 +1,17 @@ /* ******************************************************************* * Copyright (c) 2002 - 2018 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://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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * Adrian Colyer added constructor to populate javaOptions with * default settings - 01.20.2003 * Bugzilla #29768, 29769 - * Andy Clement + * Andy Clement * ******************************************************************/ package org.aspectj.ajdt.internal.core.builder; @@ -41,9 +41,9 @@ import org.aspectj.util.FileUtil; * an AjCompilerOptions instance */ public class AjBuildConfig implements CompilerConfigurationChangeFlags { - + public static final Classpath[] NO_CHECKED_CLASSPATHS = new Classpath[0]; - + private boolean shouldProceed = true; public static final String AJLINT_IGNORE = "ignore"; @@ -156,22 +156,22 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { public List<File> getXmlFiles() { return xmlfiles; } - + public void setProcessor(String processor) { this.processor = processor; } - + /** * @return the list of processor classes to execute */ public String getProcessor() { return this.processor; } - + public void setProcessorPath(String processorPath) { this.processorPath = processorPath; } - + /** * @return the processor path which can be searched for processors (via META-INF/services) */ @@ -230,7 +230,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { public List<String> getModulepath() { return modulepath; } - + public List<String> getModulesourcepath() { return modulesourcepath; } @@ -246,10 +246,10 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { } public void setCheckedClasspaths(Classpath[] checkedClasspaths) { - this.checkedClasspaths = checkedClasspaths; + this.checkedClasspaths = checkedClasspaths; checkedClasspaths = null; } - + private List<Classpath> processFilePath(List<File> path, java.lang.String encoding) { List<Classpath> entries = new ArrayList<>(); for (File file: path) { @@ -414,7 +414,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { this.aspectpath = aspectpath; checkedClasspaths = null; } - + public void addToAspectpath(File file) { this.aspectpath.add(file); checkedClasspaths = null; @@ -847,7 +847,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { public void setProjectEncoding(String projectEncoding) { options.defaultEncoding = projectEncoding; } - + public String getProjectEncoding() { return options.defaultEncoding; } @@ -921,19 +921,19 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { // This is similar to the calculation done in Main.setPaths() but it isn't as sophisticated // as that one (doesn't need to be) and it also considers the additional paths for an // AspectJ project (aspectpath/inpath/injars) - private void computeCheckedClasspath() { + private void computeCheckedClasspath() { // Follow what we do in getFullClasspath(): // bootclasspath, injars, inpath, aspectpath, classpath, modulepath String encoding = getProjectEncoding(); // What to do about bootclasspath on java 9? - + // ArrayList<Classpath> allPaths = handleBootclasspath(bootclasspaths, customEncoding); ArrayList<FileSystem.Classpath> allPaths = new ArrayList<>(); allPaths.addAll(processStringPath(bootclasspath, encoding)); allPaths.addAll(processFilePath(inJars, encoding)); - allPaths.addAll(processFilePath(inPath, encoding)); - allPaths.addAll(processFilePath(aspectpath, encoding)); + allPaths.addAll(processFilePath(inPath, encoding)); + allPaths.addAll(processFilePath(aspectpath, encoding)); if (modulepathClasspathEntries != null) { allPaths.addAll(modulepathClasspathEntries); } @@ -958,5 +958,5 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { } } } - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 87df28f0c..ad7f27d33 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildNotifier.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildNotifier.java index 9cb2723b0..1a82cb6a0 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildNotifier.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildNotifier.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -21,7 +21,7 @@ import org.aspectj.org.eclipse.jdt.internal.core.builder.BuildNotifier; * Build progress notification inside Eclipse */ public class AjBuildNotifier extends BuildNotifier implements IProgressListener { - + /** * @param monitor * @param project diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java index cdf534b54..6c60db9d0 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.core.builder; @@ -120,7 +120,7 @@ public class AjCompilerOptions extends CompilerOptions { @Override public Map<String,String> getMap() { Map<String,String> map = super.getMap(); - // now add AspectJ additional options + // now add AspectJ additional options map.put(OPTION_ReportInvalidAbsoluteTypeName, getSeverityString(InvalidAbsoluteTypeName)); map.put(OPTION_ReportInvalidWildcardTypeName, getSeverityString(InvalidWildCardTypeName)); map.put(OPTION_ReportUnresolvableMember, getSeverityString(UnresolvableMember)); @@ -293,11 +293,11 @@ public class AjCompilerOptions extends CompilerOptions { buf.append("\n\t- no inline (X option): ").append(this.xNoInline ? ENABLED : DISABLED); //$NON-NLS-1$ buf.append("\n\t- generate serializable aspects (X option): ").append(this.xSerializableAspects ? ENABLED : DISABLED); //$NON-NLS-1$ buf.append("\n\t- lazy thisJoinPoint (X option): ").append(this.xLazyThisJoinPoint ? ENABLED : DISABLED); //$NON-NLS-1$ - buf.append("\n\t- generate non-reweavable class files (X option): ").append(this.xNotReweavable ? ENABLED : DISABLED); //$NON-NLS-1$ + buf.append("\n\t- generate non-reweavable class files (X option): ").append(this.xNotReweavable ? ENABLED : DISABLED); //$NON-NLS-1$ buf.append("\n\t- has member support (X option): ").append(this.xHasMember ? ENABLED : DISABLED); //$NON-NLS-1$ - buf.append("\n\t- generate AJDE model: ").append(this.generateModel ? ENABLED : DISABLED); //$NON-NLS-1$ - buf.append("\n\t- generate Javadocs in AJDE model: ").append(this.generateJavaDocsInModel ? ENABLED : DISABLED); //$NON-NLS-1$ + buf.append("\n\t- generate AJDE model: ").append(this.generateModel ? ENABLED : DISABLED); //$NON-NLS-1$ + buf.append("\n\t- generate Javadocs in AJDE model: ").append(this.generateJavaDocsInModel ? ENABLED : DISABLED); //$NON-NLS-1$ buf.append("\n\t- generate Emacs symbol files: ").append(this.generateEmacsSymFiles ? ENABLED : DISABLED); //$NON-NLS-1$ buf.append("\n\t- suppress @AspectJ processing: ").append(this.noAtAspectJProcessing ? ENABLED : DISABLED); //$NON-NLS-1$ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjIncrementalImageBuilder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjIncrementalImageBuilder.java index d31bc2d48..a27bbc003 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjIncrementalImageBuilder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjIncrementalImageBuilder.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -20,7 +20,7 @@ import org.aspectj.org.eclipse.jdt.internal.core.builder.SourceFile; * Incremental builder used by IDE support (AJDT) */ public class AjIncrementalImageBuilder extends IncrementalImageBuilder { - + public AjIncrementalImageBuilder(AspectJBuilder builder) { super(builder); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java index 18fa2f96d..54fee3bfa 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * Andy Clement overhauled * ******************************************************************/ @@ -151,19 +151,19 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * Holds UnwovenClassFiles (byte[]s) originating from the given file source. This could be a jar file, a directory, or an * individual .class file. This is an *expensive* map. It is cleared immediately following a batch build, and the cheaper * inputClassFilesBySource map is kept for processing of any subsequent incremental builds. - * + * * Populated during AjBuildManager.initBcelWorld(). - * + * * Passed into AjCompiler adapter as the set of binary input files to reweave if the weaver determines a full weave is required. - * + * * Cleared during initBcelWorld prior to repopulation. - * + * * Used when a file is deleted during incremental compilation to delete all of the class files in the output directory that * resulted from the weaving of File. - * + * * Used during getBinaryFilesToCompile when compiling incrementally to determine which files should be recompiled if a given * input file has changed. - * + * */ private Map<String, List<UnwovenClassFile>> binarySourceFiles = new HashMap<>(); @@ -188,9 +188,9 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * Populated in noteResult to record the set of UnwovenClassFiles (intermediate results) that originated from compilation of the * class with the given fully-qualified name. - * + * * Used in removeAllResultsOfLastBuild to remove .class files from output directory. - * + * * Passed into StatefulNameEnvironment during incremental compilation to support findType lookups. */ private final Map<String, File> classesFromName = new HashMap<>(); @@ -349,7 +349,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * Checks if any of the files in the set passed in contains an aspect declaration. If one is found then we start the process of * batch building, i.e. we remove all the results of the last build, call any registered listener to tell them whats happened * and return false. - * + * * @return false if we discovered an aspect declaration */ private boolean processDeletedFiles(Set<File> deletedFiles) { @@ -434,7 +434,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * Analyse .class files in the directory specified, if they have changed since the last successful build then see if we can * determine which source files in our project depend on the change. If we can then we can still do an incremental build, if we * can't then we have to do a full build. - * + * */ private int classFileChangedInDirSinceLastBuildRequiringFullBuild(File dir, int pathid) { @@ -811,7 +811,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * Determine if a file has changed since a given time, using the local information recorded in the structural changes data * structure. - * + * * @param file the file we are wondering about * @param lastSuccessfulBuildTime the last build time for the state asking the question */ @@ -854,7 +854,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * Determine if something has changed on the classpath/inpath/aspectpath and a full build is required rather than an incremental * one. - * + * * @param previousConfig the previous configuration used * @param newConfig the new configuration being used * @return true if full build required @@ -921,7 +921,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * Return a list of the output locations - this includes any 'default' output location and then any known by a registered * CompilationResultDestinationManager. - * + * * @param config the build configuration for which the output locations should be determined * @return a list of file objects */ @@ -967,7 +967,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * Check the old and new paths, if they vary by length or individual elements then that is considered a change. Or if the last * modified time of a path entry has changed (or last modified time of a classfile in that path entry has changed) then return * true. The outputlocations are supplied so they can be 'ignored' in the comparison. - * + * * @param oldPath * @param newPath * @param checkClassFiles whether to examine individual class files within directories @@ -1025,7 +1025,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe * Check the old and new paths, if they vary by length or individual elements then that is considered a change. Or if the last * modified time of a path entry has changed (or last modified time of a classfile in that path entry has changed) then return * true. The outputlocations are supplied so they can be 'ignored' in the comparison. - * + * * @param oldPath * @param newPath * @param checkClassFiles whether to examine individual class files within directories @@ -1402,7 +1402,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * Record the fully-qualified names of the types that were declared in the given source file. - * + * * @param sourceFile, the compilation unit * @param icr, the CompilationResult from compiling it */ @@ -1417,7 +1417,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * If this compilation unit defined an aspect, we need to know in case it is modified in a future increment. - * + * * @param sourceFile * @param cr */ @@ -1548,12 +1548,12 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * Compare the class structure of the new intermediate (unwoven) class with the existingResolvedType of the same class that we * have in the world, looking for any structural differences (and ignoring aj members resulting from weaving....) - * + * * Some notes from Andy... lot of problems here, which I've eventually resolved by building the compactstructure based on a * classfilereader, rather than on a ResolvedType. There are accessors for inner types and funky fields that the compiler * creates to support the language - for non-static inner types it also mangles ctors to be prefixed with an instance of the * surrounding type. - * + * * @param reader * @param existingType * @return @@ -1807,7 +1807,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe getListener().recordDecision("StructuralAnalysis["+filename+"]: "+info); } } - + private boolean printStructuralChanges(String filename, ClassFileReader reader, CompactTypeStructureRepresentation existingType) { logAnalysis(filename,"appears to have structurally changed, printing changes:"); if (existingType == null) { @@ -2147,7 +2147,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * For two methods, discover if there has been a change in the exception types specified. - * + * * @return true if the exception types have changed */ private boolean exceptionClausesDiffer(IBinaryMethod lastMethod, IBinaryMethod newMethod) { @@ -2261,7 +2261,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe /** * Record that a particular type has been touched during a compilation run. Information is used to ensure any types depending * upon this one are also recompiled. - * + * * @param typename (possibly qualified) type name */ protected void recordTypeChanged(String typename) { @@ -2524,12 +2524,12 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe public void setFileSystem(FileSystem fileSystem) { this.fileSystem = fileSystem; } - + /** * Record an aspect that came in on the aspect path. When a .class file changes on the aspect path we can then recognize it as * an aspect and know to do more than just a tiny incremental build. <br> * TODO but this doesn't allow for a new aspect created on the aspectpath? - * + * * @param aspectFile path to the file, eg. c:/temp/foo/Fred.class */ public void recordAspectClassFile(String aspectFile) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java index a89a6bd93..682969b09 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java index af397b170..fd014112e 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation @@ -84,7 +84,7 @@ import org.aspectj.weaver.patterns.TypePatternList; * model will not be built properly and tools such as IDE structure views and ajdoc will fail. * <p> * <b>Note:</b> this class is not considered public API and the overridable methods are subject to change. - * + * * @author Mik Kersten */ public class AsmHierarchyBuilder extends ASTVisitor { @@ -113,7 +113,7 @@ public class AsmHierarchyBuilder extends ASTVisitor { int[] lineseps; /** - * + * * @param cuDeclaration * @param buildConfig * @param structureModel @@ -839,7 +839,7 @@ public class AsmHierarchyBuilder extends ASTVisitor { if (fieldDeclaration.binding.type==null) { System.err.println("DebugFor402832: null fieldDeclaration.binding.type for "+fieldDeclaration); type="fieldDeclaration_binding_type_is_null"; - isOk=false; + isOk=false; } else { type=fieldDeclaration.binding.type.debugName(); } @@ -936,7 +936,7 @@ public class AsmHierarchyBuilder extends ASTVisitor { } /** - * + * */ protected String genSourceSignature(FieldDeclaration fieldDeclaration) { StringBuffer output = new StringBuffer(); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java index 586508bd7..da30c8e1e 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -55,7 +55,7 @@ import org.eclipse.core.runtime.Path; /** * @author colyer - * + * * This is the builder class used by AJDT, and that the org.eclipse.ajdt.core plugin references. */ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFactory { @@ -71,7 +71,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /* * (non-Javadoc) - * + * * @see org.eclipse.core.internal.events.InternalBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor) */ protected IProject[] build(int kind, Map ignored, IProgressMonitor monitor) throws CoreException { @@ -94,7 +94,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /* * (non-Javadoc) - * + * * @see org.eclipse.jdt.internal.compiler.ICompilerAdapterFactory#getAdapter(org.eclipse.jdt.internal.compiler.Compiler) */ public ICompilerAdapter getAdapter(Compiler forCompiler) { @@ -145,7 +145,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /* * (non-Javadoc) - * + * * @see org.eclipse.jdt.internal.core.builder.JavaBuilder#createBuildNotifier(org.eclipse.core.runtime.IProgressMonitor, * org.eclipse.core.resources.IProject) */ @@ -190,7 +190,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /* * (non-Javadoc) - * + * * @seeorg.aspectj.ajdt.internal.compiler.IIntermediateResultsRequestor#acceptResult(org.aspectj.ajdt.internal.compiler. * InterimCompilationResult) */ @@ -217,7 +217,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHandler#handleMessage(org.aspectj.bridge.IMessage) */ public boolean handleMessage(IMessage message) throws AbortException { @@ -233,7 +233,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHandler#isIgnoring(org.aspectj.bridge.IMessage.Kind) */ public boolean isIgnoring(Kind kind) { @@ -244,7 +244,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /** * No-op - * + * * @see org.aspectj.bridge.IMessageHandler#isIgnoring(org.aspectj.bridge.IMessage.Kind) * @param kind */ @@ -272,7 +272,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /* * (non-Javadoc) - * + * * @see org.aspectj.ajdt.internal.compiler.IOutputClassFileNameProvider#getOutputClassFileName(char[], * org.eclipse.jdt.internal.compiler.CompilationResult) */ @@ -293,7 +293,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto /* * (non-Javadoc) - * + * * @see org.aspectj.ajdt.internal.compiler.IBinarySourceProvider#getBinarySourcesForThisWeave() */ public Map getBinarySourcesForThisWeave() { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java index b82b06d3a..48fafe5ff 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Andy Clement promoted member type from AjState diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/CompilerConfigurationChangeFlags.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/CompilerConfigurationChangeFlags.java index 7e3ef5ecd..2baf14ce0 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/CompilerConfigurationChangeFlags.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/CompilerConfigurationChangeFlags.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2008 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 - * + * Copyright (c) 2008 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Andy Clement *******************************************************************/ package org.aspectj.ajdt.internal.core.builder; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java index 795176c61..a1466800a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.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: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.core.builder; @@ -108,8 +108,8 @@ public class EclipseAdapterUtils { /** * Extract source location file, start and end lines, and context. Column is not extracted correctly. - * @param progressListener - * + * @param progressListener + * * @return ISourceLocation with correct file and lines but not column. */ public static ISourceLocation makeSourceLocation(ICompilationUnit unit, IProblem problem, IProgressListener progressListener) { @@ -127,9 +127,9 @@ public class EclipseAdapterUtils { /** * Extract message text and source location, including context. - * + * * @param world - * @param progressListener + * @param progressListener */ public static IMessage makeMessage(ICompilationUnit unit, IProblem problem, World world, IProgressListener progressListener) { ISourceLocation sourceLocation = makeSourceLocation(unit, problem, progressListener); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseClassPathManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseClassPathManager.java index fa7e531c4..cbb29a1d4 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseClassPathManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseClassPathManager.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -31,26 +31,26 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; * the various eclipse paths into their external form. */ public class EclipseClassPathManager extends ClassPathManager { - + private INameEnvironment nameEnv; - + public EclipseClassPathManager(INameEnvironment env) { this.nameEnv = env; } - + // class path manager will be used by weaver across multiple compiles, // whereas a name environment may be constructed per-compile. public void setNameEnvironment(INameEnvironment env) { this.nameEnv = env; } - + /* (non-Javadoc) * @see org.aspectj.weaver.bcel.ClassPathManager#addPath(java.lang.String, org.aspectj.bridge.IMessageHandler) */ public void addPath(String name, IMessageHandler handler) { throw new UnsupportedOperationException("Can't add paths to an *Eclipse*ClassPathManager."); } - + /* (non-Javadoc) * @see org.aspectj.weaver.bcel.ClassPathManager#find(org.aspectj.weaver.UnresolvedType) */ @@ -73,11 +73,11 @@ public class EclipseClassPathManager extends ClassPathManager { cf = new ClassFileReaderBackedClassFile(cfr); } else { throw new IllegalArgumentException( - "I'm only geared up to handle ClassFileReaders, and you gave me a " + + "I'm only geared up to handle ClassFileReaders, and you gave me a " + binType.getClass().getName()); } return cf; - } + } } /* (non-Javadoc) * @see org.aspectj.weaver.bcel.ClassPathManager#getAllClassFiles() @@ -94,16 +94,16 @@ public class EclipseClassPathManager extends ClassPathManager { buf.append(nameEnv.toString()); return buf.toString(); } - + private class ClassFileReaderBackedClassFile extends ClassPathManager.ClassFile { private ClassFileReader source; private InputStream is; - + public ClassFileReaderBackedClassFile(ClassFileReader cfr) { source = cfr; } - + /* (non-Javadoc) * @see org.aspectj.weaver.bcel.ClassPathManager.ClassFile#getInputStream() */ @@ -111,7 +111,7 @@ public class EclipseClassPathManager extends ClassPathManager { is = new ByteArrayInputStream(source.getReferenceBytes()); return is; } - + public void close() { try { if (is!=null) is.close(); @@ -119,13 +119,13 @@ public class EclipseClassPathManager extends ClassPathManager { // Should never happen ! e.printStackTrace(); } - } + } /* (non-Javadoc) * @see org.aspectj.weaver.bcel.ClassPathManager.ClassFile#getPath() */ public String getPath() { return new String(source.getFileName()); - } + } } } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java index 31471ad6d..c3a6f775a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EclipseSourceContext.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -28,23 +28,23 @@ import org.aspectj.weaver.Member; public class EclipseSourceContext implements IEclipseSourceContext { - + CompilationResult result; int offset = 0; public EclipseSourceContext(CompilationResult result) { this.result = result; } - + public EclipseSourceContext(CompilationResult result, int offset) { this.result = result; this.offset = offset; } - + public int getOffset() { return offset; } - + private File getSourceFile() { return new File(new String(result.fileName)); } @@ -71,13 +71,13 @@ public class EclipseSourceContext implements IEclipseSourceContext { } return sl; } - + public void tidy() { result=null; } public void removeUnnecessaryProblems(Member member, int problemLineNumber) { - if (result == null) return; + if (result == null) return; IProblem[] probs = result.getProblems(); if (probs!=null) { for (IProblem problem : probs) { @@ -94,7 +94,7 @@ public class EclipseSourceContext implements IEclipseSourceContext { } } - private class UnusedDeclaredThrownExceptionFilter implements ProblemsForRemovalFilter { + private class UnusedDeclaredThrownExceptionFilter implements ProblemsForRemovalFilter { private IProblem problemToRemove; public UnusedDeclaredThrownExceptionFilter(IProblem p) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java index abd1bf5a6..aba047974 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java @@ -3,9 +3,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IStateListener.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IStateListener.java index 87c24374d..1a822f44c 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IStateListener.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IStateListener.java @@ -2,9 +2,9 @@ * Copyright (c) 2005 IBM and other contributors * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Andy Clement initial implementation diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java index 13ca3c3b4..bf9bdd008 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.core.builder; @@ -27,7 +27,7 @@ import org.aspectj.weaver.CompressingDataOutputStream; /** * Central point for all things incremental... - keeps track of the state recorded for each different config file - allows limited * interaction with these states - * + * * - records dependency/change info for particular classpaths > this will become what JDT keeps in its 'State' object when it's * finished */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java index 8d49c31d1..0af411be3 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/StatefulNameEnvironment.java @@ -2,9 +2,9 @@ * Copyright (c) 2002 IBM and other contributors * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Palo Alto Research Center, Incorporated (PARC) diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AbstractBooleanTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AbstractBooleanTypePattern.java index 3b8b211c1..4163210cb 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AbstractBooleanTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AbstractBooleanTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AdviceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AdviceDeclaration.java index 4691827f9..5d0af8d30 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AdviceDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -23,54 +23,54 @@ import java.util.List; */ public abstract class AdviceDeclaration extends BodyDeclaration { - + /** * The "javadoc" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(AdviceDeclaration.class); /** * The "parameters" structural property of this node type). * @since 3.0 */ - public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(AdviceDeclaration.class, "parameters", SingleVariableDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildPropertyDescriptor POINTCUT_PROPERTY = + + public static final ChildPropertyDescriptor POINTCUT_PROPERTY = new ChildPropertyDescriptor(AdviceDeclaration.class, "pointcut", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "thrownExceptions" structural property of this node type). * @since 3.0 */ - public static final ChildListPropertyDescriptor THROWN_EXCEPTIONS_PROPERTY = + public static final ChildListPropertyDescriptor THROWN_EXCEPTIONS_PROPERTY = new ChildListPropertyDescriptor(AdviceDeclaration.class, "thrownExceptions", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(AdviceDeclaration.class, "body", Block.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ protected static List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ protected static List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(5); createPropertyList(AdviceDeclaration.class, propertyList); @@ -80,7 +80,7 @@ public abstract class AdviceDeclaration extends BodyDeclaration { addProperty(POINTCUT_PROPERTY, propertyList); addProperty(BODY_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(5); createPropertyList(AdviceDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -94,9 +94,9 @@ public abstract class AdviceDeclaration extends BodyDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -109,13 +109,13 @@ public abstract class AdviceDeclaration extends BodyDeclaration { } /** - * The parameter declarations + * The parameter declarations * (element type: <code>SingleVariableDeclaration</code>). * Defaults to an empty list. */ protected ASTNode.NodeList parameters = new ASTNode.NodeList(PARAMETERS_PROPERTY); - + private PointcutDesignator pointcut; /** @@ -130,20 +130,20 @@ public abstract class AdviceDeclaration extends BodyDeclaration { * Defaults to none. */ private Block optionalBody = null; - + /** - * Creates a new AST node for a method declaration owned + * Creates a new AST node for a method declaration owned * by the given AST. By default, the declaration is for a method of an - * unspecified, but legal, name; no modifiers; no javadoc; no type - * parameters; void return type; no parameters; no array dimensions after + * unspecified, but legal, name; no modifiers; no javadoc; no type + * parameters; void return type; no parameters; no array dimensions after * the parameters; no thrown exceptions; and no body (as opposed to an * empty body). * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ AdviceDeclaration(AST ast) { @@ -157,7 +157,7 @@ public abstract class AdviceDeclaration extends BodyDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -189,7 +189,7 @@ public abstract class AdviceDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -203,7 +203,7 @@ public abstract class AdviceDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -217,7 +217,7 @@ public abstract class AdviceDeclaration extends BodyDeclaration { final int getNodeType0() { return METHOD_DECLARATION; // ajh02: should add one like ADVICE_DECLARATION or something } - + public PointcutDesignator getPointcut(){ return pointcut; } @@ -230,41 +230,41 @@ public abstract class AdviceDeclaration extends BodyDeclaration { this.pointcut = pointcut; postReplaceChild(oldChild, pointcut, POINTCUT_PROPERTY); } - + /** * Returns the live ordered list of method parameter declarations for this * method declaration. - * + * * @return the live list of method parameter declarations * (element type: <code>SingleVariableDeclaration</code>) - */ + */ public List parameters() { return this.parameters; } - + /** - * Returns the live ordered list of thrown exception names in this method + * Returns the live ordered list of thrown exception names in this method * declaration. - * + * * @return the live list of exception names * (element type: <code>Name</code>) - */ + */ public List thrownExceptions() { return this.thrownExceptions; } /** - * Returns the body of this method declaration, or <code>null</code> if + * Returns the body of this method declaration, or <code>null</code> if * this method has <b>no</b> body. * <p> * Note that there is a subtle difference between having no body and having * an empty body ("{}"). * </p> - * + * * @return the method body, or <code>null</code> if this method has no * body - */ + */ public Block getBody() { return this.optionalBody; } @@ -272,13 +272,13 @@ public abstract class AdviceDeclaration extends BodyDeclaration { /** * Sets or clears the body of this method declaration. * <p> - * Note that there is a subtle difference between having no body + * Note that there is a subtle difference between having no body * (as in <code>"void foo();"</code>) and having an empty body (as in * "void foo() {}"). Abstract methods, and methods declared in interfaces, * have no body. Non-abstract methods, and all constructors, have a body. * </p> - * - * @param body the block node, or <code>null</code> if + * + * @param body the block node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -286,7 +286,7 @@ public abstract class AdviceDeclaration extends BodyDeclaration { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Block body) { // a MethodDeclaration may occur in a Block - must check cycles ASTNode oldChild = this.optionalBody; @@ -301,7 +301,7 @@ public abstract class AdviceDeclaration extends BodyDeclaration { int memSize() { return super.memSize() + 0; // ajh02: stub. I don't know what this is meant to do } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -315,13 +315,13 @@ public abstract class AdviceDeclaration extends BodyDeclaration { + (this.pointcut == null ? 0 : getPointcut().treeSize()) + (this.optionalBody == null ? 0 : getBody().treeSize()); } - + final SimplePropertyDescriptor internalModifiersProperty() { return internalModifiersPropertyFactory(AdviceDeclaration.class); // ajh02: stub method. I don't know what this does } final ChildListPropertyDescriptor internalModifiers2Property() { return internalModifiers2PropertyFactory(AdviceDeclaration.class);// ajh02: stub method. I don't know what this does } - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java index eed69d89c..a7857745f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterAdviceDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -17,11 +17,11 @@ package org.aspectj.org.eclipse.jdt.core.dom; */ public class AfterAdviceDeclaration extends AdviceDeclaration { - + AfterAdviceDeclaration(AST ast) { super(ast); } - + ASTNode clone0(AST target) { AfterAdviceDeclaration result = new AfterAdviceDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -44,7 +44,7 @@ public class AfterAdviceDeclaration extends AdviceDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java index f78e2a2a8..c073bc595 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterReturningAdviceDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -19,7 +19,7 @@ import java.util.List; * has: * everything an AfterAdviceDeclaration has, * an optional returning property - * + * * It inherits property descriptors from AdviceDeclaration, * but needs to add one for its returning property, * but I can't mix descripters from two different classes in a property list, @@ -31,29 +31,29 @@ import java.util.List; */ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration { - - public static final ChildPropertyDescriptor returningJAVADOC_PROPERTY = + + public static final ChildPropertyDescriptor returningJAVADOC_PROPERTY = internalJavadocPropertyFactory(AfterReturningAdviceDeclaration.class); - public static final ChildListPropertyDescriptor returningPARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor returningPARAMETERS_PROPERTY = new ChildListPropertyDescriptor(AfterReturningAdviceDeclaration.class, "parameters", SingleVariableDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildPropertyDescriptor returningPOINTCUT_PROPERTY = + + public static final ChildPropertyDescriptor returningPOINTCUT_PROPERTY = new ChildPropertyDescriptor(AfterReturningAdviceDeclaration.class, "pointcut", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildListPropertyDescriptor returningTHROWN_EXCEPTIONS_PROPERTY = + + public static final ChildListPropertyDescriptor returningTHROWN_EXCEPTIONS_PROPERTY = new ChildListPropertyDescriptor(AfterReturningAdviceDeclaration.class, "thrownExceptions", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildPropertyDescriptor returningBODY_PROPERTY = + + public static final ChildPropertyDescriptor returningBODY_PROPERTY = new ChildPropertyDescriptor(AfterReturningAdviceDeclaration.class, "body", Block.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ protected static List returningPROPERTY_DESCRIPTORS_2_0; - + protected static List returningPROPERTY_DESCRIPTORS_3_0; - - public static final ChildPropertyDescriptor returningRETURNING_PROPERTY = + + public static final ChildPropertyDescriptor returningRETURNING_PROPERTY = new ChildPropertyDescriptor(AfterReturningAdviceDeclaration.class, "returning", SingleVariableDeclaration.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ - + public static List propertyDescriptors(int apiLevel) { if (apiLevel == AST.JLS2_INTERNAL) { return returningPROPERTY_DESCRIPTORS_2_0; @@ -61,7 +61,7 @@ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration { return returningPROPERTY_DESCRIPTORS_3_0; } } - + static { List propertyList = new ArrayList(6); createPropertyList(AfterReturningAdviceDeclaration.class, propertyList); @@ -72,7 +72,7 @@ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration { addProperty(returningRETURNING_PROPERTY, propertyList); addProperty(returningBODY_PROPERTY, propertyList); returningPROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(6); createPropertyList(AfterReturningAdviceDeclaration.class, propertyList); addProperty(returningJAVADOC_PROPERTY, propertyList); @@ -80,16 +80,16 @@ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration { addProperty(returningTHROWN_EXCEPTIONS_PROPERTY, propertyList); addProperty(returningPOINTCUT_PROPERTY, propertyList); addProperty(returningRETURNING_PROPERTY, propertyList); - addProperty(returningBODY_PROPERTY, propertyList); + addProperty(returningBODY_PROPERTY, propertyList); returningPROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + private SingleVariableDeclaration returning = null; - + AfterReturningAdviceDeclaration(AST ast) { super(ast); } - + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == returningRETURNING_PROPERTY) { if (get) { @@ -101,15 +101,15 @@ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration { } return super.internalGetSetChildProperty(property, get, child); } - + public SingleVariableDeclaration getReturning() { return returning; } - + public void setReturning(SingleVariableDeclaration returning) { this.returning = returning; } - + ASTNode clone0(AST target) { AfterReturningAdviceDeclaration result = new AfterReturningAdviceDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -125,13 +125,13 @@ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration { (Block) ASTNode.copySubtree(target, getBody())); return result; } - + int treeSize() { return super.treeSize() + (this.returning == null ? 0 : this.returning.treeSize()); } - + void accept0(ASTVisitor visitor) { if (visitor instanceof AjASTVisitor) { boolean visitChildren = ((AjASTVisitor)visitor).visit(this); @@ -147,4 +147,4 @@ public class AfterReturningAdviceDeclaration extends AfterAdviceDeclaration { ((AjASTVisitor)visitor).endVisit(this); } } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java index 0d5142278..2164d7a28 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AfterThrowingAdviceDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -19,7 +19,7 @@ import java.util.List; * has: * everything an AfterAdviceDeclaration has, * an optional throwing property - * + * * It inherits property descriptors from AdviceDeclaration, * but needs to add one for its throwing property, * but I can't mix descripters from two different classes in a property list, @@ -30,29 +30,29 @@ import java.util.List; * */ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration { - - public static final ChildPropertyDescriptor throwingJAVADOC_PROPERTY = + + public static final ChildPropertyDescriptor throwingJAVADOC_PROPERTY = internalJavadocPropertyFactory(AfterThrowingAdviceDeclaration.class); - public static final ChildListPropertyDescriptor throwingPARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor throwingPARAMETERS_PROPERTY = new ChildListPropertyDescriptor(AfterThrowingAdviceDeclaration.class, "parameters", SingleVariableDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildPropertyDescriptor throwingPOINTCUT_PROPERTY = + + public static final ChildPropertyDescriptor throwingPOINTCUT_PROPERTY = new ChildPropertyDescriptor(AfterThrowingAdviceDeclaration.class, "pointcut", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildListPropertyDescriptor throwingTHROWN_EXCEPTIONS_PROPERTY = + + public static final ChildListPropertyDescriptor throwingTHROWN_EXCEPTIONS_PROPERTY = new ChildListPropertyDescriptor(AfterThrowingAdviceDeclaration.class, "thrownExceptions", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildPropertyDescriptor throwingBODY_PROPERTY = + + public static final ChildPropertyDescriptor throwingBODY_PROPERTY = new ChildPropertyDescriptor(AfterThrowingAdviceDeclaration.class, "body", Block.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ protected static List throwingPROPERTY_DESCRIPTORS_2_0; - + protected static List throwingPROPERTY_DESCRIPTORS_3_0; - - public static final ChildPropertyDescriptor throwingTHROWING_PROPERTY = + + public static final ChildPropertyDescriptor throwingTHROWING_PROPERTY = new ChildPropertyDescriptor(AfterThrowingAdviceDeclaration.class, "throwing", SingleVariableDeclaration.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ - + public static List propertyDescriptors(int apiLevel) { if (apiLevel == AST.JLS2_INTERNAL) { return throwingPROPERTY_DESCRIPTORS_2_0; @@ -60,7 +60,7 @@ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration { return throwingPROPERTY_DESCRIPTORS_3_0; } } - + static { List propertyList = new ArrayList(6); createPropertyList(AfterThrowingAdviceDeclaration.class, propertyList); @@ -71,7 +71,7 @@ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration { addProperty(throwingTHROWING_PROPERTY, propertyList); addProperty(throwingBODY_PROPERTY, propertyList); throwingPROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(6); createPropertyList(AfterThrowingAdviceDeclaration.class, propertyList); addProperty(throwingJAVADOC_PROPERTY, propertyList); @@ -79,16 +79,16 @@ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration { addProperty(throwingTHROWN_EXCEPTIONS_PROPERTY, propertyList); addProperty(throwingPOINTCUT_PROPERTY, propertyList); addProperty(throwingTHROWING_PROPERTY, propertyList); - addProperty(throwingBODY_PROPERTY, propertyList); + addProperty(throwingBODY_PROPERTY, propertyList); throwingPROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + private SingleVariableDeclaration throwing = null; - + AfterThrowingAdviceDeclaration(AST ast) { super(ast); } - + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == throwingTHROWING_PROPERTY) { if (get) { @@ -100,15 +100,15 @@ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration { } return super.internalGetSetChildProperty(property, get, child); } - + public SingleVariableDeclaration getThrowing() { return throwing; } - + public void setThrowing(SingleVariableDeclaration throwing) { this.throwing = throwing; } - + ASTNode clone0(AST target) { AfterThrowingAdviceDeclaration result = new AfterThrowingAdviceDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -124,13 +124,13 @@ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration { (Block) ASTNode.copySubtree(target, getBody())); return result; } - + int treeSize() { return super.treeSize() + (this.throwing == null ? 0 : this.throwing.treeSize()); } - + void accept0(ASTVisitor visitor) { if (visitor instanceof AjASTVisitor) { boolean visitChildren = ((AjASTVisitor)visitor).visit(this); @@ -146,4 +146,4 @@ public class AfterThrowingAdviceDeclaration extends AfterAdviceDeclaration { ((AjASTVisitor)visitor).endVisit(this); } } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjAST.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjAST.java index 627922205..8aa4bc8ba 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjAST.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjAST.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2006 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java index 3065aca88..02ca4544f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -418,7 +418,7 @@ public class AjASTConverter extends ASTConverter { } return methodDecl; } - + // checkCanceled(); // if (methodDeclaration instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) { // return convert((org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) methodDeclaration); @@ -686,7 +686,7 @@ public class AjASTConverter extends ASTConverter { .setTypePattern((org.aspectj.org.eclipse.jdt.core.dom.TypePattern) pNode); } } - + if (declareDeclaration != null) { declareDeclaration.setSourceRange(declareDecl.declarationSourceStart, declareDecl.declarationSourceEnd - declareDecl.declarationSourceStart + 1); @@ -940,7 +940,7 @@ public class AjASTConverter extends ASTConverter { /** * Creates an ExactType, WildType, or BindingType, or null if none of the * three can be created - * + * * @param weaverTypePattern * to convert to a DOM equivalent * @return DOM node or null if it was not created @@ -3585,7 +3585,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve the ending position for a type declaration when the dimension is right after the type name. * For example: int[] i; → return 5, but int i[] → return -1; - * + * * @return int the dimension found */ protected int retrieveEndOfDimensionsPosition(int start, int end) { @@ -3615,7 +3615,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve the start and end position of a name or primitive type token. - * + * * @return int[] a single dimensional array, with two elements, for the start and end positions of the name respectively */ protected int[] retrieveEndOfElementTypeNamePosition(int start, int end) { @@ -3653,7 +3653,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve the position after the right parenthesis. - * + * * @return int the position found */ protected int retrieveEndOfRightParenthesisPosition(int start, int end) { @@ -3675,7 +3675,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve the array dimension declared after the name of a local or a field declaration. For example: * int i, j[] = null, k[][] = {{}}; It should return 0 for i, 1 for j and 2 for k. - * + * * @return int the dimension found */ protected int retrieveExtraDimension(int start, int end) { @@ -3722,7 +3722,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve the start position of the block. - * + * * @return int the dimension found, -1 if none */ protected int retrieveIdentifierEndPosition(int start, int end) { @@ -3743,7 +3743,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve position before the next comma or semi-colon. - * + * * @return int the position found. */ protected int retrievePositionBeforeNextCommaOrSemiColon(int start, int end) { @@ -3805,7 +3805,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve position before the next right brace or semi-colon. - * + * * @return int the position found. */ protected int retrieveRightBraceOrSemiColonPosition(int start, int end) { @@ -3828,7 +3828,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve position before the next right brace or semi-colon. - * + * * @return int the position found. */ protected int retrieveRightBrace(int start, int end) { @@ -3849,7 +3849,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve the position of the right bracket. - * + * * @return int the dimension found, -1 if none */ protected int retrieveRightBracketPosition(int start, int end) { @@ -3914,7 +3914,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve the start position of the block. - * + * * @return int the dimension found, -1 if none */ protected int retrieveStartBlockPosition(int start, int end) { @@ -3935,7 +3935,7 @@ public class AjASTConverter extends ASTConverter { /** * This method is used to retrieve the starting position of the catch keyword. - * + * * @return int the dimension found, -1 if none */ protected int retrieveStartingCatchPosition(int start, int end) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTMatcher.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTMatcher.java index ca571c6a8..c72bfc8c9 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTMatcher.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTMatcher.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -26,7 +26,7 @@ public class AjASTMatcher extends ASTMatcher { /** * Creates a new AST matcher instance. - * + * * @param matchDocTags <code>true</code> if doc comment tags are to be compared by default, and <code>false</code> otherwise * @see #match(Javadoc,Object) * @since 3.0 diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTVisitor.java index 182ba2054..8a2520ca7 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTVisitor.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -17,54 +17,54 @@ public abstract class AjASTVisitor extends ASTVisitor { public AjASTVisitor() { super(false); } - + public AjASTVisitor(boolean visitDocTags) { super(visitDocTags); } - + public void endVisit(PointcutDeclaration node) { // default implementation: do nothing } - + public void endVisit(ReferencePointcut node) { // default implementation: do nothing } - + public void endVisit(DefaultPointcut node) { // default implementation: do nothing } - + public void endVisit(NotPointcut node) { // default implementation: do nothing } - + public void endVisit(PerObject node) { // default implementation: do nothing } - + public void endVisit(PerCflow node) { // default implementation: do nothing } - + public void endVisit(CflowPointcut node) { // default implementation: do nothing } - + public void endVisit(PerTypeWithin node) { // default implementation: do nothing } - + public void endVisit(AndPointcut node) { // default implementation: do nothing } - + public void endVisit(OrPointcut node) { // default implementation: do nothing } public boolean visit(AdviceDeclaration node) { return true; } - + public boolean visit(AroundAdviceDeclaration node) { return true; } @@ -119,21 +119,21 @@ public abstract class AjASTVisitor extends ASTVisitor { // ajh02: method added // default implementation: do nothing } - + public boolean visit(DeclareAnnotationDeclaration node) { return true; } public void endVisit(DeclareAnnotationDeclaration node) { // default implementation: do nothing } - + public boolean visit(DeclareAtTypeDeclaration node) { return true; } public void endVisit(DeclareAtTypeDeclaration node) { // default implementation: do nothing } - + public boolean visit(DeclareAtConstructorDeclaration node) { return true; } @@ -152,100 +152,100 @@ public abstract class AjASTVisitor extends ASTVisitor { public void endVisit(DeclareAtFieldDeclaration node) { // default implementation: do nothing } - + public boolean visit(DeclareErrorDeclaration node) { return true; } public void endVisit(DeclareErrorDeclaration node) { // default implementation: do nothing } - + public boolean visit(DeclareParentsDeclaration node) { return true; } public void endVisit(DeclareParentsDeclaration node) { // default implementation: do nothing } - + public boolean visit(DeclarePrecedenceDeclaration node) { return true; } public void endVisit(DeclarePrecedenceDeclaration node) { // default implementation: do nothing } - + public boolean visit(DeclareSoftDeclaration node) { return true; } public void endVisit(DeclareSoftDeclaration node) { // default implementation: do nothing } - + public boolean visit(DeclareWarningDeclaration node) { return true; } public void endVisit(DeclareWarningDeclaration node) { // default implementation: do nothing } - + public boolean visit(PointcutDeclaration node) { return true; } - + public boolean visit(ReferencePointcut node) { return true; } - + public boolean visit(NotPointcut node) { return true; } - + public boolean visit(PerObject node) { return true; } - + public boolean visit(PerCflow node) { return true; } - + public boolean visit(PerTypeWithin node) { return true; } - + public boolean visit(CflowPointcut node) { return true; } - + public boolean visit(AndPointcut node) { return true; } - + public boolean visit(OrPointcut node) { return true; } - - + + public boolean visit(DefaultPointcut node) { return true; } - + public void endVisit(AdviceDeclaration node) { // default implementation: do nothing } - + public boolean visit(DefaultTypePattern node) { return true; } - + public void endVisit(DefaultTypePattern node) { } public boolean visit(SignaturePattern node) { return true; } - + public void endVisit(SignaturePattern node) { } - + /* * TODO: if necessary split this into the two specialised * boolean type patterns (AndTypePattern, OrTypePattern) @@ -321,12 +321,12 @@ public abstract class AjASTVisitor extends ASTVisitor { public void endVisit(TypeCategoryTypePattern node) { } - + public boolean visit(Type node) { return true; } public void endVisit(Type node) { - + } } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjNaiveASTFlattener.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjNaiveASTFlattener.java index e4f3cdeea..36f95a109 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjNaiveASTFlattener.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjNaiveASTFlattener.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -35,51 +35,51 @@ import java.util.List; * Call the <code>reset</code> method to clear the previous result before reusing an * existing instance. * </p> - * + * * @since 2.0 */ public class AjNaiveASTFlattener extends AjASTVisitor { - + /** * The string buffer into which the serialized representation of the AST is * written. */ protected StringBuffer buffer; - + private int indent = 0; - + /** * Creates a new AST printer. */ public AjNaiveASTFlattener() { this.buffer = new StringBuffer(); } - + /** * Returns the string accumulated in the visit. * - * @return the serialized + * @return the serialized */ public String getResult() { return this.buffer.toString(); } - + /** * Resets this printer so that it can be used again. */ public void reset() { this.buffer.setLength(0); } - + void printIndent() { - for (int i = 0; i < this.indent; i++) + for (int i = 0; i < this.indent; i++) this.buffer.append(" "); //$NON-NLS-1$ } - + /** * Appends the text representation of the given modifier flags, followed by a single space. * Used for 3.0 modifiers and annotations. - * + * * @param ext the list of modifier and annotation nodes * (element type: <code>IExtendedModifiers</code>) */ @@ -89,12 +89,12 @@ public class AjNaiveASTFlattener extends AjASTVisitor { p.accept(this); this.buffer.append(" ");//$NON-NLS-1$ } - } - + } + /** * Appends the text representation of the given modifier flags, followed by a single space. * Used for JLS2 modifiers. - * + * * @param modifiers the modifier flags */ void printModifiers(int modifiers) { @@ -131,8 +131,8 @@ public class AjNaiveASTFlattener extends AjASTVisitor { if (Modifier.isTransient(modifiers)) { this.buffer.append("transient ");//$NON-NLS-1$ } - } - + } + /* * @see ASTVisitor#visit(AnnotationTypeDeclaration) * @since 3.1 @@ -153,7 +153,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append("}\n");//$NON-NLS-1$ return false; } - + /* * @see ASTVisitor#visit(AnnotationTypeMemberDeclaration) * @since 3.1 @@ -175,7 +175,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(";\n");//$NON-NLS-1$ return false; } - + /* * @see ASTVisitor#visit(AnonymousClassDeclaration) */ @@ -512,7 +512,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { node.getBody().accept(this); return false; } - + public boolean visit(PointcutDeclaration node) { printIndent(); buffer.append(" pointcut "); @@ -804,7 +804,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { node.getTypeName().accept(this); return false; } - + /* * @see ASTVisitor#visit(MemberRef) * @since 3.0 @@ -817,7 +817,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { node.getName().accept(this); return false; } - + /* * @see ASTVisitor#visit(MemberValuePair) * @since 3.1 @@ -828,7 +828,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { node.getValue().accept(this); return false; } - + /* * @see ASTVisitor#visit(MethodRef) * @since 3.0 @@ -850,7 +850,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(")");//$NON-NLS-1$ return false; } - + /* * @see ASTVisitor#visit(MethodRefParameter) * @since 3.0 @@ -868,7 +868,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { } return false; } - + /* * @see ASTVisitor#visit(MethodDeclaration) */ @@ -919,7 +919,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(")");//$NON-NLS-1$ for (int i = 0; i < node.getExtraDimensions(); i++) { this.buffer.append("[]"); //$NON-NLS-1$ - } + } if (!node.thrownExceptions().isEmpty()) { this.buffer.append(" throws ");//$NON-NLS-1$ for (Iterator it = node.thrownExceptions().iterator(); it.hasNext(); ) { @@ -981,7 +981,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(node.getKeyword().toString()); return false; } - + /* * @see ASTVisitor#visit(NormalAnnotation) * @since 3.1 @@ -1000,7 +1000,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(")");//$NON-NLS-1$ return false; } - + /* * @see ASTVisitor#visit(NullLiteral) */ @@ -1154,7 +1154,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(")");//$NON-NLS-1$ return false; } - + /* * @see ASTVisitor#visit(SingleVariableDeclaration) */ @@ -1176,7 +1176,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { node.getName().accept(this); for (int i = 0; i < node.getExtraDimensions(); i++) { this.buffer.append("[]"); //$NON-NLS-1$ - } + } if (node.getInitializer() != null) { this.buffer.append("=");//$NON-NLS-1$ node.getInitializer().accept(this); @@ -1359,7 +1359,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { } return false; } - + /* * @see ASTVisitor#visit(TextElement) * @since 3.0 @@ -1368,7 +1368,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(node.getText()); return false; } - + /* * @see ASTVisitor#visit(ThisExpression) */ @@ -1504,7 +1504,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { // enum constant declarations are separated by commas this.buffer.append(", ");//$NON-NLS-1$ } else { - // semicolon separates last enum constant declaration from + // semicolon separates last enum constant declaration from // first class body declarations this.buffer.append("; ");//$NON-NLS-1$ } @@ -1653,13 +1653,13 @@ public class AjNaiveASTFlattener extends AjASTVisitor { printIndent(); this.buffer.append("declare parents: "); node.getChildTypePattern().accept(this); - + if(node.isExtends()){ this.buffer.append(" extends "); } else { this.buffer.append(" implements "); } - + for (Iterator it = node.parentTypePatterns().iterator(); it.hasNext();) { TypePattern typePat = (TypePattern) it.next(); typePat.accept(this); @@ -1667,15 +1667,15 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(", "); } } - + this.buffer.append(";\n"); - + return false; } - + public boolean visit(DeclareWarningDeclaration node) { printIndent(); - + this.buffer.append("declare warning: "); node.getPointcut().accept(this); this.buffer.append(" : "); @@ -1683,10 +1683,10 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(" ;\n"); return false; } - + public boolean visit(DeclareErrorDeclaration node) { printIndent(); - + this.buffer.append("declare error: "); node.getPointcut().accept(this); this.buffer.append(" : "); @@ -1694,10 +1694,10 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(" ;\n"); return false; } - + public boolean visit(DeclareSoftDeclaration node) { printIndent(); - + this.buffer.append("declare soft: "); node.getTypePattern().accept(this); this.buffer.append(" : "); @@ -1705,10 +1705,10 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(" ;\n"); return false; } - + public boolean visit(DeclarePrecedenceDeclaration node) { printIndent(); - + this.buffer.append("declare precedence: "); for (Iterator it = node.typePatterns().iterator(); it.hasNext();) { TypePattern typePat = (TypePattern) it.next(); @@ -1717,14 +1717,14 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(", "); } } - + this.buffer.append(";\n"); - + return false; } - + public boolean visit(AbstractBooleanTypePattern node) { - + // Flatten boolean expressions in order, meaning // the left node needs to be appended first, followed by the // boolean operator, followed by the right node. @@ -1733,7 +1733,7 @@ public class AjNaiveASTFlattener extends AjASTVisitor { this.buffer.append(node.getTypePatternExpression()); this.buffer.append(" "); node.getRight().accept(this); - + // No need to visit the childrena, as they were already visited above return false; } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjTypeDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjTypeDeclaration.java index 429e0f5b7..b0f5eaff3 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjTypeDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjTypeDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -22,18 +22,18 @@ import java.util.List; * by AspectDeclaration, a further subtype of AjTypeDeclaration. */ public class AjTypeDeclaration extends TypeDeclaration { - + /** * The "aspect" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor ASPECT_PROPERTY = + public static final SimplePropertyDescriptor ASPECT_PROPERTY = new SimplePropertyDescriptor(TypeDeclaration.class, "aspect", boolean.class, MANDATORY); //$NON-NLS-1$ - + protected static List ajPROPERTY_DESCRIPTORS_2_0; protected static List ajPROPERTY_DESCRIPTORS_3_0; - + // Need to fix up the property lists created during the super's static initializer static { // Need to fix up the property lists created during the super's static initializer @@ -42,7 +42,7 @@ public class AjTypeDeclaration extends TypeDeclaration { temporary.addAll(PROPERTY_DESCRIPTORS_2_0); addProperty(ASPECT_PROPERTY, temporary); ajPROPERTY_DESCRIPTORS_2_0 = reapPropertyList(temporary); - + temporary.clear(); createPropertyList(TypeDeclaration.class, temporary); temporary.addAll(PROPERTY_DESCRIPTORS_3_0); @@ -55,20 +55,20 @@ public class AjTypeDeclaration extends TypeDeclaration { * Defaults to class. */ private boolean isAspect = false; - + /** - * Creates a new AST node for a type declaration owned by the given + * Creates a new AST node for a type declaration owned by the given * AST. By default, the type declaration is for a class of an - * unspecified, but legal, name; no modifiers; no javadoc; + * unspecified, but legal, name; no modifiers; no javadoc; * no type parameters; no superclass or superinterfaces; and an empty list * of body declarations. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ public AjTypeDeclaration(AST ast) { @@ -122,15 +122,15 @@ public class AjTypeDeclaration extends TypeDeclaration { // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -141,26 +141,26 @@ public class AjTypeDeclaration extends TypeDeclaration { return ajPROPERTY_DESCRIPTORS_3_0; } } - + /** - * Returns whether this type declaration declares a class or an + * Returns whether this type declaration declares a class or an * aspect. - * + * * @return <code>true</code> if this is an aspect declaration, * and <code>false</code> if this is a class or interface declaration - */ + */ public boolean isAspect() { return this.isAspect; } - + /** - * Sets whether this type declaration declares a class or an + * Sets whether this type declaration declares a class or an * aspect. - * + * * @param isAspect <code>true</code> if this is an aspect * declaration, and <code>false</code> if this is a class or interface * declaration - */ + */ public void setAspect(boolean isAspect) { preValueChange(ASPECT_PROPERTY); this.isAspect = isAspect; @@ -186,11 +186,11 @@ public class AjTypeDeclaration extends TypeDeclaration { } return pointcuts; } - + public ASTNode.NodeList getSuperInterfaceNames() { return superInterfaceNames; } - + public ASTNode.NodeList getTypeParameters() { return typeParameters; } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java index 1cb204007..790d03eb8 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -24,10 +24,10 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * @author ajh02 * */ -public class AndPointcut extends PointcutDesignator { - +public class AndPointcut extends PointcutDesignator { + private PointcutDesignator left = null; - public static final ChildPropertyDescriptor LEFT_PROPERTY = + public static final ChildPropertyDescriptor LEFT_PROPERTY = new ChildPropertyDescriptor(AndPointcut.class, "left", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public PointcutDesignator getLeft() { return this.left; @@ -41,9 +41,9 @@ public class AndPointcut extends PointcutDesignator { this.left = left; postReplaceChild(oldChild, left, LEFT_PROPERTY); } - + private PointcutDesignator right = null; - public static final ChildPropertyDescriptor RIGHT_PROPERTY = + public static final ChildPropertyDescriptor RIGHT_PROPERTY = new ChildPropertyDescriptor(AndPointcut.class, "right", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public PointcutDesignator getRight() { return this.right; @@ -57,10 +57,10 @@ public class AndPointcut extends PointcutDesignator { this.right = right; postReplaceChild(oldChild, right, RIGHT_PROPERTY); } - - - - + + + + AndPointcut(AST ast) { super(ast); } @@ -126,4 +126,4 @@ public class AndPointcut extends PointcutDesignator { + (this.left == null ? 0 : getLeft().treeSize()) + (this.right == null ? 0 : getRight().treeSize()); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AndTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AndTypePattern.java index b2ccde08b..87d96868d 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AndTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AndTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -30,7 +30,7 @@ public class AndTypePattern extends AbstractBooleanTypePattern { cloned.setSourceRange(getStartPosition(), getLength()); return cloned; } - + void accept0(ASTVisitor visitor) { if (visitor instanceof AjASTVisitor) { AjASTVisitor ajVisitor = (AjASTVisitor) visitor; @@ -42,7 +42,7 @@ public class AndTypePattern extends AbstractBooleanTypePattern { ajVisitor.endVisit(this); } } - + boolean subtreeMatch0(ASTMatcher matcher, Object other) { if (matcher instanceof AjASTMatcher) { AjASTMatcher ajmatcher = (AjASTMatcher) matcher; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AnyTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AnyTypePattern.java index 801de79df..b2355da3c 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AnyTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AnyTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -28,7 +28,7 @@ public class AnyTypePattern extends TypePattern { cloned.setSourceRange(getStartPosition(), getLength()); return cloned; } - + boolean subtreeMatch0(ASTMatcher matcher, Object other) { if (matcher instanceof AjASTMatcher) { AjASTMatcher ajmatcher = (AjASTMatcher) matcher; @@ -36,7 +36,7 @@ public class AnyTypePattern extends TypePattern { } return false; } - + void accept0(ASTVisitor visitor) { if (visitor instanceof AjASTVisitor) { AjASTVisitor ajVisitor = (AjASTVisitor) visitor; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AnyWithAnnotationTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AnyWithAnnotationTypePattern.java index 5a6e04f79..678537df5 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AnyWithAnnotationTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AnyWithAnnotationTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -14,7 +14,7 @@ import java.util.List; /** * TODO: Add support for proper AnnotationPatterns instead of the annotation * expression - * + * */ public class AnyWithAnnotationTypePattern extends TypePattern { @@ -41,7 +41,7 @@ public class AnyWithAnnotationTypePattern extends TypePattern { } return false; } - + void accept0(ASTVisitor visitor) { if (visitor instanceof AjASTVisitor) { AjASTVisitor ajVisitor = (AjASTVisitor) visitor; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java index 915ab1a52..95d7bda67 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AroundAdviceDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -19,7 +19,7 @@ import java.util.List; * has: * everything an AdviceDeclaration has, * a return type (or return type Mark2) - * + * * It inherits property descriptors from AdviceDeclaration, * but needs to add one for its return type, * but I can't mix descripters from two different classes in a property list, @@ -31,34 +31,34 @@ import java.util.List; */ public class AroundAdviceDeclaration extends AdviceDeclaration { - - public static final ChildPropertyDescriptor aroundRETURN_TYPE_PROPERTY = + + public static final ChildPropertyDescriptor aroundRETURN_TYPE_PROPERTY = new ChildPropertyDescriptor(AroundAdviceDeclaration.class, "returnType", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - public static final ChildPropertyDescriptor aroundRETURN_TYPE2_PROPERTY = + public static final ChildPropertyDescriptor aroundRETURN_TYPE2_PROPERTY = new ChildPropertyDescriptor(AroundAdviceDeclaration.class, "returnType2", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildListPropertyDescriptor aroundTYPE_PARAMETERS_PROPERTY = + + public static final ChildListPropertyDescriptor aroundTYPE_PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(AroundAdviceDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildPropertyDescriptor aroundJAVADOC_PROPERTY = + + public static final ChildPropertyDescriptor aroundJAVADOC_PROPERTY = internalJavadocPropertyFactory(AroundAdviceDeclaration.class); - public static final ChildListPropertyDescriptor aroundPARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor aroundPARAMETERS_PROPERTY = new ChildListPropertyDescriptor(AroundAdviceDeclaration.class, "parameters", SingleVariableDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildPropertyDescriptor aroundPOINTCUT_PROPERTY = + + public static final ChildPropertyDescriptor aroundPOINTCUT_PROPERTY = new ChildPropertyDescriptor(AroundAdviceDeclaration.class, "pointcut", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildListPropertyDescriptor aroundTHROWN_EXCEPTIONS_PROPERTY = + + public static final ChildListPropertyDescriptor aroundTHROWN_EXCEPTIONS_PROPERTY = new ChildListPropertyDescriptor(AroundAdviceDeclaration.class, "thrownExceptions", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$ - - public static final ChildPropertyDescriptor aroundBODY_PROPERTY = + + public static final ChildPropertyDescriptor aroundBODY_PROPERTY = new ChildPropertyDescriptor(AroundAdviceDeclaration.class, "body", Block.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ protected static List aroundPROPERTY_DESCRIPTORS_2_0; protected static List aroundPROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(6); createPropertyList(AroundAdviceDeclaration.class, propertyList); @@ -69,7 +69,7 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { addProperty(aroundPOINTCUT_PROPERTY, propertyList); addProperty(aroundBODY_PROPERTY, propertyList); aroundPROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(7); createPropertyList(AroundAdviceDeclaration.class, propertyList); addProperty(aroundJAVADOC_PROPERTY, propertyList); @@ -81,8 +81,8 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { addProperty(aroundBODY_PROPERTY, propertyList); aroundPROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - - + + public static List propertyDescriptors(int apiLevel) { if (apiLevel == AST.JLS2_INTERNAL) { return aroundPROPERTY_DESCRIPTORS_2_0; @@ -90,7 +90,7 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { return aroundPROPERTY_DESCRIPTORS_3_0; } } - + private Type returnType = null; /** * Indicated whether the return type has been initialized. @@ -98,14 +98,14 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { */ private boolean returnType2Initialized = false; private ASTNode.NodeList typeParameters = null; - + AroundAdviceDeclaration(AST ast) { super(ast); if (ast.apiLevel >= AST.JLS3) { // ajh02: move to aroundAdvice this.typeParameters = new ASTNode.NodeList(aroundTYPE_PARAMETERS_PROPERTY); } } - + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == aroundRETURN_TYPE_PROPERTY) { if (get) { @@ -125,14 +125,14 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { } return super.internalGetSetChildProperty(property, get, child); } - + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == aroundTYPE_PARAMETERS_PROPERTY) { return typeParameters(); } return super.internalGetChildListProperty(property); } - + public List typeParameters() { // more efficient than just calling unsupportedIn2() to check if (this.typeParameters == null) { @@ -140,11 +140,11 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { } return this.typeParameters; } - + public Type getReturnType() { return internalGetReturnType(); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -164,11 +164,11 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { } return this.returnType; } - + public void setReturnType(Type type) { internalSetReturnType(type); } - + /*package*/ void internalSetReturnType(Type type) { supportedOnlyIn2(); if (type == null) { @@ -179,7 +179,7 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { this.returnType = type; postReplaceChild(oldChild, type, aroundRETURN_TYPE_PROPERTY); } - + public Type getReturnType2() { unsupportedIn2(); if (this.returnType == null && !this.returnType2Initialized) { @@ -195,7 +195,7 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { } return this.returnType; } - + public void setReturnType2(Type type) { unsupportedIn2(); this.returnType2Initialized = true; @@ -204,7 +204,7 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { this.returnType = type; postReplaceChild(oldChild, type, aroundRETURN_TYPE2_PROPERTY); } - + ASTNode clone0(AST target) { AroundAdviceDeclaration result = new AroundAdviceDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -219,7 +219,7 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { (Block) ASTNode.copySubtree(target, getBody())); return result; } - + int treeSize() { return super.treeSize() @@ -234,7 +234,7 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -249,7 +249,7 @@ public class AroundAdviceDeclaration extends AdviceDeclaration { } else { acceptChild(visitor, getReturnType2()); } - + acceptChildren(visitor, this.parameters); acceptChild(visitor, getPointcut()); acceptChildren(visitor, this.thrownExceptions); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java index e94b43f0e..a35c24b33 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -15,11 +15,11 @@ import java.util.List; /** * AspectDeclaration DOM AST node. - * + * * Has everything an AjTypeDeclaration has plus: an ASTNode called 'perClause' a boolean called 'privileged' - * + * * @author ajh02 - * + * */ public class AspectDeclaration extends AjTypeDeclaration { @@ -158,9 +158,9 @@ public class AspectDeclaration extends AjTypeDeclaration { /** * Returns a list of structural property descriptors for this node type. Clients must not modify the result. - * + * * @param apiLevel the API level; one of the <code>AST.JLS*</code> constants - * + * * @return a list of property descriptors (element type: {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -188,7 +188,7 @@ public class AspectDeclaration extends AjTypeDeclaration { /** * Returns whether this aspect is a privileged one. - * + * * @return <code>true</code> if this is a privileged aspect declaration, and <code>false</code> otherwise. */ public boolean isPrivileged() { @@ -197,7 +197,7 @@ public class AspectDeclaration extends AjTypeDeclaration { /** * Sets whether this aspect is a privileged one - * + * * @param isPrivileged <code>true</code> if this is a privileged aspect declaration, and <code>false</code> otherwise. */ public void setPrivileged(boolean isPrivileged) { @@ -239,4 +239,4 @@ public class AspectDeclaration extends AjTypeDeclaration { // return pointcuts; // } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java index 043dc9822..0f7fb53fd 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/BeforeAdviceDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -17,11 +17,11 @@ package org.aspectj.org.eclipse.jdt.core.dom; */ public class BeforeAdviceDeclaration extends AdviceDeclaration { - + BeforeAdviceDeclaration(AST ast) { super(ast); } - + ASTNode clone0(AST target) { BeforeAdviceDeclaration result = new BeforeAdviceDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -44,7 +44,7 @@ public class BeforeAdviceDeclaration extends AdviceDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/BindingTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/BindingTypePattern.java index bb6bc75d1..55d41adca 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/BindingTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/BindingTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java index 65b22b25e..4974719d9 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/CflowPointcut.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -22,10 +22,10 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * A PointcutDesignator called 'body' * @author ajh02 */ -public class CflowPointcut extends PointcutDesignator { - +public class CflowPointcut extends PointcutDesignator { + private PointcutDesignator body = null; - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(CflowPointcut.class, "body", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public PointcutDesignator getBody() { return this.body; @@ -39,7 +39,7 @@ public class CflowPointcut extends PointcutDesignator { this.body = body; postReplaceChild(oldChild, body, BODY_PROPERTY); } - + private boolean isCflowBelow = false; public boolean isCflowBelow(){ return isCflowBelow; @@ -47,10 +47,10 @@ public class CflowPointcut extends PointcutDesignator { public void setIsCflowBelow(boolean isCflowBelow) { this.isCflowBelow = isCflowBelow; } - - - - + + + + CflowPointcut(AST ast) { super(ast); } @@ -101,4 +101,4 @@ public class CflowPointcut extends PointcutDesignator { memSize() + (this.body == null ? 0 : getBody().treeSize()); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAnnotationDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAnnotationDeclaration.java index 9e20dd9df..0bf38dad4 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAnnotationDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAnnotationDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -13,38 +13,38 @@ package org.aspectj.org.eclipse.jdt.core.dom; /** * Abstract class for the different declare annotation * declaration AST node types. - * + * * Has everything a DeclareDeclaration has plus: * a PatternNode called 'pattern' * a SimpleName called 'annotationName' - * - * Unsupported for JLS2. + * + * Unsupported for JLS2. */ public abstract class DeclareAnnotationDeclaration extends DeclareDeclaration { - + abstract ChildPropertyDescriptor internalPatternNodeProperty(); abstract ChildPropertyDescriptor internalAnnotationNameProperty(); - + /** * Creates and returns a structural property descriptor for the * "annotationName" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildPropertyDescriptor internalAnnotationNamePropertyFactory(Class nodeClass) { return new ChildPropertyDescriptor(nodeClass, "annotationName", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ } - + /** * Creates and returns a structural property descriptor for the * "pattern" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildPropertyDescriptor internalPatternNodePropertyFactory(Class nodeClass) { return new ChildPropertyDescriptor(nodeClass, "pattern", PatternNode.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ } - + PatternNode pattern; SimpleName name = null; @@ -52,11 +52,11 @@ public abstract class DeclareAnnotationDeclaration extends DeclareDeclaration { super(ast); unsupportedIn2(); } - + public PatternNode getPatternNode(){ return pattern; } - + public void setPatternNode(PatternNode pattern) { if (pattern == null) { throw new IllegalArgumentException(); @@ -66,12 +66,12 @@ public abstract class DeclareAnnotationDeclaration extends DeclareDeclaration { this.pattern = pattern; postReplaceChild(oldChild, pattern, internalPatternNodeProperty()); } - + /** * Returns the name of the annotation type member declared in this declaration. - * + * * @return the name node - */ + */ public SimpleName getAnnotationName() { if (this.name == null) { // lazy init must be thread-safe for readers @@ -85,18 +85,18 @@ public abstract class DeclareAnnotationDeclaration extends DeclareDeclaration { } return this.name; } - + /** * Sets the name of the annotation type member declared in this declaration to the * given name. - * + * * @param name the new member name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setAnnotationName(SimpleName name) { if (name == null) { throw new IllegalArgumentException(); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtConstructorDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtConstructorDeclaration.java index 2fb1f45d3..2a7b1480c 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtConstructorDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtConstructorDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,20 +15,20 @@ import java.util.List; /** * DeclareAtConstructorDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has. - * - * Unsupported for JLS2. + * + * Unsupported for JLS2. */ public class DeclareAtConstructorDeclaration extends DeclareAnnotationDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclareAtConstructorDeclaration.class); - public static final ChildPropertyDescriptor PATTERN_PROPERTY = + public static final ChildPropertyDescriptor PATTERN_PROPERTY = internalPatternNodePropertyFactory(DeclareAtConstructorDeclaration.class); - public static final ChildPropertyDescriptor ANNOTATION_NAME_PROPERTY = + public static final ChildPropertyDescriptor ANNOTATION_NAME_PROPERTY = internalAnnotationNamePropertyFactory(DeclareAtConstructorDeclaration.class); private static final List PROPERTY_DESCRIPTORS; @@ -86,7 +86,7 @@ public class DeclareAtConstructorDeclaration extends DeclareAnnotationDeclaratio /* * (omit javadoc for this method) Method declared on BodyDeclaration. - * + * * There are no modifiers declared for DeclareErrorDeclaration - therefore * we don't do anything with this */ @@ -96,7 +96,7 @@ public class DeclareAtConstructorDeclaration extends DeclareAnnotationDeclaratio /* * (omit javadoc for this method) Method declared on BodyDeclaration. - * + * * There are no modifiers declared for DeclareErrorDeclaration - therefore * we don't do anything with this */ @@ -114,7 +114,7 @@ public class DeclareAtConstructorDeclaration extends DeclareAnnotationDeclaratio /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel * the API level; one of the <code>AST.JLS*</code> * constants diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtFieldDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtFieldDeclaration.java index 5c4268437..bf6dd0f0c 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtFieldDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtFieldDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,20 +15,20 @@ import java.util.List; /** * DeclareAtFieldDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has. - * - * Unsupported for JLS2. + * + * Unsupported for JLS2. */ public class DeclareAtFieldDeclaration extends DeclareAnnotationDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclareAtFieldDeclaration.class); - public static final ChildPropertyDescriptor PATTERN_PROPERTY = + public static final ChildPropertyDescriptor PATTERN_PROPERTY = internalPatternNodePropertyFactory(DeclareAtFieldDeclaration.class); - public static final ChildPropertyDescriptor ANNOTATION_NAME_PROPERTY = + public static final ChildPropertyDescriptor ANNOTATION_NAME_PROPERTY = internalAnnotationNamePropertyFactory(DeclareAtFieldDeclaration.class); private static final List PROPERTY_DESCRIPTORS; @@ -86,7 +86,7 @@ public class DeclareAtFieldDeclaration extends DeclareAnnotationDeclaration { /* * (omit javadoc for this method) Method declared on BodyDeclaration. - * + * * There are no modifiers declared for DeclareErrorDeclaration - therefore * we don't do anything with this */ @@ -96,7 +96,7 @@ public class DeclareAtFieldDeclaration extends DeclareAnnotationDeclaration { /* * (omit javadoc for this method) Method declared on BodyDeclaration. - * + * * There are no modifiers declared for DeclareErrorDeclaration - therefore * we don't do anything with this */ @@ -114,7 +114,7 @@ public class DeclareAtFieldDeclaration extends DeclareAnnotationDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel * the API level; one of the <code>AST.JLS*</code> * constants diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtMethodDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtMethodDeclaration.java index 1fab22b6b..df9212314 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtMethodDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,20 +15,20 @@ import java.util.List; /** * DeclareAtMethodDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has. - * - * Unsupported for JLS2. + * + * Unsupported for JLS2. */ public class DeclareAtMethodDeclaration extends DeclareAnnotationDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclareAtMethodDeclaration.class); - public static final ChildPropertyDescriptor PATTERN_PROPERTY = + public static final ChildPropertyDescriptor PATTERN_PROPERTY = internalPatternNodePropertyFactory(DeclareAtMethodDeclaration.class); - public static final ChildPropertyDescriptor ANNOTATION_NAME_PROPERTY = + public static final ChildPropertyDescriptor ANNOTATION_NAME_PROPERTY = internalAnnotationNamePropertyFactory(DeclareAtMethodDeclaration.class); private static final List PROPERTY_DESCRIPTORS; @@ -86,7 +86,7 @@ public class DeclareAtMethodDeclaration extends DeclareAnnotationDeclaration { /* * (omit javadoc for this method) Method declared on BodyDeclaration. - * + * * There are no modifiers declared for DeclareErrorDeclaration - therefore * we don't do anything with this */ @@ -96,7 +96,7 @@ public class DeclareAtMethodDeclaration extends DeclareAnnotationDeclaration { /* * (omit javadoc for this method) Method declared on BodyDeclaration. - * + * * There are no modifiers declared for DeclareErrorDeclaration - therefore * we don't do anything with this */ @@ -114,7 +114,7 @@ public class DeclareAtMethodDeclaration extends DeclareAnnotationDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel * the API level; one of the <code>AST.JLS*</code> * constants diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtTypeDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtTypeDeclaration.java index bbc2200d5..f0db5014f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtTypeDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareAtTypeDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,20 +15,20 @@ import java.util.List; /** * DeclareAtTypeDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has. - * - * Unsupported for JLS2. + * + * Unsupported for JLS2. */ public class DeclareAtTypeDeclaration extends DeclareAnnotationDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclareAtTypeDeclaration.class); - public static final ChildPropertyDescriptor PATTERN_PROPERTY = + public static final ChildPropertyDescriptor PATTERN_PROPERTY = internalPatternNodePropertyFactory(DeclareAtTypeDeclaration.class); - public static final ChildPropertyDescriptor ANNOTATION_NAME_PROPERTY = + public static final ChildPropertyDescriptor ANNOTATION_NAME_PROPERTY = internalAnnotationNamePropertyFactory(DeclareAtTypeDeclaration.class); private static final List PROPERTY_DESCRIPTORS; @@ -86,7 +86,7 @@ public class DeclareAtTypeDeclaration extends DeclareAnnotationDeclaration { /* * (omit javadoc for this method) Method declared on BodyDeclaration. - * + * * There are no modifiers declared for DeclareErrorDeclaration - therefore * we don't do anything with this */ @@ -96,7 +96,7 @@ public class DeclareAtTypeDeclaration extends DeclareAnnotationDeclaration { /* * (omit javadoc for this method) Method declared on BodyDeclaration. - * + * * There are no modifiers declared for DeclareErrorDeclaration - therefore * we don't do anything with this */ @@ -114,7 +114,7 @@ public class DeclareAtTypeDeclaration extends DeclareAnnotationDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel * the API level; one of the <code>AST.JLS*</code> * constants diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java index 5eb602344..873d0ff43 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareDeclaration.java @@ -2,9 +2,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -14,15 +14,15 @@ package org.aspectj.org.eclipse.jdt.core.dom; /** * DeclareDeclaration DOM AST node. - * + * * @author ajh02 */ public abstract class DeclareDeclaration extends BodyDeclaration { - + DeclareDeclaration(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -36,7 +36,7 @@ public abstract class DeclareDeclaration extends BodyDeclaration { int memSize() { return super.memSize() + 9 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -53,13 +53,13 @@ public abstract class DeclareDeclaration extends BodyDeclaration { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public IMethodBinding resolveBinding() { return null; // ajh02: :-/ //return this.ast.getBindingResolver().resolveMethod(this); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareErrorDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareErrorDeclaration.java index 886574048..58615159b 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareErrorDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareErrorDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,26 +15,26 @@ import java.util.List; /** * DeclareErrorDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has plus: * a PointcutDesignator called 'pointcut' * a StringLiteral called 'message' */ public class DeclareErrorDeclaration extends DeclareDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclareErrorDeclaration.class); - public static final ChildPropertyDescriptor POINTCUT_PROPERTY = + public static final ChildPropertyDescriptor POINTCUT_PROPERTY = new ChildPropertyDescriptor(DeclareErrorDeclaration.class, "pointcut", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - public static final ChildPropertyDescriptor MESSAGE_PROPERTY = + public static final ChildPropertyDescriptor MESSAGE_PROPERTY = new ChildPropertyDescriptor(DeclareErrorDeclaration.class, "message", StringLiteral.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - - private static final List PROPERTY_DESCRIPTORS_2_0; + + private static final List PROPERTY_DESCRIPTORS_2_0; private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(3); createPropertyList(DeclareErrorDeclaration.class, propertyList); @@ -42,7 +42,7 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { addProperty(POINTCUT_PROPERTY, propertyList); addProperty(MESSAGE_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(3); createPropertyList(DeclareErrorDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -50,14 +50,14 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { addProperty(MESSAGE_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + private PointcutDesignator pointcut; private StringLiteral message; - + DeclareErrorDeclaration(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -78,7 +78,7 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -97,8 +97,8 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ SimplePropertyDescriptor internalModifiersProperty() { @@ -107,8 +107,8 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ ChildListPropertyDescriptor internalModifiers2Property() { @@ -125,10 +125,10 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -139,14 +139,14 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -179,7 +179,7 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { return super.internalGetSetChildProperty(property, get, child); } - + public PointcutDesignator getPointcut(){ return pointcut; } @@ -192,11 +192,11 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { this.pointcut = pointcut; postReplaceChild(oldChild, pointcut, POINTCUT_PROPERTY); } - + public StringLiteral getMessage(){ return message; } - + public void setMessage(StringLiteral message) { if (message == null) { throw new IllegalArgumentException(); @@ -206,5 +206,5 @@ public class DeclareErrorDeclaration extends DeclareDeclaration { this.message = message; postReplaceChild(oldChild, message, MESSAGE_PROPERTY); } - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareParentsDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareParentsDeclaration.java index 0961d4e8d..3443fb5a9 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareParentsDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareParentsDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,7 +15,7 @@ import java.util.List; /** * DeclareParentsDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has plus: * a TypePattern called 'childTypePattern' * a boolean called 'isExtends' @@ -23,21 +23,21 @@ import java.util.List; */ public class DeclareParentsDeclaration extends DeclareDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclareParentsDeclaration.class); - public static final ChildPropertyDescriptor CHILD_TYPE_PATTERN_PROPERTY = + public static final ChildPropertyDescriptor CHILD_TYPE_PATTERN_PROPERTY = new ChildPropertyDescriptor(DeclareParentsDeclaration.class, "childTypePattern", TypePattern.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - public static final SimplePropertyDescriptor IS_EXTENDS_PROPERTY = + public static final SimplePropertyDescriptor IS_EXTENDS_PROPERTY = new SimplePropertyDescriptor(DeclareParentsDeclaration.class, "isExtends", boolean.class, MANDATORY); //$NON-NLS-1$ - - public static final ChildListPropertyDescriptor PARENTS_TYPE_PATTERNS_LIST_PROPERTY = + + public static final ChildListPropertyDescriptor PARENTS_TYPE_PATTERNS_LIST_PROPERTY = new ChildListPropertyDescriptor(DeclareParentsDeclaration.class, "typePatternsList", TypePattern.class, NO_CYCLE_RISK); //$NON-NLS-1$ - - private static final List PROPERTY_DESCRIPTORS_2_0; + + private static final List PROPERTY_DESCRIPTORS_2_0; private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(4); createPropertyList(DeclareParentsDeclaration.class, propertyList); @@ -46,7 +46,7 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { addProperty(IS_EXTENDS_PROPERTY, propertyList); addProperty(PARENTS_TYPE_PATTERNS_LIST_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(4); createPropertyList(DeclareParentsDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -60,16 +60,16 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { private TypePattern childTypePattern; protected ASTNode.NodeList parentTypePatterns =new ASTNode.NodeList(PARENTS_TYPE_PATTERNS_LIST_PROPERTY); - + DeclareParentsDeclaration(AST ast) { this(ast,false); } - + DeclareParentsDeclaration(AST ast, boolean isExtends) { super(ast); this.isExtends = isExtends; } - + ASTNode clone0(AST target) { DeclareParentsDeclaration result = new DeclareParentsDeclaration(target/*,declareDecl*/); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -87,7 +87,7 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -106,8 +106,8 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ SimplePropertyDescriptor internalModifiersProperty() { @@ -116,8 +116,8 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ ChildListPropertyDescriptor internalModifiers2Property() { @@ -134,10 +134,10 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -148,14 +148,14 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -194,7 +194,7 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { } return super.internalGetSetBooleanProperty(property,get,value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -205,23 +205,23 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /** * Returns the live ordered list of parent type patterns for this * declare precedence. - * + * * @return the live list of parent type patterns * (element type: <code>TypePattern</code>) - */ + */ public List parentTypePatterns() { return this.parentTypePatterns; } - - + + public TypePattern getChildTypePattern(){ return childTypePattern; } - + public void setChildTypePattern(TypePattern typePattern) { if (typePattern == null) { throw new IllegalArgumentException(); @@ -235,24 +235,24 @@ public class DeclareParentsDeclaration extends DeclareDeclaration { /** * Returns whether this declareParents declares an extends * or implements. - * + * * @return <code>true</code> if this is an extends declaration, * and <code>false</code> if this is an implements declaration - */ + */ public boolean isExtends() { return this.isExtends; } - + /** * Sets whether this declareParents declares an extends or implements. - * + * * @param isExtends <code>true</code> for an extends declaration, * and <code>false</code> for an implements declaration - */ + */ public void setExtends(boolean isExtends) { preValueChange(IS_EXTENDS_PROPERTY); this.isExtends = isExtends; postValueChange(IS_EXTENDS_PROPERTY); } - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclarePrecedenceDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclarePrecedenceDeclaration.java index a40c70f41..1b50f431e 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclarePrecedenceDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclarePrecedenceDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -16,41 +16,41 @@ import java.util.List; /** * DeclarePrecedenceDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has plus: * a TypePattern list called 'parentTypePatterns' */ public class DeclarePrecedenceDeclaration extends DeclareDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclarePrecedenceDeclaration.class); - - public static final ChildListPropertyDescriptor TYPE_PATTERNS_LIST_PROPERTY = + + public static final ChildListPropertyDescriptor TYPE_PATTERNS_LIST_PROPERTY = new ChildListPropertyDescriptor(DeclarePrecedenceDeclaration.class, "parentTypePatterns", TypePattern.class, NO_CYCLE_RISK); //$NON-NLS-1$ - - private static final List PROPERTY_DESCRIPTORS_2_0; + + private static final List PROPERTY_DESCRIPTORS_2_0; private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(2); createPropertyList(DeclarePrecedenceDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); addProperty(TYPE_PATTERNS_LIST_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(2); createPropertyList(DeclarePrecedenceDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); addProperty(TYPE_PATTERNS_LIST_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + protected ASTNode.NodeList typePatterns =new ASTNode.NodeList(TYPE_PATTERNS_LIST_PROPERTY); - + DeclarePrecedenceDeclaration(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -71,7 +71,7 @@ public class DeclarePrecedenceDeclaration extends DeclareDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -89,8 +89,8 @@ public class DeclarePrecedenceDeclaration extends DeclareDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ SimplePropertyDescriptor internalModifiersProperty() { @@ -99,8 +99,8 @@ public class DeclarePrecedenceDeclaration extends DeclareDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ ChildListPropertyDescriptor internalModifiers2Property() { @@ -117,10 +117,10 @@ public class DeclarePrecedenceDeclaration extends DeclareDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -131,14 +131,14 @@ public class DeclarePrecedenceDeclaration extends DeclareDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -165,18 +165,18 @@ public class DeclarePrecedenceDeclaration extends DeclareDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /** * Returns the live ordered list of type patterns for this * declare precedence. - * + * * @return the live list of type patterns * (element type: <code>TypePattern</code>) - */ + */ public List typePatterns() { return this.typePatterns; } - + int treeSize() { return memSize() diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareSoftDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareSoftDeclaration.java index 34c40f14e..ae760e84b 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareSoftDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareSoftDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,26 +15,26 @@ import java.util.List; /** * DeclareSoftDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has plus: * a Type called 'type' * a PointcutDesignator called 'pointcut' */ public class DeclareSoftDeclaration extends DeclareDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclareSoftDeclaration.class); - public static final ChildPropertyDescriptor TYPE_PATTERN_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PATTERN_PROPERTY = new ChildPropertyDescriptor(DeclareSoftDeclaration.class, "typePattern", TypePattern.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - public static final ChildPropertyDescriptor POINTCUT_PROPERTY = + public static final ChildPropertyDescriptor POINTCUT_PROPERTY = new ChildPropertyDescriptor(DeclareSoftDeclaration.class, "pointcut", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - private static final List PROPERTY_DESCRIPTORS_2_0; + private static final List PROPERTY_DESCRIPTORS_2_0; private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(3); createPropertyList(DeclareSoftDeclaration.class, propertyList); @@ -42,7 +42,7 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { addProperty(POINTCUT_PROPERTY, propertyList); addProperty(TYPE_PATTERN_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(3); createPropertyList(DeclareSoftDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -50,14 +50,14 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { addProperty(TYPE_PATTERN_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + private TypePattern typePattern; private PointcutDesignator pointcut; - + DeclareSoftDeclaration(AST ast) { super(ast); } - + ASTNode clone0(AST target) { DeclareSoftDeclaration result = new DeclareSoftDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -73,7 +73,7 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -89,11 +89,11 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { ((AjASTVisitor)visitor).endVisit(this); } } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ SimplePropertyDescriptor internalModifiersProperty() { @@ -102,8 +102,8 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ ChildListPropertyDescriptor internalModifiers2Property() { @@ -120,10 +120,10 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -134,14 +134,14 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -173,11 +173,11 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + public TypePattern getTypePattern(){ return typePattern; } - + public void setTypePattern(TypePattern typePattern) { if (typePattern == null) { throw new IllegalArgumentException(); @@ -187,11 +187,11 @@ public class DeclareSoftDeclaration extends DeclareDeclaration { this.typePattern = typePattern; postReplaceChild(oldChild, typePattern, TYPE_PATTERN_PROPERTY); } - + public PointcutDesignator getPointcut(){ return pointcut; } - + public void setPointcut(PointcutDesignator pointcut) { if (pointcut == null) { throw new IllegalArgumentException(); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareWarningDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareWarningDeclaration.java index dfaba4cb9..ec23be694 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareWarningDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DeclareWarningDeclaration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,26 +15,26 @@ import java.util.List; /** * DeclareWarningDeclaration DOM AST node. - * + * * Has everything a DeclareDeclaration has plus: * a PointcutDesignator called 'pointcut' * a StringLiteral called 'message' */ public class DeclareWarningDeclaration extends DeclareDeclaration { - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(DeclareWarningDeclaration.class); - - public static final ChildPropertyDescriptor POINTCUT_PROPERTY = + + public static final ChildPropertyDescriptor POINTCUT_PROPERTY = new ChildPropertyDescriptor(DeclareWarningDeclaration.class, "pointcut", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - public static final ChildPropertyDescriptor MESSAGE_PROPERTY = + public static final ChildPropertyDescriptor MESSAGE_PROPERTY = new ChildPropertyDescriptor(DeclareWarningDeclaration.class, "message", StringLiteral.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - private static final List PROPERTY_DESCRIPTORS_2_0; + private static final List PROPERTY_DESCRIPTORS_2_0; private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(3); createPropertyList(DeclareWarningDeclaration.class, propertyList); @@ -42,7 +42,7 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { addProperty(POINTCUT_PROPERTY, propertyList); addProperty(MESSAGE_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(3); createPropertyList(DeclareWarningDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -53,11 +53,11 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { private PointcutDesignator pointcut; private StringLiteral message; - + DeclareWarningDeclaration(AST ast) { super(ast); } - + ASTNode clone0(AST target) { DeclareWarningDeclaration result = new DeclareWarningDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -72,7 +72,7 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -88,11 +88,11 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { ((AjASTVisitor)visitor).endVisit(this); } } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ SimplePropertyDescriptor internalModifiersProperty() { @@ -101,8 +101,8 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. - * - * There are no modifiers declared for DeclareErrorDeclaration - + * + * There are no modifiers declared for DeclareErrorDeclaration - * therefore we don't do anything with this */ ChildListPropertyDescriptor internalModifiers2Property() { @@ -119,10 +119,10 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -133,14 +133,14 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -172,11 +172,11 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + public PointcutDesignator getPointcut(){ return pointcut; } - + public void setPointcut(PointcutDesignator pointcut) { if (pointcut == null) { throw new IllegalArgumentException(); @@ -186,11 +186,11 @@ public class DeclareWarningDeclaration extends DeclareDeclaration { this.pointcut = pointcut; postReplaceChild(oldChild, pointcut, POINTCUT_PROPERTY); } - + public StringLiteral getMessage(){ return message; } - + public void setMessage(StringLiteral message) { if (message == null) { throw new IllegalArgumentException(); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java index bb05896fb..6bf520a4e 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DefaultPointcut.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -15,9 +15,9 @@ import java.util.List; /** * DefaultPointcut DOM AST node. has: nothing - * + * * This class is a stub and should be deleted when concrete subclasses exist for all the different types of pointcuts in AspectJ. - * + * * @author ajh02 */ @@ -74,4 +74,4 @@ public class DefaultPointcut extends PointcutDesignator { int treeSize() { return memSize(); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DefaultTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DefaultTypePattern.java index b9ca939e1..eae206a46 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DefaultTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/DefaultTypePattern.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,7 +15,7 @@ import java.util.List; /** * DefaultTypePattern DOM AST node. has: nothing - * + * * This class is a stub and should be deleted when concrete subclasses exist for all the different TypePattern's in AspectJ. */ public class DefaultTypePattern extends TypePattern { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/EllipsisTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/EllipsisTypePattern.java index 332fe1a60..6e6d78813 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/EllipsisTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/EllipsisTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -28,7 +28,7 @@ public class EllipsisTypePattern extends TypePattern { node.setSourceRange(getStartPosition(), getLength()); return node; } - + boolean subtreeMatch0(ASTMatcher matcher, Object other) { if (matcher instanceof AjASTMatcher) { AjASTMatcher ajmatcher = (AjASTMatcher) matcher; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/ExactTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/ExactTypePattern.java index c43adff00..0385d13d2 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/ExactTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/ExactTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -31,7 +31,7 @@ public class ExactTypePattern extends IdentifierTypePattern { node.setSourceRange(getStartPosition(), getLength()); return node; } - + boolean subtreeMatch0(ASTMatcher matcher, Object other) { if (matcher instanceof AjASTMatcher) { AjASTMatcher ajmatcher = (AjASTMatcher) matcher; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/FormalBinding.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/FormalBinding.java index f84c74ab7..23524debc 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/FormalBinding.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/FormalBinding.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -17,7 +17,7 @@ public class FormalBinding extends Type { private String binding; /** - * + * * @param type * must not be null * @param binding diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/HasMemberTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/HasMemberTypePattern.java index 8ba7c7d06..a98a1d5b8 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/HasMemberTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/HasMemberTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/IdentifierTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/IdentifierTypePattern.java index f7ab856cf..5c18f9450 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/IdentifierTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/IdentifierTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -22,7 +22,7 @@ public abstract class IdentifierTypePattern extends TypePattern { /** * This may be null if no Type has been resolved. A String representation * may still exist. - * + * * @return type if defined or resolved, or null if not defined or resolved * at the time when this node is created */ @@ -32,7 +32,7 @@ public abstract class IdentifierTypePattern extends TypePattern { /** * Generate an expression (String representation) for the given type. - * + * * @param type * @return non-null expression for the given type. Null if no expression can * be generated. diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java index 80859baf3..7349f68cc 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/InterTypeFieldDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -15,7 +15,7 @@ package org.aspectj.org.eclipse.jdt.core.dom; * InterTypeFieldDeclaration DOM AST node. * has: * everything FieldDeclarations have - * + * * Refused Bequest: * has the variableDeclarationFragments list * it redundantly inherits from FieldDeclaration @@ -33,14 +33,14 @@ public class InterTypeFieldDeclaration extends FieldDeclaration { super(ast); } - public String getOnType() { + public String getOnType() { return onType; } - + public void setOnType(String onType) { this.onType = onType; } - + ASTNode clone0(AST target) { InterTypeFieldDeclaration result = new InterTypeFieldDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -57,7 +57,7 @@ public class InterTypeFieldDeclaration extends FieldDeclaration { ASTNode.copySubtrees(target, fragments())); return result; } - + void accept0(ASTVisitor visitor) { if (visitor instanceof AjASTVisitor) { boolean visitChildren = ((AjASTVisitor)visitor).visit(this); @@ -73,4 +73,4 @@ public class InterTypeFieldDeclaration extends FieldDeclaration { ((AjASTVisitor)visitor).endVisit(this); } } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java index 9aa4ba978..7439f3eb8 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/InterTypeMethodDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -21,7 +21,7 @@ import org.aspectj.org.eclipse.jdt.core.dom.Type; * InterTypeMethodDeclaration DOM AST node. * has: * everything MethodDeclarations have - * + * * Note: * should also have the name of the type it's declared on! * @author ajh02 @@ -29,15 +29,15 @@ import org.aspectj.org.eclipse.jdt.core.dom.Type; public class InterTypeMethodDeclaration extends MethodDeclaration { private String onType; - + InterTypeMethodDeclaration(AST ast) { super(ast); } - public String getOnType() { + public String getOnType() { return onType; } - + public void setOnType(String onType) { this.onType = onType; } @@ -73,13 +73,13 @@ public class InterTypeMethodDeclaration extends MethodDeclaration { (Block) ASTNode.copySubtree(target, getBody())); return result; } - - - + + + /* (omit javadoc for this method) * Method declared on ASTNode. */ - void accept0(ASTVisitor visitor) { + void accept0(ASTVisitor visitor) { if (visitor instanceof AjASTVisitor) { AjASTVisitor ajvis = (AjASTVisitor)visitor; boolean visitChildren = ajvis.visit(this); @@ -102,4 +102,4 @@ public class InterTypeMethodDeclaration extends MethodDeclaration { ajvis.endVisit(this); } } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NoTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NoTypePattern.java index 7ae1bd471..5fdec4e3a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NoTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NoTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -30,7 +30,7 @@ public class NoTypePattern extends TypePattern { node.setSourceRange(getStartPosition(), getLength()); return node; } - + void accept0(ASTVisitor visitor) { if (visitor instanceof AjASTVisitor) { AjASTVisitor ajVisitor = (AjASTVisitor) visitor; @@ -38,7 +38,7 @@ public class NoTypePattern extends TypePattern { ajVisitor.endVisit(this); } } - + boolean subtreeMatch0(ASTMatcher matcher, Object other) { if (matcher instanceof AjASTMatcher) { AjASTMatcher ajmatcher = (AjASTMatcher) matcher; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java index fc0408ea7..1d1b319e2 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NotPointcut.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -21,14 +21,14 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * has: * everything PointcutDesignators have * a PointcutDesignator called 'body' - * + * * @author ajh02 */ -public class NotPointcut extends PointcutDesignator { - +public class NotPointcut extends PointcutDesignator { + private PointcutDesignator body = null; - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(NotPointcut.class, "body", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public PointcutDesignator getBody() { return this.body; @@ -42,10 +42,10 @@ public class NotPointcut extends PointcutDesignator { this.body = body; postReplaceChild(oldChild, body, BODY_PROPERTY); } - - - - + + + + NotPointcut(AST ast) { super(ast); } @@ -96,4 +96,4 @@ public class NotPointcut extends PointcutDesignator { memSize() + (this.body == null ? 0 : getBody().treeSize()); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NotTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NotTypePattern.java index b9a0dc4cf..882aadb02 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NotTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/NotTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -17,7 +17,7 @@ public class NotTypePattern extends TypePattern { /** * The negated type pattern cannot be null - * + * * @param ast * not null * @param negatedPattern @@ -53,7 +53,7 @@ public class NotTypePattern extends TypePattern { ajVisitor.endVisit(this); } } - + boolean subtreeMatch0(ASTMatcher matcher, Object other) { if (matcher instanceof AjASTMatcher) { AjASTMatcher ajmatcher = (AjASTMatcher) matcher; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java index 2fb1cee2c..59b59e915 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/OrPointcut.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -22,13 +22,13 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * everything PointcutDesignators have * a PointcutDesignator called 'left' * a PointcutDesignator called 'right' - * + * * @author ajh02 */ -public class OrPointcut extends PointcutDesignator { - +public class OrPointcut extends PointcutDesignator { + private PointcutDesignator left = null; - public static final ChildPropertyDescriptor LEFT_PROPERTY = + public static final ChildPropertyDescriptor LEFT_PROPERTY = new ChildPropertyDescriptor(OrPointcut.class, "left", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public PointcutDesignator getLeft() { return this.left; @@ -42,9 +42,9 @@ public class OrPointcut extends PointcutDesignator { this.left = left; postReplaceChild(oldChild, left, LEFT_PROPERTY); } - + private PointcutDesignator right = null; - public static final ChildPropertyDescriptor RIGHT_PROPERTY = + public static final ChildPropertyDescriptor RIGHT_PROPERTY = new ChildPropertyDescriptor(OrPointcut.class, "right", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public PointcutDesignator getRight() { return this.right; @@ -58,10 +58,10 @@ public class OrPointcut extends PointcutDesignator { this.right = right; postReplaceChild(oldChild, right, RIGHT_PROPERTY); } - - - - + + + + OrPointcut(AST ast) { super(ast); } @@ -123,4 +123,4 @@ public class OrPointcut extends PointcutDesignator { + (this.left == null ? 0 : getLeft().treeSize()) + (this.right == null ? 0 : getRight().treeSize()); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/OrTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/OrTypePattern.java index c7545d359..68239ffcd 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/OrTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/OrTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PatternNode.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PatternNode.java index d0590a00e..fc145f06f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PatternNode.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PatternNode.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006, 2010 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006, 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version * Nieraj Singh *******************************************************************/ @@ -28,5 +28,5 @@ public abstract class PatternNode extends ASTNode { int memSize() { return 0; // stub method } - + } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java index 106a99c22..d8314c543 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerCflow.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -21,16 +21,16 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * has: * everything PointcutDesignators have * a PointcutDesignator called 'body' - * + * * @author ajh02 */ -public class PerCflow extends PointcutDesignator { +public class PerCflow extends PointcutDesignator { // ajh02: should make an abstract PerClause Pointcut parent // of this and all the other PerClause nodes - - + + private PointcutDesignator body = null; - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(PerCflow.class, "body", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public PointcutDesignator getBody() { return this.body; @@ -44,7 +44,7 @@ public class PerCflow extends PointcutDesignator { this.body = body; postReplaceChild(oldChild, body, BODY_PROPERTY); } - + private boolean isBelow = false; // percflow or percflowbelow public boolean isBelow(){ return isBelow; @@ -52,9 +52,9 @@ public class PerCflow extends PointcutDesignator { public void setIsBelow(boolean isBelow){ this.isBelow = isBelow; } - - - + + + PerCflow(AST ast) { super(ast); } @@ -106,4 +106,4 @@ public class PerCflow extends PointcutDesignator { memSize() + (this.body == null ? 0 : getBody().treeSize()); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java index a288611fa..cdd25c7e6 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerObject.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -21,16 +21,16 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * has: * everything PointcutDesignators have * a PointcutDesignator called 'body' - * + * * @author ajh02 */ -public class PerObject extends PointcutDesignator { +public class PerObject extends PointcutDesignator { // ajh02: should make an abstract PerClause Pointcut parent // of this and all the other PerClause nodes - - + + private PointcutDesignator body = null; - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(PerObject.class, "body", PointcutDesignator.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public PointcutDesignator getBody() { return this.body; @@ -44,7 +44,7 @@ public class PerObject extends PointcutDesignator { this.body = body; postReplaceChild(oldChild, body, BODY_PROPERTY); } - + private boolean isThis = false; // if it's not a perthis, it's a pertarget public boolean isThis(){ return isThis; @@ -52,9 +52,9 @@ public class PerObject extends PointcutDesignator { public void setIsThis(boolean isThis){ this.isThis = isThis; } - - - + + + PerObject(AST ast) { super(ast); } @@ -106,4 +106,4 @@ public class PerObject extends PointcutDesignator { memSize() + (this.body == null ? 0 : getBody().treeSize()); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java index 8b6d22c39..88d828207 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PerTypeWithin.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -20,13 +20,13 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * OrPointcut DOM AST node. * has: * everything PointcutDesignators have - * + * * note: * should also have a typepattern or something. I haven't put one in yet. * @author ajh02 */ -public class PerTypeWithin extends PointcutDesignator { - +public class PerTypeWithin extends PointcutDesignator { + PerTypeWithin(AST ast) { super(ast); } @@ -68,4 +68,4 @@ public class PerTypeWithin extends PointcutDesignator { return memSize(); // stub } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java index 15069516d..0a0cc8f7f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PointcutDeclaration.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -22,39 +22,39 @@ import java.util.List; * a SingleVariableDeclaration list called 'parameters' * javadoc * modifiers - * + * * note: * should also have a property for its parameter list, * like the one MethodDeclarations have. * @author ajh02 */ public class PointcutDeclaration extends BodyDeclaration { - + private SimpleName pointcutName = null; - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(PointcutDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - + private PointcutDesignator pointcutDesignator = null; - public static final ChildPropertyDescriptor DESIGNATOR_PROPERTY = + public static final ChildPropertyDescriptor DESIGNATOR_PROPERTY = new ChildPropertyDescriptor(PointcutDeclaration.class, "designator", PointcutDesignator.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "parameters" structural property of this node type. */ - public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(PointcutDeclaration.class, "parameters", SingleVariableDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - + public PointcutDesignator getDesignator() { return this.pointcutDesignator; } - + public void setDesignator(PointcutDesignator pointcutDesignator) { ASTNode oldChild = this.pointcutDesignator; preReplaceChild(oldChild, pointcutDesignator, DESIGNATOR_PROPERTY); this.pointcutDesignator = pointcutDesignator; postReplaceChild(oldChild, pointcutDesignator, DESIGNATOR_PROPERTY); } - + public SimpleName getName() { if (this.pointcutName == null) { // lazy init must be thread-safe for readers @@ -68,7 +68,7 @@ public class PointcutDeclaration extends BodyDeclaration { } return this.pointcutName; } - + public void setName(SimpleName pointcutName) { if (pointcutName == null) { throw new IllegalArgumentException(); @@ -78,44 +78,44 @@ public class PointcutDeclaration extends BodyDeclaration { this.pointcutName = pointcutName; postReplaceChild(oldChild, pointcutName, NAME_PROPERTY); } - + /** * The "javadoc" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(PointcutDeclaration.class); /** * The "modifiers" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = internalModifiersPropertyFactory(PointcutDeclaration.class); - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(PointcutDeclaration.class); - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(6); createPropertyList(PointcutDeclaration.class, propertyList); @@ -124,9 +124,9 @@ public class PointcutDeclaration extends BodyDeclaration { addProperty(NAME_PROPERTY, propertyList); addProperty(DESIGNATOR_PROPERTY, propertyList); addProperty(PARAMETERS_PROPERTY, propertyList); - + PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(6); createPropertyList(PointcutDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -134,18 +134,18 @@ public class PointcutDeclaration extends BodyDeclaration { addProperty(NAME_PROPERTY, propertyList); addProperty(DESIGNATOR_PROPERTY, propertyList); addProperty(PARAMETERS_PROPERTY, propertyList); - + PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -158,20 +158,20 @@ public class PointcutDeclaration extends BodyDeclaration { } /** - * Creates a new unparented field declaration statement node owned + * Creates a new unparented field declaration statement node owned * by the given AST. By default, the field declaration has: no modifiers, - * an unspecified (but legal) type, and an empty list of variable + * an unspecified (but legal) type, and an empty list of variable * declaration fragments (which is syntactically illegal). * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ PointcutDeclaration(AST ast) { super(ast); } - + protected ASTNode.NodeList parameters = new ASTNode.NodeList(PARAMETERS_PROPERTY); @@ -182,7 +182,7 @@ public class PointcutDeclaration extends BodyDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -230,7 +230,7 @@ public class PointcutDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -244,7 +244,7 @@ public class PointcutDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -295,7 +295,7 @@ public class PointcutDeclaration extends BodyDeclaration { ASTNode.copySubtrees(target, parameters())); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -303,7 +303,7 @@ public class PointcutDeclaration extends BodyDeclaration { // dispatch to correct overloaded match method return ((AjASTMatcher)matcher).match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -324,25 +324,25 @@ public class PointcutDeclaration extends BodyDeclaration { ajvis.endVisit(this); } } - + /** * Returns the live ordered list of method parameter declarations for this * method declaration. - * + * * @return the live list of method parameter declarations * (element type: <code>SingleVariableDeclaration</code>) - */ + */ public List parameters() { return this.parameters; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PointcutDesignator.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PointcutDesignator.java index 9a54578cc..97e2f95bf 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PointcutDesignator.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/PointcutDesignator.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -17,7 +17,7 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * abstract PointcutDesignator DOM AST node. * has: * nothing at the moment - * + * * @author ajh02 */ public abstract class PointcutDesignator extends ASTNode { @@ -30,4 +30,4 @@ public abstract class PointcutDesignator extends ASTNode { int memSize() { return 0; // ajh02: stub method } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java index 7ecd8b5c1..3df384d4a 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/ReferencePointcut.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -20,15 +20,15 @@ import org.aspectj.org.eclipse.jdt.core.dom.ASTNode; * ReferencePointcut DOM AST node. * has: * a name - * + * * note: * should also have a parameter list like method invokations do? * @author ajh02 */ -public class ReferencePointcut extends PointcutDesignator { - +public class ReferencePointcut extends PointcutDesignator { + private SimpleName pointcutName = null; - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(ReferencePointcut.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ public SimpleName getName() { if (this.pointcutName == null) { @@ -52,10 +52,10 @@ public class ReferencePointcut extends PointcutDesignator { this.pointcutName = pointcutName; postReplaceChild(oldChild, pointcutName, NAME_PROPERTY); } - - - - + + + + ReferencePointcut(AST ast) { super(ast); } @@ -106,4 +106,4 @@ public class ReferencePointcut extends PointcutDesignator { memSize() + (this.pointcutName == null ? 0 : getName().treeSize()); } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/SignaturePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/SignaturePattern.java index 77a875ac2..0882bcafb 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/SignaturePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/SignaturePattern.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,7 +15,7 @@ import java.util.List; /** * SignaturePattern DOM AST node. has: nothing - * + * * For the moment this does nothing except enable us to set a SignaturePattern for the declare annotation declarations */ public class SignaturePattern extends PatternNode { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/TypeCategoryTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/TypeCategoryTypePattern.java index 1b9c08d2e..d932caab3 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/TypeCategoryTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/TypeCategoryTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -24,9 +24,9 @@ public class TypeCategoryTypePattern extends TypePattern { public static final int ANNOTATION = org.aspectj.weaver.patterns.TypeCategoryTypePattern.ANNOTATION; /** - * + * * See the weaver implementation for the type categories. - * + * * @see org.aspectj.weaver.patterns.TypeCategoryTypePattern * @param ast * must not be null @@ -39,9 +39,9 @@ public class TypeCategoryTypePattern extends TypePattern { } /** - * + * * See the weaver implementation for the type categories. - * + * * @see org.aspectj.weaver.patterns.TypeCategoryTypePattern * @return type category */ diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/TypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/TypePattern.java index a58782216..d296dbef3 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/TypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/TypePattern.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006, 2010 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006, 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version * Nieraj Singh *******************************************************************/ @@ -17,7 +17,7 @@ package org.aspectj.org.eclipse.jdt.core.dom; public abstract class TypePattern extends PatternNode { private String typePatternExpression; - + public static final String EMPTY_EXPRESSION = ""; TypePattern(AST ast) { @@ -42,7 +42,7 @@ public abstract class TypePattern extends PatternNode { * Return the type pattern in expression form (String representation). In * many cases, this is not null, although it may be null in some cases like * the NoTypePattern - * + * * @return String expression of the type pattern. May be null. */ public String getTypePatternExpression() { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/WildTypePattern.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/WildTypePattern.java index 90f31246d..1a50f9fdc 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/WildTypePattern.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/WildTypePattern.java @@ -1,10 +1,10 @@ /******************************************************************** - * Copyright (c) 2010 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 - * + * Copyright (c) 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: Nieraj Singh - initial implementation *******************************************************************/ package org.aspectj.org.eclipse.jdt.core.dom; @@ -15,7 +15,7 @@ public class WildTypePattern extends IdentifierTypePattern { /** * Use this constructor if Type is known - * + * * @param ast * @param type */ @@ -25,7 +25,7 @@ public class WildTypePattern extends IdentifierTypePattern { /** * Use this constructor if Type cannot be determined - * + * * @param ast * @param typeExpression */ @@ -48,7 +48,7 @@ public class WildTypePattern extends IdentifierTypePattern { return cloned; } - + boolean subtreeMatch0(ASTMatcher matcher, Object other) { if (matcher instanceof AjASTMatcher) { AjASTMatcher ajmatcher = (AjASTMatcher) matcher; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/tools/ajc/Main.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/tools/ajc/Main.java index 1f29d5835..ffeadba95 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/tools/ajc/Main.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/tools/ajc/Main.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.tools.ajc; @@ -44,19 +44,19 @@ import org.aspectj.weaver.Dump; * error stream. * <p> * Clients can handle all messages by registering a holder: - * + * * <pre> * Main main = new Main(); * IMessageHolder holder = new MessageHandler(); * main.setHolder(holder); * </pre> - * + * * Clients can get control after each command completes by installing a Runnable: - * + * * <pre> * main.setCompletionRunner(new Runnable() {..}); * </pre> - * + * */ public class Main { /** Header used when rendering exceptions for users */ @@ -88,7 +88,7 @@ public class Main { * Convenience method to run ajc and collect String lists of messages. This can be reflectively invoked with the List collecting * parameters supplied by a parent class loader. The String messages take the same form as command-line messages. * This method does not catch unchecked exceptions thrown by the compiler. - * + * * @param args the String[] args to pass to the compiler * @param useSystemExit if true and errors, return System.exit(errs) * @param fails the List sink, if any, for String failure (or worse) messages @@ -217,7 +217,7 @@ public class Main { /** * Run without throwing exceptions but optionally using System.exit(..). This sets up a message handler which emits messages * immediately, so report(boolean, IMessageHandler) only reports total number of errors or warnings. - * + * * @param args the String[] command line for the compiler * @param useSystemExit if true, use System.exit(int) to complete unless one of the args is -noExit. and signal result (0 no * exceptions/error, <0 exceptions, >0 compiler errors). @@ -322,7 +322,7 @@ public class Main { * </ul> * When complete, this contains all the messages of the final run of the command and/or any FAIL messages produced in running * the command, including any Throwable thrown by the command itself. - * + * * @param args the String[] command line for the compiler * @param holder the MessageHandler sink for messages. */ @@ -430,7 +430,7 @@ public class Main { /** * Set holder to be passed all messages. When holder is set, messages will not be printed by default. - * + * * @param holder the IMessageHolder sink for all messages (use null to restore default behavior) */ public void setHolder(IMessageHolder holder) { @@ -443,7 +443,7 @@ public class Main { /** * Install a Runnable to be invoked synchronously after each compile completes. - * + * * @param runner the Runnable to invoke - null to disable */ public void setCompletionRunner(Runnable runner) { @@ -452,7 +452,7 @@ public class Main { /** * Call System.exit(int) with values derived from the number of failures/aborts or errors in messages. - * + * * @param messages the IMessageHolder to interrogate. */ protected void systemExit(IMessageHolder messages) { @@ -466,7 +466,7 @@ public class Main { } System.exit(0); } - + /** Messages to the user */ protected void outMessage(String message) { // XXX coordinate with MessagePrinter @@ -478,10 +478,10 @@ public class Main { * Report results from a (possibly-incremental) compile run. This delegates to any reportHandler or otherwise prints summary * counts of errors/warnings to System.err (if any errors) or System.out (if only warnings). WARNING: this silently ignores * other messages like FAIL, but clears the handler of all messages when returning true. XXX false - * + * * This implementation ignores the pass parameter but clears the holder after reporting on the assumption messages were * handled/printed already. (ignoring UnsupportedOperationException from holder.clearMessages()). - * + * * @param pass true result of the command * @param holder IMessageHolder with messages from the command * @return false if the process should abort @@ -530,7 +530,7 @@ public class Main { /** * Print errors and warnings to System.err, and optionally info to System.out, rendering message String only. - * + * * @return false always */ @Override @@ -547,7 +547,7 @@ public class Main { /** * Render message differently. If abort, then prefix stack trace with feedback request. If the actual message is empty, then * use toString on the whole. Prefix message part with file:line; If it has context, suffix message with context. - * + * * @param message the IMessage to render * @return String rendering IMessage (never null) */ @@ -624,7 +624,7 @@ public class Main { /** * No-op - * + * * @see org.aspectj.bridge.IMessageHandler#isIgnoring(org.aspectj.bridge.IMessage.Kind) * @param kind */ @@ -652,7 +652,7 @@ public class Main { /** * No-op - * + * * @see org.aspectj.bridge.IMessageHandler#ignore(org.aspectj.bridge.IMessage.Kind) * @param kind */ diff --git a/org.aspectj.ajdt.core/src/test/java/AroundAMain.java b/org.aspectj.ajdt.core/src/test/java/AroundAMain.java index 9dce77d1e..24ada5132 100644 --- a/org.aspectj.ajdt.core/src/test/java/AroundAMain.java +++ b/org.aspectj.ajdt.core/src/test/java/AroundAMain.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/test/java/Eajc515ModuleTests.java b/org.aspectj.ajdt.core/src/test/java/Eajc515ModuleTests.java index 094ab29c2..85391c21e 100644 --- a/org.aspectj.ajdt.core/src/test/java/Eajc515ModuleTests.java +++ b/org.aspectj.ajdt.core/src/test/java/Eajc515ModuleTests.java @@ -1,10 +1,10 @@ ///******************************************************************************* // * Copyright (c) 2006 IBM Corporation and others. -// * All rights reserved. This program and the accompanying materials -// * are made available under the terms of the Eclipse Public License v1.0 +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v 2.0 // * which accompanies this distribution, and is available at -// * http://www.eclipse.org/legal/epl-v10.html -// * +// * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt +// * // * Contributors: // * Matthew Webster - initial implementation // *******************************************************************************/ @@ -13,7 +13,7 @@ // //public class Eajc515ModuleTests extends TestCase { // -// public static Test suite() { +// public static Test suite() { // TestSuite suite = new TestSuite(Eajc515ModuleTests.class.getName()); // suite.addTest(org.aspectj.tools.ajc.Ajc5Tests.suite()); // return suite; @@ -21,4 +21,4 @@ // // public Eajc515ModuleTests(String name) { super(name); } // -//} +//} diff --git a/org.aspectj.ajdt.core/src/test/java/RunWeaveTests.java b/org.aspectj.ajdt.core/src/test/java/RunWeaveTests.java index ad68e64d5..d8d080518 100644 --- a/org.aspectj.ajdt.core/src/test/java/RunWeaveTests.java +++ b/org.aspectj.ajdt.core/src/test/java/RunWeaveTests.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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: - * Noel Markham, Matthew Webster initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Noel Markham, Matthew Webster initial implementation * ******************************************************************/ import java.io.BufferedOutputStream; @@ -26,23 +26,23 @@ public class RunWeaveTests { private static boolean RUN_SMALL = true; private static boolean RUN_MED = true; private static boolean RUN_LARGE = true; - + private static final String SMALL_PROGRAM_ARGS = "-c 8 -m 100 -l 10 "; // must end on a space in case any more arguments are added later in the script private static final String MEDIUM_PROGRAM_ARGS = "-c 64 -m 100 -l 10 "; private static final String LARGE_PROGRAM_ARGS = "-c 512 -m 100 -l 10 "; - + private static final String WARMUP_ARGS = "-c 3 -m 100 -l 10 "; private static final int ITERATIONS = 3; - + private static String filename; - + private static long[][] times = new long[7][3 * ITERATIONS]; - + public static void main(String[] args) throws IOException { - + parseArgs(args); - + // Purely as a warm-up... System.out.println("Warming up..."); WeaveTest.main(split(WARMUP_ARGS + "-i " + ITERATIONS)); @@ -60,8 +60,8 @@ public class RunWeaveTests { System.arraycopy(WeaveTest.getFastTimes, 0, times[4], 0, ITERATIONS); System.arraycopy(WeaveTest.getMedTimes, 0, times[5], 0, ITERATIONS); System.arraycopy(WeaveTest.getSlowTimes, 0, times[6], 0, ITERATIONS); - } - + } + if (RUN_MED) { WeaveTest.main( split(MEDIUM_PROGRAM_ARGS + "-echo -i " + ITERATIONS)); @@ -75,9 +75,9 @@ public class RunWeaveTests { System.arraycopy(WeaveTest.getFastTimes, 0, times[4], ITERATIONS, 2 * ITERATIONS - 3); System.arraycopy(WeaveTest.getMedTimes, 0, times[5], ITERATIONS, 2 * ITERATIONS - 3); System.arraycopy(WeaveTest.getSlowTimes, 0, times[6], ITERATIONS, 2 * ITERATIONS - 3); - - } - + + } + if (RUN_LARGE) { WeaveTest.main( split(LARGE_PROGRAM_ARGS + "-echo -i " + ITERATIONS)); @@ -91,12 +91,12 @@ public class RunWeaveTests { System.arraycopy(WeaveTest.getFastTimes, 0, times[4], 2 * ITERATIONS, 3 * ITERATIONS - 6); System.arraycopy(WeaveTest.getMedTimes, 0, times[5], 2 * ITERATIONS, 3 * ITERATIONS - 6); System.arraycopy(WeaveTest.getSlowTimes, 0, times[6], 2 * ITERATIONS, 3 * ITERATIONS - 6); - - } + + } createCSV(); } - + /* Compatibility with JDK 1.3.1 */ public static String[] split (String s) { List list = new ArrayList(); @@ -104,19 +104,19 @@ public class RunWeaveTests { while (st.hasMoreTokens()) { list.add(st.nextToken()); } - + String[] result = new String[list.size()]; list.toArray(result); return result; } - + private static void parseArgs(String args[]) { - + if(args == null || args.length <= 0) { System.out.println("Running all program tests"); return; } - + if(args[0].equals("-small")) { System.out.println("Running small-sized program test only"); RUN_SMALL = true; @@ -137,23 +137,23 @@ public class RunWeaveTests { } else usage(); } - + private static void usage() { System.err.println("Usage:"); System.err.println("\tjava RunWeaveTests [-small|-medium|-large]"); System.exit(-1); } - + private static void createCSV() { String NL = System.getProperty("line.separator", "\n"); StringBuffer csv = new StringBuffer(1000); - + csv.append("Test Results"); - + if(RUN_SMALL) for(int i = 0; i < ITERATIONS; i++) csv.append("," + SMALL_PROGRAM_ARGS); if(RUN_MED) for(int i = 0; i < ITERATIONS; i++) csv.append("," + MEDIUM_PROGRAM_ARGS); if(RUN_LARGE) for(int i = 0; i < ITERATIONS; i++) csv.append("," + LARGE_PROGRAM_ARGS); - + csv.append(NL); csv.append("Compile"); if(RUN_SMALL) for(int i = 0; i < ITERATIONS; i++) csv.append("," + times[0][i]); @@ -167,7 +167,7 @@ public class RunWeaveTests { if(RUN_MED) for(int i = ITERATIONS; i < (2 * ITERATIONS); i++) csv.append("," + times[1][i]); if(RUN_LARGE) for(int i = (2 * ITERATIONS); i < (3 * ITERATIONS); i++) csv.append("," + times[1][i]); csv.append(NL); - + csv.append(WeaveTest.EXECUTION_MED); if(RUN_SMALL) for(int i = 0; i < ITERATIONS; i++) csv.append("," + times[2][i]); if(RUN_MED) for(int i = ITERATIONS; i < (2 * ITERATIONS); i++) csv.append("," + times[2][i]); @@ -197,14 +197,14 @@ public class RunWeaveTests { if(RUN_MED) for(int i = ITERATIONS; i < (2 * ITERATIONS); i++) csv.append("," + times[6][i]); if(RUN_LARGE) for(int i = (2 * ITERATIONS); i < (3 * ITERATIONS); i++) csv.append("," + times[6][i]); csv.append(NL); - + filename = createFilename(); try { FileOutputStream fos = new FileOutputStream(filename); BufferedOutputStream bos = new BufferedOutputStream(fos); - + bos.write(new String(csv).getBytes()); - + bos.close(); fos.close(); } catch (IOException e) { @@ -213,49 +213,49 @@ public class RunWeaveTests { } System.out.println("Written: " + filename); } - + private static String createFilename() { - + return (getVMInfo() + "_" + getDateAndTime()).replace('.', '_') + ".csv"; } - + private static StringBuffer getDateAndTime() { Calendar c = Calendar.getInstance(); - + StringBuffer sb = new StringBuffer(15); sb.append(c.get(Calendar.YEAR)); int month = (c.get(Calendar.MONTH)) + 1; - if(month < 10) sb.append(0); + if(month < 10) sb.append(0); sb.append(month); int date = c.get(Calendar.DAY_OF_MONTH); if(date < 10) sb.append(0); sb.append(date); - + sb.append("_"); - + int hour = c.get(Calendar.HOUR_OF_DAY); if(hour < 10) sb.append(0); sb.append(hour); - int minute = c.get(Calendar.MINUTE); + int minute = c.get(Calendar.MINUTE); if(minute < 10) sb.append(0); sb.append(minute); int second = c.get(Calendar.SECOND); if(second < 10) sb.append(0); sb.append(second); - - + + return sb; } - + private static StringBuffer getVMInfo() { StringBuffer sb = new StringBuffer(40); - + String vm = System.getProperty("java.vm.vendor"); - + if(vm.equals("IBM Corporation")) { String vminfo = System.getProperty("java.vm.info"); String[] vminfoComponents = split(vminfo); - + sb.append(vminfoComponents[2] + ("_")); sb.append(vminfoComponents[3] + ("_")); sb.append(vminfoComponents[4] + ("_")); diff --git a/org.aspectj.ajdt.core/src/test/java/WeaveTest.java b/org.aspectj.ajdt.core/src/test/java/WeaveTest.java index 1b858bb05..4bbc15768 100644 --- a/org.aspectj.ajdt.core/src/test/java/WeaveTest.java +++ b/org.aspectj.ajdt.core/src/test/java/WeaveTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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: - * Noel Markham, Matthew Webster initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Noel Markham, Matthew Webster initial implementation * ******************************************************************/ import java.io.BufferedOutputStream; @@ -20,21 +20,21 @@ import java.io.IOException; * @author Noel Markham */ public class WeaveTest { - + private static final String OUTPUT_PACKAGE = "out"; - + private static final int WEAVE_FAST = 1; private static final int WEAVE_MED = 2; private static final int WEAVE_SLOW = 3; - + public static final String EXECUTION_SLOW = "execution(void *(..))"; public static final String EXECUTION_MED = "args(" + OUTPUT_PACKAGE + ".C0) && execution(void m0(..))"; public static final String EXECUTION_FAST = "within(" + OUTPUT_PACKAGE + ".C0) && execution(void m0(..))"; - + public static final String GET_SLOW = "get(int *)"; public static final String GET_MED = "target(" + OUTPUT_PACKAGE + ".C0) && get(int i0)"; public static final String GET_FAST = "get(int " + OUTPUT_PACKAGE + ".C0.i0)"; - + // Defaults, can be changed with command-line args private static int NUMCLASSES = 5; private static int ITERATIONS = 3; @@ -53,13 +53,13 @@ public class WeaveTest { public static long[] compileTimes = new long[ITERATIONS]; public static long[] executionSlowTimes = new long[ITERATIONS]; public static long[] executionMedTimes = new long[ITERATIONS]; - public static long[] executionFastTimes = new long[ITERATIONS]; + public static long[] executionFastTimes = new long[ITERATIONS]; public static long[] getSlowTimes = new long[ITERATIONS]; public static long[] getMedTimes = new long[ITERATIONS]; public static long[] getFastTimes = new long[ITERATIONS]; private static final String NL = System.getProperty("line.separator", "\n"); - + private static final File outputDir = new File(System.getProperty("user.dir") + File.separatorChar + OUTPUT_PACKAGE); static { @@ -70,15 +70,15 @@ public class WeaveTest { //if (args.length > 0) parseArgs(args); parseArgs(args); - + if(ECHO) System.out.println("Weave-time Test"); if(ECHO) System.out.println("---------------"); - + if(ECHO) System.out.println("Number of classes: " + NUMCLASSES); if(ECHO) System.out.println("Number of methods: " + NUMMETHODS); if(ECHO) System.out.println("Number of method lines: " + METHODLINES); if(ECHO) System.out.println("Number of test iterations: " + ITERATIONS); - if(ECHO) + if(ECHO) if(INCLUDE_TEST_CLASSES) System.out.println("Including advice test classes"); if(ECHO) if(TEST_GET && !TEST_EXECUTION) System.out.println("Weaving only get advice"); @@ -93,42 +93,42 @@ public class WeaveTest { } if(ECHO) System.out.println(); - + createClasses(); compileClasses(); - boolean warm = false; + boolean warm = false; if (TEST_EXECUTION) { String advice = "execution"; createAspects(advice); - + //Warm up the weaver weaveAllAspects(advice, WEAVE_FAST); warm = true; - + weaveAspects(advice); } - + if (TEST_GET) { String advice = "get"; createAspects(advice); - + if(!warm) weaveAllAspects(advice, WEAVE_FAST); weaveAspects(advice); } } - + private static void parseArgs(String[] args) { - + if(args == null || args.length <= 0) return; int i = 0; boolean error = false; - + while(i < args.length) { String arg = args[i++]; - + try { if(arg.equals("-c")) { // Number of classes if(i < args.length) @@ -188,13 +188,13 @@ public class WeaveTest { } catch (NumberFormatException e) { usage(); } - + if(error) usage(); - + compileTimes = new long[ITERATIONS]; executionSlowTimes = new long[ITERATIONS]; executionMedTimes = new long[ITERATIONS]; - executionFastTimes = new long[ITERATIONS]; + executionFastTimes = new long[ITERATIONS]; getSlowTimes = new long[ITERATIONS]; getMedTimes = new long[ITERATIONS]; getFastTimes = new long[ITERATIONS]; @@ -207,19 +207,19 @@ public class WeaveTest { System.err.println("\tjava WeaveTests [-c num_of_classes] [-m num_of_methods] " + "[-l num_of_method_lines] [-i num_of_iterations]" + "\n\t\t[-include-tests y|n] [-advice get|execution] [-pointcut fast|medium|slow] [-echo] [-help]"); - + System.exit(-1); } - + /** * Will create a number of classes of the following form: - * + * * public class C0 { - * + * * int i0; * ... * int iN; - * + * * void m0(C0 arg) { * i0++; * ... @@ -229,57 +229,57 @@ public class WeaveTest { * void mN(C0 arg) { * ... * } - * + * */ public static void createClasses() throws IOException { - + if(ECHO) System.out.println("Creating classes"); - + for(int classcounter = 0; classcounter < NUMCLASSES; classcounter++) { - + StringBuffer classfile = new StringBuffer(1000); - + classfile.append("// Auto-generated" + NL); classfile.append("package " + OUTPUT_PACKAGE + ";" + NL + NL); - + classfile.append("public class C" + classcounter + " {" + NL + NL); - + for(int intdeclaration = 0; intdeclaration < METHODLINES; intdeclaration++) { classfile.append("\tint i" + intdeclaration + ";" + NL); } classfile.append("\tint getter;" + NL); - + classfile.append(NL); - + for(int methodcounter = 0; methodcounter < NUMMETHODS; methodcounter++) { classfile.append("\tvoid m" + methodcounter + "(C" + classcounter + " arg) {" + NL); - + for(int methodbody = 0; methodbody < METHODLINES; methodbody++) { classfile.append("\t\ti" + methodbody + "++;" + NL); - } - - classfile.append("\t}" + NL + NL); + } + + classfile.append("\t}" + NL + NL); } classfile.append("}" + NL); - + try { - + File f = new File(outputDir, ("C" + classcounter + ".java")); FileOutputStream fos = new FileOutputStream(f); BufferedOutputStream bos = new BufferedOutputStream(fos); - + bos.write(new String(classfile).getBytes()); - + bos.close(); fos.close(); - + } catch (IOException e) { e.printStackTrace(); System.exit(-1); } } - + if (INCLUDE_TEST_CLASSES) { StringBuffer testFiles = new StringBuffer(1000); @@ -335,22 +335,22 @@ public class WeaveTest { } StringBuffer buildList = new StringBuffer(100); - + for(int i = 0; i < NUMCLASSES; i++) buildList.append("C" + i + ".java" + NL); - + if (INCLUDE_TEST_CLASSES) { buildList.append("TestGet.java" + NL); buildList.append("TestExecution.java" + NL); } - + try { File f = new File(outputDir, "build.lst"); FileOutputStream fos = new FileOutputStream(f); BufferedOutputStream bos = new BufferedOutputStream(fos); - + bos.write(new String(buildList).getBytes()); - + bos.close(); fos.close(); } catch (IOException e) { @@ -358,30 +358,30 @@ public class WeaveTest { System.exit(-1); } } - + /** * @param adviceType Either "get" or "execution" depending on which test. - * + * * Will create an aspect such as the following: - * + * * public aspect GetAdviceWeaveOne { - * + * * before() : get(int output.C0.getter) { * System.out.println("In the aspect"); * } * } */ public static void createAspects(String adviceType) { - + adviceType = adviceType.toLowerCase(); - + if((!adviceType.equals("get")) && (!adviceType.equals("execution"))) { System.err.println("Only get and execution advice is supported"); System.exit(-1); } - + if(ECHO) System.out.println("Creating aspects"); - + if(ALL_POINTCUT_TESTS || TEST_ONE) createAllAspects(adviceType, WEAVE_FAST); if(ALL_POINTCUT_TESTS || TEST_ONE_SEARCH_ALL) @@ -389,14 +389,14 @@ public class WeaveTest { if(ALL_POINTCUT_TESTS || TEST_ALL) createAllAspects(adviceType, WEAVE_SLOW); } - + private static void createAllAspects(String adviceType, int pointcut) { - + StringBuffer aspectFile = new StringBuffer(1000); // Capitalises the first char in the adviceType String, and then adds "Advice" to it. String adviceName = (char)(adviceType.charAt(0) - 32) + adviceType.substring(1) + "Advice"; - + switch(pointcut) { case WEAVE_FAST: adviceName += "WeaveFast"; @@ -408,12 +408,12 @@ public class WeaveTest { adviceName += "WeaveSlow"; break; } - + aspectFile.append("// Auto-generated" + NL + NL); - + aspectFile.append("public aspect " + adviceName + " {" + NL + NL); aspectFile.append("\tbefore() : "); - + if(adviceType.equals("execution")) { switch(pointcut) { case WEAVE_FAST: @@ -440,9 +440,9 @@ public class WeaveTest { break; } } - + aspectFile.append(" {" + NL); - + aspectFile.append("\t\tSystem.out.println(\"In the aspect\");" + NL); aspectFile.append("\t}" + NL); aspectFile.append("}" + NL); @@ -452,9 +452,9 @@ public class WeaveTest { File f = new File(outputDir, (adviceName + ".aj")); FileOutputStream fos = new FileOutputStream(f); BufferedOutputStream bos = new BufferedOutputStream(fos); - + bos.write(new String(aspectFile).getBytes()); - + bos.close(); fos.close(); } catch (IOException e) { @@ -462,89 +462,89 @@ public class WeaveTest { System.exit(-1); } } - + public static void compileClasses() throws IOException { - + if(ECHO) System.out.print("Compiling: "); long average = 0; - + for (int i = 0; i < ITERATIONS; i++) { long time = performCompile(); compileTimes[i] = time; average += time; } - + if(ECHO) System.out.println((average / ITERATIONS) + " millis"); } - + private static long performCompile() throws IOException { - - String ajcargs = - "-noExit -outjar " + OUTPUT_PACKAGE + File.separatorChar + "classes.jar " + + + String ajcargs = + "-noExit -outjar " + OUTPUT_PACKAGE + File.separatorChar + "classes.jar " + "-argfile " + OUTPUT_PACKAGE + File.separatorChar + "build.lst"; // split method creates a String array delimited on a space - String[] parsedArgs = RunWeaveTests.split(ajcargs); + String[] parsedArgs = RunWeaveTests.split(ajcargs); + - long start = System.currentTimeMillis(); - + org.aspectj.tools.ajc.Main.main(parsedArgs); - + long stop = System.currentTimeMillis(); - + return stop - start; } - - + + public static void weaveAspects(String adviceType) throws IOException { adviceType = adviceType.toLowerCase(); - + if((!adviceType.equals("get")) && (!adviceType.equals("execution"))) { System.err.println("Only get and execution advice is supported"); System.exit(-1); } - + long average = 0; - + if(ECHO) System.out.println((char)(adviceType.charAt(0) - 32) + adviceType.substring(1)); - + if (ALL_POINTCUT_TESTS || TEST_ONE) { if(ECHO) System.out.print("Weave Fast:"); for (int i = 0; i < ITERATIONS; i++) { long time = weaveAllAspects(adviceType, WEAVE_FAST); - + if(adviceType.equals("execution")) executionFastTimes[i] = time; else getFastTimes[i] = time; - + average += time; if(ECHO) System.out.print("."); } if(ECHO) System.out.println(" " + (average / ITERATIONS) + " millis"); } - - + + average = 0; - + if (ALL_POINTCUT_TESTS || TEST_ONE_SEARCH_ALL) { if(ECHO) System.out.print("Weave Medium:"); for (int i = 0; i < ITERATIONS; i++) { long time = weaveAllAspects(adviceType, WEAVE_MED); - + if(adviceType.equals("execution")) executionMedTimes[i] = time; else getMedTimes[i] = time; - + average += time; if(ECHO) System.out.print("."); } if(ECHO) System.out.println(" " + (average / ITERATIONS) + " millis"); } - - + + average = 0; - + if (ALL_POINTCUT_TESTS || TEST_ALL) { if(ECHO) System.out.print("Weave Slow:"); for (int i = 0; i < ITERATIONS; i++) { @@ -552,7 +552,7 @@ public class WeaveTest { if(adviceType.equals("execution")) executionSlowTimes[i] = time; else getSlowTimes[i] = time; - + average += time; if(ECHO) System.out.print("."); } @@ -561,12 +561,12 @@ public class WeaveTest { if(ECHO) System.out.println(); } - + private static long weaveAllAspects(String adviceType, int pointcut) throws IOException { // Capitalises the first char in the adviceType String, to keep to Java naming convention String adviceName = (char)(adviceType.charAt(0) - 32) + adviceType.substring(1) + "Advice"; - + switch(pointcut) { case WEAVE_FAST: adviceName += "WeaveFast"; @@ -578,20 +578,20 @@ public class WeaveTest { adviceName += "WeaveSlow"; break; } - + String ajcargs = - "-noExit -injars " + OUTPUT_PACKAGE + File.separatorChar + "classes.jar " + - "-outjar " + OUTPUT_PACKAGE + File.separatorChar + adviceName + ".jar " + + "-noExit -injars " + OUTPUT_PACKAGE + File.separatorChar + "classes.jar " + + "-outjar " + OUTPUT_PACKAGE + File.separatorChar + adviceName + ".jar " + OUTPUT_PACKAGE + File.separatorChar + adviceName + ".aj"; - + String[] parsedArgs = RunWeaveTests.split(ajcargs); - + long start = System.currentTimeMillis(); - + org.aspectj.tools.ajc.Main.main(parsedArgs); - + long stop = System.currentTimeMillis(); - + return stop - start; } -}
\ No newline at end of file +} diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/AjdtCoreModuleTests.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/AjdtCoreModuleTests.java index 70a894c40..1df4a0227 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/AjdtCoreModuleTests.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/AjdtCoreModuleTests.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: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt; @@ -21,31 +21,31 @@ import junit.framework.*; public class AjdtCoreModuleTests extends TestCase { - public static Test suite() { + public static Test suite() { TestSuite suite = new TestSuite(AjdtCoreModuleTests.class.getName()); - suite.addTestSuite(AjdtCommandTestCase.class); - suite.addTestSuite(BuildArgParserTestCase.class); - suite.addTestSuite(ConsoleMessageHandlerTestCase.class); - - suite.addTestSuite(BasicCommandTestCase.class); - suite.addTestSuite(BinaryFormsTestCase.class); - suite.addTestSuite(CompileAndRunTestCase.class); - suite.addTestSuite(PerformanceTestCase.class); - suite.addTestSuite(ImageTestCase.class); - suite.addTestSuite(MultipleCompileTestCase.class); + suite.addTestSuite(AjdtCommandTestCase.class); + suite.addTestSuite(BuildArgParserTestCase.class); + suite.addTestSuite(ConsoleMessageHandlerTestCase.class); + + suite.addTestSuite(BasicCommandTestCase.class); + suite.addTestSuite(BinaryFormsTestCase.class); + suite.addTestSuite(CompileAndRunTestCase.class); + suite.addTestSuite(PerformanceTestCase.class); + suite.addTestSuite(ImageTestCase.class); + suite.addTestSuite(MultipleCompileTestCase.class); suite.addTestSuite(JavadocTest.class); suite.addTestSuite(PartiallyExposedHierarchyTestCase.class); - suite.addTestSuite(CompilerDumpTestCase.class); + suite.addTestSuite(CompilerDumpTestCase.class); suite.addTestSuite(ProceedOnErrorTestCase.class); suite.addTestSuite(DeclareParentsTest.class); suite.addTestSuite(DumpTestCase.class); - suite.addTestSuite(AjBuildManagerTest.class); - suite.addTestSuite(AjBuildConfigTest.class); - suite.addTestSuite(AsmBuilderTest.class); + suite.addTestSuite(AjBuildManagerTest.class); + suite.addTestSuite(AjBuildConfigTest.class); + suite.addTestSuite(AsmBuilderTest.class); suite.addTestSuite(AjCompilerOptionsTest.class); suite.addTestSuite(AjStateTest.class); suite.addTestSuite(OutjarTest.class); - + suite.addTestSuite(MainTest.class); suite.addTestSuite(ASTVisitorTest.class); suite.addTestSuite(ASTitdTest.class); @@ -58,4 +58,4 @@ public class AjdtCoreModuleTests extends TestCase { public AjdtCoreModuleTests(String name) { super(name); } -} +} diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/StreamPrintWriter.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/StreamPrintWriter.java index 4ead0209b..5f6b78f0a 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/StreamPrintWriter.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/StreamPrintWriter.java @@ -1,17 +1,17 @@ /* ******************************************************************* - * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Xerox/PARC initial implementation * ******************************************************************/ - + package org.aspectj.ajdt; import java.io.*; diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java index 952e707b8..75ee8b921 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.ajc; diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java index c4439c9f7..916a5abe8 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/BuildArgParserTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.ajc; @@ -46,7 +46,7 @@ public class BuildArgParserTestCase extends TestCase { public BuildArgParserTestCase(String name) { super(name); } - + private AjBuildConfig genBuildConfig(String[] args, IMessageHandler handler) { return new BuildArgParser(handler).genBuildConfig(args); } @@ -58,7 +58,7 @@ public class BuildArgParserTestCase extends TestCase { System.setProperty("java.class.path", ENTRY); // see finally below BuildArgParser parser = new BuildArgParser(messageWriter); AjBuildConfig config = parser.genBuildConfig(new String[] { }); - /*String err = */parser.getOtherMessages(true); + /*String err = */parser.getOtherMessages(true); //!!!assertTrue(err, null == err); assertTrue( config.getClasspath().toString(), @@ -66,10 +66,10 @@ public class BuildArgParserTestCase extends TestCase { assertTrue( config.getClasspath().toString(), config.getClasspath().contains("2.jar")); - + config = genBuildConfig(new String[] { "-1.3" }, messageWriter); // these errors are deffered to the compiler now - //err = parser.getOtherMessages(true); + //err = parser.getOtherMessages(true); //!!!assertTrue(err, null == err); assertTrue( config.getClasspath().toString(), @@ -77,10 +77,10 @@ public class BuildArgParserTestCase extends TestCase { assertTrue( config.getClasspath().toString(), config.getClasspath().contains("2.jar")); - + parser = new BuildArgParser(messageWriter); config = parser.genBuildConfig(new String[] { "-1.3" }); - /*err = */parser.getOtherMessages(true); + /*err = */parser.getOtherMessages(true); //!!!assertTrue(err, null == err); assertTrue( config.getClasspath().toString(), @@ -88,11 +88,11 @@ public class BuildArgParserTestCase extends TestCase { assertTrue( config.getClasspath().toString(), config.getClasspath().contains("2.jar")); - - config = genBuildConfig(new String[] { + + config = genBuildConfig(new String[] { "-classpath", ENTRY, "-1.4" }, messageWriter); // these errors are deffered to the compiler now - //err = parser.getOtherMessages(true); + //err = parser.getOtherMessages(true); //assertTrue("expected errors for missing jars", null != err); List cp = config.getClasspath(); boolean jar1Found = false; @@ -108,16 +108,16 @@ public class BuildArgParserTestCase extends TestCase { assertTrue( config.getClasspath().toString(), jar2Found); - + } finally { // do finally to avoid messing up classpath for other tests System.setProperty("java.class.path", classpath); String setPath = System.getProperty("java.class.path"); String m = "other tests will fail - classpath not reset"; - assertEquals(m, classpath, setPath); + assertEquals(m, classpath, setPath); } } - + public void testPathResolutionFromConfigArgs() { String FILE_PATH = "@" + TEST_DIR + "configWithClasspathExtdirsBootCPArgs.lst"; AjBuildConfig config = genBuildConfig(new String[] { FILE_PATH }, messageWriter); @@ -135,62 +135,62 @@ public class BuildArgParserTestCase extends TestCase { Iterator<File> fIter = files.iterator(); assertEquals("Should be relative to TESTDIR",new File(TEST_DIR+File.separator+"Abc.java").getCanonicalFile(),fIter.next()); assertEquals("Should be relative to TESTDIR",new File(TEST_DIR+File.separator+"xyz"+File.separator+"Def.aj").getCanonicalFile(),fIter.next()); - + } catch (IOException ex) { fail("Test case failure attempting to create canonical path: " + ex); } - + } - + public void testAjOptions() throws InvalidInputException { AjBuildConfig config = genBuildConfig(new String[] { "-Xlint" }, messageWriter); - + assertTrue( "default options", - config.getLintMode().equals(AjBuildConfig.AJLINT_DEFAULT)); + config.getLintMode().equals(AjBuildConfig.AJLINT_DEFAULT)); } public void testAspectpath() throws InvalidInputException { final String SOURCE_JAR = Constants.TESTDATA_PATH + "/testclasses.jar"; - final String SOURCE_JARS = Constants.TESTDATA_PATH + "/testclasses.jar" + File.pathSeparator - + "../weaver/testdata/tracing.jar" + File.pathSeparator + final String SOURCE_JARS = Constants.TESTDATA_PATH + "/testclasses.jar" + File.pathSeparator + + "../weaver/testdata/tracing.jar" + File.pathSeparator + "../weaver/testdata/dummyAspect.jar"; - AjBuildConfig config = genBuildConfig(new String[] { - "-aspectpath", SOURCE_JAR }, + AjBuildConfig config = genBuildConfig(new String[] { + "-aspectpath", SOURCE_JAR }, messageWriter); - + assertTrue(config.getAspectpath().get(0).getName(), config.getAspectpath().get(0).getName().equals("testclasses.jar")); - config = genBuildConfig(new String[] { - "-aspectpath", SOURCE_JARS }, + config = genBuildConfig(new String[] { + "-aspectpath", SOURCE_JARS }, messageWriter); assertTrue("size", + config.getAspectpath().size() == 3); } public void testInJars() throws InvalidInputException { final String SOURCE_JAR = Constants.TESTDATA_PATH + "/testclasses.jar"; - final String SOURCE_JARS = Constants.TESTDATA_PATH + "/testclasses.jar" + File.pathSeparator - + "../weaver/testdata/tracing.jar" + File.pathSeparator + final String SOURCE_JARS = Constants.TESTDATA_PATH + "/testclasses.jar" + File.pathSeparator + + "../weaver/testdata/tracing.jar" + File.pathSeparator + "../weaver/testdata/dummyAspect.jar"; - AjBuildConfig config = genBuildConfig(new String[] { - "-injars", SOURCE_JAR }, + AjBuildConfig config = genBuildConfig(new String[] { + "-injars", SOURCE_JAR }, messageWriter); - //XXX don't let this remain in both places in beta1 + //XXX don't let this remain in both places in beta1 // assertTrue( -// "" + config.getAjOptions().get(AjCompilerOptions.OPTION_InJARs), +// "" + config.getAjOptions().get(AjCompilerOptions.OPTION_InJARs), // config.getAjOptions().get(AjCompilerOptions.OPTION_InJARs).equals(CompilerOptions.PRESERVE)); assertTrue(config.getInJars().get(0).getName(), config.getInJars().get(0).getName().equals("testclasses.jar")); - config = genBuildConfig(new String[] { - "-injars", SOURCE_JARS }, + config = genBuildConfig(new String[] { + "-injars", SOURCE_JARS }, messageWriter); assertTrue("size", + config.getInJars().size() == 3); } public void testBadInJars() throws InvalidInputException { final String SOURCE_JARS = Constants.TESTDATA_PATH + "/testclasses.jar" + File.pathSeparator + "b.far" + File.pathSeparator + "c.jar"; - AjBuildConfig config = genBuildConfig(new String[] { - "-injars", SOURCE_JARS }, + AjBuildConfig config = genBuildConfig(new String[] { + "-injars", SOURCE_JARS }, messageWriter); assertTrue("size: " + config.getInJars().size(), config.getInJars().size() == 1); } @@ -198,19 +198,19 @@ public class BuildArgParserTestCase extends TestCase { public void testBadPathToSourceFiles() { CountingMessageHandler countingHandler = new CountingMessageHandler(messageWriter); /*AjBuildConfig config = */genBuildConfig(new String[]{ "inventedDir/doesntexist/*.java"},countingHandler); - assertTrue("Expected an error for the invalid path.",countingHandler.numMessages(IMessage.ERROR,false)==1); + assertTrue("Expected an error for the invalid path.",countingHandler.numMessages(IMessage.ERROR,false)==1); } public void testMultipleSourceRoots() throws InvalidInputException, IOException { final String SRCROOT_1 = Constants.TESTDATA_PATH + "/src1/p1"; final String SRCROOT_2 = Constants.TESTDATA_PATH + "/ajc"; - AjBuildConfig config = genBuildConfig(new String[] { - "-sourceroots", SRCROOT_1 + File.pathSeparator + SRCROOT_2 }, + AjBuildConfig config = genBuildConfig(new String[] { + "-sourceroots", SRCROOT_1 + File.pathSeparator + SRCROOT_2 }, messageWriter); - + assertEquals(getCanonicalPath(new File(SRCROOT_1)), config.getSourceRoots().get(0).getAbsolutePath()); - + Collection expectedFiles = Arrays.asList(new File[] { new File(SRCROOT_1+File.separator+"A.java").getCanonicalFile(), new File(SRCROOT_1+File.separator+"Foo.java").getCanonicalFile(), @@ -220,7 +220,7 @@ public class BuildArgParserTestCase extends TestCase { new File(SRCROOT_2+File.separator+"Y.aj").getCanonicalFile(), new File(SRCROOT_2+File.separator+"pkg"+File.separator+"Hello.java").getCanonicalFile(), }); - + //System.out.println(config.getFiles()); TestUtil.assertSetEquals(expectedFiles, config.getFiles()); @@ -242,12 +242,12 @@ public class BuildArgParserTestCase extends TestCase { public void testSourceRootDir() throws InvalidInputException, IOException { final String SRCROOT = Constants.TESTDATA_PATH + "/ajc"; - AjBuildConfig config = genBuildConfig(new String[] { - "-sourceroots", SRCROOT }, + AjBuildConfig config = genBuildConfig(new String[] { + "-sourceroots", SRCROOT }, messageWriter); assertEquals(getCanonicalPath(new File(SRCROOT)), config.getSourceRoots().get(0).getAbsolutePath()); - + Collection expectedFiles = Arrays.asList(new File[] { new File(SRCROOT+File.separator+"A.java").getCanonicalFile(), new File(SRCROOT+File.separator+"B.java").getCanonicalFile(), @@ -262,44 +262,44 @@ public class BuildArgParserTestCase extends TestCase { } public void testBadSourceRootDir() throws InvalidInputException { - AjBuildConfig config = genBuildConfig(new String[] { - "-sourceroots", - Constants.TESTDATA_PATH + "/mumbleDoesNotExist" + File.pathSeparator - + Constants.TESTDATA_PATH + "/ajc" }, + AjBuildConfig config = genBuildConfig(new String[] { + "-sourceroots", + Constants.TESTDATA_PATH + "/mumbleDoesNotExist" + File.pathSeparator + + Constants.TESTDATA_PATH + "/ajc" }, messageWriter); assertTrue(config.getSourceRoots().toString(), config.getSourceRoots().size() == 1); - config = genBuildConfig(new String[] { - "-sourceroots" }, + config = genBuildConfig(new String[] { + "-sourceroots" }, messageWriter); assertTrue("" + config.getSourceRoots(), config.getSourceRoots().size() == 0); - + } //??? we've decided not to make this an error public void testSourceRootDirWithFiles() throws InvalidInputException, IOException { final String SRCROOT = Constants.TESTDATA_PATH + "/ajc/pkg"; - AjBuildConfig config = genBuildConfig(new String[] { - "-sourceroots", SRCROOT, Constants.TESTDATA_PATH + "/src1/A.java"}, + AjBuildConfig config = genBuildConfig(new String[] { + "-sourceroots", SRCROOT, Constants.TESTDATA_PATH + "/src1/A.java"}, messageWriter); assertEquals(getCanonicalPath(new File(SRCROOT)), config.getSourceRoots().get(0).getAbsolutePath()); - + Collection expectedFiles = Arrays.asList(new File[] { new File(SRCROOT+File.separator+"Hello.java").getCanonicalFile(), new File(Constants.TESTDATA_PATH +File.separator+"src1"+File.separator+"A.java").getCanonicalFile(), }); TestUtil.assertSetEquals(expectedFiles, config.getFiles()); - + } public void testExtDirs() throws Exception { final String DIR = Constants.TESTDATA_PATH; - AjBuildConfig config = genBuildConfig(new String[] { - "-extdirs", DIR }, + AjBuildConfig config = genBuildConfig(new String[] { + "-extdirs", DIR }, messageWriter); assertTrue(config.getClasspath().toString(), config.getClasspath().contains( new File(DIR + File.separator + "testclasses.jar").getCanonicalPath() @@ -308,68 +308,68 @@ public class BuildArgParserTestCase extends TestCase { public void testBootclasspath() throws InvalidInputException { final String PATH = "mumble" + File.separator + "rt.jar"; - AjBuildConfig config = genBuildConfig(new String[] { - "-bootclasspath", PATH }, - messageWriter); + AjBuildConfig config = genBuildConfig(new String[] { + "-bootclasspath", PATH }, + messageWriter); assertTrue("Should find '" + PATH + "' contained in the first entry of '" + config.getBootclasspath().toString(), config.getBootclasspath().get(0).contains(PATH)); - config = genBuildConfig(new String[] { - }, - messageWriter); - assertTrue(config.getBootclasspath().toString(), !config.getBootclasspath().get(0).equals(PATH)); + config = genBuildConfig(new String[] { + }, + messageWriter); + assertTrue(config.getBootclasspath().toString(), !config.getBootclasspath().get(0).equals(PATH)); } public void testOutputJar() throws InvalidInputException { final String OUT_JAR = Constants.TESTDATA_PATH + "/testclasses.jar"; - - AjBuildConfig config = genBuildConfig(new String[] { - "-outjar", OUT_JAR }, + + AjBuildConfig config = genBuildConfig(new String[] { + "-outjar", OUT_JAR }, messageWriter); //XXX don't let this remain in both places in beta1 // assertTrue( -// "will generate: " + config.getAjOptions().get(AjCompilerOptions.OPTION_OutJAR), +// "will generate: " + config.getAjOptions().get(AjCompilerOptions.OPTION_OutJAR), // config.getAjOptions().get(AjCompilerOptions.OPTION_OutJAR).equals(CompilerOptions.GENERATE)); assertEquals( - getCanonicalPath(new File(OUT_JAR)),config.getOutputJar().getAbsolutePath()); - + getCanonicalPath(new File(OUT_JAR)),config.getOutputJar().getAbsolutePath()); + File nonExistingJar = new File(Constants.TESTDATA_PATH + "/mumbleDoesNotExist.jar"); - config = genBuildConfig(new String[] { - "-outjar", nonExistingJar.getAbsolutePath() }, + config = genBuildConfig(new String[] { + "-outjar", nonExistingJar.getAbsolutePath() }, messageWriter); assertEquals( - getCanonicalPath(nonExistingJar), - config.getOutputJar().getAbsolutePath()); + getCanonicalPath(nonExistingJar), + config.getOutputJar().getAbsolutePath()); nonExistingJar.delete(); } - + //XXX shouldn't need -1.4 to get this to pass public void testCombinedOptions() throws InvalidInputException { AjBuildConfig config = genBuildConfig(new String[] { "-Xlint:error", "-target", "1.4"}, messageWriter); assertTrue( - "target set", - config.getOptions().targetJDK == ClassFileConstants.JDK1_4); + "target set", + config.getOptions().targetJDK == ClassFileConstants.JDK1_4); assertTrue( "Xlint option set", - config.getLintMode().equals(AjBuildConfig.AJLINT_ERROR)); + config.getLintMode().equals(AjBuildConfig.AJLINT_ERROR)); } - + public void testOutputDirectorySetting() throws InvalidInputException { AjBuildConfig config = genBuildConfig(new String[] { "-d", TEST_DIR }, messageWriter); - + assertTrue( - new File(config.getOutputDir().getPath()).getAbsolutePath() + " ?= " + + new File(config.getOutputDir().getPath()).getAbsolutePath() + " ?= " + new File(TEST_DIR).getAbsolutePath(), - config.getOutputDir().getAbsolutePath().equals((new File(TEST_DIR)).getAbsolutePath())); + config.getOutputDir().getAbsolutePath().equals((new File(TEST_DIR)).getAbsolutePath())); } public void testClasspathSetting() throws InvalidInputException { String ENTRY = "1.jar" + File.pathSeparator + "2.jar"; AjBuildConfig config = genBuildConfig(new String[] { "-classpath", ENTRY }, messageWriter); - + List cp = config.getClasspath(); boolean jar1Found = false; boolean jar2Found = false; @@ -390,10 +390,10 @@ public class BuildArgParserTestCase extends TestCase { String FILE_PATH = "@" + TEST_DIR + "configWithArgs.lst"; String OUT_PATH = "bin"; AjBuildConfig config = genBuildConfig(new String[] { FILE_PATH }, messageWriter); - + assertNotNull(config); File outputDir = config.getOutputDir(); - assertNotNull(outputDir); + assertNotNull(outputDir); assertEquals(outputDir.getPath(), OUT_PATH); } @@ -411,7 +411,7 @@ public class BuildArgParserTestCase extends TestCase { assertTrue(pathList.contains(a)); assertTrue(pathList.contains(b)); assertTrue(pathList.contains(c)); - + } public void testXlint() throws InvalidInputException { @@ -427,13 +427,13 @@ public class BuildArgParserTestCase extends TestCase { } public void testXlintfile() throws InvalidInputException { - String lintFile = Constants.TESTDATA_PATH + "/lintspec.properties"; + String lintFile = Constants.TESTDATA_PATH + "/lintspec.properties"; // String badLintFile = "lint.props"; AjBuildConfig config = genBuildConfig(new String[] {"-Xlintfile", lintFile}, messageWriter); assertTrue(new File(lintFile).exists()); - assertEquals(getCanonicalPath(new File(lintFile)),config.getLintSpecFile().getAbsolutePath()); + assertEquals(getCanonicalPath(new File(lintFile)),config.getLintSpecFile().getAbsolutePath()); } - + /** * The option '-1.5' are currently eaten by the AspectJ argument parser - since * the JDT compiler upon which we are based doesn't understand them - *this should change* when we @@ -461,46 +461,46 @@ public class BuildArgParserTestCase extends TestCase { String TARGET = "1.4"; AjBuildConfig config = genBuildConfig(new String[] {"-target", TARGET, "-source", TARGET}, messageWriter); assertTrue( - "target set", + "target set", config.getOptions().targetJDK == ClassFileConstants.JDK1_4); assertTrue( - "source set", + "source set", config.getOptions().sourceLevel == ClassFileConstants.JDK1_4); } - + public void testLstFileExpansion() throws IOException, FileNotFoundException, InvalidInputException { String FILE_PATH = TEST_DIR + "config.lst"; String SOURCE_PATH_1 = "A.java"; String SOURCE_PATH_2 = "B.java"; // File f = new File(FILE_PATH); - + AjBuildConfig config = genBuildConfig(new String[] { "@" + FILE_PATH }, messageWriter); List resultList = config.getFiles(); - - assertTrue("correct number of files", resultList.size() == 2); + + assertTrue("correct number of files", resultList.size() == 2); assertTrue(resultList.toString() + new File(TEST_DIR + SOURCE_PATH_1).getCanonicalFile(), resultList.contains(new File(TEST_DIR + SOURCE_PATH_1).getCanonicalFile())); assertTrue(resultList.toString() + SOURCE_PATH_2, - resultList.contains(new File(TEST_DIR + SOURCE_PATH_2).getCanonicalFile())); + resultList.contains(new File(TEST_DIR + SOURCE_PATH_2).getCanonicalFile())); } - + //??? do we need to remove this limitation // public void testArgInConfigFileAndRelativizingPathParam() throws InvalidInputException { // String FILE_PATH = "@" + TEST_DIR + "configWithArgs.lst"; // String OUT_PATH = TEST_DIR + "bin"; // AjBuildConfig config = genBuildConfig(new String[] { FILE_PATH }); -// +// // assertTrue( // config.getOutputDir().getPath() + " ?= " + OUT_PATH, -// config.getOutputDir().getAbsolutePath().equals((new File(OUT_PATH)).getAbsolutePath())); +// config.getOutputDir().getAbsolutePath().equals((new File(OUT_PATH)).getAbsolutePath())); // } - + public void testAjFileInclusion() throws InvalidInputException { genBuildConfig(new String[] { TEST_DIR + "X.aj", TEST_DIR + "Y.aj"}, messageWriter); } - + public void testOutxml () { IMessageHolder messageHolder = new MessageHandler(); AjBuildConfig config = genBuildConfig(new String[] { "-outxml", "-showWeaveInfo" }, messageHolder); @@ -508,7 +508,7 @@ public class BuildArgParserTestCase extends TestCase { assertEquals("Wrong outxml","META-INF/aop-ajc.xml",config.getOutxmlName()); assertTrue("Following option currupted",config.getShowWeavingInformation()); } - + public void testOutxmlfile () { IMessageHolder messageHolder = new MessageHandler(); AjBuildConfig config = genBuildConfig(new String[] { "-outxmlfile", "custom/aop.xml", "-showWeaveInfo" }, messageHolder); @@ -521,12 +521,12 @@ public class BuildArgParserTestCase extends TestCase { AjBuildConfig config = setupNonstandardPath("-injars"); assertEquals("bad path: " + config.getInJars(), 3, config.getInJars().size()); } - + public void testNonstandardInpath() { AjBuildConfig config = setupNonstandardPath("-inpath"); assertEquals("bad path: " + config.getInpath(), 3, config.getInpath().size()); } - + public void testNonstandardAspectpath() { AjBuildConfig config = setupNonstandardPath("-aspectpath"); assertEquals("bad path: " + config.getAspectpath(), 3, config.getAspectpath().size()); @@ -536,12 +536,12 @@ public class BuildArgParserTestCase extends TestCase { AjBuildConfig config = setupNonstandardPath("-classpath"); checkPathSubset(config.getClasspath()); } - + public void testNonstandardBootpath() throws IOException { AjBuildConfig config = setupNonstandardPath("-bootclasspath"); checkPathSubset(config.getBootclasspath()); } - + private void checkPathSubset(List path) throws IOException { String files[] = { "aspectjJar.file", "jarChild", "parent.zip" }; for (String s : files) { @@ -552,15 +552,15 @@ public class BuildArgParserTestCase extends TestCase { public void testNonstandardOutjar() { final String OUT_JAR = NONSTANDARD_JAR_DIR + File.pathSeparator + "outputFile"; - - AjBuildConfig config = genBuildConfig(new String[] { - "-outjar", OUT_JAR }, + + AjBuildConfig config = genBuildConfig(new String[] { + "-outjar", OUT_JAR }, messageWriter); File newJar = new File(OUT_JAR); assertEquals( - getCanonicalPath(newJar),config.getOutputJar().getAbsolutePath()); - + getCanonicalPath(newJar),config.getOutputJar().getAbsolutePath()); + newJar.delete(); } @@ -568,25 +568,25 @@ public class BuildArgParserTestCase extends TestCase { String filePath = Constants.TESTDATA_PATH + File.separator + "ajc.jar" + File.separator; File testDir = new File(filePath); AjBuildConfig config = genBuildConfig(new String[] { "-d", filePath }, messageWriter); - - assertEquals(testDir.getAbsolutePath(), config.getOutputDir().getAbsolutePath()); + + assertEquals(testDir.getAbsolutePath(), config.getOutputDir().getAbsolutePath()); } - + private static final String NONSTANDARD_JAR_DIR = Constants.TESTDATA_PATH + "/OutjarTest/folder.jar/"; - + private AjBuildConfig setupNonstandardPath(String pathType) { - String NONSTANDARD_PATH_ENTRY = NONSTANDARD_JAR_DIR+"aspectjJar.file" + File.pathSeparator + NONSTANDARD_JAR_DIR+"aspectJar.file" + File.pathSeparator + NONSTANDARD_JAR_DIR+"jarChild" + File.pathSeparator + NONSTANDARD_JAR_DIR+"parent.zip"; - - return genBuildConfig(new String[] { - pathType, NONSTANDARD_PATH_ENTRY }, + String NONSTANDARD_PATH_ENTRY = NONSTANDARD_JAR_DIR+"aspectjJar.file" + File.pathSeparator + NONSTANDARD_JAR_DIR+"aspectJar.file" + File.pathSeparator + NONSTANDARD_JAR_DIR+"jarChild" + File.pathSeparator + NONSTANDARD_JAR_DIR+"parent.zip"; + + return genBuildConfig(new String[] { + pathType, NONSTANDARD_PATH_ENTRY }, messageWriter); } - + @Override protected void setUp() throws Exception { super.setUp(); } - + @Override protected void tearDown() throws Exception { super.tearDown(); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/ConsoleMessageHandlerTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/ConsoleMessageHandlerTestCase.java index 9ec3e201c..ef996b891 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/ConsoleMessageHandlerTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/ConsoleMessageHandlerTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.ajc; @@ -15,7 +15,7 @@ package org.aspectj.ajdt.ajc; import junit.framework.TestCase; /** - * @author Mik Kersten + * @author Mik Kersten */ public class ConsoleMessageHandlerTestCase extends TestCase { @@ -34,7 +34,7 @@ public class ConsoleMessageHandlerTestCase extends TestCase { public void testHandlingInfoMessages() { testOutput(true); } - + private void testOutput(boolean verboseMode) { //XXX update to new MessageHandler // final String MESSAGE = "test;"; @@ -42,16 +42,16 @@ public class ConsoleMessageHandlerTestCase extends TestCase { // StreamPrintWriter output = new StreamPrintWriter(new PrintWriter(System.out)); // ConsoleMessageHandler writer = new ConsoleMessageHandler(output); // if (!verboseMode) writer.ignore(IMessage.INFO); -// +// // writer.handleMessage(new Message(MESSAGE, Message.INFO, null, null)); // if (verboseMode) { // assertTrue("message=" + output.getContents(), output.getContents().equals(MESSAGE + "\n")); // } else { -// assertTrue("message=" + output.getContents(), output.getContents().equals("")); +// assertTrue("message=" + output.getContents(), output.getContents().equals("")); // } -// +// // output.flushBuffer(); // writer.handleMessage(new Message(MESSAGE, Message.ERROR, null, null)); -// assertTrue(output.getContents(), output.getContents().equals(MESSAGE + "\n")); - } +// assertTrue(output.getContents(), output.getContents().equals(MESSAGE + "\n")); + } } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/Constants.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/Constants.java index f9078d032..916ab0cef 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/Constants.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/ajc/Constants.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2019 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * ******************************************************************/ package org.aspectj.ajdt.ajc; @@ -19,9 +19,9 @@ public class Constants { public static final String TESTDATA_PATH = "../org.aspectj.ajdt.core/testdata"; public static final File TESTDATA_DIR = new File(TESTDATA_PATH); - + public static String aspectjrtClasspath() { - return TestUtil.aspectjrtPath().getPath(); + return TestUtil.aspectjrtPath().getPath(); } - -} + +} diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java index 7b1ee7163..21bf414f7 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/AjdtBatchTests.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: -// * PARC initial implementation +// * All rights reserved. +// * This program and the accompanying materials are made available +// * under the terms of the Eclipse Public License v 2.0 +// * which accompanies this distribution and is available at +// * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt +// * +// * Contributors: +// * PARC initial implementation // * ******************************************************************/ // // @@ -18,28 +18,28 @@ // //public class AjdtBatchTests extends TestCase { // -// public static Test suite() { +// public static Test suite() { // TestSuite suite = new TestSuite(AjdtBatchTests.class.getName()); // // Abstract superclass -// //suite.addTestSuite(CommandTestCase.class); +// //suite.addTestSuite(CommandTestCase.class); // //$JUnit-BEGIN$ -// suite.addTestSuite(BasicCommandTestCase.class); -// suite.addTestSuite(BinaryFormsTestCase.class); -// suite.addTestSuite(CompileAndRunTestCase.class); -// suite.addTestSuite(PerformanceTestCase.class); -// suite.addTestSuite(ImageTestCase.class); -// suite.addTestSuite(MultipleCompileTestCase.class); +// suite.addTestSuite(BasicCommandTestCase.class); +// suite.addTestSuite(BinaryFormsTestCase.class); +// suite.addTestSuite(CompileAndRunTestCase.class); +// suite.addTestSuite(PerformanceTestCase.class); +// suite.addTestSuite(ImageTestCase.class); +// suite.addTestSuite(MultipleCompileTestCase.class); // suite.addTestSuite(JavadocTest.class); // suite.addTestSuite(PartiallyExposedHierarchyTestCase.class); -// suite.addTestSuite(CompilerDumpTestCase.class); +// suite.addTestSuite(CompilerDumpTestCase.class); // suite.addTestSuite(ProceedOnErrorTestCase.class); // suite.addTestSuite(DeclareParentsTest.class); -// // XXX suite.addTestSuite(VerifyWeaveTestCase.class); -// //suite.addTestSuite(WorkingCommandTestCase.class); +// // XXX suite.addTestSuite(VerifyWeaveTestCase.class); +// //suite.addTestSuite(WorkingCommandTestCase.class); // //$JUnit-END$ // return suite; // } // // public AjdtBatchTests(String name) { super(name); } // -//} +//} diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java index a670cad50..873087383 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BasicCommandTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -39,19 +39,19 @@ public class BasicCommandTestCase extends CommandTestCase { public BasicCommandTestCase(String name) { super(name); } - + public void testA() { checkCompile("src1/A.java", NO_ERRORS); } - + public void testA1() { checkCompile("src1/A1.java", NO_ERRORS); } - + public void testBadA() { checkCompile("src1/BadA.java", new int[] {7, 8}); } - + public void testHello() { checkCompile("src1/Hello.java", NO_ERRORS); } @@ -63,29 +63,29 @@ public class BasicCommandTestCase extends CommandTestCase { public void testMissingHello() { checkCompile("src1/MissingHello.java", TOP_ERROR); } - + public void testBadBinding() { checkCompile("src1/BadBinding.java", new int[] {2, 4, 8, 10, 13, 16, 19}); } public void testThisAndModifiers() { checkCompile("src1/ThisAndModifiers.java", NO_ERRORS); } - + public void testDeclares() { checkCompile("src1/Declares.java", new int[] {2}); - } - + } + public void testDeclareWarning() { checkCompile("src1/DeclareWarning.java", NO_ERRORS); - } - - + } + + public void testP1() { checkCompile("src1/p1/Foo.java", NO_ERRORS); } - + public void testUnimplementedSyntax() { - checkCompile("src1/UnimplementedSyntax.java", + checkCompile("src1/UnimplementedSyntax.java", new int[] {5, 15, 16, 22, 25}); } public void testXlintWarn() { @@ -96,7 +96,7 @@ public class BasicCommandTestCase extends CommandTestCase { args.add("-d"); args.add(getSandboxName()); - + args.add("-classpath"); StringBuilder classpath = new StringBuilder(); classpath.append(getRuntimeClasspath()); @@ -104,7 +104,7 @@ public class BasicCommandTestCase extends CommandTestCase { args.add(classpath.toString()); args.add("-Xlint:error"); args.add(Constants.TESTDATA_PATH + "/src1/Xlint.java"); - + runCompiler(args, new int[] {2}); } public void testMissingJarError() { @@ -112,12 +112,12 @@ public class BasicCommandTestCase extends CommandTestCase { args.add("-d"); args.add(getSandboxName()); - + args.add("-classpath"); args.add(getRuntimeClasspath() + File.pathSeparator + "../lib/junit/junit.jar;../testing-client/bin;not_found_anywhere.jar"); args.add(Constants.TESTDATA_PATH + "/src1/ThisAndModifiers.java"); - + ICommand command = new AjdtCommand(); MessageHandler myHandler = new MessageHandler(); //myHandler.setInterceptor(org.aspectj.tools.ajc.Main.MessagePrinter.TERSE); @@ -133,11 +133,11 @@ public class BasicCommandTestCase extends CommandTestCase { args.add("-d"); args.add(getSandboxName()); - + args.add("-classpath"); args.add("../lib/junit/junit.jar;../testing-client/bin"); args.add(Constants.TESTDATA_PATH + "/src1/ThisAndModifiers.java"); - + ICommand command = new AjdtCommand(); MessageHandler myHandler = new MessageHandler(); myHandler.setInterceptor(org.aspectj.tools.ajc.Main.MessagePrinter.TERSE); @@ -145,51 +145,51 @@ public class BasicCommandTestCase extends CommandTestCase { assertEquals("error for org.aspectj.lang.JoinPoint not found", 1, myHandler.getErrors().length); } - + public void testImplicitOutputDir() { List args = new ArrayList(); - + args.add("-classpath"); args.add(getRuntimeClasspath() + File.pathSeparator + "../lib/junit/junit.jar;../testing-client/bin"); - + File f1 = new File(Constants.TESTDATA_PATH + "/src1/p1/Foo.class"); File f2 = new File(Constants.TESTDATA_PATH + "/src1/WrongPackage.class"); File f3 = new File(Constants.TESTDATA_PATH + "/src1/WrongPackage$1.class"); - + if (f1.exists()) f1.delete(); if (f2.exists()) f2.delete(); if (f3.exists()) f3.delete(); - + args.add(Constants.TESTDATA_PATH + "/src1/p1/Foo.java"); args.add(Constants.TESTDATA_PATH + "/src1/WrongPackage.java"); - + runCompiler(args, NO_ERRORS); - + assertTrue(f1.getPath(), f1.exists()); assertTrue(f2.getPath(), f2.exists()); assertTrue(f3.getPath(), f3.exists()); - + if (f1.exists()) f1.delete(); if (f2.exists()) f2.delete(); if (f3.exists()) f3.delete(); - + } - + public void testSizeChanges() { File f1 = new File(getSandboxName(),"SizeIssues.class"); - + List<String> args = new ArrayList<>(); args.add("-d"); args.add(getSandboxName()); - + args.add("-classpath"); args.add(getRuntimeClasspath() + File.pathSeparator + "../lib/junit/junit.jar;../testing-client/bin"); - - args.add(Constants.TESTDATA_PATH + "/src1/SizeIssuesAspect.java"); + + args.add(Constants.TESTDATA_PATH + "/src1/SizeIssuesAspect.java"); args.add(Constants.TESTDATA_PATH + "/src1/SizeIssues.java"); runCompiler(args, NO_ERRORS); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java index 4fd1b50c6..45c64f248 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -22,7 +22,7 @@ import org.aspectj.ajdt.ajc.Constants; public class BcweaverJarMaker { private static String cp = "../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path"); - + public BcweaverJarMaker() { super(); } @@ -32,22 +32,22 @@ public class BcweaverJarMaker { makeJar1(); makeJar1a(); makeJar2(); - + makeJarObviousNothing(); makeJarHardNothing(); - - + + makeTestJars(); makeURLWeavingClassLoaderJars(); - + makeDuplicateManifestTestJars(); makeOutjarTestJars(); makeAspectPathTestJars(); makeAjc11TestJars(); } - + public static void makeJar0() throws IOException { List<String> args = new ArrayList<>(); args.add("-outjar"); @@ -55,13 +55,13 @@ public class BcweaverJarMaker { args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add(Constants.TESTDATA_PATH + "/src1/Trace.java"); args.add(Constants.TESTDATA_PATH + "/src1/MyTrace.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } - + public static void makeJar1() throws IOException { List<String> args = new ArrayList<>(); @@ -70,14 +70,14 @@ public class BcweaverJarMaker { args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add(Constants.TESTDATA_PATH + "/src1/trace/MegaTrace.java"); args.add(Constants.TESTDATA_PATH + "/src1/trace/ExecTrace.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } - - + + public static void makeJarObviousNothing() throws IOException { List<String> args = new ArrayList<>(); args.add("-outjar"); @@ -85,13 +85,13 @@ public class BcweaverJarMaker { args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add(Constants.TESTDATA_PATH + "/src1/trace/MegaTrace.java"); args.add(Constants.TESTDATA_PATH + "/src1/trace/ObviousTraceNothing.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } - + public static void makeJarHardNothing() throws IOException { List<String> args = new ArrayList<>(); args.add("-outjar"); @@ -99,14 +99,14 @@ public class BcweaverJarMaker { args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add(Constants.TESTDATA_PATH + "/src1/trace/MegaTrace.java"); args.add(Constants.TESTDATA_PATH + "/src1/trace/HardTraceNothing.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } - - + + public static void makeJar1a() throws IOException { List<String> args = new ArrayList<>(); args.add("-outjar"); @@ -116,14 +116,14 @@ public class BcweaverJarMaker { args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add(Constants.TESTDATA_PATH + "/src1/trace/MegaTrace.java"); args.add(Constants.TESTDATA_PATH + "/src1/trace/ExecTrace.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } - - + + public static void makeJar2() throws IOException { List<String> args = new ArrayList<>(); args.add("-outjar"); @@ -131,78 +131,78 @@ public class BcweaverJarMaker { args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add(Constants.TESTDATA_PATH + "/src1/DummyAspect.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - } - + } + public static void makeTestJars() throws IOException { List<String> args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); - args.add("../tests/new/options11/aspectlib1.jar"); + args.add("../tests/new/options11/aspectlib1.jar"); args.add("../tests/new/options11/library1/*.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - + args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); - args.add("../tests/new/options11/aspectlib2.jar"); + args.add("../tests/new/options11/aspectlib2.jar"); args.add("../tests/new/options11/library2/*.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - + args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); - args.add("../tests/new/options11/injar.jar"); + args.add("../tests/new/options11/injar.jar"); args.add("../tests/new/options11/injar/*.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - + args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); - args.add("../tests/bugs/serialVersionUID/injar.jar"); + args.add("../tests/bugs/serialVersionUID/injar.jar"); args.add("../tests/bugs/serialVersionUID/Test.java"); args.add("../tests/bugs/serialVersionUID/Util.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - + // For PR55341 args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); - args.add("../tests/bugs/StringToString/helloworld.jar"); - args.add("../tests/bugs/StringToString/HW.java"); + args.add("../tests/bugs/StringToString/helloworld.jar"); + args.add("../tests/bugs/StringToString/HW.java"); CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - buildShowWeaveInfoTestingJars(); + buildShowWeaveInfoTestingJars(); } - + public static void makeURLWeavingClassLoaderJars() throws IOException { List<String> args = new ArrayList<>(); /* * Vanilla classes */ - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -211,11 +211,11 @@ public class BcweaverJarMaker { args.add(Constants.TESTDATA_PATH + "/src1/ltw/LTWPackageTest.java"); CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - /* + /* * Woven classes */ args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-XnotReweavable"); @@ -229,7 +229,7 @@ public class BcweaverJarMaker { * Advice */ args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -241,7 +241,7 @@ public class BcweaverJarMaker { * Declare warning advice */ args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -253,7 +253,7 @@ public class BcweaverJarMaker { * Declare error advice */ args = new ArrayList(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -265,7 +265,7 @@ public class BcweaverJarMaker { * Around closure advice */ args = new ArrayList<>(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -277,8 +277,8 @@ public class BcweaverJarMaker { * ITD */ args = new ArrayList<>(); - args.add("-Xlint:ignore"); - args.add("-classpath"); + args.add("-Xlint:ignore"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -292,31 +292,31 @@ public class BcweaverJarMaker { * perXXX() */ args = new ArrayList(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); args.add("../weaver/testdata/ltw-peraspects.jar"); args.add(Constants.TESTDATA_PATH + "/src1/LTWPerthis.aj"); CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - } - + } + private static void buildJarWithClasspath(String outjar,String input,String deps,boolean nodebug) { System.out.println(" Building "+outjar); List<String> args = new ArrayList<>(); - if (nodebug) args.add("-g:none"); - args.add("-classpath"); + if (nodebug) args.add("-g:none"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path") + (deps!=null?File.pathSeparator + "../ajde/testdata/WeaveInfoMessagesTest/"+deps:"")); args.add("-outjar"); - args.add("../ajde/testdata/WeaveInfoMessagesTest/"+outjar); + args.add("../ajde/testdata/WeaveInfoMessagesTest/"+outjar); args.add("../ajde/testdata/WeaveInfoMessagesTest/"+input); - + System.err.println(args); - CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } - + private static void buildShowWeaveInfoTestingJars() { System.out.println("For binary weave info message testing (ShowWeaveMessagesTestCase.java)"); buildJarWithClasspath("Simple.jar","Simple.java",null,false); @@ -330,15 +330,15 @@ public class BcweaverJarMaker { buildJarWithClasspath("AspectITD_nodebug.jar","AspectITD.aj","Simple.jar",true); buildJarWithClasspath("AspectDeclareSoft.jar","AspectDeclareSoft.aj","Simple.jar",false); buildJarWithClasspath("AspectDeclareSoft_nodebug.jar","AspectDeclareSoft.aj","Simple.jar",true); - } - + } + public static void makeDuplicateManifestTestJars() throws IOException { List<String> args = new ArrayList<>(); /* * injar */ - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -350,7 +350,7 @@ public class BcweaverJarMaker { * aspectjar */ args = new ArrayList(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -358,37 +358,37 @@ public class BcweaverJarMaker { args.add(Constants.TESTDATA_PATH + "/src1/Trace.java"); args.add(Constants.TESTDATA_PATH + "/src1/TraceHello.java"); CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - } - + } + public static void makeAspectPathTestJars() throws IOException { List<String> args = new ArrayList<>(); args.clear(); - args.add("-classpath"); + args.add("-classpath"); args.add(cp); args.add("-outjar"); args.add("../tests/bugs/perCflowAndJar/lib.jar"); args.add("../tests/bugs/perCflowAndJar/PerCFlowCompileFromJar.java"); CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } - + public static void makeAjc11TestJars() throws IOException { List<String> args = new ArrayList<>(); args.clear(); - args.add("-classpath"); + args.add("-classpath"); args.add(cp); args.add("-outjar"); args.add("../tests/bugs/cflowAndJar/lib.jar"); args.add("../tests/bugs/cflowAndJar/AbstractAspect.aj"); CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } - + public static void makeOutjarTestJars() throws IOException { List<String> args = new ArrayList<>(); // parent args.clear(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -400,7 +400,7 @@ public class BcweaverJarMaker { * child */ args.clear(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path") + File.pathSeparator + "./testdata/OutjarTest/parent.jar"); @@ -413,7 +413,7 @@ public class BcweaverJarMaker { * aspects */ args.clear(); - args.add("-classpath"); + args.add("-classpath"); args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + File.pathSeparator + System.getProperty("aspectjrt.path")); args.add("-outjar"); @@ -425,7 +425,7 @@ public class BcweaverJarMaker { * aspectjar */ // args = new ArrayList(); -// args.add("-classpath"); +// args.add("-classpath"); // args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" + // File.pathSeparator + System.getProperty("aspectjrt.path")); // args.add("-outjar"); @@ -433,5 +433,5 @@ public class BcweaverJarMaker { // args.add(AjdtAjcTests.TESTDATA_PATH + "/src1/Trace.java"); // args.add(AjdtAjcTests.TESTDATA_PATH + "/src1/TraceHello.java"); // CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - } + } } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BinaryFormsTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BinaryFormsTestCase.java index cd514fe43..382fcd201 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BinaryFormsTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/BinaryFormsTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -26,46 +26,46 @@ public class BinaryFormsTestCase extends CommandTestCase { public BinaryFormsTestCase(String name) { super(name); } - + public void testJar1() throws IOException { String library = getSandboxName() + "/lib.jar"; - + List<String> args = new ArrayList<>(); args.add("-outjar"); args.add(library); args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add("-d"); args.add(getSandboxName()); args.add("-XnotReweavable"); - + args.add(Constants.TESTDATA_PATH + "/src1/binary/lib/ConcreteA.aj"); args.add(Constants.TESTDATA_PATH + "/src1/binary/lib/AbstractA.aj"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - + args = new ArrayList<>(); args.add("-aspectpath"); args.add(library); args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add("-d"); args.add(getSandboxName()); args.add("-XnotReweavable"); - + args.add(Constants.TESTDATA_PATH + "/src1/binary/client/Client.java"); args.add(Constants.TESTDATA_PATH + "/src1/binary/client/Client1.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - + TestUtil.runMain(getSandboxName() + File.pathSeparator + library, "client.Client"); TestUtil.runMain(getSandboxName() + File.pathSeparator + library, "client.Client1"); - + args = new ArrayList(); args.add("-aspectpath"); args.add(library); @@ -73,15 +73,15 @@ public class BinaryFormsTestCase extends CommandTestCase { args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); args.add("-XnotReweavable"); - + args.add("-d"); args.add(getSandboxName()); - + args.add(Constants.TESTDATA_PATH + "/src1/binary/client/MyAspect.aj"); args.add(Constants.TESTDATA_PATH + "/src1/binary/client/Client1.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); - + TestUtil.runMain(getSandboxName() + File.pathSeparator + library, "client.Client1"); args = new ArrayList<>(); @@ -90,39 +90,39 @@ public class BinaryFormsTestCase extends CommandTestCase { args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); - + args.add("-d"); args.add(getSandboxName()); args.add("-XnotReweavable"); - + args.add(Constants.TESTDATA_PATH + "/src1/binary/client/MyAspect1.aj"); args.add(Constants.TESTDATA_PATH + "/src1/binary/client/Client1.java"); - + CommandTestCase.runCompiler(args, new int[] {24, 30}); args = new ArrayList(); args.add("-classpath"); args.add(library + File.pathSeparator + Constants.aspectjrtClasspath()); - + args.add("-d"); args.add(getSandboxName()); args.add("-XnotReweavable"); - + args.add(Constants.TESTDATA_PATH + "/src1/binary/client/Client1.java"); - + CommandTestCase.runCompiler(args, new int[] {15, 17, 22}); - + args = new ArrayList(); args.add("-classpath"); args.add(Constants.aspectjrtClasspath() + File.pathSeparator + library); args.add("-Xlint:error"); - + args.add("-d"); args.add(getSandboxName()); - + args.add(Constants.TESTDATA_PATH + "/src1/binary/client/MyAspect.aj"); args.add(Constants.TESTDATA_PATH + "/src1/binary/client/Client1.java"); - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); } } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java index daa23dd98..e259bf6d3 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CommandTestCase.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CompileAndRunTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CompileAndRunTestCase.java index 4d1d6db26..504477c60 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CompileAndRunTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CompileAndRunTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -25,7 +25,7 @@ public class CompileAndRunTestCase extends CommandTestCase { checkCompile("src1/AroundA.java", NO_ERRORS); runMain("AroundAMain"); } - + public void testInterType() throws IOException { checkCompile("src1/InterType.java",new String[]{"-Xset:itdVersion=1"}, NO_ERRORS); runMain("InterType"); @@ -36,59 +36,59 @@ public class CompileAndRunTestCase extends CommandTestCase { // checkCompile("src1/InterType2.java", NO_ERRORS); // runMain("InterType2"); // } - + public void testInterTypeMethods() throws IOException { checkCompile("src1/InterTypeMethods.java", NO_ERRORS); runMain("InterTypeMethods"); } - + public void testIf() throws IOException { checkCompile("src1/IfPcd.java", CommandTestCase.NO_ERRORS); runMain("IfPcd"); } - + public void testDeclareParentsFail() throws IOException { checkCompile("src1/ParentsFail.java", new int[] {3, 11, 19}); } - + public void testDeclareParents() throws IOException { checkCompile("src1/Parents.java", CommandTestCase.NO_ERRORS); runMain("Parents"); } - + public void testPerCflow() throws IOException { checkCompile("src1/PerCflow.java", CommandTestCase.NO_ERRORS); runMain("PerCflow"); } - + public void testPerObject() throws IOException { checkCompile("src1/PerObject.java", CommandTestCase.NO_ERRORS); runMain("PerObject"); } - + public void testDeclareSoft() throws IOException { checkCompile("src1/DeclareSoft.java", CommandTestCase.NO_ERRORS); runMain("DeclareSoft"); } - + public void testPrivileged() throws IOException { checkCompile("src1/Privileged.java", CommandTestCase.NO_ERRORS); runMain("Privileged"); } - + public void testHandler() throws IOException { checkCompile("src1/Handler.java", CommandTestCase.NO_ERRORS); runMain("Handler"); } - + public void testInterConstructors() throws IOException { checkCompile("src1/InterTypeConstructors.java", CommandTestCase.NO_ERRORS); runMain("InterTypeConstructors"); } - + public void testAroundA1() throws IOException { checkCompile("src1/AroundA1.java", CommandTestCase.NO_ERRORS); runMain("AroundA1"); } - + } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CompilerDumpTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CompilerDumpTestCase.java index 7aa3749c2..d1d72dddd 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CompilerDumpTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/CompilerDumpTestCase.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Matthew Webster - initial implementation *******************************************************************************/ @@ -45,9 +45,9 @@ public class CompilerDumpTestCase extends AjcTestCase { /** * Aim: Dump after successful compile to ensure it contains the command line information. - * + * * Inputs to the compiler: HelloWorld.java Pointcuts.aj Aspect.aj - * + * * Expected result = Compile succeeds. */ public void testDump() { @@ -61,9 +61,9 @@ public class CompilerDumpTestCase extends AjcTestCase { /** * Aim: Dump after successful compile to ensure it contains warning messages. - * + * * Inputs to the compiler: HelloWorld.java Pointcuts.aj Aspect.aj DeclareWarning.aj - * + * * Expected result = Compile succeeds. */ public void testDumpWithWarnings() { @@ -78,9 +78,9 @@ public class CompilerDumpTestCase extends AjcTestCase { /** * Aim: Dump due to errors. - * + * * Inputs to the compiler: HelloWorld.java Pointcuts.aj Aspect.aj DeclareError.aj - * + * * Expected result = Compile fails and dump file created. */ public void testWithErrors() { diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/DeclareParentsTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/DeclareParentsTest.java index 33f8a48e9..4f742a140 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/DeclareParentsTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/DeclareParentsTest.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Andy Clement - initial implementation *******************************************************************************/ @@ -24,18 +24,18 @@ import org.aspectj.tools.ajc.CompilationResult; * the classes/aspects - we get some set of errors/warnings and weaving messages out from doing this. We then compile the source * files and aspects separately and binary weave them together - we should get the same set of weaving information messages. Where * possible we also execute one of the classes after the binary weave to check it passes the verifier and executes. - * + * * There are some notes about the implementation throughout these testcases and they are marked: 'IMPORTANT:' - * - * + * + * * Two things missing: - * + * * In the case where inherited methods can't be overridden to reduce visibility, we should cope with a subclass of the decp target * also trying to do it ? We need a way once we see a type to say 'hey, watch out for this guys kids...' - this will also help us * when working with abstract classes that don't provide method implementations where their children might. - * + * * Field inheritance? Is there something to worry about here? - * + * * Covariance on method overrides is supported but untested because we need a Java5 compiler (so we can write easy tests) */ public class DeclareParentsTest extends AjcTestCase { @@ -117,7 +117,7 @@ public class DeclareParentsTest extends AjcTestCase { /** * If overriding an instance method, can't make it static. If overriding a static method, can't make it an instance method. - * + * * Note: Error messages and locations for binary weaving are much better than their source counterparts ! */ public void test_cantMakeInheritedInstanceMethodsStatic() { @@ -135,7 +135,7 @@ public class DeclareParentsTest extends AjcTestCase { /** * The Object class cannot be subject to declare parents extends - * + * * This is tested when the aspect is compiled - so couldn't occur during binary weaving of decp. */ @@ -149,7 +149,7 @@ public class DeclareParentsTest extends AjcTestCase { /** * if you inherit methods you cannot override them and reduce their visibility. - * + * * test 2 in this set checks methods from a superclass of the named new parent. */ public void test_cantReduceVisibilityOfOverriddenMethods_2() { @@ -167,7 +167,7 @@ public class DeclareParentsTest extends AjcTestCase { /** * Testing: If you inherit abstract methods and you are not abstract you need to provide an implementation. - * + * * Test 1 in this set is simple. */ public void test_inheritedAbstractMethodsMustBeImplemented_1() { @@ -186,7 +186,7 @@ public class DeclareParentsTest extends AjcTestCase { /** * Testing: If you inherit abstract methods and you are not abstract you need to provide an implementation. - * + * * Test 2 in this set includes methods further up the hierarchy that must be implemented. */ public void test_inheritedAbstractMethodsMustBeImplemented_2() { @@ -196,7 +196,7 @@ public class DeclareParentsTest extends AjcTestCase { /** * Testing: If you inherit abstract methods and you are not abstract you need to provide an implementation. - * + * * Test 3 in this set includes methods further up the hierarchy that must be implemented *and* the dependencies are satisfied by * ITDs from the aspect */ diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/DumpTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/DumpTestCase.java index 4f40922d6..48f713380 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/DumpTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/DumpTestCase.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: - * Matthew Webster + * Matthew Webster *******************************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -26,7 +26,7 @@ import org.aspectj.weaver.Dump; /** * @author websterm * - * Test Dump facility. Ensure it can be configured and files contain expected contents. Testcase + * Test Dump facility. Ensure it can be configured and files contain expected contents. Testcase * returns Dump configuration to orginal state. */ public class DumpTestCase extends TestCase { @@ -40,18 +40,18 @@ public class DumpTestCase extends TestCase { protected void setUp() throws Exception { super.setUp(); - + dumpFile = null; savedDumpCondition = Dump.getDumpOnExit(); } protected void tearDown() throws Exception { super.tearDown(); - + if (dumpFile != null && dumpFile.exists()) { boolean deleted = dumpFile.delete(); assertTrue("Dump file '" + dumpFile.getPath() + "' could not be deleted",deleted); - } + } Dump.setDumpOnExit(savedDumpCondition); } @@ -59,26 +59,26 @@ public class DumpTestCase extends TestCase { Dump.setDumpOnException(true); assertTrue("DumpOnException should be true",Dump.getDumpOnException()); } - + public void testSetDumpOnExit () { assertTrue("Should be able to set condition 'error'",Dump.setDumpOnExit("error")); assertTrue("Should be able to set condition 'warning'",Dump.setDumpOnExit("warning")); assertFalse("Should not be able to set condition 'junk'",Dump.setDumpOnExit("junk")); } - + public void testDump () { String fileName = Dump.dump("testDump()"); dumpFile = new File(fileName); assertTrue("Dump file '" + fileName + "' should exist",dumpFile.exists()); } - + public void testDumpWithException () { String message = "testDumpWithException()"; String fileName = recursiveCall(message,100); dumpFile = new File(fileName); assertContents(dumpFile,"Exception Information",message); } - + public void testDumpOnExit () { Dump.setDumpOnExit("abort"); Dump.saveMessageHolder(null); @@ -86,7 +86,7 @@ public class DumpTestCase extends TestCase { dumpFile = new File(fileName); assertTrue("Dump file '" + fileName + "' should exist",dumpFile.exists()); } - + public void testDumpOnExitExcluded () { Dump.setDumpOnExit("abort"); IMessageHolder holder = new MessageHandler(); @@ -96,7 +96,7 @@ public class DumpTestCase extends TestCase { dumpFile = new File(fileName); assertEquals("Dump '" + fileName + "' should be excluded",Dump.DUMP_EXCLUDED,fileName); } - + public void testDumpOnExitIncluded () { Dump.setDumpOnExit("error"); IMessageHolder holder = new MessageHandler(); @@ -107,17 +107,17 @@ public class DumpTestCase extends TestCase { dumpFile = new File(fileName); assertContents(dumpFile,"Compiler Messages",error.getMessage()); } - + /* Ensure dump file exists and contains certain contents under a given heading */ public static void assertContents (File dumpFile, String heading, String contents) { assertTrue("Dump file '" + dumpFile.getPath() + "' should exist",dumpFile.exists()); assertTrue("Dump file '" + dumpFile.getPath()+ "' should contain '" + contents + "'",fileContains(dumpFile,heading,contents)); } - + private static boolean fileContains (File dumpFile, String heading, String contents) { boolean result = false; - - try { + + try { BufferedReader reader = new BufferedReader(new FileReader(dumpFile)); String currentHeading = ""; String record; @@ -130,10 +130,10 @@ public class DumpTestCase extends TestCase { catch (IOException ex) { fail(ex.toString()); } - + return result; } - + /* Generate a big stack trace */ private String recursiveCall (String message, int depth) { if (depth == 0) { diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/ImageTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/ImageTestCase.java index 73043b064..da904c352 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/ImageTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/ImageTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -32,7 +32,7 @@ import junit.framework.*; public class ImageTestCase extends TestCase { - + public ImageTestCase(String name) { super(name); } @@ -44,7 +44,7 @@ public class ImageTestCase extends TestCase { //// config.setArgs(new String[] { "testdata/src1/BadHello.java" }); //// config.setArgs(new String[] { "testdata/src1/A.java" }); // List files = new ArrayList(); -// files.add(new File("testdata/src1/A.java")); +// files.add(new File("testdata/src1/A.java")); // config.getBuildConfig().setFiles(files); // // SimpleBatchBuilder builder = new SimpleBatchBuilder(config); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java index 0d84dfc8f..96c959970 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.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: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -58,14 +58,14 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? System.err.println(sb.toString()); } - /** + /** * Run an incremental compile case. * For each i=1..9, copy files srcDir/*{i=1..9}0.java * to the sandbox and compile. * This only expects the changed files to be recompiled, but * it also calls verifyCompile(..); * @param handler all non-functional feedback here. - * Exceptions are logged as ABORT messages + * Exceptions are logged as ABORT messages */ public boolean run(File srcBase, IMessageHandler handler) throws IOException { @@ -105,7 +105,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? } MessageHandler compilerMessages = new MessageHandler(); StringBuffer commandLine = new StringBuffer(); - for (int i = 1; result && (i < 10); i++) { + for (int i = 1; result && (i < 10); i++) { String fromSuffix = "." + i + "0.java"; // copy files, collecting as we go... files.clear(); @@ -179,17 +179,17 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? log("verifyCompile - messages ", compilerMessages, handler); StringBuffer failures = new StringBuffer(); if (def.expectFail == result) { - failures.append("iteration " + iteration + + failures.append("iteration " + iteration + " expected to " + (def.expectFail ? "fail\n" : "pass")); } if (0 < failures.length()) { - fail(handler, + fail(handler, "\nFailures in iteration " + iteration - + "\n Command: " + commandLine - + "\nMessages: " + compilerMessages + + "\n Command: " + commandLine + + "\nMessages: " + compilerMessages + "\n Def: " + def + "\nFailures: " + failures); - return false; + return false; } IMessage[] messages = compilerMessages.getMessages(IMessage.ERROR, IMessageHolder.EQUAL); String[] expected = @@ -210,7 +210,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? } // -------------------------------------- test case setup - /** + /** * Get the sandbox (parent) directory. * This implementation uses the temporary directory */ @@ -220,7 +220,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? tempFile.delete(); return tempDir; } - + //XXX hack public File outputDir; @@ -252,7 +252,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? } return result; } - + // -------------------------------------- test case verification @@ -274,12 +274,12 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? List<String> result = new ArrayList<>(); for (File file: list) { // for (Iterator<?> iter = list.iterator(); iter.hasNext();) { - result.add(normalizeFilename(file.getPath())); + result.add(normalizeFilename(file.getPath())); } Collections.sort(result); return result; } - + String normalizeFilename(String s) { // XXX error-prone final String suffix = ".java"; int loc = s.lastIndexOf(suffix); @@ -290,7 +290,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? loc = s.lastIndexOf("/"); return (-1 == loc ? s : s.substring(loc+1)); } - + /** XXX duplicate message checking */ boolean haveAll( diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java index bea58ff7b..284d97545 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/JavadocTest.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Andy Clement - initial implementation *******************************************************************************/ @@ -30,9 +30,9 @@ public class JavadocTest extends AjcTestCase { /** * Aim: Check javadoc warning that appear are appropriate - * + * * ajc -warn:allJavadoc World.java - * + * */ public void testMissingJavadoc() { String[] args = new String[] { "World.java", "-warn:allJavadoc", "-1.4" }; diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/MultipleCompileTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/MultipleCompileTestCase.java index 7b3e31015..3cb2b0bf2 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/MultipleCompileTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/MultipleCompileTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/PartiallyExposedHierarchyTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/PartiallyExposedHierarchyTestCase.java index 994cce516..5047809ed 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/PartiallyExposedHierarchyTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/PartiallyExposedHierarchyTestCase.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Matthew Webster - initial implementation *******************************************************************************/ @@ -25,19 +25,19 @@ public class PartiallyExposedHierarchyTestCase extends AjcTestCase { public static final String PROJECT_DIR = "partialHierarchy"; private File baseDir; - + protected void setUp() throws Exception { super.setUp(); baseDir = new File("../org.aspectj.ajdt.core/testdata",PROJECT_DIR); } - + /** * This test verifies that AspectJ behaves correctly when parts of an object * hierarchy are exposed to it for weaving. See pr49657 for all the details. */ public void testPartiallyExposedHierarchy () { Message warning = new Message(11,"no interface constructor-execution join point"); - + // This error can't happen with the new logic to process types in hierarchical order // when applying declare parents (rather than just processing them in the order encountered // like we have been doing) - this kind of makes the test redundant ?!? @@ -52,6 +52,6 @@ public class PartiallyExposedHierarchyTestCase extends AjcTestCase { MessageSpec spec = new MessageSpec(null,newMessageList(warning),null);//newMessageList(error)); assertMessages(result,spec); } - + } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/PerformanceTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/PerformanceTestCase.java index bc10576eb..ff22e0a04 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/PerformanceTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/PerformanceTestCase.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java index 70d42bf4a..e5cdb3647 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/ProceedOnErrorTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/VerifyWeaveTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/VerifyWeaveTestCase.java index dbf205d6d..51aad2323 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/VerifyWeaveTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/VerifyWeaveTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -29,19 +29,19 @@ class Ignore {} // regenerate = false; // runTests = true; // } -// +// // static final String outDirName = "out"; // static final String srcDir = "testdata" + File.separator + "src1"+ File.separator; // // public VerifyWeaveTestCase(String name) { // super(name); // } -// +// // public void testCompile() throws IOException { // buildTest("A", "Hello", outDirName); // } -// -// +// +// // public boolean doCompile(String fileToCompile, String specifiedOutDir) { // List args = new ArrayList(); // if (specifiedOutDir != null) { @@ -51,7 +51,7 @@ class Ignore {} // args.add("-classpath"); // args.add("../runtime/bin"); // args.add(fileToCompile); -// +// // // ICommand command = new AjdtCommand(); // MessageHandler myHandler = new MessageHandler(); @@ -66,35 +66,35 @@ class Ignore {} // // public void testBuildOutputDir() throws IOException { // FileUtil.deleteContents(new File(outDirName)); -// +// // doCompile(srcDir + "A.java", outDirName); -// assertTrue("default package, output dir specified", +// assertTrue("default package, output dir specified", // new File(outDirName + File.separator + "A.class").exists()); -// +// // File testFile = new File(srcDir + "A.class"); // //XXX These test for javac compatible behavior with output dirs //// testFile.delete(); //// doCompile(srcDir + "A.java", null); -//// assertTrue("default package, no output dir specified", +//// assertTrue("default package, no output dir specified", //// testFile.exists()); -//// +//// //// doCompile(srcDir + "Ap.java", null); -//// assertTrue("package named, no dir specified", +//// assertTrue("package named, no dir specified", //// new File(srcDir + "Ap.class").exists()); -// +// // doCompile(srcDir + "Ap.java", outDirName); -// File checkFile = +// File checkFile = // new File(outDirName + File.separator + "src1" + File.separator + "Ap.class"); -// assertTrue("package named, dir specified: " + checkFile.getAbsolutePath(), +// assertTrue("package named, dir specified: " + checkFile.getAbsolutePath(), // checkFile.exists()); -// +// // } // // public void buildTest(String name, String outName, String specifiedOutDir) throws IOException { // String classDir = "bin"; -// +// // doCompile(srcDir + name + ".java", specifiedOutDir); -// +// // LazyClassGen gen = new LazyClassGen(new BcelObjectType(new ClassParser(outDirName + File.separator + outName +".class").parse())); // // try { diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java index b1ebd10ca..4af03a479 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/WorkingTestMain.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ package org.aspectj.ajdt.internal.compiler.batch; @@ -25,111 +25,111 @@ public class WorkingTestMain { //testExamples(); testOne(); } - + public static void testOne() throws IOException { //CommandTestCase.checkCompile("src1/Parents.java", CommandTestCase.NO_ERRORS); - + //CommandTestCase.checkCompile("../../tests/new/ArgsInCflow2.java", CommandTestCase.NO_ERRORS); - + //CommandTestCase.checkCompile("src1/ParentsFail.java", CommandTestCase.NO_ERRORS); - + List args = new ArrayList(); args.add("-verbose"); - + //args.add("-1.3"); args.add("-d"); args.add("out"); - + args.add("-classpath"); args.add(Constants.aspectjrtClasspath() + File.pathSeparator + "../testing-client/bin"); //args.add("../runtime/bin;../lib/junit/junit.jar"); - + // args.add("-injars"); // args.add("testdata/testclasses.jar"); - + //args.add("-aspectpath"); //args.add("../weaver/testdata/megatrace.jar"); - + args.add("c:/aspectj/scratch/arno/*.java"); //args.add("-XnoInline"); //args.add("../tests/new/Counting1.java"); //args.add("-Xlint:error"); //args.add("testdata/src1/InterType.java"); //args.add("@" + examplesDir + "tjp/files.lst"); - - + + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); //CommandTestCase.runCompiler(args, new int[] {11, 14, 18, 32, 43}); - + //CommandTestCase.printGenerated("../out", "AroundA1"); // CommandTestCase.printGenerated("../out", "SuperC"); CommandTestCase.printGenerated("../out", "org.schmidmeier.unittests.cache.TimeCacheTestsWorking"); TestUtil.runMain("out;../lib/test/testing-client.jar", "org.schmidmeier.unittests.cache.AllTimeCacheTests"); } - + private static String examplesDir = "../docs/dist/doc/examples/"; private static void example(String[] argfiles, String[] classes) { List args = new ArrayList(); args.add("-verbose"); - + args.add("-d"); args.add("out"); - + args.add("-classpath"); args.add(Constants.aspectjrtClasspath()); for (String argfile : argfiles) { args.add("@" + examplesDir + argfile); } - + CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS); for (String aClass : classes) { TestUtil.runMain("out", aClass); - } + } } - - + + public static void testExamples() throws IOException { - example(new String[] {"observer/files.lst"}, + example(new String[] {"observer/files.lst"}, new String[] {}); // don't run the gui - - example(new String[] {"tjp/files.lst"}, + + example(new String[] {"tjp/files.lst"}, new String[] {"tjp.Demo"}); - - example(new String[] {"telecom/timing.lst"}, + + example(new String[] {"telecom/timing.lst"}, new String[] {"telecom.TimingSimulation"}); - - example(new String[] {"telecom/billing.lst"}, + + example(new String[] {"telecom/billing.lst"}, new String[] {"telecom.BillingSimulation"}); - - example(new String[] {"tracing/tracev1.lst"}, + + example(new String[] {"tracing/tracev1.lst"}, new String[] {"tracing.version1.TraceMyClasses"}); - - example(new String[] {"tracing/tracev2.lst"}, + + example(new String[] {"tracing/tracev2.lst"}, new String[] {"tracing.version2.TraceMyClasses"}); - - example(new String[] {"tracing/tracev3.lst"}, + + example(new String[] {"tracing/tracev3.lst"}, new String[] {"tracing.version3.TraceMyClasses"}); - - example(new String[] {"introduction/files.lst"}, + + example(new String[] {"introduction/files.lst"}, new String[] {"introduction.HashablePoint", "introduction.ComparablePoint"}); - - - example(new String[] {"bean/files.lst"}, + + + example(new String[] {"bean/files.lst"}, new String[] {"bean.Demo"}); - - example(new String[] {"spacewar/demo.lst"}, + + example(new String[] {"spacewar/demo.lst"}, new String[] {}); // don't run the gui - - example(new String[] {"spacewar/debug.lst"}, + + example(new String[] {"spacewar/debug.lst"}, new String[] {}); // don't run the gui - + System.out.println("done!!!!!!!!!!!!!!!!!!!!"); } - + } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java index a8b2964c4..f6a4db725 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfigTest.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2018 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://www.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * ******************************************************************/ package org.aspectj.ajdt.internal.core.builder; diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildManagerTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildManagerTest.java index 1dc118283..b6e4943a8 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildManagerTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjBuildManagerTest.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * PARC initial implementation diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjCompilerOptionsTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjCompilerOptionsTest.java index 21050fc95..6e36c06ec 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjCompilerOptionsTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjCompilerOptionsTest.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -24,12 +24,12 @@ import junit.framework.TestCase; public class AjCompilerOptionsTest extends TestCase { private AjCompilerOptions options; - + protected void setUp() throws Exception { super.setUp(); options = new AjCompilerOptions(); } - + public void testDefaultValues() { assertFalse(options.terminateAfterCompilation); assertFalse(options.xSerializableAspects); @@ -40,7 +40,7 @@ public class AjCompilerOptionsTest extends TestCase { assertFalse(options.generateJavaDocsInModel); assertFalse(options.generateEmacsSymFiles); assertFalse(options.noAtAspectJProcessing); - + Map<String,String> map = options.getMap(); assertEquals(CompilerOptions.WARNING,map.get(AjCompilerOptions.OPTION_ReportInvalidAbsoluteTypeName)); assertEquals(CompilerOptions.IGNORE,map.get(AjCompilerOptions.OPTION_ReportInvalidWildcardTypeName)); @@ -52,7 +52,7 @@ public class AjCompilerOptionsTest extends TestCase { assertEquals(CompilerOptions.IGNORE,map.get(AjCompilerOptions.OPTION_ReportNeedSerialVersionUIDField)); assertEquals(CompilerOptions.IGNORE,map.get(AjCompilerOptions.OPTION_ReportIncompatibleSerialVersion)); } - + public void testDirectSet() { options.terminateAfterCompilation = true; options.xSerializableAspects = true; @@ -76,7 +76,7 @@ public class AjCompilerOptionsTest extends TestCase { assertEquals(CompilerOptions.ENABLED,map.get(AjCompilerOptions.OPTION_XDevNoAtAspectJProcessing)); } - + public void testMapSet() { Map<String,String> map = new HashMap<>(); map.put(AjCompilerOptions.OPTION_ReportInvalidAbsoluteTypeName,CompilerOptions.ERROR); @@ -88,7 +88,7 @@ public class AjCompilerOptionsTest extends TestCase { map.put(AjCompilerOptions.OPTION_ReportCannotImplementLazyTJP,CompilerOptions.ERROR); map.put(AjCompilerOptions.OPTION_ReportNeedSerialVersionUIDField,CompilerOptions.WARNING); map.put(AjCompilerOptions.OPTION_ReportIncompatibleSerialVersion,CompilerOptions.ERROR); - + map.put(AjCompilerOptions.OPTION_TerminateAfterCompilation,CompilerOptions.ENABLED); map.put(AjCompilerOptions.OPTION_XSerializableAspects,CompilerOptions.ENABLED); map.put(AjCompilerOptions.OPTION_XLazyThisJoinPoint,CompilerOptions.ENABLED); @@ -98,9 +98,9 @@ public class AjCompilerOptionsTest extends TestCase { map.put(AjCompilerOptions.OPTION_GenerateJavaDocsInModel,CompilerOptions.ENABLED); map.put(AjCompilerOptions.OPTION_Emacssym,CompilerOptions.ENABLED); map.put(AjCompilerOptions.OPTION_XDevNoAtAspectJProcessing,CompilerOptions.ENABLED); - + options.set(map); - + assertTrue(options.terminateAfterCompilation); assertTrue(options.xSerializableAspects); assertTrue(options.xLazyThisJoinPoint); @@ -110,7 +110,7 @@ public class AjCompilerOptionsTest extends TestCase { assertTrue(options.generateJavaDocsInModel); assertTrue(options.generateEmacsSymFiles); assertTrue(options.noAtAspectJProcessing); - + Map<String,String> newMap = options.getMap(); assertEquals(CompilerOptions.ERROR,newMap.get(AjCompilerOptions.OPTION_ReportInvalidAbsoluteTypeName)); assertEquals(CompilerOptions.ERROR,newMap.get(AjCompilerOptions.OPTION_ReportInvalidWildcardTypeName)); @@ -122,7 +122,7 @@ public class AjCompilerOptionsTest extends TestCase { assertEquals(CompilerOptions.WARNING,newMap.get(AjCompilerOptions.OPTION_ReportNeedSerialVersionUIDField)); assertEquals(CompilerOptions.ERROR,newMap.get(AjCompilerOptions.OPTION_ReportIncompatibleSerialVersion)); } - + public void testToString() { String s = options.toString(); assertTrue("Should have info on AspectJ options",s.indexOf("AspectJ Specific Options:") > 0); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java index 1cd4ade77..ebdaa97ba 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjStateTest.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjdtBuilderTests.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjdtBuilderTests.java index 14eb7a0db..30b0e3ccb 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjdtBuilderTests.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AjdtBuilderTests.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: -// * PARC initial implementation +// * All rights reserved. +// * This program and the accompanying materials are made available +// * under the terms of the Eclipse Public License v 2.0 +// * which accompanies this distribution and is available at +// * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt +// * +// * Contributors: +// * PARC initial implementation // * ******************************************************************/ // // @@ -20,12 +20,12 @@ // //public class AjdtBuilderTests extends TestCase { // -// public static Test suite() { +// public static Test suite() { // TestSuite suite = new TestSuite(AjdtBuilderTests.class.getName()); // //$JUnit-BEGIN$ -// suite.addTestSuite(AjBuildManagerTest.class); -// suite.addTestSuite(AjBuildConfigTest.class); -// suite.addTestSuite(AsmBuilderTest.class); +// suite.addTestSuite(AjBuildManagerTest.class); +// suite.addTestSuite(AjBuildConfigTest.class); +// suite.addTestSuite(AsmBuilderTest.class); // suite.addTestSuite(AjCompilerOptionsTest.class); // suite.addTestSuite(AjStateTest.class); // suite.addTestSuite(OutjarTest.class); @@ -35,4 +35,4 @@ // // public AjdtBuilderTests(String name) { super(name); } // -//} +//} diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AsmBuilderTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AsmBuilderTest.java index dc40100bc..0f3b527cb 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AsmBuilderTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/AsmBuilderTest.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: - * PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * PARC initial implementation * ******************************************************************/ @@ -26,11 +26,11 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope; public class AsmBuilderTest extends TestCase { private AsmHierarchyBuilder builder = new AsmHierarchyBuilder(); - - public static Test suite() { + + public static Test suite() { TestSuite suite = new TestSuite(AsmBuilderTest.class.getName()); //$JUnit-BEGIN$ - suite.addTestSuite(AsmBuilderTest.class); + suite.addTestSuite(AsmBuilderTest.class); //$JUnit-END$ return suite; } @@ -38,7 +38,7 @@ public class AsmBuilderTest extends TestCase { /** * Test for bug#39626 */ - public void testNullHandlingOfVisit() { + public void testNullHandlingOfVisit() { ICompilationUnit cu = new ICompilationUnit() { public char[] getContents() { return null; @@ -51,31 +51,31 @@ public class AsmBuilderTest extends TestCase { public char[][] getPackageName() { return null; } - - public char[] getFileName() { + + public char[] getFileName() { return null; } public boolean ignoreOptionalProblems() { return false; } - + }; TypeDeclaration local = new TypeDeclaration(new CompilationResult(cu, 0, 0, 0)); local.name = new char[2]; BlockScope scope = null; - - try { + + try { // builder.internalBuild(new CompilationResult(cu, 0, 0, 0), null); builder.visit(local, scope); - } + } catch (Exception e) { assertTrue(e instanceof NullPointerException); - } + } // XXX put back? // catch (Exception e) { // assertTrue(e instanceof EmptyStackException); // } } -} +} diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/OutjarTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/OutjarTest.java index 4c69037a8..10c8b3f9d 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/OutjarTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/core/builder/OutjarTest.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Matthew Webster - initial implementation diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java index b38e8166c..e8912fead 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTVisitorTest.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * IBM Corporation - initial API and implementation @@ -78,7 +78,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import junit.framework.TestCase; public class ASTVisitorTest extends TestCase { - + public void testEnum_pr211201() { check("public enum BasicEnum {"+ "A = 1, B = 2, C = 3;"+ @@ -86,20 +86,20 @@ public class ASTVisitorTest extends TestCase { " return 3;"+ "}"+ "}","(compilationUnit(enum(simpleName)(simpleName)(simpleName)(simpleName)(method(primitiveType)(simpleName)(block(numberLiteral)))))"); - + } - + // from bug 110465 - will currently break because of casts public void testAspectWithITD() { check("aspect A{ public void B.x(){} }", "(compilationUnit(aspect(simpleName)(methodITD(primitiveType)(simpleName)(block))))"); } - + public void testAspectWithCommentThenITD() { check("aspect A{ /** */ public void B.x(){} }", "(compilationUnit(aspect(simpleName)(methodITD(primitiveType)(simpleName)(block))))"); } - + public void testAspectWithCommentThenPointcut() { check("aspect A{ /** */ pointcut x(); }","(compilationUnit(aspect(simpleName)(pointcut(simpleName))))"); } @@ -166,7 +166,7 @@ public class ASTVisitorTest extends TestCase { check("aspect A {pointcut a();pointcut b();pointcut c(): a() && b();}", "(compilationUnit(aspect(simpleName)(pointcut(simpleName))(pointcut(simpleName))(pointcut(simpleName)(referencePointcut(simpleName))(referencePointcut(simpleName)))))"); } - + public void testCallPointcut(){ check("aspect A {pointcut a(): call(* *.*(..));}", "(compilationUnit(aspect(simpleName)(pointcut(simpleName))))"); @@ -203,12 +203,12 @@ public class ASTVisitorTest extends TestCase { check("aspect A {pointcut a(): adviceexecution();}", "(compilationUnit(aspect(simpleName)(pointcut(simpleName))))"); } - + public void testPointcutWithoutArguments(){ check("aspect A {pointcut a(): adviceexecution();}", "(compilationUnit(aspect(simpleName)(pointcut(simpleName))))"); } - + public void testPointcutWithOnePrimitiveArgument(){ check("aspect A {pointcut a(int a): adviceexecution();}", "(compilationUnit(aspect(simpleName)(pointcut(simpleName)(primitiveType)(simpleName))))"); @@ -248,7 +248,7 @@ public class ASTVisitorTest extends TestCase { check("class A {}aspect B {A.new(){}}", "(compilationUnit(class(simpleName))(aspect(simpleName)(constructorITD(primitiveType)(simpleName)(block))))"); } - + public void testInitializedField(){ check("class A{int a = 1;}", "(compilationUnit(class(simpleName)(field(primitiveType)(simpleName)(numberLiteral))))"); @@ -265,7 +265,7 @@ public class ASTVisitorTest extends TestCase { check("class A {}aspect B {int A.a = 1;}", "(compilationUnit(class(simpleName))(aspect(simpleName)(fieldITD(primitiveType)(simpleName)(numberLiteral))))"); } - + public void testMethodBeingCalled(){ check("class A {void a(){}void b(){a();}}", "(compilationUnit(class(simpleName)(method(primitiveType)(simpleName)(block))(method(primitiveType)(simpleName)(block(expressionStatement(methodInvocation(simpleName)))))))"); @@ -290,13 +290,13 @@ public class ASTVisitorTest extends TestCase { check("class A {void b(){A();}}aspect B {A.new(){}}", "(compilationUnit(class(simpleName)(method(primitiveType)(simpleName)(block(expressionStatement(methodInvocation(simpleName))))))(aspect(simpleName)(constructorITD(primitiveType)(simpleName)(block))))"); } - + /* - * + * * START: Test TypePattern nodes introduced in Bugzilla 329268. - * + * */ - + public void testDeclareParents() { check("class A{}class B{}aspect C {declare parents : A extends B;}", "(compilationUnit(class(simpleName))(class(simpleName))(aspect(simpleName)(declareParents(wildTypePattern)(wildTypePattern))))"); @@ -346,15 +346,15 @@ public class ASTVisitorTest extends TestCase { check("class E{}aspect C {declare parents : (@AnnotationT *) extends E;}", "(compilationUnit(class(simpleName))(aspect(simpleName)(declareParents(anyWithAnnotationTypePattern)(wildTypePattern))))"); } - - + + /* - * + * * END: Test TypePattern nodes introduced in Bugzilla 329268. - * + * */ - - + + public void testDeclareWarning(){ check("aspect A {pointcut a();declare warning: a(): \"warning\";}", "(compilationUnit(aspect(simpleName)(pointcut(simpleName))(declareWarning(referencePointcut(simpleName))(stringLiteral))))"); @@ -403,7 +403,7 @@ public class ASTVisitorTest extends TestCase { check("aspect A percflowbelow(a()) {pointcut a();}", "(compilationUnit(aspect(simpleName)(perCflow(referencePointcut(simpleName)))(pointcut(simpleName)))))"); } - + private void check(String source, String expectedOutput){ ASTParser parser = ASTParser.newParser(AST.JLS3);//JLS2); // ajh02: need to use 2 for returnType - in 3 it has "returnType2" Map<String, String> options = new HashMap<>(); @@ -418,7 +418,7 @@ public class ASTVisitorTest extends TestCase { assertTrue("Expected:\n"+ expectedOutput + "====Actual:\n" + result, expectedOutput.equals(result)); } - + private void checkJLS3(String source, String expectedOutput) { ASTParser parser = ASTParser.newParser(AST.JLS3); Map<String,String> options = new HashMap<>(); @@ -432,14 +432,14 @@ public class ASTVisitorTest extends TestCase { System.err.println("actual:\n" + result); assertTrue("Expected:\n"+ expectedOutput + "====Actual:\n" + result, expectedOutput.equals(result)); - + } - + /** @deprecated using deprecated code */ @Deprecated private static final int AST_INTERNAL_JLS2 = AST.JLS2; - - + + /** * @deprecated (not really - just suppressing the warnings * that come from testing Javadoc.getComment()) @@ -451,12 +451,12 @@ public class ASTVisitorTest extends TestCase { super.setUp(); } - + @Override protected void tearDown() throws Exception { super.tearDown(); } - + protected CompilationUnit createAST(char[] source) { ASTParser parser= ASTParser.newParser(AST_INTERNAL_JLS2); parser.setSource(source); @@ -466,26 +466,26 @@ public class ASTVisitorTest extends TestCase { } class TestVisitor extends AjASTVisitor { - + StringBuffer b = new StringBuffer(); boolean visitTheKids = true; - + boolean visitDocTags; - + TestVisitor() { this(false); } - + @Override public String toString(){ return b.toString(); } - + TestVisitor(boolean visitDocTags) { super(visitDocTags); this.visitDocTags = visitDocTags; } - + public boolean isVisitingChildren() { return visitTheKids; } @@ -493,7 +493,7 @@ class TestVisitor extends AjASTVisitor { public void setVisitingChildren(boolean visitChildren) { visitTheKids = visitChildren; } - + @Override public boolean visit(TypeDeclaration node) { if (((AjTypeDeclaration)node).isAspect()) { @@ -514,14 +514,14 @@ class TestVisitor extends AjASTVisitor { @Override public void endVisit(TypeDeclaration node) { - if (((AjTypeDeclaration)node).isAspect()) - if (((AspectDeclaration) node).isPrivileged() + if (((AjTypeDeclaration)node).isAspect()) + if (((AspectDeclaration) node).isPrivileged() || ((AspectDeclaration)node).getPerClause() != null) { - b.append(")"); + b.append(")"); } b.append(")"); //$NON-NLS-1$ } - + @Override public boolean visit(EnumDeclaration node) { b.append("(enum"); @@ -532,12 +532,12 @@ class TestVisitor extends AjASTVisitor { public void endVisit(EnumDeclaration node) { b.append(")"); } - + @Override public boolean visit(PointcutDeclaration node) { b.append("(pointcut"); //$NON-NLS-1$ return isVisitingChildren(); - } + } @Override public void endVisit(PointcutDeclaration node) { b.append(")"); //$NON-NLS-1$ @@ -546,7 +546,7 @@ class TestVisitor extends AjASTVisitor { public boolean visit(ReferencePointcut node) { b.append("(referencePointcut"); //$NON-NLS-1$ return isVisitingChildren(); - } + } @Override public void endVisit(ReferencePointcut node) { b.append(")"); //$NON-NLS-1$ @@ -576,7 +576,7 @@ class TestVisitor extends AjASTVisitor { b.append("(afterReturningAdvice"); //$NON-NLS-1$ return isVisitingChildren(); } - + @Override public void endVisit(BeforeAdviceDeclaration node) { b.append(")"); //$NON-NLS-1$ @@ -597,7 +597,7 @@ class TestVisitor extends AjASTVisitor { public void endVisit(AfterReturningAdviceDeclaration node) { b.append(")"); //$NON-NLS-1$ } - + @Override public boolean visit(MethodDeclaration node) { if (node instanceof InterTypeMethodDeclaration) return visit((InterTypeMethodDeclaration)node); @@ -813,31 +813,31 @@ class TestVisitor extends AjASTVisitor { b.append("(declareAtField"); return isVisitingChildren(); } - + @Override public boolean visit(DeclareErrorDeclaration node) { b.append("(declareError"); return isVisitingChildren(); } - + @Override public boolean visit(DeclareParentsDeclaration node) { b.append("(declareParents"); return isVisitingChildren(); } - + @Override public boolean visit(DeclarePrecedenceDeclaration node) { b.append("(declarePrecedence"); return isVisitingChildren(); } - + @Override public boolean visit(DeclareSoftDeclaration node) { b.append("(declareSoft"); return isVisitingChildren(); } - + @Override public boolean visit(DeclareWarningDeclaration node) { b.append("(declareWarning"); @@ -879,7 +879,7 @@ class TestVisitor extends AjASTVisitor { public void endVisit(DeclareWarningDeclaration node) { b.append(")"); //$NON-NLS-1$ } - + @Override public boolean visit(AbstractBooleanTypePattern node) { b.append("("); @@ -891,7 +891,7 @@ class TestVisitor extends AjASTVisitor { } node.getRight().accept(this); b.append(")"); - + // Don't visit the children, as that is done above in order (left node first, boolean operator next, right node last return false; } @@ -906,7 +906,7 @@ class TestVisitor extends AjASTVisitor { @Override public void endVisit(AnyTypePattern node) { - b.append(")"); + b.append(")"); } @@ -919,7 +919,7 @@ class TestVisitor extends AjASTVisitor { @Override public void endVisit(AnyWithAnnotationTypePattern node) { - b.append(")"); + b.append(")"); } @Override @@ -937,7 +937,7 @@ class TestVisitor extends AjASTVisitor { @Override public void endVisit(IdentifierTypePattern node) { - b.append(")"); + b.append(")"); } @@ -950,7 +950,7 @@ class TestVisitor extends AjASTVisitor { @Override public void endVisit(NotTypePattern node) { - b.append(")"); + b.append(")"); } @@ -963,16 +963,16 @@ class TestVisitor extends AjASTVisitor { @Override public void endVisit(TypeCategoryTypePattern node) { - b.append(")"); + b.append(")"); } - - + + // End of TypePattern additions for Bugzilla 329268 @Override public boolean visit(SignaturePattern node) { b.append("(signaturePattern"); - return isVisitingChildren(); + return isVisitingChildren(); } @Override public void endVisit(SignaturePattern node) { @@ -981,17 +981,17 @@ class TestVisitor extends AjASTVisitor { @Override public boolean visit(PerObject node) { b.append("(perObject"); - return isVisitingChildren(); + return isVisitingChildren(); } @Override public boolean visit(PerCflow node) { b.append("(perCflow"); - return isVisitingChildren(); + return isVisitingChildren(); } @Override public boolean visit(PerTypeWithin node) { b.append("(perTypeWithin"); - return isVisitingChildren(); + return isVisitingChildren(); } @Override public void endVisit(PerObject node) { diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTitdTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTitdTest.java index 2c18f05dd..b27ebc019 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTitdTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/ASTitdTest.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 - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2005 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajc; @@ -40,11 +40,11 @@ public class ASTitdTest extends TestCase { public void testAspectWithConstructorITD() { checkNameAndModifiers("class A {}aspect B {public A.new(){}}","name = A_new, modifier = public"); } - + public void testAspectWithPublicFieldITD() { checkNameAndModifiers("class A {}aspect B {public int A.a;}","name = a, modifier = public"); } - + private void checkNameAndModifiers(String source, String expectedOutput){ ASTParser parser = ASTParser.newParser(AST.JLS2); // ajh02: need to use 2 for returnType - in 3 it has "returnType2" parser.setCompilerOptions(new HashMap());//JavaCore.getOptions()); @@ -57,29 +57,29 @@ public class ASTitdTest extends TestCase { assertTrue("Expected:\n"+ expectedOutput + "====Actual:\n" + result, expectedOutput.equals(result)); } - + } class ITDTestVisitor extends AjASTVisitor { StringBuffer b = new StringBuffer(); boolean visitDocTags; - + ITDTestVisitor() { this(false); } - + public String toString(){ return b.toString(); } - + ITDTestVisitor(boolean visitDocTags) { super(visitDocTags); this.visitDocTags = visitDocTags; } - + public boolean visit(MethodDeclaration node) { - if (node instanceof InterTypeMethodDeclaration) + if (node instanceof InterTypeMethodDeclaration) return visit((InterTypeMethodDeclaration)node); return true; } @@ -90,5 +90,5 @@ class ITDTestVisitor extends AjASTVisitor { public boolean visit(InterTypeMethodDeclaration node) { b.append("name = " + node.getName() + ", modifier = " + Modifier.toString(node.getModifiers())); return true; - } + } } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java index 27a7d1e24..65fca0097 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initital version * Matthew Webster - moved tests *******************************************************************/ @@ -69,7 +69,7 @@ public class AjAST5Test extends AjASTTestCase { } } } - + public void testInternalAjTypeDeclaration() { AjAST ajast = createAjAST(); AjTypeDeclaration d = ajast.newAjTypeDeclaration(); @@ -96,7 +96,7 @@ public class AjAST5Test extends AjASTTestCase { } } } - + public void testInternalDeclareParentsDeclaration() { AjAST ajast = createAjAST(); DeclareParentsDeclaration d = ajast.newDeclareParentsDeclaration(); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java index bb205d430..3c8d57a20 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTest.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2006, 2010 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java index a28308bb1..5d26c5a37 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjASTTestCase.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2006, 2010 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: Helen Hawkins - initial implementation * Matthew Webster - initial implementation diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjNaiveASTFlattenerTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjNaiveASTFlattenerTest.java index b08b8604f..bdd36723e 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjNaiveASTFlattenerTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjNaiveASTFlattenerTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006, 2010 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: IBM Corporation - initial API and implementation + * Copyright (c) 2006, 2010 Contributors. All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: IBM Corporation - initial API and implementation * Eduardo Piveta - initial version * Helen Hawkins - ammended to fit within JUnit framework *******************************************************************/ @@ -29,115 +29,115 @@ public class AjNaiveASTFlattenerTest extends TestCase { public void testOneIntPointcutArg() { check("public aspect A { pointcut y(int a): call(* *.*(..));}", - "public aspect A {\n pointcut y(int a):call(* *.*(..));\n}\n"); + "public aspect A {\n pointcut y(int a):call(* *.*(..));\n}\n"); } - + public void testOneIntOneDoublePointcutArg() { check("public aspect A { pointcut y(int a, double b): call(* *.*(..));}", - "public aspect A {\n pointcut y(int a, double b):call(* *.*(..));\n}\n"); + "public aspect A {\n pointcut y(int a, double b):call(* *.*(..));\n}\n"); } - + public void testOneTypedPointcutArg() { check("public aspect A { pointcut y(X a): call(* *.*(..));}", - "public aspect A {\n pointcut y(X a):call(* *.*(..));\n}\n"); + "public aspect A {\n pointcut y(X a):call(* *.*(..));\n}\n"); } - + public void testTwoTypedPointcutArgs() { check("public aspect A { pointcut y(X a, X b): call(* *.*(..));}", - "public aspect A {\n pointcut y(X a, X b):call(* *.*(..));\n}\n"); + "public aspect A {\n pointcut y(X a, X b):call(* *.*(..));\n}\n"); } - + public void testOneTypedAndOneIntPointcutArg() { check("public aspect A { pointcut y(X a, int b): call(* *.*(..));}", - "public aspect A {\n pointcut y(X a, int b):call(* *.*(..));\n}\n"); + "public aspect A {\n pointcut y(X a, int b):call(* *.*(..));\n}\n"); } - + public void testOneIntAndOneTypedPointcutArg() { check("public aspect A { pointcut y(int a, X b): call(* *.*(..));}", - "public aspect A {\n pointcut y(int a, X b):call(* *.*(..));\n}\n"); + "public aspect A {\n pointcut y(int a, X b):call(* *.*(..));\n}\n"); } - + public void testOneIntOneDoubleAndOneTypedPointcutArg() { check("public aspect A { pointcut y(int a, double b, Y c): call(* *.*(..));}", "public aspect A {\n pointcut y(int a, double b, Y c):call(* *.*(..));\n}\n"); } - + public void testDeclareParentsDeclaration() throws Exception { check("public aspect A { declare parents: X extends Y; }", "public aspect A {\n declare parents: X extends Y;\n}\n"); } - - + + /* - * - * + * + * * START: Test TypePattern nodes introduced in Bugzilla 329268. - * - * + * + * */ - + public void testDeclareParentsDeclarationAny() throws Exception { check("public aspect A { declare parents: * extends Y; }", "public aspect A {\n declare parents: * extends Y;\n}\n"); } - + public void testDeclareParentsAndDeclaration() throws Exception { check("public aspect A { declare parents: W && X && Y extends Z; }", "public aspect A {\n declare parents: W && X && Y extends Z;\n}\n"); } - + public void testDeclareParentsOrDeclaration() throws Exception { check("public aspect A { declare parents: W || X || Y extends Z; }", "public aspect A {\n declare parents: W || X || Y extends Z;\n}\n"); } - + public void testDeclareParentsNot() throws Exception { check("public aspect A { declare parents: W && !X extends Z; }", "public aspect A {\n declare parents: W && !X extends Z;\n}\n"); } - + public void testDeclareParentsTypeCategory() throws Exception { check("public aspect A { declare parents: B && is(AnonymousType) extends Z; }", "public aspect A {\n declare parents: B && is(AnonymousType) extends Z;\n}\n"); - + } - + public void testDeclareParentsTypeCategoryNot() throws Exception { check("public aspect A { declare parents: B && !is(InnerType) extends Z; }", "public aspect A {\n declare parents: B && !is(InnerType) extends Z;\n}\n"); } - + // TODO: commented until hasmethod is supported in AspectJ // public void testDeclareParentsHasMember() { // check("public aspect A { declare parents : A && hasmethod(void foo*(..)) extends D; }", // "public aspect A {\n declare parents : A && hasmethod(void foo*(..)) extends D;\n}\n"); // } - + /* - * - * + * + * * END: Test TypePattern nodes introduced in Bugzilla 329268. - * - * + * + * */ - + public void testDeclareWarning() throws Exception { check("public aspect A { declare warning: call(* *.*(..)) : \"warning!\"; }", "public aspect A {\n declare warning: call(* *.*(..)) : \"warning!\" ;\n}\n"); } - + public void testDeclareErrorDeclaration() throws Exception { check("public aspect A { declare error: call(* *.*(..)) : \"error!\"; }", "public aspect A {\n declare error: call(* *.*(..)) : \"error!\" ;\n}\n"); } - + public void testDeclareSoftDeclaration() throws Exception { check("public aspect A { declare soft: X : call(* *.*(..)); }", "public aspect A {\n declare soft: X : call(* *.*(..)) ;\n}\n"); } - + public void testDeclarePrecedenceDeclaration() throws Exception { check("public aspect A { declare precedence: X, Y, Z; }", "public aspect A {\n declare precedence: X, Y, Z;\n}\n"); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java index b6abb38ab..4cfc2fa47 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Adrian Colyer, diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc5Tests.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc5Tests.java index f4426d3ff..dcfcf256e 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc5Tests.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/Ajc5Tests.java @@ -1,13 +1,13 @@ ///* ******************************************************************* // * 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: -// * Matthew Webster initial implementation +// * All rights reserved. +// * This program and the accompanying materials are made available +// * under the terms of the Eclipse Public License v 2.0 +// * which accompanies this distribution and is available at +// * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt +// * +// * Contributors: +// * Matthew Webster initial implementation // * ******************************************************************/ //package org.aspectj.tools.ajc; // @@ -19,9 +19,9 @@ // //public class Ajc5Tests extends TestCase { // public static String aspectjrtClasspath() { -// return TestUtil.aspectjrtPath().getPath(); +// return TestUtil.aspectjrtPath().getPath(); // } -// public static Test suite() { +// public static Test suite() { // TestSuite suite = new TestSuite(Ajc5Tests.class.getName()); // suite.addTestSuite(AjAST5Test.class); // return suite; diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index 22db23d17..35bd22c68 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Adrian Colyer, Abraham Nevado (lucierna) diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCaseTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCaseTest.java index a3d349eb4..ec0ebc12e 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCaseTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCaseTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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: - * Adrian Colyer, + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Adrian Colyer, * ******************************************************************/ package org.aspectj.tools.ajc; @@ -30,7 +30,7 @@ public class AjcTestCaseTest extends AjcTestCase { RunResult rresult = run("Driver",new String[0],null); System.out.println(rresult.getStdOut()); } - + public void testIncrementalCompile() throws Exception { File baseDir = new File("../tests/incrementalju/initialTests/classAdded"); String[] args = new String[] {"-sourceroots","src","-d",".","-incremental"}; @@ -47,5 +47,5 @@ public class AjcTestCaseTest extends AjcTestCase { rr = run("main.Main",new String[0],null); System.out.println(rr.getStdOut()); } - + } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTests.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTests.java index decf3ad99..5438a580b 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTests.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTests.java @@ -1,13 +1,13 @@ ///* ******************************************************************* // * 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: -// * Wes Isberg initial implementation +// * All rights reserved. +// * This program and the accompanying materials are made available +// * under the terms of the Eclipse Public License v 2.0 +// * which accompanies this distribution and is available at +// * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt +// * +// * Contributors: +// * Wes Isberg initial implementation // * ******************************************************************/ // // @@ -21,9 +21,9 @@ // //public class AjcTests extends TestCase { // public static String aspectjrtClasspath() { -// return TestUtil.aspectjrtPath().getPath(); +// return TestUtil.aspectjrtPath().getPath(); // } -// public static Test suite() { +// public static Test suite() { // TestSuite suite = new TestSuite(AjcTests.class.getName()); // suite.addTestSuite(org.aspectj.tools.ajc.MainTest.class); // suite.addTestSuite(ASTVisitorTest.class); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/CompilationResult.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/CompilationResult.java index 047879a32..17e2e7857 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/CompilationResult.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/CompilationResult.java @@ -2,9 +2,9 @@ * 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 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Adrian Colyer, diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/DelegatingOutputStream.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/DelegatingOutputStream.java index dc60334a7..ce4065419 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/DelegatingOutputStream.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/DelegatingOutputStream.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Matthew Webster - initial implementation *******************************************************************************/ @@ -20,12 +20,12 @@ public class DelegatingOutputStream extends OutputStream { private boolean verbose = true; private OutputStream target; private List delegates; - + public DelegatingOutputStream (OutputStream os) { this.target = os; this.delegates = new LinkedList(); } - + public void close() throws IOException { target.close(); @@ -70,11 +70,11 @@ public class DelegatingOutputStream extends OutputStream { delegate.write(b); } } - + public boolean add (OutputStream delegate) { return delegates.add(delegate); } - + public boolean remove (OutputStream delegate) { return delegates.remove(delegate); } @@ -86,5 +86,5 @@ public class DelegatingOutputStream extends OutputStream { public void setVerbose(boolean verbose) { this.verbose = verbose; } - + } diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java index f4b4bcd72..d97f02192 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/MainTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 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://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ package org.aspectj.tools.ajc; @@ -17,7 +17,7 @@ import java.util.ArrayList; import java.util.List; public class MainTest extends AjcTestCase { - + public void testBareMainUsage() { List<String> fails = new ArrayList<>(); List<String> errors = new ArrayList<>(); @@ -49,7 +49,7 @@ public class MainTest extends AjcTestCase { .orElse(null) ); } - + public void testAjcUsageX() { CompilationResult compilationResult = ajc(null, new String[] { "-X" }); MessageSpec messageSpec = new MessageSpec( @@ -58,7 +58,7 @@ public class MainTest extends AjcTestCase { ); assertMessages(compilationResult, "Expecting xoptions usage message", messageSpec); } - + public void testMainMessageHolderFail() { try { new Main().runMain(new String[] {"-messageHolder","org.xyz.abc"},false); @@ -68,7 +68,7 @@ public class MainTest extends AjcTestCase { // good } } - + public void testMainMessageHolderOk() { Main main = new Main(); main.runMain(new String[] {"-messageHolder","org.aspectj.tools.ajc.TestMessageHolder"},false); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/TestMessageHolder.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/TestMessageHolder.java index 5acefcab1..aa0acd73e 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/TestMessageHolder.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/TestMessageHolder.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 v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.tools.ajc; @@ -20,14 +20,14 @@ import org.aspectj.bridge.IMessageHolder; /** * @author Adrian - * + * * Deliberately empty implementation of IMessageHolder */ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHolder#hasAnyMessage(org.aspectj.bridge.IMessage.Kind, boolean) */ public boolean hasAnyMessage(Kind kind, boolean orGreater) { @@ -37,7 +37,7 @@ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHolder#numMessages(org.aspectj.bridge.IMessage.Kind, boolean) */ public int numMessages(Kind kind, boolean orGreater) { @@ -47,7 +47,7 @@ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHolder#getMessages(org.aspectj.bridge.IMessage.Kind, boolean) */ public IMessage[] getMessages(Kind kind, boolean orGreater) { @@ -57,7 +57,7 @@ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHolder#getUnmodifiableListView() */ public List<IMessage> getUnmodifiableListView() { @@ -67,7 +67,7 @@ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHolder#clearMessages() */ public void clearMessages() throws UnsupportedOperationException { @@ -77,7 +77,7 @@ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHandler#handleMessage(org.aspectj.bridge.IMessage) */ public boolean handleMessage(IMessage message) throws AbortException { @@ -87,7 +87,7 @@ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHandler#isIgnoring(org.aspectj.bridge.IMessage.Kind) */ public boolean isIgnoring(Kind kind) { @@ -97,7 +97,7 @@ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHandler#dontIgnore(org.aspectj.bridge.IMessage.Kind) */ public void dontIgnore(Kind kind) { @@ -107,7 +107,7 @@ public class TestMessageHolder implements IMessageHolder { /* * (non-Javadoc) - * + * * @see org.aspectj.bridge.IMessageHandler#ignore(org.aspectj.bridge.IMessage.Kind) */ public void ignore(Kind kind) { |