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 /weaver | |
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 'weaver')
195 files changed, 1842 insertions, 1843 deletions
diff --git a/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj b/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj index bad4543e1..3eae6c886 100644 --- a/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj +++ b/weaver/ajsrc/org/aspectj/weaver/BcelApiRules.aj @@ -1,38 +1,37 @@ -/* *******************************************************************
- * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC),
- * 2003 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:
- * Xerox/PARC initial implementation
- * AMC 01.20.2003 extended to support new AspectJ 1.1 options,
- * bugzilla #29769
- * ******************************************************************/
-
-package org.aspectj.weaver;
-
-import org.aspectj.weaver.*;
-import org.aspectj.weaver.bcel.*;
-import org.apache.bcel.generic.*;
-
-/**
- * Enforces the correct use of BCEL APIs.
- */
-public aspect BcelApiRules {
-
- /**
- * The Utility method needs to be used instead of the BCEL method doue to a bug
- * in the implementation of Instruction.copy()
- */
- declare error:
- call(* Instruction.copy()) && within(org.aspectj.weaver..*)
- && !withincode(* Utility.copyInstruction(Instruction)):
- "use Utility.copyInstruction to work-around bug in Select.copy()";
-
-
-}
-
\ No newline at end of file +/* ******************************************************************* + * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), + * 2003 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: + * Xerox/PARC initial implementation + * AMC 01.20.2003 extended to support new AspectJ 1.1 options, + * bugzilla #29769 + * ******************************************************************/ + +package org.aspectj.weaver; + +import org.aspectj.weaver.*; +import org.aspectj.weaver.bcel.*; +import org.apache.bcel.generic.*; + +/** + * Enforces the correct use of BCEL APIs. + */ +public aspect BcelApiRules { + + /** + * The Utility method needs to be used instead of the BCEL method doue to a bug + * in the implementation of Instruction.copy() + */ + declare error: + call(* Instruction.copy()) && within(org.aspectj.weaver..*) + && !withincode(* Utility.copyInstruction(Instruction)): + "use Utility.copyInstruction to work-around bug in Select.copy()"; + + +} diff --git a/weaver/src/main/java/org/aspectj/weaver/IClassFileProvider.java b/weaver/src/main/java/org/aspectj/weaver/IClassFileProvider.java index 029bba7c6..32b42ff7e 100644 --- a/weaver/src/main/java/org/aspectj/weaver/IClassFileProvider.java +++ b/weaver/src/main/java/org/aspectj/weaver/IClassFileProvider.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 *******************************************************************************/ @@ -16,7 +16,7 @@ import org.aspectj.weaver.bcel.UnwovenClassFile; /** * @author colyer - * + * * Clients implementing the IClassFileProvider can have a set of class files under their control woven by a weaver, by * calling the weave(IClassFileProvider source) method. The contract is that a call to getRequestor().acceptResult() is * providing a result for the class file most recently returned from the getClassFileIterator(). @@ -26,7 +26,7 @@ public interface IClassFileProvider { /** * Answer an iterator that can be used to iterate over a set of UnwovenClassFiles to be woven. During a weave, this method may * be called multiple times. - * + * * @return iterator over UnwovenClassFiles. */ Iterator<UnwovenClassFile> getClassFileIterator(); diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessFieldVar.java b/weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessFieldVar.java index 60aa84125..0408b3694 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessFieldVar.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessFieldVar.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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.weaver.bcel; @@ -31,7 +31,7 @@ import org.aspectj.weaver.UnresolvedType; /** * An AnnotationAccessVar represents access to a particular annotation, whilst an AnnotationAccessFieldVar represents access to a * specific field of that annotation. - * + * * @author Andy Clement */ class AnnotationAccessFieldVar extends BcelVar { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessVar.java b/weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessVar.java index f84d5e05e..81c4e0a60 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessVar.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessVar.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005-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://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.weaver.bcel; @@ -260,7 +260,7 @@ public class AnnotationAccessVar extends BcelVar { /** * Return an object that can access a particular value of this annotation. - * + * * @param valueType The type from the annotation that is of interest * @param formalName the formal name expressed in the pointcut, can be used to disambiguate * @return a variable that represents access to that annotation value diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/AspectInstanceVar.java b/weaver/src/main/java/org/aspectj/weaver/bcel/AspectInstanceVar.java index 37633b71f..46fb74460 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/AspectInstanceVar.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/AspectInstanceVar.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2011 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/vmware * ******************************************************************/ package org.aspectj.weaver.bcel; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java index 6072c0232..7fb18abcd 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/AtAjAttributes.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * initial implementation Alexandre Vasseur diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java index a32ea69b7..6bc5cb4a0 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Alexandre Vasseur initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAdvice.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAdvice.java index 85cd66e54..320b22c1e 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAdvice.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAdvice.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 @@ -808,4 +808,4 @@ class BcelAdvice extends Advice { thrownExceptions = Collections.emptyList(); // !!! interaction with unit tests } -}
\ No newline at end of file +} diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAnnotation.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAnnotation.java index 73699f2a0..0db2ba905 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAnnotation.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelAnnotation.java @@ -1,11 +1,11 @@ /* ******************************************************************* * 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://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.weaver.bcel; @@ -27,7 +27,7 @@ import org.aspectj.weaver.World; /** * Wraps a Bcel Annotation object and uses it to answer AnnotationAJ method calls. This is cheaper than translating all Bcel * annotations into AnnotationAJ objects. - * + * * @author AndyClement */ public class BcelAnnotation extends AbstractAnnotationAJ { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowAccessVar.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowAccessVar.java index 2640edd95..9675486dc 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowAccessVar.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowAccessVar.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.weaver.bcel; @@ -23,7 +23,7 @@ import org.aspectj.weaver.ResolvedType; /** * XXX Erik and I need to discuss this hierarchy. Having FieldRef extend Var is convenient, but hopefully there's a better design. - * + * * This is always a static reference. */ public class BcelCflowAccessVar extends BcelVar { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.java index a70a5d8a9..586147827 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowCounterFieldAdder.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 * (Andy Clement) diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.java index 455edd174..710014985 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelCflowStackFieldAdder.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.weaver.bcel; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java index edf7a0c48..4aa8d2485 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.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/weaver/src/main/java/org/aspectj/weaver/bcel/BcelConstantPoolReader.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelConstantPoolReader.java index 2deaf57c1..00ad47b5d 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelConstantPoolReader.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelConstantPoolReader.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.ConstantPoolReader; /** * An implementation of the constant pool reader that speaks Bcel. - * + * * @author Andy Clement */ public class BcelConstantPoolReader implements ConstantPoolReader { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelConstantPoolWriter.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelConstantPoolWriter.java index 634764901..bf1fcd81f 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelConstantPoolWriter.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelConstantPoolWriter.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 Bcel. - * + * * @author Andy Clement */ class BcelConstantPoolWriter implements ConstantPoolWriter { @@ -31,4 +31,4 @@ class BcelConstantPoolWriter implements ConstantPoolWriter { return pool.addUtf8(name); } -}
\ No newline at end of file +} diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelField.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelField.java index c88e8519f..4428fdf42 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelField.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelField.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.weaver.bcel; @@ -34,7 +34,7 @@ import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.GenericSigna /** * An AspectJ Field object that is backed by a Bcel Field object. - * + * * @author PARC * @author Andy Clement */ @@ -304,4 +304,4 @@ final class BcelField extends ResolvedMemberImpl { field = null; } } -}
\ No newline at end of file +} diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelFieldRef.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelFieldRef.java index a5a2a79ec..246f258d6 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelFieldRef.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelFieldRef.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.weaver.bcel; @@ -20,7 +20,7 @@ import org.aspectj.weaver.ResolvedType; /** * XXX Erik and I need to discuss this hierarchy. Having FieldRef extend Var is convenient, but hopefully there's a better design. - * + * * This is always a static reference. */ public class BcelFieldRef extends BcelVar { @@ -78,7 +78,7 @@ public class BcelFieldRef extends BcelVar { // Utility.appendConversion(il, fact, storee.getType(), convertToType); // il.append(fact.createArrayStore(BcelWorld.makeBcelType(convertToType))); // } - // + // // InstructionList createConvertableArrayStore( // InstructionFactory fact, // int index, diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXConverter.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXConverter.java index 70ea191cb..c5c7cfbd6 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXConverter.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXConverter.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.weaver.bcel; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelMethod.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelMethod.java index 08651412c..abf1b3c1a 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelMethod.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelMethod.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.weaver.bcel; @@ -48,7 +48,7 @@ import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.World; import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.GenericSignatureFormatException; -//public final +//public final class BcelMethod extends ResolvedMemberImpl { private final static String ASPECTJ_ANNOTATION_PACKAGE = "org.aspectj.lang.annotation"; @@ -694,7 +694,7 @@ class BcelMethod extends ResolvedMemberImpl { /** * Return true if the method represents the default constructor. Hard to determine this from bytecode, but the existence of the * MethodDeclarationLineNumber attribute should tell us. - * + * * @return true if this BcelMethod represents the default constructor */ @Override @@ -709,4 +709,4 @@ class BcelMethod extends ResolvedMemberImpl { } } -}
\ No newline at end of file +} diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java index 41b1f3fa6..d1c4a9f42 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelObjectType.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 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 * RonBodkin/AndyClement optimizations for memory consumption/speed * ******************************************************************/ @@ -132,7 +132,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { /* * Notes: note(1): in some cases (perclause inheritance) we encounter unpacked state when calling getPerClause - * + * * note(2): A BcelObjectType is 'damaged' if it has been modified from what was original constructed from the bytecode. This * currently happens if the parents are modified or an annotation is added - ideally BcelObjectType should be immutable but * that's a bigger piece of work. XXX @@ -356,7 +356,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { /** * Check if the type is an @AJ aspect (no matter if used from an LTW point of view). Such aspects are annotated with @Aspect - * + * * @return true for @AJ aspect */ public boolean isAnnotationStyleAspect() { @@ -588,7 +588,7 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { ensureAnnotationsUnpacked(); return annotations; } - + public boolean hasAnnotations() { ensureAnnotationsUnpacked(); return annotations.length != 0; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java index cca34bc12..bafe80f42 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * initial implementation Alexandre Vasseur diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelRenderer.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelRenderer.java index a18047812..38f61ee0a 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelRenderer.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelRenderer.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.weaver.bcel; @@ -82,16 +82,16 @@ public final class BcelRenderer implements ITestVisitor, IExprVisitor { /* * Get the instructions representing this test. - * + * * @param e test to render - * + * * @param sk instructionHandle to jump to if our rendered check succeeds (typically start of advice) - * + * * @param fk instructionHandle to jump to if our rendered check fails (typically after end of advice) - * + * * @param next instructionHandle that will follow this generated code. Passing in null will generate one unnecessary GOTO * instruction. - * + * * @returns the instruction list representing this expression */ public static InstructionList renderTest(InstructionFactory fact, BcelWorld world, Test e, InstructionHandle sk, @@ -170,7 +170,7 @@ public final class BcelRenderer implements ITestVisitor, IExprVisitor { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.ast.ITestVisitor#visit(org.aspectj.weaver.internal.tools.MatchingContextBasedTest) */ public void visit(MatchingContextBasedTest matchingContextTest) { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java index 5144976d3..c64ffde82 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.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/weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java index 8f4009eea..b8552dbb2 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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: + * 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 * Alexandre Vasseur @AspectJ ITDs * ******************************************************************/ @@ -757,7 +757,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { LazyMethodGen ret = new LazyMethodGen(member.getModifiers(), returnType, member.getName(), parameterTypes, UnresolvedType.getNames(member .getExceptions()), gen); - + // 43972 : Static crosscutting makes interfaces unusable for javac // ret.makeSynthetic(); return ret; @@ -1291,7 +1291,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { /** * Create a bridge method for a particular munger. - * + * * @param world * @param munger * @param unMangledInterMethod the method to bridge 'to' that we have already created in the 'subtype' @@ -1307,7 +1307,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { int pos = 0; // The bridge method in this type will have the same signature as the one in the supertype - LazyMethodGen bridgeMethod = makeMethodGen(clazz, theBridgeMethod); + LazyMethodGen bridgeMethod = makeMethodGen(clazz, theBridgeMethod); bridgeMethod.setAccessFlags(bridgeMethod.getAccessFlags() | 0x00000040 /* BRIDGE = 0x00000040 */); // UnresolvedType[] newParams = munger.getSignature().getParameterTypes(); Type returnType = BcelWorld.makeBcelType(theBridgeMethod.getReturnType()); @@ -1777,7 +1777,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { body.append(InstructionConstants.RETURN); addNeededSuperCallMethods(weaver, onType, munger.getSuperMethodsCalled()); - + return true; } @@ -1905,7 +1905,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { if (Modifier.isStatic(field.getModifiers())) { throw new RuntimeException("unimplemented"); } - + boolean alreadyExists = false; // only need to check for version 2 style mungers if (munger.version==NewFieldTypeMunger.VersionTwo) { @@ -1916,11 +1916,11 @@ public class BcelTypeMunger extends ConcreteTypeMunger { } } } - + // FieldGen fg = makeFieldGen(gen, AjcMemberMaker.interFieldInterfaceField(field, onType, aspectType)); ResolvedMember newField = AjcMemberMaker.interFieldInterfaceField(field, onType, aspectType, munger.version == NewFieldTypeMunger.VersionTwo); String fieldName = newField.getName(); - + Type fieldType = BcelWorld.makeBcelType(field.getType()); if (!alreadyExists) { weaver.addInitializer(this); diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelVar.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelVar.java index ce45fdf12..69d022243 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelVar.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelVar.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.weaver.bcel; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeakClassLoaderReference.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeakClassLoaderReference.java index aac294fa4..c369ec736 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeakClassLoaderReference.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeakClassLoaderReference.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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.weaver.bcel; @@ -29,8 +29,8 @@ import org.aspectj.weaver.WeakClassLoaderReference; * WeakClassLoaderReference instances will not 'lose' their ClassLoader references until the top level ClassLoader reference is * null'd. This means there is no need to check for the null case on get() in this WeakReference logic below, because we shouldn't * be using this weaver if its associated ClassLoader has been collected. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=210470 - * - * + * + * * @author Andy Clement */ public class BcelWeakClassLoaderReference extends WeakClassLoaderReference implements ClassLoaderReference { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java index 110d58c88..12b8cb2c0 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.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 * ******************************************************************/ package org.aspectj.weaver.bcel; @@ -95,7 +95,7 @@ import org.aspectj.weaver.tools.Trace; import org.aspectj.weaver.tools.TraceFactory; /** - * + * * @author PARC * @author Andy Clement * @author Alexandre Vasseur @@ -143,7 +143,7 @@ public class BcelWeaver { /** * Add the given aspect to the weaver. The type is resolved to support DOT for static inner classes as well as DOLLAR - * + * * @param aspectName * @return aspect */ @@ -221,13 +221,13 @@ public class BcelWeaver { } else { IMessage message = new Message("Cannot register '"+aspectName+"' because the type found with that name is not an aspect", null, true); world.getMessageHandler().handleMessage(message); - } + } return null; } } /** - * + * * @param inFile directory containing classes or zip/jar class archive */ public void addLibraryJarFile(File inFile) throws IOException { @@ -279,7 +279,7 @@ public class BcelWeaver { /** * Look for .class files that represent aspects in the supplied directory - return the list of accumulated aspects. - * + * * @param directory the directory in which to look for Aspect .class files * @return the list of discovered aspects * @throws FileNotFoundException @@ -307,7 +307,7 @@ public class BcelWeaver { /** * Determine if the supplied bytes represent an aspect, if they do then create a ResolvedType instance for the aspect and return * it, otherwise return null - * + * * @param classbytes the classbytes that might represent an aspect * @param name the name of the class * @param directory directory which contained the class file @@ -347,7 +347,7 @@ public class BcelWeaver { /** * Add any .class files in the directory to the outdir. Anything other than .class files in the directory (or its * subdirectories) are considered resources and are also copied. - * + * */ public List<UnwovenClassFile> addDirectoryContents(File inFile, File outDir) throws IOException { List<UnwovenClassFile> addedClassFiles = new ArrayList<>(); @@ -1084,7 +1084,7 @@ public class BcelWeaver { if (classFile.shouldBeWoven()) { String className = classFile.getClassName(); BcelObjectType classType = getClassType(className); - + // null return from getClassType() means the delegate is an eclipse // source type - so // there *cant* be any reweavable state... (he bravely claimed...) @@ -1143,7 +1143,7 @@ public class BcelWeaver { if (theType.isAspect()) { BcelObjectType classType = BcelWorld.getBcelObjectType(theType); if (classType == null) { - + // Sometimes.. if the Bcel Delegate couldn't be found then a // problem occurred at compile time - on // a previous compiler run. In this case I assert the @@ -1155,7 +1155,7 @@ public class BcelWeaver { if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) { continue; } - + throw new BCException("Can't find bcel delegate for " + className + " type=" + theType.getClass()); } weaveAndNotify(classFile, classType, requestor); @@ -1177,16 +1177,16 @@ public class BcelWeaver { if (!theType.isAspect()) { BcelObjectType classType = BcelWorld.getBcelObjectType(theType); if (classType == null) { - + // bug 119882 - see above comment for bug 113531 ReferenceTypeDelegate theDelegate = ((ReferenceType) theType).getDelegate(); - + // TODO urgh - put a method on the interface to check this, // string compare is hideous if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) { continue; } - + throw new BCException("Can't find bcel delegate for " + className + " type=" + theType.getClass()); } weaveAndNotify(classFile, classType, requestor); @@ -1296,7 +1296,7 @@ public class BcelWeaver { * 'typeToWeave' is one from the 'typesForWeaving' list. This routine ensures we process supertypes (classes/interfaces) of * 'typeToWeave' that are in the 'typesForWeaving' list before 'typeToWeave' itself. 'typesToWeave' is then removed from the * 'typesForWeaving' list. - * + * * Note: Future gotcha in here ... when supplying partial hierarchies, this algorithm may break down. If you have a hierarchy * A>B>C and only give A and C to the weaver, it may choose to weave them in either order - but you'll probably have other * problems if you are supplying partial hierarchies like that ! @@ -1328,7 +1328,7 @@ public class BcelWeaver { } ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_DECLARE_PARENTS, resolvedTypeToWeave.getName()); - // If A was processed before B (and was declared 'class A implements B') then there is no need to complete B again, it + // If A was processed before B (and was declared 'class A implements B') then there is no need to complete B again, it // will have been done whilst processing A. if (!resolvedTypeToWeave.isTypeHierarchyComplete()) { weaveParentTypeMungers(resolvedTypeToWeave); @@ -1397,7 +1397,7 @@ public class BcelWeaver { WeaverMessages.format(WeaverMessages.MUST_KEEP_OVERWEAVING_ONCE_START, className))); // onType.getName(), annoX.getTypeName(), annoX.getValidTargets()), -// decA.getSourceLocation())); +// decA.getSourceLocation())); } else { byte[] bytes = wsi.getUnwovenClassFileData(classType.getJavaClass().getBytes()); JavaClass newJavaClass = Utility.makeJavaClass(classType.getJavaClass().getFileName(), bytes); @@ -1468,7 +1468,7 @@ public class BcelWeaver { /** * Weaves new parents and annotations onto a type ("declare parents" and "declare @type") - * + * * Algorithm: 1. First pass, do parents then do annotations. During this pass record: - any parent mungers that don't match but * have a non-wild annotation type pattern - any annotation mungers that don't match 2. Multiple subsequent passes which go over * the munger lists constructed in the first pass, repeatedly applying them until nothing changes. FIXME asc confirm that @@ -1945,7 +1945,7 @@ public class BcelWeaver { /** * Perform a fast match of the specified list of shadowmungers against the specified type. A subset of those that might match is * returned. - * + * * @param list list of all shadow mungers that might match * @param type the target type * @return a list of shadow mungers that might match with those that cannot (according to fast match rules) removed diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeavingSupport.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeavingSupport.java index 120df80c2..801f8f8b6 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeavingSupport.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeavingSupport.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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.weaver.bcel; @@ -25,7 +25,7 @@ import org.aspectj.weaver.patterns.Pointcut; /** * Bcel implementation of the weaving support required in a BcelWorld which will actually modify bytecode. - * + * * @author Andy Clement */ public class BcelWeavingSupport implements IWeavingSupport { @@ -47,7 +47,7 @@ public class BcelWeavingSupport implements IWeavingSupport { /** * Register a munger for perclause @AJ aspect so that we add aspectOf(..) to them as needed - * + * * @param aspect * @param kind * @return munger diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java index 65c3da11a..e7fdb4a10 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.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 @@ -299,7 +299,7 @@ public class BcelWorld extends World implements Repository { /** * Build a World from a ClassLoader, for LTW support - * + * * @param loader * @param handler * @param xrefHandler @@ -355,7 +355,7 @@ public class BcelWorld extends World implements Repository { } return ret; } - + public static Type makeBcelType(String type) { return Type.getType(type); } @@ -624,7 +624,7 @@ public class BcelWorld extends World implements Repository { UnresolvedType declaringType = null; String signature = ii.getSignature(cpg); - + // 307147 if (name.startsWith("ajc$privMethod$")) { // The invoke is on a privileged accessor. These may be created for different @@ -833,7 +833,7 @@ public class BcelWorld extends World implements Repository { } return didSomething; } - + /** * Apply the specified declare @field construct to any matching fields in the specified type. * @param deca the declare annotation targeting fields @@ -854,7 +854,7 @@ public class BcelWorld extends World implements Repository { } return changedType; } - + /** * Checks for an @target() on the annotation and if found ensures it allows the annotation to be attached to the target type * that matched. @@ -904,7 +904,7 @@ public class BcelWorld extends World implements Repository { anAnnotationChangeOccurred = true; } } - + // apply declare @field for (DeclareAnnotation deca: getCrosscuttingMembersSet().getDeclareAnnotationOnFields()) { if (applyDeclareAtField(deca,onType)) { @@ -928,7 +928,7 @@ public class BcelWorld extends World implements Repository { anAnnotationChangeOccurred = true; } } - + for (DeclareAnnotation deca: getCrosscuttingMembersSet().getDeclareAnnotationOnFields()) { if (applyDeclareAtField(deca, onType)) { anAnnotationChangeOccurred = true; @@ -936,7 +936,7 @@ public class BcelWorld extends World implements Repository { } decpToRepeat = decpToRepeatNextTime; } - + } @Override @@ -979,7 +979,7 @@ public class BcelWorld extends World implements Repository { /** * These are aop.xml files that can be used to alter the aspects that actually apply from those passed in - and also their scope * of application to other files in the system. - * + * * @param xmlFiles list of File objects representing any aop.xml files passed in to configure the build process */ public void setXmlFiles(List<File> xmlFiles) { @@ -1068,7 +1068,7 @@ public class BcelWorld extends World implements Repository { // Record that it has an invalid type reference aspectRequiredTypes.put(aspectName,requiredTypeName); } - } + } if (anythingMissing) { return true; } @@ -1127,7 +1127,7 @@ public class BcelWorld extends World implements Repository { * it will initialize and transform those definitions into an optimized set of values (eg. resolve type patterns and string * names to real entities). It can then answer questions quickly: (1) is this aspect included in the weaving? (2) Is there a * scope specified for this aspect and does it include type X? - * + * */ static class WeavingXmlConfig { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java b/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java index 2b8cc5ceb..a090e7189 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/ClassPathManager.java @@ -2,9 +2,9 @@ * Copyright (c) 2002, 2017 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/weaver/src/main/java/org/aspectj/weaver/bcel/ExceptionRange.java b/weaver/src/main/java/org/aspectj/weaver/bcel/ExceptionRange.java index 5e74627c3..06ac1f03a 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/ExceptionRange.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/ExceptionRange.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.weaver.bcel; @@ -21,7 +21,7 @@ import org.aspectj.weaver.UnresolvedType; * used when we pack the exception table into a method... the exception table should be sorted from high to low priority. Exceptions * we generate for advice is either high priority (higher than anything coming from the original method... most kinds of * non-execution advice) or low priority (lower than anything coming from the original method, for execution advice). - * + * * <p> * ??? This does not account for handler, or any other "statement-level" advice. When such statement level advice happens, we may * want to go to a float level, so we can set the priority of advice to be lower than anything it encloses, and higher than anything @@ -41,7 +41,7 @@ public final class ExceptionRange extends Range { /** * After this constructor is called, this range is not well situated unless {@link #associateWithTargets} is called - * + * * XXX priority should be fixed */ public ExceptionRange(InstructionList body, UnresolvedType exceptionType, int priority) { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/ExtensibleURLClassLoader.java b/weaver/src/main/java/org/aspectj/weaver/bcel/ExtensibleURLClassLoader.java index 76bd4b84b..54aefa4b8 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/ExtensibleURLClassLoader.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/ExtensibleURLClassLoader.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2004 IBM Corporation - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Webster, Adrian Colyer, - * Martin Lippert 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, Adrian Colyer, + * Martin Lippert initial implementation * Andy Clement * Roy Varghese - Bug 473555 * ******************************************************************/ @@ -103,7 +103,7 @@ public abstract class ExtensibleURLClassLoader extends URLClassLoader { int offset = className.lastIndexOf('.'); return (offset == -1) ? null : className.substring(0, offset); } - + @Override public void close() throws IOException { super.close(); diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/FakeAnnotation.java b/weaver/src/main/java/org/aspectj/weaver/bcel/FakeAnnotation.java index 4194e66e9..7ffc717b1 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/FakeAnnotation.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/FakeAnnotation.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * initial implementation Andy Clement diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/IfFinder.java b/weaver/src/main/java/org/aspectj/weaver/bcel/IfFinder.java index c66aa8939..df0f3baf2 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/IfFinder.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/IfFinder.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/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java index 22c7945f0..80eb20acf 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.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 diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyMethodGen.java index 7bac02dad..a6c8dd2ea 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyMethodGen.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyMethodGen.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.weaver.bcel; @@ -67,12 +67,12 @@ import org.aspectj.weaver.tools.Traceable; /** * A LazyMethodGen should be treated as a MethodGen. It's our way of abstracting over the low-level Method objects. It converts * through {@link MethodGen} to create and to serialize, but that's it. - * + * * <p> * At any rate, there are two ways to create LazyMethodGens. One is from a method, which does work through MethodGen to do the * correct thing. The other is the creation of a completely empty LazyMethodGen, and it is used when we're constructing code from * scratch. - * + * * <p> * We stay away from targeters for rangey things like Shadows and Exceptions. */ @@ -97,7 +97,7 @@ public final class LazyMethodGen implements Traceable { int highestLineNumber = 0; boolean wasPackedOptimally = false; private Method savedMethod = null; - + // Some tools that may post process the output bytecode do not long local variable tables // to be generated as one reason the tables may be missing in the first place is because // the bytecode is odd. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=470658 @@ -105,14 +105,14 @@ public final class LazyMethodGen implements Traceable { /* * We use LineNumberTags and not Gens. - * + * * This option specifies whether we let the BCEL classes create LineNumberGens and LocalVariableGens or if we make it create * LineNumberTags and LocalVariableTags. Up until 1.5.1 we always created Gens - then on return from the MethodGen ctor we took * them apart, reprocessed them all and created Tags. (see unpackLocals/unpackLineNumbers). As we have our own copy of Bcel, why * not create the right thing straightaway? So setting this to true will call the MethodGen ctor() in such a way that it creates * Tags - removing the need for unpackLocals/unpackLineNumbers - HOWEVER see the ensureAllLineNumberSetup() method for some * other relevant info. - * + * * Whats the difference between a Tag and a Gen? A Tag is more lightweight, it doesn't know which instructions it targets, it * relies on the instructions targettingit - this reduces the amount of targeter manipulation we have to do. */ @@ -129,14 +129,14 @@ public final class LazyMethodGen implements Traceable { List<BcelShadow> matchedShadows; // Used for interface introduction - this is the type of the interface the method is technically on public ResolvedType definingType = null; - + static class LightweightBcelMethod extends BcelMethod { LightweightBcelMethod(BcelObjectType declaringType, Method method) { super(declaringType, method); // TODO Auto-generated constructor stub } - + } public LazyMethodGen(int modifiers, Type returnType, String name, Type[] paramTypes, String[] declaredExceptions, @@ -319,7 +319,7 @@ public final class LazyMethodGen implements Traceable { memberView.addParameterAnnotation(parameterNumber, anno); } } - + public ResolvedType[] getAnnotationTypes() { initialize(); if (memberView == null && newAnnotations!=null && newAnnotations.size()!=0) { @@ -332,7 +332,7 @@ public final class LazyMethodGen implements Traceable { } return null; } - + public AnnotationAJ[] getAnnotations() { initialize(); if (memberView == null && newAnnotations!=null && newAnnotations.size()!=0) { @@ -1019,15 +1019,15 @@ public final class LazyMethodGen implements Traceable { } else { packBody(gen); } - - gen.setMaxLocals(true); + + gen.setMaxLocals(true); gen.setMaxStack(); } else { gen.setInstructionList(null); } return gen; } - + private boolean hasAttribute(String attributeName) { for (Attribute attr: attributes) { if (attr.getName().equals(attributeName)) { @@ -1584,7 +1584,7 @@ public final class LazyMethodGen implements Traceable { /** * A good body is a body with the following properties: - * + * * <ul> * <li>For each branch instruction S in body, target T of S is in body. * <li>For each branch instruction S in body, target T of S has S as a targeter. @@ -1597,7 +1597,7 @@ public final class LazyMethodGen implements Traceable { * <li>For each exception range R in body, let T := R.handler. T is in body, and R is one of T's targeters * <li>All ranges are properly nested: For all ranges Q and R, if Q.start preceeds R.start, then R.end preceeds Q.end. * </ul> - * + * * Where the shorthand "R is in body" means "R.start is in body, R.end is in body, and any InstructionHandle stored in a field * of R (such as an exception handle) is in body". */ diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/Range.java b/weaver/src/main/java/org/aspectj/weaver/bcel/Range.java index eaebad695..2ca002b6b 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/Range.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/Range.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.weaver.bcel; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/ShadowRange.java b/weaver/src/main/java/org/aspectj/weaver/bcel/ShadowRange.java index d25a4b1ee..2aa7a7f16 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/ShadowRange.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/ShadowRange.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.weaver.bcel; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/TypeAnnotationAccessVar.java b/weaver/src/main/java/org/aspectj/weaver/bcel/TypeAnnotationAccessVar.java index e23174389..d982fd4b4 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/TypeAnnotationAccessVar.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/TypeAnnotationAccessVar.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 IBM - * 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.weaver.bcel; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/TypeDelegateResolver.java b/weaver/src/main/java/org/aspectj/weaver/bcel/TypeDelegateResolver.java index 2a29c927a..8935efeb4 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/TypeDelegateResolver.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/TypeDelegateResolver.java @@ -2,9 +2,9 @@ * 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 + * 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, SpringSource @@ -17,8 +17,8 @@ import org.aspectj.weaver.ReferenceTypeDelegate; /** * A type delegate resolver is able to create type delegates for a named reference type. A type delegate will implement * ReferenceTypeDelegate. There are three kind of delegate already in existence: those created for eclipse structures, those - * created for bytecode structures, and those created based on reflection. - * + * created for bytecode structures, and those created based on reflection. + * * @author Andy Clement */ public interface TypeDelegateResolver { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/UnwovenClassFile.java b/weaver/src/main/java/org/aspectj/weaver/bcel/UnwovenClassFile.java index 7076316f7..a33053424 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/UnwovenClassFile.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/UnwovenClassFile.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.weaver.bcel; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/UnwovenClassFileWithThirdPartyManagedBytecode.java b/weaver/src/main/java/org/aspectj/weaver/bcel/UnwovenClassFileWithThirdPartyManagedBytecode.java index 18edc8413..832912704 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/UnwovenClassFileWithThirdPartyManagedBytecode.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/UnwovenClassFileWithThirdPartyManagedBytecode.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/weaver/src/main/java/org/aspectj/weaver/bcel/Utility.java b/weaver/src/main/java/org/aspectj/weaver/bcel/Utility.java index 368c6b34c..d9fc3396b 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/Utility.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/Utility.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.weaver.bcel; @@ -201,7 +201,7 @@ public class Utility { if (m.getEnclosingClass().isInterface()) { if (m.isStatic()) { // For static methods on interfaces - kind = Constants.INVOKESTATIC; + kind = Constants.INVOKESTATIC; } else { kind = Constants.INVOKEINTERFACE; } @@ -218,7 +218,7 @@ public class Utility { /** * Create an invoke instruction - * + * * @param fact * @param kind INVOKEINTERFACE, INVOKEVIRTUAL.. * @param member @@ -478,7 +478,7 @@ public class Utility { /** * replace an instruction handle with another instruction, in this case, a branch instruction. - * + * * @param ih the instruction handle to replace. * @param replacementInstructions the branch instruction to replace ih with * @param enclosingMethod where to find ih's instruction list. @@ -493,7 +493,7 @@ public class Utility { /** * delete an instruction handle and retarget all targeters of the deleted instruction to the next instruction. Obviously, this * should not be used to delete a control transfer instruction unless you know what you're doing. - * + * * @param ih the instruction handle to delete. * @param enclosingMethod where to find ih's instruction list. */ @@ -503,7 +503,7 @@ public class Utility { /** * delete an instruction handle and retarget all targeters of the deleted instruction to the provided target. - * + * * @param ih the instruction handle to delete * @param retargetTo the instruction handle to retarget targeters of ih to. * @param enclosingMethod where to find ih's instruction list. @@ -523,11 +523,11 @@ public class Utility { /** * Fix for Bugzilla #39479, #40109 patch contributed by Andy Clement - * + * * Need to manually copy Select instructions - if we rely on the the 'fresh' object created by copy(), the InstructionHandle * array 'targets' inside the Select object will not have been deep copied, so modifying targets in fresh will modify the * original Select - not what we want ! (It is a bug in BCEL to do with cloning Select objects). - * + * * <pre> * declare error: * call(* Instruction.copy()) && within(org.aspectj.weaver) @@ -713,4 +713,4 @@ public class Utility { return new Unknown(nameIndex, length, bytes, pool); } -}
\ No newline at end of file +} diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/asm/AsmDetector.java b/weaver/src/main/java/org/aspectj/weaver/bcel/asm/AsmDetector.java index 5fa7bd006..86571a0c7 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/asm/AsmDetector.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/asm/AsmDetector.java @@ -2,9 +2,9 @@ * 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 + * 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 diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/asm/StackMapAdder.java b/weaver/src/main/java/org/aspectj/weaver/bcel/asm/StackMapAdder.java index 07f3435ae..2610174df 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/asm/StackMapAdder.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/asm/StackMapAdder.java @@ -2,9 +2,9 @@ * Copyright (c) 2008, 2018 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 diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.java index e2dfd928e..2561a9c6c 100644 --- a/weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.java +++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * David Knibb initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/Definition.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/Definition.java index e706b240e..962051e74 100644 --- a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/Definition.java +++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/Definition.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Alexandre Vasseur initial implementation @@ -18,7 +18,7 @@ import java.util.Map; /** * A POJO that contains raw strings from the XML (sort of XMLBean for our simple LTW DTD) - * + * * @author Alexandre Vasseur (alex AT gnilux DOT com) */ public class Definition { @@ -156,16 +156,16 @@ public class Definition { public enum AdviceKind { Before, After, AfterReturning, AfterThrowing, Around; } - + public enum DeclareAnnotationKind { Method, Field, Type; } - + public static class DeclareAnnotation { public final DeclareAnnotationKind declareAnnotationKind; public final String pattern; public final String annotation; - + public DeclareAnnotation(DeclareAnnotationKind kind, String pattern, String annotation) { this.declareAnnotationKind = kind; this.pattern = pattern; diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java index cdecd6aaa..eddc5bd32 100644 --- a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java +++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Alexandre Vasseur initial implementation @@ -32,7 +32,7 @@ import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.XMLReaderFactory; /** - * + * * @author Alexandre Vasseur * @author A. Nevado * @author Andy Clement diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/LightXMLParser.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/LightXMLParser.java index e93bc896c..119ba8a51 100644 --- a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/LightXMLParser.java +++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/LightXMLParser.java @@ -2,9 +2,9 @@ * Copyright (c) 2011 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: * Abraham Nevado - Lucierna initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java index 8d912a317..c73b51af1 100644 --- a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java +++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java @@ -2,13 +2,13 @@ * Copyright (c) 2011 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: * Abraham Nevado - Lucierna initial implementation - * Just a slight variation of current DocumentParser.java from Alexandre Vasseur. + * Just a slight variation of current DocumentParser.java from Alexandre Vasseur. *******************************************************************************/ package org.aspectj.weaver.loadtime.definition; @@ -26,7 +26,7 @@ import org.xml.sax.SAXException; /** * This class has been created to avoid deadlocks when instrumenting SAXParser. * So it is used as a wrapper for the ligthweigh XML parser LightXMLParser. - * + * * @author A. Nevado */ public class SimpleAOPParser { @@ -183,7 +183,7 @@ public class SimpleAOPParser { } } } - + } } else if (BEFORE_ELEMENT.equals(qName) && m_inAspects ) { diff --git a/weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java b/weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java index ca4779526..7dc8b7dd4 100644 --- a/weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.java +++ b/weaver/src/main/java/org/aspectj/weaver/ltw/LTWWorld.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: * Ron Bodkin Initial implementation * ******************************************************************/ package org.aspectj.weaver.ltw; @@ -35,14 +35,14 @@ import org.aspectj.weaver.reflect.ReflectionWorld; /** * @author adrian * @author Ron Bodkin - * + * * For use in LT weaving - * + * * Backed by both a BcelWorld and a ReflectionWorld - * + * * Needs a callback when a woven class is defined This is the trigger for us to ditch the class from Bcel and cache it in * the reflective world instead. - * + * * Create by passing in a classloader, message handler */ public class LTWWorld extends BcelWorld implements IReflectionWorld { @@ -156,7 +156,7 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld { /** * Remove this class from the typeMap. Call back to be made from a publishing class loader The class loader should, ideally, * make this call on each not yet working - * + * * @param clazz */ public void loadedClass(Class clazz) { @@ -170,7 +170,7 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.reflect.IReflectionWorld#resolve(java.lang.Class) */ public ResolvedType resolve(Class aClass) { diff --git a/weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipProvider.java b/weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipProvider.java index cf9bb1b94..0dbae4188 100644 --- a/weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipProvider.java +++ b/weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipProvider.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.weaver.model; @@ -929,12 +929,12 @@ public class AsmRelationshipProvider { /** * Finds or creates a code IProgramElement for the given shadow. - * + * * The byteCodeName of the created node is set to 'shadowSig.getName() + "!" + counter', eg "println!3". The counter is the * occurence count of children within the enclosingNode which have the same name. So, for example, if a method contains two * System.out.println statements, the first one will have byteCodeName 'println!1' and the second will have byteCodeName * 'println!2'. This is to ensure the two nodes have unique handles when the handles do not depend on sourcelocations. - * + * * Currently the shadows are examined in the sequence they appear in the source file. This means that the counters are * consistent over incremental builds. All aspects are compiled up front and any new aspect created will force a full build. * Moreover, if the body of the enclosingShadow is changed, then the model for this is rebuilt from scratch. diff --git a/weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipUtils.java b/weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipUtils.java index 01cedfaa6..053a88abe 100644 --- a/weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipUtils.java +++ b/weaver/src/main/java/org/aspectj/weaver/model/AsmRelationshipUtils.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 - initial version *******************************************************************/ package org.aspectj.weaver.model; diff --git a/weaver/src/main/java/org/aspectj/weaver/reflect/ArgNameFinder.java b/weaver/src/main/java/org/aspectj/weaver/reflect/ArgNameFinder.java index 25945a90a..f40ef1983 100644 --- a/weaver/src/main/java/org/aspectj/weaver/reflect/ArgNameFinder.java +++ b/weaver/src/main/java/org/aspectj/weaver/reflect/ArgNameFinder.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2005-2017 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License 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.weaver.reflect; diff --git a/weaver/src/main/java/org/aspectj/weaver/reflect/DeferredResolvedPointcutDefinition.java b/weaver/src/main/java/org/aspectj/weaver/reflect/DeferredResolvedPointcutDefinition.java index b0af93f16..aafe91fa0 100644 --- a/weaver/src/main/java/org/aspectj/weaver/reflect/DeferredResolvedPointcutDefinition.java +++ b/weaver/src/main/java/org/aspectj/weaver/reflect/DeferredResolvedPointcutDefinition.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 * ******************************************************************/ @@ -21,9 +21,9 @@ import org.aspectj.weaver.UnresolvedType; * algorithm proceeds in two phases, first we create and store instances of this class in the pointcuts array, and once that is * done, we come back round and resolve the actual pointcut expression. This means that if we recurse doing resolution, we will find * the named pointcut we are looking for! - * + * * @author adrian colyer - * + * */ public class DeferredResolvedPointcutDefinition extends ResolvedPointcutDefinition { diff --git a/weaver/src/main/java/org/aspectj/weaver/reflect/InternalUseOnlyPointcutParser.java b/weaver/src/main/java/org/aspectj/weaver/reflect/InternalUseOnlyPointcutParser.java index 8d81d7b08..90364493c 100644 --- a/weaver/src/main/java/org/aspectj/weaver/reflect/InternalUseOnlyPointcutParser.java +++ b/weaver/src/main/java/org/aspectj/weaver/reflect/InternalUseOnlyPointcutParser.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 * ******************************************************************/ @@ -23,21 +23,21 @@ public class InternalUseOnlyPointcutParser extends PointcutParser { setClassLoader(classLoader); setWorld(world); } - + public InternalUseOnlyPointcutParser(ClassLoader classLoader) { super(); setClassLoader(classLoader); } - + public Pointcut resolvePointcutExpression( - String expression, + String expression, Class inScope, PointcutParameter[] formalParameters) { return super.resolvePointcutExpression(expression, inScope, formalParameters); } - + public Pointcut concretizePointcutExpression(Pointcut pc, Class inScope, PointcutParameter[] formalParameters) { return super.concretizePointcutExpression(pc, inScope, formalParameters); } - + } diff --git a/weaver/src/main/java/org/aspectj/weaver/reflect/Java15AnnotationFinder.java b/weaver/src/main/java/org/aspectj/weaver/reflect/Java15AnnotationFinder.java index 842863ae3..6cfc4fb77 100644 --- a/weaver/src/main/java/org/aspectj/weaver/reflect/Java15AnnotationFinder.java +++ b/weaver/src/main/java/org/aspectj/weaver/reflect/Java15AnnotationFinder.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2005, 2017 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License 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.weaver.reflect; @@ -31,7 +31,7 @@ import org.aspectj.weaver.bcel.BcelAnnotation; import org.aspectj.weaver.bcel.BcelWeakClassLoaderReference; /** - * + * * @author Adrian Colyer * @author Andy Clement */ @@ -43,7 +43,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { private BcelWeakClassLoaderReference classLoaderRef; private World world; private static boolean useCachingClassLoaderRepository; - + static { try { useCachingClassLoaderRepository = System.getProperty("Xset:bcelRepositoryCaching","true").equalsIgnoreCase("true"); diff --git a/weaver/src/main/java/org/aspectj/weaver/reflect/Java15GenericSignatureInformationProvider.java b/weaver/src/main/java/org/aspectj/weaver/reflect/Java15GenericSignatureInformationProvider.java index c9de9517e..3d298023e 100644 --- a/weaver/src/main/java/org/aspectj/weaver/reflect/Java15GenericSignatureInformationProvider.java +++ b/weaver/src/main/java/org/aspectj/weaver/reflect/Java15GenericSignatureInformationProvider.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.weaver.reflect; @@ -27,11 +27,11 @@ public class Java15GenericSignatureInformationProvider implements GenericSignatureInformationProvider { private final World world; - + public Java15GenericSignatureInformationProvider(World forWorld) { this.world = forWorld; } - + /* (non-Javadoc) * @see org.aspectj.weaver.reflect.GenericSignatureInformationProvider#getGenericParameterTypes(org.aspectj.weaver.reflect.ReflectionBasedResolvedMemberImpl) */ @@ -60,12 +60,12 @@ public class Java15GenericSignatureInformationProvider implements } else if (member instanceof Method) { return typeConverter.fromType(((Method)member).getGenericReturnType()); } else if (member instanceof Constructor) { - return typeConverter.fromType(((Constructor)member).getDeclaringClass()); + return typeConverter.fromType(((Constructor)member).getDeclaringClass()); } else { - throw new IllegalStateException("unexpected member type: " + member); + throw new IllegalStateException("unexpected member type: " + member); } } - + /* (non-Javadoc) * @see org.aspectj.weaver.reflect.GenericSignatureInformationProvider#isBridge() */ @@ -77,7 +77,7 @@ public class Java15GenericSignatureInformationProvider implements return false; } } - + /* (non-Javadoc) * @see org.aspectj.weaver.reflect.GenericSignatureInformationProvider#isVarArgs() */ @@ -86,12 +86,12 @@ public class Java15GenericSignatureInformationProvider implements if (member instanceof Method) { return ((Method)member).isVarArgs(); } else if (member instanceof Constructor) { - return ((Constructor)member).isVarArgs(); + return ((Constructor)member).isVarArgs(); } else { return false; } } - + /* (non-Javadoc) * @see org.aspectj.weaver.reflect.GenericSignatureInformationProvider#isSynthetic() */ diff --git a/weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java b/weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java index 0edd1d40e..2fccd1dd7 100644 --- a/weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java +++ b/weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.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.weaver.reflect; @@ -38,7 +38,7 @@ import org.aspectj.weaver.tools.PointcutParameter; /** * Provides Java 5 behaviour in reflection based delegates (overriding 1.4 behaviour from superclass where * appropriate) - * + * * @author Adrian Colyer * @author Andy Clement */ @@ -94,7 +94,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends ReflectionBasedR } return annotations; } - + @Override public boolean hasAnnotations() { if (annotations == null) { @@ -373,7 +373,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends ReflectionBasedR public boolean isAnonymous() { return this.myClass.isAnonymousClass(); } - + @Override public boolean isNested() { return this.myClass.isMemberClass(); @@ -382,7 +382,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends ReflectionBasedR @Override public ResolvedType getOuterClass() { return ReflectionBasedReferenceTypeDelegateFactory.resolveTypeInWorld( - myClass.getEnclosingClass(),world); + myClass.getEnclosingClass(),world); } } diff --git a/weaver/src/main/java/org/aspectj/weaver/reflect/JavaLangTypeToResolvedTypeConverter.java b/weaver/src/main/java/org/aspectj/weaver/reflect/JavaLangTypeToResolvedTypeConverter.java index 74477d143..799dbdfdc 100644 --- a/weaver/src/main/java/org/aspectj/weaver/reflect/JavaLangTypeToResolvedTypeConverter.java +++ b/weaver/src/main/java/org/aspectj/weaver/reflect/JavaLangTypeToResolvedTypeConverter.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License 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.weaver.reflect; @@ -26,7 +26,7 @@ import org.aspectj.weaver.World; /** * Handles the translation of java.lang.reflect.Type objects into AspectJ UnresolvedTypes. - * + * * @author Adrian Colyer */ public class JavaLangTypeToResolvedTypeConverter { @@ -49,14 +49,14 @@ public class JavaLangTypeToResolvedTypeConverter { String name = clazz.getName(); /** * getName() can return: - * - * 1. If this class object represents a reference type that is not an - * array type then the binary name of the class is returned + * + * 1. If this class object represents a reference type that is not an + * array type then the binary name of the class is returned * 2. If this class object represents a primitive type or void, then * the name returned is a String equal to the Java language keyword - * corresponding to the primitive type or void. + * corresponding to the primitive type or void. * 3. If this class object represents a class of arrays, then the internal - * form of the name consists of the name of the element type preceded by + * form of the name consists of the name of the element type preceded by * one or more '[' characters representing the depth of the array nesting. */ if (clazz.isArray()) { diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/Jdk14Trace.java b/weaver/src/main/java/org/aspectj/weaver/tools/Jdk14Trace.java index 4fc7a1087..a51349063 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/Jdk14Trace.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/Jdk14Trace.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 *******************************************************************************/ @@ -19,19 +19,19 @@ public class Jdk14Trace extends AbstractTrace { private Logger logger; private String name; - + public Jdk14Trace (Class clazz) { super(clazz); this.name = clazz.getName(); this.logger = Logger.getLogger(name); } - + public void enter(String methodName, Object thiz, Object[] args) { if (logger.isLoggable(Level.FINE)) { logger.entering(name,methodName,formatObj(thiz)); if (args != null && logger.isLoggable(Level.FINER)) { logger.entering(name,methodName,formatObjects(args)); - } + } } } @@ -62,7 +62,7 @@ public class Jdk14Trace extends AbstractTrace { logger.logp(Level.FINER,name,methodName,"EVENT",formatObj(thiz)); if (args != null && logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER,name,methodName,"EVENT",formatObjects(args)); - } + } } } @@ -122,5 +122,5 @@ public class Jdk14Trace extends AbstractTrace { logger.log(Level.SEVERE,message,th); } } - + } diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/Jdk14TraceFactory.java b/weaver/src/main/java/org/aspectj/weaver/tools/Jdk14TraceFactory.java index 4043d1d33..91d5eafa0 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/Jdk14TraceFactory.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/Jdk14TraceFactory.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 *******************************************************************************/ diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java index a27824635..00346a0fb 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.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: * Matthew Webster, Adrian Colyer, John Kew + Lyor Goldstein (caching) diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractCacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractCacheBacking.java index 1fc3d4e61..627f6fb85 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractCacheBacking.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractCacheBacking.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractFileCacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractFileCacheBacking.java index 5447c158b..40858277e 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractFileCacheBacking.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractFileCacheBacking.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation @@ -19,7 +19,7 @@ import java.io.InputStream; import java.io.OutputStream; /** - * Useful "common" functionality for caching to files + * Useful "common" functionality for caching to files */ public abstract class AbstractFileCacheBacking extends AbstractCacheBacking { /** diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractIndexedFileCacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractIndexedFileCacheBacking.java index 32dba3d90..e32ffcafa 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractIndexedFileCacheBacking.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AbstractIndexedFileCacheBacking.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation @@ -195,7 +195,7 @@ public abstract class AbstractIndexedFileCacheBacking extends AbstractFileCacheB } /** - * The default index entry in the index file + * The default index entry in the index file */ public static class IndexEntry implements Serializable, Cloneable { private static final long serialVersionUID = 756391290557029363L; @@ -205,7 +205,7 @@ public abstract class AbstractIndexedFileCacheBacking extends AbstractFileCacheB public boolean ignored; public long crcClass; public long crcWeaved; - + public IndexEntry () { super(); } diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java index 2ddd3a15e..7ff4f5ba3 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * Lyor Goldstein (vmware) add support for weaved class being re-defined diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java index f6eb1f585..ae59031e8 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheFactory.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheFactory.java index 042ef61bd..50bcbfe71 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheFactory.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheFactory.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheKeyResolver.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheKeyResolver.java index c729efe7f..80987092b 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheKeyResolver.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheKeyResolver.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheStatistics.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheStatistics.java index 1ccacfc18..3494c41fb 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheStatistics.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheStatistics.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CachedClassEntry.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CachedClassEntry.java index 5e4b37cef..658740e0c 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CachedClassEntry.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CachedClassEntry.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CachedClassReference.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CachedClassReference.java index 443958406..434e4395c 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CachedClassReference.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CachedClassReference.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheFactory.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheFactory.java index 7eb796e4b..4c9e73af4 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheFactory.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheFactory.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolver.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolver.java index 11e9b2f2d..5f0e54772 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolver.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolver.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultFileCacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultFileCacheBacking.java index 7bfee2068..586b99694 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultFileCacheBacking.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/DefaultFileCacheBacking.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation @@ -176,7 +176,7 @@ public class DefaultFileCacheBacking extends AbstractIndexedFileCacheBacking { delete(cacheFile); return null; } - + if (ie.ignored) { return new CachedClassEntry(ref, WeavedClassCache.ZERO_BYTES, CachedClassEntry.EntryType.IGNORED); } diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/FlatFileCacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/FlatFileCacheBacking.java index cd3a078ef..06c95fa9c 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/FlatFileCacheBacking.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/FlatFileCacheBacking.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2012 VMware, Inc. custard - * - * 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: * Lyor Goldstein * ******************************************************************/ @@ -32,8 +32,8 @@ import org.aspectj.util.LangUtil; * O/S-es may impose internal limits on the maximum number of "children" * a folder node may have. On the other hand, it is much faster (again, for * small number of instrumented classes) than the ZIP cache since each class/aspect - * is represented by a single file - thus adding/removing/modifying it is easier. - * + * is represented by a single file - thus adding/removing/modifying it is easier. + * * @author Lyor Goldstein */ public class FlatFileCacheBacking extends AsynchronousFileCacheBacking { @@ -106,7 +106,7 @@ public class FlatFileCacheBacking extends AsynchronousFileCacheBacking { return result; } - + @Override protected IndexEntry resolveIndexMapEntry (File cacheDir, IndexEntry ie) { File cacheEntry = new File(cacheDir, ie.key); diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/GeneratedCachedClassHandler.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/GeneratedCachedClassHandler.java index 91c332b6b..506f4d105 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/GeneratedCachedClassHandler.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/GeneratedCachedClassHandler.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java index 69cb1a576..4bbf8d9c9 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java @@ -26,9 +26,9 @@ import org.aspectj.weaver.tools.TraceFactory; * Copyright (c) 2012 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: * Abraham Nevado (lucierna) initial implementation @@ -46,7 +46,7 @@ public class SimpleCache { private Map<String, byte[]> generatedCache; private static final String GENERATED_CACHE_SUBFOLDER = "panenka.cache"; private static final String GENERATED_CACHE_SEPARATOR = ";"; - + public static final String IMPL_NAME = "shared"; protected SimpleCache(String folder, boolean enabled) { @@ -115,32 +115,32 @@ public class SimpleCache { private static class StoreableCachingMap extends HashMap { private String folder; private static final String CACHENAMEIDX = "cache.idx"; - + private long lastStored = System.currentTimeMillis(); private static int DEF_STORING_TIMER = 60000; //ms private int storingTimer; - + private transient Trace trace; private void initTrace(){ trace = TraceFactory.getTraceFactory().getTrace(StoreableCachingMap.class); } - + // private StoreableCachingMap(String folder) { // this.folder = folder; // initTrace(); // } - + private StoreableCachingMap(String folder, int storingTimer){ this.folder = folder; initTrace(); this.storingTimer = storingTimer; } - + public static StoreableCachingMap init(String folder) { return init(folder,DEF_STORING_TIMER); - + } - + public static StoreableCachingMap init(String folder, int storingTimer) { File file = new File(folder + File.separator + CACHENAMEIDX); if (file.exists()) { @@ -186,7 +186,7 @@ public class SimpleCache { try { String path = null; byte[] valueBytes = (byte[]) value; - + if (Arrays.equals(valueBytes, SAME_BYTES)) { path = SAME_BYTES_STRING; } else { @@ -201,8 +201,8 @@ public class SimpleCache { } return null; } - - + + public void storeMap() { long now = System.currentTimeMillis(); @@ -270,7 +270,7 @@ public class SimpleCache { for (String generatedClassName : generatedClassesNames) { byte[] generatedBytes = get(generatedClassName, bytes); - + if (protectionDomain == null) { defineClass(loader, generatedClassName, generatedBytes); } else { diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCacheFactory.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCacheFactory.java index 49569dd0e..033e57b98 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCacheFactory.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCacheFactory.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * Abraham Nevado (lucierna) initial implementation @@ -17,20 +17,20 @@ import java.io.File; import org.aspectj.weaver.Dump; public class SimpleCacheFactory { - + public static final String CACHE_ENABLED_PROPERTY = "aj.weaving.cache.enabled"; public static final String CACHE_DIR = "aj.weaving.cache.dir"; public static final String CACHE_IMPL = "aj.weaving.cache.impl"; - + public static final String PATH_DEFAULT= "/tmp/"; // TODO windows default...? - public static final boolean BYDEFAULT= false; - - + public static final boolean BYDEFAULT= false; + + public static String path = PATH_DEFAULT; public static Boolean enabled = false; private static boolean determinedIfEnabled = false; private static SimpleCache lacache=null; - + public static synchronized SimpleCache createSimpleCache(){ if (lacache==null){ if (!determinedIfEnabled) { @@ -46,7 +46,7 @@ public class SimpleCacheFactory { if (path == null){ path = PATH_DEFAULT; } - + } catch (Throwable t) { path=PATH_DEFAULT; t.printStackTrace(); @@ -59,7 +59,7 @@ public class SimpleCacheFactory { lacache= new SimpleCache(path, enabled); } return lacache; - + } private static void determineIfEnabled() { @@ -69,7 +69,7 @@ public class SimpleCacheFactory { enabled = BYDEFAULT; } else if (property.equalsIgnoreCase("true")){ - + String impl = System.getProperty(CACHE_IMPL); if (SimpleCache.IMPL_NAME.equals(impl)){ enabled = true; @@ -81,7 +81,7 @@ public class SimpleCacheFactory { else{ enabled = BYDEFAULT; } - + } catch (Throwable t) { enabled=BYDEFAULT; System.err.println("Error creating cache"); @@ -90,7 +90,7 @@ public class SimpleCacheFactory { } determinedIfEnabled = true; } - + // Should behave ok with two threads going through here, well whoever gets there first will set determinedIfEnabled but only after // it has set 'enabled' to the right value. public static boolean isEnabled() { @@ -98,7 +98,7 @@ public class SimpleCacheFactory { determineIfEnabled(); } return enabled; - } - + } + } diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java index cc0532316..b5ac70270 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBacking.java index fa7fba074..f5cc1a709 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBacking.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBacking.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * Lyor Goldstein (vmware) add support for weaved class being re-defined @@ -78,7 +78,7 @@ public class ZippedFileCacheBacking extends AsynchronousFileCacheBacking { + " to read current data: " + e.getMessage(), e); } - + FileUtil.deleteContents(outFile); return; } @@ -98,7 +98,7 @@ public class ZippedFileCacheBacking extends AsynchronousFileCacheBacking { + " to write updated data: " + e.getMessage(), e); } - + FileUtil.deleteContents(outFile); } } @@ -116,7 +116,7 @@ public class ZippedFileCacheBacking extends AsynchronousFileCacheBacking { + " to read current data: " + e.getMessage(), e); } - + FileUtil.deleteContents(outFile); return; } @@ -136,7 +136,7 @@ public class ZippedFileCacheBacking extends AsynchronousFileCacheBacking { + " to write updated data: " + e.getMessage(), e); } - + FileUtil.deleteContents(outFile); } } @@ -293,7 +293,7 @@ public class ZippedFileCacheBacking extends AsynchronousFileCacheBacking { return result; } - + public static final void writeZipClassBytes (File file, Map<String,byte[]> entriesMap) throws IOException { if (entriesMap.isEmpty()) { FileUtil.deleteContents(file); diff --git a/weaver/src/main/resources/aspectj_1_5_0.dtd b/weaver/src/main/resources/aspectj_1_5_0.dtd index 314290333..1e9fb8a91 100644 --- a/weaver/src/main/resources/aspectj_1_5_0.dtd +++ b/weaver/src/main/resources/aspectj_1_5_0.dtd @@ -3,9 +3,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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Alexandre Vasseur initial implementation diff --git a/weaver/src/test/java/$Proxy1.java b/weaver/src/test/java/$Proxy1.java index 51cae8b05..ddb236c33 100644 --- a/weaver/src/test/java/$Proxy1.java +++ b/weaver/src/test/java/$Proxy1.java @@ -1,9 +1,9 @@ /******************************************************************************* - * Copyright (c) 2009 Contributors + * Copyright (c) 2009 Contributors * 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: * Andy Clement - initial API and implementation diff --git a/weaver/src/test/java/CounterAspect.java b/weaver/src/test/java/CounterAspect.java index 1ca126d02..7faa4963d 100644 --- a/weaver/src/test/java/CounterAspect.java +++ b/weaver/src/test/java/CounterAspect.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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 - * - * 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 * ******************************************************************/ import org.aspectj.lang.annotation.Aspect; @@ -15,7 +15,7 @@ import org.aspectj.lang.annotation.Pointcut; /** * Created to enable PointcutDesignatorHandlerTests.testParsingBeanInReferencePointcut01 and 02 to run - * + * * @author Andy Clement */ @Aspect @@ -31,7 +31,7 @@ public class CounterAspect { @Pointcut("execution(* toString(..)) && bean(testBean1)") public void testBean1toString() { } - + @Pointcut("execution(* setAge(..)) && bean(testBean1)") public void testBean1SetAge() { } @@ -49,4 +49,4 @@ public class CounterAspect { public void increment2() { count++; } -}
\ No newline at end of file +} diff --git a/weaver/src/test/java/GenericService.java b/weaver/src/test/java/GenericService.java index 87f5c0419..a7418633c 100644 --- a/weaver/src/test/java/GenericService.java +++ b/weaver/src/test/java/GenericService.java @@ -1,9 +1,9 @@ /******************************************************************************* - * Copyright (c) 2009 Contributors + * Copyright (c) 2009 Contributors * 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: * Andy Clement - initial API and implementation diff --git a/weaver/src/test/java/MA.java b/weaver/src/test/java/MA.java index 270882586..5b13369b6 100644 --- a/weaver/src/test/java/MA.java +++ b/weaver/src/test/java/MA.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ public @interface MA { diff --git a/weaver/src/test/java/MB.java b/weaver/src/test/java/MB.java index 3ff3eede4..e8aa30cf0 100644 --- a/weaver/src/test/java/MB.java +++ b/weaver/src/test/java/MB.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ public @interface MB { diff --git a/weaver/src/test/java/MC.java b/weaver/src/test/java/MC.java index d48133baf..f66d19de0 100644 --- a/weaver/src/test/java/MC.java +++ b/weaver/src/test/java/MC.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ public @interface MC { diff --git a/weaver/src/test/java/MD.java b/weaver/src/test/java/MD.java index 47a61cba0..540b6b710 100644 --- a/weaver/src/test/java/MD.java +++ b/weaver/src/test/java/MD.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ public @interface MD { diff --git a/weaver/src/test/java/MessageService.java b/weaver/src/test/java/MessageService.java index 160aecc21..2fe021af8 100644 --- a/weaver/src/test/java/MessageService.java +++ b/weaver/src/test/java/MessageService.java @@ -1,13 +1,13 @@ /******************************************************************************* - * Copyright (c) 2009 Contributors + * Copyright (c) 2009 Contributors * 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: * Andy Clement - initial API and implementation *******************************************************************************/ public interface MessageService extends GenericService<Long> { -} +} diff --git a/weaver/src/test/java/org/aspectj/matcher/tools/ReflectionWorldAdvancedPointcutExpressionTest.java b/weaver/src/test/java/org/aspectj/matcher/tools/ReflectionWorldAdvancedPointcutExpressionTest.java index 9e16e65fb..e1380358a 100644 --- a/weaver/src/test/java/org/aspectj/matcher/tools/ReflectionWorldAdvancedPointcutExpressionTest.java +++ b/weaver/src/test/java/org/aspectj/matcher/tools/ReflectionWorldAdvancedPointcutExpressionTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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 - * - * 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.matcher.tools; @@ -16,7 +16,7 @@ import org.aspectj.weaver.reflect.ReflectionWorld; /** * Run all the pointcut parsing/matching tests against a ReflectionWorld. - * + * * @author Andy Clement */ public class ReflectionWorldAdvancedPointcutExpressionTest extends CommonAdvancedPointcutExpressionTests { diff --git a/weaver/src/test/java/org/aspectj/weaver/AbstractTraceTest.java b/weaver/src/test/java/org/aspectj/weaver/AbstractTraceTest.java index 1f54c6791..97a51d41a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/AbstractTraceTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/AbstractTraceTest.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 *******************************************************************************/ @@ -48,7 +48,7 @@ public abstract class AbstractTraceTest extends TestCase { public String toTraceString() { return getClass().getName() + "[Traceable]"; } - + }; trace.enter(getName(),this,new Object[] { arg1 }); } @@ -59,7 +59,7 @@ public abstract class AbstractTraceTest extends TestCase { public String toString() { throw new RuntimeException("toString() can throw an Exception"); } - + }; trace.enter(getName(),this,new Object[] { arg1 }); } @@ -70,7 +70,7 @@ public abstract class AbstractTraceTest extends TestCase { public int hashCode() { throw new RuntimeException("hashCode can throw an Exception"); } - + }; trace.enter(getName(),this,new Object[] { arg1 }); } @@ -81,7 +81,7 @@ public abstract class AbstractTraceTest extends TestCase { public String toString() { throw new Error("Don't call ClassLoader.toString()"); } - + }; trace.enter(getName(),this,new Object[] { arg1 }); } diff --git a/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java index b8d9ecbd8..7ea60708a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Adrian Colyer Initial implementation diff --git a/weaver/src/test/java/org/aspectj/weaver/CommonReferenceTypeTests.java b/weaver/src/test/java/org/aspectj/weaver/CommonReferenceTypeTests.java index 8d683e8af..06e942089 100644 --- a/weaver/src/test/java/org/aspectj/weaver/CommonReferenceTypeTests.java +++ b/weaver/src/test/java/org/aspectj/weaver/CommonReferenceTypeTests.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.weaver; @@ -33,7 +33,7 @@ public abstract class CommonReferenceTypeTests extends TestCase { assertEquals("Signatures not equal ", "[Pjava/util/List<Pjava/util/List<Ljava/lang/String;>;>;", ut.getSignature()); assertEquals("Names not equal ", "java.util.List<java.util.List<java.lang.String>>[]", ut.getName()); } - + public void testArrays() { world.setBehaveInJava5Way(true); UnresolvedType ut = null; @@ -44,7 +44,7 @@ public abstract class CommonReferenceTypeTests extends TestCase { assertEquals("[Ljava/lang/String;",rt.getSignature()); assertEquals("java.lang.String[]",rt.getName()); assertFalse(rt.isMissing()); - + ut = UnresolvedType.forName("[[[[Ljava.lang.String;"); assertEquals("[[[[Ljava/lang/String;",ut.getSignature()); reified = UnresolvedType.forSignature(ut.getSignature()); diff --git a/weaver/src/test/java/org/aspectj/weaver/CommonsTraceFactoryTest.java b/weaver/src/test/java/org/aspectj/weaver/CommonsTraceFactoryTest.java index b8b451329..6c6e1faf9 100644 --- a/weaver/src/test/java/org/aspectj/weaver/CommonsTraceFactoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/CommonsTraceFactoryTest.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 *******************************************************************************/ diff --git a/weaver/src/test/java/org/aspectj/weaver/CommonsTraceTest.java b/weaver/src/test/java/org/aspectj/weaver/CommonsTraceTest.java index ac6a8cec3..245a79ef2 100644 --- a/weaver/src/test/java/org/aspectj/weaver/CommonsTraceTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/CommonsTraceTest.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,15 +13,15 @@ package org.aspectj.weaver; import org.aspectj.weaver.tools.CommonsTrace; public class CommonsTraceTest extends AbstractTraceTest { - + protected void setUp() throws Exception { super.setUp(); trace = new CommonsTrace(getClass()); trace.setTraceEnabled(true); } - + public void testCommonsTrace() { -// CommonsTrace trace = +// CommonsTrace trace = new CommonsTrace(getClass()); } diff --git a/weaver/src/test/java/org/aspectj/weaver/DefaultTraceFactoryTest.java b/weaver/src/test/java/org/aspectj/weaver/DefaultTraceFactoryTest.java index 16d14bfb6..c3256f093 100644 --- a/weaver/src/test/java/org/aspectj/weaver/DefaultTraceFactoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/DefaultTraceFactoryTest.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 *******************************************************************************/ diff --git a/weaver/src/test/java/org/aspectj/weaver/DefaultTraceTest.java b/weaver/src/test/java/org/aspectj/weaver/DefaultTraceTest.java index a8313c4fb..e60296f1e 100644 --- a/weaver/src/test/java/org/aspectj/weaver/DefaultTraceTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/DefaultTraceTest.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 *******************************************************************************/ @@ -21,7 +21,7 @@ public class DefaultTraceTest extends AbstractTraceTest { } public void testDefaultTrace() { -// DefaultTrace trace = +// DefaultTrace trace = new DefaultTrace(getClass()); } @@ -30,7 +30,7 @@ public class DefaultTraceTest extends AbstractTraceTest { trace.setTraceEnabled(true); assertTrue(trace.isTraceEnabled()); } - + public void testSetPrintStream () { DefaultTrace trace = new DefaultTrace(getClass()); trace.setPrintStream(System.out); diff --git a/weaver/src/test/java/org/aspectj/weaver/DumpTestCase.java b/weaver/src/test/java/org/aspectj/weaver/DumpTestCase.java index ba78b686b..9edee35e8 100644 --- a/weaver/src/test/java/org/aspectj/weaver/DumpTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/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.weaver; @@ -25,7 +25,7 @@ import junit.framework.TestCase; /** * @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 { @@ -39,18 +39,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); } @@ -58,26 +58,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); @@ -85,7 +85,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(); @@ -95,7 +95,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(); @@ -106,17 +106,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; @@ -129,10 +129,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/weaver/src/test/java/org/aspectj/weaver/GenericSignatureParserTest.java b/weaver/src/test/java/org/aspectj/weaver/GenericSignatureParserTest.java index a328a3464..4118e11e5 100644 --- a/weaver/src/test/java/org/aspectj/weaver/GenericSignatureParserTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/GenericSignatureParserTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* - * 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 - * + * 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.weaver; diff --git a/weaver/src/test/java/org/aspectj/weaver/Java5ReflectionBasedReferenceTypeDelegateTest.java b/weaver/src/test/java/org/aspectj/weaver/Java5ReflectionBasedReferenceTypeDelegateTest.java index b1f5df571..0ee82b5f2 100644 --- a/weaver/src/test/java/org/aspectj/weaver/Java5ReflectionBasedReferenceTypeDelegateTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/Java5ReflectionBasedReferenceTypeDelegateTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2005-2017 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: * Andrew Clement Initial implementation * ******************************************************************/ @@ -37,7 +37,7 @@ public class Java5ReflectionBasedReferenceTypeDelegateTest extends ReflectionBas assertTrue("Couldn't find 'toArray' in the set of methods? ", i != -1); // String expectedSignature = "java.lang.Object[] java.util.Collection.toArray(java.lang.Object[])"; String expectedSignature = "([Ljava/lang/Object;)[Ljava/lang/Object;"; - + assertTrue("Expected signature of '" + expectedSignature + "' but it was '" + methods[i].getSignatureErased(), methods[i] .getSignatureErased().equals(expectedSignature)); } @@ -83,27 +83,27 @@ public class Java5ReflectionBasedReferenceTypeDelegateTest extends ReflectionBas public void testAnnotationFinderClassRetention() throws Exception { ResolvedType type = world.resolve(AnnoTesting.class.getName()); ResolvedMember[] ms = type.getDeclaredMethods(); - + ResolvedMember methodWithOnlyClassLevelAnnotation = ms[findMethod("a", ms)]; ResolvedMember methodWithOnlyRuntimeLevelAnnotation = ms[findMethod("b", ms)]; ResolvedMember methodWithClassAndRuntimeLevelAnnotations = ms[findMethod("c", ms)]; ResolvedMember methodWithClassAndRuntimeLevelAnnotations2 = ms[findMethod("d", ms)]; - + assertTrue(methodWithOnlyClassLevelAnnotation.hasAnnotation(world.resolve(AnnoClass.class.getName()))); assertTrue(methodWithOnlyRuntimeLevelAnnotation.hasAnnotation(world.resolve(AnnoRuntime.class.getName()))); - + // This is the tricky scenario. - + // When asking about the runtime level annotations it should not go digging into bcel assertTrue(methodWithClassAndRuntimeLevelAnnotations.hasAnnotation(world.resolve(AnnoRuntime.class.getName()))); - + Field annotationsField = ResolvedMemberImpl.class.getDeclaredField("annotationTypes"); annotationsField.setAccessible(true); ResolvedType[] annoTypes = (ResolvedType[])annotationsField.get(methodWithClassAndRuntimeLevelAnnotations); // Should only be the runtime one here assertEquals(1, annoTypes.length); - + // But when you do ask again and this time for class level, it should redo the unpack and pull both runtime and class out assertTrue(methodWithClassAndRuntimeLevelAnnotations.hasAnnotation(world.resolve(AnnoClass.class.getName()))); @@ -118,27 +118,27 @@ public class Java5ReflectionBasedReferenceTypeDelegateTest extends ReflectionBas ResolvedType[] annotations = methodWithClassAndRuntimeLevelAnnotations2.getAnnotationTypes(); assertEquals(2,annotations.length); } - + @Retention(RetentionPolicy.CLASS) @interface AnnoClass {} - + @Retention(RetentionPolicy.RUNTIME) @interface AnnoRuntime {} - + class AnnoTesting { - + @AnnoClass public void a() {} - + @AnnoRuntime public void b() {} - + @AnnoClass @AnnoRuntime public void c() {} - + @AnnoClass @AnnoRuntime public void d() {} } -}
\ No newline at end of file +} diff --git a/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceFactoryTest.java b/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceFactoryTest.java index a6ef8f91c..889e359a9 100644 --- a/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceFactoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceFactoryTest.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 *******************************************************************************/ diff --git a/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceTest.java b/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceTest.java index 0c694cc9d..d581419c9 100644 --- a/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceTest.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 *******************************************************************************/ diff --git a/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java b/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java index c4d8efa80..969486c9b 100644 --- a/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java @@ -2,9 +2,9 @@ * Copyright (c) 2009 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: * Andy Clement diff --git a/weaver/src/test/java/org/aspectj/weaver/LocaleTest.java b/weaver/src/test/java/org/aspectj/weaver/LocaleTest.java index a79afef72..65df35b70 100644 --- a/weaver/src/test/java/org/aspectj/weaver/LocaleTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/LocaleTest.java @@ -1,12 +1,12 @@ /* Copyright (c) 2002 Contributors. - * - * 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 + * + * 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.weaver; @@ -25,7 +25,7 @@ public class LocaleTest extends TestCase { } public void testNormalLocale() { - doBipush(); + doBipush(); } public void testTurkishLocale() { @@ -37,12 +37,12 @@ public class LocaleTest extends TestCase { Locale.setDefault(def); } } - + private static void doBipush() { try { Instruction.readInstruction( - new ByteSequence(new byte[] { - (byte)16, // bipush + new ByteSequence(new byte[] { + (byte)16, // bipush (byte) 3 // data for bipush })); } catch (IOException e) { diff --git a/weaver/src/test/java/org/aspectj/weaver/Member15Test.java b/weaver/src/test/java/org/aspectj/weaver/Member15Test.java index 66980f612..33f22a13e 100644 --- a/weaver/src/test/java/org/aspectj/weaver/Member15Test.java +++ b/weaver/src/test/java/org/aspectj/weaver/Member15Test.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.weaver; @@ -37,7 +37,7 @@ public class Member15Test extends TestCase { assertFalse(getAnnotations.canBeParameterized()); } } - + public void testCanBeParameterizedGenericMethod() { BcelWorld world = new BcelWorld(); world.setBehaveInJava5Way(true); @@ -55,9 +55,9 @@ public class Member15Test extends TestCase { if (asSubclass != null) { // so can run on non-Java 5 // System.out.println("got it"); assertTrue(asSubclass.canBeParameterized()); - } + } } - + public void testCanBeParameterizedMethodInGenericType() { BcelWorld world = new BcelWorld(); world.setBehaveInJava5Way(true); @@ -75,7 +75,7 @@ public class Member15Test extends TestCase { if (add != null) { // so can run on non-Java 5 // System.out.println("got it"); assertTrue(add.canBeParameterized()); - } + } } /* public void testGenericReferenceTypeCreation() { @@ -83,7 +83,7 @@ public class Member15Test extends TestCase { assertEquals("Porg/aspectj/weaver/MemberTestCase15$One<TT;>;",genericType.getSignature()); assertEquals("Lorg/aspectj/weaver/MemberTestCase15$One;",genericType.getErasureSignature()); } - + public void testMemberSignatureCreation() { World world = new BcelWorld("../weaver5/bin/"); //new ReflectionWorld(false, getClass().getClassLoader()); @@ -91,9 +91,9 @@ public class Member15Test extends TestCase { ResolvedType one = world.resolve("org.aspectj.weaver.MemberTestCase15$One<java.lang.String>"); assertNotNull(one); assertFalse(one.isMissing()); - + // Look at the methods on the parameterized type One<String> - ResolvedMember member = findMethod("getter",one); + ResolvedMember member = findMethod("getter",one); String erasedSignature = MemberImpl.typesToSignature(member.getReturnType(),member.getParameterTypes(),true); assertEquals("()Ljava/lang/String;",erasedSignature); String nonErasedSignature = MemberImpl.typesToSignature(member.getReturnType(),member.getParameterTypes(),false); @@ -112,7 +112,7 @@ public class Member15Test extends TestCase { assertEquals("()Ljava/util/List;",nonErasedSignature); nonErasedSignature = MemberImpl.typesToSignature(member.getGenericReturnType(),member.getGenericParameterTypes(),false); assertEquals("()Pjava/util/List<Ljava/lang/String;>;",nonErasedSignature); - + // Grab the generic type backing the parameterized type ResolvedType oneGeneric = one.getGenericType(); assertTrue(oneGeneric.isGenericType()); @@ -125,12 +125,12 @@ public class Member15Test extends TestCase { assertEquals("()Pjava/util/List<TT;>;",nonErasedSignature); nonErasedSignature = MemberImpl.typesToSignature(member.getGenericReturnType(),member.getGenericParameterTypes(),false); assertEquals("()Ljava/util/List;",nonErasedSignature); - - + + ResolvedType oneRaw = oneGeneric.getRawType(); member = findMethod("getterTwo",oneRaw); } - + private ResolvedMember findMethod(String name, ResolvedType type) { ResolvedMember[] members = type.getDeclaredMethods(); for (ResolvedMember member: members) { @@ -140,7 +140,7 @@ public class Member15Test extends TestCase { } return null; } - + // testcode class One<T> { T t; diff --git a/weaver/src/test/java/org/aspectj/weaver/Member15TestCase.java b/weaver/src/test/java/org/aspectj/weaver/Member15TestCase.java index 08569f181..0b9cdcb8b 100644 --- a/weaver/src/test/java/org/aspectj/weaver/Member15TestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/Member15TestCase.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.weaver; @@ -37,7 +37,7 @@ public class Member15TestCase extends TestCase { assertFalse(getAnnotations.canBeParameterized()); } } - + public void testCanBeParameterizedGenericMethod() { BcelWorld world = new BcelWorld(); world.setBehaveInJava5Way(true); @@ -55,9 +55,9 @@ public class Member15TestCase extends TestCase { if (asSubclass != null) { // so can run on non-Java 5 // System.out.println("got it"); assertTrue(asSubclass.canBeParameterized()); - } + } } - + public void testCanBeParameterizedMethodInGenericType() { BcelWorld world = new BcelWorld(); world.setBehaveInJava5Way(true); @@ -75,7 +75,7 @@ public class Member15TestCase extends TestCase { if (add != null) { // so can run on non-Java 5 // System.out.println("got it"); assertTrue(add.canBeParameterized()); - } + } } - + } diff --git a/weaver/src/test/java/org/aspectj/weaver/MemberTestCase.java b/weaver/src/test/java/org/aspectj/weaver/MemberTestCase.java index 9b5171a3f..57fe302c4 100644 --- a/weaver/src/test/java/org/aspectj/weaver/MemberTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/MemberTestCase.java @@ -1,15 +1,15 @@ /* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). * 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: + * 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, canBeParameterized tests + * Adrian Colyer, canBeParameterized tests * ******************************************************************/ package org.aspectj.weaver; diff --git a/weaver/src/test/java/org/aspectj/weaver/ParameterizedReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/ParameterizedReferenceTypeTestCase.java index 695980e6f..d1cc70ebe 100644 --- a/weaver/src/test/java/org/aspectj/weaver/ParameterizedReferenceTypeTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/ParameterizedReferenceTypeTestCase.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.weaver; @@ -29,7 +29,7 @@ public class ParameterizedReferenceTypeTestCase extends TestCase { BcelWorld world; ReferenceType listOfString; - + public void testDeclaredMethodWithParameter() { ResolvedMember[] methods = listOfString.getDeclaredMethods(); ResolvedMember add = null; @@ -45,7 +45,7 @@ public class ParameterizedReferenceTypeTestCase extends TestCase { } UnresolvedType parameterType = add.getParameterTypes()[0]; assertEquals("Ljava/lang/String;",parameterType.getSignature()); - + ResolvedMember get = null; for (ResolvedMember method : methods) { if (method.getName().equals("get")) { @@ -57,9 +57,9 @@ public class ParameterizedReferenceTypeTestCase extends TestCase { } UnresolvedType returnType = get.getReturnType(); assertEquals("Ljava/lang/String;",returnType.getSignature()); - + } - + public void testDeclaredMethodWithParameterizedReturnType() { ResolvedMember[] methods = listOfString.getDeclaredMethods(); ResolvedMember iterator = null; @@ -71,9 +71,9 @@ public class ParameterizedReferenceTypeTestCase extends TestCase { } UnresolvedType returnType = iterator.getReturnType(); assertEquals("Pjava/util/Iterator<Ljava/lang/String;>;",returnType.getSignature()); - + } - + protected void setUp() throws Exception { super.setUp(); world = new BcelWorld(); diff --git a/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java index bae13be9e..4ed87e194 100644 --- a/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.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://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Adrian Colyer Initial implementation diff --git a/weaver/src/test/java/org/aspectj/weaver/ResolvedMemberSignatures15TestCase.java b/weaver/src/test/java/org/aspectj/weaver/ResolvedMemberSignatures15TestCase.java index 04697b884..ce35a5913 100644 --- a/weaver/src/test/java/org/aspectj/weaver/ResolvedMemberSignatures15TestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/ResolvedMemberSignatures15TestCase.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.weaver; @@ -22,9 +22,9 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { World world; UnresolvedType baseType; UnresolvedType derivedType; - + // STATIC METHODS - + public void testBaseOnlyStaticMethod() { Member toFind = new MemberImpl(Member.METHOD,baseType, (Modifier.PUBLIC | Modifier.STATIC), @@ -33,11 +33,11 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 member",1,foundMembers.length); assertEquals("Lfluffy/Base;",foundMembers[0].getDeclaringType().getSignature()); - + toFind = new MemberImpl(Member.METHOD, derivedType, (Modifier.PUBLIC | Modifier.STATIC), UnresolvedType.forSignature("V"), - "onlyBase", UnresolvedType.NONE); + "onlyBase", UnresolvedType.NONE); foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); // this looks odd but we need both because of the way calls to inherited static methods // are rendered in bytecode when written as obj.foo(); - the bytecode says it is a call @@ -47,10 +47,10 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { for (ResolvedMember rm: foundMembers) { s.append(rm.toString()+" "); } - assertEquals("Expected derived but was "+foundMembers[0]+". All="+s,"Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); + assertEquals("Expected derived but was "+foundMembers[0]+". All="+s,"Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); assertEquals("Expected base but was "+foundMembers[1]+". All="+s,"Lfluffy/Base;",foundMembers[1].getDeclaringType().getSignature()); } - + public void testBothStaticMethod() { Member toFind = new MemberImpl(Member.METHOD,baseType, (Modifier.PUBLIC | Modifier.STATIC), @@ -61,7 +61,7 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 member",1,foundMembers.length); assertEquals("Lfluffy/Base;",foundMembers[0].getDeclaringType().getSignature()); - + toFind = new MemberImpl(Member.METHOD,derivedType, (Modifier.PUBLIC | Modifier.STATIC), UnresolvedType.forSignature("V"), @@ -70,7 +70,7 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ); foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 members",1,foundMembers.length); - assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); + assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); } public void testDerivedStaticMethod() { @@ -80,10 +80,10 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { "onlyDerived", new UnresolvedType[0] ); - + ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found nothing",0,foundMembers.length); - + toFind = new MemberImpl(Member.METHOD,derivedType, (Modifier.PUBLIC | Modifier.STATIC), UnresolvedType.forSignature("V"), @@ -92,11 +92,11 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ); foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 members",1,foundMembers.length); - assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); + assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); } - + // NON-STATIC METHODS - + public void testBaseOnlyMethod() { Member toFind = new MemberImpl(Member.METHOD,baseType, Modifier.PUBLIC, @@ -107,7 +107,7 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 member",1,foundMembers.length); assertEquals("Lfluffy/Base;",foundMembers[0].getDeclaringType().getSignature()); - + toFind = new MemberImpl(Member.METHOD,derivedType, Modifier.PUBLIC, UnresolvedType.forSignature("V"), @@ -120,7 +120,7 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { assertEquals("Lfluffy/Base;",foundMembers[1].getDeclaringType().getSignature()); } - + public void testBothMethod() { Member toFind = new MemberImpl(Member.METHOD,baseType, Modifier.PUBLIC, UnresolvedType.forSignature("V"), @@ -128,7 +128,7 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 member",1,foundMembers.length); assertEquals("Lfluffy/Base;",foundMembers[0].getDeclaringType().getSignature()); - + toFind = new MemberImpl(Member.METHOD,derivedType, Modifier.PUBLIC, UnresolvedType.forSignature("V"), "bothNonStatic", UnresolvedType.NONE); @@ -145,10 +145,10 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { "onlyDerivedNonStatic", new UnresolvedType[0] ); - + ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found nothing",0,foundMembers.length); - + toFind = new MemberImpl(Member.METHOD,derivedType, Modifier.PUBLIC, UnresolvedType.forSignature("V"), @@ -157,9 +157,9 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ); foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 members",1,foundMembers.length); - assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); + assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); } - + public void testChangingThrowsClause() { Member toFind = new MemberImpl(Member.METHOD,derivedType, Modifier.PUBLIC, @@ -167,18 +167,18 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { "m", new UnresolvedType[0] ); - + ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 2 members",2,foundMembers.length); assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); assertEquals("Lfluffy/Base;",foundMembers[1].getDeclaringType().getSignature()); - + assertEquals("throws CloneNotSupported",1,foundMembers[1].getExceptions().length); assertEquals("doesn't throw anything",0,foundMembers[0].getExceptions().length); } - + // CONSTRUCTORS - + public void testNoWalkUpMatchingConstructor() { Member toFind = new MemberImpl(Member.CONSTRUCTOR,derivedType, Modifier.PUBLIC, @@ -188,9 +188,9 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ); ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 members",1,foundMembers.length); - assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); + assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); } - + public void testNoWalkUpNoMatchingConstructor() { Member toFind = new MemberImpl(Member.CONSTRUCTOR,derivedType, Modifier.PUBLIC, @@ -201,9 +201,9 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("No matches",0,foundMembers.length); } - + // FIELDS - + public void testBaseOnlyField() { Member toFind = new MemberImpl(Member.FIELD,baseType, Modifier.PUBLIC, @@ -214,7 +214,7 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 member",1,foundMembers.length); assertEquals("Lfluffy/Base;",foundMembers[0].getDeclaringType().getSignature()); - + toFind = new MemberImpl(Member.FIELD,derivedType, Modifier.PUBLIC, UnresolvedType.forSignature("I"), @@ -226,7 +226,7 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); assertEquals("Lfluffy/Base;",foundMembers[1].getDeclaringType().getSignature()); } - + public void testBothField() { Member toFind = new MemberImpl(Member.FIELD,baseType, Modifier.PUBLIC, @@ -237,7 +237,7 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 member",1,foundMembers.length); assertEquals("Lfluffy/Base;",foundMembers[0].getDeclaringType().getSignature()); - + toFind = new MemberImpl(Member.FIELD,derivedType, Modifier.PUBLIC, UnresolvedType.forSignature("I"), @@ -256,10 +256,10 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { "onlyDerived", new UnresolvedType[0] ); - + ResolvedMember[] foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found nothing",0,foundMembers.length); - + toFind = new MemberImpl(Member.FIELD,derivedType, Modifier.PUBLIC, UnresolvedType.forSignature("I"), @@ -268,8 +268,8 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { ); foundMembers = ResolvedMemberImpl.getJoinPointSignatures(toFind, world); assertEquals("found 1 members",1,foundMembers.length); - assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); - } + assertEquals("Lfluffy/Derived;",foundMembers[0].getDeclaringType().getSignature()); + } protected void setUp() throws Exception { world = new BcelWorld(); @@ -277,5 +277,5 @@ public class ResolvedMemberSignatures15TestCase extends TestCase { baseType = UnresolvedType.forSignature("Lfluffy/Base;"); derivedType = UnresolvedType.forSignature("Lfluffy/Derived;"); } - + } diff --git a/weaver/src/test/java/org/aspectj/weaver/TestShadow.java b/weaver/src/test/java/org/aspectj/weaver/TestShadow.java index 2cdfd84bf..6bf112396 100644 --- a/weaver/src/test/java/org/aspectj/weaver/TestShadow.java +++ b/weaver/src/test/java/org/aspectj/weaver/TestShadow.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.weaver; @@ -76,7 +76,7 @@ public class TestShadow extends Shadow { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.Shadow#getKindedAnnotationVar() */ public Var getKindedAnnotationVar(UnresolvedType annotationType) { @@ -85,7 +85,7 @@ public class TestShadow extends Shadow { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.Shadow#getWithinAnnotationVar() */ public Var getWithinAnnotationVar(UnresolvedType annotationType) { @@ -94,7 +94,7 @@ public class TestShadow extends Shadow { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.Shadow#getWithinCodeAnnotationVar() */ public Var getWithinCodeAnnotationVar(UnresolvedType annotationType) { @@ -103,7 +103,7 @@ public class TestShadow extends Shadow { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.Shadow#getThisAnnotationVar() */ public Var getThisAnnotationVar(UnresolvedType annotationType) { @@ -112,7 +112,7 @@ public class TestShadow extends Shadow { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.Shadow#getTargetAnnotationVar() */ public Var getTargetAnnotationVar(UnresolvedType annotationType) { @@ -121,7 +121,7 @@ public class TestShadow extends Shadow { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.Shadow#getArgAnnotationVar(int) */ public Var getArgAnnotationVar(int i, UnresolvedType annotationType) { diff --git a/weaver/src/test/java/org/aspectj/weaver/TraceFactoryTest.java b/weaver/src/test/java/org/aspectj/weaver/TraceFactoryTest.java index 24ec997fe..baba89352 100644 --- a/weaver/src/test/java/org/aspectj/weaver/TraceFactoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/TraceFactoryTest.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 *******************************************************************************/ diff --git a/weaver/src/test/java/org/aspectj/weaver/TypeVariableReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/TypeVariableReferenceTypeTestCase.java index d746b302c..aa5c5a2b0 100644 --- a/weaver/src/test/java/org/aspectj/weaver/TypeVariableReferenceTypeTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/TypeVariableReferenceTypeTestCase.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.weaver; @@ -17,7 +17,7 @@ import junit.framework.TestCase; /** * @author colyer - * + * */ public class TypeVariableReferenceTypeTestCase extends TestCase { diff --git a/weaver/src/test/java/org/aspectj/weaver/TypeVariableTestCase.java b/weaver/src/test/java/org/aspectj/weaver/TypeVariableTestCase.java index 8a9e63740..5fb30f436 100644 --- a/weaver/src/test/java/org/aspectj/weaver/TypeVariableTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/TypeVariableTestCase.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.weaver; diff --git a/weaver/src/test/java/org/aspectj/weaver/TypeXTestCase.java b/weaver/src/test/java/org/aspectj/weaver/TypeXTestCase.java index bbcbbd170..2cc8aa561 100644 --- a/weaver/src/test/java/org/aspectj/weaver/TypeXTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/TypeXTestCase.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,32 +29,32 @@ public class TypeXTestCase extends TestCase { public void testUnresolvedTypes() { // basic equality - String[] testNames = - new String[] {"int", "long", "int[]", "boolean[][]", + String[] testNames = + new String[] {"int", "long", "int[]", "boolean[][]", "java.lang.String", "java.lang.String[]", "void" }; - String[] testSigs = - new String[] {"I", "J", "[I", "[[Z", + String[] testSigs = + new String[] {"I", "J", "[I", "[[Z", "Ljava/lang/String;", "[Ljava/lang/String;", "V" }; - - String[] componentNames = + + String[] componentNames = new String[] {null, null, "int", "boolean[]", null, "java.lang.String", null }; int[] sizes = new int[] {1, 2, 1, 1, 1, 1, 0}; - - boolean[] isPrimitive = + + boolean[] isPrimitive = new boolean[] { true, true, false, false, false, false, true }; - + nameSignatureTest(testNames, testSigs); arrayTest(UnresolvedType.forNames(testNames), componentNames); arrayTest(UnresolvedType.forSignatures(testSigs), componentNames); sizeTest(UnresolvedType.forNames(testNames), sizes); sizeTest(UnresolvedType.forSignatures(testSigs), sizes); - - isPrimitiveTest(UnresolvedType.forSignatures(testSigs), isPrimitive); + + isPrimitiveTest(UnresolvedType.forSignatures(testSigs), isPrimitive); } - + public void testNameAndSigWithInners() { UnresolvedType t = UnresolvedType.forName("java.util.Map$Entry"); assertEquals(t.getName(), "java.util.Map$Entry"); @@ -62,7 +62,7 @@ public class TypeXTestCase extends TestCase { assertEquals(t.getOutermostType(), UnresolvedType.forName("java.util.Map")); assertEquals(UnresolvedType.forName("java.util.Map").getOutermostType(), UnresolvedType.forName("java.util.Map")); } - + public void testNameAndSigWithParameters() { UnresolvedType t = UnresolvedType.forName("java.util.List<java.lang.String>"); assertEquals(t.getName(),"java.util.List<java.lang.String>"); @@ -77,11 +77,11 @@ public class TypeXTestCase extends TestCase { assertEquals(t.getName(),"java.util.Map<java.util.String,java.util.List<java.lang.Integer>>"); assertEquals(t.getSignature(),"Pjava/util/Map<Ljava/util/String;Pjava/util/List<Ljava/lang/Integer;>;>;"); } - + /** * Verify UnresolvedType signature processing creates the right kind of UnresolvedType's from a signature. - * - * For example, calling UnresolvedType.dump() for + * + * For example, calling UnresolvedType.dump() for * "Ljava/util/Map<Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;" * results in: * UnresolvedType: signature=Ljava/util/Map<Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;>; parameterized=true #params=2 @@ -91,20 +91,20 @@ public class TypeXTestCase extends TestCase { */ public void testTypexGenericSignatureProcessing() { UnresolvedType tx = null; - + tx = UnresolvedType.forSignature("Pjava/util/Set<Ljava/lang/String;>;"); checkTX(tx,true,1); - + tx = UnresolvedType.forSignature("Pjava/util/Set<Pjava/util/List<Ljava/lang/String;>;>;"); checkTX(tx,true,1); - + tx = UnresolvedType.forSignature("Pjava/util/Map<Pjava/util/List<Ljava/lang/String;>;Ljava/lang/String;>;"); checkTX(tx,true,2); checkTX(tx.getTypeParameters()[0],true,1); checkTX(tx.getTypeParameters()[1],false,0); // System.err.println(tx.dump()); } - + public void testTypeXForParameterizedTypes() { World world = new BcelWorld(); UnresolvedType stringType = UnresolvedType.forName("java/lang/String"); @@ -118,7 +118,7 @@ public class TypeXTestCase extends TestCase { assertTrue(listOfStringType.isParameterizedType()); assertFalse(listOfStringType.isGenericType()); } - + public void testTypeFactoryForParameterizedTypes() { UnresolvedType enumOfSimpleType = TypeFactory.createTypeFromSignature("Pjava/lang/Enum<Ljava/lang/String;>;"); @@ -139,7 +139,7 @@ public class TypeXTestCase extends TestCase { assertEquals(1, doublyNestedTypeSignatures.getTypeParameters().length); } - + private void checkTX(UnresolvedType tx,boolean shouldBeParameterized,int numberOfTypeParameters) { assertTrue("Expected parameterization flag to be "+shouldBeParameterized,tx.isParameterizedType()==shouldBeParameterized); if (numberOfTypeParameters==0) { @@ -149,14 +149,14 @@ public class TypeXTestCase extends TestCase { assertTrue("Expected #type parameters to be "+numberOfTypeParameters,tx.getTypeParameters().length==numberOfTypeParameters); } } - + private void isPrimitiveTest(UnresolvedType[] types, boolean[] isPrimitives) { for (int i = 0, len = types.length; i < len; i++) { UnresolvedType type = types[i]; boolean b = isPrimitives[i]; assertEquals(type + " is primitive: ", b, type.isPrimitiveType()); - } + } } private void sizeTest(UnresolvedType[] types, int[] sizes) { @@ -164,7 +164,7 @@ public class TypeXTestCase extends TestCase { UnresolvedType type = types[i]; int size = sizes[i]; assertEquals("size of " + type + ": ", size, type.getSize()); - } + } } private void arrayTest(UnresolvedType[] types, String[] components) { @@ -172,10 +172,10 @@ public class TypeXTestCase extends TestCase { UnresolvedType type = types[i]; String component = components[i]; assertEquals(type + " is array: ", component != null, type.isArray()); - if (component != null) - assertEquals(type + " componentType: ", component, + if (component != null) + assertEquals(type + " componentType: ", component, type.getComponentType().getName()); - } + } } private void nameSignatureTest(String[] ns, String[] ss) { @@ -185,30 +185,30 @@ public class TypeXTestCase extends TestCase { UnresolvedType tn = UnresolvedType.forName(n); UnresolvedType ts = UnresolvedType.forSignature(s); - assertEquals("forName(n).getName()", n, + assertEquals("forName(n).getName()", n, tn.getName()); - assertEquals("forSignature(s).getSignature()", s, + assertEquals("forSignature(s).getSignature()", s, ts.getSignature()); - assertEquals("forName(n).getSignature()", s, + assertEquals("forName(n).getSignature()", s, tn.getSignature()); - assertEquals("forSignature(n).getName()", n, + assertEquals("forSignature(n).getName()", n, ts.getName()); - + TestUtil.assertCommutativeEquals(tn, tn, true); TestUtil.assertCommutativeEquals(ts, ts, true); TestUtil.assertCommutativeEquals(tn, ts, true); - + for (int j = 0; j < len; j++) { if (i == j) continue; UnresolvedType tn1 = UnresolvedType.forName(ns[j]); - UnresolvedType ts1 = UnresolvedType.forSignature(ss[j]); + UnresolvedType ts1 = UnresolvedType.forSignature(ss[j]); TestUtil.assertCommutativeEquals(tn, tn1, false); TestUtil.assertCommutativeEquals(ts, tn1, false); TestUtil.assertCommutativeEquals(tn, ts1, false); TestUtil.assertCommutativeEquals(ts, ts1, false); - } + } } } - - + + } diff --git a/weaver/src/test/java/org/aspectj/weaver/WeaverMessagesTestCase.java b/weaver/src/test/java/org/aspectj/weaver/WeaverMessagesTestCase.java index f8eaa4c9d..197e1050d 100644 --- a/weaver/src/test/java/org/aspectj/weaver/WeaverMessagesTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/WeaverMessagesTestCase.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,9 +21,9 @@ import junit.framework.TestCase; * @author Adrian Colyer */ public class WeaverMessagesTestCase extends TestCase { - + public void testAllMessagesDefined() { - + Class<?> wmClass = WeaverMessages.class; Field[] fields = wmClass.getDeclaredFields(); List<String> fieldList = new ArrayList<>(); diff --git a/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java b/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java index 4ef5bf3e0..ef1a1f2f9 100644 --- a/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java +++ b/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.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/weaver/src/test/java/org/aspectj/weaver/WeaverTestCase.java b/weaver/src/test/java/org/aspectj/weaver/WeaverTestCase.java index 6cbc8e7ee..b199aacad 100644 --- a/weaver/src/test/java/org/aspectj/weaver/WeaverTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/WeaverTestCase.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.weaver; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/AfterReturningWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/AfterReturningWeaveTestCase.java index 8ccafe4de..7303a0f5c 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/AfterReturningWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/AfterReturningWeaveTestCase.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/weaver/src/test/java/org/aspectj/weaver/bcel/AfterThrowingWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/AfterThrowingWeaveTestCase.java index b0c3f04ce..109b26bbf 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/AfterThrowingWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/AfterThrowingWeaveTestCase.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.weaver.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/AfterWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/AfterWeaveTestCase.java index 04c68afde..5d66991a7 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/AfterWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/AfterWeaveTestCase.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,8 +23,8 @@ public class AfterWeaveTestCase extends WeaveTestCase { public AfterWeaveTestCase(String name) { super(name); } - - + + public void testAfter() throws IOException { weaveTest(getStandardTargets(), "After", makeAdviceAll("after")); } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java index 1108c3574..aefcfbe21 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/ArgsWeaveTestCase.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 * ******************************************************************/ @@ -39,11 +39,11 @@ public class ArgsWeaveTestCase extends WeaveTestCase { public ArgsWeaveTestCase(String name) { super(name); } - + public void testAfterReturningArgs() throws IOException { weaveTest("HelloWorld", "ArgsAfterReturningHelloWorld", makeArgsMunger("afterReturning")); - } + } public void testFancyAfterReturningArgs() throws IOException { @@ -52,52 +52,52 @@ public class ArgsWeaveTestCase extends WeaveTestCase { public void testThrowing() throws IOException { weaveTest("HelloWorld", "ArgsAfterThrowingHelloWorld", makeArgsMunger("afterThrowing")); - } + } public void testLots() throws IOException { List<ShadowMunger> l = new ArrayList<>(); - - BcelAdvice p1 = + + BcelAdvice p1 = makeArgsMunger("before"); - BcelAdvice p2 = + BcelAdvice p2 = makeArgsMunger("afterThrowing"); - - BcelAdvice p3 = + + BcelAdvice p3 = makeArgsMunger("afterReturning"); - l.add(p1); + l.add(p1); l.add(p2); l.add(p3); - weaveTest("HelloWorld", "ArgsBeforeAfterHelloWorld", addLexicalOrder(l)); - } + weaveTest("HelloWorld", "ArgsBeforeAfterHelloWorld", addLexicalOrder(l)); + } /* private */ InstructionList getArgsAdviceTag(BcelShadow shadow, String where) { String methodName = "ajc_" + where + "_" + shadow.getKind().toLegalJavaIdentifier(); InstructionFactory fact = shadow.getFactory(); InstructionList il = new InstructionList(); - + il.append( BcelRenderer.renderExpr( - fact, - new BcelWorld(), + fact, + new BcelWorld(), shadow.getArgVar(0), Type.OBJECT)); - + il.append( fact.createInvoke( - "Aspect", - methodName, - Type.VOID, - new Type[] { Type.OBJECT }, + "Aspect", + methodName, + Type.VOID, + new Type[] { Type.OBJECT }, Constants.INVOKESTATIC)); - + return il; } - + private BcelAdvice makeArgsMunger(final String kindx) { ResolvedType rtx = world.resolve(UnresolvedType.forName("Aspect"),true); assertTrue("Cant find required type Aspect",!rtx.isMissing()); @@ -113,7 +113,7 @@ public class ArgsWeaveTestCase extends WeaveTestCase { public InstructionList getAdviceInstructions(BcelShadow shadow, BcelVar extraVar, InstructionHandle fk) { return getArgsAdviceTag(shadow, kindx); } - }; - } + }; + } } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/AroundArgsWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/AroundArgsWeaveTestCase.java index 4088755b5..6085095f4 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/AroundArgsWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/AroundArgsWeaveTestCase.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,17 +25,17 @@ public class AroundArgsWeaveTestCase extends WeaveTestCase { public AroundArgsWeaveTestCase(String name) { super(name); } - + public void testWeave() throws IOException { String label = "AroundArgs"; - ShadowMunger p = + ShadowMunger p = makeConcreteAdvice( "around(list) : " - + "(call(public * add(..)) && target(list)) -> " - + "static boolean Aspect.ajc_around0" + + "(call(public * add(..)) && target(list)) -> " + + "static boolean Aspect.ajc_around0" + "(java.util.ArrayList, org.aspectj.runtime.internal.AroundClosure)"); weaveTest(new String[] {"DynamicHelloWorld"}, label, p); - + } } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/AroundWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/AroundWeaveTestCase.java index ea5037e2c..cb95cf9aa 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/AroundWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/AroundWeaveTestCase.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 * ******************************************************************/ @@ -33,15 +33,15 @@ public class AroundWeaveTestCase extends WeaveTestCase { public AroundWeaveTestCase(String name) { super(name); } - + public void testAround() throws IOException { aroundTest("Around", true); } - + public void testAroundAll() throws IOException { aroundTest("AroundAll", false); } - + public void testAroundAndOthers() throws IOException { aroundTestAndOthers("AroundAndOthers", true); } @@ -59,9 +59,9 @@ public class AroundWeaveTestCase extends WeaveTestCase { Modifier.STATIC, "ajc_around", "(Lorg/aspectj/runtime/internal/AroundClosure;)Ljava/lang/Object;"); - + return new BcelAdvice( - AdviceKind.stringToKind("around"), + AdviceKind.stringToKind("around"), matchOnlyPrintln ? makePointcutPrintln() : makePointcutAll(), sig, 0, -1, -1, null, UnresolvedType.forName("Aspect").resolve(world)) { @@ -70,15 +70,15 @@ public class AroundWeaveTestCase extends WeaveTestCase { super.specializeOn(s); ((BcelShadow) s).initializeForAroundClosure(); } - }; - } + }; + } private void aroundTest(String outName, final boolean matchOnlyPrintln) throws IOException { weaveTest(getStandardTargets(), outName, makeAroundMunger(matchOnlyPrintln)); - } + } private void aroundTestAndOthers(String outName, final boolean matchOnlyPrintln) - throws IOException + throws IOException { // the afterReturning was taken out to avoid circular advice dependency @@ -93,6 +93,6 @@ public class AroundWeaveTestCase extends WeaveTestCase { l.add(makeAroundMunger(matchOnlyPrintln)); weaveTest(getStandardTargets(), outName, addLexicalOrder(l)); - } + } } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java index 5e44c0080..3ab35167c 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.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.weaver.bcel; @@ -26,7 +26,7 @@ import junit.framework.TestCase; /** * @author colyer - * + * */ public class BcelGenericSignatureToTypeXTestCase extends TestCase { diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelTestUtils.java b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelTestUtils.java index bc9f47a85..1aa81ac1e 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelTestUtils.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelTestUtils.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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.weaver.bcel; @@ -24,15 +24,15 @@ import org.aspectj.weaver.patterns.SimpleScope; public class BcelTestUtils { /** * Moved from BcelWorld to here - * + * * Parse a string into advice. - * + * * <blockquote> - * + * * <pre> * Kind ( Id , ... ) : Pointcut -> MethodSignature * </pre> - * + * * </blockquote> */ public static Advice shadowMunger(World w, String str, int extraFlag) { diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelWorldReferenceTypeTest.java b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelWorldReferenceTypeTest.java index 0ab70023e..00780495c 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelWorldReferenceTypeTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelWorldReferenceTypeTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002-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://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.weaver.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/BeforeWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/BeforeWeaveTestCase.java index a43689777..15b783c16 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/BeforeWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/BeforeWeaveTestCase.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,8 +23,8 @@ public class BeforeWeaveTestCase extends WeaveTestCase { public BeforeWeaveTestCase(String name) { super(name); } - - + + public void testBefore() throws IOException { weaveTest(getStandardTargets(), "Before", makeAdviceAll("before")); } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/CheckerTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/CheckerTestCase.java index 7ec480c87..1c045e070 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/CheckerTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/CheckerTestCase.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,21 +28,21 @@ public class CheckerTestCase extends WeaveTestCase { public CheckerTestCase(String name) { super(name); } - + public void testStaticTjp() throws IOException { Checker checker = new Checker( new DeclareErrorOrWarning(true, makePointcutPrintln(), "hey, we found a println")); - + MessageHandler handler = new MessageHandler(); world.setMessageHandler(handler); - + weaveTest("HelloWorld", "IdHelloWorld", checker); assertEquals(1, handler.numMessages(IMessage.ERROR, false)); - + handler = new MessageHandler(); world.setMessageHandler(handler); weaveTest("FancyHelloWorld", "IdFancyHelloWorld", checker); assertEquals(3, handler.numMessages(IMessage.ERROR, false)); - } + } } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java b/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java index cef1f7c90..03c592b69 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ @@ -33,27 +33,27 @@ public class ClassLoaderRepositoryTest extends TestCase { private ZipFile zf; private Enumeration entries; private Map map; - + public void setUp() throws Exception { f = new File("../lib/aspectj/lib/aspectjtools.jar"); assertTrue("Couldn't find aspectjtools to test. Tried: "+f.getAbsolutePath(),f.exists()); - zf = new ZipFile(f); + zf = new ZipFile(f); entries = zf.entries(); // ClassLoaderRepository.sharedCacheCompactFrequency = 16384; map = getSharedMap(); } - + public void tearDown() { new ClassLoaderRepository((ClassLoader) null).reset(); } - + private ClassLoaderRepository setupRepository() throws Exception { ClassLoader cl = Thread.currentThread().getContextClassLoader(); ClassLoader res = new URLClassLoader(new URL[]{f.toURI().toURL()},cl); ClassLoaderRepository rep = new ClassLoaderRepository(res); return rep; } - + private void compareTwoRepositories() throws Exception { ClassLoaderRepository rep1 = setupRepository(); ClassLoaderRepository rep2 = setupRepository(); @@ -63,12 +63,12 @@ public class ClassLoaderRepositoryTest extends TestCase { String classfileName = zfe.getName(); if (classfileName.endsWith(".class")) { String clazzname = classfileName.substring(0,classfileName.length()-6).replace('/','.'); - + // twice by each rep1.loadClass(clazzname); rep1.loadClass(clazzname); - rep2.loadClass(clazzname); - rep2.loadClass(clazzname); + rep2.loadClass(clazzname); + rep2.loadClass(clazzname); i++; } } @@ -91,7 +91,7 @@ public class ClassLoaderRepositoryTest extends TestCase { // } // } - public void testMultiThreaded() throws Throwable { + public void testMultiThreaded() throws Throwable { ClassLoaderRepository.useSharedCache=true; // ClassLoaderRepository.sharedCacheCompactFrequency = 200; //loadOnce(); @@ -107,11 +107,11 @@ public class ClassLoaderRepositoryTest extends TestCase { } } } - + private class TestThread extends Thread { public Throwable failure = null; Enumeration entries; - + // ensure the threads are loading DIFFERENT shared classes at the same time... public TestThread(int skip) { entries = zf.entries(); @@ -119,7 +119,7 @@ public class ClassLoaderRepositoryTest extends TestCase { entries.nextElement(); } } - + public void run() { try { ClassLoaderRepository rep = setupRepository(); @@ -133,7 +133,7 @@ public class ClassLoaderRepositoryTest extends TestCase { rep.loadClass(clazzname); i++; } - } + } System.err.println("Thread finished: "+rep.report()); } catch (Throwable t) { failure = t; @@ -143,29 +143,29 @@ public class ClassLoaderRepositoryTest extends TestCase { return failure; } } - + public void testNotSharedRepository() throws Exception { ClassLoaderRepository.useSharedCache=false; compareTwoRepositories(); } - + public void testSharedUrlRepository() throws Exception { ClassLoaderRepository.useSharedCache=true; compareTwoRepositories(); // ClassLoaderRepository.compactSharedCache(); } - - public void testPurgeUrlRepository() throws Exception { + + public void testPurgeUrlRepository() throws Exception { ClassLoaderRepository.useSharedCache = true; ClassLoaderRepository rep = setupRepository(); Reference ref = null; - + while (ref==null && entries.hasMoreElements()) { ZipEntry zfe = (ZipEntry)entries.nextElement(); String classfileName = zfe.getName(); if (classfileName.endsWith(".class")) { String clazzname = classfileName.substring(0,classfileName.length()-6).replace('/','.'); - + rep.loadClass(clazzname); assertEquals("expected one entry in shared URL cache "+map.size()+": "+map, 1, map.size()); ref = (Reference)map.values().iterator().next(); @@ -176,20 +176,20 @@ public class ClassLoaderRepositoryTest extends TestCase { } assertEquals("expected empty shared URL cache "+map.size(), 0, map.size()); } - - public void testAutoPurgeUrlRepository() throws Exception { + + public void testAutoPurgeUrlRepository() throws Exception { ClassLoaderRepository.useSharedCache = true; assertEquals("expected empty shared URL cache "+map.size(), 0, map.size()); ClassLoaderRepository rep = setupRepository(); Reference ref = null; int i = 0; - + while (i<3 && entries.hasMoreElements()) { ZipEntry zfe = (ZipEntry)entries.nextElement(); String classfileName = zfe.getName(); if (classfileName.endsWith(".class")) { String clazzname = classfileName.substring(0,classfileName.length()-6).replace('/','.'); - + rep.loadClass(clazzname); ref = (Reference)map.values().iterator().next(); ref.clear(); @@ -199,13 +199,13 @@ public class ClassLoaderRepositoryTest extends TestCase { } assertTrue("expected smaller shared URL cache "+map.size(), map.size()<3); } - + private Field getSharedMapField() throws Exception { Field field = ClassLoaderRepository.class.getDeclaredField("sharedCache"); field.setAccessible(true); return field; } - + private Map getSharedMap() throws Exception { return (Map)getSharedMapField() .get(null); } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/ClasspathManagerTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/ClasspathManagerTestCase.java index 0cf4cc8ca..1c8d7a918 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/ClasspathManagerTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/ClasspathManagerTestCase.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.weaver.bcel; @@ -30,18 +30,18 @@ import junit.framework.TestCase; /** * Should run these tests 3 times on each JDK level (8, 9, 11). On each one 3 of the - * tests should pass indicating that JDK can successfully access system types in + * tests should pass indicating that JDK can successfully access system types in * each JDK level. - * + * * @author Andy Clement */ public class ClasspathManagerTestCase extends TestCase { - + // Works on my machine where all jvms under ~/jvms private static String java18_rtjar = findJvm("j.*18.*","rt.jar"); private static String java9_jrtfsjar = findJvm("j.*9.*","jrt-fs.jar");; private static String java11_jrtfsjar = findJvm("j.*11.*","jrt-fs.jar");; - + private static String findJvm(String pattern, String jar) { String start = System.getProperty("user.home")+"/jvms"; if (new File(start).isDirectory()) { @@ -57,7 +57,7 @@ public class ClasspathManagerTestCase extends TestCase { } return null; } - + private static File walk(File dir, String jar) { File[] fs = dir.listFiles(); if (fs!=null) { @@ -74,7 +74,7 @@ public class ClasspathManagerTestCase extends TestCase { } return null; } - + public void testInstructions() { System.out.println("This test is really only for standalone usage as it need executing on multiple JDK levels"); } @@ -85,9 +85,9 @@ public class ClasspathManagerTestCase extends TestCase { classpath.add(java18_rtjar); ClassPathManager cpm = new ClassPathManager(classpath, new MH()); ClassFile t = cpm.find(UnresolvedType.forSignature("Ljava/lang/Object;")); - assertNotNull(t); + assertNotNull(t); } - + public void xtestJava18accessing11JRT() throws ClassFormatException, IOException { if (LangUtil.getVmVersion()>8) fail("Must be Java 8"); List<String> classpath = new ArrayList<>(); @@ -116,16 +116,16 @@ public class ClasspathManagerTestCase extends TestCase { assertEquals(0,c); } - + public void xtestSanity19accessing18RTJAR() throws IOException { assertEquals(9.0,LangUtil.getVmVersion()); List<String> classpath = new ArrayList<>(); classpath.add(java18_rtjar); ClassPathManager cpm = new ClassPathManager(classpath, new MH()); ClassFile t = cpm.find(UnresolvedType.forSignature("Ljava/lang/Object;")); - assertNotNull(t); + assertNotNull(t); } - + public void xtestJava19accessing11JRT() throws ClassFormatException, IOException { assertEquals(9.0,LangUtil.getVmVersion()); List<String> classpath = new ArrayList<>(); @@ -153,16 +153,16 @@ public class ClasspathManagerTestCase extends TestCase { long c = Arrays.asList(clazz.getMethods()).stream().filter(m -> m.getName().equals("isBlank")).count(); assertEquals(0,c); } - + public void xtestSanity11accessing18RTJAR() throws IOException { assertEquals(11.0,LangUtil.getVmVersion()); List<String> classpath = new ArrayList<>(); classpath.add(java18_rtjar); ClassPathManager cpm = new ClassPathManager(classpath, new MH()); ClassFile t = cpm.find(UnresolvedType.forSignature("Ljava/lang/Object;")); - assertNotNull(t); + assertNotNull(t); } - + public void xtestJava11accessing11JRT() throws ClassFormatException, IOException { assertEquals(11.0,LangUtil.getVmVersion()); List<String> classpath = new ArrayList<>(); @@ -190,7 +190,7 @@ public class ClasspathManagerTestCase extends TestCase { long c = Arrays.asList(clazz.getMethods()).stream().filter(m -> m.getName().equals("isBlank")).count(); assertEquals(0,c); } - + static class MH implements IMessageHandler { @Override @@ -211,6 +211,6 @@ public class ClasspathManagerTestCase extends TestCase { @Override public void ignore(Kind kind) { } - + } } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/FieldSetTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/FieldSetTestCase.java index c81827229..f211c0195 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/FieldSetTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/FieldSetTestCase.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/weaver/src/test/java/org/aspectj/weaver/bcel/HierarchyDependsTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/HierarchyDependsTestCase.java index 062f3dbef..7a863526b 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/HierarchyDependsTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/HierarchyDependsTestCase.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,9 +21,9 @@ public class HierarchyDependsTestCase extends TestCase { public HierarchyDependsTestCase(String arg0) { super(arg0); } - + public void testToDo() {} - + /** * XXX not currently used, fix tests when using public void testHierarchyDepends() { @@ -33,28 +33,28 @@ public class HierarchyDependsTestCase extends TestCase { ResolvedType numberType = world.resolve("java.lang.Number"); ResolvedType integerType = world.resolve("java.lang.Integer"); ResolvedType stringType = world.resolve("java.lang.String"); - - + + TypePattern numberPattern = new ExactTypePattern(numberType, false); questions.askQuestion(numberPattern, integerType, TypePattern.STATIC); questions.askQuestion(numberPattern, integerType, TypePattern.DYNAMIC); assertNull(questions.anyChanges()); - + JavaClass saveClass = integerType.getJavaClass(); integerType.replaceJavaClass(stringType.getJavaClass()); assertNotNull(questions.anyChanges()); - + integerType.replaceJavaClass(saveClass); assertNull(questions.anyChanges()); - + TypePattern runnablePattern = new ExactTypePattern(runnableType, false); questions.askQuestion(runnablePattern, stringType, TypePattern.DYNAMIC); assertNull(questions.toString(), questions.anyChanges()); - + saveClass = stringType.getJavaClass(); stringType.replaceJavaClass(numberType.getJavaClass()); assertNotNull(questions.toString(), questions.anyChanges()); - + stringType.replaceJavaClass(saveClass); assertNull(questions.toString(), questions.anyChanges()); } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/IdWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/IdWeaveTestCase.java index cf16b73b1..4538815f6 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/IdWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/IdWeaveTestCase.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.weaver.bcel; @@ -74,9 +74,9 @@ public class IdWeaveTestCase extends WeaveTestCase { // String saveClassDir = classDir; // try { // classDir = "testdata/dummyAspect.jar"; - // - // - // + // + // + // // final List l = new ArrayList(); // BcelAdvice p = new BcelAdvice(null, makePointcutAll(), null, 0, -1, -1, null, null) { // public void implementOn(Shadow shadow) { @@ -87,7 +87,7 @@ public class IdWeaveTestCase extends WeaveTestCase { // runTests = false; // weaveTest(new String[] {"DummyAspect"}, "Id", p); // runTests = tempRunTests; - // + // // checkShadowSet(l, new String[] { // "constructor-execution(void DummyAspect.<init>())", // // XXX waiting on parser stuff diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java index faa645f84..1ca86c371 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/JImageTestCase.java @@ -2,9 +2,9 @@ * Copyright (c) 2017 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 * ******************************************************************/ package org.aspectj.weaver.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.java index a5684db18..b76d1d8af 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.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.weaver.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java index da3e9f79e..ff8495ee2 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.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/weaver/src/test/java/org/aspectj/weaver/bcel/NonstaticWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/NonstaticWeaveTestCase.java index 29e1ac8d7..fbd9c721b 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/NonstaticWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/NonstaticWeaveTestCase.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 * ******************************************************************/ @@ -31,42 +31,42 @@ public class NonstaticWeaveTestCase extends WeaveTestCase { public NonstaticWeaveTestCase(String name) { super(name); } - - + + public void testBefore() throws IOException { String s = "before(): get(* *.*) -> void Aspect.ajc_before()"; PerClause per = new PerSingleton(); per = per.concretize(world.resolve("Aspect")); ShadowMunger myMunger = this.makeConcreteAdvice(s, 0, per); - + weaveTest(getStandardTargets(), "NonStaticBefore", myMunger); } - + public void testBeforeCflow() throws IOException { String s = "before(): get(* *.*) -> void Aspect.ajc_before()"; PerClause per = new PatternParser("percflow(execution(void main(..)))").maybeParsePerClause(); per.resolve(new TestScope(new String[0], new String[0], world)); - + ResolvedType onAspect = world.resolve("Aspect"); CrosscuttingMembers xcut = new CrosscuttingMembers(onAspect,true); onAspect.crosscuttingMembers = xcut; - + per = per.concretize(onAspect); ShadowMunger myMunger = this.makeConcreteAdvice(s, 0, per); - - xcut.addConcreteShadowMunger(myMunger); - - + + xcut.addConcreteShadowMunger(myMunger); + + weaveTest(getStandardTargets(), "CflowNonStaticBefore", xcut.getShadowMungers()); } - + public void testBeforePerThis() throws IOException { String s = "before(): call(* println(..)) -> void Aspect.ajc_before()"; PerClause per = new PatternParser("pertarget(call(* println(..)))").maybeParsePerClause(); per.resolve(new TestScope(new String[0], new String[0], world)); - + ResolvedType onAspect = world.resolve("Aspect"); CrosscuttingMembers xcut = new CrosscuttingMembers(onAspect,true); onAspect.crosscuttingMembers = xcut; @@ -74,15 +74,15 @@ public class NonstaticWeaveTestCase extends WeaveTestCase { ShadowMunger myMunger = this.makeConcreteAdvice(s, 0, per); xcut.addConcreteShadowMunger(myMunger); - + // List mungers = new ArrayList(); // mungers.add(myMunger); -// mungers.addAll(onAspect.getExtraConcreteShadowMungers()); - - +// mungers.addAll(onAspect.getExtraConcreteShadowMungers()); + + weaveTest(getStandardTargets(), "PerThisNonStaticBefore", xcut.getShadowMungers()); } - - - + + + } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/PatternWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/PatternWeaveTestCase.java index 2d9af5395..e145044b9 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/PatternWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/PatternWeaveTestCase.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.weaver.bcel; @@ -47,7 +47,7 @@ public class PatternWeaveTestCase extends WeaveTestCase { checkPointcut("execution(public * *(..))", publicHello, publicFancyHello); } - // + // // public void testPrintln() throws IOException { // String[] callPrintlnHello = new String[] { // "method-call(void java.io.PrintStream.println(java.lang.String))", @@ -59,27 +59,27 @@ public class PatternWeaveTestCase extends WeaveTestCase { // }; // checkPointcut("call(* println(*))", callPrintlnHello, callPrintlnFancyHello); // } - // + // // public void testMumble() throws IOException { // checkPointcut("call(* mumble(*))", none, none); // } - // + // // public void testFooBar() throws IOException { // checkPointcut("call(FooBar *(..))", none, none); // } - // + // // public void testGetOut() throws IOException { // String[] getOutHello = new String[] { // "field-get(java.io.PrintStream java.lang.System.out)", // }; - // + // // checkPointcut("get(* java.lang.System.out)", getOutHello, getOutHello); // } - // + // // // private Pointcut makePointcut(String s) { // // return new PatternParser(s).parsePointcut(); // // } - // + // private void checkPointcut(String pointcutSource, String[] expectedHelloShadows, String[] expectedFancyShadows) throws IOException { Pointcut sp = Pointcut.fromString(pointcutSource); diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.java index 210002fa6..5dd98daf2 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/PointcutResidueTestCase.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/weaver/src/test/java/org/aspectj/weaver/bcel/TjpWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/TjpWeaveTestCase.java index b24b3f6d0..76062d8bb 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/TjpWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/TjpWeaveTestCase.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.weaver.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/TraceJarWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/TraceJarWeaveTestCase.java index 45535407b..e25becabc 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/TraceJarWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/TraceJarWeaveTestCase.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,18 +23,18 @@ public class TraceJarWeaveTestCase extends WeaveTestCase { public TraceJarWeaveTestCase(String name) { super(name); } - - + + public void testTraceJar() throws IOException { world = new BcelWorld(getTraceJar()); BcelWeaver weaver = new BcelWeaver(world); weaver.addLibraryAspect("MyTrace"); - UnwovenClassFile classFile + UnwovenClassFile classFile = makeUnwovenClassFile(classDir, "DynamicHelloWorld", outDirPath); - + weaver.addClassFile(classFile,false); weaver.prepareForWeave(); - + weaveTestInner(weaver, classFile, "DynamicHelloWorld", "TraceJarHello"); } } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/UtilityTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/UtilityTestCase.java index 4fe6fb661..8e37e3017 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/UtilityTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/UtilityTestCase.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,11 +42,11 @@ public class UtilityTestCase extends TestCase { // public void testSwitchy() throws IOException { // disassembleTest("TestSwitchy"); // } - + public static void main(String[] args) throws IOException { BcelWorld world = new BcelWorld(); LazyClassGen clazz = new LazyClassGen(BcelWorld.getBcelObjectType(world.resolve(args[0]))); clazz.print(); - } + } } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveOrderTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveOrderTestCase.java index 6847fb9d2..f74ec815b 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveOrderTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveOrderTestCase.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,14 +32,14 @@ public class WeaveOrderTestCase extends WeaveTestCase { public WeaveOrderTestCase(String name) { super(name); } - + public void testLexicalOrder() { Advice a1 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.OBJECT, 1); Advice a2 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.THROWABLE, 2); - + assertEquals(-1, a2.compareTo(a1)); assertEquals(+1, a1.compareTo(a2)); } @@ -49,7 +49,7 @@ public class WeaveOrderTestCase extends WeaveTestCase { makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.OBJECT, 1); Advice a2 = makeConcreteAdvice(AdviceKind.After, UnresolvedType.OBJECT, UnresolvedType.THROWABLE, 2); - + assertEquals(+1, a2.compareTo(a1)); assertEquals(-1, a1.compareTo(a2)); @@ -57,11 +57,11 @@ public class WeaveOrderTestCase extends WeaveTestCase { makeConcreteAdvice(AdviceKind.After, UnresolvedType.OBJECT, UnresolvedType.OBJECT, 1); a2 = makeConcreteAdvice(AdviceKind.After, UnresolvedType.OBJECT, UnresolvedType.THROWABLE, 2); - + assertEquals(+1, a2.compareTo(a1)); assertEquals(-1, a1.compareTo(a2)); } - + public void testSubtypes() { Advice a1 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.OBJECT, 1); @@ -69,7 +69,7 @@ public class WeaveOrderTestCase extends WeaveTestCase { makeConcreteAdvice(AdviceKind.Before, UnresolvedType.THROWABLE, UnresolvedType.OBJECT, 1); Advice a3 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.forName("java.lang.String"), UnresolvedType.OBJECT, 1); - + assertEquals(+1, a2.compareTo(a1)); assertEquals(-1, a1.compareTo(a2)); @@ -90,25 +90,25 @@ public class WeaveOrderTestCase extends WeaveTestCase { aType.crosscuttingMembers = xcut; xcut.addDeclare(dom); world.getCrosscuttingMembersSet().addFixedCrosscuttingMembers(aType); - + Advice a1 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.OBJECT, 1); Advice a2 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.THROWABLE, 2); Advice a3 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.forName("java.lang.String"), 2); - + assertEquals(-1, a2.compareTo(a1)); assertEquals(+1, a1.compareTo(a2)); assertEquals(-1, a3.compareTo(a1)); assertEquals(+1, a1.compareTo(a3)); - - + + assertEquals(+1, a3.compareTo(a2)); assertEquals(-1, a2.compareTo(a3)); } - + public void testDominatesHarder() { Declare dom = new PatternParser("declare precedence: *, java.lang.String, java.lang.Throwable").parseDeclare(); @@ -118,38 +118,38 @@ public class WeaveOrderTestCase extends WeaveTestCase { aType.crosscuttingMembers = xcut; xcut.addDeclare(dom); world.getCrosscuttingMembersSet().addFixedCrosscuttingMembers(aType); - + Advice a1 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.OBJECT, 2); Advice a2 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.THROWABLE, 1); Advice a3 = makeConcreteAdvice(AdviceKind.Before, UnresolvedType.OBJECT, UnresolvedType.forName("java.lang.String"), 1); - + assertEquals(-1, a2.compareTo(a1)); assertEquals(+1, a1.compareTo(a2)); assertEquals(-1, a3.compareTo(a1)); assertEquals(+1, a1.compareTo(a3)); - - + + assertEquals(+1, a3.compareTo(a2)); assertEquals(-1, a2.compareTo(a3)); } - - - private Advice makeConcreteAdvice(AdviceKind kind, UnresolvedType declaringAspect, + + + private Advice makeConcreteAdvice(AdviceKind kind, UnresolvedType declaringAspect, UnresolvedType concreteAspect, int lexicalPosition) { - Advice a1 = new BcelAdvice(kind, makeResolvedPointcut("this(*)"), + Advice a1 = new BcelAdvice(kind, makeResolvedPointcut("this(*)"), MemberImpl.method(declaringAspect, 0, "foo", "()V"), 0, lexicalPosition, lexicalPosition, null, null); a1 = (Advice)a1.concretize(concreteAspect.resolve(world), world, null); return a1; } - - - + + + } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveTestCase.java index f547d6afd..590dca2b7 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveTestCase.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/weaver/src/test/java/org/aspectj/weaver/bcel/WorldTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/WorldTestCase.java index 8e7aa1448..ba7d59e2a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/WorldTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/WorldTestCase.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.weaver.bcel; @@ -108,10 +108,10 @@ public class WorldTestCase extends CommonWorldTests { modifiersTest(iter, abstractPublic | Modifier.INTERFACE); fieldsTest(iter, ResolvedMember.NONE); - methodsTest(iter, new Member[] { - MemberImpl.method(iter, 0, "hasNext", "()Z"), + methodsTest(iter, new Member[] { + MemberImpl.method(iter, 0, "hasNext", "()Z"), MemberImpl.method(iter, 0, "remove", "()V"), - MemberImpl.method(iter, 0, "next", "()Ljava/lang/Object;"), + MemberImpl.method(iter, 0, "next", "()Ljava/lang/Object;"), MemberImpl.method(iter, 0, "forEachRemaining", "(Ljava/util/function/Consumer;)V") // default void forEachRemaining(Consumer<? super E> action) { // Objects.requireNonNull(action); diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/ZipFileWeaver.java b/weaver/src/test/java/org/aspectj/weaver/bcel/ZipFileWeaver.java index 3be5ae332..dc614129e 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/ZipFileWeaver.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/ZipFileWeaver.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 * ******************************************************************/ @@ -31,9 +31,9 @@ public class ZipFileWeaver { weaver.addJarFile(inFile, new File("."),false); weaver.weave(outFile); long stopTime = System.currentTimeMillis(); - - - System.out.println("handled " + count + " entries, in " + + + + System.out.println("handled " + count + " entries, in " + (stopTime-startTime)/1000. + " seconds"); } } diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/ZipTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/ZipTestCase.java index bf1453a49..ccce12c41 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/ZipTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/ZipTestCase.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.weaver.bcel; @@ -26,7 +26,7 @@ public class ZipTestCase extends TestCase { /** * Constructor for ZipTestCase. - * + * * @param arg0 */ public ZipTestCase(String arg0) { diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java index 0c5cfd860..e11016cc3 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.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: - * 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.weaver.patterns; @@ -52,7 +52,7 @@ import junit.framework.TestCase; } *NOTE NOTE NOTE NOTE NOTE NOTE NOTE* - If you need to rebuild the test data code, run 'ant -f build-15.xml' in the + If you need to rebuild the test data code, run 'ant -f build-15.xml' in the testdata directory. */ diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java index c848bc4c9..4d0984a99 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java @@ -1,11 +1,11 @@ /* ******************************************************************* * 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 - * + * 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.weaver.patterns; @@ -58,7 +58,7 @@ public class AnnotationPatternTestCase extends TestCase { // assertEquals("Goo",UnresolvedType.forName("Goo"),(( // ExactAnnotationTypePattern)right).annotationType); // } - // + // public void testParseNotAnnotationPattern() { PatternParser p = new PatternParser("!@Foo"); AnnotationTypePattern notFoo = p.maybeParseAnnotationPattern(); @@ -102,7 +102,7 @@ public class AnnotationPatternTestCase extends TestCase { // assertTrue("Should be or pattern",andOr instanceof // OrAnnotationTypePattern); // } - // + // public void testParseBadPattern() { PatternParser p = new PatternParser("@@Foo"); try { @@ -294,7 +294,7 @@ public class AnnotationPatternTestCase extends TestCase { assertTrue("does not match goo", ap.matches(ae).alwaysFalse()); } - // + // // public void testOrAnnotationPatternMatching() { // PatternParser p = new PatternParser("@Foo || @Boo"); // AnnotationTypePattern ap = p.parseAnnotationTypePattern(); @@ -309,7 +309,7 @@ public class AnnotationPatternTestCase extends TestCase { // ae = new AnnotatedElementImpl(new String[] {"Goo"}); // assertTrue("does not match goo",ap.matches(ae).alwaysFalse()); // } - // + // public void testNotAnnotationPatternMatching() { PatternParser p = new PatternParser("!@Foo"); AnnotationTypePattern ap = p.maybeParseAnnotationPattern(); @@ -356,7 +356,7 @@ public class AnnotationPatternTestCase extends TestCase { /* * (non-Javadoc) - * + * * @see org.aspectj.weaver.AnnotatedElement#getAnnotationTypes() */ public ResolvedType[] getAnnotationTypes() { diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/ConcretizationTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/ConcretizationTestCase.java index 8c3fd0d9c..33851de9e 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/ConcretizationTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/ConcretizationTestCase.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.weaver.patterns; @@ -31,79 +31,79 @@ public class ConcretizationTestCase extends WeaveTestCase { /* * XXX temporarily skipping public void testCflowResidual() throws IOException { - * + * * BcelAdvice a = (BcelAdvice) makeConcreteTestAdviceEntryPart(); - * + * * TestShadow shadow = new TestShadow(Shadow.MethodCall, Member.methodFromString("int Aspect.i(int x)"), UnresolvedType.OBJECT, * world); - * + * * ExposedState state = new ExposedState(1); - * + * * a.specializeOn(shadow); - * + * * //System.err.println(shadow); //System.err.println(a); - * + * * //System.err.println(a.exposedState); - * - * + * + * * } - * - * - * + * + * + * * public Advice makeConcreteTestAdviceEntryPart() throws IOException { // XXX copied from below, refactor later - * - * + * + * * // returns the advice for the entry part of cflow(foo(a)) Pointcut in = createResolvedPointcut( * "cflow(foo(a)) && (args(b) && !cflow(foo(int)))", new String[] { "b", "a" }, new String[] { "float", "int" }); - * + * * ResolvedPointcutDefinition ref = new ResolvedPointcutDefinition( UnresolvedType.forName("Aspect"), 0, "foo", new * UnresolvedType[] { UnresolvedType.INT }, createResolvedPointcut( "args(refA)", new String[] { "refA" }, new String[] { "int" * })); BcelObjectType target = (BcelObjectType) world.resolve("Aspect"); - * + * * // now munge this to get the pointcut in it - * + * * target.addPointcutDefinition(ref); CrosscuttingMembers xcut = new CrosscuttingMembers(target); target.crosscuttingMembers = * xcut; - * + * * Advice adviceMember = new BcelAdvice( AdviceKind.Before, in, Member.method(UnresolvedType.forName("FOO"), 0, "garadf", * "(FI)V"), 0, 0, 0, null, null); // The pointcut to concretize - * + * * // this returns the actual advice, but we don't care about it now. in.concretize(target, 2, adviceMember); - * + * * List c = (List)xcut.getCflowEntries(); //target.getExtraConcreteShadowMungers(); - * + * * return (Advice) c.get(0); } - * + * * public void XtestCflow() throws IOException { Pointcut in = * createResolvedPointcut("cflow(foo(a)) && (args(b) && !cflow(foo(int)))", new String[] {"b", "a"}, new String[] {"float", * "int"} ); - * + * * ResolvedPointcutDefinition ref = new ResolvedPointcutDefinition(UnresolvedType.forName("Aspect"), 0, "foo", new * UnresolvedType[] { UnresolvedType.INT }, createResolvedPointcut("args(refA)", new String[] {"refA"}, new String[] {"int"})); - * + * * List expectedSlots = new ArrayList(); expectedSlots.add(new ConcreteCflowPointcut.Slot(1, UnresolvedType.INT, 0)); - * + * * checkConcr(in, ref, expectedSlots); } - * + * * public void checkConcr( Pointcut in, ResolvedPointcutDefinition referredTo, List expectedSlots) throws IOException { - * + * * BcelObjectType target = (BcelObjectType)world.resolve("Aspect"); - * + * * // now munge this to get the pointcut in it - * + * * target.addPointcutDefinition(referredTo); - * - * + * + * * Advice adviceMember = new BcelAdvice(AdviceKind.Before, in, Member.method(UnresolvedType.forName("FOO"), 0, "garadf", * "(FI)V"), 0, 0, 0, null, null); - * + * * // The pointcut to concretize AndPointcut ap = (AndPointcut)in.concretize(target, 2, adviceMember); - * - * + * + * * ConcreteCflowPointcut conc = (ConcreteCflowPointcut)ap.left; - * + * * List slots = conc.slots; TestUtil.assertSetEquals(expectedSlots, slots); - * + * * } */ diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java index 73f4854af..c30bde0e6 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.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://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.weaver.patterns; @@ -332,7 +332,7 @@ public class WildTypePatternResolutionTestCase extends TestCase { /** * Foo<? super Number> - * + * */ public void testSomethingSuper() { TypePattern rtp = resolveWildTypePattern("List<? super Double>", false); diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelAndOrNotTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelAndOrNotTestCase.java index d72960fea..1f32151fc 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelAndOrNotTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelAndOrNotTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ package org.aspectj.weaver.patterns.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelBindingTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelBindingTestCase.java index fac53dee1..4745f4c6f 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelBindingTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelBindingTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ package org.aspectj.weaver.patterns.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelModifiersPatternTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelModifiersPatternTestCase.java index 06b89dc15..d25c595c8 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelModifiersPatternTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelModifiersPatternTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ package org.aspectj.weaver.patterns.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelParserTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelParserTestCase.java index 6dc837709..16402eb0e 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelParserTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelParserTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ package org.aspectj.weaver.patterns.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelSignaturePatternTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelSignaturePatternTestCase.java index e7f0f9890..3f01a3a4d 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelSignaturePatternTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelSignaturePatternTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ package org.aspectj.weaver.patterns.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelTypePatternListTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelTypePatternListTestCase.java index 935533d3c..a2384336a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelTypePatternListTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelTypePatternListTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ package org.aspectj.weaver.patterns.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelTypePatternTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelTypePatternTestCase.java index 47b2ce3af..c41b5fe25 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelTypePatternTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelTypePatternTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ package org.aspectj.weaver.patterns.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelWithinTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelWithinTestCase.java index 8da1c172f..15376dded 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelWithinTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/bcel/BcelWithinTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * 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://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 * ******************************************************************/ package org.aspectj.weaver.patterns.bcel; diff --git a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java index 9aa4c5a80..91c3ead95 100644 --- a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.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.weaver.reflect; diff --git a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldReferenceTypeTest.java b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldReferenceTypeTest.java index 720c88289..83aad590f 100644 --- a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldReferenceTypeTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldReferenceTypeTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2002-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://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 * ******************************************************************/ package org.aspectj.weaver.reflect; diff --git a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java index 1143f6d99..e57e61d3f 100644 --- a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java @@ -2,9 +2,9 @@ * Copyright (c) 2005,2017 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 * ******************************************************************/ package org.aspectj.weaver.reflect; diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java index a89268cf9..226f7bec0 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.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.weaver.tools; @@ -55,13 +55,13 @@ public class Java15PointcutExpressionTest extends TestCase { suite.addTestSuite(Java15PointcutExpressionTest.class); return suite; } - + private PointcutParser parser; private Method a; private Method b; private Method c; private Method d; - + /** * Parse some expressions and ensure we capture the parameter annotations and parameter type annotations correctly. * Buckle up, this will get complicated ;) @@ -78,16 +78,16 @@ public class Java15PointcutExpressionTest extends TestCase { pexpr = p.parsePointcutExpression("execution(public void foo(@MA @MB *))"); checkParameterAnnotations(pexpr,0,null,"@MA @MB","(exact[@MA:t] and exact[@MB:t])"); - + pexpr = p.parsePointcutExpression("execution(public void foo(@MA (@MB *)))"); checkParameterAnnotations(pexpr,0,"@MA","@MB","(exact[@MA:p] and exact[@MB:t])"); - + pexpr = p.parsePointcutExpression("execution(public void foo(@MA @MB (@MC *)))"); checkParameterAnnotations(pexpr,0,"@MA @MB","@MC","((exact[@MA:p] and exact[@MB:p]) and exact[@MC:t])"); pexpr = p.parsePointcutExpression("execution(public void foo(@MA (@MB @MC @MD *)))"); checkParameterAnnotations(pexpr,0,"@MA","@MB @MC @MD","(exact[@MA:p] and ((exact[@MB:t] and exact[@MC:t]) and exact[@MD:t]))"); - + pexpr = p.parsePointcutExpression("execution(public void foo(@(MA || MB) (@MC @MD *)))"); checkParameterAnnotations(pexpr,0,null/*Should be MA MB */,"@MC @MD","(wild[(MA || MB)] and (exact[@MC:t] and exact[@MD:t]))"); // I dont think WildAnnotationTypePatterns work properly... @@ -95,17 +95,17 @@ public class Java15PointcutExpressionTest extends TestCase { checkParameterAnnotations(pexpr,0,"@MA","@MB","(exact[@MA:p] and exact[@MB:t])"); checkParameterAnnotations(pexpr,1,null,"@MC","exact[@MC:t]"); checkParameterAnnotations(pexpr,2,"@MD",null,"exact[@MD:p]"); - + } - + public void testMatchingAnnotationValueExpressions() throws SecurityException, NoSuchMethodException { PointcutParser p = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(this.getClass().getClassLoader()); PointcutExpression pexpr = null; ShadowMatch match = null; - Method n = test.AnnoValues.class.getMethod("none"); - Method r = test.AnnoValues.class.getMethod("redMethod"); - Method g = test.AnnoValues.class.getMethod("greenMethod"); + Method n = test.AnnoValues.class.getMethod("none"); + Method r = test.AnnoValues.class.getMethod("redMethod"); + Method g = test.AnnoValues.class.getMethod("greenMethod"); Method b = test.AnnoValues.class.getMethod("blueMethod"); Method d = test.AnnoValues.class.getMethod("defaultMethod"); @@ -115,14 +115,14 @@ public class Java15PointcutExpressionTest extends TestCase { assertTrue("Should not match", pexpr.matchesMethodExecution(g).neverMatches()); assertTrue("Should not match", pexpr.matchesMethodExecution(b).neverMatches()); assertTrue("Should match", pexpr.matchesMethodExecution(d).alwaysMatches()); - + pexpr = p.parsePointcutExpression("execution(@test.A3(test.Color.GREEN) public void *(..))"); assertTrue("Should not match", pexpr.matchesMethodExecution(n).neverMatches()); // default value RED assertTrue("Should not match", pexpr.matchesMethodExecution(r).neverMatches()); assertTrue("Should match", pexpr.matchesMethodExecution(g).alwaysMatches()); assertTrue("Should not match", pexpr.matchesMethodExecution(b).neverMatches()); assertTrue("Should not match", pexpr.matchesMethodExecution(d).neverMatches()); - + pexpr = p.parsePointcutExpression("execution(@test.A3(test.Color.BLUE) public void *(..))"); assertTrue("Should not match", pexpr.matchesMethodExecution(n).neverMatches()); // default value RED assertTrue("Should not match", pexpr.matchesMethodExecution(r).neverMatches()); @@ -138,7 +138,7 @@ public class Java15PointcutExpressionTest extends TestCase { assertTrue("Should match", pexpr.matchesMethodExecution(d).alwaysMatches()); } - + private static final Set<PointcutPrimitive> DEFAULT_SUPPORTED_PRIMITIVES = new HashSet<>(); static { @@ -164,7 +164,7 @@ public class Java15PointcutExpressionTest extends TestCase { System.out.println("Time to get a parser "+(stime2-stime1)+"ms"); System.out.println("Time taken to parse expression is "+(etime-stime2)+"ms"); } - + public void testPerformanceOfPointcutParsingWithBean() { String expression = "execution(public * rewards.internal.*.*Repository+.*(..))"; @@ -176,16 +176,16 @@ public class Java15PointcutExpressionTest extends TestCase { long etime = System.currentTimeMillis(); System.out.println("Time taken to parse expression is "+(etime-stime)+"ms"); } - + private class BeanDesignatorHandler implements PointcutDesignatorHandler { private String askedToParse; public boolean simulateDynamicTest = false; - + public String getDesignatorName() { return "bean"; } - + /* (non-Javadoc) * @see org.aspectj.weaver.tools.PointcutDesignatorHandler#parse(java.lang.String) */ @@ -194,12 +194,12 @@ public class Java15PointcutExpressionTest extends TestCase { return null; // return new BeanPointcutExpression(expression,this.simulateDynamicTest); } - + public String getExpressionLastAskedToParse() { return this.askedToParse; } } - + /** * Test matching of pointcuts against expressions. A reflection world is being used on the backend here (not a Bcel one). @@ -225,7 +225,7 @@ public class Java15PointcutExpressionTest extends TestCase { assertTrue("Should not match", pexpr.matchesMethodExecution(a).neverMatches()); assertTrue("Should not match", pexpr.matchesMethodExecution(b).neverMatches()); assertTrue("Should not match", pexpr.matchesMethodExecution(c).neverMatches()); - + pexpr = p.parsePointcutExpression("execution(public void *(@test.A1 (*)))"); assertTrue("Should not match", pexpr.matchesMethodExecution(a).neverMatches()); assertTrue("Should match", pexpr.matchesMethodExecution(b).alwaysMatches()); @@ -258,8 +258,8 @@ public class Java15PointcutExpressionTest extends TestCase { assertTrue("Should not match", pexpr.matchesMethodExecution(h).neverMatches()); // assertTrue("Should match", pexpr.matchesMethodExecution(j).alwaysMatches()); // should match but does not, broken implementation, old bug - see WildAnnotationTypePattern.match - - + + } private void checkParameterAnnotations(PointcutExpression pe,int parameterNumber,String expectedParameterAnnotations,String expectedParameterTypeAnnotations,String expectedNodeStructure) { @@ -268,11 +268,11 @@ public class Java15PointcutExpressionTest extends TestCase { SignaturePattern sp = kindedP.getSignature(); TypePatternList tpl = sp.getParameterTypes(); TypePattern[] tps = tpl.getTypePatterns(); - + // A visitor over the annotation pattern for the parameter will break it down into parameter vs parameter type annotations MyPatternNodeVisitor mpnv = new MyPatternNodeVisitor(); tps[parameterNumber].getAnnotationPattern().accept(mpnv,null); - + if (expectedNodeStructure==null) { // The caller hasn't worked it out yet!! System.out.println(mpnv.getStringRepresentation()); @@ -281,16 +281,16 @@ public class Java15PointcutExpressionTest extends TestCase { fail("Expected annotation pattern node structure for expression "+pe.getPointcutExpression()+ " was '"+expectedNodeStructure+"' but it turned out to be '"+mpnv.getStringRepresentation()+"'"); } - + tps[parameterNumber].getAnnotationPattern().toString(); - + // parameter type annotation checking Set<String> expected = new HashSet<>(mpnv.getParameterTypeAnnotations()); - + StringTokenizer st = new StringTokenizer(expectedParameterTypeAnnotations==null?"":expectedParameterTypeAnnotations); while (st.hasMoreTokens()) { String nextToken = st.nextToken(); - if (!expected.contains(nextToken)) + if (!expected.contains(nextToken)) fail("In pointcut expression "+pe.getPointcutExpression()+" parameter "+parameterNumber+". The annotation type pattern did not include parameter type annotation "+nextToken+". It's full set was "+mpnv.getParameterTypeAnnotations()); expected.remove(nextToken); } @@ -301,14 +301,14 @@ public class Java15PointcutExpressionTest extends TestCase { } fail("In pointcut expression "+pe.getPointcutExpression()+" parameter "+parameterNumber+". The annotation type pattern has these unexpected parameter type annotations "+excessTokens.toString()); } - + // parameter annotation checking expected = new HashSet<>(mpnv.getParameterAnnotations()); - + st = new StringTokenizer(expectedParameterAnnotations==null?"":expectedParameterAnnotations); while (st.hasMoreTokens()) { String nextToken = st.nextToken(); - if (!expected.contains(nextToken)) + if (!expected.contains(nextToken)) fail("In pointcut expression "+pe.getPointcutExpression()+" parameter "+parameterNumber+". The annotation type pattern did not include parameter annotation "+nextToken+". It's full set was "+mpnv.getParameterAnnotations()); expected.remove(nextToken); } @@ -319,18 +319,18 @@ public class Java15PointcutExpressionTest extends TestCase { } fail("In pointcut expression "+pe.getPointcutExpression()+" parameter "+parameterNumber+". The annotation type pattern has these unexpected parameter annotations "+excessTokens.toString()); } - + } - + static class MyPatternNodeVisitor extends AbstractPatternNodeVisitor { private StringBuffer stringRep = new StringBuffer(); private List<String> parameterAnnotations = new ArrayList<>(); private List<String> parameterTypeAnnotations = new ArrayList<>(); - + public String getStringRepresentation() { return stringRep.toString(); } public List<String> getParameterAnnotations() { return parameterAnnotations; } public List<String> getParameterTypeAnnotations() { return parameterTypeAnnotations; } - + public Object visit(AndAnnotationTypePattern node, Object data) { stringRep.append("("); node.getLeft().accept(this, data); @@ -343,7 +343,7 @@ public class Java15PointcutExpressionTest extends TestCase { stringRep.append("any"); return node; } - public Object visit(ExactAnnotationTypePattern node, Object data) { + public Object visit(ExactAnnotationTypePattern node, Object data) { stringRep.append("exact["+stringify(node.getResolvedAnnotationType())+":"+(node.isForParameterAnnotationMatch()?"p":"t")+"]"); if (node.isForParameterAnnotationMatch()) { parameterAnnotations.add(stringify(node.getResolvedAnnotationType())); @@ -358,7 +358,7 @@ public class Java15PointcutExpressionTest extends TestCase { public Object visit(BindingAnnotationTypePattern node, Object data) { stringRep.append("binding"); - + return node; } public Object visit(NotAnnotationTypePattern node, Object data) { @@ -381,15 +381,15 @@ public class Java15PointcutExpressionTest extends TestCase { } public Object visit(AnnotationPatternList node, Object data) { stringRep.append("list"); - + return node; } - - + + } - - - + + + public void testAtThis() { PointcutExpression atThis = parser.parsePointcutExpression("@this(org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation)"); ShadowMatch sMatch1 = atThis.matchesMethodExecution(a); @@ -401,7 +401,7 @@ public class Java15PointcutExpressionTest extends TestCase { JoinPointMatch jp2 = sMatch2.matchesJoinPoint(new B(), new B(), new Object[0]); assertTrue("matches",jp2.matches()); } - + public void testAtTarget() { PointcutExpression atTarget = parser.parsePointcutExpression("@target(org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation)"); ShadowMatch sMatch1 = atTarget.matchesMethodExecution(a); @@ -411,9 +411,9 @@ public class Java15PointcutExpressionTest extends TestCase { JoinPointMatch jp1 = sMatch1.matchesJoinPoint(new A(), new A(), new Object[0]); assertFalse("does not match",jp1.matches()); JoinPointMatch jp2 = sMatch2.matchesJoinPoint(new B(), new B(), new Object[0]); - assertTrue("matches",jp2.matches()); + assertTrue("matches",jp2.matches()); } - + public void testAtThisWithBinding() { PointcutParameter param = parser.createPointcutParameter("a",MyAnnotation.class); B myB = new B(); @@ -430,7 +430,7 @@ public class Java15PointcutExpressionTest extends TestCase { assertEquals(1,jp2.getParameterBindings().length); assertEquals("should be myB's annotation",bAnnotation,jp2.getParameterBindings()[0].getBinding()); } - + public void testAtTargetWithBinding() { PointcutParameter param = parser.createPointcutParameter("a",MyAnnotation.class); B myB = new B(); @@ -447,7 +447,7 @@ public class Java15PointcutExpressionTest extends TestCase { assertEquals(1,jp2.getParameterBindings().length); assertEquals("should be myB's annotation",bAnnotation,jp2.getParameterBindings()[0].getBinding()); } - + public void testAtArgs() { PointcutExpression atArgs = parser.parsePointcutExpression("@args(..,org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation)"); ShadowMatch sMatch1 = atArgs.matchesMethodExecution(a); @@ -455,8 +455,8 @@ public class Java15PointcutExpressionTest extends TestCase { assertTrue("never matches A",sMatch1.neverMatches()); assertTrue("maybe matches C",sMatch2.maybeMatches()); JoinPointMatch jp2 = sMatch2.matchesJoinPoint(new B(), new B(), new Object[]{new A(),new B()}); - assertTrue("matches",jp2.matches()); - + assertTrue("matches",jp2.matches()); + atArgs = parser.parsePointcutExpression("@args(org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation,org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation)"); sMatch1 = atArgs.matchesMethodExecution(a); sMatch2 = atArgs.matchesMethodExecution(c); @@ -465,9 +465,9 @@ public class Java15PointcutExpressionTest extends TestCase { JoinPointMatch jp1 = sMatch2.matchesJoinPoint(new A(), new A(), new Object[] {new A(), new B()}); assertFalse("does not match",jp1.matches()); jp2 = sMatch2.matchesJoinPoint(new B(), new B(), new Object[] {new B(),new B()}); - assertTrue("matches",jp2.matches()); + assertTrue("matches",jp2.matches()); } - + public void testAtArgs2() { PointcutExpression atArgs = parser.parsePointcutExpression("@args(*, org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation)"); ShadowMatch sMatch1 = atArgs.matchesMethodExecution(c); @@ -477,9 +477,9 @@ public class Java15PointcutExpressionTest extends TestCase { JoinPointMatch jp1 = sMatch1.matchesJoinPoint(new B(), new B(), new Object[] {new A(), new B()}); assertTrue("matches",jp1.matches()); JoinPointMatch jp2 = sMatch2.matchesJoinPoint(new B(), new B(), new Object[] {new A(),new A()}); - assertFalse("does not match",jp2.matches()); + assertFalse("does not match",jp2.matches()); } - + public void testAtArgsWithBinding() { PointcutParameter p1 = parser.createPointcutParameter("a",MyAnnotation.class); PointcutParameter p2 = parser.createPointcutParameter("b", MyAnnotation.class); @@ -491,17 +491,17 @@ public class Java15PointcutExpressionTest extends TestCase { assertEquals(1,jp2.getParameterBindings().length); MyAnnotation bAnnotation = B.class.getAnnotation(MyAnnotation.class); assertEquals("annotation on B",bAnnotation,jp2.getParameterBindings()[0].getBinding()); - + atArgs = parser.parsePointcutExpression("@args(a,b)",A.class,new PointcutParameter[] {p1,p2}); sMatch2 = atArgs.matchesMethodExecution(c); assertTrue("maybe matches C",sMatch2.maybeMatches()); jp2 = sMatch2.matchesJoinPoint(new B(), new B(), new Object[] {new B(),new B()}); - assertTrue("matches",jp2.matches()); + assertTrue("matches",jp2.matches()); assertEquals(2,jp2.getParameterBindings().length); assertEquals("annotation on B",bAnnotation,jp2.getParameterBindings()[0].getBinding()); - assertEquals("annotation on B",bAnnotation,jp2.getParameterBindings()[1].getBinding()); + assertEquals("annotation on B",bAnnotation,jp2.getParameterBindings()[1].getBinding()); } - + public void testAtWithin() { PointcutExpression atWithin = parser.parsePointcutExpression("@within(org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation)"); ShadowMatch sMatch1 = atWithin.matchesMethodExecution(a); @@ -509,7 +509,7 @@ public class Java15PointcutExpressionTest extends TestCase { assertTrue("does not match a",sMatch1.neverMatches()); assertTrue("matches b",sMatch2.alwaysMatches()); } - + public void testAtWithinWithBinding() { PointcutParameter p1 = parser.createPointcutParameter("x",MyAnnotation.class); PointcutExpression atWithin = parser.parsePointcutExpression("@within(x)",B.class,new PointcutParameter[] {p1}); @@ -521,17 +521,17 @@ public class Java15PointcutExpressionTest extends TestCase { assertTrue(jpm.matches()); assertEquals(1,jpm.getParameterBindings().length); MyAnnotation bAnnotation = B.class.getAnnotation(MyAnnotation.class); - assertEquals("annotation on B",bAnnotation,jpm.getParameterBindings()[0].getBinding()); + assertEquals("annotation on B",bAnnotation,jpm.getParameterBindings()[0].getBinding()); } - + public void testAtWithinCode() { PointcutExpression atWithinCode = parser.parsePointcutExpression("@withincode(org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation)"); ShadowMatch sMatch1 = atWithinCode.matchesMethodCall(a,b); ShadowMatch sMatch2 = atWithinCode.matchesMethodCall(a,a); assertTrue("does not match from b",sMatch1.neverMatches()); - assertTrue("matches from a",sMatch2.alwaysMatches()); + assertTrue("matches from a",sMatch2.alwaysMatches()); } - + public void testAtWithinCodeWithBinding() { PointcutParameter p1 = parser.createPointcutParameter("x",MyAnnotation.class); PointcutExpression atWithinCode = parser.parsePointcutExpression("@withincode(x)",A.class,new PointcutParameter[] {p1}); @@ -542,41 +542,41 @@ public class Java15PointcutExpressionTest extends TestCase { MyAnnotation annOna = a.getAnnotation(MyAnnotation.class); assertEquals("MyAnnotation on a",annOna,jpm.getParameterBindings()[0].getBinding()); } - + public void testAtAnnotation() { PointcutExpression atAnnotation = parser.parsePointcutExpression("@annotation(org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation)"); ShadowMatch sMatch1 = atAnnotation.matchesMethodCall(b,a); ShadowMatch sMatch2 = atAnnotation.matchesMethodCall(a,a); assertTrue("does not match call to b",sMatch1.neverMatches()); - assertTrue("matches call to a",sMatch2.alwaysMatches()); + assertTrue("matches call to a",sMatch2.alwaysMatches()); } - + public void testAtAnnotationWithBinding() { PointcutParameter p1 = parser.createPointcutParameter("x",MyAnnotation.class); PointcutExpression atAnnotation = parser.parsePointcutExpression("@annotation(x)",A.class,new PointcutParameter[] {p1}); ShadowMatch sMatch2 = atAnnotation.matchesMethodCall(a,a); - assertTrue("matches call to a",sMatch2.alwaysMatches()); + assertTrue("matches call to a",sMatch2.alwaysMatches()); JoinPointMatch jpm = sMatch2.matchesJoinPoint(new A(), new A(), new Object[0]); assertTrue(jpm.matches()); assertEquals(1,jpm.getParameterBindings().length); MyAnnotation annOna = a.getAnnotation(MyAnnotation.class); - assertEquals("MyAnnotation on a",annOna,jpm.getParameterBindings()[0].getBinding()); + assertEquals("MyAnnotation on a",annOna,jpm.getParameterBindings()[0].getBinding()); } - + public void testReferencePointcutNoParams() { PointcutExpression pc = parser.parsePointcutExpression("foo()",C.class,new PointcutParameter[0]); ShadowMatch sMatch1 = pc.matchesMethodCall(a,b); ShadowMatch sMatch2 = pc.matchesMethodExecution(a); assertTrue("no match on call",sMatch1.neverMatches()); assertTrue("match on execution",sMatch2.alwaysMatches()); - + pc = parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.C.foo()"); sMatch1 = pc.matchesMethodCall(a,b); sMatch2 = pc.matchesMethodExecution(a); assertTrue("no match on call",sMatch1.neverMatches()); assertTrue("match on execution",sMatch2.alwaysMatches()); } - + public void testReferencePointcutParams() { PointcutParameter p1 = parser.createPointcutParameter("x",A.class); PointcutExpression pc = parser.parsePointcutExpression("goo(x)",C.class,new PointcutParameter[] {p1}); @@ -591,7 +591,7 @@ public class Java15PointcutExpressionTest extends TestCase { assertEquals("should be bound to anA",anA,jpm.getParameterBindings()[0].getBinding()); } - + public void testExecutionWithClassFileRetentionAnnotation() { PointcutExpression pc1 = parser.parsePointcutExpression("execution(@org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyAnnotation * *(..))"); PointcutExpression pc2 = parser.parsePointcutExpression("execution(@org.aspectj.weaver.tools.Java15PointcutExpressionTest.MyClassFileRetentionAnnotation * *(..))"); @@ -604,35 +604,35 @@ public class Java15PointcutExpressionTest extends TestCase { sMatch = pc2.matchesMethodExecution(b); assertTrue("matches",sMatch.alwaysMatches()); } - + public void testGenericMethodSignatures() throws Exception{ PointcutExpression ex = parser.parsePointcutExpression("execution(* set*(java.util.List<org.aspectj.weaver.tools.Java15PointcutExpressionTest.C>))"); Method m = TestBean.class.getMethod("setFriends",List.class); ShadowMatch sm = ex.matchesMethodExecution(m); - assertTrue("should match",sm.alwaysMatches()); + assertTrue("should match",sm.alwaysMatches()); } - + public void testAnnotationInExecution() throws Exception { - parser.parsePointcutExpression("execution(@(org.springframework..*) * *(..))"); + parser.parsePointcutExpression("execution(@(org.springframework..*) * *(..))"); } - + public void testVarArgsMatching() throws Exception { PointcutExpression ex = parser.parsePointcutExpression("execution(* *(String...))"); Method usesVarArgs = D.class.getMethod("varArgs",String[].class); Method noVarArgs = D.class.getMethod("nonVarArgs", String[].class); ShadowMatch sm1 = ex.matchesMethodExecution(usesVarArgs); - assertTrue("should match",sm1.alwaysMatches()); + assertTrue("should match",sm1.alwaysMatches()); ShadowMatch sm2 = ex.matchesMethodExecution(noVarArgs); - assertFalse("should not match",sm2.alwaysMatches()); + assertFalse("should not match",sm2.alwaysMatches()); } - + public void testJavaLangMatching() throws Exception { PointcutExpression ex = parser.parsePointcutExpression("@within(java.lang.Deprecated)"); Method foo = GoldenOldie.class.getMethod("foo"); ShadowMatch sm1 = ex.matchesMethodExecution(foo); assertTrue("should match",sm1.alwaysMatches()); } - + public void testReferencePCsInSameType() throws Exception { PointcutExpression ex = parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.NamedPointcutResolution.c()",NamedPointcutResolution.class,new PointcutParameter[0]); ShadowMatch sm = ex.matchesMethodExecution(a); @@ -640,15 +640,15 @@ public class Java15PointcutExpressionTest extends TestCase { sm = ex.matchesMethodExecution(b); assertTrue("does not match",sm.neverMatches()); } - + public void testReferencePCsInOtherType() throws Exception { PointcutExpression ex = parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.ExternalReferrer.d()",ExternalReferrer.class,new PointcutParameter[0]); ShadowMatch sm = ex.matchesMethodExecution(a); assertTrue("should match",sm.alwaysMatches()); sm = ex.matchesMethodExecution(b); - assertTrue("does not match",sm.neverMatches()); + assertTrue("does not match",sm.neverMatches()); } - + public void testArrayTypeInArgs() throws Exception { PointcutParameter[] params = new PointcutParameter[3]; params[0] = parser.createPointcutParameter("d", Date.class); @@ -656,7 +656,7 @@ public class Java15PointcutExpressionTest extends TestCase { params[2] = parser.createPointcutParameter("ss", String[].class); parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.UsesArrays.pc(d,s,ss)",UsesArrays.class,params); } - + protected void setUp() throws Exception { super.setUp(); parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(this.getClass().getClassLoader()); @@ -668,38 +668,38 @@ public class Java15PointcutExpressionTest extends TestCase { @Retention(RetentionPolicy.RUNTIME) private @interface MyAnnotation {} - + private @interface MyClassFileRetentionAnnotation {} - + private static class A { @MyAnnotation public void a() {} } - + @MyAnnotation private static class B { @MyClassFileRetentionAnnotation public void b() {} public void c(A anA, B aB) {} - + public void d(A anA, A anotherA) {} } - + private static class C { - + @Pointcut("execution(* *(..))") public void foo() {} - + @Pointcut(value="execution(* *(..)) && this(x)", argNames="x") public void goo(A x) {} } - + private static class D { - + public void nonVarArgs(String[] strings) {}; - + public void varArgs(String... strings) {}; - + } - + static class TestBean { public void setFriends(List<C> friends) {} } @@ -708,32 +708,32 @@ public class Java15PointcutExpressionTest extends TestCase { static class GoldenOldie { public void foo() {} } - + private static class NamedPointcutResolution { - + @Pointcut("execution(* *(..))") public void a() {} - + @Pointcut("this(org.aspectj.weaver.tools.Java15PointcutExpressionTest.A)") public void b() {} - + @Pointcut("a() && b()") public void c() {} } - + private static class ExternalReferrer { - - @Pointcut("org.aspectj.weaver.tools.Java15PointcutExpressionTest.NamedPointcutResolution.a() && " + + + @Pointcut("org.aspectj.weaver.tools.Java15PointcutExpressionTest.NamedPointcutResolution.a() && " + "org.aspectj.weaver.tools.Java15PointcutExpressionTest.NamedPointcutResolution.b())") public void d() {} - + } - + private static class UsesArrays { - + @Pointcut("execution(* *(..)) && args(d,s,ss)") public void pc(Date d, String s, String[] ss) {} - + } } diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutDesignatorHandlerTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutDesignatorHandlerTest.java index bd192c78c..e6bcb42fa 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutDesignatorHandlerTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutDesignatorHandlerTest.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.weaver.tools; @@ -15,7 +15,7 @@ import junit.framework.TestCase; /** * @author Adrian Colyer - * + * */ public class PointcutDesignatorHandlerTest extends TestCase { @@ -25,17 +25,17 @@ public class PointcutDesignatorHandlerTest extends TestCase { super.setUp(); needToSkip = needToSkipPointcutParserTests(); } - + /** this condition can occur on the build machine only, and is way too complex to fix right now... */ private boolean needToSkipPointcutParserTests() { try { - Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate",false,this.getClass().getClassLoader());//ReflectionBasedReferenceTypeDelegate.class.getClassLoader()); + Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate",false,this.getClass().getClassLoader());//ReflectionBasedReferenceTypeDelegate.class.getClassLoader()); } catch (ClassNotFoundException cnfEx) { return true; } return false; } - + public void testParseWithoutHandler() { if (needToSkip) return; try { @@ -47,7 +47,7 @@ public class PointcutDesignatorHandlerTest extends TestCase { assertTrue("contains bean", ex.getMessage().contains("bean")); } } - + public void testParseWithHandler() { if (needToSkip) return; PointcutParser parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution(); @@ -56,8 +56,8 @@ public class PointcutDesignatorHandlerTest extends TestCase { parser.parsePointcutExpression("bean(service.*)"); assertEquals("service.*",beanHandler.getExpressionLastAskedToParse()); } - - + + /* * Bug 205907 - the registered pointcut designator does not also get registered with the * InternalUseOnlyPointcutParser inside the Java15ReflectionBasedReferenceTypeDelegate code. First test checks @@ -74,7 +74,7 @@ public class PointcutDesignatorHandlerTest extends TestCase { // public void testBean1SetAge() { } // This should be found and resolved -// PointcutExpression pc = +// PointcutExpression pc = parser.parsePointcutExpression("CounterAspect.testBean1SetAge()"); } @@ -93,7 +93,7 @@ public class PointcutDesignatorHandlerTest extends TestCase { // // @Pointcut("execution(* toString(..)) && bean(testBean1)") // public void testBean1toString() { } - + // This should be found and resolved PointcutExpression pc = parser.parsePointcutExpression("CounterAspect.testBean1toString()"); @@ -102,10 +102,10 @@ public class PointcutDesignatorHandlerTest extends TestCase { pc.setMatchingContext(context); ShadowMatch sm = pc.matchesMethodExecution(Object.class.getMethod("toString", new Class[0])); assertTrue(sm.alwaysMatches()); - + sm = pc.matchesMethodExecution(Object.class.getMethod("hashCode", new Class[0])); assertTrue(sm.neverMatches()); - + context = new DefaultMatchingContext(); context.addContextBinding("beanName", "testBean2"); pc.setMatchingContext(context); @@ -119,9 +119,9 @@ public class PointcutDesignatorHandlerTest extends TestCase { BeanDesignatorHandler beanHandler = new BeanDesignatorHandler(); parser.registerPointcutDesignatorHandler(beanHandler); parser.parsePointcutExpression("bean(org.xyz.someapp..*)"); - assertEquals("org.xyz.someapp..*",beanHandler.getExpressionLastAskedToParse()); + assertEquals("org.xyz.someapp..*",beanHandler.getExpressionLastAskedToParse()); } - + public void testStaticMatch() throws Exception { if (needToSkip) return; PointcutParser parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution(); @@ -137,7 +137,7 @@ public class PointcutDesignatorHandlerTest extends TestCase { sm = pc.matchesMethodExecution(Object.class.getMethod("toString",new Class[0])); assertTrue(sm.neverMatches()); } - + public void testDynamicMatch() throws Exception { if (needToSkip) return; PointcutParser parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution(); @@ -156,7 +156,7 @@ public class PointcutDesignatorHandlerTest extends TestCase { context.addContextBinding("beanName", "notMyBean"); assertFalse(sm.matchesJoinPoint(null, null, null).matches()); } - + public void testFastMatch() { if (needToSkip) return; PointcutParser parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingContextClassloaderForResolution(); @@ -168,18 +168,18 @@ public class PointcutDesignatorHandlerTest extends TestCase { pc.setMatchingContext(context); assertTrue(pc.couldMatchJoinPointsInType(String.class)); context.addContextBinding("beanName","yourBean"); - assertFalse(pc.couldMatchJoinPointsInType(String.class)); + assertFalse(pc.couldMatchJoinPointsInType(String.class)); } private class BeanDesignatorHandler implements PointcutDesignatorHandler { private String askedToParse; public boolean simulateDynamicTest = false; - + public String getDesignatorName() { return "bean"; } - + /* (non-Javadoc) * @see org.aspectj.weaver.tools.PointcutDesignatorHandler#parse(java.lang.String) */ @@ -187,12 +187,12 @@ public class PointcutDesignatorHandlerTest extends TestCase { this.askedToParse = expression; return new BeanPointcutExpression(expression,this.simulateDynamicTest); } - + public String getExpressionLastAskedToParse() { return this.askedToParse; } } - + private class BeanPointcutExpression implements ContextBasedMatcher { private final String beanNamePattern; @@ -200,14 +200,14 @@ public class PointcutDesignatorHandlerTest extends TestCase { public BeanPointcutExpression(String beanNamePattern, boolean simulateDynamicTest) { this.beanNamePattern = beanNamePattern; - this.simulateDynamicTest = simulateDynamicTest; + this.simulateDynamicTest = simulateDynamicTest; } public boolean couldMatchJoinPointsInType(Class aClass) { return true; } - + /* (non-Javadoc) * @see org.aspectj.weaver.tools.ContextBasedMatcher#couldMatchJoinPointsInType(java.lang.Class) */ @@ -244,5 +244,5 @@ public class PointcutDesignatorHandlerTest extends TestCase { public boolean matchesDynamically(MatchingContext matchContext) { return this.beanNamePattern.equals(matchContext.getBinding("beanName")); } - } + } } diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutExpressionTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutExpressionTest.java index ccf8e560b..b4337e66a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutExpressionTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutExpressionTest.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/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java index d3eaaf67e..2a20d9c11 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.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 * * ******************************************************************/ package org.aspectj.weaver.tools; diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/ReadingAttributesTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/ReadingAttributesTest.java index 25dc54009..e45c4ce3f 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/ReadingAttributesTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/ReadingAttributesTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2009 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 * ******************************************************************/ package org.aspectj.weaver.tools; @@ -28,7 +28,7 @@ import junit.framework.TestCase; public class ReadingAttributesTest extends TestCase { public void testSkip() {} // Review what to do about these tests - + public void xtestWeaverStateInfo() throws ClassNotFoundException, IOException { JavaClass jc = getClassFrom(new File("n:/temp"), "com.springsource.petclinic.domain.Visit"); diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/TypePatternMatcherTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/TypePatternMatcherTest.java index 402fe4e27..e6efbd851 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/TypePatternMatcherTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/TypePatternMatcherTest.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,25 +20,25 @@ public class TypePatternMatcherTest extends TestCase { TypePatternMatcher tpm; private boolean needToSkip = false; - + /** this condition can occur on the build machine only, and is way too complex to fix right now... */ private boolean needToSkipPointcutParserTests() { try { - Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate",false,this.getClass().getClassLoader());//ReflectionBasedReferenceTypeDelegate.class.getClassLoader()); + Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate",false,this.getClass().getClassLoader());//ReflectionBasedReferenceTypeDelegate.class.getClassLoader()); } catch (ClassNotFoundException cnfEx) { return true; } return false; } - + public void testMatching() { if (needToSkip) return; - + assertTrue("Map+ matches Map",tpm.matches(Map.class)); assertTrue("Map+ matches HashMap",tpm.matches(HashMap.class)); assertFalse("Map+ does not match String",tpm.matches(String.class)); } - + protected void setUp() throws Exception { super.setUp(); needToSkip = needToSkipPointcutParserTests(); @@ -46,7 +46,7 @@ public class TypePatternMatcherTest extends TestCase { PointcutParser pp = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(this.getClass().getClassLoader()); tpm = pp.parseTypePattern("java.util.Map+"); } - - + + } diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/AbstractCacheBackingTestSupport.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/AbstractCacheBackingTestSupport.java index 3539ede2a..a9fdeae7a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/AbstractCacheBackingTestSupport.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/AbstractCacheBackingTestSupport.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * Lyor Goldstein (vmware) add support for weaved class being re-defined @@ -106,9 +106,9 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { throw new IllegalStateException("Unable to create cache dir",e); } - + // if ((targetFolder=detectTargetFolder(getClass())) == null) { -// +// //// throw new IllegalStateException("Failed to detect target folder"); // } } @@ -143,7 +143,7 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { public static final File detectTargetFolder (Class<?> anchor) { return detectTargetFolder(getClassContainerLocationFile(anchor)); } - + /** * @param anchorFile An anchor {@link File) we want to use * as the starting point for the "target" folder lookup up the @@ -155,7 +155,7 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { if (!file.isDirectory()) { continue; } - + String name=file.getName(); if ("target".equals(name) || "bin".equals(name) || "src".equals(name)) { File parent=file.getParentFile(); @@ -174,7 +174,7 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { * @throws IllegalArgumentException If location is not a valid * {@link File} location * @see #getClassContainerLocationURI(Class) - * @see File#File(URI) + * @see File#File(URI) */ public static File getClassContainerLocationFile (Class<?> clazz) throws IllegalArgumentException { @@ -215,7 +215,7 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { if ((url=cl.getResource(className)) == null) { return null; } - + String srcForm=getURLSource(url); if (LangUtil.isEmpty(srcForm)) { return null; @@ -242,13 +242,13 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { * If a non-<code>null</code> loader is returned from the * {@link Thread#getContextClassLoader()} call then use it. * </LI> - * + * * <LI> * Otherwise, use the same loader that was used to load the anchor class. * </LI> * </UL> * @throws IllegalArgumentException if no anchor class provided (regardless of - * whether it is used or not) + * whether it is used or not) */ public static ClassLoader getDefaultClassLoader(Class<?> anchor) { if (anchor == null) { @@ -267,7 +267,7 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { } return cl; - + } public static final String getURLSource (File file) { return getURLSource((file == null) ? null : file.toURI()); @@ -286,7 +286,7 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { public static final String getURLSource (URL url) { return getURLSource((url == null) ? null : url.toExternalForm()); } - + /** * @param externalForm The {@link URL#toExternalForm()} string - ignored if * <code>null</code>/empty @@ -303,7 +303,7 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { if (LangUtil.isEmpty(url)){ return url; } - + int sepPos=url.indexOf(RESOURCE_SUBPATH_SEPARATOR); if (sepPos < 0) { return adjustURLPathValue(url); @@ -338,8 +338,8 @@ public abstract class AbstractCacheBackingTestSupport extends TestCase { if (url.startsWith(JAR_URL_PREFIX)) { return url.substring(JAR_URL_PREFIX.length()); - } - + } + return url; } diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java index e8b0b4ecd..ee840149a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBackingTestSupport.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * Lyor Goldstein (vmware) add support for weaved class being re-defined @@ -46,7 +46,7 @@ public abstract class AsynchronousFileCacheBackingTestSupport public void setUp () throws Exception { super.setUp(); cleanupCache(); - + random.nextBytes(bytes); } @@ -55,7 +55,7 @@ public abstract class AsynchronousFileCacheBackingTestSupport cleanupCache(); super.tearDown(); } - + protected void cleanupCache() { if (indexFile != null) { if (FileUtil.deleteContents(indexFile) > 0) { @@ -89,7 +89,7 @@ public abstract class AsynchronousFileCacheBackingTestSupport File targetDir=detectTargetFolder(); cacheDir = new File(targetDir, "dir-" + String.valueOf(Math.random())); } - + return ensureFolderExists(cacheDir); } @@ -110,9 +110,9 @@ public abstract class AsynchronousFileCacheBackingTestSupport assertEquals("Mismatched index size", 0, indexMap.size()); // no data files were created - Map<String, byte[]> bytesMap=cache.getBytesMap(); + Map<String, byte[]> bytesMap=cache.getBytesMap(); assertEquals("Mismatched bytes size", 0, bytesMap.size()); - + writeIndex(cache.getIndexFile(), cache.getIndexEntries()); assertFalse("Index file still available: " + cacheIndex, cacheIndex.canRead()); @@ -163,12 +163,12 @@ public abstract class AsynchronousFileCacheBackingTestSupport if (LangUtil.isEmpty(dataBytes)) { return null; } - + File parent=getCacheDir(), file=new File(parent, key); OutputStream out=new FileOutputStream(file); try { out.write(dataBytes); - } finally { + } finally { out.close(); } @@ -190,7 +190,7 @@ public abstract class AsynchronousFileCacheBackingTestSupport entry.crcClass = AbstractCacheBacking.crc(originalBytes); entry.crcWeaved = AbstractCacheBacking.crc(bytes); } - + return entry; } } diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java index 1e240eee3..3a8f58d8b 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultFileCacheBackingTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultFileCacheBackingTest.java index 2d5ec0c77..2fea0af1b 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultFileCacheBackingTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultFileCacheBackingTest.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation @@ -142,7 +142,7 @@ public class DefaultFileCacheBackingTest extends AbstractCacheBackingTestSupport public void testOriginalClassBytesChanged () { DefaultFileCacheBacking backing = DefaultFileCacheBacking.createBacking(root); backing.put(new CachedClassEntry(fakeRef, FAKE_BYTES, CachedClassEntry.EntryType.WEAVED), FAKE_BYTES); - + CachedClassEntry entry = backing.get(fakeRef, FAKE_BYTES); assertNotNull("No initial entry", entry); @@ -153,7 +153,7 @@ public class DefaultFileCacheBackingTest extends AbstractCacheBackingTestSupport entry = backing.get(fakeRef, newBytes); assertNull("Unexpected modified bytes entry: " + entry, entry); - + File cachedFile = new File(root, fakeKey); assertFalse("Cache file not removed", cachedFile.exists()); } diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/FlatFileCacheBackingTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/FlatFileCacheBackingTest.java index 3271a1ffa..31b717ee1 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/FlatFileCacheBackingTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/FlatFileCacheBackingTest.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright (c) 2012 VMware, Inc. - * - * 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: * Lyor Goldstein *******************************************************************************/ diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/SimpleClassCacheTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/SimpleClassCacheTest.java index 68fac6913..c8cbc8245 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/SimpleClassCacheTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/SimpleClassCacheTest.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * Abraham Nevado (lucierna) initial implementation @@ -34,38 +34,38 @@ public class SimpleClassCacheTest extends TestCase { public void testCache() throws Exception { String classA = "com.generated.A"; SimpleCache cache = createCache(); - + cache.put(classA, FAKE_BYTES_V1, FAKE_WOVEN_BYTES_V1); - - + + // Test the returned woven bytes are the original one byte result[] = cache.getAndInitialize(classA, FAKE_BYTES_V1, null, null); for(int i = 0; i < result.length; i ++){ assertEquals("Cached version byte[" +i+"] should be equal to the original woven classe",result[i],FAKE_WOVEN_BYTES_V1[i]); } - + // Assure the class is properly backed up in the backing folder File f = new File (System.getProperty("java.io.tmpdir") + File.separator + "com.generated.A-1164760902"); assertTrue("Class should be backed up to backing folder, with te CRC:1164760902 ",f.exists()); } - + public void testDifferentVersionCache() throws Exception { String classA = "com.generated.A"; SimpleCache cache = createCache(); cache.put(classA, FAKE_BYTES_V1, FAKE_WOVEN_BYTES_V1); cache.put(classA, FAKE_BYTES_V2, FAKE_WOVEN_BYTES_V2); - + // Test the returned woven bytes are the original one for v1 byte result[] = cache.getAndInitialize(classA, FAKE_BYTES_V1, null, null); for(int i = 0; i < result.length; i ++){ assertEquals("Cached version v1 byte[" +i+"] should be equal to the original woven classe",result[i],FAKE_WOVEN_BYTES_V1[i]); } - + // Test the returned woven bytes are the original one for v2 result = cache.getAndInitialize(classA, FAKE_BYTES_V2, null, null); for(int i = 0; i < result.length; i ++){ assertEquals("Cached version v2 byte[" +i+"] should be equal to the original woven classe",result[i],FAKE_WOVEN_BYTES_V2[i]); } } -}
\ No newline at end of file +} diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java index 9d256d576..9d8224f72 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java @@ -2,9 +2,9 @@ * Copyright (c) 2012 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: * John Kew (vmware) initial implementation diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBackingTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBackingTest.java index eee9aa32b..9f3edaf32 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBackingTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/ZippedFileCacheBackingTest.java @@ -1,12 +1,12 @@ /** * Copyright (c) 2012 VMware, Inc. * - * 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: * Lyor Goldstein */ @@ -22,7 +22,7 @@ import org.aspectj.util.FileUtil; import org.aspectj.weaver.tools.cache.AbstractIndexedFileCacheBacking.IndexEntry; /** - * + * */ public class ZippedFileCacheBackingTest extends AsynchronousFileCacheBackingTestSupport { private File zipTestFile; @@ -57,13 +57,13 @@ public class ZippedFileCacheBackingTest extends AsynchronousFileCacheBackingTest Map<String, IndexEntry> indexMap=cache.getIndexMap(); assertEquals("Mismatched index size", entries.length, indexMap.size()); - Map<String, byte[]> bytesMap=cache.getBytesMap(); + Map<String, byte[]> bytesMap=cache.getBytesMap(); assertEquals("Mismatched bytes size", entriesMap.size() /* the ignored one has no file */, bytesMap.size()); - + for (IndexEntry entry : entries) { String key=entry.key; assertNotNull("Missing entry for key=" + key, indexMap.get(key)); - + if (entry.ignored) { assertNull("Unexpected bytes for ignored key=" + key, bytesMap.get(key)); } else { @@ -121,7 +121,7 @@ public class ZippedFileCacheBackingTest extends AsynchronousFileCacheBackingTest Map<String, IndexEntry> indexMap=cache.getIndexMap(); assertEquals("Mismatched index size", 1 /* only the ignored entry */, indexMap.size()); - Map<String, byte[]> bytesMap=cache.getBytesMap(); + Map<String, byte[]> bytesMap=cache.getBytesMap(); assertEquals("Non empty data bytes", 0, bytesMap.size()); assertFalse("Zip file not deleted: " + zipFile, zipFile.canRead()); } @@ -151,4 +151,4 @@ public class ZippedFileCacheBackingTest extends AsynchronousFileCacheBackingTest protected ZippedFileCacheBacking createFileBacking(File dir) { return new ZippedFileCacheBacking(dir); } -}
\ No newline at end of file +} diff --git a/weaver/src/test/java/reflect/tests/C.java b/weaver/src/test/java/reflect/tests/C.java index f52043b5a..19ad03055 100644 --- a/weaver/src/test/java/reflect/tests/C.java +++ b/weaver/src/test/java/reflect/tests/C.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 reflect.tests; @@ -20,9 +20,9 @@ public class C { public String foo(Object a) throws Exception { return null; } - + private void bar() {} - + public int f; private String s; } @@ -30,4 +30,4 @@ public class C { class D extends C implements java.io.Serializable { public int getNumberOfThingies() { return 0; } private Object o; -}
\ No newline at end of file +} diff --git a/weaver/src/test/java/test/A.java b/weaver/src/test/java/test/A.java index 12959cd51..8094341ce 100644 --- a/weaver/src/test/java/test/A.java +++ b/weaver/src/test/java/test/A.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ package test; @@ -16,7 +16,7 @@ public class A { public void b(@A1 String s) {} public void c(@A1 @A2 String s) {} public void d(@A1 String s,@A2 String t) {} - + public void e(A1AnnotatedType s) {} public void f(A2AnnotatedType s) {} public void g(@A2 A1AnnotatedType s) {} diff --git a/weaver/src/test/java/test/A1.java b/weaver/src/test/java/test/A1.java index 616708345..32aa90219 100644 --- a/weaver/src/test/java/test/A1.java +++ b/weaver/src/test/java/test/A1.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ package test; diff --git a/weaver/src/test/java/test/A1AnnotatedType.java b/weaver/src/test/java/test/A1AnnotatedType.java index e40addbf5..2f1843775 100644 --- a/weaver/src/test/java/test/A1AnnotatedType.java +++ b/weaver/src/test/java/test/A1AnnotatedType.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ package test; diff --git a/weaver/src/test/java/test/A2.java b/weaver/src/test/java/test/A2.java index 48749a3d4..1151980b2 100644 --- a/weaver/src/test/java/test/A2.java +++ b/weaver/src/test/java/test/A2.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ package test; diff --git a/weaver/src/test/java/test/A2AnnotatedType.java b/weaver/src/test/java/test/A2AnnotatedType.java index 0fa3b5c8a..f0f08bbdd 100644 --- a/weaver/src/test/java/test/A2AnnotatedType.java +++ b/weaver/src/test/java/test/A2AnnotatedType.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ package test; diff --git a/weaver/src/test/java/test/A3.java b/weaver/src/test/java/test/A3.java index 71678c531..49c430b02 100644 --- a/weaver/src/test/java/test/A3.java +++ b/weaver/src/test/java/test/A3.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ package test; diff --git a/weaver/src/test/java/test/AnnoValues.java b/weaver/src/test/java/test/AnnoValues.java index 08301d1a0..e34523072 100644 --- a/weaver/src/test/java/test/AnnoValues.java +++ b/weaver/src/test/java/test/AnnoValues.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ package test; @@ -16,5 +16,5 @@ public class AnnoValues { @A3 public void defaultMethod() {} @A3(Color.GREEN) public void greenMethod() {} @A3(Color.RED) public void redMethod() {} - @A3(Color.BLUE) public void blueMethod() {} + @A3(Color.BLUE) public void blueMethod() {} } diff --git a/weaver/src/test/java/test/Color.java b/weaver/src/test/java/test/Color.java index dea2593ac..5a74374e6 100644 --- a/weaver/src/test/java/test/Color.java +++ b/weaver/src/test/java/test/Color.java @@ -1,14 +1,14 @@ package test; /* ******************************************************************* * 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://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 + * Andy Clement * ******************************************************************/ -public enum Color { RED, GREEN, BLUE }
\ No newline at end of file +public enum Color { RED, GREEN, BLUE } diff --git a/weaver/testinputdata/org/aspectj/weaver/test/DynamicHelloWorld.java b/weaver/testinputdata/org/aspectj/weaver/test/DynamicHelloWorld.java index 62a2affb5..71e30683d 100644 --- a/weaver/testinputdata/org/aspectj/weaver/test/DynamicHelloWorld.java +++ b/weaver/testinputdata/org/aspectj/weaver/test/DynamicHelloWorld.java @@ -1,12 +1,12 @@ /* Copyright (c) 2002 Contributors. - * - * 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 + * + * 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.weaver.test; @@ -32,7 +32,7 @@ public class DynamicHelloWorld implements Serializable { } throw new RuntimeException("should have caught exception"); } - + String doit(String s, List l) { l.add(s); // this will throw an exception return l.toString(); diff --git a/weaver/testinputdata/org/aspectj/weaver/test/FancyHelloWorld.java b/weaver/testinputdata/org/aspectj/weaver/test/FancyHelloWorld.java index 0ad272d40..3eb97e7c4 100644 --- a/weaver/testinputdata/org/aspectj/weaver/test/FancyHelloWorld.java +++ b/weaver/testinputdata/org/aspectj/weaver/test/FancyHelloWorld.java @@ -1,12 +1,12 @@ /* Copyright (c) 2002 Contributors. - * - * 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 + * + * 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.weaver.test; @@ -27,7 +27,7 @@ public abstract class FancyHelloWorld { out.println("finally"); } } - + public static String getName() { int x = 0; x += "name".hashCode(); diff --git a/weaver/testinputdata/org/aspectj/weaver/test/FieldyHelloWorld.java b/weaver/testinputdata/org/aspectj/weaver/test/FieldyHelloWorld.java index 57686a84c..8106baef6 100644 --- a/weaver/testinputdata/org/aspectj/weaver/test/FieldyHelloWorld.java +++ b/weaver/testinputdata/org/aspectj/weaver/test/FieldyHelloWorld.java @@ -1,12 +1,12 @@ /* Copyright (c) 2002 Contributors. - * - * 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 + * + * 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.weaver.test; @@ -16,7 +16,7 @@ public class FieldyHelloWorld { public static void main(String[] args) { str += " World"; - - System.out.println(str); + + System.out.println(str); } } diff --git a/weaver/testinputdata/org/aspectj/weaver/test/HelloWorld.java b/weaver/testinputdata/org/aspectj/weaver/test/HelloWorld.java index 1424b269a..44a0e9c09 100644 --- a/weaver/testinputdata/org/aspectj/weaver/test/HelloWorld.java +++ b/weaver/testinputdata/org/aspectj/weaver/test/HelloWorld.java @@ -1,12 +1,12 @@ /* Copyright (c) 2002 Contributors. - * - * 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 + * + * 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.weaver.test; @@ -18,7 +18,7 @@ public class HelloWorld { public static void main(String[] args) { System.out - .println("hello world"); + .println("hello world"); //System.out.println("hello world"); } } diff --git a/weaver/testinputdata/org/aspectj/weaver/test/MultiArgHelloWorld.java b/weaver/testinputdata/org/aspectj/weaver/test/MultiArgHelloWorld.java index d83701f8e..4b3e7382c 100644 --- a/weaver/testinputdata/org/aspectj/weaver/test/MultiArgHelloWorld.java +++ b/weaver/testinputdata/org/aspectj/weaver/test/MultiArgHelloWorld.java @@ -1,12 +1,12 @@ /* Copyright (c) 2002 Contributors. - * - * 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 + * + * 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.weaver.test; @@ -15,7 +15,7 @@ public class MultiArgHelloWorld { public static void main(String[] args) { foo("Hello", "World"); } - + static void foo(Object s, Object t) { System.out.println(s + " " + t); } diff --git a/weaver/testinputdata/org/aspectj/weaver/test/Test.java b/weaver/testinputdata/org/aspectj/weaver/test/Test.java index 50ca00bac..b2b2a7463 100644 --- a/weaver/testinputdata/org/aspectj/weaver/test/Test.java +++ b/weaver/testinputdata/org/aspectj/weaver/test/Test.java @@ -1,12 +1,12 @@ /* Copyright (c) 2002 Contributors. - * - * 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 + * + * 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.weaver.test; diff --git a/weaver/testinputdata/org/aspectj/weaver/test/TestSwitchy.java b/weaver/testinputdata/org/aspectj/weaver/test/TestSwitchy.java index 72f539b72..86ae00159 100644 --- a/weaver/testinputdata/org/aspectj/weaver/test/TestSwitchy.java +++ b/weaver/testinputdata/org/aspectj/weaver/test/TestSwitchy.java @@ -1,12 +1,12 @@ /* Copyright (c) 2002 Contributors. - * - * 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 + * + * 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.weaver.test; @@ -22,10 +22,10 @@ public abstract class TestSwitchy { public int i = 3; - + public static final int j = 4; - - + + public static void main(String[] args) { switch (args.length) { case 0: System.err.println("hi"); @@ -35,9 +35,9 @@ public abstract class TestSwitchy { } System.err.println("done"); } - - + + abstract int goo(); - - void nimbo() {} + + void nimbo() {} } |