Refactory: remove unused classes, imports, fields and methods.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / ReconcileWorkingCopyOperation.java
index 5356891..95eeb1e 100644 (file)
@@ -34,11 +34,11 @@ public class ReconcileWorkingCopyOperation extends JavaModelOperation {
 
        // net.sourceforge.phpdt.core.dom.CompilationUnit ast;
 
-       public ReconcileWorkingCopyOperation(IJavaElement workingCopy,
-                       boolean forceProblemDetection) {
-               super(new IJavaElement[] { workingCopy });
-               this.forceProblemDetection = forceProblemDetection;
-       }
+//     public ReconcileWorkingCopyOperation(IJavaElement workingCopy,
+//                     boolean forceProblemDetection) {
+//             super(new IJavaElement[] { workingCopy });
+//             this.forceProblemDetection = forceProblemDetection;
+//     }
 
        public ReconcileWorkingCopyOperation(IJavaElement workingCopy,
                        boolean creatAST, int astLevel, boolean forceProblemDetection,
@@ -113,20 +113,19 @@ public class ReconcileWorkingCopyOperation extends JavaModelOperation {
                }
 
                CompilationUnit workingCopy = getWorkingCopy();
-               // boolean wasConsistent = workingCopy.isConsistent();
-               // JavaElementDeltaBuilder deltaBuilder = null;
+               boolean wasConsistent = workingCopy.isConsistent();
+               JavaElementDeltaBuilder deltaBuilder = null;
 
                try {
                        // create the delta builder (this remembers the current content of
                        // the cu)
-                       // if (!wasConsistent){
-                       // deltaBuilder = new JavaElementDeltaBuilder(workingCopy);
-                       //                              
-                       // // update the element infos with the content of the working copy
-                       // workingCopy.makeConsistent(fMonitor);
-                       // deltaBuilder.buildDeltas();
-                       //              
-                       // }
+                       if (!wasConsistent) {
+                               deltaBuilder = new JavaElementDeltaBuilder(workingCopy);
+
+                               // update the element infos with the content of the working copy
+                               workingCopy.makeConsistent(progressMonitor);
+                               deltaBuilder.buildDeltas();
+                       }
 
                        if (progressMonitor != null)
                                progressMonitor.worked(2);
@@ -168,12 +167,12 @@ public class ReconcileWorkingCopyOperation extends JavaModelOperation {
                        }
 
                        // register the deltas
-                       // if (deltaBuilder != null){
-                       // if ((deltaBuilder.delta != null) &&
-                       // (deltaBuilder.delta.getAffectedChildren().length > 0)) {
-                       // addReconcileDelta(workingCopy, deltaBuilder.delta);
-                       // }
-                       // }
+                       if (deltaBuilder != null) {
+                               if ((deltaBuilder.delta != null)
+                                               && (deltaBuilder.delta.getAffectedChildren().length > 0)) {
+                                       addReconcileDelta(workingCopy, deltaBuilder.delta);
+                               }
+                       }
                } finally {
                        if (progressMonitor != null)
                                progressMonitor.done();