groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] branch master updated: GROOVY-8647: Split package renaming (groovy.xml.QName -> groovy.namespace.QName)
Date Fri, 17 May 2019 12:49:07 GMT
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new f37feca  GROOVY-8647: Split package renaming (groovy.xml.QName -> groovy.namespace.QName)
f37feca is described below

commit f37feca3f78c278e4e40e4110e6258f31ca1a3b1
Author: Paul King <paulk@asert.com.au>
AuthorDate: Fri May 17 22:48:54 2019 +1000

    GROOVY-8647: Split package renaming (groovy.xml.QName -> groovy.namespace.QName)
---
 src/main/groovy/groovy/{xml => namespace}/QName.java           |  2 +-
 src/main/groovy/groovy/util/Node.java                          |  2 +-
 src/main/groovy/groovy/util/NodeList.java                      |  2 +-
 src/main/groovy/groovy/xml/QName.java                          |  3 ++-
 .../XmlTest.java => src/test/groovy/namespace/QNameTest.java   | 10 ++--------
 src/test/groovy/util/NodeTest.groovy                           |  2 +-
 .../groovy-ant/src/main/java/groovy/ant/AntBuilder.java        |  2 +-
 .../src/main/groovy/groovy/text/XmlTemplateEngine.java         |  6 +++---
 .../groovy-xml/src/main/java/groovy/xml/DOMBuilder.java        |  1 +
 .../groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java     |  1 +
 subprojects/groovy-xml/src/main/java/groovy/xml/Namespace.java |  2 ++
 .../src/main/java/groovy/xml/NamespaceBuilderSupport.java      |  1 +
 .../groovy-xml/src/main/java/groovy/xml/SAXBuilder.java        |  1 +
 .../groovy-xml/src/main/java/groovy/xml/XmlNodePrinter.java    |  1 +
 subprojects/groovy-xml/src/main/java/groovy/xml/XmlParser.java |  1 +
 .../groovy-xml/src/main/java/groovy/xml/XmlSlurper.java        |  1 +
 .../groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java   |  2 +-
 .../src/main/java/groovy/xml/slurpersupport/Attributes.java    |  2 +-
 .../java/groovy/xml/slurpersupport/NamespaceAwareHashMap.java  |  2 +-
 subprojects/groovy-xml/src/spec/doc/xml-userguide.adoc         |  6 +++---
 .../groovy-xml/src/spec/test/UserGuideXmlParserTest.groovy     |  1 +
 .../src/test/groovy/groovy/xml/NamespaceNodeTest.groovy        |  2 ++
 .../groovy-xml/src/test/groovy/groovy/xml/XmlParserTest.groovy |  1 +
 23 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/src/main/groovy/groovy/xml/QName.java b/src/main/groovy/groovy/namespace/QName.java
similarity index 99%
copy from src/main/groovy/groovy/xml/QName.java
copy to src/main/groovy/groovy/namespace/QName.java
index 06a733d..2d43d79 100644
--- a/src/main/groovy/groovy/xml/QName.java
+++ b/src/main/groovy/groovy/namespace/QName.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package groovy.xml;
+package groovy.namespace;
 
 import java.io.Serializable;
 
diff --git a/src/main/groovy/groovy/util/Node.java b/src/main/groovy/groovy/util/Node.java
index b1907ce..2adc8ea 100644
--- a/src/main/groovy/groovy/util/Node.java
+++ b/src/main/groovy/groovy/util/Node.java
@@ -23,7 +23,7 @@ import groovy.lang.DelegatingMetaClass;
 import groovy.lang.GroovySystem;
 import groovy.lang.MetaClass;
 import groovy.lang.Tuple2;
-import groovy.xml.QName;
+import groovy.namespace.QName;
 import org.codehaus.groovy.runtime.DefaultGroovyMethods;
 import org.codehaus.groovy.runtime.InvokerHelper;
 import org.codehaus.groovy.runtime.StringGroovyMethods;
