Author: Grid.Qian
Date: 2010-02-10 05:25:07 -0500 (Wed, 10 Feb 2010)
New Revision: 20215
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ValidateWSImplCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
Log:
JBIDE-4806:Cannot create WS artifacts for POJO when in default package
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ValidateWSImplCommand.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ValidateWSImplCommand.java 2010-02-10
10:14:17 UTC (rev 20214)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ValidateWSImplCommand.java 2010-02-10
10:25:07 UTC (rev 20215)
@@ -16,7 +16,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -43,26 +43,28 @@
String implClass = model.getServiceClasses().get(0);
String project = model.getWebProjectName();
- ICompilationUnit unit = null;
try {
- if (JBossWSCreationUtils.getJavaProjectByName(project).findType(
- implClass) != null) {
- unit = JBossWSCreationUtils.getJavaProjectByName(project)
- .findType(implClass).getCompilationUnit();
+ IType type = JBossWSCreationUtils.getJavaProjectByName(project)
+ .findType(implClass);
+ if (type != null) {
+ if(!type.getPackageFragment().exists()||
type.getPackageFragment().isDefaultPackage()){
+ return StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_No_Package);
+ }
+ if (!type.getAnnotation(
+ JBossWSCreationCoreMessages.Webservice_Annotation)
+ .exists()
+ && !type
+ .getAnnotation(
+ JBossWSCreationCoreMessages.Webservice_Annotation_Prefix)
+ .exists()) {
+ return StatusUtils
+ .errorStatus(JBossWSCreationCoreMessages.Error_No_Annotation);
+ }
} else {
return StatusUtils.errorStatus(NLS.bind(
JBossWSCreationCoreMessages.Error_No_Class,
new String[] { implClass, project }));
}
- if (!unit.getSource().contains(
- JBossWSCreationCoreMessages.Webservice_Annotation)
- && !unit
- .getSource()
- .contains(
- JBossWSCreationCoreMessages.Webservice_Annotation_Prefix)) {
- return StatusUtils
- .errorStatus(JBossWSCreationCoreMessages.Error_No_Annotation);
- }
} catch (JavaModelException e) {
JBossWSCreationCore.getDefault().logError(e);
return StatusUtils.errorStatus(NLS.bind(
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2010-02-10
10:14:17 UTC (rev 20214)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2010-02-10
10:25:07 UTC (rev 20215)
@@ -26,8 +26,8 @@
# START NON-TRANSLATABLE
Separator_Java=/
WebserviceClient_Annotation=@WebServiceClient
-Webservice_Annotation=@WebService
-Webservice_Annotation_Prefix=(a)javax.jws.WebService
+Webservice_Annotation=WebService
+Webservice_Annotation_Prefix=javax.jws.WebService
Webservice_Annotation_Check=@WebService(
Client_Sample_Package_Name=.clientsample
Client_Sample_Class_Name=ClientSample
@@ -37,6 +37,7 @@
Error_No_Class= The class {0} cannot be loaded via project {1}.Check that the project
contains the class, or that the class is loadable according to the Java Build Path of the
project.
Error_WS_Location=The JBoss WS Runtime Location is NULL. Please set the location on JBoss
WS preferences page.
Error_Create_Client_Sample=When create a client sample, a error comes up. Please check
the generated files.
+Error_No_Package=The service implementation selected does not follow Java naming
conventions. This may result in not being able to generate your WebService.
Error_WS_Chose_runtime=Select a JBoss Web Service runtime. If a server supplied JBoss
Web Service runtime is chosen ,\n the chosen server adapter must be capable of providing
the JBoss Web Service runtime
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2010-02-10
10:14:17 UTC (rev 20214)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2010-02-10
10:25:07 UTC (rev 20215)
@@ -48,6 +48,7 @@
public static String Error_No_Annotation;
public static String WebserviceClient_Annotation;
public static String Error_No_Class;
+ public static String Error_No_Package;
public static String Error_WS_Location;
public static String Error_WS_No_Runtime_Specifed;
public static String Error_WS_Chose_runtime;
Show replies by date