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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java (-5 / +4 lines)
Lines 36-46 Link Here
36
		FlowInfo flowInfo) {
36
		FlowInfo flowInfo) {
37
37
38
		// if reachable, request the addition of a synthetic field for caching the class descriptor
38
		// if reachable, request the addition of a synthetic field for caching the class descriptor
39
		SourceTypeBinding sourceType =
39
		SourceTypeBinding sourceType = currentScope.outerMostClassScope().enclosingSourceType();
40
			currentScope.outerMostMethodScope().enclosingSourceType();
40
		// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=22334
41
		if ((!(sourceType.isInterface()
41
		if (!sourceType.isInterface()
42
				// no field generated in interface case (would'nt verify) see 1FHHEZL
42
				&& !sourceType.isBaseType()
43
				|| sourceType.isBaseType()))
44
				&& currentScope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5) {
43
				&& currentScope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5) {
45
			syntheticField = sourceType.addSyntheticFieldForClassLiteral(targetType, currentScope);
44
			syntheticField = sourceType.addSyntheticFieldForClassLiteral(targetType, currentScope);
46
		}
45
		}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java (-9 / +23 lines)
Lines 10-21 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.compiler.ast;
11
package org.eclipse.jdt.internal.compiler.ast;
12
12
13
import org.eclipse.jdt.internal.compiler.*;
13
import org.eclipse.jdt.internal.compiler.ASTVisitor;
14
import org.eclipse.jdt.internal.compiler.codegen.*;
14
import org.eclipse.jdt.internal.compiler.ClassFile;
15
import org.eclipse.jdt.internal.compiler.flow.*;
15
import org.eclipse.jdt.internal.compiler.CompilationResult;
16
import org.eclipse.jdt.internal.compiler.lookup.*;
16
import org.eclipse.jdt.internal.compiler.codegen.BranchLabel;
17
import org.eclipse.jdt.internal.compiler.parser.*;
17
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
18
import org.eclipse.jdt.internal.compiler.problem.*;
18
import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
19
import org.eclipse.jdt.internal.compiler.flow.ExceptionHandlingFlowContext;
20
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
21
import org.eclipse.jdt.internal.compiler.flow.InitializationFlowContext;
22
import org.eclipse.jdt.internal.compiler.lookup.Binding;
23
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
24
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
25
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
26
import org.eclipse.jdt.internal.compiler.lookup.MethodScope;
27
import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
28
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
29
import org.eclipse.jdt.internal.compiler.parser.Parser;
30
import org.eclipse.jdt.internal.compiler.problem.AbortMethod;
19
31
20
public class Clinit extends AbstractMethodDeclaration {
32
public class Clinit extends AbstractMethodDeclaration {
21
	
33
	
Lines 313-321 Link Here
313
		// we need to add the field right now, because the field infos are generated before the methods
325
		// we need to add the field right now, because the field infos are generated before the methods
314
		if (needClassLiteralField) {
326
		if (needClassLiteralField) {
315
			SourceTypeBinding sourceType =
327
			SourceTypeBinding sourceType =
316
				this.scope.outerMostMethodScope().enclosingSourceType();
328
				this.scope.outerMostClassScope().enclosingSourceType();
317
			this.classLiteralSyntheticField =
329
			// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=22334
318
				sourceType.addSyntheticFieldForClassLiteral(sourceType, scope);
330
			if (!sourceType.isInterface() && !sourceType.isBaseType()) {			
331
				this.classLiteralSyntheticField = sourceType.addSyntheticFieldForClassLiteral(sourceType, scope);
332
			}
319
		}
333
		}
320
	}
334
	}
321
335

Return to bug 163600