perf_34x - Synchronize with HEAD contents
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/AllPerformanceTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/AllPerformanceTests.java
index 274a602..a64924d 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/AllPerformanceTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/AllPerformanceTests.java
@@ -44,17 +44,17 @@
/**
* Additional test class(es).
- *
+ *
* Classes put in this list will be run only if "add" VM parameter is added
* while running JUnit test suite.
- *
+ *
* @see #ADD
*/
public static Class[] getAdditionalTestClasses() {
return new Class[] {
};
}
-
+
/**
* Build test suite.
* All classes suite method are called and bundle to main test suite.
@@ -114,7 +114,7 @@
buffer.append(TestCase.TESTS_RANGE[1]);
buffer.append(";\n");
}
-
+
// Verify VM memory arguments: should be -Xmx256M -Xms256M
NumberFormat floatFormat = NumberFormat.getNumberInstance();
floatFormat.setMaximumFractionDigits(1);
@@ -144,7 +144,7 @@
buffer.append(floatFormat.format(((MAX_MEM/1024.0)/1024.0)));
buffer.append("M should have been specified.\n");
}
-
+
// Display warning message if any
if (buffer != null) {
System.err.println(buffer.toString());
@@ -197,7 +197,7 @@
suitesAcronym = RUN_ID;
}
FullSourceWorkspaceTests.RUN_ID = suitesAcronym; //.toLowerCase();
-
+
// Get tests of suites
for (int i = 0; i < length; i++) {
Class testClass = testSuites[i];
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 0353651..d28ecb8 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
@@ -75,7 +75,7 @@
if (LOG_DIR != null) {
logPerfResult(LOG_STREAMS, TESTS_COUNT);
}
-
+
// Print statistics
if (TESTS_COUNT == 0) {
System.out.println("-------------------------------------");
@@ -540,7 +540,7 @@
/**
* Create AST nodes tree for a given compilation unit at a JLS given level
- *
+ *
* @deprecated
*/
private void createAST(ICompilationUnit unit, int astLevel) throws JavaModelException {
@@ -571,7 +571,7 @@
CompilationUnit compilationUnit = (CompilationUnit) result;
CommentMapperASTVisitor visitor = new CommentMapperASTVisitor(compilationUnit);
compilationUnit.accept(visitor);
- nodesCount += visitor.nodes * iterations;
+ this.nodesCount += visitor.nodes * iterations;
}
// Commit
@@ -667,7 +667,7 @@
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setResolveBindings(true);
parser.setProject(javaProject);
-
+
Map options= javaProject.getOptions(true);
// turn all errors and warnings into ignore. The customizable set of compiler
// options only contains additional Eclipse options. The standard JDK compiler
@@ -685,7 +685,7 @@
}
options.put(JavaCore.COMPILER_TASK_TAGS, "");
parser.setCompilerOptions(options);
-
+
List units = getProjectCompilationUnits(javaProject);
ICompilationUnit[] compilationUnits = new ICompilationUnit[units.size()];
units.toArray(compilationUnits);
@@ -723,10 +723,10 @@
commitMeasurements();
assertPerformance();
}
-
+
/**
* Create AST nodes tree for all compilation units in JUnit project.
- *
+ *
* @throws JavaModelException
*/
public void testDomAstCreationProjectJLS3() throws JavaModelException {
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java
index 5d43678..d43f8f8 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceBuildTests.java
@@ -55,7 +55,7 @@
* This includes tests on build, batch compiler, Scanner and Parser.
*/
public class FullSourceWorkspaceBuildTests extends FullSourceWorkspaceTests {
-
+
// Tests counters
private static int TESTS_COUNT = 0;
private final static int ITERATIONS_COUNT = 10;
@@ -64,7 +64,7 @@
// Tests thresholds
private final static int TIME_THRESHOLD = 150;
-
+
// Log files
private static PrintStream[] LOG_STREAMS = new PrintStream[DIM_NAMES.length];
@@ -100,7 +100,7 @@
"staticReceiver," +
"syntheticAccess," +
"tasks(TODO|FIX|XXX)";
-
+
// Source paths
final static String[] JDT_CORE_SRC_PATHS = {
"batch",
@@ -112,7 +112,7 @@
"model",
"search"
};
-
+
/**
* @param name
*/
@@ -138,7 +138,7 @@
/**
* Start a build on given project or workspace using given options.
- *
+ *
* @param javaProject Project which must be (full) build or null if all workspace has to be built.
* @param options Options used while building
*/
@@ -160,7 +160,7 @@
for (int i=0; i<WARMUP_COUNT; i++) {
ENV.fullBuild(javaProject.getProject().getName());
}
-
+
// measures
int max = MEASURES_COUNT;
for (int i=0; i<max; i++) {
@@ -180,7 +180,7 @@
stopMeasuring();
}
}
-
+
// Verify markers
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IMarker[] markers = workspaceRoot.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
@@ -219,11 +219,11 @@
System.out.println("--------------------");
}
if (DEBUG) System.out.println("done");
-
+
// Commit measure
commitMeasurements();
assertPerformance();
-
+
// Store warning
if (warnings>0) {
System.out.println("\t- "+warnings+" warnings found while performing build.");
@@ -306,7 +306,7 @@
org.eclipse.jdt.core.tests.util.Util.delete(COMPILER_OUTPUT_DIR);
}
}
-
+
// Commit measures
commitMeasurements();
assertPerformance();
@@ -335,12 +335,12 @@
CompilerOptions options = new CompilerOptions();
options.sourceLevel = ClassFileConstants.JDK1_4;
options.targetJDK = ClassFileConstants.JDK1_4;
- ProblemReporter problemReporter =
+ ProblemReporter problemReporter =
new ProblemReporter(
- DefaultErrorHandlingPolicies.exitAfterAllProblems(),
- options,
+ DefaultErrorHandlingPolicies.exitAfterAllProblems(),
+ options,
new DefaultProblemFactory());
-
+
// Create parser
Parser parser = null;
switch (kind) {
@@ -355,7 +355,7 @@
// Warm up
for (int i = 0; i < 2; i++) {
ICompilationUnit unit = new CompilationUnit(content, file.getName(), null);
- CompilationResult unitResult = new CompilationResult(unit, 0, 1, options.maxProblemsPerUnit);
+ CompilationResult unitResult = new CompilationResult(unit, 0, 1, options.maxProblemsPerUnit);
CompilationUnitDeclaration unitDeclaration = parser.dietParse(unit, unitResult);
parser.getMethodBodies(unitDeclaration);
}
@@ -373,7 +373,7 @@
startMeasuring();
for (int i = 0; i < iterations; i++) {
ICompilationUnit unit = new CompilationUnit(content, file.getName(), null);
- CompilationResult unitResult = new CompilationResult(unit, 0, 1, options.maxProblemsPerUnit);
+ CompilationResult unitResult = new CompilationResult(unit, 0, 1, options.maxProblemsPerUnit);
CompilationUnitDeclaration unitDeclaration = parser.dietParse(unit, unitResult);
parser.getMethodBodies(unitDeclaration);
parsedCharacters += content.length;
@@ -399,7 +399,7 @@
* Test performance for a parser on one file.
* Parse is executed many times ({@link #ITERATIONS_COUNT}) to have significant time for execution.
* This test is repeated several times ({@link #MEASURES_COUNT}) to average time measuring.
- *
+ *
* @throws InvalidInputException
* @throws IOException
*/
@@ -409,7 +409,7 @@
IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IWorkspaceRoot workspaceRoot = workspace.getRoot();
final String workspacePath = workspaceRoot.getLocation().toFile().getCanonicalPath();
-
+
// Run test
for (int i=0; i<MEASURES_COUNT; i++) {
IWorkspaceRunnable compilation = new IWorkspaceRunnable() {
@@ -541,7 +541,7 @@
if (LOG_DIR != null) {
logPerfResult(LOG_STREAMS, TESTS_COUNT);
}
-
+
// Call super at the end as it close print streams
super.tearDown();
}
@@ -550,7 +550,7 @@
* Test performance for Scanner on one file.
* Scan is executed many times ({@link #SCAN_REPEAT}) to have significant time for execution.
* This test is repeated several times ({@link #ITERATIONS_COUNT}) to average time measuring.
- *
+ *
* @throws InvalidInputException
* @throws IOException
*/
@@ -588,7 +588,7 @@
* Test performance for Parser on one file.
* Parse is executed many times ({@link #ITERATIONS_COUNT}) to have significant time for execution.
* This test is repeated several times ({@link #MEASURES_COUNT}) to average time measuring.
- *
+ *
* @throws InvalidInputException
* @throws IOException
*/
@@ -600,11 +600,11 @@
* Test performance for SourceElementParser on one file.
* Parse is executed many times ({@link #ITERATIONS_COUNT}) to have significant time for execution.
* This test is repeated several times ({@link #MEASURES_COUNT}) to average time measuring.
- *
+ *
* Note: This test has been temporarily removed as there's unexplicable difference between
* HEAD and 3.0 versions for CPU Time results (10% faster) and Elapsed process (25% slower)...
* TODO (frederic) Put back when platform-releng will have stabilized performance results process.
- *
+ *
* @throws InvalidInputException
* @throws IOException
*/
@@ -614,12 +614,12 @@
/**
* Full build with JavaCore default options.
- *
+ *
* WARNING:
* This test must be and _ever_ stay at first position as it build the entire workspace.
* It also cannot be removed as it's a Global fingerprint!
* Move it would have great consequence on all other tests results...
- *
+ *
* @throws CoreException
* @throws IOException
*/
@@ -630,7 +630,7 @@
/**
* JDT/Core project full build with no warning.
- *
+ *
* @throws CoreException
* @throws IOException
* @since 3.2 M6
@@ -642,7 +642,7 @@
/**
* JDT/Core project full build with JavaCore default options.
- *
+ *
* @throws CoreException
* @throws IOException
* @since 3.2 M6
@@ -654,7 +654,7 @@
/**
* JDT/Core project full build with all warnings.
- *
+ *
* @throws CoreException
* @throws IOException
* @since 3.2 M6
@@ -666,10 +666,10 @@
/**
* Batch compiler build with no warning
- *
+ *
* Not calling tagAsSummary means that this test is currently evaluated
* before put it in builds performance results.
- *
+ *
* @throws IOException
*/
public void testBatchCompilerNoWarning() throws IOException, CoreException {
@@ -679,7 +679,7 @@
/**
* Compile JDT/Core project with default warnings
- *
+ *
* @throws IOException
*/
public void testCompileJDTCoreProjectNoWarning() throws IOException, CoreException {
@@ -689,7 +689,7 @@
/**
* Compile JDT/Core project with default warnings
- *
+ *
* @throws IOException
*/
public void testCompileJDTCoreProjectDefault() throws IOException, CoreException {
@@ -699,7 +699,7 @@
/**
* Compile JDT/Core project with default javadoc warnings
- *
+ *
* @throws IOException
*/
public void testCompileJDTCoreProjectJavadoc() throws IOException, CoreException {
@@ -709,7 +709,7 @@
/**
* Compile JDT/Core project with all warnings
- *
+ *
* @throws IOException
* @since 3.2 M6
*/
@@ -720,7 +720,7 @@
/**
* Compile JDT/Core project with default warnings
- *
+ *
* @throws IOException
* @since 3.2 M6
*/
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceCompleteSearchTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceCompleteSearchTests.java
index 3ce6cb6..42589d3 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceCompleteSearchTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceCompleteSearchTests.java
@@ -30,11 +30,11 @@
* Performance test suite which covers all main search requests:
* <ul>
* </ul>
- *
+ *
* Note that this test suite was not supposed to be included in releng performance tests
* as it would take too much time to be run...
*/
-public class FullSourceWorkspaceCompleteSearchTests extends FullSourceWorkspaceSearchTests implements IJavaSearchConstants {
+public class FullSourceWorkspaceCompleteSearchTests extends FullSourceWorkspaceSearchTests {
// Tests counters
private static int TESTS_COUNT = 0;
@@ -149,7 +149,7 @@
* Execute the current job, answer whether it was successful.
*/
public boolean execute(IProgressMonitor progress) {
- if (start) {
+ if (this.start) {
startMeasuring();
} else {
stopMeasuring();
@@ -168,9 +168,9 @@
? SearchPattern.R_PATTERN_MATCH
: SearchPattern.R_EXACT_MATCH;
SearchPattern pattern = SearchPattern.createPattern(
- patternString,
+ patternString,
searchFor,
- limitTo,
+ limitTo,
matchMode | SearchPattern.R_CASE_SENSITIVE);
new SearchEngine().search(
pattern,
@@ -182,8 +182,8 @@
protected void search(IJavaElement element, int limitTo, JavaSearchResultCollector resultCollector) throws CoreException {
SearchPattern pattern = SearchPattern.createPattern(
- element,
- limitTo,
+ element,
+ limitTo,
SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
new SearchEngine().search(
pattern,
@@ -237,7 +237,7 @@
search(name, TYPE, DECLARATIONS, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -262,7 +262,7 @@
search(name, TYPE, REFERENCES, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -291,7 +291,7 @@
search(type, DECLARATIONS, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -320,7 +320,7 @@
search(type, REFERENCES, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -358,7 +358,7 @@
search(name, FIELD, DECLARATIONS, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -386,7 +386,7 @@
search(name, FIELD, REFERENCES, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -419,7 +419,7 @@
search(field, DECLARATIONS, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -452,7 +452,7 @@
search(field, REFERENCES, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -490,7 +490,7 @@
search(name, METHOD, DECLARATIONS, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -518,7 +518,7 @@
search(name, METHOD, REFERENCES, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -551,7 +551,7 @@
search(method, DECLARATIONS, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -584,7 +584,7 @@
search(method, REFERENCES, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -622,7 +622,7 @@
search(name, CONSTRUCTOR, DECLARATIONS, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -650,7 +650,7 @@
search(name, CONSTRUCTOR, REFERENCES, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -683,7 +683,7 @@
search(constructor, DECLARATIONS, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -716,7 +716,7 @@
search(constructor, REFERENCES, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceCompletionTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceCompletionTests.java
index dad4173..9d0de14 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceCompletionTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceCompletionTests.java
@@ -20,7 +20,7 @@
/**
*/
public class FullSourceWorkspaceCompletionTests extends FullSourceWorkspaceTests {
-
+
// Counters
private static final int WARMUP_COUNT = 10;
private static final int ITERATION_COUNT = 40;
@@ -81,11 +81,11 @@
}
System.out.println("-------------------------------------\n");
}
-
+
// Call super at the end as it close print streams
super.tearDown();
}
-
+
class TestCompletionRequestor extends CompletionRequestor {
public void accept(CompletionProposal proposal) {
PROPOSAL_COUNTS[TESTS_LENGTH-TESTS_COUNT]++;
@@ -118,24 +118,24 @@
int[] ignoredKinds,
int warmupCount,
int iterationCount) throws JavaModelException {
-
+
AbstractJavaModelTests.waitUntilIndexesReady();
-
+
TestCompletionRequestor requestor = new TestCompletionRequestor();
if(ignoredKinds != null) {
for (int i = 0; i < ignoredKinds.length; i++) {
requestor.setIgnored(ignoredKinds[i], true);
}
}
-
+
ICompilationUnit unit =
getCompilationUnit(projectName, packageName, unitName);
-
+
String str = unit.getSource();
int completionIndex = str.indexOf(completeAt) + completeBehind.length();
-
+
if (DEBUG) System.out.print("Perform code assist inside " + unitName + "...");
-
+
// Warm up
if(warmupCount > 0) {
unit.codeComplete(completionIndex, requestor);
@@ -157,12 +157,12 @@
stopMeasuring();
}
if (DEBUG) System.out.println("done!");
-
+
// Commit
commitMeasurements();
assertPerformance();
}
-
+
public void testPerfCompleteMethodDeclaration() throws JavaModelException {
complete(
"org.eclipse.jdt.core",
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceFormatterTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceFormatterTests.java
index 58e26bd..676c05e 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceFormatterTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceFormatterTests.java
@@ -119,10 +119,10 @@
new DefaultCodeFormatter().format(CodeFormatter.K_COMPILATION_UNIT, source, 0, source.length(), 0, null);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
- assertPerformance();
+ assertPerformance();
}
/**
@@ -151,10 +151,10 @@
new DefaultCodeFormatter().format(CodeFormatter.K_COMPILATION_UNIT, source, 0, source.length(), 0, null);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
- assertPerformance();
+ assertPerformance();
}
protected void resetCounters() {
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 fac02f8..9257064 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
@@ -65,10 +65,10 @@
// TESTS_NAMES = new String[] {
// "testPerfNameLookupFindKnownSecondaryType",
// "testPerfNameLookupFindUnknownType",
-// "testPerfReconcile",
+// "testPerfReconcile",
// "testPerfSearchAllTypeNamesAndReconcile",
// };
-
+
// TESTS_PREFIX = "testPerfReconcile";
}
public static Test suite() {
@@ -109,7 +109,7 @@
BIG_PROJECT.setRawClasspath(BIG_PROJECT.getRawClasspath(), null);
} else {
System.out.println("Create project "+BIG_PROJECT_NAME+" in "+workspaceRoot.getLocation()+":");
-
+
// setup projects with several source folders and several packages per source folder
System.out.println(" - create "+FOLDERS_COUNT+" folders x "+PACKAGES_COUNT+" packages...");
final String[] sourceFolders = new String[FOLDERS_COUNT];
@@ -172,7 +172,7 @@
} finally {
// do not delete project
}
-
+
}
private void setUpBigJars() throws Exception {
String bigProjectLocation = BIG_PROJECT.getResource().getLocation().toOSString();
@@ -182,7 +182,7 @@
String[] pathAndContents = new String[size * 2];
for (int i = 0; i < size; i++) {
pathAndContents[i*2] = "/p" + i + "/X" + i + ".java";
- pathAndContents[i*2 + 1] =
+ pathAndContents[i*2 + 1] =
"package p" + i + ";\n" +
"public class X" + i + "{\n" +
"}";
@@ -195,7 +195,7 @@
String[] pathAndContents = new String[size * 2];
for (int i = 0; i < size; i++) {
pathAndContents[i*2] = "/q" + i + "/Y" + i + ".java";
- pathAndContents[i*2 + 1] =
+ pathAndContents[i*2 + 1] =
"package q" + i + ";\n" +
"public class Y" + i + "{\n" +
"}";
@@ -242,9 +242,9 @@
? SearchPattern.R_PATTERN_MATCH
: SearchPattern.R_EXACT_MATCH;
SearchPattern pattern = SearchPattern.createPattern(
- patternString,
+ patternString,
searchFor,
- limitTo,
+ limitTo,
matchMode | SearchPattern.R_CASE_SENSITIVE);
this.resultCollector = new JavaSearchResultCollector();
new SearchEngine().search(
@@ -260,7 +260,7 @@
class TypeNameCounter extends TypeNameRequestor {
int count = 0;
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) {
- count++;
+ this.count++;
}
}
TypeNameCounter requestor = new TypeNameCounter();
@@ -343,7 +343,7 @@
/**
* Performance tests for model: Find known type in name lookup.
- *
+ *
* First wait that already started indexing jobs end before perform test.
* Perform one find before measure performance for warm-up.
*/
@@ -372,7 +372,7 @@
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -380,7 +380,7 @@
/**
* Performance tests for model: Find known secondary type in name lookup.
- *
+ *
* First wait that already started indexing jobs end before perform test.
* Perform one find before measure performance for warm-up.
*/
@@ -411,7 +411,7 @@
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -419,7 +419,7 @@
/**
* Performance tests for model: Find Unknown type in name lookup.
- *
+ *
* First wait that already started indexing jobs end before perform test.
* Perform one find before measure performance for warm-up.
*/
@@ -448,7 +448,7 @@
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -456,7 +456,7 @@
/**
* Performance tests for model: Find known type.
- *
+ *
* First wait that already started indexing jobs end before perform test.
* Perform one find before measure performance for warm-up.
*/
@@ -484,7 +484,7 @@
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -492,7 +492,7 @@
/**
* Performance tests for model: Find known member type.
- *
+ *
* First wait that already started indexing jobs end before perform test.
* Perform one find before measure performance for warm-up.
*/
@@ -523,7 +523,7 @@
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -531,7 +531,7 @@
/**
* Performance tests for model: Find known secondary type.
- *
+ *
* First wait that already started indexing jobs end before perform test.
* Perform one find before measure performance for warm-up.
*/
@@ -558,7 +558,7 @@
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -566,7 +566,7 @@
/**
* Performance tests for model: Find Unknown type.
- *
+ *
* First wait that already started indexing jobs end before perform test.
* Perform one find before measure performance for warm-up.
*/
@@ -594,7 +594,7 @@
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -603,20 +603,20 @@
/*
* Performance tests for model: Find Unknown type after resetting the classpath
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=217059 )
- *
+ *
*/
public void testProjectFindUnknownTypeAfterSetClasspath() throws CoreException {
tagAsSummary("Find unknown type in project after resetting classpath", false); // do NOT put in fingerprint
// Wait for indexing end
AbstractJavaModelTests.waitUntilIndexesReady();
-
+
// First findType populates the package fragment roots in the Java model cache
String fullQualifiedName = BIG_PROJECT_TYPE_PATH.removeFileExtension().removeFirstSegments(2).removeLastSegments(1).toString();
fullQualifiedName = fullQualifiedName.replace('/', '.')+".Unknown";
IType type = BIG_PROJECT.findType(fullQualifiedName);
assertNull("We should not find an unknown type in project "+BIG_PROJECT_NAME, type);
-
+
// Reset classpath
BIG_PROJECT.setRawClasspath(BIG_PROJECT.getRawClasspath(), null);
@@ -635,7 +635,7 @@
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -683,7 +683,7 @@
finally {
workingCopy.discardWorkingCopy();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -696,25 +696,25 @@
*/
public void testPerfReconcileBigFileWithSyntaxError() throws JavaModelException {
tagAsSummary("Reconcile editor change on big file with syntax error", false); // do NOT put in fingerprint
-
+
// build big file contents
String method =
"() {\n" +
" bar(\n" +
- " \"public class X <E extends Exception> {\\n\" + \r\n" +
- " \" void foo(E e) throws E {\\n\" + \r\n" +
- " \" throw e;\\n\" + \r\n" +
- " \" }\\n\" + \r\n" +
- " \" void bar(E e) {\\n\" + \r\n" +
- " \" try {\\n\" + \r\n" +
- " \" foo(e);\\n\" + \r\n" +
- " \" } catch(Exception ex) {\\n\" + \r\n" +
- " \" System.out.println(\\\"SUCCESS\\\");\\n\" + \r\n" +
- " \" }\\n\" + \r\n" +
- " \" }\\n\" + \r\n" +
- " \" public static void main(String[] args) {\\n\" + \r\n" +
- " \" new X<Exception>().bar(new Exception());\\n\" + \r\n" +
- " \" }\\n\" + \r\n" +
+ " \"public class X <E extends Exception> {\\n\" + \r\n" +
+ " \" void foo(E e) throws E {\\n\" + \r\n" +
+ " \" throw e;\\n\" + \r\n" +
+ " \" }\\n\" + \r\n" +
+ " \" void bar(E e) {\\n\" + \r\n" +
+ " \" try {\\n\" + \r\n" +
+ " \" foo(e);\\n\" + \r\n" +
+ " \" } catch(Exception ex) {\\n\" + \r\n" +
+ " \" System.out.println(\\\"SUCCESS\\\");\\n\" + \r\n" +
+ " \" }\\n\" + \r\n" +
+ " \" }\\n\" + \r\n" +
+ " \" public static void main(String[] args) {\\n\" + \r\n" +
+ " \" new X<Exception>().bar(new Exception());\\n\" + \r\n" +
+ " \" }\\n\" + \r\n" +
" \"}\\n\"" +
" );\n" +
"}\n";
@@ -727,20 +727,20 @@
bigContents.append(method);
}
// don't add closing } for class def so as to have a syntax error
-
+
ICompilationUnit workingCopy = null;
try {
// Setup
workingCopy = (ICompilationUnit) JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/BigProject/src/org/eclipse/jdt/core/tests/BigCu.java")));
workingCopy.becomeWorkingCopy(null);
-
+
// Warm up
int warmup = WARMUP_COUNT / 10;
for (int i=0; i<warmup; i++) {
workingCopy.getBuffer().setContents(bigContents.append("a").toString());
workingCopy.reconcile(AST.JLS3, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
}
-
+
// Measures
resetCounters();
for (int i=0; i<MEASURES_COUNT; i++) {
@@ -750,11 +750,11 @@
workingCopy.reconcile(AST.JLS3, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
- assertPerformance();
-
+ assertPerformance();
+
} finally {
if (workingCopy != null)
workingCopy.discardWorkingCopy();
@@ -767,7 +767,7 @@
*/
public void testReconcileDuplicates() throws JavaModelException {
tagAsSummary("Reconcile editor change on file with lots of duplicates", false); // do NOT put in fingerprint
-
+
// build big file contents
StringBuffer contents = new StringBuffer();
contents.append("public class CUWithDuplicates {\n");
@@ -777,20 +777,20 @@
contents.append(fooIndex++);
}
contents.append("} //"); // ensure it ends with a line comment that is edited below
-
+
ICompilationUnit workingCopy = null;
try {
// Setup
workingCopy = (ICompilationUnit) JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/BigProject/src/CUWithDuplicates.java")));
workingCopy.becomeWorkingCopy(null);
-
+
// Warm up
int warmup = WARMUP_COUNT / 10;
for (int i=0; i<warmup; i++) {
workingCopy.getBuffer().setContents(contents.append('a').toString());
workingCopy.reconcile(AST.JLS3, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
}
-
+
// Measures
resetCounters();
for (int i=0; i<MEASURES_COUNT; i++) {
@@ -800,11 +800,11 @@
workingCopy.reconcile(AST.JLS3, false/*no pb detection*/, null/*no owner*/, null/*no progress*/);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
- assertPerformance();
-
+ assertPerformance();
+
} finally {
if (workingCopy != null)
workingCopy.discardWorkingCopy();
@@ -817,7 +817,7 @@
*/
public void testPerfBatchCreatePackageAndReconcile() throws CoreException {
tagAsSummary("Reconcile editor change after creating a package fragment in a batch operation", false); // do NOT put in fingerprint
-
+
IJavaProject project = null;
try {
project = createJavaProject("P234718");
@@ -831,14 +831,14 @@
}, null);
final IPackageFragmentRoot root = project.getPackageFragmentRoot(project.getProject());
ICompilationUnit workingCopy = root.getPackageFragment("").createCompilationUnit(
- "X.java",
+ "X.java",
"public class {\n" +
"}"
, false, null);
workingCopy.becomeWorkingCopy(null);
AbstractJavaModelTests.waitUntilIndexesReady();
AbstractJavaModelTests.waitForAutoBuild();
-
+
// Warm up
try {
final ICompilationUnit copy = workingCopy;
@@ -857,7 +857,7 @@
} finally {
root.getPackageFragment("p2").delete(false/*don't force*/, null);
}
-
+
// Measures
resetCounters();
runnable = new IWorkspaceRunnable(){
@@ -884,11 +884,11 @@
finally {
workingCopy.discardWorkingCopy();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
-
+
} finally {
if (project != null)
project.getProject().delete(true, null);
@@ -942,7 +942,7 @@
finally {
workingCopy.discardWorkingCopy();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -954,7 +954,7 @@
* (see bug 190094 Java Outline Causes Eclipse Lock-up.)
*/
public void testPopulateTwoBigJars() throws CoreException {
-
+
IJavaProject project = null;
try {
project = createJavaProject("HugeJarProject");
@@ -969,7 +969,7 @@
AbstractJavaModelTests.waitForAutoBuild();
IPackageFragmentRoot root1 = project.getPackageFragmentRoot(bigJar1);
IPackageFragmentRoot root2 = project.getPackageFragmentRoot(bigJar2);
-
+
// warm up
int max = 20;
int warmup = WARMUP_COUNT / 10;
@@ -980,7 +980,7 @@
root2.getPackageFragment("q" + j).open(null);
}
}
-
+
// measure performance
for (int i = 0; i < MEASURES_COUNT; i++) {
project.close();
@@ -992,7 +992,7 @@
}
stopMeasuring();
}
-
+
commitMeasurements();
assertPerformance();
} finally {
@@ -1015,15 +1015,15 @@
public void acceptMemberType(IType type) {}
public void acceptMethod(IMethod method) {}
public void acceptPackageFragment(IPackageFragment packageFragment) {
- if (pkgs != null)
- pkgs.add(packageFragment);
+ if (this.pkgs != null)
+ this.pkgs.add(packageFragment);
}
public void acceptType(IType type) {}
public boolean isCanceled() {
return false;
}
}
-
+
// first pass: ensure all class are loaded, and ensure that the test works as expected
PackageRequestor requestor = new PackageRequestor();
for (int i=0; i<WARMUP_COUNT; i++) {
@@ -1039,7 +1039,7 @@
);
}
}
-
+
// measure performance
requestor.pkgs = null;
resetCounters();
@@ -1097,7 +1097,7 @@
// setup (force the project cache to be created)
IFile file = (IFile) WORKING_COPY.getResource();
getNameLookup(BIG_PROJECT);
-
+
// warm up
int warmup = WARMUP_COUNT / 10;
int iterations = 5000;
@@ -1106,7 +1106,7 @@
JavaCore.create(file);
}
}
-
+
// measure performance
for (int i = 0; i < MEASURES_COUNT; i++) {
runGc();
@@ -1135,7 +1135,7 @@
// Measures
for (int i=0; i<MEASURES_COUNT; i++) {
// shutdwon
- simulateExit();
+ simulateExit();
runGc();
startMeasuring();
// restart
@@ -1154,16 +1154,16 @@
* (see bug 161175 JarPackageFragmentRoot slow to initialize)
*/
public void testFindType() throws CoreException {
-
+
IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
IJavaProject[] existingProjects = model.getJavaProjects();
-
+
try {
// close existing projects
for (int i = 0, length = existingProjects.length; i < length; i++) {
existingProjects[i].getProject().close(null);
}
-
+
// get 20 projects
int max = 20;
IJavaProject[] projects = new IJavaProject[max];
@@ -1172,7 +1172,7 @@
}
AbstractJavaModelTests.waitUntilIndexesReady();
AbstractJavaModelTests.waitForAutoBuild();
-
+
try {
// warm up
int warmup = WARMUP_COUNT / 10;
@@ -1182,7 +1182,7 @@
projects[j].findType("java.lang.Object");
}
}
-
+
// measure performance
for (int i = 0; i < MEASURES_COUNT; i++) {
model.close();
@@ -1193,7 +1193,7 @@
}
stopMeasuring();
}
-
+
commitMeasurements();
assertPerformance();
} finally {
@@ -1214,7 +1214,7 @@
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=190840 )
*/
public void testGetSourceBigJarNoAttachment() throws CoreException {
-
+
IJavaProject project = null;
try {
project = createJavaProject("HugeJarProject");
@@ -1227,7 +1227,7 @@
AbstractJavaModelTests.waitForAutoBuild();
IPackageFragmentRoot root = project.getPackageFragmentRoot(bigJar1);
IClassFile classFile = root.getPackageFragment("p0").getClassFile("X0.class");
-
+
// warm up
int max = 20;
int warmup = WARMUP_COUNT / 10;
@@ -1237,7 +1237,7 @@
classFile.getSource();
}
}
-
+
// measure performance
for (int i = 0; i < MEASURES_COUNT; i++) {
runGc();
@@ -1248,7 +1248,7 @@
}
stopMeasuring();
}
-
+
commitMeasurements();
assertPerformance();
} finally {
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java
index 266e31a..a8b9bc2 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java
@@ -41,7 +41,7 @@
// Formats
private final static NumberFormat INT_FORMAT = NumberFormat.getIntegerInstance();
-
+
/**
* @param name
*/
@@ -155,7 +155,7 @@
* Execute the current job, answer whether it was successful.
*/
public boolean execute(IProgressMonitor progress) {
- if (start) {
+ if (this.start) {
startMeasuring();
} else {
stopMeasuring();
@@ -166,15 +166,15 @@
return "FullSourceWorkspaceSearchTests.Measuring";
}
}
-
+
protected void search(String patternString, int searchFor, int limitTo, IJavaSearchScope scope, SearchRequestor resultCollector) throws CoreException {
int matchMode = patternString.indexOf('*') != -1 || patternString.indexOf('?') != -1
? SearchPattern.R_PATTERN_MATCH
: SearchPattern.R_EXACT_MATCH;
SearchPattern pattern = SearchPattern.createPattern(
- patternString,
+ patternString,
searchFor,
- limitTo,
+ limitTo,
matchMode | SearchPattern.R_CASE_SENSITIVE);
new SearchEngine().search(
pattern,
@@ -201,10 +201,10 @@
/**
* Performance tests for search: Indexing entire workspace
- *
+ *
* First wait that already started indexing jobs ends before performing test and measure.
* Consider this initial indexing jobs as warm-up for this test.
- *
+ *
* TODO (frederic) After 3.3, activate several iteration for this test to have more accurate results,
* then rename the test as numbers will be different...
*/
@@ -273,7 +273,7 @@
/**
* Performance tests for search: Search All Types Names using 2.1 API.
- *
+ *
* @deprecated As we use deprecated API
*/
public void testSearchAllTypeNames() throws CoreException {
@@ -291,7 +291,7 @@
null,
SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE,
IJavaSearchConstants.TYPE,
- scope,
+ scope,
requestor,
WAIT_UNTIL_READY_TO_SEARCH,
null);
@@ -317,14 +317,14 @@
null,
SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE,
IJavaSearchConstants.TYPE,
- scope,
+ scope,
requestor,
WAIT_UNTIL_READY_TO_SEARCH,
null);
}
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -349,7 +349,7 @@
null,
SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE,
IJavaSearchConstants.TYPE,
- scope,
+ scope,
requestor,
WAIT_UNTIL_READY_TO_SEARCH,
null);
@@ -375,7 +375,7 @@
null,
SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE,
IJavaSearchConstants.TYPE,
- scope,
+ scope,
requestor,
WAIT_UNTIL_READY_TO_SEARCH,
null);
@@ -389,7 +389,7 @@
/**
* Performance tests for search: Search All Types Names Matches.
- *
+ *
* This test use a collector which accepts IType.
*/
public void testSearchAllTypeNameMatches() throws CoreException {
@@ -408,7 +408,7 @@
null,
SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE,
IJavaSearchConstants.TYPE,
- scope,
+ scope,
requestor,
WAIT_UNTIL_READY_TO_SEARCH,
null);
@@ -434,7 +434,7 @@
null,
SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE,
IJavaSearchConstants.TYPE,
- scope,
+ scope,
requestor,
WAIT_UNTIL_READY_TO_SEARCH,
null);
@@ -448,7 +448,7 @@
/**
* Performance tests for search: Types occurrences.
- *
+ *
* Note that following search have been tested:
* - "String": > 65000 macthes (CAUTION: needs -Xmx512M)
* - "Object": 13497 matches
@@ -480,7 +480,7 @@
search(name, TYPE, ALL_OCCURRENCES, scope, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -514,7 +514,7 @@
search(name, FIELD, ALL_OCCURRENCES, scope, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -527,10 +527,10 @@
public void testSearchMethod() throws CoreException {
tagAsSummary("Search method occurences (no resolution)", false); // do NOT put in fingerprint
setComment(Performance.EXPLAINS_DEGRADATION_COMMENT, "Test is not enough stable and will be replaced by another one...");
-
+
// Wait for indexing end
AbstractJavaModelTests.waitUntilIndexesReady();
-
+
// Warm up
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { JDT_CORE_PROJECT }, IJavaSearchScope.SOURCES);
String name = "equals";
@@ -541,19 +541,19 @@
System.out.println(" - "+INT_FORMAT.format(resultCollector.count)+" occurences for method '"+name+"' in project "+JDT_CORE_PROJECT.getElementName());
}
}
-
+
// Measures
for (int i=0; i<MEASURES_COUNT; i++) {
// clean before test
cleanCategoryTableCache(false, scope, resultCollector);
runGc();
-
+
// test
startMeasuring();
search(name, METHOD, ALL_OCCURRENCES, scope, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -591,7 +591,7 @@
search(name, METHOD, ALL_OCCURRENCES, scope, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -665,7 +665,7 @@
search(name, PACKAGE, DECLARATIONS, scope, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -700,7 +700,7 @@
search(name, PACKAGE, DECLARATIONS, scope, resultCollector);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
@@ -748,7 +748,7 @@
search(name, PACKAGE, DECLARATIONS, scope, requestor);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java
index 5ef3de8..1c6d9fd 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java
@@ -68,7 +68,7 @@
} else {
System.out.println("Used compliance: "+compliance);
options.put(CompilerOptions.OPTION_Compliance, compliance);
- options.put(CompilerOptions.OPTION_Source, compliance);
+ options.put(CompilerOptions.OPTION_Source, compliance);
options.put(CompilerOptions.OPTION_TargetPlatform, compliance);
JavaCore.setOptions(options);
}
@@ -86,7 +86,7 @@
}
return compliance;
}
-
+
// Garbage collect constants
final static int MAX_GC = 10; // Max gc iterations
final static int TIME_GC = 500; // Sleep to wait gc to run (in ms)
@@ -103,7 +103,7 @@
protected static final String BIG_JAR2_NAME = "big2.jar";
// protected final static String JUNIT_PROJECT_NAME = "junit";
// protected static IJavaProject JUNIT_PROJECT;
-
+
// Compilaiton variable
public static final String COMPILER_OUTPUT_DIR;
static {
@@ -131,7 +131,7 @@
// Index variables
protected static IndexManager INDEX_MANAGER = JavaModelManager.getIndexManager();
-
+
// Tests infos
protected static int ALL_TESTS_COUNT = 0;
protected static int TEST_POSITION = 0;
@@ -190,7 +190,7 @@
* following options:
* -DPerformanceMeterFactory=org.eclipse.jdt.core.tests.performance:org.eclipse.jdt.core.tests.performance.util.JdtCorePerformanceMeterFactory
* -DlogDir=directory where you want to write log files (for example d:/usr/OTI/tests/perfs/stats)
- *
+ *
*/
// Store directory where to put files
private final static File INVALID_DIR = new File("Invalid");
@@ -210,13 +210,13 @@
// Patch version currently applied: may be null!
protected final static String PATCH_ID = System.getProperty("patch");
protected static String RUN_ID;
-
+
// Format to store/display numbers
private NumberFormat percentFormat = NumberFormat.getPercentInstance();
private final NumberFormat d2Format = NumberFormat.getNumberInstance();
{
- percentFormat.setMaximumFractionDigits(1);
- d2Format.setMaximumFractionDigits(2);
+ this.percentFormat.setMaximumFractionDigits(1);
+ this.d2Format.setMaximumFractionDigits(2);
}
// Filter to get only the 3.0 plugins
@@ -248,12 +248,12 @@
/**
* Initialize log directory.
- *
+ *
* Directory where log files must be put is specified by System property <code>logDir</code>.
* For example, if user want to store log files in d:/usr/OTI/tests/perfs/stats,
* then he has to specify: -DlogDir=d:/usr/OTI/tests/perfs/stats in VM Arguments of his
* performance test launch configuration.
- *
+ *
* CAUTION: Parent directory at least <b>must</b> exist before running test otherwise
* it won't be created and times won't be logged.
* This was intentional to avoid unexpected log files creation (especially during nightly/integration builds).
@@ -285,9 +285,9 @@
dir = INVALID_DIR;
}
}
-
+
// Create Log dir
- String[] subdirs = (PATCH_ID == null)
+ String[] subdirs = (PATCH_ID == null)
? new String[] {LOG_VERSION, RUN_ID }
: new String[] {LOG_VERSION, PATCH_ID, RUN_ID };
for (int i=0; i<subdirs.length; i++) {
@@ -317,7 +317,7 @@
/**
* Create test suite for a given TestCase class.
- *
+ *
* Use this method for all JDT/Core performance test using full source workspace.
* All test count is computed to know when tests are about to be finished.
*
@@ -338,7 +338,7 @@
TESTS_NAME_LIST.add(test.getName());
}
ALL_TESTS_COUNT += suite.testCount();
-
+
// Init log dir if necessary
if (LOG_DIR == null) {
if (RUN_ID == null) {
@@ -346,7 +346,7 @@
}
initLogDir();
}
-
+
// Return created tests
return suite;
}
@@ -355,9 +355,9 @@
* Create print streams (one for each type of statistic).
* Log file names have all same prefix based on test class name,
* include type of statistic stored in it and always have extension ".log".
- *
+ *
* If log file does not exist, then add column headers at the beginning of the file.
- *
+ *
* This method does nothing if log files directory has not been initialized
* (which should be the case most of times and especially while running nightly/integration build performance tests).
*/
@@ -384,7 +384,7 @@
logStreams[i].print(testName+'\t');
}
logStreams[i].println("Comment");
-
+
}
// Log date and time
Date date = new Date(System.currentTimeMillis());
@@ -490,7 +490,7 @@
if (haveStats) {
if (scenarioComments[i] != null) {
logStreams[i].print(scenarioComments[i].toString());
- }
+ }
logStreams[i].println();
}
logStreams[i].close();
@@ -508,8 +508,8 @@
double error = stddev / Math.sqrt(count);
if ((error/average) > ERROR_THRESHOLD) {
//if (logStreams[0] != null) logStreams[0].print("'"); // disable over threshold result for xls table
- System.out.println(" WARNING: "+DIM_NAMES[index]+" error is over "+ERROR_STRING+"%: "+d2Format.format(stddev)+"/sqrt("+count+")="+ percentFormat.format(error/average));
- comments[index] = "err=" + percentFormat.format(error/average);
+ System.out.println(" WARNING: "+DIM_NAMES[index]+" error is over "+ERROR_STRING+"%: "+this.d2Format.format(stddev)+"/sqrt("+count+")="+ this.percentFormat.format(error/average));
+ comments[index] = "err=" + this.percentFormat.format(error/average);
}
if (logStreams[index] != null) {
logStreams[index].print(""+statistics.getSum(index)+"\t");
@@ -580,7 +580,7 @@
// Abort if only touch
if (TOUCH) {
- String testPrintName = "'"+scenarioShortName+"' test";
+ String testPrintName = "'"+this.scenarioShortName+"' test";
System.out.println("Touch "+testPrintName+" to verify that it will run correctly.");
throw new Error(testPrintName+" execution has been aborted!");
}
@@ -600,7 +600,7 @@
* Set up full source workpsace from zip file.
*/
private void setUpFullSourceWorkspace() throws IOException, CoreException {
-
+
// Get wksp info
IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IWorkspaceRoot workspaceRoot = workspace.getRoot();
@@ -656,7 +656,7 @@
throw new RuntimeException("Cannot set JRE_LIB classpath variable as the rt.jar lib was not found!!!");
}
JavaCore.setClasspathVariable("JRE_LIB", new Path(jdkLib), null);
-
+
// Set classpaths (workaround bug 73253 Project references not set on project open)
System.out.print("Set projects classpaths...");
ALL_PROJECTS = JavaCore.create(workspaceRoot).getJavaProjects();
@@ -691,28 +691,28 @@
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot workspaceRoot = workspace.getRoot();
final String targetWorkspacePath = workspaceRoot.getLocation().toFile().getCanonicalPath();
-
+
// Print for log in case of project creation troubles...
System.out.println("Create '"+JUNIT_PROJECT_NAME+"' project in "+workspaceRoot.getLocation()+":");
long start = System.currentTimeMillis();
-
+
// Print for log in case of project creation troubles...
String genericsZipPath = getPluginDirectoryPath() + File.separator + JUNIT_PROJECT_NAME + "src.zip";
start = System.currentTimeMillis();
System.out.println("Unzipping "+genericsZipPath);
System.out.print(" in "+targetWorkspacePath+"...");
-
+
// Unzip file
Util.unzip(genericsZipPath, targetWorkspacePath);
System.out.println(" "+(System.currentTimeMillis()-start)+"ms.");
-
+
// Add project to workspace
System.out.print(" - add project to full source workspace...");
start = System.currentTimeMillis();
ENV.addProject(JUNIT_PROJECT_NAME);
JUNIT_PROJECT = createJavaProject(JUNIT_PROJECT_NAME, new String[]{ "src" }, "bin", "1.5");
JUNIT_PROJECT.setRawClasspath(JUNIT_PROJECT.getResolvedClasspath(true), null);
-
+
// Print for log in case of project creation troubles...
System.out.println(" "+(System.currentTimeMillis()-start)+"ms.");
}
@@ -841,8 +841,8 @@
final IJavaProject[] result = new IJavaProject[1];
IWorkspaceRunnable create = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
-
- // create classpath entries
+
+ // create classpath entries
IProject project = ENV.getProject(projectName);
IPath projectPath = project.getFullPath();
int sourceLength = sourceFolders == null ? 0 : sourceFolders.length;
@@ -862,15 +862,15 @@
}
}
// create source entry
- entries[i] =
+ entries[i] =
JavaCore.newSourceEntry(
- projectPath.append(sourcePath),
+ projectPath.append(sourcePath),
new IPath[0],
- new IPath[0],
+ new IPath[0],
null
);
}
-
+
// Add JRE_LIB entry
entries[sourceLength] = JavaCore.newVariableEntry(
new Path("JRE_LIB"),
@@ -885,24 +885,24 @@
output.create(true, true, null);
}
}
-
+
// set classpath and output location
IJavaProject javaProject = ENV.getJavaProject(projectName);
javaProject.setRawClasspath(entries, projectPath.append(outputPath), null);
-
+
// set compliance level options
if ("1.5".equals(compliance)) {
Map options = new HashMap();
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
+ options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
+ options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
javaProject.setOptions(options);
}
-
+
result[0] = javaProject;
}
};
- ResourcesPlugin.getWorkspace().run(create, null);
+ ResourcesPlugin.getWorkspace().run(create, null);
return result[0];
}
@@ -976,14 +976,14 @@
/**
* Returns the specified package fragment root in the given project, or
* <code>null</code> if it does not exist.
- * If relative, the rootPath must be specified as a project relative path.
+ * If relative, the rootPath must be specified as a project relative path.
* The empty path refers to the package fragment root that is the project
* folder iteslf.
- * If absolute, the rootPath refers to either an external jar, or a resource
+ * If absolute, the rootPath refers to either an external jar, or a resource
* internal to the workspace
*/
public IPackageFragmentRoot getPackageFragmentRoot(
- IJavaProject project,
+ IJavaProject project,
String rootPath)
throws JavaModelException {
@@ -1065,7 +1065,7 @@
if (root.isExternal() && root.getElementName().equals(jarSimpleName)) {
return root;
}
- }
+ }
return null;
}
/*
@@ -1147,7 +1147,7 @@
Hashtable optionsMap = JavaCore.getDefaultOptions();
if (kind == 0) {
// Default set since 3.1
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE);
} else {
clearOptions(optionsMap);
boolean all = kind == 1;
@@ -1155,60 +1155,60 @@
String warning = all ? CompilerOptions.WARNING : CompilerOptions.IGNORE;
String enabled = all ? CompilerOptions.ENABLED : CompilerOptions.DISABLED;
String preserve = all ? CompilerOptions.OPTIMIZE_OUT : CompilerOptions.PRESERVE;
-
+
// Set options values
- optionsMap.put(CompilerOptions.OPTION_LocalVariableAttribute, generate);
+ optionsMap.put(CompilerOptions.OPTION_LocalVariableAttribute, generate);
optionsMap.put(CompilerOptions.OPTION_LineNumberAttribute, generate);
optionsMap.put(CompilerOptions.OPTION_SourceFileAttribute, generate);
optionsMap.put(CompilerOptions.OPTION_PreserveUnusedLocal, preserve);
- optionsMap.put(CompilerOptions.OPTION_DocCommentSupport, enabled);
- optionsMap.put(CompilerOptions.OPTION_ReportMethodWithConstructorName, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportDeprecation, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, enabled);
- optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, enabled);
- optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportLocalVariableHiding, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportFieldHiding, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportEmptyStatement, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportAssertIdentifier, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryElse, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadoc, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, enabled);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTags, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocComments, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, warning);
- optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, warning);
+ optionsMap.put(CompilerOptions.OPTION_DocCommentSupport, enabled);
+ optionsMap.put(CompilerOptions.OPTION_ReportMethodWithConstructorName, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportDeprecation, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, enabled);
+ optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, enabled);
+ optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportLocalVariableHiding, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportFieldHiding, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportEmptyStatement, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportAssertIdentifier, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryElse, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadoc, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, enabled);
+ optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTags, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocComments, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, warning);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, warning);
optionsMap.put(CompilerOptions.OPTION_TaskTags, all ? JavaCore.DEFAULT_TASK_TAGS : "");
optionsMap.put(CompilerOptions.OPTION_TaskPriorities, all ? JavaCore.DEFAULT_TASK_PRIORITIES : "");
- optionsMap.put(CompilerOptions.OPTION_TaskCaseSensitive, enabled);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, enabled);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, enabled);
- optionsMap.put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, enabled);
+ optionsMap.put(CompilerOptions.OPTION_TaskCaseSensitive, enabled);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, enabled);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, enabled);
+ optionsMap.put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, enabled);
optionsMap.put(CompilerOptions.OPTION_InlineJsr, enabled);
}
// Ignore 3.1 options
- optionsMap.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.IGNORE);
+ optionsMap.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.IGNORE);
+ optionsMap.put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.IGNORE);
// Ignore 3.2 options
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedLabel, CompilerOptions.IGNORE);
+ optionsMap.put(CompilerOptions.OPTION_ReportUnusedLabel, CompilerOptions.IGNORE);
// Set compliance
String compliance= compliance();
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTypeHierarchyTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTypeHierarchyTests.java
index e6e765c..e09ceeb 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTypeHierarchyTests.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTypeHierarchyTests.java
@@ -21,7 +21,7 @@
/**
*/
public class FullSourceWorkspaceTypeHierarchyTests extends FullSourceWorkspaceTests implements IJavaSearchConstants {
-
+
// Tests counter
private static int TESTS_COUNT = 0;
private final static int WARMUP_COUNT = 5;
@@ -72,7 +72,7 @@
if (LOG_DIR != null) {
logPerfResult(LOG_STREAMS, TESTS_COUNT);
}
-
+
// Call super at the end as it close print streams
super.tearDown();
}
@@ -86,7 +86,7 @@
this.count++;
}
}
-
+
protected JavaSearchResultCollector resultCollector;
public void testPerfAllTypes() throws CoreException {
@@ -112,12 +112,12 @@
unit.getType("ASTNode").newTypeHierarchy(null).getAllClasses();
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
}
-
+
/*
* A direct subclass of org.eclipse.jface.text.templates.TemplateVariableResolver is called Collection.
* Collection is also an interface that is the root of a deep hierarchy in java.util.
@@ -145,7 +145,7 @@
type.newTypeHierarchy(null);
stopMeasuring();
}
-
+
// Commit
commitMeasurements();
assertPerformance();
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/OneTest.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/OneTest.java
index 619a5f6..7b27ff3 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/OneTest.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/OneTest.java
@@ -21,9 +21,9 @@
public class OneTest extends TestCase {
public static Test suite() {
- return new TestSuite(OneTest.class);
+ return new TestSuite(OneTest.class);
}
-
+
public void test1() {
assertTrue(true);
}
diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/util/JdtCorePerformanceMeterPlugin.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/util/JdtCorePerformanceMeterPlugin.java
index 4f27a34..0172e70 100644
--- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/util/JdtCorePerformanceMeterPlugin.java
+++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/util/JdtCorePerformanceMeterPlugin.java
@@ -15,22 +15,22 @@
import org.eclipse.core.runtime.Status;
public class JdtCorePerformanceMeterPlugin extends Plugin {
-
+
private static final String PLUGIN_ID= "com.ibm.zrh.eclipse.test.performance.yourkit"; //$NON-NLS-1$
- private static JdtCorePerformanceMeterPlugin fgDefault;
-
+ private static JdtCorePerformanceMeterPlugin DEFAULT;
+
public JdtCorePerformanceMeterPlugin() {
- fgDefault= this;
+ DEFAULT= this;
}
-
+
public static JdtCorePerformanceMeterPlugin getDefault() {
- return fgDefault;
+ return DEFAULT;
}
-
+
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
-
+
public static void log(Throwable e) {
log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Internal error", e)); //$NON-NLS-1$
}