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

Collapse All | Expand All

(-)search/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.java (-1 / +4 lines)
Lines 14-19 Link Here
14
import org.eclipse.jdt.internal.compiler.IProblemFactory;
14
import org.eclipse.jdt.internal.compiler.IProblemFactory;
15
import org.eclipse.jdt.internal.compiler.ISourceElementRequestor;
15
import org.eclipse.jdt.internal.compiler.ISourceElementRequestor;
16
import org.eclipse.jdt.internal.compiler.SourceElementParser;
16
import org.eclipse.jdt.internal.compiler.SourceElementParser;
17
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
17
import org.eclipse.jdt.internal.compiler.ast.ImportReference;
18
import org.eclipse.jdt.internal.compiler.ast.ImportReference;
18
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
19
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
19
import org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
20
import org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
Lines 36-42 Link Here
36
		ImportReference ref = this.importReference;
37
		ImportReference ref = this.importReference;
37
		ref.tokens = tokens;
38
		ref.tokens = tokens;
38
		ref.sourcePositions = sourcePositions;
39
		ref.sourcePositions = sourcePositions;
39
		ref.onDemand = onDemand;
40
		if (onDemand) {
41
			ref.bits |= ASTNode.OnDemand;
42
		}
40
		ref.sourceEnd = (int) (sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFF);
43
		ref.sourceEnd = (int) (sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFF);
41
		ref.sourceStart = (int) (sourcePositions[0] >>> 32);
44
		ref.sourceStart = (int) (sourcePositions[0] >>> 32);
42
		ref.modifiers = modifiers;
45
		ref.modifiers = modifiers;
