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

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java (-5 / +5 lines)
Lines 41-47 Link Here
41
	}
41
	}
42
42
43
	void buildAnonymousTypeBinding(SourceTypeBinding enclosingType, ReferenceBinding supertype) {
43
	void buildAnonymousTypeBinding(SourceTypeBinding enclosingType, ReferenceBinding supertype) {
44
		LocalTypeBinding anonymousType = buildLocalType(enclosingType, supertype, enclosingType.fPackage);
44
		LocalTypeBinding anonymousType = buildLocalType(enclosingType, enclosingType.fPackage);
45
		anonymousType.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; // tag all anonymous types as used locally
45
		anonymousType.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; // tag all anonymous types as used locally
46
		if (supertype.isInterface()) {
46
		if (supertype.isInterface()) {
47
			anonymousType.superclass = getJavaLangObject();
47
			anonymousType.superclass = getJavaLangObject();
Lines 155-168 Link Here
155
			 ((SourceTypeBinding) memberTypes[i]).scope.buildFieldsAndMethods();
155
			 ((SourceTypeBinding) memberTypes[i]).scope.buildFieldsAndMethods();
156
	}
156
	}
157
157
158
	private LocalTypeBinding buildLocalType(SourceTypeBinding enclosingType, ReferenceBinding anonymousOriginalSuperType, PackageBinding packageBinding) {
158
	private LocalTypeBinding buildLocalType(SourceTypeBinding enclosingType, PackageBinding packageBinding) {
159
159
160
		this.referenceContext.scope = this;
160
		this.referenceContext.scope = this;
161
		this.referenceContext.staticInitializerScope = new MethodScope(this, this.referenceContext, true);
161
		this.referenceContext.staticInitializerScope = new MethodScope(this, this.referenceContext, true);
162
		this.referenceContext.initializerScope = new MethodScope(this, this.referenceContext, false);
162
		this.referenceContext.initializerScope = new MethodScope(this, this.referenceContext, false);
163
163
164
		// build the binding or the local type
164
		// build the binding or the local type
165
		LocalTypeBinding localType = new LocalTypeBinding(this, enclosingType, innermostSwitchCase(), anonymousOriginalSuperType);
165
		LocalTypeBinding localType = new LocalTypeBinding(this, enclosingType, innermostSwitchCase());
166
		this.referenceContext.binding = localType;
166
		this.referenceContext.binding = localType;
167
		checkAndSetModifiers();
167
		checkAndSetModifiers();
168
		buildTypeVariables();
168
		buildTypeVariables();
Lines 198-204 Link Here
198
					}
198
					}
199
				}
199
				}
200
				ClassScope memberScope = new ClassScope(this, this.referenceContext.memberTypes[i]);
200
				ClassScope memberScope = new ClassScope(this, this.referenceContext.memberTypes[i]);
201
				LocalTypeBinding memberBinding = memberScope.buildLocalType(localType, null /* anonymous super type*/, packageBinding);
201
				LocalTypeBinding memberBinding = memberScope.buildLocalType(localType, packageBinding);
202
				memberBinding.setAsMemberType();
202
				memberBinding.setAsMemberType();
203
				memberTypeBindings[count++] = memberBinding;
203
				memberTypeBindings[count++] = memberBinding;
204
			}
204
			}
Lines 211-217 Link Here
211
211
212
	void buildLocalTypeBinding(SourceTypeBinding enclosingType) {
212
	void buildLocalTypeBinding(SourceTypeBinding enclosingType) {
213
213
214
		LocalTypeBinding localType = buildLocalType(enclosingType, null /* anonymous super type*/, enclosingType.fPackage);
214
		LocalTypeBinding localType = buildLocalType(enclosingType, enclosingType.fPackage);
215
		connectTypeHierarchy();
215
		connectTypeHierarchy();
216
		if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
216
		if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
217
			checkParameterizedTypeBounds();
217
			checkParameterizedTypeBounds();
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java (-4 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 26-34 Link Here
26
	public int sourceStart; // used by computeUniqueKey to uniquely identify this binding
26
	public int sourceStart; // used by computeUniqueKey to uniquely identify this binding
27
	public MethodBinding enclosingMethod;
27
	public MethodBinding enclosingMethod;
28
28
29
//	public ReferenceBinding anonymousOriginalSuperType;
29
public LocalTypeBinding(ClassScope scope, SourceTypeBinding enclosingType, CaseStatement switchCase) {
30
31
public LocalTypeBinding(ClassScope scope, SourceTypeBinding enclosingType, CaseStatement switchCase, ReferenceBinding anonymousOriginalSuperType) {
32
	super(
30
	super(
33
		new char[][] {CharOperation.concat(LocalTypeBinding.LocalTypePrefix, scope.referenceContext.name)},
31
		new char[][] {CharOperation.concat(LocalTypeBinding.LocalTypePrefix, scope.referenceContext.name)},
34
		scope,
32
		scope,

Return to bug 307523