Author: akazakov
Date: 2010-03-03 13:18:49 -0500 (Wed, 03 Mar 2010)
New Revision: 20623
Modified:
branches/jbosstools-3.1.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
branches/jbosstools-3.1.x/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.3
branches/jbosstools-3.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5976
Modified:
branches/jbosstools-3.1.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
---
branches/jbosstools-3.1.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-03-03
18:12:26 UTC (rev 20622)
+++
branches/jbosstools-3.1.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-03-03
18:18:49 UTC (rev 20623)
@@ -612,8 +612,8 @@
}
String className = declaration.getClassName();
+ IType type = null;
if(className!=null) {
- IType type = null;
// validate class name
try {
IProject p = seamProject.getProject();
@@ -640,16 +640,24 @@
} catch (JavaModelException e) {
SeamCorePlugin.getDefault().logError(SeamCoreMessages.SEAM_CORE_VALIDATOR_ERROR_VALIDATING_SEAM_CORE,
e);
}
- // validate properties
- Collection<ISeamProperty> properties = declaration.getProperties();
- for (ISeamProperty property : properties) {
- if(SeamUtil.isJar(property)) {
- return;
+ }
+ // validate properties
+ Collection<ISeamProperty> properties = declaration.getProperties();
+ for (ISeamProperty property : properties) {
+ if(SeamUtil.isJar(property)) {
+ return;
+ }
+ String name = property.getName();
+ if(name==null) {
+ return;
+ }
+ if(type==null && component.getJavaDeclaration()!=null) {
+ IMember member = component.getJavaDeclaration().getSourceMember();
+ if(member instanceof IType) {
+ type = (IType)member;
}
- String name = property.getName();
- if(name==null) {
- return;
- }
+ }
+ if(type!=null) {
boolean ok = type.isBinary() || SeamUtil.findProperty(type, name)!=null;
if(!ok) {
addError(SeamValidationMessages.UNKNOWN_COMPONENT_PROPERTY,
SeamPreferences.UNKNOWN_COMPONENT_PROPERTY, new String[]{type.getElementName(),
componentName, name}, property, declaration.getResource());
Modified:
branches/jbosstools-3.1.x/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.3
===================================================================
---
branches/jbosstools-3.1.x/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.3 2010-03-03
18:12:26 UTC (rev 20622)
+++
branches/jbosstools-3.1.x/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.3 2010-03-03
18:18:49 UTC (rev 20623)
@@ -10,12 +10,16 @@
http://jboss.com/products/seam/drools
http://jboss.com/products/seam/drools-1.1.xsd
http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-1.1.xsd
http://jboss.com/products/seam/mail
http://jboss.com/products/seam/mail-1.2.xsd
-
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-1.1.xsd">
+
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-1.1.xsd">
<component
class="org.domain.SeamWebWarTestProject.session.StatefulComponent"
scope="application">
<property name="abc">value1</property>
</component>
+ <component name="statefulComponent">
+ <property name="abc">value1</property>
+ </component>
+
<core:init debug="true" jndi-pattern="@jndiPattern@"/>
<core:manager concurrent-request-timeout="500"
Modified:
branches/jbosstools-3.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
---
branches/jbosstools-3.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2010-03-03
18:12:26 UTC (rev 20622)
+++
branches/jbosstools-3.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2010-03-03
18:18:49 UTC (rev 20623)
@@ -306,7 +306,7 @@
assertMarkerIsCreated(
componentsFile,
MARKER_TYPE,
- "Class \"StatefulComponent\" of component
\"statefulComponent\" does not have a setter or a field for the property
\"abc\"", 16);
+ "Class \"StatefulComponent\" of component
\"statefulComponent\" does not have a setter or a field for the property
\"abc\"", 16, 20);
}
public void testEntityHasWrongScope_Validator() throws CoreException {