fix #774 infinite loop in net.sourceforge.phpeclipse.builder.IdentifierIndexManager...
authorincastrix <incastrix>
Sun, 20 Sep 2009 19:49:50 +0000 (19:49 +0000)
committerincastrix <incastrix>
Sun, 20 Sep 2009 19:49:50 +0000 (19:49 +0000)
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java

index 526ff4b..86de9b5 100644 (file)
@@ -149,6 +149,7 @@ public class IdentifierIndexManager {
                        boolean hasModifiers = false;
                        int phpdocOffset = -1;
                        int phpdocLength = -1;
+
                        try {
                                while (fToken != TokenNameEOF && fToken != TokenNameERROR) {
                                        phpdocOffset = -1;
@@ -325,6 +326,7 @@ public class IdentifierIndexManager {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
+                       
                }
 
                synchronized public void parseIdentifiers(char[] charArray,
@@ -337,6 +339,7 @@ public class IdentifierIndexManager {
                        fScanner.setSource(charArray);
                        fScanner.setPHPMode(false);
                        fToken = TokenNameEOF;
+                       
                        try {
                                getNextToken();
                                while (fToken != TokenNameEOF) { // && fToken !=
@@ -380,11 +383,15 @@ public class IdentifierIndexManager {
                                                                                ident = fScanner.getCurrentIdentifierSource();
                                                                                addIdentifierInformation('v', ident, buf,
                                                                                                phpdocOffset, phpdocLength);
+                                                                               skipComments();
+                                                                               if (fToken == TokenNameCOMMA) {
+                                                                                       skipComments();
+                                                                               }
                                                                        }       
-                                                                       skipComments();
+/*                                                                     skipComments();
                                                                        if (fToken == TokenNameCOMMA) {
                                                                                skipComments();
-                                                                       }
+                                                                       }*/
                                                                } while (fToken != TokenNameRPAREN );
                                                        }
                                                        parseDeclarations(null, buf, true);