diff --git a/src/main/groovy/groovy/util/NodeList.java b/src/main/groovy/groovy/util/NodeList.java
index 8ce39f4..c4fac31 100644
--- a/src/main/groovy/groovy/util/NodeList.java
+++ b/src/main/groovy/groovy/util/NodeList.java
@@ -23,7 +23,7 @@ import groovy.lang.DelegatingMetaClass;
 import groovy.lang.GroovyRuntimeException;
 import groovy.lang.GroovySystem;
 import groovy.lang.MetaClass;
-import groovy.xml.QName;
+import groovy.namespace.QName;
 
 import java.util.ArrayList;
 import java.util.Collection;
diff --git a/src/main/groovy/groovy/xml/QName.java b/src/main/groovy/groovy/xml/QName.java
index 06a733d..0c37f42 100644
--- a/src/main/groovy/groovy/xml/QName.java
+++ b/src/main/groovy/groovy/xml/QName.java
@@ -29,6 +29,7 @@ import java.io.Serializable;
  * The localPart provides the local part of the qualified name. The
  * namespaceURI is a URI reference identifying the namespace.
  */
+@Deprecated
 public class QName implements Serializable {
     private static final long serialVersionUID = -9029109610006696081L;
 
@@ -284,4 +285,4 @@ public class QName implements Serializable {
         result = 29 * result + localPart.hashCode();
         return result;
     }
-} 
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlTest.java b/src/test/groovy/namespace/QNameTest.java
similarity index 78%
rename from subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlTest.java
rename to src/test/groovy/namespace/QNameTest.java
index 645e7f5..bbc0e94 100644
--- a/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlTest.java
+++ b/src/test/groovy/namespace/QNameTest.java
@@ -16,17 +16,11 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package groovy.xml;
+package groovy.namespace;
 
 import groovy.test.GroovyTestCase;
 