(-)compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.java (-2 / +3 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.compiler.parser.diagnose;
11
package org.eclipse.jdt.internal.compiler.parser.diagnose;
12
12
13
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
13
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
14
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
14
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
15
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
15
import org.eclipse.jdt.internal.compiler.ast.Initializer;
16
import org.eclipse.jdt.internal.compiler.ast.Initializer;
Lines 141-147 Link Here
141
					AbstractMethodDeclaration method = methods[i];
142
					AbstractMethodDeclaration method = methods[i];
142
					if(containsIgnoredBody(method)) {
143
					if(containsIgnoredBody(method)) {
143
						if(containsErrorInSignature(method)) {
144
						if(containsErrorInSignature(method)) {
144
							method.errorInSignature = true;
145
							method.bits |= ASTNode.ErrorInSignature;
145
							result.addInterval(method.declarationSourceStart, method.declarationSourceEnd, IGNORE);
146
							result.addInterval(method.declarationSourceStart, method.declarationSourceEnd, IGNORE);
146
						} else {
147
						} else {
147
							int flags = method.sourceEnd + 1 == method.bodyStart ? LBRACE_MISSING : NO_FLAG;
148
							int flags = method.sourceEnd + 1 == method.bodyStart ? LBRACE_MISSING : NO_FLAG;
Lines 159-165 Link Here
159
					if (fields[i] instanceof Initializer) {
160
					if (fields[i] instanceof Initializer) {
160
						Initializer initializer = (Initializer)fields[i];
161
						Initializer initializer = (Initializer)fields[i];
161
						if(initializer.declarationSourceEnd == initializer.bodyEnd && initializer.declarationSourceStart != initializer.declarationSourceEnd){
162
						if(initializer.declarationSourceEnd == initializer.bodyEnd && initializer.declarationSourceStart != initializer.declarationSourceEnd){
162
							initializer.errorInSignature = true;
163
							initializer.bits |= ASTNode.ErrorInSignature;
163
							result.addInterval(initializer.declarationSourceStart, initializer.declarationSourceEnd, IGNORE);
164
							result.addInterval(initializer.declarationSourceStart, initializer.declarationSourceEnd, IGNORE);
164
						} else {
165
						} else {
165
							result.addInterval(initializer.bodyStart, initializer.bodyEnd);
166
							result.addInterval(initializer.bodyStart, initializer.bodyEnd);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java (-3 / +4 lines)
Lines 57-64 Link Here
57
					FlowInfo.DEAD_END);
57
					FlowInfo.DEAD_END);
58
58
59
			// check for missing returning path
59
			// check for missing returning path
60
			this.needFreeReturn = (flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0;
60
			if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
61
61
				this.bits |= ASTNode.NeedFreeReturn;
62
			}
62
63
63
			// check missing blank final field initializations
64
			// check missing blank final field initializations
64
			flowInfo = flowInfo.mergedWith(staticInitializerFlowContext.initsOnReturn);
65
			flowInfo = flowInfo.mergedWith(staticInitializerFlowContext.initsOnReturn);
Lines 265-271 Link Here
265
			// reset the constant pool to its state before the clinit
266
			// reset the constant pool to its state before the clinit
266
			constantPool.resetForClinit(constantPoolIndex, constantPoolOffset);
267
			constantPool.resetForClinit(constantPoolIndex, constantPoolOffset);
267
		} else {
268
		} else {
268
			if (this.needFreeReturn) {
269
			if ((this.bits & ASTNode.NeedFreeReturn) != 0) {
269
				int before = codeStream.position;
270
				int before = codeStream.position;
270
				codeStream.return_();
271
				codeStream.return_();
271
				if (lastInitializerScope != null) {
272
				if (lastInitializerScope != null) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java (-7 / +5 lines)
Lines 20-28 Link Here
20
public class ReturnStatement extends Statement {
20
public class ReturnStatement extends Statement {
21
		
21
		
22
	public Expression expression;
22
	public Expression expression;
23
	public boolean isSynchronized;
24
	public SubRoutineStatement[] subroutines;
23
	public SubRoutineStatement[] subroutines;
25
	public boolean isAnySubRoutineEscaping = false;
26
	public LocalVariableBinding saveValueVariable;
24
	public LocalVariableBinding saveValueVariable;
27
	public int initStateIndex = -1;
25
	public int initStateIndex = -1;
28
	
26
	
Lines 61-67 Link Here
61
			this.subroutines[subCount++] = sub;
59
			this.subroutines[subCount++] = sub;
62
			if (sub.isSubRoutineEscaping()) {
60
			if (sub.isSubRoutineEscaping()) {
63
				saveValueNeeded = false;
61
				saveValueNeeded = false;
64
				this.isAnySubRoutineEscaping = true;
62
				this.bits |= ASTNode.IsAnySubRoutineEscaping;
65
				break;
63
				break;
66
			}
64
			}
67
		}
65
		}
Lines 70-76 Link Here
70
		if (traversedContext instanceof InsideSubRoutineFlowContext) {
68
		if (traversedContext instanceof InsideSubRoutineFlowContext) {
71
			ASTNode node = traversedContext.associatedNode;
69
			ASTNode node = traversedContext.associatedNode;
72
			if (node instanceof SynchronizedStatement) {
70
			if (node instanceof SynchronizedStatement) {
73
				this.isSynchronized = true;
71
				this.bits |= ASTNode.IsSynchronized;
74
			} else if (node instanceof TryStatement) {
72
			} else if (node instanceof TryStatement) {
75
				TryStatement tryStatement = (TryStatement) node;
73
				TryStatement tryStatement = (TryStatement) node;
76
				flowInfo.addInitializationsFrom(tryStatement.subRoutineInits); // collect inits
74
				flowInfo.addInitializationsFrom(tryStatement.subRoutineInits); // collect inits
Lines 99-105 Link Here
99
		}
97
		}
100
	} else {
98
	} else {
101
		this.saveValueVariable = null;
99
		this.saveValueVariable = null;
102
		if (!this.isSynchronized && this.expression != null && this.expression.resolvedType == TypeBinding.BOOLEAN) {
100
		if (((this.bits & ASTNode.IsSynchronized) == 0) && this.expression != null && this.expression.resolvedType == TypeBinding.BOOLEAN) {
103
			this.expression.bits |= ASTNode.IsReturnedValue;
101
			this.expression.bits |= ASTNode.IsReturnedValue;
104
		}
102
		}
105
	}
103
	}
Lines 177-184 Link Here
177
175
178
public boolean needValue() {
176
public boolean needValue() {
179
	return this.saveValueVariable != null 
177
	return this.saveValueVariable != null 
180
					|| this.isSynchronized
178
					|| (this.bits & ASTNode.IsSynchronized) != 0
181
					|| !this.isAnySubRoutineEscaping;
179
					|| ((this.bits & ASTNode.IsAnySubRoutineEscaping) == 0);
182
}
180
}
183
181
184
public void prepareSaveValueLocation(TryStatement targetTryStatement){
182
public void prepareSaveValueLocation(TryStatement targetTryStatement){
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java (-1 / +3 lines)
Lines 373-379 Link Here
373
					scope.problemReporter().javadocInvalidValueReference(fieldRef.sourceStart, fieldRef.sourceEnd, scopeModifiers);
373
					scope.problemReporter().javadocInvalidValueReference(fieldRef.sourceStart, fieldRef.sourceEnd, scopeModifiers);
374
				}
374
				}
375
				else if (fieldRef.receiverType != null) {
375
				else if (fieldRef.receiverType != null) {
376
					fieldRef.superAccess = scope.enclosingSourceType().isCompatibleWith(fieldRef.receiverType);
376
					if (scope.enclosingSourceType().isCompatibleWith(fieldRef.receiverType)) {
377
						fieldRef.bits |= ASTNode.SuperAccess;
378
					}
377
					fieldRef.methodBinding = scope.findMethod((ReferenceBinding)fieldRef.receiverType, fieldRef.token, new TypeBinding[0], fieldRef);
379
					fieldRef.methodBinding = scope.findMethod((ReferenceBinding)fieldRef.receiverType, fieldRef.token, new TypeBinding[0], fieldRef);
378
				}
380
				}
379
			}
381
			}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java (-4 / +4 lines)
Lines 25-32 Link Here
25
	public Statement thenStatement;
25
	public Statement thenStatement;
26
	public Statement elseStatement;
26
	public Statement elseStatement;
27
27
28
	boolean thenExit;
29
30
	// for local variables table attributes
28
	// for local variables table attributes
31
	int thenInitStateIndex = -1;
29
	int thenInitStateIndex = -1;
32
	int elseInitStateIndex = -1;
30
	int elseInitStateIndex = -1;
Lines 87-93 Link Here
87
			}
85
			}
88
		}
86
		}
89
		// code gen: optimizing the jump around the ELSE part
87
		// code gen: optimizing the jump around the ELSE part
90
		this.thenExit = (thenFlowInfo.tagBits & FlowInfo.UNREACHABLE) != 0;
88
		if ((thenFlowInfo.tagBits & FlowInfo.UNREACHABLE) != 0) {
89
			this.bits |= ASTNode.ThenExit;
90
		}
91
91
92
		// process the ELSE part
92
		// process the ELSE part
93
		if (this.elseStatement != null) {
93
		if (this.elseStatement != null) {
Lines 160-166 Link Here
160
			this.thenStatement.generateCode(currentScope, codeStream);
160
			this.thenStatement.generateCode(currentScope, codeStream);
161
			// jump around the else statement
161
			// jump around the else statement
162
			if (hasElsePart) {
162
			if (hasElsePart) {
163
				if (!thenExit) {
163
				if ((this.bits & ASTNode.ThenExit) == 0) {
164
					this.thenStatement.branchChainTo(endifLabel);
164
					this.thenStatement.branchChainTo(endifLabel);
165
					int position = codeStream.position;
165
					int position = codeStream.position;
166
					codeStream.goto_(endifLabel);
166
					codeStream.goto_(endifLabel);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java (-2 / +3 lines)
Lines 96-103 Link Here
96
			// check for missing returning path
96
			// check for missing returning path
97
			TypeBinding returnTypeBinding = binding.returnType;
97
			TypeBinding returnTypeBinding = binding.returnType;
98
			if ((returnTypeBinding == TypeBinding.VOID) || isAbstract()) {
98
			if ((returnTypeBinding == TypeBinding.VOID) || isAbstract()) {
99
				this.needFreeReturn =
99
				if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
100
					(flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0;
100
					this.bits |= ASTNode.NeedFreeReturn;
101
				}
101
			} else {
102
			} else {
102
				if (flowInfo != FlowInfo.DEAD_END) { 
103
				if (flowInfo != FlowInfo.DEAD_END) { 
103
					scope.problemReporter().shouldReturn(returnTypeBinding, this);
104
					scope.problemReporter().shouldReturn(returnTypeBinding, this);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java (-31 / +65 lines)
Lines 22-60 Link Here
22
22
23
	public int sourceStart, sourceEnd;
23
	public int sourceStart, sourceEnd;
24
24
25
	// storage for internal flags (32 bits)						BIT USAGE
25
	// storage for internal flags (32 bits)				BIT USAGE
26
	public final static int Bit1 = 0x1; 						// return type (operator) | name reference kind (name ref) | add assertion (type decl) | useful empty statement (empty statement)
26
	public final static int Bit1 = 0x1;					// return type (operator) | name reference kind (name ref) | add assertion (type decl) | useful empty statement (empty statement)
27
	public final static int Bit2 = 0x2; 						// return type (operator) | name reference kind (name ref) | has local type (type, method, field decl)
27
	public final static int Bit2 = 0x2;					// return type (operator) | name reference kind (name ref) | has local type (type, method, field decl)
28
	public final static int Bit3 = 0x4; 						// return type (operator) | name reference kind (name ref) | implicit this (this ref)
28
	public final static int Bit3 = 0x4;					// return type (operator) | name reference kind (name ref) | implicit this (this ref)
29
	public final static int Bit4 = 0x8; 						// return type (operator) | first assignment to local (name ref,local decl) | undocumented empty block (block, type and method decl)
29
	public final static int Bit4 = 0x8;					// return type (operator) | first assignment to local (name ref,local decl) | undocumented empty block (block, type and method decl)
30
	public final static int Bit5 = 0x10; 						// value for return (expression) | has all method bodies (unit) | supertype ref (type ref) | resolved (field decl)
30
	public final static int Bit5 = 0x10;				// value for return (expression) | has all method bodies (unit) | supertype ref (type ref) | resolved (field decl)
31
	public final static int Bit6 = 0x20; 						// depth (name ref, msg) | ignore need cast check (cast expression)
31
	public final static int Bit6 = 0x20;				// depth (name ref, msg) | ignore need cast check (cast expression) | error in signature (method declaration/ initializer)
32
	public final static int Bit7 = 0x40; 						// depth (name ref, msg) | operator (operator) | need runtime checkcast (cast expression) | label used (labelStatement)
32
	public final static int Bit7 = 0x40;				// depth (name ref, msg) | operator (operator) | need runtime checkcast (cast expression) | label used (labelStatement) | needFreeReturn (AbstractMethodDeclaration)
33
	public final static int Bit8 = 0x80; 						// depth (name ref, msg) | operator (operator) | unsafe cast (cast expression)
33
	public final static int Bit8 = 0x80;				// depth (name ref, msg) | operator (operator) | unsafe cast (cast expression) | is default constructor (constructor declaration)
34
	public final static int Bit9 = 0x100; 					// depth (name ref, msg) | operator (operator) | is local type (type decl)
34
	public final static int Bit9 = 0x100;				// depth (name ref, msg) | operator (operator) | is local type (type decl)
35
	public final static int Bit10= 0x200; 					// depth (name ref, msg) | operator (operator) | is anonymous type (type decl)
35
	public final static int Bit10= 0x200;				// depth (name ref, msg) | operator (operator) | is anonymous type (type decl)
36
	public final static int Bit11 = 0x400; 					// depth (name ref, msg) | operator (operator) | is member type (type decl)
36
	public final static int Bit11 = 0x400;				// depth (name ref, msg) | operator (operator) | is member type (type decl)
37
	public final static int Bit12 = 0x800; 					// depth (name ref, msg) | operator (operator) | has abstract methods (type decl)
37
	public final static int Bit12 = 0x800;				// depth (name ref, msg) | operator (operator) | has abstract methods (type decl)
38
	public final static int Bit13 = 0x1000; 				// depth (name ref, msg) | is secondary type (type decl)
38
	public final static int Bit13 = 0x1000;				// depth (name ref, msg) | is secondary type (type decl)
39
	public final static int Bit14 = 0x2000; 				// strictly assigned (reference lhs) | discard enclosing instance (explicit constr call)
39
	public final static int Bit14 = 0x2000;				// strictly assigned (reference lhs) | discard enclosing instance (explicit constr call) | hasBeenGenerated (type decl)
40
	public final static int Bit15 = 0x4000; 				// is unnecessary cast (expression) | is varargs (type ref) | isSubRoutineEscaping (try statement)
40
	public final static int Bit15 = 0x4000;				// is unnecessary cast (expression) | is varargs (type ref) | isSubRoutineEscaping (try statement) | superAccess (javadoc allocation expression/javadoc message send/javadoc return statement)
41
	public final static int Bit16 = 0x8000; 				// in javadoc comment (name ref, type ref, msg)
41
	public final static int Bit16 = 0x8000;				// in javadoc comment (name ref, type ref, msg)
42
	public final static int Bit17 = 0x10000; 				// compound assigned (reference lhs)
42
	public final static int Bit17 = 0x10000;			// compound assigned (reference lhs)
43
	public final static int Bit18 = 0x20000;				// non null (expression)
43
	public final static int Bit18 = 0x20000;			// non null (expression) | onDemand (import reference)
44
	public final static int Bit19 = 0x40000;
44
	public final static int Bit19 = 0x40000;			// didResolve (parameterized qualified type ref/parameterized single type ref)  | empty (javadoc return statement)
45
	public final static int Bit20 = 0x80000;
45
	public final static int Bit20 = 0x80000;
46
	public final static int Bit21 = 0x100000;
46
	public final static int Bit21 = 0x100000;
47
	public final static int Bit22 = 0x200000; 			// parenthesis count (expression)
47
	public final static int Bit22 = 0x200000;			// parenthesis count (expression) | used (import reference)
48
	public final static int Bit23 = 0x400000; 			// parenthesis count (expression)
48
	public final static int Bit23 = 0x400000;			// parenthesis count (expression)
49
	public final static int Bit24 = 0x800000; 			// parenthesis count (expression)
49
	public final static int Bit24 = 0x800000;			// parenthesis count (expression)
50
	public final static int Bit25 = 0x1000000; 			// parenthesis count (expression)
50
	public final static int Bit25 = 0x1000000;			// parenthesis count (expression)
51
	public final static int Bit26 = 0x2000000; 			// parenthesis count (expression)
51
	public final static int Bit26 = 0x2000000;			// parenthesis count (expression)
52
	public final static int Bit27 = 0x4000000; 			// parenthesis count (expression)
52
	public final static int Bit27 = 0x4000000;			// parenthesis count (expression)
53
	public final static int Bit28 = 0x8000000; 			// parenthesis count (expression)
53
	public final static int Bit28 = 0x8000000;			// parenthesis count (expression)
54
	public final static int Bit29 = 0x10000000; 		// parenthesis count (expression)
54
	public final static int Bit29 = 0x10000000;			// parenthesis count (expression)
55
	public final static int Bit30 = 0x20000000; 		// elseif (if statement) | try block exit (try statement) | fall-through (case statement) | ignore no effect assign (expression ref)
55
	public final static int Bit30 = 0x20000000;			// elseif (if statement) | try block exit (try statement) | fall-through (case statement) | ignore no effect assign (expression ref) | needScope (for statement) | isAnySubRoutineEscaping (return statement) | blockExit (synchronized statement)
56
	public final static int Bit31 = 0x40000000; 		// local declaration reachable (local decl) | ignore raw type check (type ref) | discard entire assignment (assignment)
56
	public final static int Bit31 = 0x40000000;			// local declaration reachable (local decl) | ignore raw type check (type ref) | discard entire assignment (assignment) | isSynchronized (return statement) | thenExit (if statement) 
57
	public final static int Bit32 = 0x80000000; 		// reachable (statement)
57
	public final static int Bit32 = 0x80000000;			// reachable (statement)
58
58
59
	public final static long Bit32L = 0x80000000L;
59
	public final static long Bit32L = 0x80000000L;
60
	public final static long Bit33L = 0x100000000L;
60
	public final static long Bit33L = 0x100000000L;
Lines 138-143 Link Here
138
	public static final int IsMemberType = Bit11; // local member do not know it is local at parse time (need to look at binding)
138
	public static final int IsMemberType = Bit11; // local member do not know it is local at parse time (need to look at binding)
139
	public static final int HasAbstractMethods = Bit12; // used to promote abstract enums
139
	public static final int HasAbstractMethods = Bit12; // used to promote abstract enums
140
	public static final int IsSecondaryType = Bit13; // used to test for secondary
140
	public static final int IsSecondaryType = Bit13; // used to test for secondary
141
	public static final int HasBeenGenerated = Bit14;
141
142
142
	// for type, method and field declarations
143
	// for type, method and field declarations
143
	public static final int HasLocalType = Bit2; // cannot conflict with AddAssertionMASK
144
	public static final int HasLocalType = Bit2; // cannot conflict with AddAssertionMASK
Lines 162-167 Link Here
162
	public static final int UndocumentedEmptyBlock = Bit4;
163
	public static final int UndocumentedEmptyBlock = Bit4;
163
	public static final int OverridingMethodWithSupercall = Bit5;
164
	public static final int OverridingMethodWithSupercall = Bit5;
164
165
166
	// for initializer and method declaration
167
	public static final int ErrorInSignature = Bit6;
168
	
169
	// for abstract method declaration
170
	public static final int NeedFreeReturn = Bit7; // abstract method declaration
171
172
	// for constructor declaration
173
	public static final int IsDefaultConstructor = Bit8;
174
165
	// for compilation unit
175
	// for compilation unit
166
	public static final int HasAllMethodBodies = Bit5;
176
	public static final int HasAllMethodBodies = Bit5;
167
	public static final int IsImplicitUnit = Bit1;
177
	public static final int IsImplicitUnit = Bit1;
Lines 169-176 Link Here
169
	// for references in Javadoc comments
179
	// for references in Javadoc comments
170
	public static final int InsideJavadoc = Bit16;
180
	public static final int InsideJavadoc = Bit16;
171
181
182
	// for javadoc allocation expression/javadoc message send/javadoc return statement
183
	public static final int SuperAccess = Bit15;
184
185
	// for javadoc return statement
186
	public static final int Empty = Bit19;
187
172
	// for if statement
188
	// for if statement
173
	public static final int IsElseIfStatement = Bit30;
189
	public static final int IsElseIfStatement = Bit30;
190
	public static final int ThenExit = Bit31;
174
191
175
	// for type reference
192
	// for type reference
176
	public static final int IsSuperType = Bit5;
193
	public static final int IsSuperType = Bit5;
Lines 183-188 Link Here
183
	// for null reference analysis
200
	// for null reference analysis
184
	public static final int IsNonNull = Bit18;
201
	public static final int IsNonNull = Bit18;
185
202
203
	// for for statement
204
	public static final int NeededScope = Bit30;
205
206
	// for import reference
207
	public static final int OnDemand = Bit18;
208
	public static final int Used = Bit2;
209
	
210
	// for parameterized qualified/single type ref
211
	public static final int DidResolve = Bit19;
212
	
213
	// for return statement
214
	public static final int IsAnySubRoutineEscaping = Bit30;
215
	public static final int IsSynchronized = Bit31;
216
	
217
	// for synchronized statement
218
	public static final int BlockExit = Bit30;
219
	
186
	// constants used when checking invocation arguments
220
	// constants used when checking invocation arguments
187
	public static final int INVOCATION_ARGUMENT_OK = 0;
221
	public static final int INVOCATION_ARGUMENT_OK = 0;
188
	public static final int INVOCATION_ARGUMENT_UNCHECKED = 1;
222
	public static final int INVOCATION_ARGUMENT_UNCHECKED = 1;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java (-4 / +4 lines)
Lines 18-28 Link Here
18
18
19
	public char[][] tokens;
19
	public char[][] tokens;
20
	public long[] sourcePositions; //each entry is using the code : (start<<32) + end
20
	public long[] sourcePositions; //each entry is using the code : (start<<32) + end
21
	public boolean onDemand = true; //most of the time
22
	public int declarationEnd; // doesn't include an potential trailing comment
21
	public int declarationEnd; // doesn't include an potential trailing comment
23
	public int declarationSourceStart;
22
	public int declarationSourceStart;
24
	public int declarationSourceEnd;
23
	public int declarationSourceEnd;
25
	public boolean used;
26
	public int modifiers; // 1.5 addition for static imports
24
	public int modifiers; // 1.5 addition for static imports
27
	public Annotation[] annotations;
25
	public Annotation[] annotations;
28
26
Lines 34-40 Link Here
34
32
35
		this.tokens = tokens;
33
		this.tokens = tokens;
36
		this.sourcePositions = sourcePositions;
34
		this.sourcePositions = sourcePositions;
37
		this.onDemand = onDemand;
35
		if (onDemand) {
36
			this.bits |= ASTNode.OnDemand;
37
		}
38
		this.sourceEnd = (int) (sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFF);
38
		this.sourceEnd = (int) (sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFF);
39
		this.sourceStart = (int) (sourcePositions[0] >>> 32);
39
		this.sourceStart = (int) (sourcePositions[0] >>> 32);
40
		this.modifiers = modifiers;
40
		this.modifiers = modifiers;
Lines 64-70 Link Here
64
			if (i > 0) output.append('.');
64
			if (i > 0) output.append('.');
65
			output.append(tokens[i]);
65
			output.append(tokens[i]);
66
		}
66
		}
67
		if (withOnDemand && onDemand) {
67
		if (withOnDemand && ((this.bits & ASTNode.OnDemand) != 0)) {
68
			output.append(".*"); //$NON-NLS-1$
68
			output.append(".*"); //$NON-NLS-1$
69
		}
69
		}
70
		return output;
70
		return output;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java (-3 / +4 lines)
Lines 20-26 Link Here
20
20
21
	public int tagSourceStart, tagSourceEnd;
21
	public int tagSourceStart, tagSourceEnd;
22
	public int tagValue;
22
	public int tagValue;
23
	public boolean superAccess = false;
24
23
25
	public JavadocMessageSend(char[] name, long pos) {
24
	public JavadocMessageSend(char[] name, long pos) {
26
		this.selector = name;
25
		this.selector = name;
Lines 81-87 Link Here
81
		}
80
		}
82
		this.actualReceiverType = scope.environment().convertToRawType(this.receiver.resolvedType);
81
		this.actualReceiverType = scope.environment().convertToRawType(this.receiver.resolvedType);
83
		SourceTypeBinding enclosingType = scope.enclosingSourceType();
82
		SourceTypeBinding enclosingType = scope.enclosingSourceType();
84
		this.superAccess = enclosingType==null ? false : enclosingType.isCompatibleWith(this.actualReceiverType);
83
		if (enclosingType==null ? false : enclosingType.isCompatibleWith(this.actualReceiverType)) {
84
			this.bits |= ASTNode.SuperAccess;
85
		}
85
86
86
		// base type cannot receive any message
87
		// base type cannot receive any message
87
		if (this.actualReceiverType.isBaseType()) {
88
		if (this.actualReceiverType.isBaseType()) {
Lines 173-179 Link Here
173
	 * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#isSuperAccess()
174
	 * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#isSuperAccess()
174
	 */
175
	 */
175
	public boolean isSuperAccess() {
176
	public boolean isSuperAccess() {
176
		return this.superAccess;
177
		return (this.bits & ASTNode.SuperAccess) != 0;
177
	}
178
	}
178
179
179
	public StringBuffer printExpression(int indent, StringBuffer output){
180
	public StringBuffer printExpression(int indent, StringBuffer output){
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java (-2 / +1 lines)
Lines 19-25 Link Here
19
	public int tagSourceStart, tagSourceEnd;
19
	public int tagSourceStart, tagSourceEnd;
20
	public int tagValue;
20
	public int tagValue;
21
	public MethodBinding methodBinding;
21
	public MethodBinding methodBinding;
22
	public boolean superAccess = false;
23
22
24
	public JavadocFieldReference(char[] source, long pos) {
23
	public JavadocFieldReference(char[] source, long pos) {
25
		super(source, pos);
24
		super(source, pos);
Lines 103-109 Link Here
103
	}
102
	}
104
	
103
	
105
	public boolean isSuperAccess() {
104
	public boolean isSuperAccess() {
106
		return this.superAccess;
105
		return (this.bits & ASTNode.SuperAccess) != 0;
107
	}
106
	}
108
107
109
	public StringBuffer printExpression(int indent, StringBuffer output) {
108
	public StringBuffer printExpression(int indent, StringBuffer output) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java (-3 / +4 lines)
Lines 19-25 Link Here
19
19
20
	public int tagSourceStart, tagSourceEnd;
20
	public int tagSourceStart, tagSourceEnd;
21
	public int tagValue, memberStart;
21
	public int tagValue, memberStart;
22
	public boolean superAccess = false;
23
	public char[][] qualification;
22
	public char[][] qualification;
24
23
25
	public JavadocAllocationExpression(int start, int end) {
24
	public JavadocAllocationExpression(int start, int end) {
Lines 74-80 Link Here
74
		}
73
		}
75
		this.resolvedType = scope.environment().convertToRawType(this.type.resolvedType);
74
		this.resolvedType = scope.environment().convertToRawType(this.type.resolvedType);
76
		SourceTypeBinding enclosingType = scope.enclosingSourceType();
75
		SourceTypeBinding enclosingType = scope.enclosingSourceType();
77
		this.superAccess = enclosingType==null ? false : enclosingType.isCompatibleWith(this.resolvedType);
76
		if (enclosingType == null ? false : enclosingType.isCompatibleWith(this.resolvedType)) {
77
			this.bits |= ASTNode.SuperAccess;
78
		}
78
	
79
	
79
		ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType;
80
		ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType;
80
		this.binding = scope.getConstructor(allocationType, argumentTypes, this);
81
		this.binding = scope.getConstructor(allocationType, argumentTypes, this);
Lines 147-153 Link Here
147
	}
148
	}
148
149
149
	public boolean isSuperAccess() {
150
	public boolean isSuperAccess() {
150
		return this.superAccess;
151
		return (this.bits & ASTNode.SuperAccess) != 0;
151
	}
152
	}
152
153
153
	public TypeBinding resolveType(BlockScope scope) {
154
	public TypeBinding resolveType(BlockScope scope) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java (-18 / +17 lines)
Lines 22-28 Link Here
22
public class ParameterizedQualifiedTypeReference extends ArrayQualifiedTypeReference {
22
public class ParameterizedQualifiedTypeReference extends ArrayQualifiedTypeReference {
23
23
24
	public TypeReference[][] typeArguments;
24
	public TypeReference[][] typeArguments;
25
	public boolean didResolve = false;
26
25
27
	/**
26
	/**
28
	 * @param tokens
27
	 * @param tokens
Lines 112-150 Link Here
112
111
113
		// handle the error here
112
		// handle the error here
114
		this.constant = Constant.NotAConstant;
113
		this.constant = Constant.NotAConstant;
115
		if (this.didResolve) { // is a shared type reference which was already resolved
114
		if ((this.bits & ASTNode.DidResolve) != 0) { // is a shared type reference which was already resolved
116
			if (this.resolvedType != null && !this.resolvedType.isValidBinding())
115
			if (this.resolvedType != null && !this.resolvedType.isValidBinding())
117
				return null; // already reported error
116
				return null; // already reported error
118
			return this.resolvedType;
117
			return this.resolvedType;
119
		} 
118
		} 
120
	    this.didResolve = true;
119
		this.bits |= ASTNode.DidResolve;
121
	    boolean isClassScope = scope.kind == Scope.CLASS_SCOPE;
120
		boolean isClassScope = scope.kind == Scope.CLASS_SCOPE;
122
	    Binding binding = scope.getPackage(this.tokens);
121
		Binding binding = scope.getPackage(this.tokens);
123
	    if (binding != null && !binding.isValidBinding()) {
122
		if (binding != null && !binding.isValidBinding()) {
124
	    	this.resolvedType = (ReferenceBinding) binding;
123
			this.resolvedType = (ReferenceBinding) binding;
125
			reportInvalidType(scope);
124
			reportInvalidType(scope);
126
			// be resilient, still attempt resolving arguments
125
			// be resilient, still attempt resolving arguments
127
			for (int i = 0, max = this.tokens.length; i < max; i++) {
126
			for (int i = 0, max = this.tokens.length; i < max; i++) {
128
			    TypeReference[] args = this.typeArguments[i];
127
				TypeReference[] args = this.typeArguments[i];
129
			    if (args != null) {
128
				if (args != null) {
130
					int argLength = args.length;
129
					int argLength = args.length;
131
					for (int j = 0; j < argLength; j++) {
130
					for (int j = 0; j < argLength; j++) {
132
					    TypeReference typeArgument = args[j];
131
						TypeReference typeArgument = args[j];
133
					    if (isClassScope) {
132
						if (isClassScope) {
134
					    	typeArgument.resolveType((ClassScope) scope);
133
							typeArgument.resolveType((ClassScope) scope);
135
					    } else {
134
						} else {
136
					    	typeArgument.resolveType((BlockScope) scope, checkBounds);
135
							typeArgument.resolveType((BlockScope) scope, checkBounds);
137
					    }
136
						}
138
					}
137
					}
139
			    }				
138
				}
140
			}
139
			}
141
			return null;
140
			return null;
142
		}
141
		}
143
142
144
	    PackageBinding packageBinding = binding == null ? null : (PackageBinding) binding;
143
		PackageBinding packageBinding = binding == null ? null : (PackageBinding) binding;
145
		boolean typeIsConsistent = true;
144
		boolean typeIsConsistent = true;
146
		ReferenceBinding qualifiedType = null;
145
		ReferenceBinding qualifiedType = null;
147
	    for (int i = packageBinding == null ? 0 : packageBinding.compoundName.length, max = this.tokens.length; i < max; i++) {
146
		for (int i = packageBinding == null ? 0 : packageBinding.compoundName.length, max = this.tokens.length; i < max; i++) {
148
			findNextTypeBinding(i, scope, packageBinding);
147
			findNextTypeBinding(i, scope, packageBinding);
149
			if (!(this.resolvedType.isValidBinding())) {
148
			if (!(this.resolvedType.isValidBinding())) {
150
				reportInvalidType(scope);
149
				reportInvalidType(scope);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java (-7 / +6 lines)
Lines 46-52 Link Here
46
	public int declarationSourceEnd;
46
	public int declarationSourceEnd;
47
	public int bodyStart;
47
	public int bodyStart;
48
	public int bodyEnd; // doesn't include the trailing comment if any.
48
	public int bodyEnd; // doesn't include the trailing comment if any.
49
	protected boolean hasBeenGenerated = false;
50
	public CompilationResult compilationResult;
49
	public CompilationResult compilationResult;
51
	public MethodDeclaration[] missingAbstractMethods;
50
	public MethodDeclaration[] missingAbstractMethods;
52
	public Javadoc javadoc;	
51
	public Javadoc javadoc;	
Lines 308-314 Link Here
308
307
309
	//the constructor
308
	//the constructor
310
	ConstructorDeclaration constructor = new ConstructorDeclaration(this.compilationResult);
309
	ConstructorDeclaration constructor = new ConstructorDeclaration(this.compilationResult);
311
	constructor.isDefaultConstructor = true;
310
	constructor.bits |= ASTNode.IsDefaultConstructor;
312
	constructor.selector = this.name;
311
	constructor.selector = this.name;
313
	constructor.modifiers = this.modifiers & ExtraCompilerModifiers.AccVisibilityMASK;
312
	constructor.modifiers = this.modifiers & ExtraCompilerModifiers.AccVisibilityMASK;
314
313
Lines 361-367 Link Here
361
		newModifiers |= ClassFileConstants.AccVarargs;
360
		newModifiers |= ClassFileConstants.AccVarargs;
362
	}
361
	}
363
	constructor.modifiers = newModifiers;
362
	constructor.modifiers = newModifiers;
364
	constructor.isDefaultConstructor = true;
363
	constructor.bits |= ASTNode.IsDefaultConstructor;
365
364
366
	if (argumentsLength > 0) {
365
	if (argumentsLength > 0) {
367
		Argument[] arguments = (constructor.arguments = new Argument[argumentsLength]);
366
		Argument[] arguments = (constructor.arguments = new Argument[argumentsLength]);
Lines 491-499 Link Here
491
 * Generic bytecode generation for type
490
 * Generic bytecode generation for type
492
 */
491
 */
493
public void generateCode(ClassFile enclosingClassFile) {
492
public void generateCode(ClassFile enclosingClassFile) {
494
	if (this.hasBeenGenerated)
493
	if ((this.bits & ASTNode.HasBeenGenerated) != 0)
495
		return;
494
		return;
496
	this.hasBeenGenerated = true;
495
	this.bits |= ASTNode.HasBeenGenerated;
497
	if (this.ignoreFurtherInvestigation) {
496
	if (this.ignoreFurtherInvestigation) {
498
		if (this.binding == null)
497
		if (this.binding == null)
499
			return;
498
			return;
Lines 558-564 Link Here
558
	if ((this.bits & ASTNode.IsReachable) == 0) {
557
	if ((this.bits & ASTNode.IsReachable) == 0) {
559
		return;
558
		return;
560
	}		
559
	}		
561
	if (this.hasBeenGenerated) return;
560
	if ((this.bits & ASTNode.HasBeenGenerated) != 0) return;
562
	int pc = codeStream.position;
561
	int pc = codeStream.position;
563
	if (this.binding != null) ((NestedTypeBinding) this.binding).computeSyntheticArgumentSlotSizes();
562
	if (this.binding != null) ((NestedTypeBinding) this.binding).computeSyntheticArgumentSlotSizes();
564
	generateCode(codeStream.classFile);
563
	generateCode(codeStream.classFile);
Lines 569-575 Link Here
569
 * Bytecode generation for a member inner type
568
 * Bytecode generation for a member inner type
570
 */
569
 */
571
public void generateCode(ClassScope classScope, ClassFile enclosingClassFile) {
570
public void generateCode(ClassScope classScope, ClassFile enclosingClassFile) {
572
	if (this.hasBeenGenerated) return;
571
	if ((this.bits & ASTNode.HasBeenGenerated) != 0) return;
573
	if (this.binding != null) ((NestedTypeBinding) this.binding).computeSyntheticArgumentSlotSizes();
572
	if (this.binding != null) ((NestedTypeBinding) this.binding).computeSyntheticArgumentSlotSizes();
574
	generateCode(enclosingClassFile);
573
	generateCode(enclosingClassFile);
575
}
574
}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java (-4 / +4 lines)
Lines 37-46 Link Here
37
		LookupEnvironment env = scope.environment();
37
		LookupEnvironment env = scope.environment();
38
		try {
38
		try {
39
			env.missingClassFileLocation = this;
39
			env.missingClassFileLocation = this;
40
		    if (this.resolvedType == null) {
40
			if (this.resolvedType == null) {
41
				this.resolvedType = scope.getType(this.tokens[tokenIndex], packageBinding);
41
				this.resolvedType = scope.getType(this.tokens[tokenIndex], packageBinding);
42
		    } else {
42
			} else {
43
			    this.resolvedType = scope.getMemberType(this.tokens[tokenIndex], (ReferenceBinding) this.resolvedType);
43
				this.resolvedType = scope.getMemberType(this.tokens[tokenIndex], (ReferenceBinding) this.resolvedType);
44
				if (this.resolvedType instanceof ProblemReferenceBinding) {
44
				if (this.resolvedType instanceof ProblemReferenceBinding) {
45
					ProblemReferenceBinding problemBinding = (ProblemReferenceBinding) this.resolvedType;
45
					ProblemReferenceBinding problemBinding = (ProblemReferenceBinding) this.resolvedType;
46
					this.resolvedType = new ProblemReferenceBinding(
46
					this.resolvedType = new ProblemReferenceBinding(
Lines 49-55 Link Here
49
						this.resolvedType.problemId());
49
						this.resolvedType.problemId());
50
				}
50
				}
51
			}
51
			}
52
		    return this.resolvedType;
52
			return this.resolvedType;
53
		} catch (AbortCompilation e) {
53
		} catch (AbortCompilation e) {
54
			e.updateContext(this, scope.referenceCompilationUnit().compilationResult);
54
			e.updateContext(this, scope.referenceCompilationUnit().compilationResult);
55
			throw e;
55
			throw e;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java (-9 / +10 lines)
Lines 24-31 Link Here
24
public class ConstructorDeclaration extends AbstractMethodDeclaration {
24
public class ConstructorDeclaration extends AbstractMethodDeclaration {
25
25
26
	public ExplicitConstructorCall constructorCall;
26
	public ExplicitConstructorCall constructorCall;
27
	
27
28
	public boolean isDefaultConstructor = false;
29
	public TypeParameter[] typeParameters;
28
	public TypeParameter[] typeParameters;
30
29
31
public ConstructorDeclaration(CompilationResult compilationResult){
30
public ConstructorDeclaration(CompilationResult compilationResult){
Lines 54-60 Link Here
54
	checkUnused: {
53
	checkUnused: {
55
		MethodBinding constructorBinding;
54
		MethodBinding constructorBinding;
56
		if ((constructorBinding = this.binding) == null) break checkUnused;
55
		if ((constructorBinding = this.binding) == null) break checkUnused;
57
		if (this.isDefaultConstructor) break checkUnused;
56
		if ((this.bits & ASTNode.IsDefaultConstructor) != 0) break checkUnused;
58
		if (constructorBinding.isUsed()) break checkUnused;
57
		if (constructorBinding.isUsed()) break checkUnused;
59
		if (constructorBinding.isPrivate()) {
58
		if (constructorBinding.isPrivate()) {
60
			if ((this.binding.declaringClass.tagBits & TagBits.HasNonPrivateConstructor) == 0)
59
			if ((this.binding.declaringClass.tagBits & TagBits.HasNonPrivateConstructor) == 0)
Lines 136-142 Link Here
136
			}
135
			}
137
		}
136
		}
138
		// check for missing returning path
137
		// check for missing returning path
139
		this.needFreeReturn = (flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0;
138
		if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) {
139
			this.bits |= ASTNode.NeedFreeReturn;
140
		}
140
141
141
		// reuse the initial reach mode for diagnosing missing blank finals
142
		// reuse the initial reach mode for diagnosing missing blank finals
142
		flowInfo.setReachMode(initialReachMode);		
143
		flowInfo.setReachMode(initialReachMode);		
Lines 153-159 Link Here
153
					&& (!flowInfo.isDefinitelyAssigned(fields[i]))) {
154
					&& (!flowInfo.isDefinitelyAssigned(fields[i]))) {
154
					this.scope.problemReporter().uninitializedBlankFinalField(
155
					this.scope.problemReporter().uninitializedBlankFinalField(
155
						field,
156
						field,
156
						this.isDefaultConstructor ? (ASTNode) this.scope.referenceType() : this);
157
						((this.bits & ASTNode.IsDefaultConstructor) != 0) ? (ASTNode) this.scope.referenceType() : this);
157
				}
158
				}
158
			}
159
			}
159
		}
160
		}
Lines 319-325 Link Here
319
				this.statements[i].generateCode(this.scope, codeStream);
320
				this.statements[i].generateCode(this.scope, codeStream);
320
			}
321
			}
321
		}
322
		}
322
		if (this.needFreeReturn) {
323
		if ((this.bits & ASTNode.NeedFreeReturn) != 0) {
323
			codeStream.return_();
324
			codeStream.return_();
324
		}
325
		}
325
		// local variable attributes
326
		// local variable attributes
Lines 341-347 Link Here
341
}
342
}
342
343
343
public boolean isDefaultConstructor() {
344
public boolean isDefaultConstructor() {
344
	return this.isDefaultConstructor;
345
	return (this.bits & ASTNode.IsDefaultConstructor) != 0;
345
}
346
}
346
347
347
public boolean isInitializationMethod() {
348
public boolean isInitializationMethod() {
Lines 381-387 Link Here
381
	//fill up the constructor body with its statements
382
	//fill up the constructor body with its statements
382
	if (this.ignoreFurtherInvestigation)
383
	if (this.ignoreFurtherInvestigation)
383
		return;
384
		return;
384
	if (this.isDefaultConstructor && this.constructorCall == null){
385
	if (((this.bits & ASTNode.IsDefaultConstructor) != 0) && this.constructorCall == null){
385
		this.constructorCall = SuperReference.implicitSuperConstructorCall();
386
		this.constructorCall = SuperReference.implicitSuperConstructorCall();
386
		this.constructorCall.sourceStart = this.sourceStart;
387
		this.constructorCall.sourceStart = this.sourceStart;
387
		this.constructorCall.sourceEnd = this.sourceEnd; 
388
		this.constructorCall.sourceEnd = this.sourceEnd; 
Lines 411-417 Link Here
411
public void resolveJavadoc() {
412
public void resolveJavadoc() {
412
	if (this.binding == null || this.javadoc != null) {
413
	if (this.binding == null || this.javadoc != null) {
413
		super.resolveJavadoc();
414
		super.resolveJavadoc();
414
	} else if (!this.isDefaultConstructor) {
415
	} else if ((this.bits & ASTNode.IsDefaultConstructor) == 0) {
415
		this.scope.problemReporter().javadocMissing(this.sourceStart, this.sourceEnd, this.binding.modifiers);
416
		this.scope.problemReporter().javadocMissing(this.sourceStart, this.sourceEnd, this.binding.modifiers);
416
	}
417
	}
417
}
418
}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java (-4 / +2 lines)
Lines 18-31 Link Here
18
import org.eclipse.jdt.internal.compiler.parser.*;
18
import org.eclipse.jdt.internal.compiler.parser.*;
19
19
20
public class Initializer extends FieldDeclaration {
20
public class Initializer extends FieldDeclaration {
21
	
21
22
	public Block block;
22
	public Block block;
23
	public int lastVisibleFieldID;
23
	public int lastVisibleFieldID;
24
	public int bodyStart;
24
	public int bodyStart;
25
	public int bodyEnd;
25
	public int bodyEnd;
26
	
26
27
	public boolean errorInSignature = false; 
28
	
29
	public Initializer(Block block, int modifiers) {
27
	public Initializer(Block block, int modifiers) {
30
		this.block = block;
28
		this.block = block;
31
		this.modifiers = modifiers;
29
		this.modifiers = modifiers;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java (-12 / +11 lines)
Lines 22-28 Link Here
22
public class ParameterizedSingleTypeReference extends ArrayTypeReference {
22
public class ParameterizedSingleTypeReference extends ArrayTypeReference {
23
23
24
	public TypeReference[] typeArguments;
24
	public TypeReference[] typeArguments;
25
	public boolean didResolve = false;
26
	
25
	
27
	public ParameterizedSingleTypeReference(char[] name, TypeReference[] typeArguments, int dim, long pos){
26
	public ParameterizedSingleTypeReference(char[] name, TypeReference[] typeArguments, int dim, long pos){
28
		super(name, dim, pos);
27
		super(name, dim, pos);
Lines 89-115 Link Here
89
88
90
		// handle the error here
89
		// handle the error here
91
		this.constant = Constant.NotAConstant;
90
		this.constant = Constant.NotAConstant;
92
		if (this.didResolve) { // is a shared type reference which was already resolved
91
		if ((this.bits & ASTNode.DidResolve) != 0) { // is a shared type reference which was already resolved
93
			if (this.resolvedType != null && !this.resolvedType.isValidBinding())
92
			if (this.resolvedType != null && !this.resolvedType.isValidBinding())
94
				return null; // already reported error
93
				return null; // already reported error
95
			return this.resolvedType;
94
			return this.resolvedType;
96
		} 
95
		} 
97
	    this.didResolve = true;
96
		this.bits |= ASTNode.DidResolve;
98
		if (enclosingType == null) {
97
		if (enclosingType == null) {
99
			this.resolvedType = scope.getType(token);
98
			this.resolvedType = scope.getType(token);
100
			if (!(this.resolvedType.isValidBinding())) {
99
			if (!(this.resolvedType.isValidBinding())) {
101
				reportInvalidType(scope);
100
				reportInvalidType(scope);
102
				// be resilient, still attempt resolving arguments
101
				// be resilient, still attempt resolving arguments
103
			    boolean isClassScope = scope.kind == Scope.CLASS_SCOPE;
102
				boolean isClassScope = scope.kind == Scope.CLASS_SCOPE;
104
				int argLength = this.typeArguments.length;
103
				int argLength = this.typeArguments.length;
105
				for (int i = 0; i < argLength; i++) {
104
				for (int i = 0; i < argLength; i++) {
106
				    TypeReference typeArgument = this.typeArguments[i];
105
					TypeReference typeArgument = this.typeArguments[i];
107
				    if (isClassScope) {
106
					if (isClassScope) {
108
				    	typeArgument.resolveType((ClassScope) scope);
107
						typeArgument.resolveType((ClassScope) scope);
109
				    } else {
108
					} else {
110
				    	typeArgument.resolveType((BlockScope) scope, checkBounds);
109
						typeArgument.resolveType((BlockScope) scope, checkBounds);
111
				    }
110
					}
112
				}				
111
				}
113
				return null;
112
				return null;
114
			}
113
			}
115
			enclosingType = this.resolvedType.enclosingType(); // if member type
114
			enclosingType = this.resolvedType.enclosingType(); // if member type
Lines 120-126 Link Here
120
					: scope.environment().convertToParameterizedType(enclosingType);
119
					: scope.environment().convertToParameterizedType(enclosingType);
121
			}
120
			}
122
		} else { // resolving member type (relatively to enclosingType)
121
		} else { // resolving member type (relatively to enclosingType)
123
			this.resolvedType = scope.getMemberType(token, enclosingType);		    
122
			this.resolvedType = scope.getMemberType(token, enclosingType);
124
			if (!this.resolvedType.isValidBinding()) {
123
			if (!this.resolvedType.isValidBinding()) {
125
				scope.problemReporter().invalidEnclosingType(this, this.resolvedType, enclosingType);
124
				scope.problemReporter().invalidEnclosingType(this, this.resolvedType, enclosingType);
126
				return null;
125
				return null;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java (-4 / +3 lines)
Lines 15-25 Link Here
15
15
16
16
17
public class JavadocReturnStatement extends ReturnStatement {
17
public class JavadocReturnStatement extends ReturnStatement {
18
	public boolean empty = true;
19
18
20
	public JavadocReturnStatement(int s, int e) {
19
	public JavadocReturnStatement(int s, int e) {
21
		super(null, s, e);
20
		super(null, s, e);
22
		this.bits |= InsideJavadoc;
21
		this.bits |= (ASTNode.InsideJavadoc | ASTNode.Empty);
23
	}
22
	}
24
23
25
	/* (non-Javadoc)
24
	/* (non-Javadoc)
Lines 36-42 Link Here
36
				: TypeBinding.VOID;
35
				: TypeBinding.VOID;
37
		if (methodType == null || methodType == TypeBinding.VOID) {
36
		if (methodType == null || methodType == TypeBinding.VOID) {
38
			scope.problemReporter().javadocUnexpectedTag(this.sourceStart, this.sourceEnd);
37
			scope.problemReporter().javadocUnexpectedTag(this.sourceStart, this.sourceEnd);
39
		} else if (this.empty) {
38
		} else if ((this.bits & ASTNode.Empty) != 0) {
40
			scope.problemReporter().javadocEmptyReturnTag(this.sourceStart, this.sourceEnd, scope.getDeclarationModifiers());
39
			scope.problemReporter().javadocEmptyReturnTag(this.sourceStart, this.sourceEnd, scope.getDeclarationModifiers());
41
		}
40
		}
42
	}
41
	}
Lines 46-52 Link Here
46
	 */
45
	 */
47
	public StringBuffer printStatement(int tab, StringBuffer output) {
46
	public StringBuffer printStatement(int tab, StringBuffer output) {
48
		printIndent(tab, output).append("return"); //$NON-NLS-1$
47
		printIndent(tab, output).append("return"); //$NON-NLS-1$
49
		if (!this.empty)
48
		if ((this.bits & ASTNode.Empty) == 0)
50
			output.append(' ').append(" <not empty>"); //$NON-NLS-1$
49
			output.append(' ').append(" <not empty>"); //$NON-NLS-1$
51
		return output;
50
		return output;
52
	}
51
	}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java (-4 / +1 lines)
Lines 40-46 Link Here
40
	public int explicitDeclarations;
40
	public int explicitDeclarations;
41
	public MethodBinding binding;
41
	public MethodBinding binding;
42
	public boolean ignoreFurtherInvestigation = false;
42
	public boolean ignoreFurtherInvestigation = false;
43
	public boolean needFreeReturn = false;
44
	
43
	
45
	public Javadoc javadoc;
44
	public Javadoc javadoc;
46
	
45
	
Lines 48-55 Link Here
48
	public int bodyEnd = -1;
47
	public int bodyEnd = -1;
49
	public CompilationResult compilationResult;
48
	public CompilationResult compilationResult;
50
	
49
	
51
	public boolean errorInSignature = false; 
52
	
53
	AbstractMethodDeclaration(CompilationResult compilationResult){
50
	AbstractMethodDeclaration(CompilationResult compilationResult){
54
		this.compilationResult = compilationResult;
51
		this.compilationResult = compilationResult;
55
	}
52
	}
Lines 228-234 Link Here
228
				for (int i = 0, max = this.statements.length; i < max; i++)
225
				for (int i = 0, max = this.statements.length; i < max; i++)
229
					this.statements[i].generateCode(this.scope, codeStream);
226
					this.statements[i].generateCode(this.scope, codeStream);
230
			}
227
			}
231
			if (this.needFreeReturn) {
228
			if ((this.bits & ASTNode.NeedFreeReturn) != 0) {
232
				codeStream.return_();
229
				codeStream.return_();
233
			}
230
			}
234
			// local variable attributes
231
			// local variable attributes
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java (-7 / +8 lines)
Lines 25-32 Link Here
25
	public Statement action;
25
	public Statement action;
26
26
27
	//when there is no local declaration, there is no need of a new scope
27
	//when there is no local declaration, there is no need of a new scope
28
	//scope is positionned either to a new scope, or to the "upper"scope (see resolveType)
28
	//scope is positioned either to a new scope, or to the "upper"scope (see resolveType)
29
	public boolean neededScope;
30
	public BlockScope scope;
29
	public BlockScope scope;
31
30
32
	private BranchLabel breakLabel, continueLabel;
31
	private BranchLabel breakLabel, continueLabel;
Lines 53-60 Link Here
53
		this.increments = increments;
52
		this.increments = increments;
54
		this.action = action;
53
		this.action = action;
55
		// remember useful empty statement
54
		// remember useful empty statement
56
		if (action instanceof EmptyStatement) action.bits |= IsUsefulEmptyStatement;
55
		if (action instanceof EmptyStatement) action.bits |= ASTNode.IsUsefulEmptyStatement;
57
		this.neededScope = neededScope;
56
		if (neededScope) {
57
			this.bits |= ASTNode.NeededScope;
58
		}
58
	}
59
	}
59
60
60
	public FlowInfo analyseCode(
61
	public FlowInfo analyseCode(
Lines 232-238 Link Here
232
		if (isConditionOptimizedFalse) {
233
		if (isConditionOptimizedFalse) {
233
			condition.generateCode(scope, codeStream, false);
234
			condition.generateCode(scope, codeStream, false);
234
			// May loose some local variable initializations : affecting the local variable attributes
235
			// May loose some local variable initializations : affecting the local variable attributes
235
			if (neededScope) {
236
			if ((this.bits & ASTNode.NeededScope) != 0) {
236
				codeStream.exitUserScope(scope);
237
				codeStream.exitUserScope(scope);
237
			}
238
			}
238
			if (mergedInitStateIndex != -1) {
239
			if (mergedInitStateIndex != -1) {
Lines 314-320 Link Here
314
315
315
316
316
		// May loose some local variable initializations : affecting the local variable attributes
317
		// May loose some local variable initializations : affecting the local variable attributes
317
		if (neededScope) {
318
		if ((this.bits & ASTNode.NeededScope) != 0) {
318
			codeStream.exitUserScope(scope);
319
			codeStream.exitUserScope(scope);
319
		}
320
		}
320
		if (mergedInitStateIndex != -1) {
321
		if (mergedInitStateIndex != -1) {
Lines 361-367 Link Here
361
	public void resolve(BlockScope upperScope) {
362
	public void resolve(BlockScope upperScope) {
362
363
363
		// use the scope that will hold the init declarations
364
		// use the scope that will hold the init declarations
364
		scope = neededScope ? new BlockScope(upperScope) : upperScope;
365
		scope = (this.bits & ASTNode.NeededScope) != 0 ? new BlockScope(upperScope) : upperScope;
365
		if (initializations != null)
366
		if (initializations != null)
366
			for (int i = 0, length = initializations.length; i < length; i++)
367
			for (int i = 0, length = initializations.length; i < length; i++)
367
				initializations[i].resolve(scope);
368
				initializations[i].resolve(scope);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java (-4 / +5 lines)
Lines 22-28 Link Here
22
	public Expression expression;
22
	public Expression expression;
23
	public Block block;
23
	public Block block;
24
	public BlockScope scope;
24
	public BlockScope scope;
25
	boolean blockExit;
26
	public LocalVariableBinding synchroVariable;
25
	public LocalVariableBinding synchroVariable;
27
	static final char[] SecretLocalDeclarationName = " syncValue".toCharArray(); //$NON-NLS-1$
26
	static final char[] SecretLocalDeclarationName = " syncValue".toCharArray(); //$NON-NLS-1$
28
27
Lines 65-71 Link Here
65
		currentScope.methodScope().recordInitializationStates(flowInfo);
64
		currentScope.methodScope().recordInitializationStates(flowInfo);
66
65
67
	// optimizing code gen
66
	// optimizing code gen
68
	this.blockExit = (flowInfo.tagBits & FlowInfo.UNREACHABLE) != 0;
67
	if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) != 0) {
68
		this.bits |= ASTNode.BlockExit;
69
	}
69
70
70
	return flowInfo;
71
	return flowInfo;
71
}
72
}
Lines 119-125 Link Here
119
		}
120
		}
120
121
121
		BranchLabel endLabel = new BranchLabel(codeStream);
122
		BranchLabel endLabel = new BranchLabel(codeStream);
122
		if (!blockExit) {
123
		if ((this.bits & ASTNode.BlockExit) == 0) {
123
			codeStream.load(synchroVariable);
124
			codeStream.load(synchroVariable);
124
			codeStream.monitorexit();
125
			codeStream.monitorexit();
125
			this.exitAnyExceptionHandler();
126
			this.exitAnyExceptionHandler();
Lines 144-150 Link Here
144
		if (scope != currentScope) {
145
		if (scope != currentScope) {
145
			codeStream.removeVariable(this.synchroVariable);
146
			codeStream.removeVariable(this.synchroVariable);
146
		}
147
		}
147
		if (!blockExit) {
148
		if ((this.bits & ASTNode.BlockExit) == 0) {
148
			endLabel.place();
149
			endLabel.place();
149
		}
150
		}
150
	}
151
	}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java (-1 / +1 lines)
Lines 163-169 Link Here
163
			for (int i = 0, max = this.scope.imports.length; i < max; i++){
163
			for (int i = 0, max = this.scope.imports.length; i < max; i++){
164
				ImportBinding importBinding = this.scope.imports[i];
164
				ImportBinding importBinding = this.scope.imports[i];
165
				ImportReference importReference = importBinding.reference;
165
				ImportReference importReference = importBinding.reference;
166
				if (importReference != null && !importReference.used){
166
				if (importReference != null && ((importReference.bits & ASTNode.Used) == 0)){
167
					scope.problemReporter().unusedImport(importReference);
167
					scope.problemReporter().unusedImport(importReference);
168
				}
168
				}
169
			}
169
			}
(-)search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java (-1 / +1 lines)
Lines 95-101 Link Here
95
			// With static import, we can have static method reference in import reference
95
			// With static import, we can have static method reference in import reference
96
			ImportReference importRef = (ImportReference) node;
96
			ImportReference importRef = (ImportReference) node;
97
			int length = importRef.tokens.length-1;
97
			int length = importRef.tokens.length-1;
98
			if (importRef.isStatic() && !importRef.onDemand && matchesName(this.pattern.selector, importRef.tokens[length])) {
98
			if (importRef.isStatic() && ((importRef.bits & ASTNode.OnDemand) == 0) && matchesName(this.pattern.selector, importRef.tokens[length])) {
99
				char[][] compoundName = new char[length][];
99
				char[][] compoundName = new char[length][];
100
				System.arraycopy(importRef.tokens, 0, compoundName, 0, length);
100
				System.arraycopy(importRef.tokens, 0, compoundName, 0, length);
101
				char[] declaringType = CharOperation.concat(pattern.declaringQualification, pattern.declaringSimpleName, '.');
101
				char[] declaringType = CharOperation.concat(pattern.declaringQualification, pattern.declaringSimpleName, '.');
(-)search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java (-2 / +2 lines)
Lines 207-216 Link Here
207
		typeBinding = (ReferenceBinding) binding;
207
		typeBinding = (ReferenceBinding) binding;
208
	} else if (binding instanceof FieldBinding) { // may happen for static import
208
	} else if (binding instanceof FieldBinding) { // may happen for static import
209
		typeBinding = ((FieldBinding)binding).declaringClass;
209
		typeBinding = ((FieldBinding)binding).declaringClass;
210
		lastButOne = importRef.isStatic() && !importRef.onDemand;
210
		lastButOne = importRef.isStatic() && ((importRef.bits & ASTNode.OnDemand) == 0);
211
	} else if (binding instanceof MethodBinding) { // may happen for static import
211
	} else if (binding instanceof MethodBinding) { // may happen for static import
212
		typeBinding = ((MethodBinding)binding).declaringClass;
212
		typeBinding = ((MethodBinding)binding).declaringClass;
213
		lastButOne = importRef.isStatic() && !importRef.onDemand;
213
		lastButOne = importRef.isStatic() && ((importRef.bits & ASTNode.OnDemand) == 0);
214
	}
214
	}
215
	if (typeBinding != null) {
215
	if (typeBinding != null) {
216
		int lastIndex = importRef.tokens.length - 1;
216
		int lastIndex = importRef.tokens.length - 1;
(-)search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java (-1 / +1 lines)
Lines 37-43 Link Here
37
			// With static import, we can have static field reference in import reference
37
			// With static import, we can have static field reference in import reference
38
			ImportReference importRef = (ImportReference) node;
38
			ImportReference importRef = (ImportReference) node;
39
			int length = importRef.tokens.length-1;
39
			int length = importRef.tokens.length-1;
40
			if (importRef.isStatic() && !importRef.onDemand && matchesName(this.pattern.name, importRef.tokens[length])) {
40
			if (importRef.isStatic() && ((importRef.bits & ASTNode.OnDemand) == 0) && matchesName(this.pattern.name, importRef.tokens[length])) {
41
				char[][] compoundName = new char[length][];
41
				char[][] compoundName = new char[length][];
42
				System.arraycopy(importRef.tokens, 0, compoundName, 0, length);
42
				System.arraycopy(importRef.tokens, 0, compoundName, 0, length);
43
				FieldPattern fieldPattern = (FieldPattern) this.pattern;
43
				FieldPattern fieldPattern = (FieldPattern) this.pattern;
(-)search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java (-2 / +2 lines)
Lines 673-679 Link Here
673
 */
673
 */
674
protected IJavaElement createImportHandle(ImportReference importRef) {
674
protected IJavaElement createImportHandle(ImportReference importRef) {
675
	char[] importName = CharOperation.concatWith(importRef.getImportName(), '.');
675
	char[] importName = CharOperation.concatWith(importRef.getImportName(), '.');
676
	if (importRef.onDemand)
676
	if ((importRef.bits & ASTNode.OnDemand) != 0)
677
		importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$
677
		importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$
678
	Openable openable = this.currentPossibleMatch.openable;
678
	Openable openable = this.currentPossibleMatch.openable;
679
	if (openable instanceof CompilationUnit)
679
	if (openable instanceof CompilationUnit)
Lines 2131-2137 Link Here
2131
				if (this.hierarchyResolver != null) continue;
2131
				if (this.hierarchyResolver != null) continue;
2132
2132
2133
				ImportReference importRef = (ImportReference) node;
2133
				ImportReference importRef = (ImportReference) node;
2134
				Binding binding = importRef.onDemand
2134
				Binding binding = (importRef.bits & ASTNode.OnDemand) != 0
2135
					? unitScope.getImport(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length), true, importRef.isStatic())
2135
					? unitScope.getImport(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length), true, importRef.isStatic())
2136
					: unitScope.getImport(importRef.tokens, false, importRef.isStatic());
2136
					: unitScope.getImport(importRef.tokens, false, importRef.isStatic());
2137
				this.patternLocator.matchLevelAndReportImportRef(importRef, binding, this);
2137
				this.patternLocator.matchLevelAndReportImportRef(importRef, binding, this);
(-)search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java (-1 / +1 lines)
Lines 177-183 Link Here
177
	if (reference instanceof ImportReference) {
177
	if (reference instanceof ImportReference) {
178
		ImportReference importRef = (ImportReference) reference;
178
		ImportReference importRef = (ImportReference) reference;
179
		positions = importRef.sourcePositions;
179
		positions = importRef.sourcePositions;
180
		last = importRef.onDemand ? positions.length : positions.length - 1;
180
		last = (importRef.bits & ASTNode.OnDemand) != 0 ? positions.length : positions.length - 1;
181
	} else {
181
	} else {
182
		TypeBinding typeBinding = null;
182
		TypeBinding typeBinding = null;
183
		if (reference instanceof QualifiedNameReference) {
183
		if (reference instanceof QualifiedNameReference) {
(-)compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (-3 / +3 lines)
Lines 9929-9935 Link Here
9929
protected void reportSyntaxErrors(boolean isDietParse, int oldFirstToken) {
9929
protected void reportSyntaxErrors(boolean isDietParse, int oldFirstToken) {
9930
	if(this.referenceContext instanceof MethodDeclaration) {
9930
	if(this.referenceContext instanceof MethodDeclaration) {
9931
		MethodDeclaration methodDeclaration = (MethodDeclaration) this.referenceContext;
9931
		MethodDeclaration methodDeclaration = (MethodDeclaration) this.referenceContext;
9932
		if(methodDeclaration.errorInSignature){
9932
		if((methodDeclaration.bits & ASTNode.ErrorInSignature) != 0){
9933
			return;
9933
			return;
9934
		}
9934
		}
9935
	}
9935
	}
Lines 9963-9969 Link Here
9963
			if(methods != null) {
9963
			if(methods != null) {
9964
				for (int j = 0; j < methods.length; j++) {
9964
				for (int j = 0; j < methods.length; j++) {
9965
					AbstractMethodDeclaration method = methods[j];
9965
					AbstractMethodDeclaration method = methods[j];
9966
					if(method.errorInSignature) {
9966
					if((method.bits & ASTNode.ErrorInSignature) != 0) {
9967
						if(method.isAnnotationMethod()) {
9967
						if(method.isAnnotationMethod()) {
9968
							DiagnoseParser diagnoseParser = new DiagnoseParser(this, TokenNameQUESTION, method.declarationSourceStart, method.declarationSourceEnd, this.options);
9968
							DiagnoseParser diagnoseParser = new DiagnoseParser(this, TokenNameQUESTION, method.declarationSourceStart, method.declarationSourceEnd, this.options);
9969
							diagnoseParser.diagnoseParse(this.options.performStatementsRecovery);
9969
							diagnoseParser.diagnoseParse(this.options.performStatementsRecovery);
Lines 9982-9988 Link Here
9982
				for (int j = 0; j < length; j++) {
9982
				for (int j = 0; j < length; j++) {
9983
					if (fields[j] instanceof Initializer) {
9983
					if (fields[j] instanceof Initializer) {
9984
						Initializer initializer = (Initializer)fields[j];
9984
						Initializer initializer = (Initializer)fields[j];
9985
						if(initializer.errorInSignature){
9985
						if((initializer.bits & ASTNode.ErrorInSignature) != 0){
9986
							DiagnoseParser diagnoseParser = new DiagnoseParser(this, TokenNameRIGHT_SHIFT, initializer.declarationSourceStart, initializer.declarationSourceEnd, this.options);
9986
							DiagnoseParser diagnoseParser = new DiagnoseParser(this, TokenNameRIGHT_SHIFT, initializer.declarationSourceStart, initializer.declarationSourceEnd, this.options);
9987
							diagnoseParser.diagnoseParse(this.options.performStatementsRecovery);
9987
							diagnoseParser.diagnoseParse(this.options.performStatementsRecovery);
9988
						}
9988
						}
(-)compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java (-1 / +1 lines)
Lines 726-732 Link Here
726
	 * Refresh return statement
726
	 * Refresh return statement
727
	 */
727
	 */
728
	protected void refreshReturnStatement() {
728
	protected void refreshReturnStatement() {
729
		((JavadocReturnStatement) this.returnStatement).empty = false;
729
		((JavadocReturnStatement) this.returnStatement).bits &= ~ASTNode.Empty;
730
	}
730
	}
731
731
732
	public String toString() {
732
	public String toString() {
(-)eval/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.java (-2 / +3 lines)
Lines 12-17 Link Here
12
12
13
import org.eclipse.jdt.internal.compiler.ClassFile;
13
import org.eclipse.jdt.internal.compiler.ClassFile;
14
import org.eclipse.jdt.internal.compiler.CompilationResult;
14
import org.eclipse.jdt.internal.compiler.CompilationResult;
15
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
15
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
16
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
16
import org.eclipse.jdt.internal.compiler.problem.AbortType;
17
import org.eclipse.jdt.internal.compiler.problem.AbortType;
17
18
Lines 25-32 Link Here
25
 * Generic bytecode generation for type
26
 * Generic bytecode generation for type
26
 */
27
 */
27
public void generateCode(ClassFile enclosingClassFile) {
28
public void generateCode(ClassFile enclosingClassFile) {
28
	if (this.hasBeenGenerated) return;
29
	if ((this.bits & ASTNode.HasBeenGenerated) != 0) return;
29
	this.hasBeenGenerated = true;
30
	this.bits |= ASTNode.HasBeenGenerated;
30
	
31
	
31
	if (this.ignoreFurtherInvestigation) {
32
	if (this.ignoreFurtherInvestigation) {
32
		if (this.binding == null)
33
		if (this.binding == null)
(-)dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java (-3 / +3 lines)
Lines 728-734 Link Here
728
			if (node instanceof ImportReference) {
728
			if (node instanceof ImportReference) {
729
				ImportReference importReference = (ImportReference) node;
729
				ImportReference importReference = (ImportReference) node;
730
				final boolean isStatic = importReference.isStatic();
730
				final boolean isStatic = importReference.isStatic();
731
				if (importReference.onDemand) {
731
				if ((importReference.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.OnDemand) != 0) {
732
					Binding binding = this.scope.getImport(CharOperation.subarray(importReference.tokens, 0, importReference.tokens.length), true, isStatic);
732
					Binding binding = this.scope.getImport(CharOperation.subarray(importReference.tokens, 0, importReference.tokens.length), true, isStatic);
733
					if (binding != null) {
733
					if (binding != null) {
734
						if (isStatic) {
734
						if (isStatic) {
Lines 969-975 Link Here
969
				if (this.scope == null) return null;
969
				if (this.scope == null) return null;
970
				if (importReferenceLength == index) {
970
				if (importReferenceLength == index) {
971
					try {
971
					try {
972
						binding = this.scope.getImport(CharOperation.subarray(importReference.tokens, 0, index), importReference.onDemand, importReference.isStatic());
972
						binding = this.scope.getImport(CharOperation.subarray(importReference.tokens, 0, index), (importReference.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.OnDemand) != 0, importReference.isStatic());
973
					} catch (AbortCompilation e) {
973
					} catch (AbortCompilation e) {
974
						// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53357
974
						// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53357
975
					}
975
					}
Lines 1177-1183 Link Here
1177
				if (this.scope == null) return null;
1177
				if (this.scope == null) return null;
1178
				if (importReferenceLength == index) {
1178
				if (importReferenceLength == index) {
1179
					try {
1179
					try {
1180
						binding = this.scope.getImport(CharOperation.subarray(importReference.tokens, 0, index), importReference.onDemand, importReference.isStatic());
1180
						binding = this.scope.getImport(CharOperation.subarray(importReference.tokens, 0, index), (importReference.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.OnDemand) != 0, importReference.isStatic());
1181
					} catch (AbortCompilation e) {
1181
					} catch (AbortCompilation e) {
1182
						// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53357
1182
						// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53357
1183
					}
1183
					}
(-)dom/org/eclipse/jdt/core/dom/ASTConverter.java (-1 / +1 lines)
Lines 2757-2763 Link Here
2757
	
2757
	
2758
	public ImportDeclaration convertImport(org.eclipse.jdt.internal.compiler.ast.ImportReference importReference) {
2758
	public ImportDeclaration convertImport(org.eclipse.jdt.internal.compiler.ast.ImportReference importReference) {
2759
		final ImportDeclaration importDeclaration = new ImportDeclaration(this.ast);
2759
		final ImportDeclaration importDeclaration = new ImportDeclaration(this.ast);
2760
		final boolean onDemand = importReference.onDemand;
2760
		final boolean onDemand = (importReference.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.OnDemand) != 0;
2761
		final char[][] tokens = importReference.tokens;
2761
		final char[][] tokens = importReference.tokens;
2762
		int length = importReference.tokens.length;
2762
		int length = importReference.tokens.length;
2763
		final long[] positions = importReference.sourcePositions;
2763
		final long[] positions = importReference.sourcePositions;
(-)codeassist/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java (-2 / +2 lines)
Lines 59-70 Link Here
59
		
59
		
60
		private void cleanUp(ParameterizedSingleTypeReference typeReference) {
60
		private void cleanUp(ParameterizedSingleTypeReference typeReference) {
61
			this.cleanUp((TypeReference)typeReference);
61
			this.cleanUp((TypeReference)typeReference);
62
			typeReference.didResolve = false;
62
			typeReference.bits &= ~ASTNode.DidResolve;
63
		}
63
		}
64
		
64
		
65
		private void cleanUp(ParameterizedQualifiedTypeReference typeReference) {
65
		private void cleanUp(ParameterizedQualifiedTypeReference typeReference) {
66
			this.cleanUp((TypeReference)typeReference);
66
			this.cleanUp((TypeReference)typeReference);
67
			typeReference.didResolve = false;
67
			typeReference.bits &= ~ASTNode.DidResolve;
68
		}
68
		}
69
		
69
		
70
		public void cleanUp(TypeReference convertedType, BlockScope scope) {
70
		public void cleanUp(TypeReference convertedType, BlockScope scope) {
(-)codeassist/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.java (-2 / +2 lines)
Lines 296-302 Link Here
296
	}
296
	}
297
	
297
	
298
	public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope classScope) {
298
	public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope classScope) {
299
		if (!constructorDeclaration.isDefaultConstructor && !constructorDeclaration.isClinit()) {
299
		if (((constructorDeclaration.bits & ASTNode.IsDefaultConstructor) == 0) && !constructorDeclaration.isClinit()) {
300
			removeLocals(
300
			removeLocals(
301
					constructorDeclaration.arguments,
301
					constructorDeclaration.arguments,
302
					constructorDeclaration.declarationSourceStart,
302
					constructorDeclaration.declarationSourceStart,
Lines 358-364 Link Here
358
	}
358
	}
359
	
359
	
360
	public void endVisit(ConstructorDeclaration constructorDeclaration, ClassScope classScope) {
360
	public void endVisit(ConstructorDeclaration constructorDeclaration, ClassScope classScope) {
361
		if (!constructorDeclaration.isDefaultConstructor && !constructorDeclaration.isClinit()) {
361
		if (((constructorDeclaration.bits & ASTNode.IsDefaultConstructor) == 0) && !constructorDeclaration.isClinit()) {
362
			endVisitPreserved(constructorDeclaration.bodyStart, constructorDeclaration.bodyEnd);
362
			endVisitPreserved(constructorDeclaration.bodyStart, constructorDeclaration.bodyEnd);
363
		}
363
		}
364
		popParent();
364
		popParent();
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-1 / +1 lines)
Lines 7537-7543 Link Here
7537
				
7537
				
7538
				if (CharOperation.equals(f.tokens, compoundName)) continue next;
7538
				if (CharOperation.equals(f.tokens, compoundName)) continue next;
7539
				
7539
				
7540
				if (!onDemand && !f.onDemand) {
7540
				if (!onDemand && ((f.bits & ASTNode.OnDemand) == 0)) {
7541
					if (CharOperation.equals(f.tokens[f.tokens.length - 1], compoundName[compoundName.length - 1]))
7541
					if (CharOperation.equals(f.tokens[f.tokens.length - 1], compoundName[compoundName.length - 1]))
7542
						continue next;
7542
						continue next;
7543
				}
7543
				}
(-)codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java (-2 / +2 lines)
Lines 679-685 Link Here
679
679
680
	/* build specific assist node on import statement */
680
	/* build specific assist node on import statement */
681
	ImportReference reference = this.createAssistImportReference(subset, positions, ClassFileConstants.AccStatic);
681
	ImportReference reference = this.createAssistImportReference(subset, positions, ClassFileConstants.AccStatic);
682
	reference.onDemand = true;
682
	reference.bits |= ASTNode.OnDemand;
683
	assistNode = reference;
683
	assistNode = reference;
684
	this.lastCheckPoint = reference.sourceEnd + 1;
684
	this.lastCheckPoint = reference.sourceEnd + 1;
685
685
Lines 785-791 Link Here
785
785
786
	/* build specific assist node on import statement */
786
	/* build specific assist node on import statement */
787
	ImportReference reference = this.createAssistImportReference(subset, positions, ClassFileConstants.AccDefault);
787
	ImportReference reference = this.createAssistImportReference(subset, positions, ClassFileConstants.AccDefault);
788
	reference.onDemand = true;
788
	reference.bits |= ASTNode.OnDemand;
789
	assistNode = reference;
789
	assistNode = reference;
790
	this.lastCheckPoint = reference.sourceEnd + 1;
790
	this.lastCheckPoint = reference.sourceEnd + 1;
791
791
(-)model/org/eclipse/jdt/internal/compiler/SourceElementParser.java (-1 / +1 lines)
Lines 1323-1329 Link Here
1323
			importReference.declarationSourceStart, 
1323
			importReference.declarationSourceStart, 
1324
			importReference.declarationSourceEnd, 
1324
			importReference.declarationSourceEnd, 
1325
			importReference.tokens, 
1325
			importReference.tokens, 
1326
			importReference.onDemand,
1326
			(importReference.bits & ASTNode.OnDemand) != 0,
1327
			importReference.modifiers); 
1327
			importReference.modifiers); 
1328
	}
1328
	}
1329
}
1329
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java (-7 / +7 lines)
Lines 154-160 Link Here
154
	int numberOfImports = numberOfStatements + 1;
154
	int numberOfImports = numberOfStatements + 1;
155
	for (int i = 0; i < numberOfStatements; i++) {
155
	for (int i = 0; i < numberOfStatements; i++) {
156
		ImportReference importReference = referenceContext.imports[i];
156
		ImportReference importReference = referenceContext.imports[i];
157
		if (importReference.onDemand && CharOperation.equals(JAVA_LANG, importReference.tokens) && !importReference.isStatic()) {
157
		if (((importReference.bits & ASTNode.OnDemand) != 0) && CharOperation.equals(JAVA_LANG, importReference.tokens) && !importReference.isStatic()) {
158
			numberOfImports--;
158
			numberOfImports--;
159
			break;
159
			break;
160
		}
160
		}
Lines 170-181 Link Here
170
		// skip duplicates or imports of the current package
170
		// skip duplicates or imports of the current package
171
		for (int j = 0; j < index; j++) {
171
		for (int j = 0; j < index; j++) {
172
			ImportBinding resolved = resolvedImports[j];
172
			ImportBinding resolved = resolvedImports[j];
173
			if (resolved.onDemand == importReference.onDemand && resolved.isStatic() == importReference.isStatic())
173
			if (resolved.onDemand == ((importReference.bits & ASTNode.OnDemand) != 0) && resolved.isStatic() == importReference.isStatic())
174
				if (CharOperation.equals(compoundName, resolvedImports[j].compoundName))
174
				if (CharOperation.equals(compoundName, resolvedImports[j].compoundName))
175
					continue nextImport;
175
					continue nextImport;
176
		}
176
		}
177
177
178
		if (importReference.onDemand) {
178
		if ((importReference.bits & ASTNode.OnDemand) != 0) {
179
			if (CharOperation.equals(compoundName, currentPackageName))
179
			if (CharOperation.equals(compoundName, currentPackageName))
180
				continue nextImport;
180
				continue nextImport;
181
181
Lines 299-305 Link Here
299
	int numberOfStatements = referenceContext.imports.length;
299
	int numberOfStatements = referenceContext.imports.length;
300
	HashtableOfType typesBySimpleNames = null;
300
	HashtableOfType typesBySimpleNames = null;
301
	for (int i = 0; i < numberOfStatements; i++) {
301
	for (int i = 0; i < numberOfStatements; i++) {
302
		if (!referenceContext.imports[i].onDemand) {
302
		if ((referenceContext.imports[i].bits & ASTNode.OnDemand) == 0) {
303
			typesBySimpleNames = new HashtableOfType(topLevelTypes.length + numberOfStatements);
303
			typesBySimpleNames = new HashtableOfType(topLevelTypes.length + numberOfStatements);
304
			for (int j = 0, length = topLevelTypes.length; j < length; j++)
304
			for (int j = 0, length = topLevelTypes.length; j < length; j++)
305
				typesBySimpleNames.put(topLevelTypes[j].sourceName, topLevelTypes[j]);
305
				typesBySimpleNames.put(topLevelTypes[j].sourceName, topLevelTypes[j]);
Lines 311-317 Link Here
311
	int numberOfImports = numberOfStatements + 1;
311
	int numberOfImports = numberOfStatements + 1;
312
	for (int i = 0; i < numberOfStatements; i++) {
312
	for (int i = 0; i < numberOfStatements; i++) {
313
		ImportReference importReference = referenceContext.imports[i];
313
		ImportReference importReference = referenceContext.imports[i];
314
		if (importReference.onDemand && CharOperation.equals(JAVA_LANG, importReference.tokens) && !importReference.isStatic()) {
314
		if (((importReference.bits & ASTNode.OnDemand) != 0) && CharOperation.equals(JAVA_LANG, importReference.tokens) && !importReference.isStatic()) {
315
			numberOfImports--;
315
			numberOfImports--;
316
			break;
316
			break;
317
		}
317
		}
Lines 330-343 Link Here
330
		// skip duplicates or imports of the current package
330
		// skip duplicates or imports of the current package
331
		for (int j = 0; j < index; j++) {
331
		for (int j = 0; j < index; j++) {
332
			ImportBinding resolved = resolvedImports[j];
332
			ImportBinding resolved = resolvedImports[j];
333
			if (resolved.onDemand == importReference.onDemand && resolved.isStatic() == importReference.isStatic()) {
333
			if (resolved.onDemand == ((importReference.bits & ASTNode.OnDemand) != 0) && resolved.isStatic() == importReference.isStatic()) {
334
				if (CharOperation.equals(compoundName, resolved.compoundName)) {
334
				if (CharOperation.equals(compoundName, resolved.compoundName)) {
335
					problemReporter().unusedImport(importReference); // since skipped, must be reported now
335
					problemReporter().unusedImport(importReference); // since skipped, must be reported now
336
					continue nextImport;
336
					continue nextImport;
337
				}
337
				}
338
			}
338
			}
339
		}
339
		}
340
		if (importReference.onDemand) {
340
		if ((importReference.bits & ASTNode.OnDemand) != 0) {
341
			if (CharOperation.equals(compoundName, currentPackageName)) {
341
			if (CharOperation.equals(compoundName, currentPackageName)) {
342
				problemReporter().unusedImport(importReference); // since skipped, must be reported now
342
				problemReporter().unusedImport(importReference); // since skipped, must be reported now
343
				continue nextImport;
343
				continue nextImport;
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java (-2 / +2 lines)
Lines 67-73 Link Here
67
		if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0)
67
		if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0)
68
			problemReporter().duplicateModifierForMethod(declaringClass, (AbstractMethodDeclaration) referenceContext);
68
			problemReporter().duplicateModifierForMethod(declaringClass, (AbstractMethodDeclaration) referenceContext);
69
69
70
		if (((ConstructorDeclaration) referenceContext).isDefaultConstructor) {
70
		if ((((ConstructorDeclaration) referenceContext).bits & ASTNode.IsDefaultConstructor) != 0) {
71
			// certain flags are propagated from declaring class onto constructor
71
			// certain flags are propagated from declaring class onto constructor
72
			final int DECLARING_FLAGS = ClassFileConstants.AccEnum|ClassFileConstants.AccPublic|ClassFileConstants.AccProtected;
72
			final int DECLARING_FLAGS = ClassFileConstants.AccEnum|ClassFileConstants.AccPublic|ClassFileConstants.AccProtected;
73
			final int VISIBILITY_FLAGS = ClassFileConstants.AccPrivate|ClassFileConstants.AccPublic|ClassFileConstants.AccProtected;
73
			final int VISIBILITY_FLAGS = ClassFileConstants.AccPrivate|ClassFileConstants.AccPublic|ClassFileConstants.AccProtected;
Lines 88-94 Link Here
88
88
89
		// check for abnormal modifiers
89
		// check for abnormal modifiers
90
		final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStrictfp);
90
		final int UNEXPECTED_MODIFIERS = ~(ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected | ClassFileConstants.AccStrictfp);
91
		if (declaringClass.isEnum() && !((ConstructorDeclaration) referenceContext).isDefaultConstructor) {
91
		if (declaringClass.isEnum() && (((ConstructorDeclaration) referenceContext).bits & ASTNode.IsDefaultConstructor) == 0) {
92
			final int UNEXPECTED_ENUM_CONSTR_MODIFIERS = ~(ClassFileConstants.AccPrivate | ClassFileConstants.AccStrictfp);
92
			final int UNEXPECTED_ENUM_CONSTR_MODIFIERS = ~(ClassFileConstants.AccPrivate | ClassFileConstants.AccStrictfp);
93
			if ((realModifiers & UNEXPECTED_ENUM_CONSTR_MODIFIERS) != 0) {
93
			if ((realModifiers & UNEXPECTED_ENUM_CONSTR_MODIFIERS) != 0) {
94
				problemReporter().illegalModifierForEnumConstructor((AbstractMethodDeclaration) referenceContext);
94
				problemReporter().illegalModifierForEnumConstructor((AbstractMethodDeclaration) referenceContext);
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-6 / +16 lines)
Lines 1540-1546 Link Here
1540
									if (unitScope.resolveSingleImport(importBinding) != null && importBinding.resolvedImport instanceof FieldBinding) {
1540
									if (unitScope.resolveSingleImport(importBinding) != null && importBinding.resolvedImport instanceof FieldBinding) {
1541
										foundField = (FieldBinding) importBinding.resolvedImport;
1541
										foundField = (FieldBinding) importBinding.resolvedImport;
1542
										ImportReference importReference = importBinding.reference;
1542
										ImportReference importReference = importBinding.reference;
1543
										if (importReference != null && needResolve) importReference.used = true;
1543
										if (importReference != null && needResolve) {
1544
											importReference.bits |= ASTNode.Used;
1545
										}
1544
										invocationSite.setActualReceiverType(foundField.declaringClass);											
1546
										invocationSite.setActualReceiverType(foundField.declaringClass);											
1545
										if (foundField.isValidBinding()) {
1547
										if (foundField.isValidBinding()) {
1546
											return foundField;
1548
											return foundField;
Lines 1566-1572 Link Here
1566
										} else if (temp.isStatic()) {
1568
										} else if (temp.isStatic()) {
1567
											if (foundField == temp) continue;
1569
											if (foundField == temp) continue;
1568
											ImportReference importReference = importBinding.reference;
1570
											ImportReference importReference = importBinding.reference;
1569
											if (importReference != null && needResolve) importReference.used = true;
1571
											if (importReference != null && needResolve) {
1572
												importReference.bits |= ASTNode.Used;
1573
											}
1570
											if (foundInImport)
1574
											if (foundInImport)
1571
												// Answer error binding -- import on demand conflict; name found in two import on demand packages.
1575
												// Answer error binding -- import on demand conflict; name found in two import on demand packages.
1572
												return new ProblemReferenceBinding(name, null, ProblemReasons.Ambiguous);
1576
												return new ProblemReferenceBinding(name, null, ProblemReasons.Ambiguous);
Lines 1916-1922 Link Here
1916
										if (compatibleMethod.canBeSeenBy(unitScope.fPackage)) {
1920
										if (compatibleMethod.canBeSeenBy(unitScope.fPackage)) {
1917
											if (visible == null || !visible.contains(compatibleMethod)) {
1921
											if (visible == null || !visible.contains(compatibleMethod)) {
1918
												ImportReference importReference = importBinding.reference;
1922
												ImportReference importReference = importBinding.reference;
1919
												if (importReference != null) importReference.used = true;
1923
												if (importReference != null) {
1924
													importReference.bits |= ASTNode.Used;
1925
												}
1920
												if (!skipOnDemand && !importBinding.onDemand) {
1926
												if (!skipOnDemand && !importBinding.onDemand) {
1921
													visible = null; // forget previous matches from on demand imports
1927
													visible = null; // forget previous matches from on demand imports
1922
													skipOnDemand = true;
1928
													skipOnDemand = true;
Lines 2333-2339 Link Here
2333
			if (binding != null) { // can also include NotFound ProblemReferenceBindings if we already know this name is not found
2339
			if (binding != null) { // can also include NotFound ProblemReferenceBindings if we already know this name is not found
2334
				if (binding instanceof ImportBinding) { // single type import cached in faultInImports(), replace it in the cache with the type
2340
				if (binding instanceof ImportBinding) { // single type import cached in faultInImports(), replace it in the cache with the type
2335
					ImportReference importReference = ((ImportBinding) binding).reference;
2341
					ImportReference importReference = ((ImportBinding) binding).reference;
2336
					if (importReference != null) importReference.used = true;
2342
					if (importReference != null) {
2343
						importReference.bits |= ASTNode.Used;
2344
					}
2337
					if (binding instanceof ImportConflictBinding)
2345
					if (binding instanceof ImportConflictBinding)
2338
						typeOrPackageCache.put(name, binding = ((ImportConflictBinding) binding).conflictingTypeBinding); // already know its visible
2346
						typeOrPackageCache.put(name, binding = ((ImportConflictBinding) binding).conflictingTypeBinding); // already know its visible
2339
					else
2347
					else
Lines 2367-2373 Link Here
2367
							if (resolvedImport instanceof TypeBinding) {
2375
							if (resolvedImport instanceof TypeBinding) {
2368
								ImportReference importReference = importBinding.reference;
2376
								ImportReference importReference = importBinding.reference;
2369
								if (importReference != null)
2377
								if (importReference != null)
2370
									importReference.used = true;
2378
									importReference.bits |= ASTNode.Used;
2371
								return resolvedImport; // already know its visible
2379
								return resolvedImport; // already know its visible
2372
							}
2380
							}
2373
						}
2381
						}
Lines 2406-2412 Link Here
2406
						if (temp != type && temp != null) {
2414
						if (temp != type && temp != null) {
2407
							if (temp.isValidBinding()) {
2415
							if (temp.isValidBinding()) {
2408
								ImportReference importReference = someImport.reference;
2416
								ImportReference importReference = someImport.reference;
2409
								if (importReference != null) importReference.used = true;
2417
								if (importReference != null) {
2418
									importReference.bits |= ASTNode.Used;
2419
								}
2410
								if (foundInImport) {
2420
								if (foundInImport) {
2411
									// Answer error binding -- import on demand conflict; name found in two import on demand packages.
2421
									// Answer error binding -- import on demand conflict; name found in two import on demand packages.
2412
									temp = new ProblemReferenceBinding(name, type, ProblemReasons.Ambiguous);
2422
									temp = new ProblemReferenceBinding(name, type, ProblemReasons.Ambiguous);
(-)formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java (-1 / +1 lines)
Lines 624-630 Link Here
624
			this.scribe.printNextToken(TerminalTokens.TokenNamestatic);
624
			this.scribe.printNextToken(TerminalTokens.TokenNamestatic);
625
			this.scribe.space();
625
			this.scribe.space();
626
		}
626
		}
627
		if (importRef.onDemand) {
627
		if ((importRef.bits & ASTNode.OnDemand) != 0) {
628
			this.scribe.printQualifiedReference(importRef.sourceEnd);
628
			this.scribe.printQualifiedReference(importRef.sourceEnd);
629
			this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
629
			this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
630
			this.scribe.printNextToken(TerminalTokens.TokenNameMULTIPLY);			
630
			this.scribe.printNextToken(TerminalTokens.TokenNameMULTIPLY);			
(-)model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java (-1 / +1 lines)
Lines 89-95 Link Here
89
89
90
		if (method.isConstructor()) {
90
		if (method.isConstructor()) {
91
			ConstructorDeclaration decl = new ConstructorDeclaration(compilationResult);
91
			ConstructorDeclaration decl = new ConstructorDeclaration(compilationResult);
92
			decl.isDefaultConstructor = false;
92
			decl.bits &= ~ASTNode.IsDefaultConstructor;
93
			methodDeclaration = decl;
93
			methodDeclaration = decl;
94
		} else {
94
		} else {
95
			MethodDeclaration decl = type.isAnnotation() ? new AnnotationMethodDeclaration(compilationResult) : new MethodDeclaration(compilationResult);
95
			MethodDeclaration decl = type.isAnnotation() ? new AnnotationMethodDeclaration(compilationResult) : new MethodDeclaration(compilationResult);
(-)model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java (-1 / +1 lines)
Lines 323-329 Link Here
323
		int modifiers = methodInfo.getModifiers();
323
		int modifiers = methodInfo.getModifiers();
324
		if (methodInfo.isConstructor()) {
324
		if (methodInfo.isConstructor()) {
325
			ConstructorDeclaration decl = new ConstructorDeclaration(compilationResult);
325
			ConstructorDeclaration decl = new ConstructorDeclaration(compilationResult);
326
			decl.isDefaultConstructor = false;
326
			decl.bits &= ~ASTNode.IsDefaultConstructor;
327
			method = decl;
327
			method = decl;
328
			decl.typeParameters = typeParams;
328
			decl.typeParameters = typeParams;
329
		} else {
329
		} else {
(-)codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java (-2 / +2 lines)
Lines 868-874 Link Here
868
868
869
	/* build specific assist node on import statement */
869
	/* build specific assist node on import statement */
870
	ImportReference reference = this.createAssistImportReference(subset, positions, ClassFileConstants.AccStatic);
870
	ImportReference reference = this.createAssistImportReference(subset, positions, ClassFileConstants.AccStatic);
871
	reference.onDemand = true;
871
	reference.bits |= ASTNode.OnDemand;
872
	assistNode = reference;
872
	assistNode = reference;
873
	this.lastCheckPoint = reference.sourceEnd + 1;
873
	this.lastCheckPoint = reference.sourceEnd + 1;
874
	
874
	
Lines 937-943 Link Here
937
937
938
	/* build specific assist node on import statement */
938
	/* build specific assist node on import statement */
939
	ImportReference reference = this.createAssistImportReference(subset, positions, ClassFileConstants.AccDefault);
939
	ImportReference reference = this.createAssistImportReference(subset, positions, ClassFileConstants.AccDefault);
940
	reference.onDemand = true;
940
	reference.bits |= ASTNode.OnDemand;
941
	assistNode = reference;
941
	assistNode = reference;
942
	this.lastCheckPoint = reference.sourceEnd + 1;
942
	this.lastCheckPoint = reference.sourceEnd + 1;
943
	
943
	

Return to bug 146556