[jbosstools-commits] JBoss Tools SVN: r35900 - trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Oct 21 10:09:56 EDT 2011


Author: xcoulon
Date: 2011-10-21 10:09:55 -0400 (Fri, 21 Oct 2011)
New Revision: 35900

Modified:
   trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/ResourceMethod.java
Log:
Fixing JBIDE-9797 in trunk

Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/ResourceMethod.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/ResourceMethod.java	2011-10-21 13:27:56 UTC (rev 35899)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/ResourceMethod.java	2011-10-21 14:09:55 UTC (rev 35900)
@@ -16,6 +16,7 @@
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IMethod;
 import org.eclipse.jdt.core.IType;
 import org.eclipse.jdt.core.dom.CompilationUnit;
@@ -97,14 +98,22 @@
 			}
 			this.kind = nextKind;
 		}
-		IMethodBinding methodBinding = JdtUtils.resolveMethodBinding(javaMethod, compilationUnit);
+		if (this.kind == EnumKind.SUBRESOURCE_LOCATOR) {
+			IMethodBinding methodBinding = JdtUtils.resolveMethodBinding(
+					javaMethod, compilationUnit);
+			ITypeBinding javaReturnTypeBinding = methodBinding.getReturnType();
+			IJavaElement nextReturnType = javaReturnTypeBinding != null ? javaReturnTypeBinding
+					.getJavaElement() : null;
 
-		ITypeBinding javaReturnType = methodBinding.getReturnType();
-		IType nextReturnType = javaReturnType != null ? (IType) javaReturnType.getJavaElement() : null;
-		if ((nextReturnType != null && !nextReturnType.equals(this.returnType))
-				|| (this.returnType != null && !this.returnType.equals(nextReturnType))) {
-			changes.add(EnumElementChange.KIND);
-			this.returnType = nextReturnType;
+			if (nextReturnType.getElementType() == IJavaElement.TYPE
+					&& ((nextReturnType != null && !nextReturnType
+							.equals(this.returnType)) || (this.returnType != null && !this.returnType
+							.equals(nextReturnType)))) {
+				changes.add(EnumElementChange.KIND);
+				this.returnType = (IType) nextReturnType;
+			}
+		} else {
+			this.returnType = null;
 		}
 
 		return changes;



More information about the jbosstools-commits mailing list