Author: akazakov
Date: 2010-10-20 10:15:32 -0400 (Wed, 20 Oct 2010)
New Revision: 25945
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
https://jira.jboss.org/browse/JBIDE-7374
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-10-20
13:09:36 UTC (rev 25944)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-10-20
14:15:32 UTC (rev 25945)
@@ -28,6 +28,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
@@ -687,7 +688,12 @@
try {
IProject p = seamProject.getProject();
// type = EclipseJavaUtil.findType(EclipseResourceUtil.getJavaProject(p),
className);
- type = EclipseResourceUtil.getJavaProject(p).findType(className);
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(p);
+ if(javaProject==null) {
+ SeamCorePlugin.getDefault().logWarning("Can't get Java project for "
+ seamProject.getProject()!=null?seamProject.getProject().getName():"" + "
Seam project.");
+ return;
+ }
+ type = javaProject.findType(className);
if(type==null) {
// Mark wrong class name
ITextSourceReference location =
((SeamComponentDeclaration)declaration).getLocationFor(ISeamXmlComponentDeclaration.CLASS);