JUnit test fix and classpath issue with build.
diff --git a/bundles/org.eclipse.jst.ws.annotations.core/src/org/eclipse/jst/ws/annotations/core/utils/AnnotationUtils.java b/bundles/org.eclipse.jst.ws.annotations.core/src/org/eclipse/jst/ws/annotations/core/utils/AnnotationUtils.java
index bfe6094..f0a03b3 100644
--- a/bundles/org.eclipse.jst.ws.annotations.core/src/org/eclipse/jst/ws/annotations/core/utils/AnnotationUtils.java
+++ b/bundles/org.eclipse.jst.ws.annotations.core/src/org/eclipse/jst/ws/annotations/core/utils/AnnotationUtils.java
@@ -1105,8 +1105,11 @@
}
@SuppressWarnings("unchecked")
- public static SingleVariableDeclaration getMethodParameter(IMethod method, int offset) {
- CompilationUnit compilationUnit = getASTParser(method.getCompilationUnit());
+ public static SingleVariableDeclaration getMethodParameter(CompilationUnit compilationUnit,
+ IMethod method, int offset) {
+ if (compilationUnit == null) {
+ compilationUnit = getASTParser(method.getCompilationUnit());
+ }
IType type = method.getDeclaringType();
List<AbstractTypeDeclaration> types = compilationUnit.types();
for (AbstractTypeDeclaration abstractTypeDeclaration : types) {
diff --git a/bundles/org.eclipse.jst.ws.cxf.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.cxf.core/META-INF/MANIFEST.MF
index f2dfebd..90a4e0c 100644
--- a/bundles/org.eclipse.jst.ws.cxf.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws.cxf.core/META-INF/MANIFEST.MF
@@ -39,4 +39,5 @@
Created-By: 1.5.0_14-b03 (Sun Microsystems Inc.)
Bundle-ActivationPolicy: lazy
Import-Package: javax.jws,
+ javax.jws.soap,
javax.xml.ws
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 42e8651..87c59c0 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
@@ -24,4 +24,5 @@
org.eclipse.jst.ws.internal.jaxws.core.annotations.validation;x-friends:="org.eclipse.jst.ws.annotations.core",
org.eclipse.jst.ws.jaxws.core.utils
Import-Package: javax.jws,
+ javax.jws.soap,
javax.xml.ws
diff --git a/bundles/org.eclipse.jst.ws.jaxws.ui/src/org/eclipse/jst/ws/internal/jaxws/ui/annotations/contentassist/AnnotationCompletionProposalComputer.java b/bundles/org.eclipse.jst.ws.jaxws.ui/src/org/eclipse/jst/ws/internal/jaxws/ui/annotations/contentassist/AnnotationCompletionProposalComputer.java
index e19c39d..5caaf87 100644
--- a/bundles/org.eclipse.jst.ws.jaxws.ui/src/org/eclipse/jst/ws/internal/jaxws/ui/annotations/contentassist/AnnotationCompletionProposalComputer.java
+++ b/bundles/org.eclipse.jst.ws.jaxws.ui/src/org/eclipse/jst/ws/internal/jaxws/ui/annotations/contentassist/AnnotationCompletionProposalComputer.java
@@ -91,7 +91,7 @@
}
if (elementType == IJavaElement.METHOD) {
- SingleVariableDeclaration parameter = AnnotationUtils.getMethodParameter(
+ SingleVariableDeclaration parameter = AnnotationUtils.getMethodParameter(compilationUnit,
(IMethod)javaElement, tokenStart);
if (parameter != null) {
return getCompletionProposalsForASTNode(parameter.modifiers(), parameter, tokenStart);
diff --git a/bundles/org.eclipse.jst.ws.jaxws.ui/src/org/eclipse/jst/ws/internal/jaxws/ui/views/AnnotationsView.java b/bundles/org.eclipse.jst.ws.jaxws.ui/src/org/eclipse/jst/ws/internal/jaxws/ui/views/AnnotationsView.java
index b2f45a5..f9ea8c3 100755
--- a/bundles/org.eclipse.jst.ws.jaxws.ui/src/org/eclipse/jst/ws/internal/jaxws/ui/views/AnnotationsView.java
+++ b/bundles/org.eclipse.jst.ws.jaxws.ui/src/org/eclipse/jst/ws/internal/jaxws/ui/views/AnnotationsView.java
@@ -233,7 +233,7 @@
if (javaElement.getElementType() == IJavaElement.METHOD) {
IMethod method = (IMethod) javaElement;
SingleVariableDeclaration parameter = AnnotationUtils
- .getMethodParameter(method, offset);
+ .getMethodParameter(null, method, offset);
if (parameter != null) {
annotationTreeViewer.setInput(parameter);
} else {
diff --git a/tests/org.eclipse.jst.ws.jaxws.core.tests/src/org/eclipse/jst/ws/jaxws/core/tests/AddAnnotationToMethodParameterTest.java b/tests/org.eclipse.jst.ws.jaxws.core.tests/src/org/eclipse/jst/ws/jaxws/core/tests/AddAnnotationToMethodParameterTest.java
index fe44a98..0122e94 100644
--- a/tests/org.eclipse.jst.ws.jaxws.core.tests/src/org/eclipse/jst/ws/jaxws/core/tests/AddAnnotationToMethodParameterTest.java
+++ b/tests/org.eclipse.jst.ws.jaxws.core.tests/src/org/eclipse/jst/ws/jaxws/core/tests/AddAnnotationToMethodParameterTest.java
@@ -60,7 +60,8 @@
IMethod method = source.findPrimaryType().getMethod("add", new String[] {"I", "I"});
assertNotNull(method);
- SingleVariableDeclaration parameter = AnnotationUtils.getMethodParameter(method, 44);
+ SingleVariableDeclaration parameter = AnnotationUtils.getMethodParameter(compilationUnit, method,
+ 44);
AnnotationUtils.createMethodParameterAnnotationChange(source, compilationUnit, rewriter,
parameter, method, annotation, textFileChange);
@@ -68,7 +69,8 @@
assertTrue(executeChange(new NullProgressMonitor(), textFileChange));
//refresh
- parameter = AnnotationUtils.getMethodParameter(method, 44);
+ parameter = AnnotationUtils.getMethodParameter(
+ AnnotationUtils.getASTParser(method.getCompilationUnit()), method, 44);
assertTrue(AnnotationUtils.isAnnotationPresent(parameter, annotation));
} catch (CoreException ce) {
diff --git a/tests/org.eclipse.jst.ws.jaxws.core.tests/src/org/eclipse/jst/ws/jaxws/core/tests/RemoveAnnotationFromMethodParameterTest.java b/tests/org.eclipse.jst.ws.jaxws.core.tests/src/org/eclipse/jst/ws/jaxws/core/tests/RemoveAnnotationFromMethodParameterTest.java
index 1c47d5e..606746a 100644
--- a/tests/org.eclipse.jst.ws.jaxws.core.tests/src/org/eclipse/jst/ws/jaxws/core/tests/RemoveAnnotationFromMethodParameterTest.java
+++ b/tests/org.eclipse.jst.ws.jaxws.core.tests/src/org/eclipse/jst/ws/jaxws/core/tests/RemoveAnnotationFromMethodParameterTest.java
@@ -53,7 +53,8 @@
IMethod method = source.findPrimaryType().getMethod("add", new String[] {"I", "I"});
assertNotNull(method);
- SingleVariableDeclaration parameter = AnnotationUtils.getMethodParameter(method, 44);
+ SingleVariableDeclaration parameter = AnnotationUtils.getMethodParameter(compilationUnit, method,
+ 44);
assertTrue(AnnotationUtils.isAnnotationPresent(parameter, annotation));
@@ -63,7 +64,8 @@
assertTrue(executeChange(new NullProgressMonitor(), textFileChange));
//refresh
- parameter = AnnotationUtils.getMethodParameter(method, 44);
+ parameter = AnnotationUtils.getMethodParameter(
+ AnnotationUtils.getASTParser(method.getCompilationUnit()), method, 44);
assertFalse(AnnotationUtils.isAnnotationPresent(parameter, annotation));
} catch (CoreException ce) {