View | Details | Raw Unified | Return to bug 328744
Collapse All | Expand All

(-)batch/org/eclipse/jdt/internal/compiler/batch/Main.java (-2 lines)
Lines 605-611 Link Here
605
		public void loggingExtraProblems(Main currentMain) {
605
		public void loggingExtraProblems(Main currentMain) {
606
			ArrayList problems = currentMain.extraProblems;
606
			ArrayList problems = currentMain.extraProblems;
607
			final int count = problems.size();
607
			final int count = problems.size();
608
			int localErrorCount = 0;
609
			int localProblemCount = 0;
608
			int localProblemCount = 0;
610
			if (count != 0) {
609
			if (count != 0) {
611
				int errors = 0;
610
				int errors = 0;
Lines 617-623 Link Here
617
						logExtraProblem(problem, localProblemCount, currentMain.globalProblemsCount);
616
						logExtraProblem(problem, localProblemCount, currentMain.globalProblemsCount);
618
						localProblemCount++;
617
						localProblemCount++;
619
						if (problem.isError()) {
618
						if (problem.isError()) {
620
							localErrorCount++;
621
							errors++;
619
							errors++;
622
							currentMain.globalErrorsCount++;
620
							currentMain.globalErrorsCount++;
623
						} else if (problem.isWarning()) {
621
						} else if (problem.isWarning()) {
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-16 lines)
Lines 6950-6970 Link Here
6950
6950
6951
		boolean foundSomeFields = false;
6951
		boolean foundSomeFields = false;
6952
6952
6953
		boolean staticsOnly = false;
6954
		Scope currentScope = scope;
6953
		Scope currentScope = scope;
6955
6954
6956
		done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found
6955
		done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found
6957
6956
6958
			switch (currentScope.kind) {
6957
			switch (currentScope.kind) {
6959
6958
6960
				case Scope.METHOD_SCOPE :
6961
					// handle the error case inside an explicit constructor call (see MethodScope>>findField)
6962
					MethodScope methodScope = (MethodScope) currentScope;
6963
					staticsOnly |= methodScope.isStatic | methodScope.isConstructorCall;
6964
					break;
6965
				case Scope.CLASS_SCOPE :
6959
				case Scope.CLASS_SCOPE :
6966
					ClassScope classScope = (ClassScope) currentScope;
6960
					ClassScope classScope = (ClassScope) currentScope;
6967
					SourceTypeBinding enclosingType = classScope.referenceContext.binding;
6968
					if(!insideTypeAnnotation) {
6961
					if(!insideTypeAnnotation) {
6969
6962
6970
						FieldDeclaration[] fields = classScope.referenceContext.fields;
6963
						FieldDeclaration[] fields = classScope.referenceContext.fields;
Lines 6986-6992 Link Here
6986
							}
6979
							}
6987
						}
6980
						}
6988
					}
6981
					}
6989
					staticsOnly |= enclosingType.isStatic();
6990
					insideTypeAnnotation = false;
6982
					insideTypeAnnotation = false;
6991
					break;
6983
					break;
6992
				case Scope.COMPILATION_UNIT_SCOPE :
6984
				case Scope.COMPILATION_UNIT_SCOPE :
Lines 7004-7024 Link Here
7004
		InvocationSite invocationSite,
6996
		InvocationSite invocationSite,
7005
		boolean insideTypeAnnotation) {
6997
		boolean insideTypeAnnotation) {
7006
6998
7007
		boolean staticsOnly = false;
7008
		Scope currentScope = scope;
6999
		Scope currentScope = scope;
7009
7000
7010
		done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found
7001
		done : while (true) { // done when a COMPILATION_UNIT_SCOPE is found
7011
7002
7012
			switch (currentScope.kind) {
7003
			switch (currentScope.kind) {
7013
7004
7014
				case Scope.METHOD_SCOPE :
7015
					// handle the error case inside an explicit constructor call (see MethodScope>>findField)
7016
					MethodScope methodScope = (MethodScope) currentScope;
7017
					staticsOnly |= methodScope.isStatic | methodScope.isConstructorCall;
7018
					break;
7019
				case Scope.CLASS_SCOPE :
7005
				case Scope.CLASS_SCOPE :
7020
					ClassScope classScope = (ClassScope) currentScope;
7006
					ClassScope classScope = (ClassScope) currentScope;
7021
					SourceTypeBinding enclosingType = classScope.referenceContext.binding;
7022
					if(!insideTypeAnnotation) {
7007
					if(!insideTypeAnnotation) {
7023
7008
7024
						AbstractMethodDeclaration[] methods = classScope.referenceContext.methods;
7009
						AbstractMethodDeclaration[] methods = classScope.referenceContext.methods;
Lines 7072-7078 Link Here
7072
							}
7057
							}
7073
						}
7058
						}
7074
					}
7059
					}
7075
					staticsOnly |= enclosingType.isStatic();
7076
					insideTypeAnnotation = false;
7060
					insideTypeAnnotation = false;
7077
					break;
7061
					break;
7078
				case Scope.COMPILATION_UNIT_SCOPE :
7062
				case Scope.COMPILATION_UNIT_SCOPE :
(-)formatter/org/eclipse/jdt/internal/formatter/Scribe.java (-3 lines)
Lines 3973-3981 Link Here
3973
3973
3974
		// Compute indentation if necessary
3974
		// Compute indentation if necessary
3975
		boolean clearBlankLines = this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment;
3975
		boolean clearBlankLines = this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment;
3976
		boolean headerLine = block.isHeaderLine() && this.lastNumberOfNewLines == 0;
3977
		int firstColumn = 1 + this.indentationLevel + BLOCK_LINE_PREFIX_LENGTH;
3978
		if (headerLine) firstColumn++;
3979
3976
3980
		// Local variables init
3977
		// Local variables init
3981
		int textStart = text.sourceStart;
3978
		int textStart = text.sourceStart;
(-)model/org/eclipse/jdt/internal/core/util/Util.java (-9 lines)
Lines 3280-3286 Link Here
3280
		char[][] signatures = new char[10][];
3280
		char[][] signatures = new char[10][];
3281
		int signaturesCount = 0;
3281
		int signaturesCount = 0;
3282
//		int[] lengthes = new int [10];
3282
//		int[] lengthes = new int [10];
3283
		int typeArgsCount = 0;
3284
		int paramOpening = 0;
3283
		int paramOpening = 0;
3285
3284
3286
		// Scan each signature character
3285
		// Scan each signature character
Lines 3292-3309 Link Here
3292
						if (signaturesCount == signatures.length) {
3291
						if (signaturesCount == signatures.length) {
3293
							System.arraycopy(signatures, 0, signatures = new char[signaturesCount+10][], 0, signaturesCount);
3292
							System.arraycopy(signatures, 0, signatures = new char[signaturesCount+10][], 0, signaturesCount);
3294
						}
3293
						}
3295
						typeArgsCount = 0;
3296
					}
3294
					}
