View | Details | Raw Unified | Return to bug 313706 | Differences between
and this patch

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (-27 / +27 lines)
Lines 1459-1466 Link Here
1459
	boolean isEmptyNameCompletion = false;
1459
	boolean isEmptyNameCompletion = false;
1460
	boolean isEmptyAssistIdentifier = false;
1460
	boolean isEmptyAssistIdentifier = false;
1461
	if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR_QUALIFIER
1461
	if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR_QUALIFIER
1462
		&& ((isEmptyNameCompletion = topExpression == this.assistNode && isEmptyNameCompletion()) // eg. it is something like "this.fred([cursor]" but it is not something like "this.fred(1 + [cursor]"
1462
		&& ((isEmptyNameCompletion = topExpression == this.assistNode && isEmptyNameCompletion()) // e.g. it is something like "this.fred([cursor]" but it is not something like "this.fred(1 + [cursor]"
1463
			|| (isEmptyAssistIdentifier = this.indexOfAssistIdentifier() >= 0 && this.identifierStack[this.identifierPtr].length == 0))) { // eg. it is something like "this.fred(1 [cursor]"
1463
			|| (isEmptyAssistIdentifier = this.indexOfAssistIdentifier() >= 0 && this.identifierStack[this.identifierPtr].length == 0))) { // e.g. it is something like "this.fred(1 [cursor]"
1464
1464
1465
		// pop empty name completion
1465
		// pop empty name completion
1466
		if (isEmptyNameCompletion) {
1466
		if (isEmptyNameCompletion) {
Lines 1654-1660 Link Here
1654
	/*
1654
	/*
1655
		We didn't find any other completion, but the completion identifier is on the identifier stack,
1655
		We didn't find any other completion, but the completion identifier is on the identifier stack,
1656
		so it can only be a completion on name.
1656
		so it can only be a completion on name.
1657
		Note that we allow the completion on a name even if nothing is expected (eg. foo() b[cursor] would
1657
		Note that we allow the completion on a name even if nothing is expected (e.g. foo() b[cursor] would
1658
		be a completion on 'b'). This policy gives more to the user than he/she would expect, but this
1658
		be a completion on 'b'). This policy gives more to the user than he/she would expect, but this
1659
		simplifies the problem. To fix this, the recovery must be changed to work at a 'statement' granularity
1659
		simplifies the problem. To fix this, the recovery must be changed to work at a 'statement' granularity
1660
		instead of at the 'expression' granularity as it does right now.
1660
		instead of at the 'expression' granularity as it does right now.
Lines 1977-1983 Link Here
1977
	if (checkClassLiteralAccess()) return;
1977
	if (checkClassLiteralAccess()) return;
1978
	if (checkInstanceofKeyword()) return;
1978
	if (checkInstanceofKeyword()) return;
1979
1979
1980
	// if the completion was not on an empty name, it can still be inside an invocation (eg. this.fred("abc"[cursor])
1980
	// if the completion was not on an empty name, it can still be inside an invocation (e.g. this.fred("abc"[cursor])
1981
	// (NB: Put this check before checkNameCompletion() because the selector of the invocation can be on the identifier stack)
1981
	// (NB: Put this check before checkNameCompletion() because the selector of the invocation can be on the identifier stack)
1982
	if (checkInvocation()) return;
1982
	if (checkInvocation()) return;
1983
1983
Lines 3262-3276 Link Here
3262
		switch (token) {
3262
		switch (token) {
3263
			case TokenNameDOT:
3263
			case TokenNameDOT:
3264
				switch (previous) {
3264
				switch (previous) {
3265
					case TokenNamethis: // eg. this[.]fred()
3265
					case TokenNamethis: // e.g. this[.]fred()
3266
						this.invocationType = EXPLICIT_RECEIVER;
3266
						this.invocationType = EXPLICIT_RECEIVER;
3267
						break;
3267
						break;
3268
					case TokenNamesuper: // eg. super[.]fred()
3268
					case TokenNamesuper: // e.g. super[.]fred()
3269
						this.invocationType = SUPER_RECEIVER;
3269
						this.invocationType = SUPER_RECEIVER;
3270
						break;
3270
						break;
3271
					case TokenNameIdentifier: // eg. bar[.]fred()
3271
					case TokenNameIdentifier: // e.g. bar[.]fred()
3272
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) != K_BETWEEN_NEW_AND_LEFT_BRACKET) {
3272
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) != K_BETWEEN_NEW_AND_LEFT_BRACKET) {
3273
							if (this.identifierPtr != prevIdentifierPtr) { // if identifier has been consumed, eg. this.x[.]fred()
3273
							if (this.identifierPtr != prevIdentifierPtr) { // if identifier has been consumed, e.g. this.x[.]fred()
3274
								this.invocationType = EXPLICIT_RECEIVER;
3274
								this.invocationType = EXPLICIT_RECEIVER;
3275
							} else {
3275
							} else {
3276
								this.invocationType = NAME_RECEIVER;
3276
								this.invocationType = NAME_RECEIVER;
Lines 3280-3300 Link Here
3280
				}
3280
				}
3281
				break;
3281
				break;
3282
			case TokenNameIdentifier:
3282
			case TokenNameIdentifier:
3283
				if (previous == TokenNameDOT) { // eg. foo().[fred]()
3283
				if (previous == TokenNameDOT) { // e.g. foo().[fred]()
3284
					if (this.invocationType != SUPER_RECEIVER // eg. not super.[fred]()
3284
					if (this.invocationType != SUPER_RECEIVER // e.g. not super.[fred]()
3285
						&& this.invocationType != NAME_RECEIVER // eg. not bar.[fred]()
3285
						&& this.invocationType != NAME_RECEIVER // e.g. not bar.[fred]()
3286
						&& this.invocationType != ALLOCATION // eg. not new foo.[Bar]()
3286
						&& this.invocationType != ALLOCATION // e.g. not new foo.[Bar]()
3287
						&& this.invocationType != QUALIFIED_ALLOCATION) { // eg. not fred().new foo.[Bar]()
3287
						&& this.invocationType != QUALIFIED_ALLOCATION) { // e.g. not fred().new foo.[Bar]()
3288
3288
3289
						this.invocationType = EXPLICIT_RECEIVER;
3289
						this.invocationType = EXPLICIT_RECEIVER;
3290
						this.qualifier = this.expressionPtr;
3290
						this.qualifier = this.expressionPtr;
3291
					}
3291
					}
3292
				}
3292
				}
3293
				if (previous == TokenNameGREATER) { // eg. foo().<X>[fred]()
3293
				if (previous == TokenNameGREATER) { // e.g. foo().<X>[fred]()
3294
					if (this.invocationType != SUPER_RECEIVER // eg. not super.<X>[fred]()
3294
					if (this.invocationType != SUPER_RECEIVER // e.g. not super.<X>[fred]()
3295
						&& this.invocationType != NAME_RECEIVER // eg. not bar.<X>[fred]()
3295
						&& this.invocationType != NAME_RECEIVER // e.g. not bar.<X>[fred]()
3296
						&& this.invocationType != ALLOCATION // eg. not new foo.<X>[Bar]()
3296
						&& this.invocationType != ALLOCATION // e.g. not new foo.<X>[Bar]()
3297
						&& this.invocationType != QUALIFIED_ALLOCATION) { // eg. not fred().new foo.<X>[Bar]()
3297
						&& this.invocationType != QUALIFIED_ALLOCATION) { // e.g. not fred().new foo.<X>[Bar]()
3298
3298
3299
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_METHOD_INVOCATION) {
3299
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_METHOD_INVOCATION) {
3300
							this.invocationType = EXPLICIT_RECEIVER;
3300
							this.invocationType = EXPLICIT_RECEIVER;
Lines 3306-3325 Link Here
3306
			case TokenNamenew:
3306
			case TokenNamenew:
3307
				pushOnElementStack(K_BETWEEN_NEW_AND_LEFT_BRACKET);
3307
				pushOnElementStack(K_BETWEEN_NEW_AND_LEFT_BRACKET);
3308
				this.qualifier = this.expressionPtr; // NB: even if there is no qualification, set it to the expression ptr so that the number of arguments are correctly computed
3308
				this.qualifier = this.expressionPtr; // NB: even if there is no qualification, set it to the expression ptr so that the number of arguments are correctly computed
3309
				if (previous == TokenNameDOT) { // eg. fred().[new] X()
3309
				if (previous == TokenNameDOT) { // e.g. fred().[new] X()
3310
					this.invocationType = QUALIFIED_ALLOCATION;
3310
					this.invocationType = QUALIFIED_ALLOCATION;
3311
				} else { // eg. [new] X()
3311
				} else { // e.g. [new] X()
3312
					this.invocationType = ALLOCATION;
3312
					this.invocationType = ALLOCATION;
3313
				}
3313
				}
3314
				break;
3314
				break;
3315
			case TokenNamethis:
3315
			case TokenNamethis:
3316
				if (previous == TokenNameDOT) { // eg. fred().[this]()
3316
				if (previous == TokenNameDOT) { // e.g. fred().[this]()
3317
					this.invocationType = QUALIFIED_ALLOCATION;
3317
					this.invocationType = QUALIFIED_ALLOCATION;
3318
					this.qualifier = this.expressionPtr;
3318
					this.qualifier = this.expressionPtr;
3319
				}
3319
				}
3320
				break;
3320
				break;
3321
			case TokenNamesuper:
3321
			case TokenNamesuper:
3322
				if (previous == TokenNameDOT) { // eg. fred().[super]()
3322
				if (previous == TokenNameDOT) { // e.g. fred().[super]()
3323
					this.invocationType = QUALIFIED_ALLOCATION;
3323
					this.invocationType = QUALIFIED_ALLOCATION;
3324
					this.qualifier = this.expressionPtr;
3324
					this.qualifier = this.expressionPtr;
3325
				}
3325
				}
Lines 3332-3338 Link Here
3332
					this.qualifier = this.expressionPtr; // remenber the last expression so that arguments are correctly computed
3332
					this.qualifier = this.expressionPtr; // remenber the last expression so that arguments are correctly computed
3333
				}
3333
				}
3334
				switch (previous) {
3334
				switch (previous) {
3335
					case TokenNameIdentifier: // eg. fred[(]) or foo.fred[(])
3335
					case TokenNameIdentifier: // e.g. fred[(]) or foo.fred[(])
3336
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3336
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3337
							int info = 0;
3337
							int info = 0;
3338
							if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER,1) == K_BETWEEN_ANNOTATION_NAME_AND_RPAREN &&
3338
							if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER,1) == K_BETWEEN_ANNOTATION_NAME_AND_RPAREN &&
Lines 3352-3358 Link Here
3352
						this.qualifier = -1;
3352
						this.qualifier = -1;
3353
						this.invocationType = NO_RECEIVER;
3353
						this.invocationType = NO_RECEIVER;
3354
						break;
3354
						break;
3355
					case TokenNamethis: // explicit constructor invocation, eg. this[(]1, 2)
3355
					case TokenNamethis: // explicit constructor invocation, e.g. this[(]1, 2)
3356
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3356
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3357
							this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION);
3357
							this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION);
3358
							this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier);
3358
							this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier);
Lines 3360-3366 Link Here
3360
						this.qualifier = -1;
3360
						this.qualifier = -1;
3361
						this.invocationType = NO_RECEIVER;
3361
						this.invocationType = NO_RECEIVER;
3362
						break;
3362
						break;
3363
					case TokenNamesuper: // explicit constructor invocation, eg. super[(]1, 2)
3363
					case TokenNamesuper: // explicit constructor invocation, e.g. super[(]1, 2)
3364
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3364
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3365
							this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION);
3365
							this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION);
3366
							this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier);
3366
							this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier);
Lines 3368-3374 Link Here
3368
						this.qualifier = -1;
3368
						this.qualifier = -1;
3369
						this.invocationType = NO_RECEIVER;
3369
						this.invocationType = NO_RECEIVER;
3370
						break;
3370
						break;
3371
					case TokenNameGREATER: // explicit constructor invocation, eg. Fred<X>[(]1, 2)
3371
					case TokenNameGREATER: // explicit constructor invocation, e.g. Fred<X>[(]1, 2)
3372
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2)
3372
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2)
3373
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
3373
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
3374
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
3374
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
Lines 4359-4365 Link Here
4359
}
4359
}
4360
/**
4360
/**
4361
 * Returns whether the completion is just after an array type
4361
 * Returns whether the completion is just after an array type
4362
 * eg. String[].[cursor]
4362
 * e.g. String[].[cursor]
4363
 */
4363
 */
4364
private boolean isAfterArrayType() {
4364
private boolean isAfterArrayType() {
4365
	// TBD: The following relies on the fact that array dimensions are small: it says that if the
4365
	// TBD: The following relies on the fact that array dimensions are small: it says that if the
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java (-1 / +1 lines)
Lines 185-191 Link Here
185
					this.startPosition == this.cursorLocation + 1){
185
					this.startPosition == this.cursorLocation + 1){
186
					// compute end of empty identifier.
186
					// compute end of empty identifier.
187
					// if the empty identifier is at the start of a next token the end of
187
					// if the empty identifier is at the start of a next token the end of
188
					// empty identifier is the end of the next token (eg. "<empty token>next").
188
					// empty identifier is the end of the next token (e.g. "<empty token>next").
189
					int temp = this.eofPosition;
189
					int temp = this.eofPosition;
190
					this.eofPosition = this.source.length;
190
					this.eofPosition = this.source.length;
191
				 	while(getNextCharAsJavaIdentifierPart()){/*empty*/}
191
				 	while(getNextCharAsJavaIdentifierPart()){/*empty*/}
(-)codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java (-5 / +5 lines)
Lines 765-777 Link Here
765
					case TokenNameIdentifier:
765
					case TokenNameIdentifier:
766
						this.pushOnElementStack(K_SELECTOR, this.identifierPtr);
766
						this.pushOnElementStack(K_SELECTOR, this.identifierPtr);
767
						break;
767
						break;
768
					case TokenNamethis: // explicit constructor invocation, eg. this(1, 2)
768
					case TokenNamethis: // explicit constructor invocation, e.g. this(1, 2)
769
						this.pushOnElementStack(K_SELECTOR, THIS_CONSTRUCTOR);
769
						this.pushOnElementStack(K_SELECTOR, THIS_CONSTRUCTOR);
770
						break;
770
						break;
771
					case TokenNamesuper: // explicit constructor invocation, eg. super(1, 2)
771
					case TokenNamesuper: // explicit constructor invocation, e.g. super(1, 2)
772
						this.pushOnElementStack(K_SELECTOR, SUPER_CONSTRUCTOR);
772
						this.pushOnElementStack(K_SELECTOR, SUPER_CONSTRUCTOR);
773
						break;
773
						break;
774
					case TokenNameGREATER: // explicit constructor invocation, eg. Fred<X>[(]1, 2)
774
					case TokenNameGREATER: // explicit constructor invocation, e.g. Fred<X>[(]1, 2)
775
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2)
775
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2)
776
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
776
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
777
						if(this.identifierPtr > -1) {
777
						if(this.identifierPtr > -1) {
Lines 1120-1129 Link Here
1120
	return this.indexOfAssistIdentifier(false);
1120
	return this.indexOfAssistIdentifier(false);
1121
}
1121
}
1122
/*
1122
/*
1123
 * Iterate the most recent group of awaiting identifiers (grouped for qualified name reference (eg. aa.bb.cc)
1123
 * Iterate the most recent group of awaiting identifiers (grouped for qualified name reference (e.g. aa.bb.cc)
1124
 * so as to check whether one of them is the assist identifier.
1124
 * so as to check whether one of them is the assist identifier.
1125
 * If so, then answer the index of the assist identifier (0 being the first identifier of the set).
1125
 * If so, then answer the index of the assist identifier (0 being the first identifier of the set).
1126
 *	eg. aa(0).bb(1).cc(2)
1126
 *	e.g. aa(0).bb(1).cc(2)
1127
 * If no assist identifier was found, answers -1.
1127
 * If no assist identifier was found, answers -1.
1128
 */
1128
 */
1129
protected int indexOfAssistIdentifier(boolean useGenericsStack){
1129
protected int indexOfAssistIdentifier(boolean useGenericsStack){
(-)compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java (-1 / +1 lines)
Lines 194-200 Link Here
194
 * Finds the matching type amoung this compilation unit types.
194
 * Finds the matching type amoung this compilation unit types.
195
 * Returns null if no type with this name is found.
195
 * Returns null if no type with this name is found.
196
 * The type name is a compound name
196
 * The type name is a compound name
197
 * eg. if we're looking for X.A.B then a type name would be {X, A, B}
197
 * e.g. if we're looking for X.A.B then a type name would be {X, A, B}
198
 */
198
 */
199
public TypeDeclaration declarationOfType(char[][] typeName) {
199
public TypeDeclaration declarationOfType(char[][] typeName) {
200
	for (int i = 0; i < this.types.length; i++) {
200
	for (int i = 0; i < this.types.length; i++) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java (-2 / +2 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 470-476 Link Here
470
 * Finds the matching type amoung this type's member types.
470
 * Finds the matching type amoung this type's member types.
471
 * Returns null if no type with this name is found.
471
 * Returns null if no type with this name is found.
472
 * The type name is a compound name relative to this type
472
 * The type name is a compound name relative to this type
473
 * eg. if this type is X and we're looking for Y.X.A.B
473
 * e.g. if this type is X and we're looking for Y.X.A.B
474
 *     then a type name would be {X, A, B}
474
 *     then a type name would be {X, A, B}
475
 */
475
 */
476
public TypeDeclaration declarationOfType(char[][] typeName) {
476
public TypeDeclaration declarationOfType(char[][] typeName) {
(-)compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java (-1 / +1 lines)
Lines 274-280 Link Here
274
			}
274
			}
275
		} else {  // https://bugs.eclipse.org/bugs/show_bug.cgi?id=308980
275
		} else {  // https://bugs.eclipse.org/bugs/show_bug.cgi?id=308980
276
			// in case an initializer bracket is opened in a non-array field
276
			// in case an initializer bracket is opened in a non-array field
277
			// eg. int field = {..
277
			// e.g. int field = {..
278
			this.bracketBalance++;
278
			this.bracketBalance++;
279
			return null; // no update is necessary	(array initializer)
279
			return null; // no update is necessary	(array initializer)
280
		}
280
		}
(-)eval/org/eclipse/jdt/internal/eval/EvaluationResult.java (-4 / +4 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 16-22 Link Here
16
 * An EvaluationResult is the result of a code snippet evaluation, a global
16
 * An EvaluationResult is the result of a code snippet evaluation, a global
17
 * variable evaluation or it is used to report problems against imports and
17
 * variable evaluation or it is used to report problems against imports and
18
 * package declaration.
18
 * package declaration.
19
 * It primarily contains the representation of the resulting value (eg. its
19
 * It primarily contains the representation of the resulting value (e.g. its
20
 * toString() representation). However if the code snippet, a global variable
20
 * toString() representation). However if the code snippet, a global variable
21
 * definition, an import or the package declaration could not be compiled, it
21
 * definition, an import or the package declaration could not be compiled, it
22
 * contains the corresponding compilation problems.
22
 * contains the corresponding compilation problems.
Lines 129-135 Link Here
129
 * Returns the displayable representation of this result's value.
129
 * Returns the displayable representation of this result's value.
130
 * This is obtained by sending toString() to the result object on the target side
130
 * This is obtained by sending toString() to the result object on the target side
131
 * if it is not a primitive value. If it is a primitive value, the corresponding
131
 * if it is not a primitive value. If it is a primitive value, the corresponding
132
 * static toString(...) is used, eg. Integer.toString(int n) if it is an int.
132
 * static toString(...) is used, e.g. Integer.toString(int n) if it is an int.
133
 * Returns null if there is no value.
133
 * Returns null if there is no value.
134
 */
134
 */
135
public char[] getValueDisplayString() {
135
public char[] getValueDisplayString() {
Lines 138-144 Link Here
138
/**
138
/**
139
 * Returns the dot-separated fully qualified name of this result's value type.
139
 * Returns the dot-separated fully qualified name of this result's value type.
140
 * If the value is a primitive value, returns the toString() representation of its type
140
 * If the value is a primitive value, returns the toString() representation of its type
141
 * (eg. "int", "boolean", etc.)
141
 * (e.g. "int", "boolean", etc.)
142
 * Returns null if there is no value.
142
 * Returns null if there is no value.
143
 */
143
 */
144
public char[] getValueTypeName() {
144
public char[] getValueTypeName() {
(-)eval/org/eclipse/jdt/internal/eval/GlobalVariable.java (-1 / +1 lines)
Lines 45-51 Link Here
45
}
45
}
46
/**
46
/**
47
 * Returns the dot separated fully qualified name of the type of this global variable,
47
 * Returns the dot separated fully qualified name of the type of this global variable,
48
 * or its simple representation if it is a primitive type (eg. int, boolean, etc.)
48
 * or its simple representation if it is a primitive type (e.g. int, boolean, etc.)
49
 */
49
 */
50
public char[] getTypeName() {
50
public char[] getTypeName() {
51
	return this.typeName;
51
	return this.typeName;
(-)model/org/eclipse/jdt/core/CompletionProposal.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
2
 * Copyright (c) 2004, 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 818-824 Link Here
818
	 * </p>
818
	 * </p>
819
	 * <p>
819
	 * <p>
820
	 * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor}
820
	 * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor}
821
	 * (eg. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)}).<br>
821
	 * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)}).<br>
822
	 * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed:
822
	 * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed:
823
	 * <code>requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)</code>.
823
	 * <code>requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)</code>.
824
	 * </p>
824
	 * </p>
Lines 859-865 Link Here
859
	 * </p>
859
	 * </p>
860
	 * <p>
860
	 * <p>
861
	 * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor}
861
	 * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor}
862
	 * (eg. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)})<br>
