Refactory: removed unnecessary local variables and imports.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / JavaModelManager.java
index b64d468..fd46139 100644 (file)
@@ -47,7 +47,7 @@ import net.sourceforge.phpdt.core.WorkingCopyOwner;
 import net.sourceforge.phpdt.core.compiler.IProblem;
 import net.sourceforge.phpdt.internal.core.builder.PHPBuilder;
 import net.sourceforge.phpdt.internal.core.util.Util;
-import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil;
+import net.sourceforge.phpdt.internal.core.util.PHPFileUtil;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
 
 import org.eclipse.core.resources.IFile;
@@ -71,6 +71,7 @@ import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Plugin;
 import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
 
@@ -1190,7 +1191,8 @@ public class JavaModelManager implements ISaveParticipant {
                                }
                                // wrap callbacks with Safe runnable for subsequent listeners to
                                // be called when some are causing grief
-                               Platform.run(new ISafeRunnable() {
+                               
+                               SafeRunner.run(new ISafeRunnable() {
                                        public void handleException(Throwable exception) {
                                                Util
                                                                .log(exception,
@@ -1283,8 +1285,8 @@ public class JavaModelManager implements ISaveParticipant {
                if (returnProject) {
                        return proj;
                }
-               int rootEnd = memento.indexOf(JavaElement.JEM_PACKAGEFRAGMENT,
-                               projectEnd + 1);
+//             int rootEnd = memento.indexOf(JavaElement.JEM_PACKAGEFRAGMENT,
+//                             projectEnd + 1);
                // TODO temp-del
                // if (rootEnd == -1) {
                // return model.getHandleFromMementoForRoot(memento, proj, projectEnd,
@@ -1549,7 +1551,7 @@ public class JavaModelManager implements ISaveParticipant {
                                } else { // internal resource (not an IFile or not existing)
                                        IPath location;
                                        if (file.getType() != IResource.FILE
-                                                       || (location = file.getLocation()) == null) {
+                                                       || (location = file.getFullPath()) == null) {
                                                throw new CoreException(
                                                                new Status(
                                                                                IStatus.ERROR,
@@ -1568,7 +1570,7 @@ public class JavaModelManager implements ISaveParticipant {
                                                        JavaCore.PLUGIN_ID, -1, Util.bind(
                                                                        "file.notFound", path.toString()), null)); //$NON-NLS-1$
                                }
-                               IPath location = file.getLocation();
+                               IPath location = file.getFullPath();
                                if (location == null) {
                                        throw new CoreException(new Status(IStatus.ERROR,
                                                        JavaCore.PLUGIN_ID, -1, Util.bind(
@@ -2108,7 +2110,7 @@ public class JavaModelManager implements ISaveParticipant {
        }
 
        private synchronized Map containerClone(IJavaProject project) {
-               Map originalProjectContainers = (Map) this.containers.get(project);
+               Map originalProjectContainers = (Map) JavaModelManager.containers.get(project);
                if (originalProjectContainers == null)
                        return null;
                Map projectContainers = new HashMap(originalProjectContainers.size());