groovy git commit: GROOVY-8691: Remove deprecated Jaxb methods in old location

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: GROOVY-8691: Remove deprecated Jaxb methods in old location

paulk
Repository: groovy
Updated Branches:
  refs/heads/master 65acbdfc3 -> 040e8a04c


GROOVY-8691: Remove deprecated Jaxb methods in old location


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/040e8a04
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/040e8a04
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/040e8a04

Branch: refs/heads/master
Commit: 040e8a04ceebf10344832f3ab521dd3146980816
Parents: 65acbdf
Author: Paul King <[hidden email]>
Authored: Mon Jul 9 12:21:31 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Mon Jul 9 12:21:31 2018 +1000

----------------------------------------------------------------------
 subprojects/groovy-xml/build.gradle             | 12 ---
 .../groovy/xml/jaxb/JaxbGroovyMethods.groovy    | 90 --------------------
 2 files changed, 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/040e8a04/subprojects/groovy-xml/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/build.gradle b/subprojects/groovy-xml/build.gradle
index ef25b15..f923ff4 100644
--- a/subprojects/groovy-xml/build.gradle
+++ b/subprojects/groovy-xml/build.gradle
@@ -16,26 +16,14 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-configurations {
-    jaxb // just until we delete deprecated jaxb methods (moved to groovy-jaxb)
-}
-
 dependencies {
     compile rootProject
     testCompile rootProject.sourceSets.test.runtimeClasspath
     testCompile "xmlunit:xmlunit:$xmlunitVersion"
     testCompile project(':groovy-test')
-    jaxb 'javax.xml.bind:jaxb-api:2.3.0'
 }
 
 task moduleDescriptor(type: org.codehaus.groovy.gradle.WriteExtensionDescriptorTask) {
     extensionClasses = 'org.codehaus.groovy.runtime.XmlGroovyMethods'
 }
 compileJava.dependsOn moduleDescriptor
-
-if (JavaVersion.current().isJava9Compatible()) {
-    tasks.withType(GroovyCompile) {
-        groovyClasspath += configurations.jaxb
-        classpath += configurations.jaxb
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/040e8a04/subprojects/groovy-xml/src/main/groovy/groovy/xml/jaxb/JaxbGroovyMethods.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/main/groovy/groovy/xml/jaxb/JaxbGroovyMethods.groovy b/subprojects/groovy-xml/src/main/groovy/groovy/xml/jaxb/JaxbGroovyMethods.groovy
deleted file mode 100644
index a544b2e..0000000
--- a/subprojects/groovy-xml/src/main/groovy/groovy/xml/jaxb/JaxbGroovyMethods.groovy
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.xml.jaxb
-
-import groovy.transform.CompileStatic
-
-import javax.xml.bind.JAXBContext
-import javax.xml.bind.Marshaller
-import javax.xml.bind.Unmarshaller
-
-/**
- * This class defines new groovy methods which appear on Jaxb-related JDK
- * classes ({@code JAXBContext}, {@code Marshaller}) inside the Groovy environment.
- * Static methods are used with the first parameter being the destination class.
- *
- * @deprecated use org.apache.groovy.jaxb.extensions.JaxbExtensions
- */
-@CompileStatic
-@Deprecated
-class JaxbGroovyMethods {
-
-    /**
-     * Marshall an object to a xml {@code String}.
-     *
-     * @param self a Marshaller which can marshall the type of the given object
-     * @param jaxbElement object to marshall to a {@code String}
-     * @return {@code String} representing the object as xml
-     */
-    @Deprecated
-    static <T> String marshal(Marshaller self, T jaxbElement) {
-        StringWriter sw = new StringWriter()
-        self.marshal(jaxbElement, sw)
-        sw.toString()
-    }
-
-    /**
-     * Marshall an object to a xml {@code String}.
-     *
-     * @param self a JaxbContext, which recognizes the type of the given object
-     * @param jaxbElement object to marshall to a {@code String}
-     * @return String representing the object as xml
-     */
-    @Deprecated
-    static <T> String marshal(JAXBContext self, T jaxbElement) {
-        marshal(self.createMarshaller(), jaxbElement)
-    }
-
-    /**
-     * Unmarshal xml data from the given {@code String} to object of the given type.
-     *
-     * @param self Unmarshaller, a Unmarshaller which can unmarshall the type of the given object
-     * @param xml xml data as a {@link String}
-     * @param declaredType appropriate JAXB mapped class to hold node's xml data
-     * @return instance of destination class unmarshalled from xml
-     */
-    @Deprecated
-    static <T> T unmarshal(Unmarshaller self, String xml, Class<T> declaredType) {
-        StringReader sr = new StringReader(xml)
-        declaredType.cast(self.unmarshal(sr))
-    }
-
-    /**
-     * Unmarshal xml data from the given {@code String} to object of the given type.
-     *
-     * @param self a JaxbContext, which recognizes the type of the given object
-     * @param xml xml data as a {@link String}
-     * @param declaredType appropriate JAXB mapped class to hold node's xml data
-     * @return instance of destination class unmarshalled from xml
-     */
-    @Deprecated
-    static <T> T unmarshal(JAXBContext self, String xml, Class<T> declaredType) {
-        unmarshal(self.createUnmarshaller(), xml, declaredType)
-    }
-}