-
debian/patches/0002-ant-build.diff.patch
-
src/main/groovy/util/ObservableMap.java
--- 2.0.0~beta2-1/src/main/groovy/util/ObservableMap.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/util/ObservableMap.java 2012-02-09 20:55:10.000000000 +0000
@@ -325,8 +325,36 @@ public class ObservableMap implements Ma
}
public abstract static class PropertyEvent extends PropertyChangeEvent {
+ /**
+ * deprecated
+ */
+ public static final int ADDED = ChangeType.ADDED.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int UPDATED = ChangeType.UPDATED.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int REMOVED = ChangeType.REMOVED.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int CLEARED = ChangeType.CLEARED.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int MULTI = ChangeType.MULTI.ordinal();
+
private ChangeType type;
+ /**
+ * @deprecated
+ */
+ public PropertyEvent(Object source, String propertyName, Object oldValue, Object newValue, int type) {
+ this(source, propertyName, oldValue, newValue, ChangeType.resolve(type));
+ }
+
public PropertyEvent(Object source, String propertyName, Object oldValue, Object newValue, ChangeType type) {
super(source, propertyName, oldValue, newValue);
this.type = type;
@@ -364,6 +392,10 @@ public class ObservableMap implements Ma
}
public static class PropertyClearedEvent extends PropertyEvent {
+ /**
+ * @deprecated
+ */
+ public static final String CLEAR_PROPERTY = ObservableMap.CLEARED_PROPERTY;
private Map values = new HashMap();
public PropertyClearedEvent(Object source, Map values) {
-
src/main/groovy/util/ObservableList.java
--- 2.0.0~beta2-1/src/main/groovy/util/ObservableList.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/util/ObservableList.java 2012-02-09 20:55:10.000000000 +0000
@@ -503,10 +503,41 @@ public class ObservableList implements L
}
public abstract static class ElementEvent extends PropertyChangeEvent {
+ /**
+ * deprecated
+ */
+ public static final int ADDED = ChangeType.ADDED.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int UPDATED = ChangeType.UPDATED.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int REMOVED = ChangeType.REMOVED.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int CLEARED = ChangeType.CLEARED.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int MULTI_ADD = ChangeType.MULTI_ADD.ordinal();
+ /**
+ * deprecated
+ */
+ public static final int MULTI_REMOVE = ChangeType.MULTI_REMOVE.ordinal();
private final ChangeType type;
private final int index;
+ /**
+ * @deprecated
+ */
+ public ElementEvent(Object source, Object oldValue, Object newValue, int index, int type) {
+ this(source, oldValue, newValue, index, ChangeType.resolve(type));
+ }
+
public ElementEvent(Object source, Object oldValue, Object newValue, int index, ChangeType type) {
super(source, ObservableList.CONTENT_PROPERTY, oldValue, newValue);
this.type = type;
-
src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java
--- 2.0.0~beta2-1/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java 2012-02-09 20:55:10.000000000 +0000
@@ -670,6 +670,7 @@ public class AntlrParserPlugin extends A
ClassNode oldNode = classNode;
enumClass.addAnnotations(annotations);
classNode = enumClass;
+ configureAST(classNode, enumNode);
assertNodeType(OBJBLOCK, node);
objectBlock(node);
classNode = oldNode;
@@ -1207,10 +1208,8 @@ public class AntlrParserPlugin extends A
statement = variableDef(node);
break;
-
case LABELED_STAT:
- statement = labelledStatement(node);
- break;
+ return labelledStatement(node);
case LITERAL_assert:
statement = assertStatement(node);
@@ -1570,8 +1569,7 @@ public class AntlrParserPlugin extends A
// let's do the catch nodes
List<CatchStatement> catches = new ArrayList<CatchStatement>();
for (; node != null && isType(LITERAL_catch, node); node = node.getNextSibling()) {
- final List<CatchStatement> catchStatements = catchStatement(node);
- catches.addAll(catchStatements);
+ catches.add(catchStatement(node));
}
if (isType(LITERAL_finally, node)) {
@@ -1591,37 +1589,17 @@ public class AntlrParserPlugin extends A
return tryCatchStatement;
}
- protected List<CatchStatement> catchStatement(AST catchNode) {
+ protected CatchStatement catchStatement(AST catchNode) {
AST node = catchNode.getFirstChild();
- List<CatchStatement> catches = new LinkedList<CatchStatement>();
- Statement code = statement(node.getNextSibling());
- if (MULTICATCH == node.getType()) {
- AST variableNode = node.getNextSibling();
- final AST multicatches = node.getFirstChild();
- if (multicatches.getType() != MULTICATCH_TYPES) {
- // catch (e)
- // catch (def e)
- String variable = identifier(multicatches);
- Parameter catchParameter = new Parameter(ClassHelper.DYNAMIC_TYPE, variable);
- CatchStatement answer = new CatchStatement(catchParameter, code);
- configureAST(answer, catchNode);
- catches.add(answer);
- } else {
- // catch (Exception e)
- // catch (Exception1 | Exception2 e)
- AST exceptionNodes = multicatches.getFirstChild();
- String variable = identifier(multicatches.getNextSibling());
- while (exceptionNodes != null) {
- ClassNode exceptionType = buildName(exceptionNodes);
- Parameter catchParameter = new Parameter(exceptionType, variable);
- CatchStatement answer = new CatchStatement(catchParameter, code);
- configureAST(answer, catchNode);
- catches.add(answer);
- exceptionNodes = exceptionNodes.getNextSibling();
- }
- }
- }
- return catches;
+ Parameter parameter = parameter(node);
+ ClassNode exceptionType = parameter.getType();
+ String variable = parameter.getName();
+ node = node.getNextSibling();
+ Statement code = statement(node);
+ Parameter catchParameter = new Parameter(exceptionType, variable);
+ CatchStatement answer = new CatchStatement(catchParameter, code);
+ configureAST(answer, catchNode);
+ return answer;
}
protected Statement whileStatement(AST whileNode) {
@@ -2858,8 +2836,9 @@ public class AntlrParserPlugin extends A
private ClassNode addTypeArguments(ClassNode basicType, AST node) {
List<GenericsType> typeArgumentList = getTypeArgumentsList(node);
- // a 0-length type argument list means we face the diamond operator
- basicType.setGenericsTypes(typeArgumentList.toArray(new GenericsType[typeArgumentList.size()]));
+ if (typeArgumentList.size() > 0) {
+ basicType.setGenericsTypes(typeArgumentList.toArray(new GenericsType[typeArgumentList.size()]));
+ }
return basicType;
}
-
src/main/groovy/util/Node.java
-
src/main/groovy/transform/InheritConstructors.java
--- 2.0.0~beta2-1/src/main/groovy/transform/InheritConstructors.java 2011-12-06 17:28:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/transform/InheritConstructors.java 2012-02-07 18:53:16.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2010 the original author or authors.
+ * Copyright 2008-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -101,7 +101,7 @@ import java.lang.annotation.Target;
* this AST transformation. This means that you can't override (i.e. not
* inherit) the constructors with signatures that Groovy adds later.
* If you get it wrong you will get a compile-time error about the duplication.
- * <p>
+ * </p>
*
* @author Paul King
* @since 1.7.3
-
src/main/groovy/swing/factory/ColumnModelFactory.groovy
--- 2.0.0~beta2-1/src/main/groovy/swing/factory/ColumnModelFactory.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/factory/ColumnModelFactory.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -16,6 +16,7 @@
package groovy.swing.factory
+import java.util.logging.Logger
import javax.swing.JTable
import javax.swing.table.TableColumnModel
import groovy.util.logging.Log
-
src/main/groovy/swing/factory/ColumnFactory.groovy
--- 2.0.0~beta2-1/src/main/groovy/swing/factory/ColumnFactory.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/factory/ColumnFactory.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -16,6 +16,7 @@
package groovy.swing.factory
+import java.util.logging.Logger
import javax.swing.table.TableCellRenderer
import javax.swing.table.TableColumn
import javax.swing.table.TableColumnModel
-
--- 2.0.0~beta2-1/gradlew 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/gradlew 2012-02-09 20:55:10.000000000 +0000
@@ -7,25 +7,21 @@
##############################################################################
# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
-# GRADLE_OPTS="$GRADLE_OPTS -Xmx512m"
+GRADLE_OPTS="$GRADLE_OPTS -Xmx640m"
# JAVA_OPTS="$JAVA_OPTS -Xmx512m"
GRADLE_APP_NAME=Gradle
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
warn ( ) {
- echo "$*"
+ echo "${PROGNAME}: $*"
}
die ( ) {
- echo
- echo "$*"
- echo
+ warn "$*"
exit 1
}
+
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
@@ -83,31 +79,12 @@ if [ -z "$JAVACMD" ] ; then
fi
fi
if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
+ die "JAVA_HOME is not defined correctly, can not execute: $JAVACMD"
fi
if [ -z "$JAVA_HOME" ] ; then
warn "JAVA_HOME environment variable is not set"
fi
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name
if $darwin; then
JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME"
@@ -160,7 +137,7 @@ fi
GRADLE_APP_BASE_NAME=`basename "$0"`
-exec "$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
+"$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
-classpath "$CLASSPATH" \
-Dorg.gradle.appname="$GRADLE_APP_BASE_NAME" \
-Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \
-
--- 2.0.0~beta2-1/README.md 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/README.md 2012-02-09 20:55:10.000000000 +0000
@@ -1,47 +1,46 @@
-Groovy
-===
-
-[Groovy][Groovy] is an agile and dynamic language for the Java Virtual Machine. It builds upon the strengths of Java, but has additional power features inspired by languages like Python, Ruby and Smalltalk. Groovy makes modern programming features available to Java developers with almost-zero learning curve as well as supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain. Groovy makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL. It also increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications. Groovy simplifies testing by supporting unit testing and mocking out-of-the-box. Groovy also seamlessly integrates with all existing Java classes and libraries and compiles straight to Java bytecode so you can use it anywhere you can use Java.
-[Groovy]: http://groovy.codehaus.org/
-
-Building
----
-
-To build you will need:
-
-* [JDK 1.5+](http://www.oracle.com/technetwork/java/javase/downloads)
-
-Plus one of the following (Gradle will download itself if needed):
-
-* [Apache Ant 1.7+](http://ant.apache.org)
-* [Gradle 0.9.2+](http://gradle.org/)
-
-For detailed instructions please see:
-
-* [http://groovy.codehaus.org/Building+Groovy+from+Source](http://groovy.codehaus.org/Building+Groovy+from+Source)
-
-To build everything using ant (including running tests and creating a complete installation):
-
- ant install
-
-To build without running tests or creating OSGi information:
-
- ant install -DskipTests=true -DskipOsgi=true
-
-To run tests from gradle (will download gradle the first time):
-
- gradlew test
-
-To build from Eclipse:
-
-* ant install
-* ensure that the M2_REPO classpath variable exists and points to the correct place (typically ~/.m2/repository)
- * To Change this, go to Preferences -> Java -> Build Path -> Classpath variables
-* Project -> Clean... and then build. Should compile with no errors. But if there are errors, then send a message to the groovy users mailing list
-* You will *not* be able to run the tests from inside of Eclipse.
-
-License
----
-
-Groovy is licensed under the terms of the [Apache License, Version 2.0][Apache License, Version 2.0].
-[Apache License, Version 2.0]: http://www.apache.org/licenses/LICENSE-2.0.html
+Groovy
+===
+
+[Groovy][Groovy] is an agile and dynamic language for the Java Virtual Machine. It builds upon the strengths of Java, but has additional power features inspired by languages like Python, Ruby and Smalltalk. Groovy makes modern programming features available to Java developers with almost-zero learning curve as well as supports Domain-Specific Languages and other compact syntax so your code becomes easy to read and maintain. Groovy makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL. It also increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications. Groovy simplifies testing by supporting unit testing and mocking out-of-the-box. Groovy also seamlessly integrates with all existing Java classes and libraries and compiles straight to Java bytecode so you can use it anywhere you can use Java.
+[Groovy]: http://groovy.codehaus.org/
+
+Building
+---
+
+To build you will need:
+
+* [JDK 1.5+](http://www.oracle.com/technetwork/java/javase/downloads)
+
+Plus one of the following (Gradle will download itself if needed):
+* [Apache Ant 1.7+](http://ant.apache.org)
+* [Gradle 0.9.2+](http://gradle.org/)
+
+For detailed instructions please see:
+
+* [http://groovy.codehaus.org/Building+Groovy+from+Source](http://groovy.codehaus.org/Building+Groovy+from+Source)
+
+To build everything using ant (including running tests and creating a complete installation):
+
+ ant install
+
+To build without running tests or creating OSGi information:
+
+ ant install -DskipTests=true -DskipOsgi=true
+
+To run tests from gradle (will download gradle the first time):
+
+ gradlew test
+
+To build from Eclipse:
+
+* ant install
+* ensure that the M2_REPO classpath variable exists and points to the correct place (typically ~/.m2/repository)
+ * To Change this, go to Preferences -> Java -> Build Path -> Classpath variables
+* Project -> Clean... and then build. Should compile with no errors. But if there are errors, then send a message to the groovy users mailing list
+* You will *not* be able to run the tests from inside of Eclipse.
+
+License
+---
+
+Groovy is licensed under the terms of the [Apache License, Version 2.0][Apache License, Version 2.0].
+[Apache License, Version 2.0]: http://www.apache.org/licenses/LICENSE-2.0.html
-
--- 2.0.0~beta2-1/gradle/pomconfigurer.gradle 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/gradle/pomconfigurer.gradle 2012-02-09 20:55:10.000000000 +0000
@@ -23,7 +23,7 @@ project.pomConfigureClosure = {
modelVersion '4.0.0'
groupId 'org.codehaus.groovy'
artifactId 'groovy'
- version '1.9.0-beta-2-SNAPSHOT'
+ version '1.8.6-SNAPSHOT'
name 'Groovy'
description 'Groovy: A powerful, dynamic language for the JVM'
url 'http://groovy.codehaus.org/'
@@ -39,6 +39,7 @@ project.pomConfigureClosure = {
organization 'SpringSource'
roles {
role 'Project Manager'
+ role 'Despot'
role 'Developer'
}
}
@@ -188,6 +189,7 @@ project.pomConfigureClosure = {
email 'blackdrag@gmx.org'
roles {
role 'Developer'
+ role 'Despot'
}
}
developer {
@@ -233,6 +235,7 @@ project.pomConfigureClosure = {
organization 'ASERT, Australia'
roles {
role 'Developer'
+ role 'Despot'
}
}
developer {
@@ -306,6 +309,14 @@ project.pomConfigureClosure = {
role 'Developer'
}
}
+ developer {
+ id 'melix'
+ name 'Cédric Champeau'
+ email 'cedric.champeau@gmail.com'
+ roles {
+ role 'Developer'
+ }
+ }
}
contributors {
contributor {
@@ -443,14 +454,17 @@ project.pomConfigureClosure = {
name 'Adam Murdoch'
}
contributor {
- name 'Cédric Champeau'
- }
- contributor {
name 'David Durham'
}
contributor {
name 'Daniel Henrique Alves Lima'
}
+ contributor {
+ name 'John Wagenleitner'
+ }
+ contributor {
+ name 'Colin Harrington'
+ }
}
mailingLists {
mailingList {
@@ -466,6 +480,13 @@ project.pomConfigureClosure = {
archive 'http://dir.gmane.org/gmane.comp.lang.groovy.user'
}
}
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
scm {
connection 'scm:svn:http://svn.groovy.codehaus.org/browse/groovy/trunk/groovy/groovy-core'
developerConnection 'scm:svn:https://${maven.username}@svn.groovy.codehaus.org/browse/groovy/trunk/groovy/groovy-core'
@@ -558,4 +579,4 @@ project.pomConfigureClosure = {
}
}
}
-}
\ No newline at end of file
+}
-
src/main/groovy/transform/ToString.java
--- 2.0.0~beta2-1/src/main/groovy/transform/ToString.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/transform/ToString.java 2012-02-09 20:55:10.000000000 +0000
@@ -76,8 +76,11 @@ import java.lang.annotation.Target;
* <pre>
* AgedThing(age:5, super:NamedThing(Lassie))
* </pre>
+ * {@code @ToString} can also be used in conjunction with {@code @Canonical} and {@code @Immutable}.
*
* @author Paul King
+ * @see Immutable
+ * @see Canonical
* @since 1.8.0
*/
@java.lang.annotation.Documented
-
src/main/groovy/lang/Binding.java
--- 2.0.0~beta2-1/src/main/groovy/lang/Binding.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/lang/Binding.java 2012-02-09 20:55:10.000000000 +0000
@@ -22,6 +22,7 @@ import java.util.Map;
* Represents the variable bindings of a script which can be altered
* from outside the script object or created outside of a script and passed
* into it.
+ *
* <p> Binding instances are not supposed to be used in a multithreaded context.
*
* @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
@@ -75,6 +76,15 @@ public class Binding extends GroovyObjec
variables = new LinkedHashMap();
variables.put(name, value);
}
+
+ /**
+ * Simple check for whether the binding contains a particular variable or not.
+ *
+ * @param name the name of the variable to check for
+ */
+ public boolean hasVariable(String name) {
+ return variables != null && variables.containsKey(name);
+ }
public Map getVariables() {
if (variables == null)
@@ -107,5 +117,5 @@ public class Binding extends GroovyObjec
setVariable(property, newValue);
}
}
-
+
}
-
src/main/groovy/json/JsonOutput.groovy
--- 2.0.0~beta2-1/src/main/groovy/json/JsonOutput.groovy 2011-12-16 05:24:20.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/json/JsonOutput.groovy 2012-01-24 20:27:40.000000000 +0000
@@ -139,10 +139,12 @@ class JsonOutput {
* @return a JSON object representation for a map
*/
static String toJson(Map m) {
- if(m.containsKey(null)) {
- throw new IllegalArgumentException('Null key for a Map not allowed')
- }
- "{" + m.collect { k, v -> toJson(k.toString()) + ':' + toJson(v) }.join(',') + "}"
+ "{" + m.collect { k, v ->
+ if (k == null) {
+ throw new IllegalArgumentException('Null key for a Map not allowed')
+ }
+ toJson(k.toString()) + ':' + toJson(v)
+ }.join(',') + "}"
}
/**
-
--- 2.0.0~beta2-1/.gradle/1.0-milestone-6/outputFileStates/cache.properties.lock 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/outputFileStates/cache.properties.lock 2012-01-27 14:59:06.000000000 +0000
@@ -0,0 +1 @@
+
\ No newline at end of file
Binary files 2.0.0~beta2-1/.gradle/1.0-milestone-6/taskArtifacts/cache.bin and 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/taskArtifacts/cache.bin differ
-
--- 2.0.0~beta2-1/.gradle/1.0-milestone-6/fileSnapshots/cache.properties.lock 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/fileSnapshots/cache.properties.lock 2012-01-27 14:59:06.000000000 +0000
@@ -0,0 +1 @@
+
\ No newline at end of file
Binary files 2.0.0~beta2-1/.gradle/1.0-milestone-6/outputFileStates/cache.bin and 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/outputFileStates/cache.bin differ
-
src/main/groovy/lang/MetaObjectProtocol.java
--- 2.0.0~beta2-1/src/main/groovy/lang/MetaObjectProtocol.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/lang/MetaObjectProtocol.java 2012-02-09 20:55:10.000000000 +0000
@@ -111,7 +111,7 @@ public interface MetaObjectProtocol {
* argument values to establish the chosen MetaMethod
*
* @param name The name of the MetaMethod
- * @param args Array containing - 1) the argument values (using which their types are then inferred), or 2) the corresponding argument types
+ * @param args Array containing - 1) the argument values (using which their types are then inferred), or 2) the corresponding argument types
* @return A MetaMethod or null if it doesn't exist
*/
MetaMethod getMetaMethod(String name, Object[] args);
-
.pc/0003-disable-bnd.diff.patch/build.xml
-
src/main/groovy/util/GroovyLog.java
--- 2.0.0~beta2-1/src/main/groovy/util/GroovyLog.java 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/util/GroovyLog.java 2012-02-09 20:55:10.000000000 +0000
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2003-2007 the original author or authors.
+ *
+ * Licensed 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 org.codehaus.groovy.runtime.DefaultGroovyMethods;
+
+//
+// FIXME: This class really isn't all that useful. It would be *much* better if there
+// was a simple log API in groovy to dynamically switch to the logging facade that
+// is actually installed.
+//
+
+/**
+ * Represents an arbitrary logging service. By default this outputs to
+ * System.out though derivations of this class could log to Jakarta Commons Logging
+ * or log4j or JDK 1.5 logging etc
+ *
+ * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
+ * @version $Revision$
+ */
+@Deprecated
+public class GroovyLog extends GroovyObjectSupport {
+
+ String prefix;
+
+ /**
+ * Factory method to create new instances
+ */
+ public static GroovyLog newInstance(Class aClass) {
+ return new GroovyLog(aClass);
+ }
+
+ public GroovyLog() {
+ this("");
+ }
+
+ public GroovyLog(Class type) {
+ this(type.getName());
+ }
+
+ public GroovyLog(Object obj) {
+ this(obj.getClass());
+ }
+
+ public GroovyLog(String prefix) {
+ //
+ // FIXME: This kinda sucks as a default... shouldn't tack on any [ or : muck
+ //
+
+ this.prefix = (prefix != null && prefix.length() > 0) ? "[" + prefix + ":" : "[";
+ }
+
+ public Object invokeMethod(String name, Object args) {
+ if (args != null && args.getClass().isArray()) {
+ args = DefaultGroovyMethods.join((Object[])args, ",");
+ }
+
+ //
+ // FIXME: This kinda sucks as an output format, should probably ucase name and then
+ // warp prefix in [] and then output the args. Basically what the SimpleLog
+ // does in JCL.
+ //
+
+ System.out.println(prefix + name + "] " + args);
+
+ return null;
+ }
+}
-
--- 2.0.0~beta2-1/src/bin/groovysh 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/bin/groovysh 2012-02-09 20:55:10.000000000 +0000
@@ -30,4 +30,8 @@ DIRNAME=`dirname "$PRG"`
. "$DIRNAME/startGroovy"
-startGroovy org.codehaus.groovy.tools.shell.Main "$@"
+if [ "x$OLDSHELL" != "x" ]; then
+ startGroovy groovy.ui.InteractiveShell "$@"
+else
+ startGroovy org.codehaus.groovy.tools.shell.Main "$@"
+fi
-
--- 2.0.0~beta2-1/debian/rules 2011-10-15 02:55:46.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/debian/rules 2012-03-15 13:12:40.000000000 +0000
@@ -5,7 +5,6 @@ include /usr/share/cdbs/1/class/ant.mk
PACKAGE := $(DEB_SOURCE_PACKAGE)
VERSION := $(DEB_UPSTREAM_VERSION)
-DEB_UPSTREAM_VERSION := $(shell echo $(DEB_UPSTREAM_VERSION)| sed 's/~beta/-beta-/')
JAVA_HOME := /usr/lib/jvm/default-java
DEB_ANT_BUILDFILE := build.xml
DEB_ANT_BUILD_TARGET := install doc
@@ -15,15 +14,18 @@ DEB_JARS := ant mockobjects-
asm3-util asm3-tree asm3-analysis ivy bnd qdox jarjar jansi ant-nodeps
API_DOCS := target/html/api
+# Ubuntu hack to work around +isreally to backout 2.0.0
+UBUNTU_UPSTREAM_VERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed 's/.*isreally//')
+
binary-post-install/$(PACKAGE)::
chmod a+x debian/groovy/usr/share/groovy/bin/*
sed -i \
-e"1s,.*,#!/bin/sh," \
debian/groovy/usr/share/groovy/bin/startGroovy
- mh_installpoms -p$(PACKAGE)
+ mh_installpoms -p$(PACKAGE)
# without bnd:
- mh_installjar -p$(PACKAGE) -dusr/share/groovy/lib/groovy-$(DEB_UPSTREAM_VERSION).jar -l pom.xml target/dist/groovy.jar
- mh_installjar -p$(PACKAGE) -dusr/share/groovy/embeddable/groovy-all-$(DEB_UPSTREAM_VERSION).jar -l target/groovy-all.pom target/dist/groovy-all.jar
+ mh_installjar -p$(PACKAGE) -dusr/share/groovy/lib/groovy-$(UBUNTU_UPSTREAM_VERSION).jar -l pom.xml target/dist/groovy.jar
+ mh_installjar -p$(PACKAGE) -dusr/share/groovy/embeddable/groovy-all-$(UBUNTU_UPSTREAM_VERSION).jar -l target/groovy-all.pom target/dist/groovy-all.jar
# with bnd:
#mh_installjar -p$(PACKAGE) -dusr/share/groovy/lib/groovy-$(DEB_UPSTREAM_VERSION).jar -l pom.xml target/install/lib/groovy-$(DEB_UPSTREAM_VERSION).jar
#mh_installjar -p$(PACKAGE) -dusr/share/groovy/embeddable/groovy-all-$(DEB_UPSTREAM_VERSION).jar -l target/groovy-all.pom target/install/embeddable/groovy-all-$(DEB_UPSTREAM_VERSION).jar
-
src/main/groovy/servlet/AbstractHttpServlet.java
--- 2.0.0~beta2-1/src/main/groovy/servlet/AbstractHttpServlet.java 2011-08-30 16:20:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/servlet/AbstractHttpServlet.java 2012-02-06 15:05:22.000000000 +0000
@@ -296,13 +296,20 @@ public abstract class AbstractHttpServle
/**
* Parses the http request for the real script or template source file.
- *
- * @param request the http request to analyze
- * @return a file object using an absolute file path name
+ *
+ * @param request
+ * the http request to analyze
+ * @return a file object using an absolute file path name, or <code>null</code> if the
+ * servlet container cannot translate the virtual path to a real
+ * path for any reason (such as when the content is being made
+ * available from a .war archive).
*/
protected File getScriptUriAsFile(HttpServletRequest request) {
String uri = getScriptUri(request);
String real = servletContext.getRealPath(uri);
+ if (real == null) {
+ return null;
+ }
return new File(real).getAbsoluteFile();
}
-
src/main/groovy/beans/BindableASTTransformation.java
--- 2.0.0~beta2-1/src/main/groovy/beans/BindableASTTransformation.java 2011-12-06 17:28:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/beans/BindableASTTransformation.java 2012-02-06 15:05:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2009 the original author or authors.
+ * Copyright 2008-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -267,9 +267,9 @@ public class BindableASTTransformation i
/**
* Snoops through the declaring class and all parents looking for methods
- * void addPropertyChangeListener(PropertyChangeListener),
- * void removePropertyChangeListener(PropertyChangeListener), and
- * void firePropertyChange(String, Object, Object). If any are defined all
+ * <code>void addPropertyChangeListener(PropertyChangeListener)</code>,
+ * <code>void removePropertyChangeListener(PropertyChangeListener)</code>, and
+ * <code>void firePropertyChange(String, Object, Object)</code>. If any are defined all
* must be defined or a compilation error results.
*
* @param declaringClass the class to search
@@ -316,14 +316,18 @@ public class BindableASTTransformation i
* Adds the necessary field and methods to support property change support.
* <p/>
* Adds a new field:
+ * <pre>
* <code>protected final java.beans.PropertyChangeSupport this$PropertyChangeSupport = new java.beans.PropertyChangeSupport(this)</code>"
+ * </pre>
* <p/>
* Also adds support methods:
+ * <pre>
* <code>public void addPropertyChangeListener(java.beans.PropertyChangeListener)</code>
* <code>public void addPropertyChangeListener(String, java.beans.PropertyChangeListener)</code>
* <code>public void removePropertyChangeListener(java.beans.PropertyChangeListener)</code>
* <code>public void removePropertyChangeListener(String, java.beans.PropertyChangeListener)</code>
* <code>public java.beans.PropertyChangeListener[] getPropertyChangeListeners()</code>
+ * </pre>
*
* @param declaringClass the class to which we add the support field and methods
*/
-
--- 2.0.0~beta2-1/benchmark/bench/ary.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/benchmark/bench/ary.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -9,10 +9,10 @@
public class ary {
- public static void main(String[] args) {
+ public static void main(String args[]) {
int i, j, k, n = Integer.parseInt(args[0]);
- int[] x = new int[n];
- int[] y = new int[n];
+ int x[] = new int[n];
+ int y[] = new int[n];
for (i = 0; i < n; i++)
x[i] = i + 1;
-
--- 2.0.0~beta2-1/debian/control 2011-10-15 02:55:46.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/debian/control 2012-03-15 13:06:56.000000000 +0000
@@ -1,7 +1,8 @@
Source: groovy
Section: java
Priority: optional
-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
DM-Upload-Allowed: yes
Uploaders: Torsten Werner <twerner@debian.org>, Varun Hiremath <varun@debian.org>, Ludovic Claude <ludovic.claude@laposte.net>, Miguel Landaeta <miguel@miguel.cc>
Build-Depends: debhelper (>= 7), cdbs
@@ -12,8 +13,8 @@ Build-Depends-Indep: maven-repo-helper,
tofrodos, ivy, libqdox-java, libjarjar-java, libjansi-java
Standards-Version: 3.9.2
Homepage: http://groovy.codehaus.org/
-Vcs-Svn: svn://svn.debian.org/svn/pkg-java/branches/groovy/1.9
-Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/branches/groovy/1.9
+Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/groovy/
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/groovy/
Package: groovy
Architecture: all
-
--- 2.0.0~beta2-1/build.gradle 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/build.gradle 2012-02-09 20:55:10.000000000 +0000
@@ -27,12 +27,12 @@ configurations {
dependencies {
groovy files("$buildDir/classes")
- groovy "asm:asm:3.3.1"
+ groovy "asm:asm:3.2"
groovy "antlr:antlr:2.7.7"
- groovy "asm:asm-commons:3.3.1"
- groovy "asm:asm-util:3.3.1"
- groovy "asm:asm-analysis:3.3.1"
- groovy "asm:asm-tree:3.3.1"
+ groovy "asm:asm-commons:3.2"
+ groovy "asm:asm-util:3.2"
+ groovy "asm:asm-analysis:3.2"
+ groovy "asm:asm-tree:3.2"
compile("bsf:bsf:2.4.0") {
exclude(group: 'commons-logging', module: 'commons-logging')
@@ -76,7 +76,7 @@ dependencies {
// todo this was provided
compile "org.livetribe:livetribe-jsr223:2.0.6"
- tools "com.googlecode.jarjar:jarjar:1.1"
+ tools "com.google.code:jarjar:1.1"
tools("checkstyle:checkstyle:4.4") {
exclude(module: 'junit')
}
@@ -86,7 +86,7 @@ dependencies {
exclude(module: 'asm')
exclude(module: 'ant')
}
- tools "asm:asm:3.3.1"
+ tools "asm:asm:3.2"
tools "com.thoughtworks.qdox:qdox:1.12"
tools "biz.aQute:bnd:0.0.401"
-
src/main/groovy/xml/MarkupBuilder.java
--- 2.0.0~beta2-1/src/main/groovy/xml/MarkupBuilder.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/xml/MarkupBuilder.java 2012-02-09 20:55:10.000000000 +0000
@@ -310,7 +310,40 @@ public class MarkupBuilder extends Build
protected Object getName(String methodName) {
return super.getName(methodName);
}
-
+
+ /**
+ * Returns a String with special XML characters escaped as entities so that
+ * output XML is valid. Escapes the following characters as corresponding
+ * entities:
+ * <ul>
+ * <li>\' as &apos;</li>
+ * <li>& as &amp;</li>
+ * <li>< as &lt;</li>
+ * <li>> as &gt;</li>
+ * </ul>
+ *
+ * @param value to be searched and replaced for XML special characters.
+ * @return value with XML characters escaped
+ * @see #escapeXmlValue(String, boolean)
+ * @deprecated
+ */
+ protected String transformValue(String value) {
+ // & has to be checked and replaced before others
+ if (value.matches(".*&.*")) {
+ value = value.replaceAll("&", "&");
+ }
+ if (value.matches(".*\\'.*")) {
+ value = value.replaceAll("\'", "'");
+ }
+ if (value.matches(".*<.*")) {
+ value = value.replaceAll("<", "<");
+ }
+ if (value.matches(".*>.*")) {
+ value = value.replaceAll(">", ">");
+ }
+ return value;
+ }
+
/**
* Escapes a string so that it can be used directly as an XML
* attribute value.
-
--- 2.0.0~beta2-1/gradlew.bat 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/gradlew.bat 2012-02-09 20:55:10.000000000 +0000
@@ -5,6 +5,10 @@
@rem ##
@rem ##########################################################################
+@rem
+@rem $Revision: 10602 $ $Date: 2008-01-25 02:49:54 +0100 (ven., 25 janv. 2008) $
+@rem
+
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@@ -15,29 +19,69 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.\
-@rem Find java.exe
-set JAVA_EXE=java.exe
-if not defined JAVA_HOME goto init
-
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
+@rem Determine the command interpreter to execute the "CD" later
+set COMMAND_COM="cmd.exe"
+if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
+if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"
+
+@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
+set FIND_EXE="find.exe"
+if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
+if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"
+
+:check_JAVA_HOME
+@rem Make sure we have a valid JAVA_HOME
+if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo ERROR: Environment variable JAVA_HOME has not been set.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.
goto end
+:have_JAVA_HOME
+@rem Validate JAVA_HOME
+%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
+if not errorlevel 1 goto init
+
+echo.
+echo ERROR: JAVA_HOME might be set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation if there are problems.
+echo.
+
:init
+@rem get name of script to launch with full path
@rem Get command-line arguments, handling Windowz variants
+SET _marker=%JAVA_HOME: =%
+@rem IF NOT "%_marker%" == "%JAVA_HOME%" ECHO JAVA_HOME "%JAVA_HOME%" contains spaces. Please change to a location without spaces if this causes problems.
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%eval[2+2]" == "4" goto 4NT_args
+IF "%_marker%" == "%JAVA_HOME%" goto :win9xME_args
+
+set _FIXPATH=
+call :fixpath "%JAVA_HOME%"
+set JAVA_HOME=%_FIXPATH:~1%
+
+goto win9xME_args
+
+:fixpath
+if not %1.==. (
+for /f "tokens=1* delims=;" %%a in (%1) do (
+call :shortfilename "%%a" & call :fixpath "%%b"
+)
+)
+goto :EOF
+:shortfilename
+for %%i in (%1) do set _FIXPATH=%_FIXPATH%;%%~fsi
+goto :EOF
+
+
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
@@ -59,10 +103,10 @@ set CMD_LINE_ARGS=%$
set STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
set CLASSPATH=%DIRNAME%\gradle\wrapper\gradle-wrapper.jar
set WRAPPER_PROPERTIES=%DIRNAME%\gradle\wrapper\gradle-wrapper.properties
+set JAVA_EXE=%JAVA_HOME%\bin\java.exe
set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%"
-@rem Execute Gradle
"%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS%
:end
-
src/main/groovy/swing/factory/WidgetFactory.groovy
--- 2.0.0~beta2-1/src/main/groovy/swing/factory/WidgetFactory.groovy 2011-08-30 16:20:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/factory/WidgetFactory.groovy 2012-02-07 18:53:16.000000000 +0000
@@ -18,6 +18,8 @@ package groovy.swing.factory
import java.awt.Component
import java.awt.Window
+import javax.swing.JComponent
+import static groovy.swing.factory.LayoutFactory.DEFAULT_DELEGATE_PROPERTY_CONSTRAINT
public class WidgetFactory extends AbstractFactory {
@@ -52,6 +54,9 @@ public class WidgetFactory extends Abstr
def constraints = builder.context.constraints
if (constraints != null) {
LayoutFactory.getLayoutTarget(parent).add(child, constraints)
+ if (child instanceof JComponent) {
+ child.putClientProperty(DEFAULT_DELEGATE_PROPERTY_CONSTRAINT, constraints)
+ }
builder.context.remove('constraints')
} else {
LayoutFactory.getLayoutTarget(parent).add(child)
-
src/main/groovy/lang/MetaClassImpl.java
--- 2.0.0~beta2-1/src/main/groovy/lang/MetaClassImpl.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/lang/MetaClassImpl.java 2012-02-09 20:55:10.000000000 +0000
@@ -76,21 +76,9 @@ import java.lang.reflect.Modifier;
import java.lang.reflect.Proxy;
import java.net.URL;
import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
/**
* Allows methods to be dynamically added to existing classes at runtime
@@ -119,6 +107,11 @@ public class MetaClassImpl implements Me
private static final Class[] METHOD_MISSING_ARGS = new Class[]{String.class, Object.class};
private static final Class[] GETTER_MISSING_ARGS = new Class[]{String.class};
private static final Class[] SETTER_MISSING_ARGS = METHOD_MISSING_ARGS;
+ private static final Comparator<CachedClass> CACHED_CLASS_NAME_COMPARATOR = new Comparator<CachedClass>() {
+ public int compare(final CachedClass o1, final CachedClass o2) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ };
protected final Class theClass;
protected final CachedClass theCachedClass;
@@ -878,6 +871,7 @@ public class MetaClassImpl implements Me
/**
* Invokes the given method on the object.
+ * TODO: should this be deprecated? If so, we have to propogate to many places.
*/
public Object invokeMethod(Object object, String methodName, Object[] originalArguments) {
return invokeMethod(theClass, object, methodName, originalArguments, false, false);
@@ -1368,6 +1362,15 @@ public class MetaClassImpl implements Me
}
}
+ /**
+ * Warning, this method will be removed
+ *
+ * @deprecated use invokeConstructor instead
+ */
+ public Object invokeConstructorAt(Class at, Object[] arguments) {
+ return invokeConstructor(arguments);
+ }
+
public Object invokeConstructor(Object[] arguments) {
return invokeConstructor(theClass, arguments);
}
@@ -1933,21 +1936,27 @@ public class MetaClassImpl implements Me
* This will build up the property map (Map of MetaProperty objects, keyed on
* property name).
*/
+ @SuppressWarnings("unchecked")
private void setupProperties(PropertyDescriptor[] propertyDescriptors) {
if (theCachedClass.isInterface) {
LinkedList<CachedClass> superClasses = new LinkedList<CachedClass>();
superClasses.add(ReflectionCache.OBJECT_CLASS);
Set interfaces = theCachedClass.getInterfaces();
- classPropertyIndexForSuper = classPropertyIndex;
- final SingleKeyHashMap cPI = classPropertyIndex.getNotNull(theCachedClass);
- for (Iterator interfaceIter = interfaces.iterator(); interfaceIter.hasNext();) {
- CachedClass iclass = (CachedClass) interfaceIter.next();
- SingleKeyHashMap iPropertyIndex = cPI;
+ LinkedList<CachedClass> superInterfaces = new LinkedList<CachedClass>(interfaces);
+ // sort interfaces so that we may ensure a deterministic behaviour in case of
+ // ambiguous fields (class implementing two interfaces using the same field)
+ if (superInterfaces.size()>1) {
+ Collections.sort(superInterfaces, CACHED_CLASS_NAME_COMPARATOR);
+ }
+
+ SingleKeyHashMap iPropertyIndex = classPropertyIndex.getNotNull(theCachedClass);
+ for (CachedClass iclass : superInterfaces) {
+ SingleKeyHashMap sPropertyIndex = classPropertyIndex.getNotNull(iclass);
+ copyNonPrivateFields(sPropertyIndex, iPropertyIndex);
addFields(iclass, iPropertyIndex);
- classPropertyIndex.put(iclass, iPropertyIndex);
}
- classPropertyIndex.put(ReflectionCache.OBJECT_CLASS, cPI);
+ addFields(theCachedClass, iPropertyIndex);
applyPropertyDescriptors(propertyDescriptors);
applyStrayPropertyMethods(superClasses, classPropertyIndex, true);
@@ -1955,7 +1964,12 @@ public class MetaClassImpl implements Me
makeStaticPropertyIndex();
} else {
LinkedList<CachedClass> superClasses = getSuperClasses();
- Set interfaces = theCachedClass.getInterfaces();
+ LinkedList<CachedClass> interfaces = new LinkedList<CachedClass>(theCachedClass.getInterfaces());
+ // sort interfaces so that we may ensure a deterministic behaviour in case of
+ // ambiguous fields (class implementing two interfaces using the same field)
+ if (interfaces.size()>1) {
+ Collections.sort(interfaces, CACHED_CLASS_NAME_COMPARATOR);
+ }
// if this an Array, then add the special read-only "length" property
if (theCachedClass.isArray) {
@@ -1964,7 +1978,7 @@ public class MetaClassImpl implements Me
classPropertyIndex.put(theCachedClass, map);
}
- inheritStaticInterfaceFields(superClasses, interfaces);
+ inheritStaticInterfaceFields(superClasses, new LinkedHashSet(interfaces));
inheritFields(superClasses);
applyPropertyDescriptors(propertyDescriptors);
@@ -2924,6 +2938,10 @@ public class MetaClassImpl implements Me
Method[] listenerMethods = descriptor.getListenerMethods();
for (Method listenerMethod : listenerMethods) {
final MetaMethod metaMethod = CachedMethod.find(descriptor.getAddListenerMethod());
+ // GROOVY-5202
+ // there might be a non public listener of some kind
+ // we skip that here
+ if (metaMethod==null) continue;
addToAllMethodsIfPublic(metaMethod);
String name = listenerMethod.getName();
if (listeners.containsKey(name)) {
@@ -3307,6 +3325,13 @@ public class MetaClassImpl implements Me
}
/**
+ * @deprecated use pickMethod instead
+ */
+ protected MetaMethod retrieveMethod(String methodName, Class[] arguments) {
+ return pickMethod(methodName, arguments);
+ }
+
+ /**
* remove all method call cache entries. This should be done if a
* method is added during runtime, but not by using a category.
*/
-
src/main/groovy/text/GStringTemplateEngine.java
--- 2.0.0~beta2-1/src/main/groovy/text/GStringTemplateEngine.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/text/GStringTemplateEngine.java 2012-02-09 20:55:10.000000000 +0000
@@ -177,12 +177,12 @@ public class GStringTemplateEngine exten
templateExpressions.append("}.asWritable()}");
- final GroovyClassLoader loader = parentLoader instanceof GroovyClassLoader?(GroovyClassLoader)parentLoader:(
+ final GroovyClassLoader loader =
(GroovyClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return new GroovyClassLoader(parentLoader);
}
- }));
+ });
final Class groovyClass;
try {
groovyClass = loader.parseClass(new GroovyCodeSource(templateExpressions.toString(), "GStringTemplateScript" + counter++ + ".groovy", "x"));
-
src/main/groovy/xml/XmlUtil.java
--- 2.0.0~beta2-1/src/main/groovy/xml/XmlUtil.java 2011-12-06 17:28:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/xml/XmlUtil.java 2012-02-06 15:03:26.000000000 +0000
@@ -15,6 +15,7 @@
*/
package groovy.xml;
+import groovy.lang.GroovyRuntimeException;
import groovy.lang.Writable;
import groovy.util.Node;
import groovy.util.XmlNodePrinter;
@@ -253,7 +254,7 @@ public class XmlUtil {
transformer.transform(source, target);
}
catch (TransformerException e) {
- // ignore
+ throw new GroovyRuntimeException(e.getMessage());
}
}
-
src/main/groovy/lang/GroovyClassLoader.java
--- 2.0.0~beta2-1/src/main/groovy/lang/GroovyClassLoader.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/lang/GroovyClassLoader.java 2012-02-09 20:55:10.000000000 +0000
@@ -147,6 +147,18 @@ public class GroovyClassLoader extends U
}
/**
+ * Loads the given class node returning the implementation Class
+ *
+ * @param classNode
+ * @return a class
+ * @deprecated
+ */
+ public Class defineClass(ClassNode classNode, String file) {
+ //return defineClass(classNode, file, "/groovy/defineClass");
+ throw new DeprecationException("the method GroovyClassLoader#defineClass(ClassNode, String) is no longer used and removed");
+ }
+
+ /**
* Loads the given class node returning the implementation Class.
* <p/>
* WARNING: this compilation is not synchronized
@@ -213,6 +225,17 @@ public class GroovyClassLoader extends U
Math.abs(text.hashCode()) + ".groovy");
}
+ /**
+ * Parses the given character stream into a Java class capable of being run
+ *
+ * @param in an InputStream
+ * @return the main class defined in the given script
+ * @deprecated Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
+ */
+ public Class parseClass(InputStream in) throws CompilationFailedException {
+ return parseClass(in, generateScriptName());
+ }
+
public synchronized String generateScriptName() {
scriptNameCounter++;
return "script" + scriptNameCounter + ".groovy";
@@ -329,6 +352,27 @@ public class GroovyClassLoader extends U
return ret;
}
+ /**
+ * expands the classpath
+ *
+ * @param pathList an empty list that will contain the elements of the classpath
+ * @param classpath the classpath specified as a single string
+ * @deprecated
+ */
+ protected void expandClassPath(List pathList, String base, String classpath, boolean isManifestClasspath) {
+ throw new DeprecationException("the method groovy.lang.GroovyClassLoader#expandClassPath(List,String,String,boolean) is no longer used internally and removed");
+ }
+
+ /**
+ * A helper method to allow bytecode to be loaded. spg changed name to
+ * defineClass to make it more consistent with other ClassLoader methods
+ *
+ * @deprecated
+ */
+ protected Class defineClass(String name, byte[] bytecode, ProtectionDomain domain) {
+ throw new DeprecationException("the method groovy.lang.GroovyClassLoader#defineClass(String,byte[],ProtectionDomain) is no longer used internally and removed");
+ }
+
protected PermissionCollection getPermissions(CodeSource codeSource) {
PermissionCollection perms;
try {
@@ -832,6 +876,10 @@ public class GroovyClassLoader extends U
return ret;
}
+ private URL getSourceFile(String name) {
+ return getSourceFile(name, config.getDefaultScriptExtension());
+ }
+
/**
* Decides if the given source is newer than a class.
*
-
--- 2.0.0~beta2-1/build.properties 2011-12-23 19:01:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/build.properties 2012-02-09 22:26:34.000000000 +0000
@@ -1,6 +1,6 @@
-groovyVersion = 2.0.0-beta-2
+groovyVersion = 1.8.6
# bundle version format: major('.'minor('.'micro('.'qualifier)?)?)? (first 3 only digits)
-groovyBundleVersion = 2.0.0.beta-2
+groovyBundleVersion = 1.8.6
# Many people have reported problems testing UberTestCaseGroovySourceSubPackages, others have no difficulties with the default
# values ant junit task uses. The decision has been taken to provide the values to try and cause the least
-
src/main/groovy/time/BaseDuration.java
--- 2.0.0~beta2-1/src/main/groovy/time/BaseDuration.java 2011-08-30 16:20:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/time/BaseDuration.java 2012-02-07 18:53:16.000000000 +0000
@@ -27,7 +27,7 @@ import java.util.ArrayList;
* @see Duration
* @author John Wilson tug@wilson.co.uk
*/
-public abstract class BaseDuration {
+public abstract class BaseDuration implements Comparable<BaseDuration> {
protected final int years;
protected final int months;
protected final int days;
@@ -118,6 +118,10 @@ public abstract class BaseDuration {
public abstract From getFrom();
+ public int compareTo(BaseDuration otherDuration) {
+ return Long.signum(toMilliseconds() - otherDuration.toMilliseconds());
+ }
+
public abstract static class From {
public abstract Date getNow();
-
src/main/groovy/lang/PackageScope.java
--- 2.0.0~beta2-1/src/main/groovy/lang/PackageScope.java 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/lang/PackageScope.java 2012-02-09 20:55:10.000000000 +0000
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2008-2010 the original author or authors.
+ *
+ * Licensed 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.lang;
+
+import org.codehaus.groovy.transform.GroovyASTTransformationClass;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class or field annotation used for turning off Groovy's auto property
+ * conversion of default or package scoped fields. Place it on the field(s)
+ * of interest or on the class to apply for all package-scoped fields.
+ *
+ * This transformation is normally only used in conjunction with a third-party
+ * library or framework which requires package scoping.
+ *
+ * @author Paul King
+ * @deprecated use groovy.transform.PackageScope
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.FIELD})
+@GroovyASTTransformationClass("org.codehaus.groovy.transform.PackageScopeASTTransformation")
+@Deprecated
+public @interface PackageScope {
+}
\ No newline at end of file
-
src/main/groovy/util/ConfigObject.groovy
--- 2.0.0~beta2-1/src/main/groovy/util/ConfigObject.groovy 2011-12-16 05:24:20.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/util/ConfigObject.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -101,7 +101,7 @@ class ConfigObject extends LinkedHashMap
* @return The result of the merge
*/
Map merge(ConfigObject other) {
- return doMerge(this,other)
+ return merge(this,other)
}
@@ -128,7 +128,7 @@ class ConfigObject extends LinkedHashMap
return props
}
- private doMerge(Map config, Map other) {
+ private merge(Map config, Map other) {
for(entry in other) {
def configEntry = config[entry.key]
@@ -139,7 +139,7 @@ class ConfigObject extends LinkedHashMap
else {
if(configEntry instanceof Map && configEntry.size() > 0 && entry.value instanceof Map) {
// recur
- doMerge(configEntry, entry.value)
+ merge(configEntry, entry.value)
}
else {
config[entry.key] = entry.value
-
src/main/groovy/swing/factory/RootPaneContainerFactory.groovy
--- 2.0.0~beta2-1/src/main/groovy/swing/factory/RootPaneContainerFactory.groovy 2011-08-30 16:20:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/factory/RootPaneContainerFactory.groovy 2012-02-07 18:53:16.000000000 +0000
@@ -18,7 +18,9 @@ package groovy.swing.factory
import java.awt.Component
import java.awt.Window
+import javax.swing.JComponent
import javax.swing.JButton
+import static groovy.swing.factory.LayoutFactory.DEFAULT_DELEGATE_PROPERTY_CONSTRAINT
abstract class RootPaneContainerFactory extends AbstractFactory {
@@ -33,6 +35,9 @@ abstract class RootPaneContainerFactory
def constraints = builder.context.constraints
if (constraints != null) {
parent.contentPane.add(child, constraints)
+ if (child instanceof JComponent) {
+ child.putClientProperty(DEFAULT_DELEGATE_PROPERTY_CONSTRAINT, constraints)
+ }
builder.context.remove('constraints')
} else {
parent.contentPane.add(child)
-
--- 2.0.0~beta2-1/debian/orig-tar.sh 2011-10-15 02:55:46.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/debian/orig-tar.sh 2012-03-15 13:06:56.000000000 +0000
@@ -2,8 +2,7 @@
# called by uscan with '--upstream-version' <version> <file>
TAR=../groovy_$2.orig.tar.gz
-VERSION=$(echo $2 | sed 's/~beta/-beta-/g')
-DIR=groovy-$VERSION
+DIR=groovy-$2
# clean up the upstream tarball
unzip $3
-
--- 2.0.0~beta2-1/.gradle/1.0-milestone-6/fileHashes/cache.properties.lock 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/fileHashes/cache.properties.lock 2012-01-27 14:59:06.000000000 +0000
@@ -0,0 +1 @@
+
\ No newline at end of file
Binary files 2.0.0~beta2-1/.gradle/1.0-milestone-6/fileSnapshots/cache.bin and 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/fileSnapshots/cache.bin differ
-
--- 2.0.0~beta2-1/debian/patches/0003-disable-bnd.diff.patch 2011-10-15 02:55:46.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/debian/patches/0003-disable-bnd.diff.patch 2012-03-15 13:06:56.000000000 +0000
@@ -11,13 +11,12 @@ diff --git a/build.xml b/build.xml
index ab54309..e97dfce 100644
--- a/build.xml
+++ b/build.xml
-@@ -635,7 +635,7 @@ $Date: 2010-04-02 16:02:23 +0200 (Fr, 02. Apr 2010) $
- </move>
- </target>
-
-- <target name="install" depends="createJars,updateJarsForOsgi,skipOsgi" unless="testFailed"
-+ <target name="install" depends="createJars,skipOsgi" unless="testFailed"
- description="Create an installation hierarchy in target/install.">
-
- <!--
---
+@@ -644,7 +644,7 @@
+ </move>
+ </target>
+
+- <target name="install" depends="createJars,updateJarsForOsgi,skipOsgi" unless="testFailed"
++ <target name="install" depends="createJars,skipOsgi" unless="testFailed"
+ description="Create an installation hierarchy in target/install.">
+
+ <!--
-
--- 2.0.0~beta2-1/.gradle/1.0-milestone-6/fileSnapshots/cache.properties 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/fileSnapshots/cache.properties 2012-01-27 14:18:30.000000000 +0000
@@ -0,0 +1 @@
+#Fri Jan 27 09:48:29 CET 2012
-
src/main/groovy/transform/Immutable.java
--- 2.0.0~beta2-1/src/main/groovy/transform/Immutable.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/transform/Immutable.java 2012-02-09 20:55:10.000000000 +0000
@@ -87,7 +87,13 @@ import java.lang.annotation.Target;
* </ul>
* <p/>
* Immutable classes are particularly useful for functional and concurrent styles of programming
- * and for use as key values within maps.
+ * and for use as key values within maps. If you want similar functionality to what this annotation
+ * provides but don't need immutability then consider using {@code @Canonical}.
+ * <p/>
+ * Customising behaviour:
+ * <p/>
+ * You can customise the toString() method provided for you by {@code @Immutable}
+ * by also adding the {@code @ToString} annotation to your class definition.
* <p/>
* Limitations:
* <ul>
@@ -113,6 +119,8 @@ import java.lang.annotation.Target;
* </ul>
*
* @author Paul King
+ * @see ToString
+ * @see Canonical
* @since 1.7
*/
@java.lang.annotation.Documented
-
src/main/groovy/inspect/swingui/TableSorter.java
--- 2.0.0~beta2-1/src/main/groovy/inspect/swingui/TableSorter.java 2011-12-06 17:28:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/inspect/swingui/TableSorter.java 2012-02-06 15:03:26.000000000 +0000
@@ -193,7 +193,6 @@ space and avoid unnecessary heap allocat
}
public void tableChanged(TableModelEvent e) {
- System.out.println("Sorter: tableChanged");
reallocateIndexes();
super.tableChanged(e);
-
src/main/groovy/swing/factory/TableLayoutFactory.groovy
--- 2.0.0~beta2-1/src/main/groovy/swing/factory/TableLayoutFactory.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/factory/TableLayoutFactory.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -33,7 +33,7 @@ public class TableLayoutFactory extends
public void setParent(FactoryBuilderSupport builder, Object parent, Object child) {
if (builder.getParentFactory()) {
- builder.getParentFactory().setChild (builder, parent, child);
+ builder.getParentFactory().setChild (builder, parent, child.getComponent());
}
}
}
-
src/main/groovy/sql/GroovyRowResult.java
--- 2.0.0~beta2-1/src/main/groovy/sql/GroovyRowResult.java 2011-08-30 16:20:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/sql/GroovyRowResult.java 2012-02-06 15:05:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 the original author or authors.
+ * Copyright 2003-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,20 +47,10 @@ public class GroovyRowResult extends Gro
*/
public Object getProperty(String property) {
try {
- Object value = result.get(property);
- if (value != null)
- return value;
- // if property exists and value is null, return null
- if (result.containsKey(property))
- return null;
- // with some databases/drivers, the columns names are stored uppercase.
- String propertyUpper = property.toUpperCase();
- value = result.get(propertyUpper);
- if (value != null)
- return value;
- // if property exists and value is null, return null
- if (result.containsKey(propertyUpper))
- return null;
+ Object key = lookupKeyIgnoringCase(property);
+ if (key != null) {
+ return result.get(key);
+ }
throw new MissingPropertyException(property, GroovyRowResult.class);
}
catch (Exception e) {
@@ -68,6 +58,22 @@ public class GroovyRowResult extends Gro
}
}
+ private Object lookupKeyIgnoringCase(Object key) {
+ // try some special cases first for efficiency
+ if (result.containsKey(key))
+ return key;
+ if (!(key instanceof CharSequence))
+ return null;
+ String keyStr = key.toString();
+ for (Object next : result.keySet()) {
+ if (!(next instanceof String))
+ continue;
+ if (keyStr.equalsIgnoreCase((String)next))
+ return next;
+ }
+ return null;
+ }
+
/**
* Retrieve the value of the property by its index.
* A negative index will count backwards from the last column.
@@ -90,7 +96,7 @@ public class GroovyRowResult extends Gro
it.next();
i++;
}
- return (obj);
+ return obj;
}
catch (Exception e) {
throw new MissingPropertyException(Integer.toString(index), GroovyRowResult.class, e);
@@ -98,12 +104,12 @@ public class GroovyRowResult extends Gro
}
public String toString() {
- return (result.toString());
+ return result.toString();
}
/*
* The following methods are needed for implementing the Map interface.
- * They are just delegating the request to the internal LinkedHashMap
+ * They are mostly delegating the request to the provided Map.
*/
public void clear() {
@@ -111,7 +117,7 @@ public class GroovyRowResult extends Gro
}
public boolean containsKey(Object key) {
- return result.containsKey(key);
+ return lookupKeyIgnoringCase(key) != null;
}
public boolean containsValue(Object value) {
@@ -129,8 +135,7 @@ public class GroovyRowResult extends Gro
public Object get(Object property) {
if (property instanceof String)
return getProperty((String)property);
- else
- return null;
+ return null;
}
public int hashCode() {
@@ -153,8 +158,8 @@ public class GroovyRowResult extends Gro
result.putAll(t);
}
- public Object remove(Object key) {
- return result.remove(key);
+ public Object remove(Object rawKey) {
+ return result.remove(lookupKeyIgnoringCase(rawKey));
}
public int size() {
-
--- 2.0.0~beta2-1/.gradle/1.0-milestone-6/taskArtifacts/cache.properties.lock 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/taskArtifacts/cache.properties.lock 2012-01-27 14:59:06.000000000 +0000
@@ -0,0 +1 @@
+
\ No newline at end of file
-
src/main/org/codehaus/groovy/ant/Groovyc.java
--- 2.0.0~beta2-1/src/main/org/codehaus/groovy/ant/Groovyc.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/org/codehaus/groovy/ant/Groovyc.java 2012-02-09 20:55:10.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2010 the original author or authors.
+ * Copyright 2003-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,11 +36,11 @@ import org.apache.tools.ant.util.SourceF
import org.codehaus.groovy.control.CompilationUnit;
import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.control.SourceExtensionHandler;
+import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.codehaus.groovy.tools.ErrorReporter;
import org.codehaus.groovy.tools.FileSystemCompiler;
import org.codehaus.groovy.tools.RootLoader;
import org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit;
-import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import java.io.File;
import java.io.FileWriter;
@@ -51,6 +51,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedHashSet;
@@ -750,7 +751,7 @@ public class Groovyc extends MatchingTas
String optionStr = st.nextToken();
String replaced = optionStr.replace("-X", "-FX");
if(optionStr == replaced) {
- replaced = optionStr.replace("-W", "-FW"); // GROOVY-5063
+ replaced = optionStr.replace("-W", "-FW"); // GROOVY-5063
}
jointOptions.add(replaced);
}
@@ -862,6 +863,7 @@ public class Groovyc extends MatchingTas
final Execute executor = new Execute(); // new LogStreamHandler ( attributes , Project.MSG_INFO , Project.MSG_WARN ) ) ;
executor.setAntRun(getProject());
executor.setWorkingDirectory(getProject().getBaseDir());
+ executor.setEnvironment(addClasspathToEnvironment(executor.getEnvironment(), classpath.toString()));
executor.setCommandline(commandLine);
try {
executor.execute();
@@ -937,6 +939,12 @@ public class Groovyc extends MatchingTas
}
}
+ private String[] addClasspathToEnvironment(String[] oldEnvironment, String classpath) {
+ List<String> newEnvironmentList = (oldEnvironment == null) ? new ArrayList<String>() : Arrays.asList(oldEnvironment);
+ newEnvironmentList.add("classpath=" + classpath);
+ return newEnvironmentList.toArray(new String[newEnvironmentList.size()]);
+ }
+
protected CompilationUnit makeCompileUnit() {
Map<String, Object> options = configuration.getJointCompilationOptions();
if (options != null) {
-
src/main/groovy/transform/Canonical.java
--- 2.0.0~beta2-1/src/main/groovy/transform/Canonical.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/transform/Canonical.java 2012-02-09 20:55:10.000000000 +0000
@@ -77,6 +77,9 @@ import java.lang.annotation.Target;
* If an "underscore" version of the respective method already exists, then no default implementation is provided.
* </ul>
* <p/>
+ * If you want similar functionality to what this annotation provides but also require immutability, see the
+ * {@code @Immutable} annotation.
+ * <p/>
* Limitations:
* <ul>
* <li>
@@ -88,6 +91,7 @@ import java.lang.annotation.Target;
* @see groovy.transform.EqualsAndHashCode
* @see groovy.transform.ToString
* @see groovy.transform.TupleConstructor
+ * @see groovy.transform.Immutable
* @since 1.8.0
*/
@java.lang.annotation.Documented
-
src/main/groovy/swing/impl/ComponentFacade.java
--- 2.0.0~beta2-1/src/main/groovy/swing/impl/ComponentFacade.java 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/impl/ComponentFacade.java 2012-02-09 20:55:10.000000000 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2003-2007 the original author or authors.
+ *
+ * Licensed 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.swing.impl;
+
+import java.awt.Component;
+
+/**
+ * A facade to an object which contains a component.
+ *
+ * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
+ * @version $Revision$
+ * @deprecated This interface is no longer used internally and there
+ * exists no equivalent functionality
+ * Superceded by FactoryBuilderSupport handling.
+ */
+public interface ComponentFacade {
+ Component getComponent();
+}
-
--- 2.0.0~beta2-1/.classpath 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.classpath 2012-02-09 20:55:10.000000000 +0000
@@ -1,13 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main"/>
- <classpathentry excluding="groovy/bugs/Groovy1759_Bug.groovy|groovy/MultiCatchTest.groovy|org/codehaus/groovy/benchmarks/alioth/|groovy/PropertyTest.groovy|groovy/annotations/package-info.groovy" kind="src" output="bin" path="src/test"/>
- <classpathentry kind="src" path="subprojects/groovy-bsf/src/main/java"/>
- <classpathentry kind="src" output="bin" path="subprojects/groovy-bsf/src/test/java"/>
- <classpathentry kind="src" path="subprojects/groovy-jmx/src/main/groovy"/>
- <classpathentry kind="src" path="subprojects/groovy-jmx/src/main/java"/>
- <classpathentry kind="src" output="bin" path="subprojects/groovy-jmx/src/test/groovy"/>
- <classpathentry kind="src" output="bin" path="subprojects/groovy-jmx/src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.8.1/ant-1.8.1.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/jsp-api/2.0/jsp-api-2.0.jar"/>
@@ -16,7 +10,7 @@
<classpathentry kind="var" path="M2_REPO/bsf/bsf/2.4.0/bsf-2.4.0.jar"/>
<classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/>
<classpathentry kind="var" path="M2_REPO/jmock/jmock-cglib/1.2.0/jmock-cglib-1.2.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-junit/1.8.2/ant-junit-1.8.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-junit/1.8.1/ant-junit-1.8.1.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.0/commons-cli-1.0.jar"/>
<classpathentry kind="var" path="M2_REPO/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar"/>
<classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
@@ -28,20 +22,12 @@
<classpathentry kind="var" path="M2_REPO/asm/asm-util/3.2/asm-util-3.2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.8.1/ant-launcher-1.8.1.jar"/>
<classpathentry kind="lib" path="security/GroovyJarTest.jar"/>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.9/log4j-1.2.9.jar"/>
<classpathentry kind="var" path="M2_REPO/jline/jline/0.9.94/jline-0.9.94.jar"/>
+ <classpathentry kind="var" path="M2_REPO"/>
<classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-testutil/1.8.2/ant-testutil-1.8.2.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.8.2/junit-4.8.2.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
<classpathentry kind="var" path="M2_REPO/xmlunit/xmlunit/1.3/xmlunit-1.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/fusesource/jansi/jansi/1.2.1/jansi-1.2.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/ch/qos/logback/logback-classic/0.9.21/logback-classic-0.9.21.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/objectweb/asm/com.springsource.org.objectweb.asm.commons/2.2.3/com.springsource.org.objectweb.asm.commons-2.2.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/thoughtworks/qdox/qdox/1.8/qdox-1.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/ch/qos/logback/logback-core/0.9.21/logback-core-0.9.21.jar"/>
- <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar"/>
- <classpathentry kind="lib" path="target/classes"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
-
src/main/groovy/inspect/TextNode.groovy
--- 2.0.0~beta2-1/src/main/groovy/inspect/TextNode.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/inspect/TextNode.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -21,6 +21,8 @@
*/
package groovy.inspect
+import groovy.inspect.swingui.AstBrowserNodeMaker
+
class TextNode {
Object userObject
List<List<String>> properties
-
src/main/groovy/inspect/swingui/AstBrowser.groovy
--- 2.0.0~beta2-1/src/main/groovy/inspect/swingui/AstBrowser.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/inspect/swingui/AstBrowser.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -33,12 +33,7 @@ import javax.swing.tree.TreeNode
import javax.swing.tree.TreeSelectionModel
import org.codehaus.groovy.control.Phases
import static java.awt.GridBagConstraints.*
-import org.codehaus.groovy.ast.ClassNode
-import groovy.lang.GroovyClassLoader.ClassCollector
-import org.codehaus.groovy.control.CompilationUnit
-import org.codehaus.groovy.control.SourceUnit
-import org.objectweb.asm.ClassReader
-import org.objectweb.asm.util.TraceClassVisitor
+import java.awt.Component
/**
* This object is a GUI for looking at the AST that Groovy generates.
@@ -53,15 +48,15 @@ import org.objectweb.asm.util.TraceClass
public class AstBrowser {
- private inputArea, rootElement, decompiledSource, jTree, propertyTable, splitterPane, mainSplitter, bytecodeView
+ private inputArea, rootElement, decompiledSource, jTree, propertyTable, splitterPane, mainSplitter
boolean showScriptFreeForm, showScriptClass, showTreeView
- GeneratedBytecodeAwareGroovyClassLoader classLoader
+ GroovyClassLoader classLoader
def prefs = new AstBrowserUiPreferences()
AstBrowser(inputArea, rootElement, classLoader) {
this.inputArea = inputArea
this.rootElement = rootElement
- this.classLoader = new GeneratedBytecodeAwareGroovyClassLoader(classLoader)
+ this.classLoader = classLoader
}
def swing, frame
@@ -167,10 +162,7 @@ public class AstBrowser {
mainSplitter = splitPane(
orientation: JSplitPane.VERTICAL_SPLIT,
topComponent: splitterPane,
- bottomComponent: tabbedPane {
- widget(decompiledSource = new groovy.ui.ConsoleTextEditor(editable: false, showLineNumbers: false), title:'Source')
- widget(bytecodeView = new groovy.ui.ConsoleTextEditor(editable: false, showLineNumbers: false), title:'Bytecode')
- },
+ bottomComponent: decompiledSource = new groovy.ui.ConsoleTextEditor(editable: false, showLineNumbers: false),
constraints: gbc(gridx: 0, gridy: 2, gridwidth: 3, gridheight: 1, weightx: 1.0, weighty: 1.0, anchor: NORTHWEST, fill: BOTH, insets: [2, 2, 2, 2])) { }
}
@@ -208,23 +200,6 @@ public class AstBrowser {
inputArea.moveCaretPosition(inputArea.getCaretPosition())
}
}
-
- boolean classNode = node.properties.any { it[0]=='class' && it[1] in['class org.codehaus.groovy.ast.ClassNode', 'class org.codehaus.groovy.ast.InnerClassNode'] }
- if (classNode) {
- def className = node.properties.find { it[0]=='name' }[1]
- def bytecode = classLoader.getBytecode(className)
- if (bytecode) {
- def writer = new StringWriter()
- def visitor = new TraceClassVisitor(new PrintWriter(writer));
- def reader = new ClassReader(bytecode)
- reader.accept(visitor, 0)
- bytecodeView.textEditor.text = writer.toString()
- } else {
- bytecodeView.textEditor.text = '// No bytecode available at this phase'
- }
- } else {
- bytecodeView.textEditor.text = ''
- }
}
propertyTable.model.fireTableDataChanged()
} as TreeSelectionListener)
@@ -337,7 +312,6 @@ public class AstBrowser {
try {
def nodeMaker = new SwingTreeNodeMaker()
def adapter = new ScriptToTreeNodeAdapter(classLoader, showScriptFreeForm, showScriptClass, nodeMaker)
- classLoader.clearBytecodeTable()
def result = adapter.compile(script, compilePhase)
swing.doLater {
model.setRoot(result)
@@ -482,43 +456,3 @@ class SwingTreeNodeMaker implements AstB
new TreeNodeWithProperties(userObject, properties)
}
}
-
-class BytecodeCollector extends ClassCollector {
-
- Map<String, byte[]> bytecode
-
- BytecodeCollector(ClassCollector delegate, Map<String,byte[]> bytecode) {
- super(delegate.cl, delegate.unit, delegate.su)
- this.bytecode = bytecode
- }
-
- @Override
- protected Class createClass(byte[] code, ClassNode classNode) {
- bytecode[classNode.name] = code
- return super.createClass(code, classNode)
- }
-
-}
-
-class GeneratedBytecodeAwareGroovyClassLoader extends GroovyClassLoader {
-
- private final Map<String, byte[]> bytecode = new HashMap<String, byte[]>();
-
- GeneratedBytecodeAwareGroovyClassLoader(final GroovyClassLoader parent) {
- super(parent)
- }
-
- @Override
- protected ClassCollector createCollector(CompilationUnit unit, SourceUnit su) {
- def collector = super.createCollector(unit, su)
- new BytecodeCollector(collector, bytecode)
- }
-
- public void clearBytecodeTable() {
- bytecode.clear()
- }
-
- public byte[] getBytecode(final String className) {
- bytecode[className]
- }
-}
\ No newline at end of file
-
--- 2.0.0~beta2-1/benchmark/bench.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/benchmark/bench.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -4,8 +4,8 @@ import org.codehaus.groovy.tools.FileSys
def benchData = [
hello : [1],
ackermann : [5, 6, 7, 8],
- ary : [10,100,1000,1000000],
-/* binarytrees : [1],
+/* ary : [1],
+ binarytrees : [1],
chameneos : [1],
echo : [1],
except : [1],
@@ -58,7 +58,7 @@ println "Groovy benchmarking test"
showJavaVersion()
println "Groovy lib: $GROOVY_LIB"
horizontalBreak()
-def executeBench= { bench, input ->
+benchData.each { bench, input ->
println "Benchmark $bench"
[".java", ".groovy"].each { ending ->
println("\t$bench$ending :")
@@ -73,12 +73,6 @@ def executeBench= { bench, input ->
}
horizontalBreak()
}
-if (args.length==0) {
- benchData.each(executeBench)
-} else {
- executeBench(args[0],benchData[args[0]])
-}
-
void horizontalBreak() {
println "-" * 80
-
src/main/groovy/swing/impl/ContainerFacade.java
--- 2.0.0~beta2-1/src/main/groovy/swing/impl/ContainerFacade.java 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/impl/ContainerFacade.java 2012-02-09 20:55:10.000000000 +0000
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2003-2007 the original author or authors.
+ *
+ * Licensed 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.swing.impl;
+
+import java.awt.Component;
+
+/**
+ * A facade to an object to which components can be added.
+ *
+ * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
+ * @version $Revision$
+ * @deprecated This interface is no longer used internally and there
+ * exists no equivalent functionality
+ * Superceded by FactoryBuilderSupport handling.
+ */
+public interface ContainerFacade {
+ void addComponent(Component component);
+}
-
src/main/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy
--- 2.0.0~beta2-1/src/main/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/inspect/swingui/ScriptToTreeNodeAdapter.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -94,7 +94,6 @@ class ScriptToTreeNodeAdapter {
def scriptName = "script" + System.currentTimeMillis() + ".groovy"
GroovyCodeSource codeSource = new GroovyCodeSource(script, scriptName, "/groovy/script")
CompilationUnit cu = new CompilationUnit(CompilerConfiguration.DEFAULT, codeSource.codeSource, classLoader)
- cu.setClassgenCallback(classLoader.createCollector(cu, null))
TreeNodeBuildingNodeOperation operation = new TreeNodeBuildingNodeOperation(this, showScriptFreeForm, showScriptClass)
cu.addPhaseOperation(operation, compilePhase)
cu.addSource(codeSource.getName(), script);
-
--- 2.0.0~beta2-1/gradle/wrapper/gradle-wrapper.properties 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/gradle/wrapper/gradle-wrapper.properties 2012-02-09 20:55:10.000000000 +0000
@@ -1,4 +1,4 @@
-#Mon May 02 20:57:32 EST 2011
+#Tue Jan 04 21:15:37 EST 2011
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Binary files 2.0.0~beta2-1/.gradle/1.0-milestone-6/fileHashes/cache.bin and 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/fileHashes/cache.bin differ
-
--- 2.0.0~beta2-1/gradle/docs.gradle 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/gradle/docs.gradle 2012-02-09 20:55:10.000000000 +0000
@@ -1,72 +1,71 @@
-task doc(dependsOn: [javadoc, groovydoc, 'docGDK']) {
- footer = "Copyright &copy; 2003-2011 The Codehaus. All rights reserved."
- title = "Groovy ${groovyVersion}"
-}
-
-javadoc {
- maxMemory = javaDoc_mx
- project.configure(options) {
- windowTitle = doc.title
- docTitle = doc.title
- encoding = "ISO-8859-1"
- author = true
- version = true
- overview = "src/main/overview.html"
- footer = doc.footer
- source = "1.5"
- links("http://java.sun.com/javase/6/docs/api", "http://www.dpml.net/api/ant/1.7.0",
- "http://commons.apache.org/cli/api-release", "http://junit.sourceforge.net/junit3.8.1/javadoc",
- "http://java.sun.com/j2ee/1.4/docs/api", "http://www.antlr2.org/javadoc")
- }
-}
-
-groovydoc {
- dependsOn classes
- groovyClasspath = configurations.compile
- use = true
- windowtitle = doc.title
- doctitle = doc.title
- header = doc.title
- footer = doc.footer
- overview = file("src/main/overview.html")
- includePrivate = false
- link "http://java.sun.com/j2ee/1.4/docs/api", "javax.servlet.", "javax.management."
- link "http://java.sun.com/javase/6/docs/api", "java.", "org.xml.", "javax.", "org.xml."
- link "http://www.dpml.net/api/ant/1.7.0", "org.apache.ant.", "org.apache.tools.ant."
- link "http://junit.sourceforge.net/junit3.8.1/javadoc", "org.junit.", "junit."
- link "http://www.antlr2.org/javadoc", "antlr."
- link "http://commons.apache.org/cli/api-release", "org.apache.commons.cli."
-}
-
-task docGDK {
- destinationDir = "$buildDir/html/groovy-jdk"
- inputs.files sourceSets.tools.runtimeClasspath
- outputs.dir destinationDir
- doFirst {task ->
- ant {
- java(classname: "org.codehaus.groovy.tools.DocGenerator", fork: "yes", failonerror: "true",
- classpath: sourceSets.tools.runtimeClasspath.asPath,
- errorproperty: 'edr',
- outputproperty: 'odr') {
- arg(value: "org.codehaus.groovy.runtime.DefaultGroovyMethods")
- arg(value: "org.codehaus.groovy.runtime.SqlGroovyMethods")
- arg(value: "org.codehaus.groovy.runtime.SwingGroovyMethods")
- arg(value: "org.codehaus.groovy.runtime.XmlGroovyMethods")
- arg(value: "org.codehaus.groovy.runtime.EncodingGroovyMethods")
- arg(value: "org.codehaus.groovy.runtime.DateGroovyMethods")
- arg(value: "org.codehaus.groovy.runtime.ProcessGroovyMethods")
- arg(value: "org.codehaus.groovy.runtime.DefaultGroovyStaticMethods")
- arg(value: "org.codehaus.groovy.vmplugin.v5.PluginDefaultGroovyMethods")
- arg(value: "org.codehaus.groovy.vmplugin.v6.PluginDefaultGroovyMethods")
- arg(value: "org.codehaus.groovy.vmplugin.v6.PluginStaticGroovyMethods")
- }
-// println "Out: " + ant.properties.edr
-// println "Err: " + ant.properties.odr
- }
- copy {
- into task.destinationDir
- from "src/tools/org/codehaus/groovy/tools/groovy.ico", "src/tools/org/codehaus/groovy/tools/stylesheet.css"
- }
- }
-}
-
+task doc(dependsOn: [javadoc, groovydoc, 'docGDK']) {
+ footer = "Copyright &copy; 2003-2012 The Codehaus. All rights reserved."
+ title = "Groovy ${groovyVersion}"
+}
+
+javadoc {
+ maxMemory = javaDoc_mx
+ project.configure(options) {
+ windowTitle = doc.title
+ docTitle = doc.title
+ encoding = "ISO-8859-1"
+ author = true
+ version = true
+ overview = "src/main/overview.html"
+ footer = doc.footer
+ source = "1.5"
+ links("http://docs.oracle.com/javase/6/docs/api/", "http://evgeny-goldin.org/javadoc/ant/api/",
+ "http://commons.apache.org/cli/api-release", "http://kentbeck.github.com/junit/javadoc/latest/",
+ "http://docs.oracle.com/javaee/6/api/", "http://www.antlr2.org/javadoc")
+ }
+}
+
+groovydoc {
+ dependsOn classes
+ groovyClasspath = configurations.compile
+ use = true
+ windowtitle = doc.title
+ doctitle = doc.title
+ header = doc.title
+ footer = doc.footer
+ overview = file("src/main/overview.html")
+ includePrivate = false
+ link "http://docs.oracle.com/javaee/6/api/", "javax.servlet.", "javax.management."
+ link "http://docs.oracle.com/javase/6/docs/api/", "java.", "org.xml.", "javax.", "org.w3c."
+ link "http://evgeny-goldin.org/javadoc/ant/api/", "org.apache.ant.", "org.apache.tools.ant."
+ link "http://kentbeck.github.com/junit/javadoc/latest/", "org.junit.", "junit."
+ link "http://www.antlr2.org/javadoc", "antlr."
+ link "http://commons.apache.org/cli/api-release", "org.apache.commons.cli."
+}
+
+task docGDK {
+ destinationDir = "$buildDir/html/groovy-jdk"
+ inputs.files sourceSets.tools.runtimeClasspath
+ outputs.dir destinationDir
+ doFirst {task ->
+ ant {
+ java(classname: "org.codehaus.groovy.tools.DocGenerator", fork: "yes", failonerror: "true",
+ classpath: sourceSets.tools.runtimeClasspath.asPath,
+ errorproperty: 'edr',
+ outputproperty: 'odr') {
+ arg(value: "org.codehaus.groovy.runtime.DefaultGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.SqlGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.SwingGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.XmlGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.EncodingGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.DateGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.ProcessGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.DefaultGroovyStaticMethods")
+ arg(value: "org.codehaus.groovy.vmplugin.v5.PluginDefaultGroovyMethods")
+ arg(value: "org.codehaus.groovy.vmplugin.v6.PluginDefaultGroovyMethods")
+ arg(value: "org.codehaus.groovy.vmplugin.v6.PluginStaticGroovyMethods")
+ }
+// println "Out: " + ant.properties.edr
+// println "Err: " + ant.properties.odr
+ }
+ copy {
+ into task.destinationDir
+ from "src/tools/org/codehaus/groovy/tools/groovy.ico", "src/tools/org/codehaus/groovy/tools/stylesheet.css"
+ }
+ }
+}
-
--- 2.0.0~beta2-1/debian/watch 2011-10-15 02:55:46.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/debian/watch 2012-03-15 13:06:56.000000000 +0000
@@ -1,3 +1,2 @@
version=3
-opts="uversionmangle=s/-beta-/~beta/" \
-http://dist.groovy.codehaus.org/distributions/ groovy-src-(.*).zip debian debian/orig-tar.sh
+http://dist.groovy.codehaus.org/distributions/ groovy-src-(.*1\.8.*).zip debian debian/orig-tar.sh
-
src/main/groovy/xml/streamingmarkupsupport/StreamingMarkupWriter.java
--- 2.0.0~beta2-1/src/main/groovy/xml/streamingmarkupsupport/StreamingMarkupWriter.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/xml/streamingmarkupsupport/StreamingMarkupWriter.java 2012-02-09 20:55:10.000000000 +0000
@@ -76,7 +76,7 @@ public class StreamingMarkupWriter exten
StreamingMarkupWriter.this.writingAttribute = writingAttribute;
}
- public Writer escaped() {
+ public Writer excaped() {
return escapedWriter;
}
-
src/main/groovy/servlet/TemplateServlet.java
-
--- 2.0.0~beta2-1/.gradle/1.0-milestone-6/fileHashes/cache.properties 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/fileHashes/cache.properties 2012-01-27 14:22:02.000000000 +0000
@@ -0,0 +1 @@
+#Fri Jan 27 09:52:02 CET 2012
-
src/main/groovy/xml/dom/DOMCategory.java
-
src/main/groovy/grape/GrapeIvy.groovy
--- 2.0.0~beta2-1/src/main/groovy/grape/GrapeIvy.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/grape/GrapeIvy.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -194,7 +194,7 @@ class GrapeIvy implements GrapeEngine {
public IvyGrabRecord createGrabRecord(Map deps) {
// parse the actual dependency arguments
String module = deps.module ?: deps.artifactId ?: deps.artifact
- if (!module) {
+ if (!module) {
throw new RuntimeException('grab requires at least a module: or artifactId: or artifact: argument')
}
-
--- 2.0.0~beta2-1/pom.xml 2011-12-23 19:01:28.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/pom.xml 2012-02-09 22:26:50.000000000 +0000
@@ -8,7 +8,7 @@
<name>Groovy</name>
<packaging>jar</packaging>
- <version>2.0.0-beta-2</version>
+ <version>1.8.6</version>
<description>
Groovy: A powerful, dynamic language for the JVM
@@ -44,6 +44,14 @@
</mailingList>
</mailingLists>
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
<distributionManagement>
<repository>
<id>codehaus.org</id>
@@ -377,6 +385,15 @@
<role>Developer</role>
</roles>
</developer>
+ <developer>
+ <name>Cédric Champeau</name>
+ <id>melix</id>
+ <email>cedric.champeau@gmail.com</email>
+ <organization></organization>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ </developer>
</developers>
<contributors>
@@ -557,15 +574,23 @@
<email></email>
</contributor>
<contributor>
- <name>Cédric Champeau</name>
+ <name>David Durham</name>
<email></email>
</contributor>
<contributor>
- <name>David Durham</name>
+ <name>Daniel Henrique Alves Lima</name>
<email></email>
</contributor>
<contributor>
- <name>Daniel Henrique Alves Lima</name>
+ <name>John Wagenleitner</name>
+ <email></email>
+ </contributor>
+ <contributor>
+ <name>Colin Harrington</name>
+ <email></email>
+ </contributor>
+ <contributor>
+ <name>Brian Alexander</name>
<email></email>
</contributor>
</contributors>
@@ -582,7 +607,7 @@
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
- <version>3.3.1</version>
+ <version>3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -659,25 +684,25 @@
<dependency>
<groupId>asm</groupId>
<artifactId>asm-commons</artifactId>
- <version>3.3.1</version>
+ <version>3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-util</artifactId>
- <version>3.3.1</version>
+ <version>3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-analysis</artifactId>
- <version>3.3.1</version>
+ <version>3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-tree</artifactId>
- <version>3.3.1</version>
+ <version>3.2</version>
<scope>compile</scope>
</dependency>
@@ -856,6 +881,14 @@
<version>1.8.2</version>
<scope>test</scope>
</dependency>
+<!--
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <scope>test</scope>
+ </dependency>
+-->
</dependencies>
<!--
-
--- 2.0.0~beta2-1/NOTICE.txt 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/NOTICE.txt 2012-02-09 20:55:10.000000000 +0000
@@ -11,4 +11,3 @@
This product includes software developed by
The Groovy community (http://groovy.codehaus.org/).
-
-
src/main/groovy/swing/impl/TableLayout.java
--- 2.0.0~beta2-1/src/main/groovy/swing/impl/TableLayout.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/impl/TableLayout.java 2012-02-09 20:55:10.000000000 +0000
@@ -15,6 +15,7 @@
*/
package groovy.swing.impl;
+import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
@@ -35,6 +36,14 @@ public class TableLayout extends JPanel
public TableLayout() {
setLayout(new GridBagLayout());
}
+
+ /**
+ * @deprecated Simply returns this
+ * @return this
+ */
+ public Component getComponent() {
+ return this;
+ }
public int getCellpadding() {
return cellpadding;
-
src/main/groovy/lang/GroovyCodeSource.java
--- 2.0.0~beta2-1/src/main/groovy/lang/GroovyCodeSource.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/lang/GroovyCodeSource.java 2012-02-09 20:55:10.000000000 +0000
@@ -95,6 +95,31 @@ public class GroovyCodeSource {
}
}
+ /**
+ * Construct a GroovyCodeSource for an inputStream of groovyCode that has an
+ * unknown provenance -- meaning it didn't come from a File or a URL (e.g. a String).
+ * The supplied codeBase will be used to construct a File URL that should match up
+ * with a java Policy entry that determines the grants to be associated with the
+ * class that will be built from the InputStream.
+ * <p/>
+ * The permission groovy.security.GroovyCodeSourcePermission will be used to determine if the given codeBase
+ * may be specified. That is, the current Policy set must have a GroovyCodeSourcePermission that implies
+ * the codeBase, or an exception will be thrown. This is to prevent callers from hijacking
+ * existing codeBase policy entries unless explicitly authorized by the user.
+ *
+ * @deprecated Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
+ */
+ @Deprecated
+ public GroovyCodeSource(InputStream inputStream, String name, String codeBase) {
+ this.name = name;
+ this.codeSource = createCodeSource(codeBase);
+ try {
+ this.scriptText = DefaultGroovyMethods.getText(inputStream);
+ } catch (IOException e) {
+ throw new RuntimeException("Impossible to read the text content from that input stream, for script: " + name + " with codeBase: " + codeBase, e);
+ }
+ }
+
public GroovyCodeSource(final File infile, final String encoding) throws IOException {
// avoid files which confuse us like ones with .. in path
final File file = new File(infile.getCanonicalPath());
@@ -176,6 +201,34 @@ public class GroovyCodeSource {
return codeSource;
}
+ /**
+ * @deprecated Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
+ */
+ @Deprecated
+ public InputStream getInputStream() {
+ IOException ioe;
+ if (file == null) {
+ try {
+ return new ByteArrayInputStream(scriptText.getBytes("UTF-8"));
+ } catch (UnsupportedEncodingException e) {
+ ioe = e;
+ }
+ } else {
+ try {
+ return new FileInputStream(file);
+ } catch (FileNotFoundException e) {
+ ioe = e;
+ }
+ }
+
+ String errorMsg = "Impossible to read the bytes from the associated script: " + scriptText + " with name: " + name;
+ if (ioe != null) {
+ throw new RuntimeException(errorMsg, ioe);
+ } else {
+ throw new RuntimeException(errorMsg);
+ }
+ }
+
public String getScriptText() {
return scriptText;
}
-
src/main/groovy/util/GroovyScriptEngine.java
--- 2.0.0~beta2-1/src/main/groovy/util/GroovyScriptEngine.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/util/GroovyScriptEngine.java 2012-02-09 20:55:10.000000000 +0000
@@ -16,6 +16,7 @@
package groovy.util;
import groovy.lang.Binding;
+import groovy.lang.DeprecationException;
import groovy.lang.GroovyClassLoader;
import groovy.lang.GroovyCodeSource;
import groovy.lang.GroovyResourceLoader;
@@ -436,6 +437,18 @@ public class GroovyScriptEngine implemen
}
/**
+ * @param parentClassLoader ClassLoader to be used as the parent ClassLoader
+ * for scripts executed by the engine
+ * @deprecated
+ */
+ public void setParentClassLoader(ClassLoader parentClassLoader) {
+ throw new DeprecationException(
+ "The method GroovyScriptEngine#setParentClassLoader(ClassLoader) " +
+ "is no longer supported. Specify a parentLoader in the constructor instead."
+ );
+ }
+
+ /**
* Get the class of the scriptName in question, so that you can instantiate
* Groovy objects with caching and reloading.
*
@@ -466,6 +479,25 @@ public class GroovyScriptEngine implemen
}
/**
+ * Get the class of the scriptName in question, so that you can instantiate
+ * Groovy objects with caching and reloading.
+ *
+ * @param scriptName resource name pointing to the script
+ * @param parentClassLoader the class loader to use when loading the script
+ * @return the loaded scriptName as a compiled class
+ * @throws ResourceException if there is a problem accessing the script
+ * @throws ScriptException if there is a problem parsing the script
+ * @deprecated
+ */
+ public Class loadScriptByName(String scriptName, ClassLoader parentClassLoader)
+ throws ResourceException, ScriptException {
+ throw new DeprecationException(
+ "The method GroovyScriptEngine#loadScriptByName(String,ClassLoader) " +
+ "is no longer supported. Use GroovyScriptEngine#loadScriptByName(String) instead."
+ );
+ }
+
+ /**
* Run a script identified by name with a single argument.
*
* @param scriptName name of the script to run
-
src/main/groovy/transform/CompilationUnitAware.java
--- 2.0.0~beta2-1/src/main/groovy/transform/CompilationUnitAware.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/transform/CompilationUnitAware.java 1970-01-01 00:00:00.000000000 +0000
@@ -1,18 +0,0 @@
-package groovy.transform;
-/**
- * Created by IntelliJ IDEA.
- * User: cedric
- * Date: 06/10/11
- * Time: 15:02
- */
-
-import org.codehaus.groovy.control.CompilationUnit;
-
-/**
- * This interface is for AST transformations which must be aware of the compilation unit where they are applied.
- *
- * @author Cedric Champeau
- */
-public interface CompilationUnitAware {
- void setCompilationUnit(CompilationUnit unit);
-}
-
src/main/groovy/lang/Immutable.java
--- 2.0.0~beta2-1/src/main/groovy/lang/Immutable.java 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/lang/Immutable.java 2012-02-09 20:55:10.000000000 +0000
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2008 the original author or authors.
+ *
+ * Licensed 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.lang;
+
+import org.codehaus.groovy.transform.GroovyASTTransformationClass;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Note: This class is Deprecated, please use groovy.transform.Immutable.
+ * <p/>
+ * Class annotation used to assist in the creation of immutable classes.
+ * <p/>
+ * It allows you to write classes in this shortened form:
+ * <pre>
+ * {@code @Immutable} class Customer {
+ * String first, last
+ * int age
+ * Date since
+ * Collection favItems
+ * }
+ * def d = new Date()
+ * def c1 = new Customer(first:'Tom', last:'Jones', age:21, since:d, favItems:['Books', 'Games'])
+ * def c2 = new Customer('Tom', 'Jones', 21, d, ['Books', 'Games'])
+ * assert c1 == c2
+ * </pre>
+ * The {@code @Immutable} annotation instructs the compiler to execute an
+ * AST transformation which adds the necessary getters, constructors,
+ * equals, hashCode and other helper methods that are typically written
+ * when creating immutable classes with the defined properties.
+ * <p/>
+ * A class created in this way has the following characteristics:
+ * <ul>
+ * <li>The class is automatically made final.
+ * <li>Properties must be of an immutable type or a type with a strategy for handling non-immutable
+ * characteristics. Specifically, the type must be one of the primitive or wrapper types, Strings, enums,
+ * other {@code @Immutable} classes or known immutables (e.g. java.awt.Color, java.net.URI). Also handled are
+ * Cloneable classes, collections, maps and arrays, and other "effectively immutable" classes with
+ * special handling (e.g. java.util.Date).
+ * <li>Properties automatically have private, final backing fields with getters.
+ * Attempts to update the property will result in a {@code ReadOnlyPropertyException}.
+ * <li>A map-based constructor is provided which allows you to set properties by name.
+ * <li>A tuple-style constructor is provided which allows you to set properties in the same order as they are defined.
+ * <li>Default {@code equals}, {@code hashCode} and {@code toString} methods are provided based on the property values.
+ * Though not normally required, you may write your own implementations of these methods. For {@code equals} and {@code hashCode},
+ * if you do write your own method, it is up to you to obey the general contract for {@code equals} methods and supply
+ * a corresponding matching {@code hashCode} method.
+ * If you do provide one of these methods explicitly, the default implementation will be made available in a private
+ * "underscore" variant which you can call. E.g., you could provide a (not very elegant) multi-line formatted
+ * {@code toString} method for {@code Customer} above as follows:
+ * <pre>
+ * String toString() {
+ * _toString().replaceAll(/\(/, '(\n\t').replaceAll(/\)/, '\n)').replaceAll(/, /, '\n\t')
+ * }
+ * </pre>
+ * If an "underscore" version of the respective method already exists, then no default implementation is provided.
+ * <li>{@code Date}s, {@code Cloneable}s and arrays are defensively copied on the way in (constructor) and out (getters).
+ * Arrays and {@code Cloneable} objects use the {@code clone} method. For your own classes,
+ * it is up to you to define this method and use deep cloning if appropriate.
+ * <li>{@code Collection}s and {@code Map}s are wrapped by immutable wrapper classes (but not deeply cloned!).
+ * Attempts to update them will result in an {@code UnsupportedOperationException}.
+ * <li>Fields that are enums or other {@code @Immutable} classes are allowed but for an
+ * otherwise possible mutable property type, an error is thrown.
+ * <li>You don't have to follow Groovy's normal property conventions, e.g. you can create an explicit private field and
+ * then you can write explicit get and set methods. Such an approach, isn't currently prohibited (to give you some
+ * wiggle room to get around these conventions) but any fields created in this way are deemed not to be part of the
+ * significant state of the object and aren't factored into the {@code equals} or {@code hashCode} methods.
+ * Similarly, you may use static properties (though usually this is discouraged) and these too will be ignored
+ * as far as significant state is concerned. If you do break standard conventions, you do so at your own risk and
+ * your objects may no longer be immutable. It is up to you to ensure that your objects remain immutable at least
+ * to the extent expected in other parts of your program!
+ * </ul>
+ * <p/>
+ * Immutable classes are particularly useful for functional and concurrent styles of programming
+ * and for use as key values within maps.
+ * <p/>
+ * Limitations:
+ * <ul>
+ * <li>
+ * As outlined above, Arrays and {@code Cloneable} objects use the {@code clone} method. For your own classes,
+ * it is up to you to define this method and use deep cloning if appropriate.
+ * </li>
+ * <li>
+ * As outlined above, {@code Collection}s and {@code Map}s are wrapped by immutable wrapper classes (but not deeply cloned!).
+ * </li>
+ * <li>
+ * Currently {@code BigInteger} and {@code BigDecimal} are deemed immutable but see:
+ * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6348370
+ * </li>
+ * <li>
+ * {@code java.awt.Color} is treated as "effectively immutable" but is not final so while not normally used with child
+ * classes, it isn't strictly immutable. Use at your own risk.
+ * </li>
+ * <li>
+ * {@code java.util.Date} is treated as "effectively immutable" but is not final so it isn't strictly immutable.
+ * Use at your own risk.
+ * </li>
+ * </ul>
+ *
+ * @author Paul King
+ * @deprecated use groovy.transform.Immutable
+ */
+@java.lang.annotation.Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE})
+@GroovyASTTransformationClass("org.codehaus.groovy.transform.ImmutableASTTransformation")
+@Deprecated
+public @interface Immutable {
+}
-
src/main/groovy/swing/factory/CellEditorFactory.groovy
--- 2.0.0~beta2-1/src/main/groovy/swing/factory/CellEditorFactory.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/factory/CellEditorFactory.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -18,6 +18,7 @@ package groovy.swing.factory
import groovy.swing.impl.ClosureCellEditor
import java.awt.Component
+import javax.swing.JTree
/**
* @author Alexander Klein
-
src/main/groovy/ui/InteractiveShell.java
-
src/main/groovy/lang/GroovyShell.java
--- 2.0.0~beta2-1/src/main/groovy/lang/GroovyShell.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/lang/GroovyShell.java 2012-02-09 20:55:10.000000000 +0000
@@ -21,6 +21,7 @@ import groovy.security.GroovyCodeSourceP
import org.codehaus.groovy.control.CompilationFailedException;
import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.runtime.InvokerHelper;
+import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.codehaus.groovy.runtime.InvokerInvocationException;
import java.io.*;
@@ -31,6 +32,7 @@ import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.List;
+import java.util.Map;
/**
* Represents a groovy shell capable of running arbitrary groovy scripts
@@ -44,6 +46,9 @@ public class GroovyShell extends GroovyO
public static final String DEFAULT_CODE_BASE = "/groovy/shell";
+ @Deprecated
+ public static final String[] EMPTY_ARGS = {};
+
private Binding context;
private int counter;
private CompilerConfiguration config;
@@ -93,6 +98,12 @@ public class GroovyShell extends GroovyO
this.context = binding;
this.config = config;
}
+
+ @Deprecated
+ public void initializeBinding() {
+ Map map = context.getVariables();
+ if (map.get("shell")==null) map.put("shell",this);
+ }
public void resetLoadedClasses() {
loader.clearCache();
@@ -523,6 +534,32 @@ public class GroovyShell extends GroovyO
return runScriptOrMainOrTestOrRunnable(scriptClass, args);
}
+ /**
+ * Runs the given script with command line arguments
+ *
+ * @param in the stream reading the script
+ * @param fileName is the logical file name of the script (which is used to create the class name of the script)
+ * @param args the command line arguments to pass in
+ *
+ * @deprecated Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
+ */
+ public Object run(final InputStream in, final String fileName, String[] args) throws CompilationFailedException {
+ GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
+ public GroovyCodeSource run() {
+ try {
+ String scriptText = config.getSourceEncoding() != null ?
+ DefaultGroovyMethods.getText(in, config.getSourceEncoding()) :
+ DefaultGroovyMethods.getText(in);
+ return new GroovyCodeSource(scriptText, fileName, DEFAULT_CODE_BASE);
+ } catch (IOException e) {
+ throw new RuntimeException("Impossible to read the content of the input stream for file named: " + fileName, e);
+ }
+ }
+ });
+ Class scriptClass = parseClass(gcs);
+ return runScriptOrMainOrTestOrRunnable(scriptClass, args);
+ }
+
public Object getVariable(String name) {
return context.getVariables().get(name);
}
@@ -618,6 +655,37 @@ public class GroovyShell extends GroovyO
}
}
+ /**
+ * Evaluates some script against the current Binding and returns the result
+ *
+ * @param in the stream reading the script
+ *
+ * @deprecated Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
+ */
+ public Object evaluate(InputStream in) throws CompilationFailedException {
+ return evaluate(in, generateScriptName());
+ }
+
+ /**
+ * Evaluates some script against the current Binding and returns the result
+ *
+ * @param in the stream reading the script
+ * @param fileName is the logical file name of the script (which is used to create the class name of the script)
+ *
+ * @deprecated Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
+ */
+ public Object evaluate(InputStream in, String fileName) throws CompilationFailedException {
+ Script script = null;
+ try {
+ script = parse(in, fileName);
+ script.setBinding(context);
+ return script.run();
+ } finally {
+ if (script != null) {
+ InvokerHelper.removeClass(script.getClass());
+ }
+ }
+ }
/**
* Parses the given script and returns it ready to be run
@@ -631,6 +699,31 @@ public class GroovyShell extends GroovyO
}
/**
+ * Parses the given script and returns it ready to be run
+ *
+ * @param in the stream reading the script
+ * @param fileName is the logical file name of the script (which is used to create the class name of the script)
+ * @return the parsed script which is ready to be run via @link Script.run()
+ *
+ * @deprecated Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
+ */
+ public Script parse(final InputStream in, final String fileName) throws CompilationFailedException {
+ GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
+ public GroovyCodeSource run() {
+ try {
+ String scriptText = config.getSourceEncoding() != null ?
+ DefaultGroovyMethods.getText(in, config.getSourceEncoding()) :
+ DefaultGroovyMethods.getText(in);
+ return new GroovyCodeSource(scriptText, fileName, DEFAULT_CODE_BASE);
+ } catch (IOException e) {
+ throw new RuntimeException("Impossible to read the content of the input stream for file named: " + fileName, e);
+ }
+ }
+ });
+ return parse(gcs);
+ }
+
+ /**
* Parses the groovy code contained in codeSource and returns a java class.
*/
private Class parseClass(final GroovyCodeSource codeSource) throws CompilationFailedException {
@@ -686,6 +779,17 @@ public class GroovyShell extends GroovyO
return parse(in, generateScriptName());
}
+ /**
+ * Parses the given script and returns it ready to be run
+ *
+ * @param in the stream reading the script
+ *
+ * @deprecated Prefer using methods taking a Reader rather than an InputStream to avoid wrong encoding issues.
+ */
+ public Script parse(InputStream in) throws CompilationFailedException {
+ return parse(in, generateScriptName());
+ }
+
protected synchronized String generateScriptName() {
return "Script" + (++counter) + ".groovy";
}
-
src/main/groovy/grape/GrabAnnotationTransformation.java
-
--- 2.0.0~beta2-1/gradle.properties 2011-12-23 19:01:22.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/gradle.properties 2012-02-09 22:26:44.000000000 +0000
@@ -1,6 +1,6 @@
-groovyVersion = 2.0.0-beta-2
+groovyVersion = 1.8.6
# bundle version format: major('.'minor('.'micro('.'qualifier)?)?)? (first 3 only digits)
-groovyBundleVersion = 2.0.0.beta-2
+groovyBundleVersion = 1.8.6
# Many people have reported problems testing UberTestCaseGroovySourceSubPackages, others have no difficulties with the default
# values ant junit task uses. The decision has been taken to provide the values to try and cause the least
-
--- 2.0.0~beta2-1/.gradle/1.0-milestone-6/outputFileStates/cache.properties 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/outputFileStates/cache.properties 2012-01-27 14:22:02.000000000 +0000
@@ -0,0 +1 @@
+#Fri Jan 27 09:52:01 CET 2012
-
build.xml
-
src/main/groovy/json/JsonLexer.java
--- 2.0.0~beta2-1/src/main/groovy/json/JsonLexer.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/json/JsonLexer.java 2012-02-09 20:55:10.000000000 +0000
@@ -105,12 +105,17 @@ public class JsonLexer implements Iterat
StringBuilder currentContent = new StringBuilder("\"");
// consume the first double quote starting the string
reader.read();
+ boolean isEscaped = false;
for (;;) {
int read = reader.read();
if (read == -1) return null;
- currentContent.append((char) read);
- if (currentContent.charAt(currentContent.length() - 1) == '"' && currentContent.charAt(currentContent.length() - 2) != '\\' &&
+ isEscaped = (!isEscaped && currentContent.charAt(currentContent.length() - 1) == '\\');
+
+ char charRead = (char) read;
+ currentContent.append(charRead);
+
+ if (charRead == '"' && !isEscaped &&
possibleTokenType.matching(currentContent.toString())) {
token.setEndLine(reader.getLine());
token.setEndColumn(reader.getColumn());
@@ -248,4 +253,4 @@ public class JsonLexer implements Iterat
throw new UnsupportedOperationException("The method remove() is not supported on this lexer.");
}
-}
\ No newline at end of file
+}
-
--- 2.0.0~beta2-1/config/maven/groovy-tools.pom 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/config/maven/groovy-tools.pom 2012-02-09 20:55:10.000000000 +0000
@@ -53,7 +53,7 @@
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
- <version>3.3.1</version>
+ <version>3.2</version>
</dependency>
<!-- used for the JavaDoc generator script -->
-
src/main/groovy/grape/GrapeEngine.java
--- 2.0.0~beta2-1/src/main/groovy/grape/GrapeEngine.java 2011-08-30 16:20:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/grape/GrapeEngine.java 2012-02-06 15:05:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 the original author or authors.
+ * Copyright 2008-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,9 +20,7 @@ import java.util.Map;
import java.net.URI;
/**
- * User: Danno.Ferrin
- * Date: Sep 30, 2008
- * Time: 9:30:46 PM
+ * @author Danno Ferrin
*/
public interface GrapeEngine {
-
src/main/org/codehaus/groovy/antlr/groovy.g
--- 2.0.0~beta2-1/src/main/org/codehaus/groovy/antlr/groovy.g 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/org/codehaus/groovy/antlr/groovy.g 2012-02-09 20:55:10.000000000 +0000
@@ -226,7 +226,7 @@ tokens {
STATIC_IMPORT; ENUM_DEF; ENUM_CONSTANT_DEF; FOR_EACH_CLAUSE; ANNOTATION_DEF; ANNOTATIONS;
ANNOTATION; ANNOTATION_MEMBER_VALUE_PAIR; ANNOTATION_FIELD_DEF; ANNOTATION_ARRAY_INIT;
TYPE_ARGUMENTS; TYPE_ARGUMENT; TYPE_PARAMETERS; TYPE_PARAMETER; WILDCARD_TYPE;
- TYPE_UPPER_BOUNDS; TYPE_LOWER_BOUNDS; CLOSURE_LIST;MULTICATCH;MULTICATCH_TYPES;
+ TYPE_UPPER_BOUNDS; TYPE_LOWER_BOUNDS; CLOSURE_LIST;
}
{
@@ -415,7 +415,7 @@ tokens {
}
private void dumpTree(AST ast, String offset) {
- dump(ast, offset);
+ dump(ast, offset);
for (AST node = ast.getFirstChild(); node != null; node = node.getNextSibling()) {
dumpTree(node, offset+"\t");
}
@@ -765,7 +765,6 @@ wildcardType
typeArgumentsDiamond
{Token first = LT(1);}
: LT! GT! nls!
- {#typeArgumentsDiamond = #(create(TYPE_ARGUMENTS, "TYPE_ARGUMENTS",first,LT(1)), #typeArgumentsDiamond);}
;
// Type arguments to a class or interface type
@@ -1664,26 +1663,6 @@ parameterDeclaration!
}
;
-multicatch_types
-{Token first = LT(1);}
- :
- nls!
- classOrInterfaceType[false]
- (
- BOR! nls! classOrInterfaceType[false]
- )*
-
- {#multicatch_types = #(create(MULTICATCH_TYPES, "MULTICATCH_TYPES",first,LT(1)), #multicatch_types);}
- ;
-
-multicatch
-{Token first = LT(1);}
- : nls! (FINAL)? ("def")? (m:multicatch_types)? id:IDENT!
- {
- #multicatch = #(create(MULTICATCH,"MULTICATCH",first, LT(1)),m,id);
- }
- ;
-
/*OBS*
variableLengthParameterDeclaration! {Token first = LT(1);}
: pm:parameterModifier t:typeSpec[false] TRIPLE_DOT! id:IDENT
@@ -2199,7 +2178,7 @@ finallyClause {Token first = LT(1);}
// an exception handler
handler {Token first = LT(1);}
- : "catch"! LPAREN! pd:multicatch! RPAREN! nlsWarn! handlerCs:compoundStatement!
+ : "catch"! LPAREN! pd:parameterDeclaration! RPAREN! nlsWarn! handlerCs:compoundStatement!
{#handler = #(create(LITERAL_catch,"catch",first,LT(1)),pd,handlerCs);}
;
@@ -2210,7 +2189,7 @@ handler {Token first = LT(1);}
*/
commandArguments[AST head]
{
- Token first = LT(1);
+ Token first = LT(1);
}
:
commandArgument ( options {greedy=true;}: COMMA! nls! commandArgument )*
@@ -2231,7 +2210,7 @@ commandArguments[AST head]
commandArgumentsGreedy[AST head]
{
- AST prev = #head;
+ AST prev = #head;
}
:
@@ -4187,22 +4166,6 @@ options {
// TODO: Recognize all the Java identifier parts here (except '$').
;
-protected
-DIGITS_WITH_UNDERSCORE
-options {
- paraphrase="a sequence of digits and underscores, bordered by digits";
-}
- : DIGIT (DIGITS_WITH_UNDERSCORE_OPT)?
- ;
-
-protected
-DIGITS_WITH_UNDERSCORE_OPT
-options {
- paraphrase="a sequence of digits and underscores with maybe underscore starting";
-}
- : (DIGIT | '_')* DIGIT
- ;
-
// a numeric literal
NUM_INT
options {
@@ -4230,29 +4193,27 @@ options {
*OBS*/
// TODO: This complex pattern seems wrong. Verify or fix.
( '0' {isDecimal = true;} // special case for just '0'
- ( // hex digits
- ('x'|'X')
- {isDecimal = false;}
- HEX_DIGIT
- ( options { warnWhenFollowAmbig=false; }
- : (options { warnWhenFollowAmbig=false; } : HEX_DIGIT | '_')*
- HEX_DIGIT
- )?
-
- | //binary literal
- ('b'|'B') ('0'|'1') (('0'|'1'|'_')* ('0'|'1'))?
+ ( ('x'|'X')
{isDecimal = false;}
+ ( // hex
+ // the 'e'|'E' and float suffix stuff look
+ // like hex digits, hence the (...)+ doesn't
+ // know when to stop: ambig. ANTLR resolves
+ // it correctly by matching immediately. It
+ // is therefor ok to hush warning.
+ options {
+ warnWhenFollowAmbig=false;
+ }
+ : HEX_DIGIT
+ )+
| //float or double with leading zero
- ( DIGITS_WITH_UNDERSCORE
- ( '.' DIGITS_WITH_UNDERSCORE | EXPONENT | FLOAT_SUFFIX)
- ) => DIGITS_WITH_UNDERSCORE
+ (('0'..'9')+ ('.'('0'..'9')|EXPONENT|FLOAT_SUFFIX)) => ('0'..'9')+
- | // octal
- ('0'..'7') (('0'..'7'|'_')* ('0'..'7'))?
+ | ('0'..'7')+ // octal
{isDecimal = false;}
)?
- | ('1'..'9') (DIGITS_WITH_UNDERSCORE_OPT)? {isDecimal=true;} // non-zero decimal
+ | ('1'..'9') ('0'..'9')* {isDecimal=true;} // non-zero decimal
)
( ('l'|'L') { _ttype = NUM_LONG; }
| ('i'|'I') { _ttype = NUM_INT; }
@@ -4262,7 +4223,7 @@ options {
|
(~'.' | '.' ('0'..'9')) =>
{isDecimal}?
- ( '.' DIGITS_WITH_UNDERSCORE (e:EXPONENT)? (f2:FLOAT_SUFFIX {t=f2;} | g2:BIG_SUFFIX {t=g2;})?
+ ( '.' ('0'..'9')+ (EXPONENT)? (f2:FLOAT_SUFFIX {t=f2;} | g2:BIG_SUFFIX {t=g2;})?
| EXPONENT (f3:FLOAT_SUFFIX {t=f3;} | g3:BIG_SUFFIX {t=g3;})?
| f4:FLOAT_SUFFIX {t=f4;}
)
@@ -4294,7 +4255,7 @@ EXPONENT
options {
paraphrase="an exponent";
}
- : ('e'|'E') ('+'|'-')? ('0'..'9'|'_')* ('0'..'9')
+ : ('e'|'E') ('+'|'-')? ('0'..'9')+
;
-
src/main/groovy/util/ConfigSlurper.groovy
--- 2.0.0~beta2-1/src/main/groovy/util/ConfigSlurper.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/util/ConfigSlurper.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -15,6 +15,7 @@
*/
package groovy.util
+import java.beans.Introspector
import java.beans.BeanInfo
import org.codehaus.groovy.runtime.InvokerHelper
@@ -77,6 +78,7 @@ class ConfigSlurper {
def tokens = key.split(/\./)
def current = config
+ def currentToken
def last
def lastToken
def foundBase = false
-
src/main/groovy/swing/impl/Startable.java
--- 2.0.0~beta2-1/src/main/groovy/swing/impl/Startable.java 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/impl/Startable.java 2012-02-09 20:55:10.000000000 +0000
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2003-2007 the original author or authors.
+ *
+ * Licensed 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.swing.impl;
+
+/**
+ * A simple lifecycle method called when an object is fully constructed.
+ *
+ * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
+ * @version $Revision$
+ * @deprecated This interface is no longer used internally and there
+ * exists no equivalent functionality.
+ * Superceded by FactoryBuilderSupport handling.
+ */
+public interface Startable {
+ void start();
+}
-
--- 2.0.0~beta2-1/src/examples/transforms/global/CompiledAtExample.groovy 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/examples/transforms/global/CompiledAtExample.groovy 2012-02-09 20:55:10.000000000 +0000
@@ -6,10 +6,10 @@ package transforms.global
* @author Hamlet D'Arcy
*/
-println 'Script compiled at: ' + compiledTime
+println 'Script compiled at: ' + getCompiledTime()
class MyClass {
}
-println 'Class compiled at: ' + MyClass.compiledTime
+println 'Class compiled at: ' + MyClass.getCompiledTime()
-
src/main/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
--- 2.0.0~beta2-1/src/main/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy 2011-12-16 05:24:20.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy 2012-02-09 20:50:34.000000000 +0000
@@ -448,7 +448,7 @@ class AstNodeToScriptVisitor extends Pri
Expression exp = node.initialValueExpression
if (exp instanceof ConstantExpression) exp = Verifier.transformToPrimitiveConstantIfPossible(exp)
ClassNode type = exp?.type
- if (Modifier.isStatic(node.modifiers)
+ if (Modifier.isStatic(node.modifiers) && Modifier.isFinal(node.getModifiers())
&& exp instanceof ConstantExpression
&& type == node.type
&& ClassHelper.isStaticConstantInitializerType(type)) {
-
src/main/groovy/transform/TypeChecked.java
--- 2.0.0~beta2-1/src/main/groovy/transform/TypeChecked.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/transform/TypeChecked.java 1970-01-01 00:00:00.000000000 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright 2003-2011 the original author or authors.
- *
- * Licensed 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.transform;
-
-import java.lang.annotation.*;
-
-import org.codehaus.groovy.transform.GroovyASTTransformationClass;
-
-/**
- * This will let the Groovy compiler use compile time checks in the style of Java.
- * @author <a href="mailto:blackdrag@gmx.org">Jochen "blackdrag" Theodorou</a>
- */
-@java.lang.annotation.Documented
-@Retention(RetentionPolicy.SOURCE)
-@Target({ ElementType.METHOD, ElementType.TYPE,
- ElementType.CONSTRUCTOR
-})
-@GroovyASTTransformationClass("org.codehaus.groovy.transform.StaticTypesTransformation")
-public @interface TypeChecked {
-}
\ No newline at end of file
-
src/main/groovy/swing/factory/ComponentFactory.groovy
--- 2.0.0~beta2-1/src/main/groovy/swing/factory/ComponentFactory.groovy 2011-08-30 16:20:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/swing/factory/ComponentFactory.groovy 2012-02-07 18:53:16.000000000 +0000
@@ -18,6 +18,8 @@ package groovy.swing.factory
import java.awt.Component
import java.awt.Window
+import javax.swing.JComponent
+import static groovy.swing.factory.LayoutFactory.DEFAULT_DELEGATE_PROPERTY_CONSTRAINT
class ComponentFactory extends BeanFactory {
@@ -37,6 +39,9 @@ class ComponentFactory extends BeanFacto
def constraints = builder.context.constraints
if (constraints != null) {
LayoutFactory.getLayoutTarget(parent).add(child, constraints)
+ if (child instanceof JComponent) {
+ child.putClientProperty(DEFAULT_DELEGATE_PROPERTY_CONSTRAINT, constraints)
+ }
builder.context.remove('constraints')
} else {
LayoutFactory.getLayoutTarget(parent).add(child)
-
src/main/groovy/sql/Sql.java
--- 2.0.0~beta2-1/src/main/groovy/sql/Sql.java 2011-12-06 17:28:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/sql/Sql.java 2012-02-06 15:03:26.000000000 +0000
@@ -362,34 +362,42 @@ public class Sql {
* @throws ClassNotFoundException if the class cannot be found or loaded
*/
public static Sql newInstance(Map<String, Object> args) throws SQLException, ClassNotFoundException {
+ if (!args.containsKey("url"))
+ throw new IllegalArgumentException("Argument 'url' is required");
+
+ if (args.get("url") == null)
+ throw new IllegalArgumentException("Argument 'url' must not be null");
+
if (args.containsKey("driverClassName") && args.containsKey("driver"))
throw new IllegalArgumentException("Only one of 'driverClassName' and 'driver' should be provided");
- Object driverClassName = args.remove("driverClassName");
- if (driverClassName == null) driverClassName = args.remove("driver");
- if (driverClassName != null) loadDriver(driverClassName.toString());
- Object url = args.remove("url");
- if (url == null) throw new IllegalArgumentException("Argument 'url' is required");
+ // Make a copy so destructive operations will not affect the caller
+ Map<String, Object> sqlArgs = new HashMap<String, Object>(args);
+
+ Object driverClassName = sqlArgs.remove("driverClassName");
+ if (driverClassName == null) driverClassName = sqlArgs.remove("driver");
+ if (driverClassName != null) loadDriver(driverClassName.toString());
- Properties props = (Properties) args.remove("properties");
- if (props != null && args.containsKey("user"))
+ Properties props = (Properties) sqlArgs.remove("properties");
+ if (props != null && sqlArgs.containsKey("user"))
throw new IllegalArgumentException("Only one of 'properties' and 'user' should be supplied");
- if (props != null && args.containsKey("password"))
+ if (props != null && sqlArgs.containsKey("password"))
throw new IllegalArgumentException("Only one of 'properties' and 'password' should be supplied");
- if (args.containsKey("user") ^ args.containsKey("password"))
+ if (sqlArgs.containsKey("user") ^ sqlArgs.containsKey("password"))
throw new IllegalArgumentException("Found one but not both of 'user' and 'password'");
+ Object url = sqlArgs.remove("url");
Connection connection;
- if (props != null) connection = DriverManager.getConnection(url.toString(), props);
- else if (args.containsKey("user")) {
- Object user = args.remove("user");
- Object password = args.remove("password");
+ if (props != null) connection = DriverManager.getConnection(url.toString(), new Properties(props));
+ else if (sqlArgs.containsKey("user")) {
+ Object user = sqlArgs.remove("user");
+ Object password = sqlArgs.remove("password");
connection = DriverManager.getConnection(url.toString(),
(user == null ? null : user.toString()),
(password == null ? null : password.toString()));
} else connection = DriverManager.getConnection(url.toString());
- Sql result = (Sql) InvokerHelper.invokeConstructorOf(Sql.class, args);
+ Sql result = (Sql) InvokerHelper.invokeConstructorOf(Sql.class, sqlArgs);
result.setConnection(connection);
return result;
}
-
src/main/groovy/util/slurpersupport/Node.java
--- 2.0.0~beta2-1/src/main/groovy/util/slurpersupport/Node.java 2011-12-06 17:28:16.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/util/slurpersupport/Node.java 2012-02-06 15:03:26.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2010 the original author or authors.
+ * Copyright 2003-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -88,7 +88,6 @@ public class Node implements Writable {
});
}
-
protected void replaceBody(final Object newValue) {
this.children.clear();
this.children.add(newValue);
@@ -112,18 +111,15 @@ public class Node implements Writable {
* @see org.codehaus.groovy.sandbox.util.slurpersupport.Node#text()
*/
public String text() {
- final StringBuffer buff = new StringBuffer();
- final Iterator iter = this.children.iterator();
- while (iter.hasNext()) {
- final Object child = iter.next();
-
+ final StringBuilder sb = new StringBuilder();
+ for (Object child : this.children) {
if (child instanceof Node) {
- buff.append(((Node) child).text());
+ sb.append(((Node) child).text());
} else {
- buff.append(child);
+ sb.append(child);
}
}
- return buff.toString();
+ return sb.toString();
}
/* (non-Javadoc)
@@ -154,7 +150,6 @@ public class Node implements Writable {
private Object getNextElementNodes() {
while (iter.hasNext()) {
final Object node = iter.next();
-
if (node instanceof Node) {
return node;
}
@@ -169,9 +164,7 @@ public class Node implements Writable {
*/
public Writer writeTo(final Writer out) throws IOException {
if (this.replacementNodeStack.empty()) {
- final Iterator iter = this.children.iterator();
- while (iter.hasNext()) {
- final Object child = iter.next();
+ for (Object child : this.children) {
if (child instanceof Writable) {
((Writable) child).writeTo(out);
} else {
@@ -179,7 +172,6 @@ public class Node implements Writable {
}
}
return out;
-
} else {
return ((Writable) this.replacementNodeStack.peek()).writeTo(out);
}
@@ -190,7 +182,6 @@ public class Node implements Writable {
final Closure rest = new Closure(null) {
public Object doCall(final Object o) {
buildChildren(builder, namespaceMap, namespaceTagHints);
-
return null;
}
};
@@ -210,18 +201,13 @@ public class Node implements Writable {
builder.invokeMethod(this.name, new Object[]{this.attributes, rest});
} else {
final Map attributesWithNamespaces = new HashMap(this.attributes);
- final Iterator attrs = this.attributes.keySet().iterator();
-
- while (attrs.hasNext()) {
- final Object key = attrs.next();
+ for (Object key : this.attributes.keySet()) {
final Object attributeNamespaceURI = this.attributeNamespaces.get(key);
-
if (attributeNamespaceURI != null) {
attributesWithNamespaces.put(getTagFor(attributeNamespaceURI, current, pending, namespaceMap, namespaceTagHints, newTags, builder) +
"$" + key, attributesWithNamespaces.remove(key));
}
}
-
builder.getProperty(getTagFor(this.namespaceURI, current, pending, namespaceMap, namespaceTagHints, newTags, builder));
builder.invokeMethod(this.name, new Object[]{attributesWithNamespaces, rest});
}
@@ -229,7 +215,6 @@ public class Node implements Writable {
// remove the new tags we had to define for this element
if (!newTags.isEmpty()) {
final Iterator iter = newTags.iterator();
-
do {
pending.remove(iter.next());
} while (iter.hasNext());
@@ -257,7 +242,6 @@ public class Node implements Writable {
if (tag == null || tag.length() == 0) { // otherwise make up a new tag and check it has not been used before
int suffix = 0;
-
do {
final String possibleTag = "tag" + suffix++;
@@ -279,9 +263,8 @@ public class Node implements Writable {
private static String findNamespaceTag(final Map tagMap, final Object namespaceURI) {
if (tagMap.containsValue(namespaceURI)) {
- final Iterator entries = tagMap.entrySet().iterator();
- while (entries.hasNext()) {
- final Map.Entry entry = (Map.Entry) entries.next();
+ for (Object o : tagMap.entrySet()) {
+ final Map.Entry entry = (Map.Entry) o;
if (namespaceURI.equals(entry.getValue())) {
return (String) entry.getKey();
}
@@ -291,9 +274,7 @@ public class Node implements Writable {
}
private void buildChildren(final GroovyObject builder, final Map namespaceMap, final Map<String, String> namespaceTagHints) {
- final Iterator iter = this.children.iterator();
- while (iter.hasNext()) {
- final Object child = iter.next();
+ for (Object child : this.children) {
if (child instanceof Node) {
((Node) child).build(builder, namespaceMap, namespaceTagHints);
} else if (child instanceof Buildable) {
-
--- 2.0.0~beta2-1/.project 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.project 2012-02-09 20:55:10.000000000 +0000
@@ -1,29 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>groovy</name>
- <comment>Groovy: A powerful, dynamic language for the JVM</comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/Groovy ensureGrammars.launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.codehaus.groovy.eclipse.groovyNature</nature>
- </natures>
+ <name>groovy</name>
+ <comment>Groovy: A powerful, dynamic language for the JVM</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value><project>/.externalToolBuilders/Groovy ensureGrammars.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.codehaus.groovy.eclipse.groovyBuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.codehaus.groovy.eclipse.groovyNature</nature>
+ </natures>
</projectDescription>
-
--- 2.0.0~beta2-1/.gradle/1.0-milestone-6/taskArtifacts/cache.properties 1970-01-01 00:00:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/.gradle/1.0-milestone-6/taskArtifacts/cache.properties 2012-01-27 14:18:30.000000000 +0000
@@ -0,0 +1 @@
+#Fri Jan 27 09:48:29 CET 2012
-
--- 2.0.0~beta2-1/gradle/assemble.gradle 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/gradle/assemble.gradle 2012-02-09 20:55:10.000000000 +0000
@@ -110,8 +110,6 @@ task jarAll(type: Jar, dependsOn: jar) {
}.each {jarjarFile ->
zipfileset(src: jarjarFile)
}
- zipfileset(src: configurations.runtime.files.find { file -> file.name.startsWith('asm-util') },
- includes: 'org/objectweb/asm/util/AbstractVisitor.class,org/objectweb/asm/util/Trace*')
rule pattern: "antlr.**", result: "groovyjarjarantlr.@1"
rule pattern: "org.objectweb.**", result: "groovyjarjarasm.@1"
rule pattern: "org.apache.commons.cli.**", result: "groovyjarjarcommonscli.@1"
-
--- 2.0.0~beta2-1/src/bin/groovysh.bat 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/bin/groovysh.bat 2012-02-09 20:55:10.000000000 +0000
@@ -12,7 +12,8 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.\
-set CLASSNAME=org.codehaus.groovy.tools.shell.Main
+set CLASSNAME=groovy.ui.InteractiveShell
+if "%OLDSHELL%" == "" set CLASSNAME=org.codehaus.groovy.tools.shell.Main
"%DIRNAME%\startGroovy.bat" "%DIRNAME%" %CLASSNAME% %*
-
config/codenarc/codenarc.groovy
-
src/main/org/codehaus/groovy/antlr/parser/GroovyLexer.java
-
src/main/groovy/util/FactoryBuilderSupport.java
-
src/main/groovy/ui/GroovyMain.java
--- 2.0.0~beta2-1/src/main/groovy/ui/GroovyMain.java 2011-12-21 14:42:00.000000000 +0000
+++ 2.0.0~beta2+isreally1.8.6-0ubuntu1/src/main/groovy/ui/GroovyMain.java 2012-02-09 20:55:10.000000000 +0000
@@ -23,6 +23,7 @@ import groovy.lang.Script;
import java.io.*;
import java.math.BigInteger;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import java.util.List;
@@ -233,10 +234,6 @@ public class GroovyMain {
.withDescription("split lines using splitPattern (default '\\s') using implicit 'split' variable")
.withLongOpt("autosplit")
.create('a'));
- options.addOption(
- OptionBuilder.withLongOpt("indy")
- .withDescription("enables compilation using invokedynamic")
- .create());
return options;
}
@@ -321,10 +318,6 @@ public class GroovyMain {
main.conf.getOptimizationOptions().put(deopt_i,false);
}
- if (line.hasOption("indy")) {
- main.conf.getOptimizationOptions().put("indy", true);
- }
-
main.args = args;
return main.run();
-
.settings/org.eclipse.jdt.core.prefs
-
.pc/0002-ant-build.diff.patch/build.xml
- ...