862
	 * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)})<br>
863
	 * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed:
863
	 * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed:
864
	 * <code>requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)</code>.
864
	 * <code>requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)</code>.
865
	 * </p>
865
	 * </p>
(-)model/org/eclipse/jdt/internal/core/JavaModelOperation.java (-2 / +2 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 309-315 Link Here
309
				getSubProgressMonitor(1));
309
				getSubProgressMonitor(1));
310
			setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
310
			setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
311
			while (resource instanceof IFolder) {
311
			while (resource instanceof IFolder) {
312
				// deleting a package: delete the parent if it is empty (eg. deleting x.y where folder x doesn't have resources but y)
312
				// deleting a package: delete the parent if it is empty (e.g. deleting x.y where folder x doesn't have resources but y)
313
				// without deleting the package fragment root
313
				// without deleting the package fragment root
314
				resource = resource.getParent();
314
				resource = resource.getParent();
315
				if (!resource.equals(rootResource) && resource.members().length == 0) {
315
				if (!resource.equals(rootResource) && resource.members().length == 0) {
(-)model/org/eclipse/jdt/internal/core/util/HandleFactory.java (-3 / +3 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 65-73 Link Here
65
65
66
	/**
66
	/**
67
	 * Creates an Openable handle from the given resource path.
67
	 * Creates an Openable handle from the given resource path.
68
	 * The resource path can be a path to a file in the workbench (eg. /Proj/com/ibm/jdt/core/HandleFactory.java)
68
	 * The resource path can be a path to a file in the workbench (e.g. /Proj/com/ibm/jdt/core/HandleFactory.java)
69
	 * or a path to a file in a jar file - it then contains the path to the jar file and the path to the file in the jar
69
	 * or a path to a file in a jar file - it then contains the path to the jar file and the path to the file in the jar
70
	 * (eg. c:/jdk1.2.2/jre/lib/rt.jar|java/lang/Object.class or /Proj/rt.jar|java/lang/Object.class)
70
	 * (e.g. c:/jdk1.2.2/jre/lib/rt.jar|java/lang/Object.class or /Proj/rt.jar|java/lang/Object.class)
71
	 * NOTE: This assumes that the resource path is the toString() of an IPath,
71
	 * NOTE: This assumes that the resource path is the toString() of an IPath,
72
	 *       in other words, it uses the IPath.SEPARATOR for file path
72
	 *       in other words, it uses the IPath.SEPARATOR for file path
73
	 *            and it uses '/' for entries in a zip file.
73
	 *            and it uses '/' for entries in a zip file.
(-)notes/R32_buildnotes_jdt-core.html (-1 / +1 lines)
Lines 2355-2361 Link Here
2355
<li>Added Camel Case support in completion.
2355
<li>Added Camel Case support in completion.
2356
When you perform code complete, the proposals list contains proposals whose name match with the camel case pattern.
2356
When you perform code complete, the proposals list contains proposals whose name match with the camel case pattern.
2357
<br>
2357
<br>
2358
eg. a possible proposal for TT| is ToTo.
2358
e.g. a possible proposal for TT| is ToTo.
2359
</li>
2359
</li>
2360
<li>Added option to control Camel Case completion.
2360
<li>Added option to control Camel Case completion.
2361
<pre>
2361
<pre>
(-)notes/R35_buildnotes_jdt-core.html (-2 / +2 lines)
Lines 799-805 Link Here
799
	 * &lt;/p&gt;
799
	 * &lt;/p&gt;
800
	 * &lt;p&gt;
800
	 * &lt;p&gt;
801
	 * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor}
801
	 * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor}
802
	 * (eg. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)}).&lt;br&gt;
802
	 * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)}).&lt;br&gt;
803
	 * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed:
803
	 * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed:
804
	 * &lt;code&gt;requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)&lt;/code&gt;.
804
	 * &lt;code&gt;requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)&lt;/code&gt;.
805
	 * &lt;/p&gt;
805
	 * &lt;/p&gt;
Lines 840-846 Link Here
840
	 * &lt;/p&gt;
840
	 * &lt;/p&gt;
841
	 * &lt;p&gt;
841
	 * &lt;p&gt;
842
	 * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor}
842
	 * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor}
843
	 * (eg. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)})&lt;br&gt;
843
	 * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)})&lt;br&gt;
844
	 * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed:
844
	 * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed:
845
	 * &lt;code&gt;requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)&lt;/code&gt;.
845
	 * &lt;code&gt;requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)&lt;/code&gt;.
846
	 * &lt;/p&gt;
846
	 * &lt;/p&gt;
(-)search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java (-2 / +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 56-62 Link Here
56
}
56
}
57
protected boolean hasNextQuery() {
57
protected boolean hasNextQuery() {
58
	// if package has at least 4 segments, don't look at the first 2 since they are mostly
58
	// if package has at least 4 segments, don't look at the first 2 since they are mostly
59
	// redundant (eg. in 'org.eclipse.jdt.core.*' 'org.eclipse' is used all the time)
59
	// redundant (e.g. in 'org.eclipse.jdt.core.*' 'org.eclipse' is used all the time)
60
	return --this.currentSegment >= (this.segments.length >= 4 ? 2 : 0);
60
	return --this.currentSegment >= (this.segments.length >= 4 ? 2 : 0);
61
}
61
}
62
public boolean matchesDecodedKey(SearchPattern decodedPattern) {
62
public boolean matchesDecodedKey(SearchPattern decodedPattern) {

Return to bug 313706