diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-06-04 07:58:52 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-06-04 07:58:52 +0700 |
commit | 49cb924f5402c9d24379ae1af62def6fa5892649 (patch) | |
tree | 69844405209043e2e18aa9eef0f01f287bc1ae52 /org.aspectj.lib | |
parent | 82df3f0fc9842758f15f12299c9113e48f1ccb5c (diff) | |
download | aspectj-49cb924f5402c9d24379ae1af62def6fa5892649.tar.gz aspectj-49cb924f5402c9d24379ae1af62def6fa5892649.zip |
Upgrade license from CPLv1/EPLv1 to EPLv2
This was required by the Eclipse team as one precondition for the next
release.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'org.aspectj.lib')
9 files changed, 159 insertions, 161 deletions
diff --git a/org.aspectj.lib/build-aspectjlib.xml b/org.aspectj.lib/build-aspectjlib.xml index f35a25b9a..a35d448f3 100644 --- a/org.aspectj.lib/build-aspectjlib.xml +++ b/org.aspectj.lib/build-aspectjlib.xml @@ -1,16 +1,16 @@ <!-- wrapped at 70 characters, long elements wrapped --> -<!-- =========================================================================== +<!-- =========================================================================== Copyright (c) 2005 Contributors. - All rights reserved. - This program and the accompanying materials are made available - under the terms of the Eclipse Public License v1.0 - which accompanies this distribution and is available at - http://eclipse.org/legal/epl-v10.html - - Contributors: - Wes Isberg initial implementation - + All rights reserved. + This program and the accompanying materials are made available + under the terms of the Eclipse Public License v 2.0 + which accompanies this distribution and is available at + https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + + Contributors: + Wes Isberg initial implementation + ============================================================================ --> <project name="aspectj-library" default="aspectjlib" basedir="."> @@ -18,7 +18,7 @@ <target name="aspectjlib" depends="compile" /> <target name="info"> <echo> - This script builds the AspectJ library. + This script builds the AspectJ library. Relevant targets: aspectjlib build library @@ -29,7 +29,7 @@ Variants: - To define a variable, use the Ant -D option - e.g., on Windows: - + ant -f build.xml -DJAVA_HOME=c:\jdk1.3.1 -Dnorun=skip </echo> @@ -111,7 +111,7 @@ </target> <target name="init.taskdefs" - depends="init.variables, + depends="init.variables, aspectjtools.jar.available, aspectjrt.jar.available" unless="taskdefs.init" diff --git a/org.aspectj.lib/src/main/java/org/aspectj/lib/pointcuts/Pointcuts.java b/org.aspectj.lib/src/main/java/org/aspectj/lib/pointcuts/Pointcuts.java index fd96bf908..1c69912a5 100644 --- a/org.aspectj.lib/src/main/java/org/aspectj/lib/pointcuts/Pointcuts.java +++ b/org.aspectj.lib/src/main/java/org/aspectj/lib/pointcuts/Pointcuts.java @@ -1,16 +1,16 @@ /* ******************************************************************* * Copyright (c) 2003-2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Common Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ -// START-SAMPLE library-pointcutIdioms Standard pointcut idioms +// START-SAMPLE library-pointcutIdioms Standard pointcut idioms package org.aspectj.lib.pointcuts; import java.util.Collection; @@ -19,7 +19,7 @@ import java.io.PrintStream; /** * Library of pointcut idioms to use in combination with * other pointcuts. - * + * * @author Wes Isberg */ public final class Pointcuts { @@ -36,56 +36,56 @@ public final class Pointcuts { public pointcut mainExecution() : execution(public static void main(String[])); - + /** staticly-determinable to never match any join point */ public pointcut never(); - + public pointcut afterAdviceSupported() : !handler(*); public pointcut aroundAdviceSupported() : !handler(*) && !initialization(new(..)) && !preinitialization(new(..)); - public pointcut anyMethodExecution() : + public pointcut anyMethodExecution() : execution(* *(..)); - public pointcut anyPublicMethodExecution() : + public pointcut anyPublicMethodExecution() : execution(public * *(..)); - public pointcut anyPackageProtectedMethodExecution() : + public pointcut anyPackageProtectedMethodExecution() : execution(!private !public !protected * *(..)); - public pointcut anyNonPrivateMethodExecution() : + public pointcut anyNonPrivateMethodExecution() : execution(!private * *(..)); - public pointcut anyConstructorExecution() : + public pointcut anyConstructorExecution() : execution(new(..)); - public pointcut anyPublicConstructorExecution() : + public pointcut anyPublicConstructorExecution() : execution(public new(..)); public pointcut anyNonPrivateConstructorExecution() : execution(!private new(..)); - public pointcut anyPublicFieldGet() : + public pointcut anyPublicFieldGet() : get(public * *); - public pointcut anyNonPrivateFieldGet() : + public pointcut anyNonPrivateFieldGet() : get(!private * *); - public pointcut anyPublicFieldSet() : + public pointcut anyPublicFieldSet() : set(public * *); - public pointcut anyNonPrivateFieldSet() : + public pointcut anyNonPrivateFieldSet() : set(!private * *); // also !transient? public pointcut withinSetter() : // require !static? withincode(void set*(*)); // use any return type? multiple parms? - public pointcut withinGetter() : + public pointcut withinGetter() : withincode(!void get*()); // permit parms? require !static? - - public pointcut anyNonPublicFieldSetOutsideConstructorOrSetter() : - set(!public * *) && !withincode(new(..)) + + public pointcut anyNonPublicFieldSetOutsideConstructorOrSetter() : + set(!public * *) && !withincode(new(..)) && !withinSetter(); public pointcut anyRunnableImplementation() : @@ -96,7 +96,7 @@ public final class Pointcuts { public pointcut anySetSystemErrOut() : call(void System.setOut(..)) || call(void System.setErr(..)); - + public pointcut withinAnyJavaCode() : within(java..*) || within(javax..*); @@ -110,15 +110,15 @@ public final class Pointcuts { public pointcut anyThreadConstruction() : call(Thread+.new(..)) || execution(Thread+.new(..)); - /** - * Any calls to java.io classes + /** + * Any calls to java.io classes * (but not methods declared only on their subclasses). */ public pointcut anyJavaIOCalls() : call(* java.io..*.*(..)) || call(java.io..*.new(..)); - /** - * Any calls to java.awt or javax.swing methods or constructors + /** + * Any calls to java.awt or javax.swing methods or constructors * (but not methods declared only on their subclasses). */ public pointcut anyJavaAWTOrSwingCalls() : @@ -127,10 +127,10 @@ public final class Pointcuts { public pointcut cloneImplementationsInNonCloneable() : execution(Object !Cloneable+.clone()); - + public pointcut runImplementationsInNonRunnable() : execution(void !Runnable+.run()); - + /** any calls to java.lang.reflect or Class.get* (except getName()) */ public pointcut anySystemReflectiveCalls() : call(* java.lang.reflect..*.*(..)) @@ -154,13 +154,13 @@ public final class Pointcuts { * an Iterator can remove elements. */ public pointcut anyCollectionWriteCalls() : - call(boolean Collection+.add(Object)) - || call(boolean Collection+.addAll(Collection)) + call(boolean Collection+.add(Object)) + || call(boolean Collection+.addAll(Collection)) || call(void Collection+.clear()) || call(boolean Collection+.remove(Object)) || call(boolean Collection+.removeAll(Collection)) || call(boolean Collection+.retainAll(Collection)); - + public pointcut mostThrowableReadCalls() : call(* Throwable+.get*(..)) || call(* Throwable+.print*(..)) @@ -169,14 +169,14 @@ public final class Pointcuts { public pointcut exceptionWrappingCalls() : (args(Throwable+,..) || args(.., Throwable+)) && (set(Throwable+ Throwable+.*) - || (call(* Throwable+.*(..)) + || (call(* Throwable+.*(..)) || call(Throwable+.new(..)))); public pointcut anyCodeThrowingException() : execution(* *(..) throws Exception+) || execution(new(..) throws Exception+); - - private Pointcuts() {} + + private Pointcuts() {} } //END-SAMPLE library-pointcutIdioms diff --git a/org.aspectj.lib/src/main/java/org/aspectj/lib/tracing/TraceJoinPoints.java b/org.aspectj.lib/src/main/java/org/aspectj/lib/tracing/TraceJoinPoints.java index 6d6f592df..a2cf4ffd3 100644 --- a/org.aspectj.lib/src/main/java/org/aspectj/lib/tracing/TraceJoinPoints.java +++ b/org.aspectj.lib/src/main/java/org/aspectj/lib/tracing/TraceJoinPoints.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ // START-SAMPLE tracing-traceJoinPoints Trace join points executed to log @@ -23,11 +23,11 @@ import java.io.*; * To use this, define the abstract pointcuts in a subaspect. * @author Jim Hugunin, Wes Isberg */ -public abstract aspect TraceJoinPoints +public abstract aspect TraceJoinPoints extends TraceJoinPointsBase { // abstract protected pointcut entry(); - + PrintStream out; int logs = 0; int depth = 0; @@ -45,11 +45,11 @@ public abstract aspect TraceJoinPoints protected void startLog() { makeLogStream(); } - + protected void completeLog() { closeLogStream(); } - + protected void logEnter(JoinPoint.StaticPart jp) { if (terminal) out.println(">"); indent(depth); @@ -60,7 +60,7 @@ public abstract aspect TraceJoinPoints depth += 1; terminal = true; } - + protected void logExit(JoinPoint.StaticPart jp) { depth -= 1; if (terminal) { @@ -71,7 +71,7 @@ public abstract aspect TraceJoinPoints } terminal = false; } - + protected PrintStream getOut() { if (null == out) { String m = "not in the control flow of entry()"; @@ -99,9 +99,9 @@ public abstract aspect TraceJoinPoints /** @return input String formatted for XML */ protected String prepareMessage(String s) { // XXX unimplemented - return s; - } - + return s; + } + void message(String sink, String s) { if (null == sink) { message(s); @@ -110,7 +110,7 @@ public abstract aspect TraceJoinPoints + " >" + prepareMessage(s) + "</message>"); } } - + void writeSig(JoinPoint.StaticPart jp) { PrintStream out = getOut(); out.print(" sig="); @@ -137,6 +137,5 @@ public abstract aspect TraceJoinPoints while (i-- > 0) out.print(" "); } } -// END-SAMPLE tracing-traceJoinPoints +// END-SAMPLE tracing-traceJoinPoints -
\ No newline at end of file diff --git a/org.aspectj.lib/src/main/java/org/aspectj/lib/tracing/TraceJoinPointsBase.java b/org.aspectj.lib/src/main/java/org/aspectj/lib/tracing/TraceJoinPointsBase.java index 989c298e7..3a9630d8a 100644 --- a/org.aspectj.lib/src/main/java/org/aspectj/lib/tracing/TraceJoinPointsBase.java +++ b/org.aspectj.lib/src/main/java/org/aspectj/lib/tracing/TraceJoinPointsBase.java @@ -1,16 +1,16 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ -// START-SAMPLE tracing-traceJoinPoints Trace join points executed +// START-SAMPLE tracing-traceJoinPoints Trace join points executed package org.aspectj.lib.tracing; @@ -36,7 +36,7 @@ abstract aspect TraceJoinPointsBase { final pointcut start(): withinScope() && entry() && !cflowbelow(entry()); - final pointcut trace(): withinScope() && cflow(entry()) + final pointcut trace(): withinScope() && cflow(entry()) && !cflowbelow(exit()) && !within(TraceJoinPointsBase+); private pointcut supportsAfterAdvice() : !handler(*) @@ -44,27 +44,26 @@ abstract aspect TraceJoinPointsBase { before(): start() { startLog(); } - before(): trace() && supportsAfterAdvice(){ - logEnter(thisJoinPointStaticPart); + before(): trace() && supportsAfterAdvice(){ + logEnter(thisJoinPointStaticPart); } - after(): trace() && supportsAfterAdvice() { - logExit(thisJoinPointStaticPart); + after(): trace() && supportsAfterAdvice() { + logExit(thisJoinPointStaticPart); } after(): start() { completeLog(); } - + abstract protected void logEnter(JoinPoint.StaticPart jp); abstract protected void logExit(JoinPoint.StaticPart jp); - + /** called before any logging */ abstract protected void startLog(); - + /** called after any logging */ abstract protected void completeLog(); } -// END-SAMPLE tracing-traceJoinPoints +// END-SAMPLE tracing-traceJoinPoints -
\ No newline at end of file diff --git a/org.aspectj.lib/src/test/java/org/aspectj/lib/LibModuleTests.java b/org.aspectj.lib/src/test/java/org/aspectj/lib/LibModuleTests.java index 6a666b2c1..0f03a7683 100644 --- a/org.aspectj.lib/src/test/java/org/aspectj/lib/LibModuleTests.java +++ b/org.aspectj.lib/src/test/java/org/aspectj/lib/LibModuleTests.java @@ -1,14 +1,14 @@ package org.aspectj.lib; /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ // default package @@ -19,11 +19,11 @@ import junit.framework.TestSuite; public class LibModuleTests extends TestCase { - public static Test suite() { + public static Test suite() { TestSuite suite = new TestSuite(LibModuleTests.class.getName()); - suite.addTest(org.aspectj.lib.pointcuts.PointcutsTests.suite()); - suite.addTest(org.aspectj.lib.tracing.TracingTests.suite()); + suite.addTest(org.aspectj.lib.pointcuts.PointcutsTests.suite()); + suite.addTest(org.aspectj.lib.tracing.TracingTests.suite()); return suite; } -} +} diff --git a/org.aspectj.lib/src/test/java/org/aspectj/lib/pointcuts/PointcutsTest.java b/org.aspectj.lib/src/test/java/org/aspectj/lib/pointcuts/PointcutsTest.java index 7cc082a51..ebc441f97 100644 --- a/org.aspectj.lib/src/test/java/org/aspectj/lib/pointcuts/PointcutsTest.java +++ b/org.aspectj.lib/src/test/java/org/aspectj/lib/pointcuts/PointcutsTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ package org.aspectj.lib.pointcuts; @@ -15,7 +15,7 @@ package org.aspectj.lib.pointcuts; import junit.framework.TestCase; /** - * + * */ public class PointcutsTest extends TestCase { @@ -27,34 +27,34 @@ public class PointcutsTest extends TestCase { // ok, advice worked } } - + private static aspect Test_anyPublicMethodExecution { public static void error() { throw new RuntimeException("wrong exception"); } - + static void nonpublic() {} - - before() : - execution(static void Test_anyPublicMethodExecution.error()) + + before() : + execution(static void Test_anyPublicMethodExecution.error()) && Pointcuts.anyPublicMethodExecution() { throw new Error(""); } - - declare error : - execution(static void Test_anyPublicMethodExecution.nonpublic()) - && Pointcuts.anyPublicMethodExecution() + + declare error : + execution(static void Test_anyPublicMethodExecution.nonpublic()) + && Pointcuts.anyPublicMethodExecution() : "anyPublicMethodExecution failed - not public"; - + } private static aspect compileChecks { /** balk if Pointcuts has code - s.b. only pointcuts */ - declare error : within(Pointcuts) && - (set(* *) || Pointcuts.anyMethodExecution() || + declare error : within(Pointcuts) && + (set(* *) || Pointcuts.anyMethodExecution() || (Pointcuts.anyConstructorExecution() && !execution(private Pointcuts.new()))) : "only pointcuts permitted in Pointcuts"; - + } } diff --git a/org.aspectj.lib/src/test/java/org/aspectj/lib/pointcuts/PointcutsTests.java b/org.aspectj.lib/src/test/java/org/aspectj/lib/pointcuts/PointcutsTests.java index 3844804fb..59a86fc33 100644 --- a/org.aspectj.lib/src/test/java/org/aspectj/lib/pointcuts/PointcutsTests.java +++ b/org.aspectj.lib/src/test/java/org/aspectj/lib/pointcuts/PointcutsTests.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ package org.aspectj.lib.pointcuts; @@ -18,14 +18,14 @@ import junit.framework.TestSuite; public class PointcutsTests extends TestCase { - public static Test suite() { + public static Test suite() { TestSuite suite = new TestSuite(PointcutsTests.class.getName()); //$JUnit-BEGIN$ - suite.addTestSuite(PointcutsTest.class); + suite.addTestSuite(PointcutsTest.class); //$JUnit-END$ return suite; } public PointcutsTests(String name) { super(name); } -} +} diff --git a/org.aspectj.lib/src/test/java/org/aspectj/lib/tracing/TraceJoinPointsTest.java b/org.aspectj.lib/src/test/java/org/aspectj/lib/tracing/TraceJoinPointsTest.java index 75b27d472..fa4539255 100644 --- a/org.aspectj.lib/src/test/java/org/aspectj/lib/tracing/TraceJoinPointsTest.java +++ b/org.aspectj.lib/src/test/java/org/aspectj/lib/tracing/TraceJoinPointsTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ @@ -18,7 +18,7 @@ import junit.framework.TestCase; import org.aspectj.lang.JoinPoint.StaticPart; /** - * + * */ public class TraceJoinPointsTest extends TestCase { @@ -30,7 +30,7 @@ public class TraceJoinPointsTest extends TestCase { } static final int NUMJP = 1; - + static void checkTjp() { // NUMJP: only 1 join point long l = System.currentTimeMillis(); @@ -38,13 +38,13 @@ public class TraceJoinPointsTest extends TestCase { /** poor design/test */ static aspect TestTJP extends TraceJoinPoints { - + protected pointcut withinScope() : within(TraceJoinPointsTest) && !within(TestTJP); pointcut traceJoinPoints() : execution(static void TraceJoinPointsTest.testTraceJoinPoints()); - protected pointcut entry() : + protected pointcut entry() : execution(static void TraceJoinPointsTest.checkTjp()); boolean checked; @@ -59,7 +59,7 @@ public class TraceJoinPointsTest extends TestCase { protected void logExit(StaticPart jp) { logExit++; } - + protected void startLog() { startLog = 0; completeLog = 0; @@ -67,7 +67,7 @@ public class TraceJoinPointsTest extends TestCase { logExit = 0; startLog++; } - + protected void completeLog() { completeLog++; } diff --git a/org.aspectj.lib/src/test/java/org/aspectj/lib/tracing/TracingTests.java b/org.aspectj.lib/src/test/java/org/aspectj/lib/tracing/TracingTests.java index 9f4daafe0..b94109783 100644 --- a/org.aspectj.lib/src/test/java/org/aspectj/lib/tracing/TracingTests.java +++ b/org.aspectj.lib/src/test/java/org/aspectj/lib/tracing/TracingTests.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Wes Isberg initial implementation * ******************************************************************/ package org.aspectj.lib.tracing; @@ -18,12 +18,12 @@ import junit.framework.TestSuite; public class TracingTests extends TestCase { - public static Test suite() { + public static Test suite() { TestSuite suite = new TestSuite(TracingTests.class.getName()); //$JUnit-BEGIN$ - suite.addTestSuite(TraceJoinPointsTest.class); + suite.addTestSuite(TraceJoinPointsTest.class); //$JUnit-END$ return suite; } -} +} |