groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [01/47] groovy git commit: Move source files to proper packages
Date Wed, 20 Dec 2017 04:29:09 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X b464b23bd -> 0ad8c07c2


http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/OrderBy.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/OrderBy.java b/src/main/groovy/util/OrderBy.java
deleted file mode 100644
index 703c9bc..0000000
--- a/src/main/groovy/util/OrderBy.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util;
-
-import groovy.lang.Closure;
-import org.codehaus.groovy.runtime.NumberAwareComparator;
-import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * A helper class for sorting objects via a closure to return the field
- * or operation on which to sort.
- *
- * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
- */
-public class OrderBy<T> implements Comparator<T>, Serializable {
-
-    private static final long serialVersionUID = 8385130064804116654L;
-    private final List<Closure> closures;
-    private boolean equalityCheck;
-    private final NumberAwareComparator<Object> numberAwareComparator = new NumberAwareComparator<Object>();
-
-    public OrderBy() {
-        this(new ArrayList<Closure>(), false);
-    }
-
-    public OrderBy(boolean equalityCheck) {
-        this(new ArrayList<Closure>(), equalityCheck);
-    }
-
-    public OrderBy(Closure closure) {
-        this(closure, false);
-    }
-
-    public OrderBy(Closure closure, boolean equalityCheck) {
-        this(new ArrayList<Closure>(), equalityCheck);
-        closures.add(closure);
-    }
-
-    public OrderBy(List<Closure> closures) {
-        this(closures, false);
-    }
-
-    public OrderBy(List<Closure> closures, boolean equalityCheck) {
-        this.equalityCheck = equalityCheck;
-        this.closures = closures;
-    }
-
-    public void add(Closure closure) {
-        closures.add(closure);
-    }
-
-    public int compare(T object1, T object2) {
-        for (Closure closure : closures) {
-            Object value1 = closure.call(object1);
-            Object value2 = closure.call(object2);
-            int result;
-            if (!equalityCheck || (value1 instanceof Comparable && value2 instanceof Comparable)) {
-                result = numberAwareComparator.compare(value1, value2);
-            } else {
-                result = DefaultTypeTransformation.compareEqual(value1, value2) ? 0 : -1;
-            }
-            if (result == 0) continue;
-            return result;
-        }
-        return 0;
-    }
-
-    public boolean isEqualityCheck() {
-        return equalityCheck;
-    }
-
-    public void setEqualityCheck(boolean equalityCheck) {
-        this.equalityCheck = equalityCheck;
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/PermutationGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/PermutationGenerator.java b/src/main/groovy/util/PermutationGenerator.java
deleted file mode 100644
index 5a82abc..0000000
--- a/src/main/groovy/util/PermutationGenerator.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util;
-
-import org.codehaus.groovy.runtime.DefaultGroovyMethods;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Systematically generate permutations.
- *
- * Adapted from Java Code by Michael Gilleland (released with no restrictions) using an algorithm described here:
- * Kenneth H. Rosen, Discrete Mathematics and Its Applications, 2nd edition (NY: McGraw-Hill, 1991), pp. 282-284
- */
-public class PermutationGenerator<E> implements Iterator<List<E>> {
-    private final int[] a;
-    private BigInteger numLeft;
-    private final BigInteger total;
-    private final List<E> items;
-
-    /**
-     * WARNING: Don't make n too large.
-     * Recall that the number of permutations is n!
-     * which can be very large, even when n is as small as 20 --
-     * 20! = 2,432,902,008,176,640,000 and
-     * 21! is too big to fit into a Java long, which is
-     * why we use BigInteger instead.
-     *
-     * @param items the items to permute
-     */
-    public PermutationGenerator(Collection<E> items) {
-        this.items = new ArrayList<E>(items);
-        int n = items.size();
-        if (n < 1) {
-            throw new IllegalArgumentException("At least one item required");
-        }
-        a = new int[n];
-        total = getFactorial(n);
-        reset();
-    }
-
-    public PermutationGenerator(Iterable<E> items) {
-        this(DefaultGroovyMethods.asCollection(items));
-    }
-
-    public void reset() {
-        for (int i = 0; i < a.length; i++) {
-            a[i] = i;
-        }
-        numLeft = new BigInteger(total.toString());
-    }
-
-    public BigInteger getTotal() {
-        return total;
-    }
-
-    public boolean hasNext() {
-        return numLeft.compareTo(BigInteger.ZERO) == 1;
-    }
-
-    /**
-     * Compute factorial (TODO: expose this)
-     *
-     * @param n the input integer
-     * @return the factorial for n
-     */
-    private static BigInteger getFactorial(int n) {
-        BigInteger fact = BigInteger.ONE;
-        for (int i = n; i > 1; i--) {
-            fact = fact.multiply(new BigInteger(Integer.toString(i)));
-        }
-        return fact;
-    }
-
-    /**
-     * Generate next permutation (algorithm from Rosen p. 284)
-     *
-     * @return the items permuted
-     */
-    public List<E> next() {
-        if (numLeft.equals(total)) {
-            numLeft = numLeft.subtract(BigInteger.ONE);
-            return items;
-        }
-
-        int temp;
-
-        // Find largest index j with a[j] < a[j+1]
-        int j = a.length - 2;
-        while (a[j] > a[j + 1]) {
-            j--;
-        }
-
-        // Find index k such that a[k] is smallest integer
-        // greater than a[j] to the right of a[j]
-        int k = a.length - 1;
-        while (a[j] > a[k]) {
-            k--;
-        }
-
-        // Interchange a[j] and a[k]
-        temp = a[k];
-        a[k] = a[j];
-        a[j] = temp;
-
-        // Put tail end of permutation after jth position in increasing order
-        int r = a.length - 1;
-        int s = j + 1;
-
-        while (r > s) {
-            temp = a[s];
-            a[s] = a[r];
-            a[r] = temp;
-            r--;
-            s++;
-        }
-
-        numLeft = numLeft.subtract(BigInteger.ONE);
-        List<E> ans = new ArrayList<E>(a.length);
-        for (int index : a) {
-            ans.add(items.get(index));
-        }
-        return ans;
-    }
-
-    public void remove() {
-        throw new UnsupportedOperationException("remove() not allowed for PermutationGenerator");
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/Proxy.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/Proxy.java b/src/main/groovy/util/Proxy.java
deleted file mode 100644
index ac080b3..0000000
--- a/src/main/groovy/util/Proxy.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util;
-
-import groovy.lang.GroovyObjectSupport;
-import groovy.lang.MissingMethodException;
-import org.codehaus.groovy.runtime.InvokerHelper;
-
-import java.util.Iterator;
-
-/**
- * Dynamic groovy proxy for another object.  All method
- * invocations get forwarded to actual object, unless the proxy overrides it.
- * See groovy/util/ProxyTest.groovy for usage details.
- *
- * @author Troy Heninger
- * @author Dierk Koenig
- */
-public class Proxy extends GroovyObjectSupport {
-
-    private Object adaptee = null;
-
-    /**
-     * This method is for convenience.
-     * It allows to get around the need for defining dump ctors in subclasses.
-     * See unit tests for details.
-     */
-    public Proxy wrap(Object adaptee){
-        setAdaptee(adaptee);
-        return this;
-    }
-
-    public Object getAdaptee() {
-        return adaptee;
-    }
-
-    public void setAdaptee(Object adaptee) {
-        this.adaptee = adaptee;
-    }
-
-    public Object invokeMethod(String name, Object args) {
-        try {
-            return super.invokeMethod(name, args);
-        }
-        catch (MissingMethodException e) {
-            return InvokerHelper.invokeMethod(adaptee, name, args);
-        }
-    }
-    
-    public Iterator iterator() {
-        return InvokerHelper.asIterator(adaptee);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/ProxyGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ProxyGenerator.java b/src/main/groovy/util/ProxyGenerator.java
deleted file mode 100644
index da12b97..0000000
--- a/src/main/groovy/util/ProxyGenerator.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util;
-
-import groovy.lang.Closure;
-import groovy.lang.DelegatingMetaClass;
-import groovy.lang.GroovyObject;
-import groovy.lang.GroovySystem;
-import groovy.lang.MetaClass;
-import org.codehaus.groovy.runtime.InvokerHelper;
-import org.codehaus.groovy.runtime.ProxyGeneratorAdapter;
-import org.codehaus.groovy.runtime.memoize.LRUCache;
-import org.codehaus.groovy.runtime.typehandling.GroovyCastException;
-import org.codehaus.groovy.transform.trait.Traits;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Classes to generate 'Proxy' objects which implement interfaces,
- * maps of closures and/or extend classes/delegates.
- *
- * @author Paul King
- * @author Guillaume Laforge
- * @author Cedric Champeau
- */
-public class ProxyGenerator {
-    private static final Class[] EMPTY_CLASS_ARRAY = new Class[0];
-    private static final Class[] EMPTY_INTERFACE_ARRAY = EMPTY_CLASS_ARRAY;
-    private static final Map<Object,Object> EMPTY_CLOSURE_MAP = Collections.emptyMap();
-    private static final Set<String> EMPTY_KEYSET = Collections.emptySet();
-
-    public static final ProxyGenerator INSTANCE = new ProxyGenerator();
-
-    static {
-        // wrap the standard MetaClass with the delegate
-        setMetaClass(GroovySystem.getMetaClassRegistry().getMetaClass(ProxyGenerator.class));
-    }
-
-    private ClassLoader override = null;
-    private boolean debug = false;
-    private boolean emptyMethods = false;
-
-    /**
-     * The adapter cache is used to cache proxy classes. When, for example, a call like:
-     * map as MyClass is found, then a lookup is made into the cache to find if a suitable
-     * adapter already exists. If so, then the class is reused, instead of generating a
-     * new class.
-     */
-    private final LRUCache adapterCache = new LRUCache(16);
-
-    public boolean getDebug() {
-        return debug;
-    }
-
-    /**
-     * Instructs <code>ProxyGenerator</code> to dump generated Groovy
-     * source code to standard output during construction. This is useful
-     * for debugging purposes but should be turned off in production.
-     *
-     * @param debug true if you want generated source to be printed
-     */
-    public void setDebug(boolean debug) {
-        this.debug = debug;
-    }
-
-    public boolean getEmptyMethods() {
-        return emptyMethods;
-    }
-
-    /**
-     * Changes generated methods to have empty implementations.
-     * <p>
-     * Methods in generated aggregates not supplied in a closures map or
-     * base class are given 'default' implementations. The implementation
-     * will normally throw an <code>UnsupportedOperationException</code>
-     * but setting this boolean will leave it empty.
-     *
-     * @param emptyMethods true if you want generated methods to be empty
-     */
-    public void setEmptyMethods(boolean emptyMethods) {
-        this.emptyMethods = emptyMethods;
-    }
-
-    public ClassLoader getOverride() {
-        return override;
-    }
-
-    public void setOverride(ClassLoader override) {
-        this.override = override;
-    }
-
-    public GroovyObject instantiateAggregateFromBaseClass(Class clazz) {
-        return instantiateAggregateFromBaseClass((Map) null, clazz);
-    }
-
-    public GroovyObject instantiateAggregateFromBaseClass(Map map, Class clazz) {
-        return instantiateAggregateFromBaseClass(map, clazz, null);
-    }
-
-    public GroovyObject instantiateAggregateFromBaseClass(Closure cl, Class clazz) {
-        Map<String, Closure> m = new HashMap<String, Closure>();
-        m.put("*", cl);
-        return instantiateAggregateFromBaseClass(m, clazz, null);
-    }
-
-    public GroovyObject instantiateAggregateFromBaseClass(Class clazz, Object[] constructorArgs) {
-        return instantiateAggregate(null, null, clazz, constructorArgs);
-    }
-
-    public GroovyObject instantiateAggregateFromBaseClass(Map map, Class clazz, Object[] constructorArgs) {
-        return instantiateAggregate(map, null, clazz, constructorArgs);
-    }
-
-    public GroovyObject instantiateAggregateFromInterface(Class clazz) {
-        return instantiateAggregateFromInterface(null, clazz);
-    }
-
-    public GroovyObject instantiateAggregateFromInterface(Map map, Class clazz) {
-        List<Class> interfaces = new ArrayList<Class>();
-        interfaces.add(clazz);
-        return instantiateAggregate(map, interfaces);
-    }
-
-    public GroovyObject instantiateAggregate(List<Class> interfaces) {
-        return instantiateAggregate(null, interfaces);
-    }
-
-    public GroovyObject instantiateAggregate(Map closureMap, List<Class> interfaces) {
-        return instantiateAggregate(closureMap, interfaces, null);
-    }
-
-    public GroovyObject instantiateAggregate(Map closureMap, List<Class> interfaces, Class clazz) {
-        return instantiateAggregate(closureMap, interfaces, clazz, null);
-    }
-
-    @SuppressWarnings("unchecked")
-    public GroovyObject instantiateAggregate(Map closureMap, List<Class> interfaces, Class clazz, Object[] constructorArgs) {
-        if (clazz != null && Modifier.isFinal(clazz.getModifiers())) {
-            throw new GroovyCastException("Cannot coerce a map to class " + clazz.getName() + " because it is a final class");
-        }
-        Map<Object,Object> map = closureMap != null ? closureMap : EMPTY_CLOSURE_MAP;
-        ProxyGeneratorAdapter adapter = createAdapter(map, interfaces, null, clazz);
-
-        return adapter.proxy(map, constructorArgs);
-    }
-
-    public GroovyObject instantiateDelegate(Object delegate) {
-        return instantiateDelegate(null, delegate);
-    }
-
-    public GroovyObject instantiateDelegate(List<Class> interfaces, Object delegate) {
-        return instantiateDelegate(null, interfaces, delegate);
-    }
-
-    public GroovyObject instantiateDelegate(Map closureMap, List<Class> interfaces, Object delegate) {
-        return instantiateDelegateWithBaseClass(closureMap, interfaces, delegate, null);
-    }
-
-    public GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate) {
-        return instantiateDelegateWithBaseClass(closureMap, interfaces, delegate, delegate.getClass());
-    }
-
-    public GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass) {
-        return instantiateDelegateWithBaseClass(closureMap, interfaces, delegate, baseClass, null);
-    }
-
-    /**
-     * Creates a proxy with a delegate object.
-     *
-     * @param closureMap the closure for methods not handled by the delegate
-     * @param interfaces interfaces to be implemented
-     * @param delegate the delegate object
-     * @param baseClass the base class
-     * @param name the name of the proxy, unused, but kept for compatibility with previous versions of Groovy.
-     * @return a proxy object implementing the specified interfaces, and delegating to the provided object
-     */
-    @SuppressWarnings("unchecked")
-    public GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass, String name) {
-        Map<Object,Object> map = closureMap != null ? closureMap : EMPTY_CLOSURE_MAP;
-        ProxyGeneratorAdapter adapter = createAdapter(map, interfaces, delegate.getClass(), baseClass);
-
-        return adapter.delegatingProxy(delegate, map, (Object[])null);
-    }
-
-    private ProxyGeneratorAdapter createAdapter(Map closureMap, List<Class> interfaces, Class delegateClass, Class baseClass) {
-        // According to https://shipilev.net/blog/2016/arrays-wisdom-ancients/#_conclusion
-        // toArray(new T[0]) seems faster, safer, and contractually cleaner, and therefore should be the default choice now.
-        Class[] intfs = interfaces != null ? interfaces.toArray(EMPTY_CLASS_ARRAY) : EMPTY_INTERFACE_ARRAY;
-        Class base = baseClass;
-        if (base == null) {
-            if (intfs.length > 0) {
-                base = intfs[0];
-            } else {
-                base = Object.class;
-            }
-        }
-        Set<String> keys = closureMap == EMPTY_CLOSURE_MAP ? EMPTY_KEYSET : new HashSet<String>();
-        for (Object o : closureMap.keySet()) {
-            keys.add(o.toString());
-        }
-        boolean useDelegate = null != delegateClass;
-        CacheKey key = new CacheKey(base, useDelegate ? delegateClass : Object.class, keys, intfs, emptyMethods, useDelegate);
-        ProxyGeneratorAdapter adapter = (ProxyGeneratorAdapter) adapterCache.get(key);
-        if (adapter == null) {
-            adapter = new ProxyGeneratorAdapter(closureMap, base, intfs, useDelegate ? delegateClass.getClassLoader() : base.getClassLoader(), emptyMethods, useDelegate ? delegateClass : null);
-            adapterCache.put(key, adapter);
-        }
-
-        return adapter;
-    }
-
-    private static void setMetaClass(final MetaClass metaClass) {
-        final MetaClass newMetaClass = new DelegatingMetaClass(metaClass) {
-            @Override
-            public Object invokeStaticMethod(Object object, String methodName, Object[] arguments) {
-                return InvokerHelper.invokeMethod(INSTANCE, methodName, arguments);
-            }
-        };
-        GroovySystem.getMetaClassRegistry().setMetaClass(ProxyGenerator.class, newMetaClass);
-    }
-    
-    private static final class CacheKey {
-        private static final Comparator<Class> INTERFACE_COMPARATOR = new Comparator<Class>() {
-            public int compare(final Class o1, final Class o2) {
-                // Traits order *must* be preserved
-                // See GROOVY-7285
-                if (Traits.isTrait(o1)) return -1;
-                if (Traits.isTrait(o2)) return 1;
-                return o1.getName().compareTo(o2.getName());
-            }
-        };
-        private final boolean emptyMethods;
-        private final boolean useDelegate;
-        private final Set<String> methods;
-        private final ClassReference delegateClass;
-        private final ClassReference baseClass;
-        private final ClassReference[] interfaces;
-
-        private CacheKey(final Class baseClass, final Class delegateClass, final Set<String> methods, final Class[] interfaces, final boolean emptyMethods, final boolean useDelegate) {
-            this.useDelegate = useDelegate;
-            this.baseClass = new ClassReference(baseClass);
-            this.delegateClass = new ClassReference(delegateClass);
-            this.emptyMethods = emptyMethods;
-            this.interfaces = interfaces == null ? null : new ClassReference[interfaces.length];
-            if (interfaces != null) {
-                Class[] interfacesCopy = new Class[interfaces.length];
-                System.arraycopy(interfaces, 0, interfacesCopy, 0, interfaces.length);
-                Arrays.sort(interfacesCopy, INTERFACE_COMPARATOR);
-                for (int i = 0; i < interfacesCopy.length; i++) {
-                    Class anInterface = interfacesCopy[i];
-                    this.interfaces[i] = new ClassReference(anInterface);
-                }
-            }
-            this.methods = methods;
-        }
-
-        @Override
-        public boolean equals(final Object o) {
-            if (this == o) return true;
-            if (o == null || getClass() != o.getClass()) return false;
-
-            final CacheKey cacheKey = (CacheKey) o;
-
-            if (emptyMethods != cacheKey.emptyMethods) return false;
-            if (useDelegate != cacheKey.useDelegate) return false;
-            if (baseClass != null ? !baseClass.equals(cacheKey.baseClass) : cacheKey.baseClass != null) return false;
-            if (delegateClass != null ? !delegateClass.equals(cacheKey.delegateClass) : cacheKey.delegateClass != null) return false;
-            if (!Arrays.equals(interfaces, cacheKey.interfaces)) return false;
-            if (methods != null ? !methods.equals(cacheKey.methods) : cacheKey.methods != null) return false;
-
-            return true;
-        }
-
-        @Override
-        public int hashCode() {
-            int result = (emptyMethods ? 1 : 0);
-            result = 31 * result + (useDelegate ? 1 : 0);
-            result = 31 * result + (methods != null ? methods.hashCode() : 0);
-            result = 31 * result + (baseClass != null ? baseClass.hashCode() : 0);
-            result = 31 * result + (delegateClass != null ? delegateClass.hashCode() : 0);
-            result = 31 * result + (interfaces != null ? Arrays.hashCode(interfaces) : 0);
-            return result;
-        }
-
-        /**
-         * A weak reference which delegates equals and hashcode to the referent.
-         */
-        private static class ClassReference extends WeakReference<Class> {
-
-            public ClassReference(Class referent) {
-                super(referent);
-            }
-
-            @Override
-            public boolean equals(final Object o) {
-                if (this == o) return true;
-                if (o == null || getClass() != o.getClass()) return false;
-                Class thisClass = this.get();
-                ClassReference that = (ClassReference) o;
-                if (thisClass == null) return false;
-                return thisClass.equals(that.get());
-            }
-
-            @Override
-            public int hashCode() {
-                Class thisClass = this.get();
-                if (thisClass == null) return 0;
-                return thisClass.hashCode();
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/ResourceConnector.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ResourceConnector.java b/src/main/groovy/util/ResourceConnector.java
deleted file mode 100644
index 81e329a..0000000
--- a/src/main/groovy/util/ResourceConnector.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util;
-
-import java.net.URLConnection;
-
-/**
- * Base interface for customizing where resources can be found for the <code>GroovyScriptEngine</code>.
- *
- * @author sam
- */
-public interface ResourceConnector {
-
-    /**
-     * Retrieve a URLConnection to a script referenced by name.
-     *
-     * @param name
-     * @throws ResourceException
-     */
-    URLConnection getResourceConnection(String name) throws ResourceException;
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/ResourceException.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ResourceException.java b/src/main/groovy/util/ResourceException.java
deleted file mode 100644
index 8b31d7e..0000000
--- a/src/main/groovy/util/ResourceException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util;
-
-/**
- * @author sam
- */
-public class ResourceException extends Exception {
-
-    /**
-     *
-     */
-    public ResourceException() {
-        super();
-        // TODO Auto-generated constructor stub
-    }
-
-    /**
-     * @param message
-     */
-    public ResourceException(String message) {
-        super(message);
-    }
-
-    /**
-     * @param message
-     * @param cause
-     */
-    public ResourceException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * @param cause
-     */
-    public ResourceException(Throwable cause) {
-        super(cause);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/ScriptException.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ScriptException.java b/src/main/groovy/util/ScriptException.java
deleted file mode 100644
index 85ce60f..0000000
--- a/src/main/groovy/util/ScriptException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util;
-
-/**
- * @author sam
- */
-public class ScriptException extends Exception {
-
-    /**
-     *
-     */
-    public ScriptException() {
-        super();
-    }
-
-    /**
-     * @param message
-     */
-    public ScriptException(String message) {
-        super(message);
-    }
-
-    /**
-     * @param message
-     * @param cause
-     */
-    public ScriptException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * @param cause
-     */
-    public ScriptException(Throwable cause) {
-        super(cause);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/logging/Commons.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/logging/Commons.java b/src/main/groovy/util/logging/Commons.java
deleted file mode 100644
index aa456d2..0000000
--- a/src/main/groovy/util/logging/Commons.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util.logging;
-
-import groovy.lang.GroovyClassLoader;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.BooleanExpression;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.MethodCallExpression;
-import org.codehaus.groovy.ast.expr.TernaryExpression;
-import org.codehaus.groovy.transform.GroovyASTTransformationClass;
-import org.codehaus.groovy.transform.LogASTTransformation;
-import org.objectweb.asm.Opcodes;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.Locale;
-
-/**
- * This local transform adds a logging ability to your program using
- * Apache Commons logging. Every method call on a unbound variable named <i>log</i>
- * will be mapped to a call to the logger. For this a <i>log</i> field will be
- * inserted in the class. If the field already exists the usage of this transform
- * will cause a compilation error. The method name will be used to determine
- * what to call on the logger.
- * <pre>
- * log.name(exp)
- * </pre>is mapped to
- * <pre>
- * if (log.isNameEnabled() {
- *    log.name(exp)
- * }</pre>
- * Here name is a place holder for info, debug, warning, error, etc.
- * If the expression exp is a constant or only a variable access the method call will
- * not be transformed. But this will still cause a call on the injected logger.
- *
- * @author Hamlet D'Arcy
- * @author Matthias Cullmann
- * @since 1.8.0
- */
-@java.lang.annotation.Documented
-@Retention(RetentionPolicy.SOURCE)
-@Target({ElementType.TYPE})
-@GroovyASTTransformationClass("org.codehaus.groovy.transform.LogASTTransformation")
-public @interface Commons {
-    String value() default "log";
-    String category() default LogASTTransformation.DEFAULT_CATEGORY_NAME;
-    Class<? extends LogASTTransformation.LoggingStrategy> loggingStrategy() default CommonsLoggingStrategy.class;
-
-    public  static class CommonsLoggingStrategy extends LogASTTransformation.AbstractLoggingStrategy {
-
-        private static final String LOGGER_NAME = "org.apache.commons.logging.Log";
-        private static final String LOGGERFACTORY_NAME = "org.apache.commons.logging.LogFactory";
-
-        protected CommonsLoggingStrategy(final GroovyClassLoader loader) {
-            super(loader);
-        }
-
-        public FieldNode addLoggerFieldToClass(ClassNode classNode, String logFieldName, String categoryName) {
-            return classNode.addField(logFieldName,
-                    Opcodes.ACC_FINAL | Opcodes.ACC_TRANSIENT | Opcodes.ACC_STATIC | Opcodes.ACC_PRIVATE,
-                    classNode(LOGGER_NAME),
-                    new MethodCallExpression(
-                            new ClassExpression(classNode(LOGGERFACTORY_NAME)),
-                            "getLog",
-                            new ConstantExpression(getCategoryName(classNode, categoryName))));
-        }
-
-        public boolean isLoggingMethod(String methodName) {
-            return methodName.matches("fatal|error|warn|info|debug|trace");
-        }
-
-        public Expression wrapLoggingMethodCall(Expression logVariable, String methodName, Expression originalExpression) {
-            MethodCallExpression condition = new MethodCallExpression(
-                    logVariable,
-                    "is" + methodName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methodName.substring(1, methodName.length()) + "Enabled",
-                    ArgumentListExpression.EMPTY_ARGUMENTS);
-            condition.setImplicitThis(false);
-
-            return new TernaryExpression(
-                    new BooleanExpression(condition),
-                    originalExpression,
-                    ConstantExpression.NULL);
-        }
-   }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/logging/Log.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/logging/Log.java b/src/main/groovy/util/logging/Log.java
deleted file mode 100644
index e52d39b..0000000
--- a/src/main/groovy/util/logging/Log.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util.logging;
-
-import groovy.lang.GroovyClassLoader;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.AttributeExpression;
-import org.codehaus.groovy.ast.expr.BooleanExpression;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.MethodCallExpression;
-import org.codehaus.groovy.ast.expr.TernaryExpression;
-import org.codehaus.groovy.transform.GroovyASTTransformationClass;
-import org.codehaus.groovy.transform.LogASTTransformation;
-import org.codehaus.groovy.transform.LogASTTransformation.LoggingStrategy;
-import org.objectweb.asm.Opcodes;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.Locale;
-
-/**
- * This local transform adds a logging ability to your program using
- * java.util.logging. Every method call on a unbound variable named <i>log</i>
- * will be mapped to a call to the logger. For this a <i>log</i> field will be
- * inserted in the class. If the field already exists the usage of this transform
- * will cause a compilation error. The method name will be used to determine
- * what to call on the logger.
- * <pre>
- * log.name(exp)
- * </pre>is mapped to
- * <pre>
- * if (log.isLoggable(Level.NAME) {
- *    log.name(exp)
- * }</pre>
- * Here name is a place holder for info, fine, finer, finest, config, warning, severe.
- * NAME is name transformed to upper case. if anything else is used it will result in
- * an exception at runtime. If the expression exp is a constant or only a variable access
- * the method call will not be transformed. But this will still cause a call on the injected
- * logger.
- *
- * @author Guillaume Laforge
- * @author Jochen Theodorou
- * @author Dinko Srkoc
- * @author Hamlet D'Arcy
- * @author Raffaele Cigni
- * @author Alberto Vilches Raton
- * @since 1.8.0
- */
-@java.lang.annotation.Documented
-@Retention(RetentionPolicy.SOURCE)
-@Target({ElementType.TYPE})
-@GroovyASTTransformationClass("org.codehaus.groovy.transform.LogASTTransformation")
-public @interface Log {
-    String value() default "log";
-    String category() default LogASTTransformation.DEFAULT_CATEGORY_NAME;
-    Class<? extends LoggingStrategy> loggingStrategy() default JavaUtilLoggingStrategy.class;
-
-    /**
-     * This class contains the logic of how to weave a Java Util Logging logger into the host class.
-     */
-    public static class JavaUtilLoggingStrategy extends LogASTTransformation.AbstractLoggingStrategy {
-
-        private static final ClassNode LOGGER_CLASSNODE = ClassHelper.make(java.util.logging.Logger.class);
-        private static final ClassNode LEVEL_CLASSNODE = ClassHelper.make(java.util.logging.Level.class);
-
-        protected JavaUtilLoggingStrategy(final GroovyClassLoader loader) {
-            super(loader);
-        }
-
-        public FieldNode addLoggerFieldToClass(ClassNode classNode, String logFieldName, String categoryName) {
-            return classNode.addField(logFieldName,
-                        Opcodes.ACC_FINAL | Opcodes.ACC_TRANSIENT | Opcodes.ACC_STATIC | Opcodes.ACC_PRIVATE,
-                        LOGGER_CLASSNODE,
-                        new MethodCallExpression(
-                                new ClassExpression(LOGGER_CLASSNODE),
-                                "getLogger",
-                                new ConstantExpression(getCategoryName(classNode, categoryName))));
-        }
-
-        public boolean isLoggingMethod(String methodName) {
-            return methodName.matches("severe|warning|info|fine|finer|finest");
-        }
-
-        public Expression wrapLoggingMethodCall(Expression logVariable, String methodName, Expression originalExpression) {
-            AttributeExpression logLevelExpression = new AttributeExpression(
-                    new ClassExpression(LEVEL_CLASSNODE),
-                    new ConstantExpression(methodName.toUpperCase(Locale.ENGLISH)));
-
-            ArgumentListExpression args = new ArgumentListExpression();
-            args.addExpression(logLevelExpression);
-            MethodCallExpression condition = new MethodCallExpression(logVariable, "isLoggable", args);
-            condition.setImplicitThis(false);
-
-            return new TernaryExpression(
-                    new BooleanExpression(condition),
-                    originalExpression,
-                    ConstantExpression.NULL);
-
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/logging/Log4j.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/logging/Log4j.java b/src/main/groovy/util/logging/Log4j.java
deleted file mode 100644
index 2dfdf7f..0000000
--- a/src/main/groovy/util/logging/Log4j.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util.logging;
-
-import groovy.lang.GroovyClassLoader;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.AttributeExpression;
-import org.codehaus.groovy.ast.expr.BooleanExpression;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.MethodCallExpression;
-import org.codehaus.groovy.ast.expr.TernaryExpression;
-import org.codehaus.groovy.transform.GroovyASTTransformationClass;
-import org.codehaus.groovy.transform.LogASTTransformation;
-import org.objectweb.asm.Opcodes;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.Locale;
-
-/**
- * This local transform adds a logging ability to your program using
- * Log4j logging. Every method call on a unbound variable named <i>log</i>
- * will be mapped to a call to the logger. For this a <i>log</i> field will be
- * inserted in the class. If the field already exists the usage of this transform
- * will cause a compilation error. The method name will be used to determine
- * what to call on the logger.
- * <pre>
- * log.name(exp)
- * </pre>is mapped to
- * <pre>
- * if (log.isNameEnabled() {
- *    log.name(exp)
- * }</pre>
- * Here name is a place holder for info, debug, warning, error, etc.
- * If the expression exp is a constant or only a variable access the method call will
- * not be transformed. But this will still cause a call on the injected logger.
- *
- * @author Hamlet D'Arcy
- * @author Tomek Bujok
- * @since 1.8.0
- */
-@java.lang.annotation.Documented
-@Retention(RetentionPolicy.SOURCE)
-@Target({ElementType.TYPE})
-@GroovyASTTransformationClass("org.codehaus.groovy.transform.LogASTTransformation")
-public @interface Log4j {
-    String value() default "log";
-    String category() default LogASTTransformation.DEFAULT_CATEGORY_NAME;
-    Class<? extends LogASTTransformation.LoggingStrategy> loggingStrategy() default Log4jLoggingStrategy.class;
-
-    public static class Log4jLoggingStrategy extends LogASTTransformation.AbstractLoggingStrategy {
-        private static final String LOGGER_NAME = "org.apache.log4j.Logger";
-        private static final String PRIORITY_NAME = "org.apache.log4j.Priority";
-
-        protected Log4jLoggingStrategy(final GroovyClassLoader loader) {
-            super(loader);
-        }
-
-        public FieldNode addLoggerFieldToClass(ClassNode classNode, String logFieldName, String categoryName) {
-            return classNode.addField(logFieldName,
-                    Opcodes.ACC_FINAL | Opcodes.ACC_TRANSIENT | Opcodes.ACC_STATIC | Opcodes.ACC_PRIVATE,
-                    classNode(LOGGER_NAME),
-                    new MethodCallExpression(
-                            new ClassExpression(classNode(LOGGER_NAME)),
-                            "getLogger",
-                            new ConstantExpression(getCategoryName(classNode, categoryName))));
-        }
-
-        public boolean isLoggingMethod(String methodName) {
-            return methodName.matches("fatal|error|warn|info|debug|trace");
-        }
-
-        public Expression wrapLoggingMethodCall(Expression logVariable, String methodName, Expression originalExpression) {
-            final MethodCallExpression condition;
-            if (!"trace".equals(methodName)) {
-                AttributeExpression logLevelExpression = new AttributeExpression(
-                        new ClassExpression(classNode(PRIORITY_NAME)),
-                        new ConstantExpression(methodName.toUpperCase(Locale.ENGLISH)));
-                ArgumentListExpression args = new ArgumentListExpression();
-                args.addExpression(logLevelExpression);
-                condition = new MethodCallExpression(logVariable, "isEnabledFor", args);
-            } else {
-                // log4j api is inconsistent, so trace requires special handling
-                condition = new MethodCallExpression(
-                        logVariable,
-                        "is" + methodName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methodName.substring(1, methodName.length()) + "Enabled",
-                        ArgumentListExpression.EMPTY_ARGUMENTS);
-            }
-            condition.setImplicitThis(false);
-
-            return new TernaryExpression(
-                    new BooleanExpression(condition),
-                    originalExpression,
-                    ConstantExpression.NULL);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/logging/Log4j2.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/logging/Log4j2.java b/src/main/groovy/util/logging/Log4j2.java
deleted file mode 100644
index 7aca5a5..0000000
--- a/src/main/groovy/util/logging/Log4j2.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util.logging;
-
-import groovy.lang.GroovyClassLoader;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.BooleanExpression;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.MethodCallExpression;
-import org.codehaus.groovy.ast.expr.TernaryExpression;
-import org.codehaus.groovy.transform.GroovyASTTransformationClass;
-import org.codehaus.groovy.transform.LogASTTransformation;
-import org.objectweb.asm.Opcodes;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.Locale;
-
-/**
- * This local transform adds a logging ability to your program using
- * Log4j2 logging. Every method call on a unbound variable named <i>log</i>
- * will be mapped to a call to the logger. For this a <i>log</i> field will be
- * inserted in the class. If the field already exists the usage of this transform
- * will cause a compilation error. The method name will be used to determine
- * what to call on the logger.
- * <pre>
- * log.name(exp)
- * </pre>is mapped to
- * <pre>
- * if (log.isNameEnabled() {
- *    log.name(exp)
- * }</pre>
- * Here name is a place holder for info, debug, warning, error, etc.
- * If the expression exp is a constant or only a variable access the method call will
- * not be transformed. But this will still cause a call on the injected logger.
- *
- * @since 2.2.0
- */
-@java.lang.annotation.Documented
-@Retention(RetentionPolicy.SOURCE)
-@Target({ElementType.TYPE})
-@GroovyASTTransformationClass("org.codehaus.groovy.transform.LogASTTransformation")
-public @interface Log4j2 {
-    String value() default "log";
-    String category() default LogASTTransformation.DEFAULT_CATEGORY_NAME;
-    Class<? extends LogASTTransformation.LoggingStrategy> loggingStrategy() default Log4j2LoggingStrategy.class;
-
-    public static class Log4j2LoggingStrategy extends LogASTTransformation.AbstractLoggingStrategy {
-        private static final String LOGGER_NAME = "org.apache.logging.log4j.core.Logger";
-        private static final String LOG_MANAGER_NAME = "org.apache.logging.log4j.LogManager";
-
-        protected Log4j2LoggingStrategy(final GroovyClassLoader loader) {
-            super(loader);
-        }
-
-        public FieldNode addLoggerFieldToClass(ClassNode classNode, String logFieldName, String categoryName) {
-            return classNode.addField(logFieldName,
-                    Opcodes.ACC_FINAL | Opcodes.ACC_TRANSIENT | Opcodes.ACC_STATIC | Opcodes.ACC_PRIVATE,
-                    classNode(LOGGER_NAME),
-                    new MethodCallExpression(
-                            new ClassExpression(classNode(LOG_MANAGER_NAME)),
-                            "getLogger",
-                            new ConstantExpression(getCategoryName(classNode, categoryName))));
-        }
-
-        public boolean isLoggingMethod(String methodName) {
-            return methodName.matches("fatal|error|warn|info|debug|trace");
-        }
-
-        public Expression wrapLoggingMethodCall(Expression logVariable, String methodName, Expression originalExpression) {
-            MethodCallExpression condition = new MethodCallExpression(
-                    logVariable,
-                    "is" + methodName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methodName.substring(1, methodName.length()) + "Enabled",
-                    ArgumentListExpression.EMPTY_ARGUMENTS);
-            condition.setImplicitThis(false);
-
-            return new TernaryExpression(
-                    new BooleanExpression(condition),
-                    originalExpression,
-                    ConstantExpression.NULL);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/logging/Slf4j.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/logging/Slf4j.java b/src/main/groovy/util/logging/Slf4j.java
deleted file mode 100644
index 0e866e4..0000000
--- a/src/main/groovy/util/logging/Slf4j.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.util.logging;
-
-import groovy.lang.GroovyClassLoader;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.BooleanExpression;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.MethodCallExpression;
-import org.codehaus.groovy.ast.expr.TernaryExpression;
-import org.codehaus.groovy.transform.GroovyASTTransformationClass;
-import org.codehaus.groovy.transform.LogASTTransformation;
-import org.objectweb.asm.Opcodes;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.Locale;
-
-/**
- * This local transform adds a logging ability to your program using
- * LogBack logging. Every method call on a unbound variable named <i>log</i>
- * will be mapped to a call to the logger. For this a <i>log</i> field will be
- * inserted in the class. If the field already exists the usage of this transform
- * will cause a compilation error. The method name will be used to determine
- * what to call on the logger.
- * <pre>
- * log.name(exp)
- * </pre>is mapped to
- * <pre>
- * if (log.isNameLoggable() {
- *    log.name(exp)
- * }</pre>
- * Here name is a place holder for info, debug, warning, error, etc.
- * If the expression exp is a constant or only a variable access the method call will
- * not be transformed. But this will still cause a call on the injected logger.
- *
- * @author Hamlet D'Arcy
- * @author Alberto Mijares
- * @since 1.8.0
- */
-@java.lang.annotation.Documented
-@Retention(RetentionPolicy.SOURCE)
-@Target({ElementType.TYPE})
-@GroovyASTTransformationClass("org.codehaus.groovy.transform.LogASTTransformation")
-public @interface Slf4j {
-    String value() default "log";
-    String category() default LogASTTransformation.DEFAULT_CATEGORY_NAME;
-    Class<? extends LogASTTransformation.LoggingStrategy> loggingStrategy() default Slf4jLoggingStrategy.class;
-
-    public static class Slf4jLoggingStrategy extends LogASTTransformation.AbstractLoggingStrategy {
-        private static final String LOGGER_NAME = "org.slf4j.Logger";
-        private static final String FACTORY_NAME = "org.slf4j.LoggerFactory";
-
-        protected Slf4jLoggingStrategy(final GroovyClassLoader loader) {
-            super(loader);
-        }
-
-        public FieldNode addLoggerFieldToClass(ClassNode classNode, String logFieldName, String categoryName) {
-            return classNode.addField(logFieldName,
-                    Opcodes.ACC_FINAL | Opcodes.ACC_TRANSIENT | Opcodes.ACC_STATIC | Opcodes.ACC_PRIVATE,
-                    classNode(LOGGER_NAME),
-                    new MethodCallExpression(
-                            new ClassExpression(classNode(FACTORY_NAME)),
-                            "getLogger",
-                            new ConstantExpression(getCategoryName(classNode, categoryName))));
-        }
-
-        public boolean isLoggingMethod(String methodName) {
-            return methodName.matches("error|warn|info|debug|trace");
-        }
-
-        public Expression wrapLoggingMethodCall(Expression logVariable, String methodName, Expression originalExpression) {
-            MethodCallExpression condition = new MethodCallExpression(
-                    logVariable,
-                    "is" + methodName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methodName.substring(1, methodName.length()) + "Enabled",
-                    ArgumentListExpression.EMPTY_ARGUMENTS);
-            condition.setImplicitThis(false);
-
-            return new TernaryExpression(
-                    new BooleanExpression(condition),
-                    originalExpression,
-                    ConstantExpression.NULL);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/util/package.html
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/package.html b/src/main/groovy/util/package.html
deleted file mode 100644
index e7a2c5a..0000000
--- a/src/main/groovy/util/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
-
-     Licensed to the Apache Software Foundation (ASF) under one
-     or more contributor license agreements.  See the NOTICE file
-     distributed with this work for additional information
-     regarding copyright ownership.  The ASF licenses this file
-     to you under the Apache License, Version 2.0 (the
-     "License"); you may not use this file except in compliance
-     with the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing,
-     software distributed under the License is distributed on an
-     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-     KIND, either express or implied.  See the License for the
-     specific language governing permissions and limitations
-     under the License.
-
--->
-<html>
-  <head>
-    <title>package groovy.util.*</title>
-  </head>
-  <body>
-    <p>Various Groovy utilities for working with nodes, builders, logging, JUnit test cases, text expressions, Ant tasks or JMX MBeans.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/groovy/blob/0ad8c07c/src/main/groovy/xml/QName.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/xml/QName.java b/src/main/groovy/xml/QName.java
deleted file mode 100644
index 06a733d..0000000
--- a/src/main/groovy/xml/QName.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.xml;
-
-import java.io.Serializable;
-
-/**
- * <code>QName</code> class represents the value of a qualified name
- * as specified in <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML
- * Schema Part2: Datatypes specification</a>.
- * <p>
- * The value of a QName contains a <b>namespaceURI</b>, a <b>localPart</b> and a <b>prefix</b>.
- * The localPart provides the local part of the qualified name. The
- * namespaceURI is a URI reference identifying the namespace.
- */
-public class QName implements Serializable {
-    private static final long serialVersionUID = -9029109610006696081L;
-
-    /** comment/shared empty string */
-    private static final String EMPTY_STRING = "";
-
-    /** Field namespaceURI */
-    private String namespaceURI;
-
-    /** Field localPart */
-    private String localPart;
-
-    /** Field prefix */
-    private String prefix;
-
-    /**
-     * Constructor for the QName.
-     *
-     * @param localPart Local part of the QName
-     */
-    public QName(String localPart) {
-        this(EMPTY_STRING, localPart, EMPTY_STRING);
-    }
-
-    /**
-     * Constructor for the QName.
-     *
-     * @param namespaceURI Namespace URI for the QName
-     * @param localPart Local part of the QName.
-     */
-    public QName(String namespaceURI, String localPart) {
-        this(namespaceURI, localPart, EMPTY_STRING);
-    }
-
-    /**
-     * Constructor for the QName.
-     *
-     * @param namespaceURI Namespace URI for the QName
-     * @param localPart Local part of the QName.
-     * @param prefix Prefix of the QName.
-     */
-    public QName(String namespaceURI, String localPart, String prefix) {
-        this.namespaceURI = (namespaceURI == null)
-                ? EMPTY_STRING
-                : namespaceURI;
-        if (localPart == null) {
-            throw new IllegalArgumentException("invalid QName local part");
-        } else {
-            this.localPart = localPart;
-        }
-
-        if (prefix == null) {
-            throw new IllegalArgumentException("invalid QName prefix");
-        } else {
-            this.prefix = prefix;
-        }
-    }
-
-    /**
-     * Gets the Namespace URI for this QName
-     *
-     * @return Namespace URI
-     */
-    public String getNamespaceURI() {
-        return namespaceURI;
-    }
-
-    /**
-     * Gets the Local part for this QName
-     *
-     * @return Local part
-     */
-    public String getLocalPart() {
-        return localPart;
-    }
-
-    /**
-     * Gets the Prefix for this QName
-     *
-     * @return Prefix
-     */
-    public String getPrefix() {
-        return prefix;
-    }
-
-    /**
-     * Returns the fully qualified name of this QName
-     *
-     * @return  a string representation of the QName
-     */
-    public String getQualifiedName() {
-        return ((prefix.equals(EMPTY_STRING))
-                ? localPart
-                : prefix + ':' + localPart);
-    }
-
-    /**
-     * Returns a string representation of this QName
-     *
-     * @return  a string representation of the QName
-     */
-    public String toString() {
-        return ((namespaceURI.equals(EMPTY_STRING))
-                ? localPart
-                : '{' + namespaceURI + '}' + localPart);
-    }
-
-    /**
-     * Tests this QName for equality with another object.
-     * <p>
-     * If the given object is not a QName or String equivalent or is null then this method
-     * returns <tt>false</tt>.
-     * <p>
-     * For two QNames to be considered equal requires that both
-     * localPart and namespaceURI must be equal. This method uses
-     * <code>String.equals</code> to check equality of localPart
-     * and namespaceURI. Any class that extends QName is required
-     * to satisfy this equality contract.
-     *
-     * If the supplied object is a String, then it is split in two on the last colon
-     * and the first half is compared against the prefix || namespaceURI
-     * and the second half is compared against the localPart
-     *
-     * i.e.&#160;assert new QName("namespace","localPart").equals("namespace:localPart")
-     *
-     * Intended Usage: for gpath accessors, e.g.&#160;root.'urn:mynamespace:node'
-     *
-     * Warning: this equivalence is not commutative,
-     * i.e.&#160;qname.equals(string) may be true/false  but string.equals(qname) is always false
-     *
-     * <p>
-     * This method satisfies the general contract of the <code>Object.equals</code> method.
-     *
-     * @param o the reference object with which to compare
-     *
-     * @return <code>true</code> if the given object is identical to this
-     *      QName: <code>false</code> otherwise.
-     */
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null) return false;
-        if (o instanceof QName) {
-            final QName qName = (QName) o;
-            if (!namespaceURI.equals(qName.namespaceURI)) return false;
-            return localPart.equals(qName.localPart);
-
-        } else if (o instanceof String) {
-            final String string = (String)o;
-            if (string.length() == 0) return false;
-            int lastColonIndex = string.lastIndexOf(":");
-            if (lastColonIndex < 0 || lastColonIndex == string.length() - 1) return false;
-            final String stringPrefix = string.substring(0,lastColonIndex);
-            final String stringLocalPart = string.substring(lastColonIndex + 1);
-            if (stringPrefix.equals(prefix) || stringPrefix.equals(namespaceURI)) {
-                return localPart.equals(stringLocalPart);
-            }
-            return false;
-        }
-        return false;
-    }
-
-    /**
-     * Tests if this QName matches another object.
-     * <p>
-     * If the given object is not a QName or String equivalent or is null then this method
-     * returns <tt>false</tt>.
-     * <p>
-     * For two QNames to be considered matching requires that both
-     * localPart and namespaceURI must be equal or one of them is a wildcard.
-     *
-     * If the supplied object is a String, then it is split in two on the last colon
-     * and the first half is matched against the prefix || namespaceURI
-     * and the second half is matched against the localPart
-     *
-     * @param o the reference object with which to compare
-     *
-     * @return <code>true</code> if the given object matches
-     * this QName: <code>false</code> otherwise.
-     */
-    public boolean matches(Object o) {
-        if (this == o) return true;
-        if (o == null) return false;
-        if (o instanceof QName) {
-            final QName qName = (QName) o;
-            if (!namespaceURI.equals(qName.namespaceURI) && !namespaceURI.equals("*") && !qName.namespaceURI.equals("*")) return false;
-            return localPart.equals(qName.localPart) || localPart.equals("*") || qName.localPart.equals("*");
-        } else if (o instanceof String) {
-            final String string = (String)o;
-            if (string.length() == 0) return false;
-            // try matching against 'prefix:localname'
-            int lastColonIndex = string.lastIndexOf(":");
-            if (lastColonIndex < 0 && prefix.length() == 0) return string.equals(localPart);
-            if (lastColonIndex < 0 || lastColonIndex == string.length() - 1) return false;
-            final String stringPrefix = string.substring(0,lastColonIndex);
-            final String stringLocalPart = string.substring(lastColonIndex + 1);
-            if (stringPrefix.equals(prefix) || stringPrefix.equals(namespaceURI) || stringPrefix.equals("*")) {
-                return localPart.equals(stringLocalPart) || stringLocalPart.equals("*");
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns a QName holding the value of the specified String.
-     * <p>
-     * The string must be in the form returned by the QName.toString()
-     * method, i.e. "{namespaceURI}localPart", with the "{namespaceURI}"
-     * part being optional.
-     * <p>
-     * This method doesn't do a full validation of the resulting QName.
-     * In particular, it doesn't check that the resulting namespace URI
-     * is a legal URI (per RFC 2396 and RFC 2732), nor that the resulting
-     * local part is a legal NCName per the XML Namespaces specification.
-     *
-     * @param s the string to be parsed
-     * @throws java.lang.IllegalArgumentException If the specified String cannot be parsed as a QName
-     * @return QName corresponding to the given String
-     */
-    public static QName valueOf(String s) {
-
-        if ((s == null) || s.equals("")) {
-            throw new IllegalArgumentException("invalid QName literal");
-        }
-
-        if (s.charAt(0) == '{') {
-            int i = s.indexOf('}');
-
-            if (i == -1) {
-                throw new IllegalArgumentException("invalid QName literal");
-            }
-
-            if (i == s.length() - 1) {
-                throw new IllegalArgumentException("invalid QName literal");
-            } else {
-                return new QName(s.substring(1, i), s.substring(i + 1));
-            }
-        } else {
-            return new QName(s);
-        }
-    }
-
-    /**
-     * Returns a hash code value for this QName object. The hash code
-     * is based on both the localPart and namespaceURI parts of the
-     * QName. This method satisfies the  general contract of the
-     * <code>Object.hashCode</code> method.
-     *
-     * @return a hash code value for this Qname object
-     */
-    public int hashCode() {
-        int result;
-        result = namespaceURI.hashCode();
-        result = 29 * result + localPart.hashCode();
-        return result;
-    }
-} 
\ No newline at end of file


Mime
View raw message