reduce warnings due to core.runtime deprecations
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / PHPDBGProxy.java
index 5c1f627..ad51716 100644 (file)
@@ -138,7 +138,7 @@ public class PHPDBGProxy {
                int bpNo= 0;
                try {
                        PHPLineBreakpoint phpLBP;
-                       if(breakpoint.getModelIdentifier() == PHPDebugCorePlugin.getDefault().getDescriptor().getUniqueIdentifier()) {
+                       if(breakpoint.getModelIdentifier() == PHPDebugCorePlugin.getUniqueIdentifier()) {
                                IPath filename;
                                phpLBP= (PHPLineBreakpoint)breakpoint;
                                //                              bpNo= DBGInt.addBreakpoint(phpLBP.getMarker().getResource().getLocation().toOSString(), phpLBP.getLineNumber());
@@ -162,7 +162,7 @@ public class PHPDBGProxy {
                if (DBGInt == null) return;
                try {
                        PHPLineBreakpoint phpLBP;
-                       if(breakpoint.getModelIdentifier() == PHPDebugCorePlugin.getDefault().getDescriptor().getUniqueIdentifier()) {
+                       if(breakpoint.getModelIdentifier() == PHPDebugCorePlugin.getUniqueIdentifier()) {
                                phpLBP= (PHPLineBreakpoint)breakpoint;
                                IPath filename;
                                if (remote)
@@ -345,16 +345,16 @@ public class PHPDBGProxy {
                                while (!shouldStop)     
                                {       
                                        newconnect=true;
-               try {
-                 newSocket = server.accept();
+                                       try {
+                                               newSocket = server.accept();
                 //System.out.println("Accepted! : " + socket.toString());
-               } catch (SocketTimeoutException e) {
+                                       } catch (SocketTimeoutException e) {
                                                // no one wants to connect
                                                newconnect=false;
-                   } catch (IOException e) {
-               PHPDebugCorePlugin.log(e);
-             return;
-             }
+                                       } catch (IOException e) {
+                                               PHPDebugCorePlugin.log(e);
+                                               return;
+                                       }
        
                                        if (newconnect)
                                        {
@@ -362,84 +362,81 @@ public class PHPDBGProxy {
                                                        server.setSoTimeout(1);
                                                newDBGInt= new PHPDBGInterface(getReader(newSocket), newSocket.getOutputStream(), thisProxy);
                                                newDBGInt.waitResponse(1000);
-                 newDBGInt.flushAllPackets();
+                                               newDBGInt.flushAllPackets();
                                                // Check version and session ID
-                 if ((DBGInt==null) || (DBGInt.getSID()==newDBGInt.getSID()))
-                 {
-                       DBGInt=newDBGInt;
+                                               if ((DBGInt==null) || (DBGInt.getSID()==newDBGInt.getSID()))
+                                               {
+                                                       DBGInt=newDBGInt;
                                                        try     {
                                                                closeSocket();
                                                        }       catch (IOException e) {
                                                                PHPDebugCorePlugin.log(e);
                                                                shouldStop=true;
                                                        }
-                       socket=newSocket;
+                                                       socket=newSocket;
                                                        setBreakPoints();
                                                        DBGInt.continueExecution();                     
-                 } else
-                 {
+                                               } else
+                                               {
                                                        newDBGInt.continueExecution();
-                       newSocket.close();
-                 }
+                                                       newSocket.close();
+                                               }
                                        }
 
-               if(DBGInt.waitResponse(interval))
-               {
+                                       if(DBGInt.waitResponse(interval))
+                                       {
                
-               DBGInt.flushAllPackets();
-
-               if (DBGInt.BPUnderHit != 0) {
-                       StackList = DBGInt.getStackList();
-                       if (StackList.length > 0) {
-                       for (i = 0; i < StackList.length; i++) {
-                               StackList[i].setThread(PHPMainThread);
-                               if (DBGInt.getModByNo(StackList[i].getModNo()).equals("")) {
-                               DBGInt.getSourceTree();
-                               }
-                               StackList[i].setFile(
-                               DBGInt.getModByNo(StackList[i].getModNo()));
-                       }
-                       PHPMainThread.setStackFrames(StackList);
-                       }
-                       // Fire debug event
-                       PHPMainThread.suspend();
-
-                       synchronized (this) {
-                       wait();
-                       }
-               }
-               }
-          if (remote) {
-               if (PHPMainThread.isTerminated())
-               {
-                       shouldStop=true;
-                       break;
-               }
-          } else {
-               if (PHPMainThread.isTerminated() || getDebugTarget().getProcess().isTerminated())
-               {
+                                               DBGInt.flushAllPackets();
+
+                                               if (DBGInt.BPUnderHit != 0) {
+                                                       StackList = DBGInt.getStackList();
+                                                       if (StackList.length > 0) {
+                                                               for (i = 0; i < StackList.length; i++) {
+                                                                       StackList[i].setThread(PHPMainThread);
+                                                                       if (DBGInt.getModByNo(StackList[i].getModNo()).equals("")) {
+                                                                               DBGInt.getSourceTree();
+                                                                       }
+                                                                       StackList[i].setFile(
+                                                                                       DBGInt.getModByNo(StackList[i].getModNo()));
+                                                               }
+                                                               PHPMainThread.setStackFrames(StackList);
+                                                       }
+                                                       // Fire debug event
+                                                       PHPMainThread.suspend();
+
+                                                       synchronized (this) {
+                                                               wait();
+                                                       }
+                                               }
+                                       }
+                                       if (remote) {
+                                               if (PHPMainThread.isTerminated()) {
+                                                       shouldStop=true;
+                                                       break;
+                                               }
+                                       } else {
+                                               if (PHPMainThread.isTerminated() || getDebugTarget().getProcess().isTerminated()) {
                                                        shouldStop=true;
                                                        break;                   
-               }
-          }
+                                               }
+                                       }
+                               }
+                       } 
+                       catch (Exception ex) {
+                               PHPDebugCorePlugin.log(ex);
+                               System.out.println(ex);
+                       } 
+                       finally {
+                               try {
+                                       getDebugTarget().terminate();
+                                       closeSocket();
+                                       closeServerSocket();
+                               } catch (IOException e) {
+                                       PHPDebugCorePlugin.log(e);
+                                       return;
                                }
-       } 
-       catch (Exception ex) {
-       PHPDebugCorePlugin.log(ex);
-       System.out.println(ex);
-       } 
-       finally {
-               try {
-               getDebugTarget().terminate();
-               closeSocket();
-               closeServerSocket();
-               }
-               catch (IOException e) {
-               PHPDebugCorePlugin.log(e);
-               return;
-       }
         //System.out.println("Socket loop finished.");
-       }
+                       }
                }
        }
 }