Fixed outline wrong order of methods bug
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / Parser.java
index ad67bec..b1d21e0 100644 (file)
@@ -1533,9 +1533,10 @@ public class Parser //extends PHPParserSuperclass
           typeDecl.methods = new AbstractMethodDeclaration[] { methodDecl };
         } else {
           AbstractMethodDeclaration[] newMethods;
-          System.arraycopy(typeDecl.methods, 0, newMethods = new AbstractMethodDeclaration[typeDecl.methods.length + 1], 1,
+          System.arraycopy(typeDecl.methods, 0, 
+              newMethods = new AbstractMethodDeclaration[typeDecl.methods.length + 1], 0,
               typeDecl.methods.length);
-          newMethods[0] = methodDecl;
+          newMethods[typeDecl.methods.length] = methodDecl;
           typeDecl.methods = newMethods;
         }
         if ((typeDecl.modifiers & AccAbstract) == AccAbstract) {
@@ -3428,7 +3429,11 @@ public class Parser //extends PHPParserSuperclass
               problemReporter.phpIncludeNotExistWarning(args, literal.sourceStart, literal.sourceEnd, referenceContext,
                   compilationUnit.compilationResult);
             } else {
-              impt.setFile( PHPFileUtil.createFile(path, project) );
+              try {
+                impt.setFile( PHPFileUtil.createFile(path, project) );
+              } catch (Exception e) {
+                // the file is outside of the workspace
+              }
             }
           }
         }