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 /util | |
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 'util')
15 files changed, 131 insertions, 131 deletions
diff --git a/util/src/main/java/org/aspectj/util/FileUtil.java b/util/src/main/java/org/aspectj/util/FileUtil.java index d6bf5b0a6..cf798617d 100644 --- a/util/src/main/java/org/aspectj/util/FileUtil.java +++ b/util/src/main/java/org/aspectj/util/FileUtil.java @@ -3,9 +3,9 @@ * 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation @@ -1142,7 +1142,7 @@ public class FileUtil { r.close(); return b.toString(); } - + public static List<String> readAsLines(File file) { try { return Files.readAllLines(Paths.get(file.toURI())); diff --git a/util/src/main/java/org/aspectj/util/FuzzyBoolean.java b/util/src/main/java/org/aspectj/util/FuzzyBoolean.java index 807d98087..41a63b833 100644 --- a/util/src/main/java/org/aspectj/util/FuzzyBoolean.java +++ b/util/src/main/java/org/aspectj/util/FuzzyBoolean.java @@ -1,18 +1,18 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.util; -/** +/** * This class implements boolean that include a "maybe" */ public abstract class FuzzyBoolean { @@ -20,11 +20,11 @@ public abstract class FuzzyBoolean { public abstract boolean alwaysFalse(); public abstract boolean maybeTrue(); public abstract boolean maybeFalse(); - + public abstract FuzzyBoolean and(FuzzyBoolean other); public abstract FuzzyBoolean or(FuzzyBoolean other); public abstract FuzzyBoolean not(); - + private static class YesFuzzyBoolean extends FuzzyBoolean { public boolean alwaysFalse() { return false; @@ -41,7 +41,7 @@ public abstract class FuzzyBoolean { public boolean maybeTrue() { return true; } - + public FuzzyBoolean and(FuzzyBoolean other) { return other; } @@ -57,7 +57,7 @@ public abstract class FuzzyBoolean { public String toString() { return "YES"; } - } + } private static class NoFuzzyBoolean extends FuzzyBoolean { public boolean alwaysFalse() { return true; @@ -75,7 +75,7 @@ public abstract class FuzzyBoolean { public boolean maybeTrue() { return false; } - + public FuzzyBoolean and(FuzzyBoolean other) { return this; } @@ -109,7 +109,7 @@ public abstract class FuzzyBoolean { public boolean maybeTrue() { return false; } - + public FuzzyBoolean and(FuzzyBoolean other) { return this; } @@ -126,7 +126,7 @@ public abstract class FuzzyBoolean { return "NEVER"; } } - + private static class MaybeFuzzyBoolean extends FuzzyBoolean { public boolean alwaysFalse() { return false; @@ -144,7 +144,7 @@ public abstract class FuzzyBoolean { public boolean maybeTrue() { return true; } - + public FuzzyBoolean and(FuzzyBoolean other) { return other.alwaysFalse() ? other : this; } @@ -161,7 +161,7 @@ public abstract class FuzzyBoolean { return "MAYBE"; } } - + public static final FuzzyBoolean YES = new YesFuzzyBoolean(); public static final FuzzyBoolean NO = new NoFuzzyBoolean(); public static final FuzzyBoolean MAYBE = new MaybeFuzzyBoolean(); diff --git a/util/src/main/java/org/aspectj/util/GenericSignature.java b/util/src/main/java/org/aspectj/util/GenericSignature.java index 5fa7ac632..f128ba4a5 100644 --- a/util/src/main/java/org/aspectj/util/GenericSignature.java +++ b/util/src/main/java/org/aspectj/util/GenericSignature.java @@ -1,18 +1,18 @@ /* ******************************************************************* - * 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.util; /** * Encapsulate generic signature parsing - * + * * @author Adrian Colyer * @author Andy Clement */ diff --git a/util/src/main/java/org/aspectj/util/GenericSignatureParser.java b/util/src/main/java/org/aspectj/util/GenericSignatureParser.java index 3e1e0e7b3..ba45ecc99 100644 --- a/util/src/main/java/org/aspectj/util/GenericSignatureParser.java +++ b/util/src/main/java/org/aspectj/util/GenericSignatureParser.java @@ -1,11 +1,11 @@ /* ******************************************************************* * 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://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.util; @@ -25,7 +25,7 @@ import org.aspectj.util.GenericSignature.TypeVariableSignature; /** * Parses the generic signature attribute as defined in the JVM spec. - * + * * @author Adrian Colyer * @author Andy Clement */ diff --git a/util/src/main/java/org/aspectj/util/IStructureModel.java b/util/src/main/java/org/aspectj/util/IStructureModel.java index 9008f0872..578a1839e 100644 --- a/util/src/main/java/org/aspectj/util/IStructureModel.java +++ b/util/src/main/java/org/aspectj/util/IStructureModel.java @@ -1,19 +1,19 @@ /* ******************************************************************* * 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.util; /** * Abstraction of a structure model - * + * * @author Andy Clement */ public interface IStructureModel { diff --git a/util/src/main/java/org/aspectj/util/LangUtil.java b/util/src/main/java/org/aspectj/util/LangUtil.java index 8128174aa..c53d18989 100644 --- a/util/src/main/java/org/aspectj/util/LangUtil.java +++ b/util/src/main/java/org/aspectj/util/LangUtil.java @@ -4,9 +4,9 @@ * 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: * Xerox/PARC initial implementation diff --git a/util/src/main/java/org/aspectj/util/PartialOrder.java b/util/src/main/java/org/aspectj/util/PartialOrder.java index 936bf79ed..f787a6645 100644 --- a/util/src/main/java/org/aspectj/util/PartialOrder.java +++ b/util/src/main/java/org/aspectj/util/PartialOrder.java @@ -3,9 +3,9 @@ * 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/util/src/main/java/org/aspectj/util/Reflection.java b/util/src/main/java/org/aspectj/util/Reflection.java index 614bb4b76..4a69c9273 100644 --- a/util/src/main/java/org/aspectj/util/Reflection.java +++ b/util/src/main/java/org/aspectj/util/Reflection.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: - * Xerox/PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -21,11 +21,11 @@ import java.util.ArrayList; //import java.util.StringTokenizer; public class Reflection { - public static final Class<?>[] MAIN_PARM_TYPES = new Class[] {String[].class}; + public static final Class<?>[] MAIN_PARM_TYPES = new Class[] {String[].class}; private Reflection() { } - + public static Object invokestaticN(Class<?> class_, String name, Object[] args) { return invokeN(class_, name, null, args); } @@ -33,18 +33,18 @@ public class Reflection { public static Object invoke(Class<?> class_, Object target, String name, Object arg1, Object arg2) { return invokeN(class_, name, target, new Object[] { arg1, arg2 }); } - + public static Object invoke(Class<?> class_, Object target, String name, Object arg1, Object arg2, Object arg3) { return invokeN(class_, name, target, new Object[] { arg1, arg2, arg3 }); } - - + + public static Object invokeN(Class<?> class_, String name, Object target, Object[] args) { Method meth = getMatchingMethod(class_, name, args); try { return meth.invoke(target, args); } catch (IllegalAccessException e) { - throw new RuntimeException(e.toString()); + throw new RuntimeException(e.toString()); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t instanceof Error) throw (Error)t; @@ -71,7 +71,7 @@ public class Reflection { } - + public static Object getStaticField(Class<?> class_, String name) { try { @@ -85,16 +85,16 @@ public class Reflection { public static void runMainInSameVM( String classpath, - String className, - String[] args) - throws SecurityException, NoSuchMethodException, - IllegalArgumentException, IllegalAccessException, + String className, + String[] args) + throws SecurityException, NoSuchMethodException, + IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException { LangUtil.throwIaxIfNull(className, "class name"); if (LangUtil.isEmpty(classpath)) { Class<?> mainClass = Class.forName(className); runMainInSameVM(mainClass, args); - return; + return; } ArrayList<File> dirs = new ArrayList<>(); ArrayList<File> libs = new ArrayList<>(); @@ -123,15 +123,15 @@ public class Reflection { URL[] urlRa = (URL[]) urls.toArray(new URL[0]); runMainInSameVM(urlRa, libRa, dirRa, className, args); } - + public static void runMainInSameVM( URL[] urls, - File[] libs, - File[] dirs, - String className, - String[] args) - throws SecurityException, NoSuchMethodException, - IllegalArgumentException, IllegalAccessException, + File[] libs, + File[] dirs, + String className, + String[] args) + throws SecurityException, NoSuchMethodException, + IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException { LangUtil.throwIaxIfNull(className, "class name"); LangUtil.throwIaxIfNotAssignable(libs, File.class, "jars"); @@ -153,13 +153,13 @@ public class Reflection { targetClass = loader.loadClass(className); } catch (ClassNotFoundException e) { String s = "unable to load class " + className - + " using class loader " + loader; + + " using class loader " + loader; throw new ClassNotFoundException(s); } Method main = targetClass.getMethod("main", MAIN_PARM_TYPES); main.invoke(null, new Object[] { args }); } - + public static void runMainInSameVM(Class<?> mainClass, String[] args) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { LangUtil.throwIaxIfNull(mainClass, "main class"); Method main = mainClass.getMethod("main", MAIN_PARM_TYPES); @@ -169,7 +169,7 @@ public class Reflection { /** @return URL if the input is valid as such */ private static URL makeURL(String s) { try { - return new URL(s); + return new URL(s); } catch (Throwable t) { return null; } diff --git a/util/src/main/java/org/aspectj/util/SoftHashMap.java b/util/src/main/java/org/aspectj/util/SoftHashMap.java index 8af2e6304..e4a20ef81 100644 --- a/util/src/main/java/org/aspectj/util/SoftHashMap.java +++ b/util/src/main/java/org/aspectj/util/SoftHashMap.java @@ -1,10 +1,10 @@ /* ******************************************************************* * 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 - * 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.util; import java.lang.ref.ReferenceQueue; @@ -21,7 +21,7 @@ public class SoftHashMap<K,V> extends AbstractMap<K,V> { public SoftHashMap() { this.map = new HashMap<>(); } - + class SpecialValue extends SoftReference<V> { private final K key; diff --git a/util/src/main/java/org/aspectj/util/TypeSafeEnum.java b/util/src/main/java/org/aspectj/util/TypeSafeEnum.java index aba78b117..760c2ef67 100644 --- a/util/src/main/java/org/aspectj/util/TypeSafeEnum.java +++ b/util/src/main/java/org/aspectj/util/TypeSafeEnum.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: * Xerox/PARC initial implementation diff --git a/util/src/main/java/org/aspectj/util/UtilClassLoader.java b/util/src/main/java/org/aspectj/util/UtilClassLoader.java index 2c488bc3a..164776cbc 100644 --- a/util/src/main/java/org/aspectj/util/UtilClassLoader.java +++ b/util/src/main/java/org/aspectj/util/UtilClassLoader.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 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: - * 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: + * Isberg initial implementation * ******************************************************************/ package org.aspectj.util; @@ -34,31 +34,31 @@ public class UtilClassLoader extends URLClassLoader { /** save URL[] only for toString */ private URL[] urlsForDebugString; - + public UtilClassLoader(URL[] urls, File[] dirs) { super(urls); LangUtil.throwIaxIfNotAssignable(dirs, File.class, "dirs"); this.urlsForDebugString = urls; List<File> dcopy = new ArrayList<>(); - + if (!LangUtil.isEmpty(dirs)) { dcopy.addAll(Arrays.asList(dirs)); } this.dirs = Collections.unmodifiableList(dcopy); } - + public URL getResource(String name) { return ClassLoader.getSystemResource(name); } - + public InputStream getResourceAsStream(String name) { return ClassLoader.getSystemResourceAsStream(name); - } - + } + public synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { - // search the cache, our dirs (if maybe test), + // search the cache, our dirs (if maybe test), // the system, the superclass (URL[]), // and our dirs again (if not maybe test) ClassNotFoundException thrown = null; @@ -66,10 +66,10 @@ public class UtilClassLoader extends URLClassLoader { if (null != result) { resolve = false; } else { - try { - result = findSystemClass(name); - } catch (ClassNotFoundException e) { - thrown = e; + try { + result = findSystemClass(name); + } catch (ClassNotFoundException e) { + thrown = e; } } if (null == result) { @@ -79,16 +79,16 @@ public class UtilClassLoader extends URLClassLoader { thrown = e; } if (null != result) { // resolved by superclass - return result; + return result; } } if (null == result) { byte[] data = readClass(name); if (data != null) { result = defineClass(name, data, 0, data.length); - } // handle ClassFormatError? + } // handle ClassFormatError? } - + if (null == result) { throw (null != thrown ? thrown : new ClassNotFoundException(name)); } @@ -97,7 +97,7 @@ public class UtilClassLoader extends URLClassLoader { } return result; } - + /** @return null if class not found or byte[] of class otherwise */ private byte[] readClass(String className) throws ClassNotFoundException { final String fileName = className.replace('.', '/')+".class"; @@ -107,9 +107,9 @@ public class UtilClassLoader extends URLClassLoader { return getClassData(file); } } - return null; + return null; } - + private byte[] getClassData(File f) { try { FileInputStream stream= new FileInputStream(f); @@ -126,10 +126,10 @@ public class UtilClassLoader extends URLClassLoader { } return null; } - + /** @return String with debug info: urls and classes used */ public String toString() { - return "UtilClassLoader(urls=" + return "UtilClassLoader(urls=" + Arrays.asList(urlsForDebugString) + ", dirs=" + dirs diff --git a/util/src/test/java/org/aspectj/util/FileUtilTest.java b/util/src/test/java/org/aspectj/util/FileUtilTest.java index 29cd246e4..3bd1ef4e4 100644 --- a/util/src/test/java/org/aspectj/util/FileUtilTest.java +++ b/util/src/test/java/org/aspectj/util/FileUtilTest.java @@ -3,9 +3,9 @@ * 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/util/src/test/java/org/aspectj/util/GenericSignatureParserTest.java b/util/src/test/java/org/aspectj/util/GenericSignatureParserTest.java index 79cd0bbe9..e336392e3 100644 --- a/util/src/test/java/org/aspectj/util/GenericSignatureParserTest.java +++ b/util/src/test/java/org/aspectj/util/GenericSignatureParserTest.java @@ -2,9 +2,9 @@ * 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 + * 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 * * ******************************************************************/ diff --git a/util/src/test/java/org/aspectj/util/LangUtilTest.java b/util/src/test/java/org/aspectj/util/LangUtilTest.java index fddc6f946..0ac3e846e 100644 --- a/util/src/test/java/org/aspectj/util/LangUtilTest.java +++ b/util/src/test/java/org/aspectj/util/LangUtilTest.java @@ -3,9 +3,9 @@ * 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/util/src/test/java/org/aspectj/util/UtilModuleTests.java b/util/src/test/java/org/aspectj/util/UtilModuleTests.java index 73cb4b77f..19f513a00 100644 --- a/util/src/test/java/org/aspectj/util/UtilModuleTests.java +++ b/util/src/test/java/org/aspectj/util/UtilModuleTests.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * + * Contributors: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.util; @@ -18,7 +18,7 @@ import junit.framework.TestSuite; public class UtilModuleTests extends TestCase { - public static Test suite() { + public static Test suite() { TestSuite suite = new TestSuite(UtilModuleTests.class.getName()); suite.addTestSuite(FileUtilTest.class); suite.addTestSuite(LangUtilTest.class); @@ -28,4 +28,4 @@ public class UtilModuleTests extends TestCase { public UtilModuleTests(String name) { super(name); } -} +} |