Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAyushman Jain2012-03-14 08:18:17 +0000
committerAyushman Jain2012-03-14 08:18:17 +0000
commitd7f649048f20a2b7da85ffb34af89adc6b577de1 (patch)
treefb4660363855a256f3095606fc054dfc518aa2b2 /org.eclipse.jdt.core.tests.performance
parent3cf8986b87575b2e73f0d4646e81386c419a79cb (diff)
downloadeclipse.jdt.core-d7f649048f20a2b7da85ffb34af89adc6b577de1.tar.gz
eclipse.jdt.core-d7f649048f20a2b7da85ffb34af89adc6b577de1.tar.xz
eclipse.jdt.core-d7f649048f20a2b7da85ffb34af89adc6b577de1.zip
Fixed bug 371732: Deprecate AST.JLS3v20120314-0818
Diffstat (limited to 'org.eclipse.jdt.core.tests.performance')
-rw-r--r--org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java12
-rw-r--r--org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java31
2 files changed, 28 insertions, 15 deletions
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java
index af3261c451..f78c4402cf 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java
@@ -27,7 +27,13 @@ import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests;
/**
*/
public class FullSourceWorkspaceASTTests extends FullSourceWorkspaceTests {
-
+ /**
+ * Internal synonynm for deprecated constant AST.JSL3
+ * to alleviate deprecation warnings.
+ * @deprecated
+ */
+ /*package*/ static final int JLS3_INTERNAL = AST.JLS3;
+
// Tests counter
private static int TESTS_COUNT = 0;
private final static int ITERATIONS_COUNT = 10;
@@ -599,7 +605,7 @@ public class FullSourceWorkspaceASTTests extends FullSourceWorkspaceTests {
tagAsSummary("DOM AST tree for one file using JLS3", false); // do NOT put in fingerprint
ICompilationUnit unit = getCompilationUnit("org.eclipse.jdt.core", "org.eclipse.jdt.internal.compiler.parser", "Parser.java");
- createAST(unit, AST.JLS3_INTERNAL);
+ createAST(unit, JLS3_INTERNAL);
}
/*
@@ -664,7 +670,7 @@ public class FullSourceWorkspaceASTTests extends FullSourceWorkspaceTests {
*/
private void runAstCreation(IJavaProject javaProject) throws JavaModelException {
if (DEBUG) System.out.println("Creating AST for project" + javaProject.getElementName());
- ASTParser parser = ASTParser.newParser(AST.JLS3_INTERNAL);
+ ASTParser parser = ASTParser.newParser(JLS3_INTERNAL);
parser.setResolveBindings(true);
parser.setProject(javaProject);
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java
index cf1130646f..cbcb4b8a75 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java
@@ -75,6 +75,13 @@ public class FullSourceWorkspaceModelTests extends FullSourceWorkspaceTests impl
private final static int PACKAGES_COUNT = 200;
static int TESTS_LENGTH;
+ /**
+ * Internal synonynm for deprecated constant AST.JSL3
+ * to alleviate deprecation warnings.
+ * @deprecated
+ */
+ /*package*/ static final int JLS3_INTERNAL = AST.JLS3;
+
// Log file streams
private static PrintStream[] LOG_STREAMS = new PrintStream[DIM_NAMES.length];
@@ -695,7 +702,7 @@ public void testPerfReconcile() throws CoreException {
workingCopy = PARSER_WORKING_COPY.getWorkingCopy(owner, null);
int warmup = WARMUP_COUNT / 5;
for (int i=0; i<warmup; i++) {
- CompilationUnit unit = workingCopy.reconcile(AST.JLS3_INTERNAL, true, null, null);
+ CompilationUnit unit = workingCopy.reconcile(JLS3_INTERNAL, true, null, null);
assertNotNull("Compilation Unit should not be null!", unit);
assertNotNull("Bindings were not resolved!", unit.getPackage().resolveBinding());
}
@@ -707,7 +714,7 @@ public void testPerfReconcile() throws CoreException {
runGc();
startMeasuring();
for (int n=0; n<iterations; n++) {
- workingCopy.reconcile(AST.JLS3_INTERNAL, true, null, null);
+ workingCopy.reconcile(JLS3_INTERNAL, true, null, null);
}
stopMeasuring();
}
@@ -770,7 +777,7 @@ public void testPerfReconcileBigFileWithSyntaxError() throws JavaModelException
int warmup = WARMUP_COUNT / 10;
for (int i=0; i<warmup; i++) {
workingCopy.getBuffer().setContents(bigContents.append("a").toString());
- workingCopy.reconcile(AST.JLS3_INTERNAL, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
+ workingCopy.reconcile(JLS3_INTERNAL, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
}
// Measures
@@ -779,7 +786,7 @@ public void testPerfReconcileBigFileWithSyntaxError() throws JavaModelException
workingCopy.getBuffer().setContents(bigContents.append("a").toString());
runGc();
startMeasuring();
- workingCopy.reconcile(AST.JLS3_INTERNAL, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
+ workingCopy.reconcile(JLS3_INTERNAL, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
stopMeasuring();
}
@@ -820,7 +827,7 @@ public void testReconcileDuplicates() throws JavaModelException {
int warmup = WARMUP_COUNT / 10;
for (int i=0; i<warmup; i++) {
workingCopy.getBuffer().setContents(contents.append('a').toString());
- workingCopy.reconcile(AST.JLS3_INTERNAL, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
+ workingCopy.reconcile(JLS3_INTERNAL, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
}
// Measures
@@ -829,7 +836,7 @@ public void testReconcileDuplicates() throws JavaModelException {
workingCopy.getBuffer().setContents(contents.append('a').toString());
runGc();
startMeasuring();
- workingCopy.reconcile(AST.JLS3_INTERNAL, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
+ workingCopy.reconcile(JLS3_INTERNAL, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
stopMeasuring();
}
@@ -877,10 +884,10 @@ public void testPerfBatchCreatePackageAndReconcile() throws CoreException {
IWorkspaceRunnable runnable = new IWorkspaceRunnable(){
public void run(IProgressMonitor monitor) throws CoreException {
root.createPackageFragment("p2", false/*don't force*/, monitor);
- copy.reconcile(AST.JLS3_INTERNAL, true, null, monitor);
+ copy.reconcile(JLS3_INTERNAL, true, null, monitor);
int warmup = WARMUP_COUNT / 5;
for (int i=0; i<warmup; i++) {
- copy.reconcile(AST.JLS3_INTERNAL, true, null, monitor);
+ copy.reconcile(JLS3_INTERNAL, true, null, monitor);
}
}
};
@@ -895,11 +902,11 @@ public void testPerfBatchCreatePackageAndReconcile() throws CoreException {
runnable = new IWorkspaceRunnable(){
public void run(IProgressMonitor monitor) throws CoreException {
root.createPackageFragment("p2", false/*don't force*/, monitor);
- copy.reconcile(AST.JLS3_INTERNAL, true, null, monitor);
+ copy.reconcile(JLS3_INTERNAL, true, null, monitor);
int iterations = 10;
startMeasuring();
for (int n=0; n<iterations; n++) {
- copy.reconcile(AST.JLS3_INTERNAL, true, null, monitor);
+ copy.reconcile(JLS3_INTERNAL, true, null, monitor);
}
stopMeasuring();
}
@@ -951,7 +958,7 @@ public void testPerfSearchAllTypeNamesAndReconcile() throws CoreException {
int warmup = WARMUP_COUNT / 5;
for (int i=0; i<warmup; i++) {
searchAllTypeNames(scope);
- CompilationUnit unit = workingCopy.reconcile(AST.JLS3_INTERNAL, true, null, null);
+ CompilationUnit unit = workingCopy.reconcile(JLS3_INTERNAL, true, null, null);
if (i == 0) {
assertNotNull("Compilation Unit should not be null!", unit);
assertNotNull("Bindings were not resolved!", unit.getPackage().resolveBinding());
@@ -966,7 +973,7 @@ public void testPerfSearchAllTypeNamesAndReconcile() throws CoreException {
startMeasuring();
for (int n=0; n<iterations; n++) {
searchAllTypeNames(scope);
- workingCopy.reconcile(AST.JLS3_INTERNAL, true, null, null);
+ workingCopy.reconcile(JLS3_INTERNAL, true, null, null);
}
stopMeasuring();
}

Back to the top