Author: dgolovin
Date: 2010-04-26 13:59:43 -0400 (Mon, 26 Apr 2010)
New Revision: 21698
Modified:
branches/jbosstools-3.1.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5892 NPE - seam core validation
patch applied to the branch
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-04-26
17:59:12 UTC (rev 21697)
+++
branches/jbosstools-3.1.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-04-26
17:59:43 UTC (rev 21698)
@@ -158,8 +158,10 @@
SeamProjectsSet set = new SeamProjectsSet(project);
IProject warProject = set.getWarProject();
- seamProject = SeamCorePlugin.getSeamProject(warProject, false);
- projectName = seamProject.getProject().getName();
+ if(warProject.isAccessible()) {
+ seamProject = SeamCorePlugin.getSeamProject(warProject, false);
+ projectName = seamProject.getProject().getName();
+ }
}
private boolean isPreferencesEnabled(IProject project) {
@@ -172,6 +174,9 @@
*/
public IStatus validate(Set<IFile> changedFiles, IProject project,
ContextValidationHelper validationHelper, ValidatorManager manager, IReporter reporter)
throws ValidationException {
init(project, validationHelper, manager, reporter);
+ if(seamProject==null) {
+ return OK_STATUS;
+ }
displaySubtask(SeamValidationMessages.SEARCHING_RESOURCES, new String[]{projectName});
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@@ -269,6 +274,9 @@
*/
public IStatus validateAll(IProject project, ContextValidationHelper validationHelper,
ValidatorManager manager, IReporter reporter) throws ValidationException {
init(project, validationHelper, manager, reporter);
+ if(seamProject==null) {
+ return OK_STATUS;
+ }
removeAllMessagesFromResource(seamProject.getProject());
ISeamComponent[] components = seamProject.getComponents();
for (ISeamComponent component : components) {