3297
					break;
3295
					break;
3298
				case '<':
3296
				case '<':
3299
					paramOpening++;
3297
					paramOpening++;
3300
					if (paramOpening == 1) {
3301
						typeArgsCount = 1;
3302
					}
3303
					break;
3304
				case '*':
3305
				case ';':
3306
					if (paramOpening == 1) typeArgsCount++;
3307
					break;
3298
					break;
3308
				case '.':
3299
				case '.':
3309
					if (paramOpening == 0)  {
3300
					if (paramOpening == 0)  {
(-)search/org/eclipse/jdt/internal/core/index/DiskIndex.java (-2 lines)
Lines 279-285 Link Here
279
279
280
	// find out if the memory index has any new or deleted documents, if not then the names & positions are the same
280
	// find out if the memory index has any new or deleted documents, if not then the names & positions are the same
281
	int numDeletedDocNames = 0;
281
	int numDeletedDocNames = 0;
282
	int numReindexedDocNames = 0;
283
	nextPath : for (int i = 0, l = docNames.length; i < l; i++) {
282
	nextPath : for (int i = 0, l = docNames.length; i < l; i++) {
284
		String docName = (String) docNames[i];
283
		String docName = (String) docNames[i];
285
		if (docName != null) {
284
		if (docName != null) {
Lines 290-296 Link Here
290
						numDeletedDocNames++;
289
						numDeletedDocNames++;
291
					} else {
290
					} else {
292
						positions[j] = RE_INDEXED;
291
						positions[j] = RE_INDEXED;
293
						numReindexedDocNames++;
294
					}
292
					}
295
					continue nextPath;
293
					continue nextPath;
296
				}
294
				}
(-)search/org/eclipse/jdt/internal/core/search/StringOperation.java (-3 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 317-323 Link Here
317
	if (nameEnd < 0)
317
	if (nameEnd < 0)
318
		nameEnd = name.length();
318
		nameEnd = name.length();
319
	int questions = 0;
319
	int questions = 0;
320
	int stars = 0;
321
	int parts = 0;
320
	int parts = 0;
322
	char previous = 0;
321
	char previous = 0;
323
	for (int i=patternStart; i<patternEnd; i++) {
322
	for (int i=patternStart; i<patternEnd; i++) {
Lines 327-333 Link Here
327
				questions++;
326
				questions++;
328
				break;
327
				break;
329
			case '*':
328
			case '*':
330
				stars++;
331
				break;
329
				break;
332
			default:
330
			default:
333
				switch (previous) {
331
				switch (previous) {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java (-9 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 267-276 Link Here
267
		char[] source = "0xaapaf".toCharArray(); //$NON-NLS-1$
267
		char[] source = "0xaapaf".toCharArray(); //$NON-NLS-1$
268
		scanner.setSource(source);
268
		scanner.setSource(source);
269
		scanner.resetTo(0, source.length - 1);
269
		scanner.resetTo(0, source.length - 1);
270
		int counter = 0;
271
		try {
270
		try {
272
			while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
271
			while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
273
				counter++;
272
				// ignore
274
			}
273
			}
275
		} catch (InvalidInputException e) {
274
		} catch (InvalidInputException e) {
276
			assertTrue(true);
275
			assertTrue(true);
Lines 287-296 Link Here
287
		char[] source = "0xaap.1f".toCharArray(); //$NON-NLS-1$
286
		char[] source = "0xaap.1f".toCharArray(); //$NON-NLS-1$
288
		scanner.setSource(source);
287
		scanner.setSource(source);
289
		scanner.resetTo(0, source.length - 1);
288
		scanner.resetTo(0, source.length - 1);
290
		int counter = 0;
291
		try {
289
		try {
292
			while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
290
			while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
293
				counter++;
291
				// ignore
294
			}
292
			}
295
		} catch (InvalidInputException e) {
293
		} catch (InvalidInputException e) {
296
			assertTrue(true);
294
			assertTrue(true);
Lines 383-392 Link Here
383
		char[] source = "0x".toCharArray(); //$NON-NLS-1$
381
		char[] source = "0x".toCharArray(); //$NON-NLS-1$
384
		scanner.setSource(source);
382
		scanner.setSource(source);
385
		scanner.resetTo(0, source.length - 1);
383
		scanner.resetTo(0, source.length - 1);
386
		int counter = 0;
387
		try {
384
		try {
388
			while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
385
			while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
389
				counter++;
386
				// ignore
390
			}
387
			}
391
		} catch (InvalidInputException e) {
388
		} catch (InvalidInputException e) {
392
			assertTrue(true);
389
			assertTrue(true);
Lines 403-412 Link Here
403
		char[] source = "0x".toCharArray(); //$NON-NLS-1$
400
		char[] source = "0x".toCharArray(); //$NON-NLS-1$
404
		scanner.setSource(source);
401
		scanner.setSource(source);
405
		scanner.resetTo(0, source.length - 1);
402
		scanner.resetTo(0, source.length - 1);
406
		int counter = 0;
407
		try {
403
		try {
408
			while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
404
			while (scanner.getNextToken() != ITerminalSymbols.TokenNameEOF) {
409
				counter++;
405
				// ignore
410
			}
406
			}
411
		} catch (InvalidInputException e) {
407
		} catch (InvalidInputException e) {
412
			assertTrue(true);
408
			assertTrue(true);
(-)src/org/eclipse/jdt/core/tests/eval/SimpleTest.java (-3 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 174-180 Link Here
174
	int begin = problem.getSourceStart() >= source.length ? source.length - 1 : problem.getSourceStart();
174
	int begin = problem.getSourceStart() >= source.length ? source.length - 1 : problem.getSourceStart();
175
	int relativeStart = 0;
175
	int relativeStart = 0;
176
	int end = problem.getSourceEnd() >= source.length ? source.length - 1 : problem.getSourceEnd();
176
	int end = problem.getSourceEnd() >= source.length ? source.length - 1 : problem.getSourceEnd();
177
	int relativeEnd = 0;
178
	label : for (relativeStart = 0;; relativeStart++) {
177
	label : for (relativeStart = 0;; relativeStart++) {
179
		if (begin == 0)
178
		if (begin == 0)
180
			break label;
179
			break label;
Lines 182-188 Link Here
182
			break label;
181
			break label;
183
		begin--;
182
		begin--;
184
	}
183
	}
185
	label : for (relativeEnd = 0;; relativeEnd++) {
184
	label : for (;;) {
186
		if ((end + 1) >= source.length)
185
		if ((end + 1) >= source.length)
187
			break label;
186
			break label;
188
		if ((source[end + 1] == '\r') || (source[end + 1] == '\n')) {
187
		if ((source[end + 1] == '\r') || (source[end + 1] == '\n')) {
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java (-7 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 507-513 Link Here
507
		final int length = compilationUnitscollector.size();
507
		final int length = compilationUnitscollector.size();
508
		ICompilationUnit[] units = new ICompilationUnit[length];
508
		ICompilationUnit[] units = new ICompilationUnit[length];
509
		compilationUnitscollector.toArray(units);
509
		compilationUnitscollector.toArray(units);
510
		long totalTime = 0;
511
		for (int j = 0; j < length; j++) {
510
		for (int j = 0; j < length; j++) {
512
			ICompilationUnit currentUnit = units[j];
511
			ICompilationUnit currentUnit = units[j];
513
			ASTNode result = runConversion(AST.JLS3, currentUnit, true);
512
			ASTNode result = runConversion(AST.JLS3, currentUnit, true);
Lines 538-544 Link Here
538
			unit2.accept(collector2);
537
			unit2.accept(collector2);
539
			List bindings2 = collector2.getBindings();
538
			List bindings2 = collector2.getBindings();
540
			assertEquals("Wrong size", bindings1.size(), bindings2.size());
539
			assertEquals("Wrong size", bindings1.size(), bindings2.size());
541
			long time = System.currentTimeMillis();
542
			for (int i = 0, max = bindings1.size(); i < max; i++) {
540
			for (int i = 0, max = bindings1.size(); i < max; i++) {
543
				final Object object = bindings1.get(i);
541
				final Object object = bindings1.get(i);
544
				assertTrue("not a binding", object instanceof IBinding);
542
				assertTrue("not a binding", object instanceof IBinding);
Lines 549-558 Link Here
549
				final boolean equalTo = binding.isEqualTo(binding2);
547
				final boolean equalTo = binding.isEqualTo(binding2);
550
				assertTrue("not equals", equalTo);
548
				assertTrue("not equals", equalTo);
551
			}
549
			}
552
			totalTime += (System.currentTimeMillis() - time);
553
		}
554
		if (DEBUG) {
555
			System.out.println("Total time = " + totalTime + "ms");
556
		}
550
		}
557
	}
551
	}
558
}
552
}
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java (-3 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 300-309 Link Here
300
			ASTNodesCollectorVisitor nodesCollector = new ASTNodesCollectorVisitor();
300
			ASTNodesCollectorVisitor nodesCollector = new ASTNodesCollectorVisitor();
301
			compilationUnit.accept(nodesCollector);
301
			compilationUnit.accept(nodesCollector);
302
			Set detachedNodes = nodesCollector.getDetachedAstNodes();
302
			Set detachedNodes = nodesCollector.getDetachedAstNodes();
303
			int counter = 0;
304
			for (Iterator iterator = detachedNodes.iterator(); iterator.hasNext(); ) {
303
			for (Iterator iterator = detachedNodes.iterator(); iterator.hasNext(); ) {
305
				ASTNode detachedNode = (ASTNode) iterator.next();
304
				ASTNode detachedNode = (ASTNode) iterator.next();
306
				counter++;
307
				IBinding binding = (IBinding) bindingsMap.get(detachedNode);
305
				IBinding binding = (IBinding) bindingsMap.get(detachedNode);
308
				assertNotNull(binding);
306
				assertNotNull(binding);
309
				switch(detachedNode.getNodeType()) {
307
				switch(detachedNode.getNodeType()) {
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java (-2 lines)
Lines 377-386 Link Here
377
			ASTNodesCollectorVisitor nodesCollector = new ASTNodesCollectorVisitor();
377
			ASTNodesCollectorVisitor nodesCollector = new ASTNodesCollectorVisitor();
378
			compilationUnit.accept(nodesCollector);
378
			compilationUnit.accept(nodesCollector);
379
			Set detachedNodes = nodesCollector.getDetachedAstNodes();
379
			Set detachedNodes = nodesCollector.getDetachedAstNodes();
380
			int counter = 0;
381
			for (Iterator iterator = detachedNodes.iterator(); iterator.hasNext(); ) {
380
			for (Iterator iterator = detachedNodes.iterator(); iterator.hasNext(); ) {
382
				ASTNode detachedNode = (ASTNode) iterator.next();
381
				ASTNode detachedNode = (ASTNode) iterator.next();
383
				counter++;
384
				IBinding binding = (IBinding) bindingsMap.get(detachedNode);
382
				IBinding binding = (IBinding) bindingsMap.get(detachedNode);
385
				assertNotNull(binding);
383
				assertNotNull(binding);
386
				switch(detachedNode.getNodeType()) {
384
				switch(detachedNode.getNodeType()) {
(-)src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java (-3 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 237-243 Link Here
237
			final int apiLevel = AST.JLS3;
237
			final int apiLevel = AST.JLS3;
238
			ASTParser parser = ASTParser.newParser(apiLevel);
238
			ASTParser parser = ASTParser.newParser(apiLevel);
239
			parser.setResolveBindings(RESOLVE_BINDINGS);
239
			parser.setResolveBindings(RESOLVE_BINDINGS);
240
			long totalTime = 0;
241
			int length = this.compilationUnits.length;
240
			int length = this.compilationUnits.length;
242
			long[] times = new long[length];
241
			long[] times = new long[length];
243
			ArrayList arrayList = new ArrayList(length);
242
			ArrayList arrayList = new ArrayList(length);
Lines 247-253 Link Here
247
				long time = System.currentTimeMillis();
246
				long time = System.currentTimeMillis();
248
				ASTNode node = parser.createAST(null);
247
				ASTNode node = parser.createAST(null);
249
				times[i] = System.currentTimeMillis() - time;
248
				times[i] = System.currentTimeMillis() - time;
250
				totalTime += times[i];
251
				assertNotNull("No node", node);
249
				assertNotNull("No node", node);
252
				assertEquals("Wrong type", ASTNode.COMPILATION_UNIT, node.getNodeType());
250
				assertEquals("Wrong type", ASTNode.COMPILATION_UNIT, node.getNodeType());
253
				CompilationUnit unit = (CompilationUnit) node;
251
				CompilationUnit unit = (CompilationUnit) node;

Return to bug 328744