Author: scabanovich
Date: 2010-10-15 07:10:18 -0400 (Fri, 15 Oct 2010)
New Revision: 25858
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
Log:
JBIDE-7343
https://jira.jboss.org/browse/JBIDE-7343
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2010-10-15
10:12:40 UTC (rev 25857)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2010-10-15
11:10:18 UTC (rev 25858)
@@ -27,6 +27,10 @@
public class KbProjectFactory {
+ public static IKbProject getKbProject(IProject project, boolean resolve) {
+ return getKbProject(project, resolve, false);
+ }
+
/**
* Factory method creating kb project instance by project resource.
* Returns null if
@@ -38,10 +42,11 @@
* @param resolve if true and results of last build have not been resolved they are
loaded.
* @return
*/
- public static IKbProject getKbProject(IProject project, boolean resolve) {
+ public static IKbProject getKbProject(IProject project, boolean resolve, boolean
isNatureRequired) {
if(project == null || !project.exists() || !project.isOpen()) return null;
try {
if(!project.hasNature(IKbProject.NATURE_ID)) {
+ if(isNatureRequired) return null;
String s = project.getPersistentProperty(NATURE_MOCK);
if(s != null && "true".equals(s)) {
return getMockKbProject(project);
@@ -101,6 +106,9 @@
long t0 = System.currentTimeMillis();
KbBuilderEx builder = new KbBuilderEx();
setProjectToBuilder(builder, project);
+ if(WebKbPlugin.getDefault() == null) {
+ return;
+ }
builder.build();
underConstruction.remove(project);
// long dt = System.currentTimeMillis() - t0;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java 2010-10-15
10:12:40 UTC (rev 25857)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java 2010-10-15
11:10:18 UTC (rev 25858)
@@ -49,7 +49,7 @@
case ISaveContext.FULL_SAVE:
IProject[] ps = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject p: ps) {
- KbProject sp = (KbProject)KbProjectFactory.getKbProject(p, false);
+ KbProject sp = (KbProject)KbProjectFactory.getKbProject(p, false, true);
if(sp != null && sp.getModificationsSinceLastStore() > 0) {
// sp.printModifications();
try {