[446080] Remove the javax.xml.bind bundle from WTP
diff --git a/bundles/org.eclipse.jst.ws.jaxws.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.jaxws.core/META-INF/MANIFEST.MF
index faf5d8f..184a5b7 100644
--- a/bundles/org.eclipse.jst.ws.jaxws.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws.jaxws.core/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jst.ws.jaxws.core;singleton:=true
Bundle-Vendor: %pluginProvider
-Bundle-Version: 1.0.400.qualifier
+Bundle-Version: 1.0.401.qualifier
Bundle-ClassPath: .
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
@@ -28,7 +28,6 @@
Import-Package: javax.activation,
javax.jws,
javax.jws.soap,
- javax.xml.bind.annotation,
javax.xml.ws;version="2.1.0",
javax.xml.ws.http;version="2.1.0",
javax.xml.ws.soap;version="2.1.0",
diff --git a/bundles/org.eclipse.jst.ws.jaxws.core/pom.xml b/bundles/org.eclipse.jst.ws.jaxws.core/pom.xml
index 6a34cf9..a39589f 100644
--- a/bundles/org.eclipse.jst.ws.jaxws.core/pom.xml
+++ b/bundles/org.eclipse.jst.ws.jaxws.core/pom.xml
@@ -22,7 +22,7 @@
<groupId>org.eclipse.webtools.webservices</groupId>
<artifactId>org.eclipse.jst.ws.jaxws.core</artifactId>
- <version>1.0.400-SNAPSHOT</version>
+ <version>1.0.401-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
diff --git a/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/WebServiceParametersReturnTypesRule.java b/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/WebServiceParametersReturnTypesRule.java
index 7bccfba..11068de 100644
--- a/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/WebServiceParametersReturnTypesRule.java
+++ b/bundles/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/annotations/validation/WebServiceParametersReturnTypesRule.java
@@ -17,7 +17,6 @@
import java.util.Set;
import javax.jws.WebService;
-import javax.xml.bind.annotation.XmlType;
import org.eclipse.jdt.apt.core.env.EclipseAnnotationProcessorEnvironment;
import org.eclipse.jdt.core.Flags;
@@ -27,10 +26,10 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jst.ws.annotations.core.processor.AbstractAnnotationProcessor;
-import org.eclipse.jst.ws.annotations.core.utils.AnnotationUtils;
import org.eclipse.jst.ws.internal.jaxws.core.JAXWSCoreMessages;
import org.eclipse.jst.ws.internal.jaxws.core.JAXWSCorePlugin;
+import com.sun.mirror.declaration.AnnotationMirror;
import com.sun.mirror.declaration.AnnotationTypeDeclaration;
import com.sun.mirror.declaration.ClassDeclaration;
import com.sun.mirror.declaration.Declaration;
@@ -50,6 +49,8 @@
private static final Set<String> ALLOWED_IN_MULTIPLE_INHERITANCE = new HashSet<String>();
+ private static final String XML_TYPE = "javax.xml.bind.annotation.XmlType";
+
static {
JAVA_TYPES.add("java.util.Calendar"); //$NON-NLS-1$
JAVA_TYPES.add("java.util.Date"); //$NON-NLS-1$
@@ -231,9 +232,18 @@
}
private boolean isXMLType(InterfaceDeclaration interfaceDeclaration) {
- return AnnotationUtils.getAnnotation(interfaceDeclaration, XmlType.class) != null;
- }
+ Collection<AnnotationMirror> aannotationMirrors = interfaceDeclaration.getAnnotationMirrors();
+ for (AnnotationMirror annotationMirror : aannotationMirrors) {
+ AnnotationTypeDeclaration annotationTypeDeclaration = annotationMirror.getAnnotationType().getDeclaration();
+ if (annotationTypeDeclaration != null
+ && annotationTypeDeclaration.getQualifiedName().equals(XML_TYPE)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private void checkIfRemoteObject(ClassDeclaration classDeclaration, MethodDeclaration methodDeclaration) {
if (isRemoteObject(classDeclaration)) {
printError(methodDeclaration.getPosition(), JAXWSCoreMessages.bind(
diff --git a/features/org.eclipse.jst.ws.cxf.feature/feature.xml b/features/org.eclipse.jst.ws.cxf.feature/feature.xml
index 35a23cf..5eeefac 100644
--- a/features/org.eclipse.jst.ws.cxf.feature/feature.xml
+++ b/features/org.eclipse.jst.ws.cxf.feature/feature.xml
@@ -89,13 +89,6 @@
unpack="false"/>
<plugin
- id="javax.xml.bind"
- download-size="0"
- install-size="0"
- version="2.1.9.qualifier"
- unpack="false"/>
-
- <plugin
id="javax.xml.stream"
download-size="0"
install-size="0"
diff --git a/features/org.eclipse.jst.ws.cxf.feature/pom.xml b/features/org.eclipse.jst.ws.cxf.feature/pom.xml
index 2eecc65..4cad719 100644
--- a/features/org.eclipse.jst.ws.cxf.feature/pom.xml
+++ b/features/org.eclipse.jst.ws.cxf.feature/pom.xml
@@ -41,7 +41,6 @@
<configuration>
<excludes>
<feature id="org.eclipse.jst.ws.jaxws_userdoc.feature"/>
- <plugin id="javax.xml.bind"/>
<plugin id="javax.xml.stream"/>
<plugin id="javax.xml.ws"/>
</excludes>
diff --git a/features/org.eclipse.jst.ws.jaxws.feature/feature.xml b/features/org.eclipse.jst.ws.jaxws.feature/feature.xml
index b7ff135..3f9582c 100644
--- a/features/org.eclipse.jst.ws.jaxws.feature/feature.xml
+++ b/features/org.eclipse.jst.ws.jaxws.feature/feature.xml
@@ -57,13 +57,6 @@
unpack="false"/>
<plugin
- id="javax.xml.bind"
- download-size="0"
- install-size="0"
- version="2.1.9.qualifier"
- unpack="false"/>
-
- <plugin
id="javax.xml.stream"
download-size="0"
install-size="0"
diff --git a/features/org.eclipse.jst.ws.jaxws.feature/pom.xml b/features/org.eclipse.jst.ws.jaxws.feature/pom.xml
index 2836e7d..34ab30b 100644
--- a/features/org.eclipse.jst.ws.jaxws.feature/pom.xml
+++ b/features/org.eclipse.jst.ws.jaxws.feature/pom.xml
@@ -40,7 +40,6 @@
</goals>
<configuration>
<excludes>
- <plugin id="javax.xml.bind"/>
<plugin id="javax.xml.stream"/>
<plugin id="javax.xml.ws"/>
</excludes>
diff --git a/features/org.eclipse.jst.ws.jaxws_tests.feature/feature.xml b/features/org.eclipse.jst.ws.jaxws_tests.feature/feature.xml
index fb124e3..a2778d8 100644
--- a/features/org.eclipse.jst.ws.jaxws_tests.feature/feature.xml
+++ b/features/org.eclipse.jst.ws.jaxws_tests.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jst.ws.jaxws_tests.feature"
label="%featureName"
- version="1.0.300.qualifier"
+ version="1.0.400.qualifier"
provider-name="%featureProvider"
image="eclipse_update_120.jpg"
license-feature="org.eclipse.license"
diff --git a/features/org.eclipse.jst.ws.jaxws_tests.feature/pom.xml b/features/org.eclipse.jst.ws.jaxws_tests.feature/pom.xml
index 72904df..fac8385 100644
--- a/features/org.eclipse.jst.ws.jaxws_tests.feature/pom.xml
+++ b/features/org.eclipse.jst.ws.jaxws_tests.feature/pom.xml
@@ -22,6 +22,6 @@
<groupId>org.eclipse.webtools.webservices</groupId>
<artifactId>org.eclipse.jst.ws.jaxws_tests.feature</artifactId>
- <version>1.0.300-SNAPSHOT</version>
+ <version>1.0.400-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/tests/org.eclipse.jst.ws.jaxb.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.jst.ws.jaxb.core.tests/META-INF/MANIFEST.MF
index 8f07ac9..1aa8167 100644
--- a/tests/org.eclipse.jst.ws.jaxb.core.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.jst.ws.jaxb.core.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jst.ws.jaxb.core.tests
-Bundle-Version: 1.0.300.qualifier
+Bundle-Version: 1.0.400.qualifier
Bundle-Vendor: %pluginProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.junit;bundle-version="3.8.0",
@@ -18,10 +18,4 @@
org.eclipse.jdt.apt.core;bundle-version="[3.3.100,4.0.0)",
org.eclipse.text;bundle-version="[3.4.0,4.0.0)",
org.eclipse.jdt.ui;bundle-version="[3.4.0,4.0.0)"
-Import-Package: javax.xml.bind;version="[2.1.0,2.2.0)",
- javax.xml.bind.annotation;version="[2.1.0,2.2.0)",
- javax.xml.bind.annotation.adapters;version="[2.1.0,2.2.0)",
- javax.xml.bind.attachment;version="[2.1.0,2.2.0)",
- javax.xml.bind.helpers;version="[2.1.0,2.2.0)",
- javax.xml.bind.util;version="[2.1.0,2.2.0)"
Export-Package: org.eclipse.jst.ws.jaxb.core.tests
diff --git a/tests/org.eclipse.jst.ws.jaxb.core.tests/pom.xml b/tests/org.eclipse.jst.ws.jaxb.core.tests/pom.xml
index e01791b..39d4db3 100644
--- a/tests/org.eclipse.jst.ws.jaxb.core.tests/pom.xml
+++ b/tests/org.eclipse.jst.ws.jaxb.core.tests/pom.xml
@@ -22,6 +22,6 @@
<groupId>org.eclipse.webtools.webservices</groupId>
<artifactId>org.eclipse.jst.ws.jaxb.core.tests</artifactId>
- <version>1.0.300-SNAPSHOT</version>
+ <version>1.0.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/tests/org.eclipse.jst.ws.jaxb.core.tests/src/org/eclipse/jst/ws/jaxb/core/tests/AddAnnotationToPackageTest.java b/tests/org.eclipse.jst.ws.jaxb.core.tests/src/org/eclipse/jst/ws/jaxb/core/tests/AddAnnotationToPackageTest.java
index 016d91d..1470922 100644
--- a/tests/org.eclipse.jst.ws.jaxb.core.tests/src/org/eclipse/jst/ws/jaxb/core/tests/AddAnnotationToPackageTest.java
+++ b/tests/org.eclipse.jst.ws.jaxb.core.tests/src/org/eclipse/jst/ws/jaxb/core/tests/AddAnnotationToPackageTest.java
@@ -13,8 +13,6 @@
import java.util.ArrayList;
import java.util.List;
-import javax.xml.bind.annotation.XmlSchema;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IPackageDeclaration;
@@ -25,6 +23,9 @@
public class AddAnnotationToPackageTest extends AbstractAnnotationTest {
+ private static final String XML_SCHEMA_CANONICAL_NAME = "javax.xml.bind.annotation.XmlSchema";
+ private static final String XML_SCHEMA_SIMPLE_NAME = "XmlSchema";
+
@Override
public String getPackageName() {
return "com.example";
@@ -53,23 +54,23 @@
memberValuePairs.add(locationVP);
memberValuePairs.add(namespaceVP);
- return AnnotationsCore.createNormalAnnotation(ast, XmlSchema.class.getSimpleName(), memberValuePairs);
+ return AnnotationsCore.createNormalAnnotation(ast, XML_SCHEMA_SIMPLE_NAME, memberValuePairs);
}
public void testAddAnnotationToPackage() {
try {
assertNotNull(annotation);
- assertEquals(XmlSchema.class.getSimpleName(), AnnotationUtils.getAnnotationName(annotation));
+ assertEquals(XML_SCHEMA_SIMPLE_NAME, AnnotationUtils.getAnnotationName(annotation));
IPackageDeclaration myPackage = source.getPackageDeclaration(getPackageName());
assertNotNull(myPackage);
textFileChange.addEdit(AnnotationUtils.createAddAnnotationTextEdit(myPackage, annotation));
- textFileChange.addEdit(AnnotationUtils.createAddImportTextEdit(myPackage, XmlSchema.class.getCanonicalName()));
+ textFileChange.addEdit(AnnotationUtils.createAddImportTextEdit(myPackage, XML_SCHEMA_CANONICAL_NAME));
assertTrue(executeChange(new NullProgressMonitor(), textFileChange));
assertTrue(AnnotationUtils.isAnnotationPresent(myPackage, AnnotationUtils.getAnnotationName(annotation)));
- assertTrue(source.getImport(XmlSchema.class.getCanonicalName()).exists());
+ assertTrue(source.getImport(XML_SCHEMA_CANONICAL_NAME).exists());
} catch (CoreException ce) {
fail(ce.getLocalizedMessage());
}
diff --git a/tests/org.eclipse.jst.ws.jaxb.core.tests/src/org/eclipse/jst/ws/jaxb/core/tests/RemoveAnnotationFromPackageTest.java b/tests/org.eclipse.jst.ws.jaxb.core.tests/src/org/eclipse/jst/ws/jaxb/core/tests/RemoveAnnotationFromPackageTest.java
index fdaad71..a753fa1 100644
--- a/tests/org.eclipse.jst.ws.jaxb.core.tests/src/org/eclipse/jst/ws/jaxb/core/tests/RemoveAnnotationFromPackageTest.java
+++ b/tests/org.eclipse.jst.ws.jaxb.core.tests/src/org/eclipse/jst/ws/jaxb/core/tests/RemoveAnnotationFromPackageTest.java
@@ -7,8 +7,6 @@
*******************************************************************************/
package org.eclipse.jst.ws.jaxb.core.tests;
-import javax.xml.bind.annotation.XmlSchema;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IPackageDeclaration;
@@ -18,6 +16,9 @@
public class RemoveAnnotationFromPackageTest extends AbstractAnnotationTest {
+ private static final String XML_SCHEMA_CANONICAL_NAME = "javax.xml.bind.annotation.XmlSchema";
+ private static final String XML_SCHEMA_SIMPLE_NAME = "XmlSchema";
+
@Override
public String getPackageName() {
return "com.example";
@@ -38,13 +39,13 @@
@Override
public Annotation getAnnotation() {
- return AnnotationsCore.createNormalAnnotation(ast, XmlSchema.class.getSimpleName(), null);
+ return AnnotationsCore.createNormalAnnotation(ast, XML_SCHEMA_SIMPLE_NAME, null);
}
public void testRemoveAnnotationFromPackage() {
try {
assertNotNull(annotation);
- assertEquals(XmlSchema.class.getSimpleName(), AnnotationUtils.getAnnotationName(annotation));
+ assertEquals(XML_SCHEMA_SIMPLE_NAME, AnnotationUtils.getAnnotationName(annotation));
IPackageDeclaration myPackage = source.getPackageDeclaration(getPackageName());
assertNotNull(myPackage);
@@ -52,12 +53,12 @@
.getAnnotationName(annotation)));
textFileChange.addEdit(AnnotationUtils.createRemoveAnnotationTextEdit(myPackage, annotation));
- textFileChange.addEdit(AnnotationUtils.createRemoveImportTextEdit(myPackage, XmlSchema.class.getCanonicalName()));
+ textFileChange.addEdit(AnnotationUtils.createRemoveImportTextEdit(myPackage, XML_SCHEMA_CANONICAL_NAME));
assertTrue(executeChange(new NullProgressMonitor(), textFileChange));
assertFalse(AnnotationUtils.isAnnotationPresent(myPackage, AnnotationUtils.getAnnotationName(annotation)));
- assertFalse(source.getImport(XmlSchema.class.getCanonicalName()).exists());
+ assertFalse(source.getImport(XML_SCHEMA_CANONICAL_NAME).exists());
} catch (CoreException ce) {
fail(ce.getLocalizedMessage());
}