From c0ff271b8d6cda34f10c7cb7d85e57e152c7a93a Mon Sep 17 00:00:00 2001 From: incastrix Date: Sun, 20 Sep 2009 19:49:50 +0000 Subject: [PATCH 1/1] fix #774 infinite loop in net.sourceforge.phpeclipse.builder.IdentifierIndexManager.LineCreator.parseIdentifiers(char[], StringBuffer). --- .../phpeclipse/builder/IdentifierIndexManager.java | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java index 526ff4b..86de9b5 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java @@ -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); -- 1.7.1