Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2016-05-05 18:55:32 +0000
committerManoj Palat2016-05-06 08:46:45 +0000
commit2fb52d07af8018b7544e8f642edb22d156e437f7 (patch)
tree0ef83e1adc86d89cad855d81ad3f2276eddc59c4
parentabba0b50eff6442abcaad6c3c3018cfe37a8bd83 (diff)
downloadeclipse.jdt.core-2fb52d07af8018b7544e8f642edb22d156e437f7.tar.gz
eclipse.jdt.core-2fb52d07af8018b7544e8f642edb22d156e437f7.tar.xz
eclipse.jdt.core-2fb52d07af8018b7544e8f642edb22d156e437f7.zip
Fix for bug 493054 ASTParser.createASTs() performance slowdown in 4.5.2I20160506-0830
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
index d4b49f87de..0ff1a5be64 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
@@ -195,6 +195,7 @@ private Hashtable<String, String> getPackageTypes(String qualifiedPackageName) {
if (f.isDirectory()) continue;
String s = f.getAbsolutePath();
if (s == null) continue;
+ if (!(s.endsWith(SUFFIX_STRING_java) || s.endsWith(SUFFIX_STRING_JAVA))) continue;
CompilationUnit cu = new CompilationUnit(null, s, this.encoding, this.destinationPath);
CompilationResult compilationResult = new CompilationResult(cu.getContents(), 1, 1, 10);
ProblemReporter problemReporter =
@@ -203,6 +204,7 @@ private Hashtable<String, String> getPackageTypes(String qualifiedPackageName) {
new CompilerOptions(this.options),
new DefaultProblemFactory());
Parser parser = new Parser(problemReporter, false);
+ parser.reportSyntaxErrorIsRequired = false;
CompilationUnitDeclaration unit = parser.parse(cu, compilationResult);
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] types = unit != null ? unit.types : null;

Back to the top