-public class XmlTest extends GroovyTestCase {
-
-//    public void testTree() throws Exception {
-//        Script script = new GroovyShell().parse(new File("src/test/groovy/xml/dom/NamespaceDOMTest.groovy"));
-////        GroovyObject object = compile("src/test/groovy/xml/dom/NamespaceDOMTest.groovy");
-//        script.invokeMethod("testXsdSchemaWithBuilderHavingAutoPrefix", null);
-//    }
+public class QNameTest extends GroovyTestCase {
 
     public void testQName() {
         QName qname = new QName("urn:mynamespace", "localPart", "x");
diff --git a/src/test/groovy/util/NodeTest.groovy b/src/test/groovy/util/NodeTest.groovy
index f9e4716..5b5b56f 100644
--- a/src/test/groovy/util/NodeTest.groovy
+++ b/src/test/groovy/util/NodeTest.groovy
@@ -18,7 +18,7 @@
  */
 package groovy.util
 
-import groovy.xml.QName
+import groovy.namespace.QName
 
 /**
  * Tests the use of the structured Attribute type
diff --git a/subprojects/groovy-ant/src/main/java/groovy/ant/AntBuilder.java b/subprojects/groovy-ant/src/main/java/groovy/ant/AntBuilder.java
index 166fa66..87d3a80 100644
--- a/subprojects/groovy-ant/src/main/java/groovy/ant/AntBuilder.java
+++ b/subprojects/groovy-ant/src/main/java/groovy/ant/AntBuilder.java
@@ -19,7 +19,7 @@
 package groovy.ant;
 
 import groovy.util.BuilderSupport;
-import groovy.xml.QName;
+import groovy.namespace.QName;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.BuildLogger;
 import org.apache.tools.ant.DemuxInputStream;
diff --git a/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
b/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
index 70db3c3..147697d 100644
--- a/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
+++ b/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
@@ -25,9 +25,9 @@ import groovy.lang.Script;
 import groovy.lang.Writable;
 import groovy.util.IndentPrinter;
 import groovy.util.Node;
-import groovy.util.XmlNodePrinter;
-import groovy.util.XmlParser;
-import groovy.xml.QName;
+import groovy.xml.XmlNodePrinter;
+import groovy.xml.XmlParser;
+import groovy.namespace.QName;
 import org.apache.groovy.io.StringBuilderWriter;
 import org.codehaus.groovy.control.CompilationFailedException;
 import org.codehaus.groovy.runtime.InvokerHelper;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java b/subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java
index f1fd975..2823cb5 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/DOMBuilder.java
@@ -18,6 +18,7 @@
  */
 package groovy.xml;
 
+import groovy.namespace.QName;
 import groovy.util.BuilderSupport;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java b/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
index c469f95..cc219f8 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
@@ -19,6 +19,7 @@
 package groovy.xml;
 
 import groovy.lang.Closure;
+import groovy.namespace.QName;
 import groovy.util.BuilderSupport;
 import groovy.util.IndentPrinter;
 import org.codehaus.groovy.runtime.StringGroovyMethods;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/Namespace.java b/subprojects/groovy-xml/src/main/java/groovy/xml/Namespace.java
index e9276f6..db97a50 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/Namespace.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/Namespace.java
@@ -18,6 +18,8 @@
  */
 package groovy.xml;
 
+import groovy.namespace.QName;
+
 /**
  * A simple helper class which acts as a factory of {@link QName} instances.
  * 
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/NamespaceBuilderSupport.java
b/subprojects/groovy-xml/src/main/java/groovy/xml/NamespaceBuilderSupport.java
index 4b56e58..998ad3f 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/NamespaceBuilderSupport.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/NamespaceBuilderSupport.java
@@ -18,6 +18,7 @@
  */
 package groovy.xml;
 
+import groovy.namespace.QName;
 import groovy.util.BuilderSupport;
 import groovy.util.NodeBuilder;
 import org.codehaus.groovy.runtime.InvokerHelper;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/SAXBuilder.java b/subprojects/groovy-xml/src/main/java/groovy/xml/SAXBuilder.java
index b0b165d..2a74844 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/SAXBuilder.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/SAXBuilder.java
@@ -19,6 +19,7 @@
 package groovy.xml;
 
 import groovy.lang.Tuple3;
+import groovy.namespace.QName;
 import groovy.util.BuilderSupport;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/XmlNodePrinter.java b/subprojects/groovy-xml/src/main/java/groovy/xml/XmlNodePrinter.java
index 7bd4bb2..aa417f6 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/XmlNodePrinter.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/XmlNodePrinter.java
@@ -18,6 +18,7 @@
  */
 package groovy.xml;
 
+import groovy.namespace.QName;
 import groovy.util.IndentPrinter;
 import groovy.util.Node;
 import org.codehaus.groovy.runtime.InvokerHelper;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/XmlParser.java b/subprojects/groovy-xml/src/main/java/groovy/xml/XmlParser.java
index bc53ff0..0129cc1 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/XmlParser.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/XmlParser.java
@@ -18,6 +18,7 @@
  */
 package groovy.xml;
 
+import groovy.namespace.QName;
 import groovy.util.Node;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/XmlSlurper.java b/subprojects/groovy-xml/src/main/java/groovy/xml/XmlSlurper.java
index 6e78b41..5152cfd 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/XmlSlurper.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/XmlSlurper.java
@@ -18,6 +18,7 @@
  */
 package groovy.xml;
 
+import groovy.namespace.QName;
 import groovy.xml.slurpersupport.GPathResult;
 import groovy.xml.slurpersupport.NamespaceAwareHashMap;
 import groovy.xml.slurpersupport.Node;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java b/subprojects/groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java
index 95eca0d..365f21a 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java
@@ -22,7 +22,7 @@ import groovy.lang.Closure;
 import groovy.lang.GroovyRuntimeException;
 import groovy.lang.IntRange;
 import groovy.xml.DOMBuilder;
-import groovy.xml.QName;
+import groovy.namespace.QName;
 import org.codehaus.groovy.runtime.InvokerHelper;
 import org.codehaus.groovy.runtime.XmlGroovyMethods;
 import org.w3c.dom.Attr;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/slurpersupport/Attributes.java
b/subprojects/groovy-xml/src/main/java/groovy/xml/slurpersupport/Attributes.java
index b1d81bc..182e2ce 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/slurpersupport/Attributes.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/slurpersupport/Attributes.java
@@ -21,7 +21,7 @@ package groovy.xml.slurpersupport;
 import groovy.lang.Closure;
 import groovy.lang.GroovyObject;
 import groovy.lang.GroovyRuntimeException;
-import groovy.xml.QName;
+import groovy.namespace.QName;
 
 import java.io.IOException;
 import java.io.Writer;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/slurpersupport/NamespaceAwareHashMap.java
b/subprojects/groovy-xml/src/main/java/groovy/xml/slurpersupport/NamespaceAwareHashMap.java
index 0a3a9e2..4035e5c 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/slurpersupport/NamespaceAwareHashMap.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/slurpersupport/NamespaceAwareHashMap.java
@@ -18,7 +18,7 @@
  */
 package groovy.xml.slurpersupport;
 
-import groovy.xml.QName;
+import groovy.namespace.QName;
 
 import java.util.HashMap;
 import java.util.Map;
diff --git a/subprojects/groovy-xml/src/spec/doc/xml-userguide.adoc b/subprojects/groovy-xml/src/spec/doc/xml-userguide.adoc
index 9796077..ff796cb 100644
--- a/subprojects/groovy-xml/src/spec/doc/xml-userguide.adoc
+++ b/subprojects/groovy-xml/src/spec/doc/xml-userguide.adoc
@@ -28,8 +28,8 @@
 The most commonly used approach for parsing XML with Groovy is to use
 one of:
 
-* `groovy.util.XmlParser`
-* `groovy.util.XmlSlurper`
+* `groovy.xml.XmlParser`
+* `groovy.xml.XmlSlurper`
 
 Both have the same approach to parse an xml. Both come with a bunch of
 overloaded parse methods plus some special methods such as `parseText`,
@@ -511,7 +511,7 @@ The `createNode()` method receives the following parameters:
 * parent node (could be null)
 * The qualified name for the tag (In this case we only use the local
   part without any namespace). We're using an instance of
-  `groovy.xml.QName`
+  `groovy.namespace.QName`
 * A map with the tag's attributes (None in this particular case)
 
 Anyway you won't normally be creating a node from the parser instance
diff --git a/subprojects/groovy-xml/src/spec/test/UserGuideXmlParserTest.groovy b/subprojects/groovy-xml/src/spec/test/UserGuideXmlParserTest.groovy
index 6de9fd4..be06ac1 100644
--- a/subprojects/groovy-xml/src/spec/test/UserGuideXmlParserTest.groovy
+++ b/subprojects/groovy-xml/src/spec/test/UserGuideXmlParserTest.groovy
@@ -18,6 +18,7 @@
  */
 package groovy.xml
 
+import groovy.namespace.QName
 import groovy.test.GroovyTestCase
 
 /**
diff --git a/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy b/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy
index 6fa879c..32c84cc 100644
--- a/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy
+++ b/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy
@@ -18,6 +18,8 @@
  */
 package groovy.xml
 
+import groovy.namespace.QName
+
 /**
  * Test the building of namespaced XML using GroovyMarkup
  */
diff --git a/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlParserTest.groovy b/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlParserTest.groovy
index 6288164..78fc5b2 100644
--- a/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlParserTest.groovy
+++ b/subprojects/groovy-xml/src/test/groovy/groovy/xml/XmlParserTest.groovy
@@ -18,6 +18,7 @@
  */
 package groovy.xml
 
+import groovy.namespace.QName
 import groovy.test.GroovyTestCase
 
 class XmlParserTest extends GroovyTestCase {


Mime
View raw message