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

(-)compiler/org/eclipse/jdt/internal/compiler/ClassFile.java (-5 / +20 lines)
Lines 3901-3920 Link Here
3901
		if (aType.isInterface()) {
3901
		if (aType.isInterface()) {
3902
			superclassNameIndex = this.constantPool.literalIndexForType(ConstantPool.JavaLangObjectConstantPoolName);
3902
			superclassNameIndex = this.constantPool.literalIndexForType(ConstantPool.JavaLangObjectConstantPoolName);
3903
		} else {
3903
		} else {
3904
			superclassNameIndex =
3904
			if (aType.superclass != null) {
3905
				(aType.superclass == null ? 0 : this.constantPool.literalIndexForType(aType.superclass));
3905
				 if ((aType.superclass.tagBits & TagBits.HasMissingType) != 0) {
3906
						superclassNameIndex = this.constantPool.literalIndexForType(ConstantPool.JavaLangObjectConstantPoolName);
3907
				 } else {
3908
						superclassNameIndex = this.constantPool.literalIndexForType(aType.superclass);
3909
				 }
3910
			} else {
3911
				superclassNameIndex = 0;
3912
			}
3906
		}
3913
		}
3907
		this.contents[this.contentsOffset++] = (byte) (superclassNameIndex >> 8);
3914
		this.contents[this.contentsOffset++] = (byte) (superclassNameIndex >> 8);
3908
		this.contents[this.contentsOffset++] = (byte) superclassNameIndex;
3915
		this.contents[this.contentsOffset++] = (byte) superclassNameIndex;
3909
		ReferenceBinding[] superInterfacesBinding = aType.superInterfaces();
3916
		ReferenceBinding[] superInterfacesBinding = aType.superInterfaces();
3910
		int interfacesCount = superInterfacesBinding.length;
3917
		int interfacesCount = superInterfacesBinding.length;
3911
		this.contents[this.contentsOffset++] = (byte) (interfacesCount >> 8);
3918
		int interfacesCountPosition = this.contentsOffset;
3912
		this.contents[this.contentsOffset++] = (byte) interfacesCount;
3919
		this.contentsOffset += 2;
3920
		int interfaceCounter = 0;
3913
		for (int i = 0; i < interfacesCount; i++) {
3921
		for (int i = 0; i < interfacesCount; i++) {
3914
			int interfaceIndex = this.constantPool.literalIndexForType(superInterfacesBinding[i]);
3922
			ReferenceBinding binding = superInterfacesBinding[i];
3923
			if ((binding.tagBits & TagBits.HasMissingType) != 0) {
3924
				continue;
3925
			}
3926
			interfaceCounter++;
3927
			int interfaceIndex = this.constantPool.literalIndexForType(binding);
3915
			this.contents[this.contentsOffset++] = (byte) (interfaceIndex >> 8);
3928
			this.contents[this.contentsOffset++] = (byte) (interfaceIndex >> 8);
3916
			this.contents[this.contentsOffset++] = (byte) interfaceIndex;
3929
			this.contents[this.contentsOffset++] = (byte) interfaceIndex;
3917
		}
3930
		}
3931
		this.contents[interfacesCountPosition++] = (byte) (interfaceCounter >> 8);
3932
		this.contents[interfacesCountPosition] = (byte) interfaceCounter;
3918
		this.creatingProblemType = createProblemType;
3933
		this.creatingProblemType = createProblemType;
3919
3934
3920
		// retrieve the enclosing one guaranteed to be the one matching the propagated flow info
3935
		// retrieve the enclosing one guaranteed to be the one matching the propagated flow info
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 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 1579-1587 Link Here
1579
			false,
1579
			false,
1580
			false);
1580
			false);
1581
1581
1582
	// check Y superclass in problem classfile
1582
	// check Y superclass in problem classfile: shoud not be Z otherwise the class cannot load
1583
	String expectedOutput =
1583
	String expectedOutput =
1584
		"public class Y extends Z {\n";
1584
		"public class Y {\n";
1585
1585
1586
	File f = new File(OUTPUT_DIR + File.separator + "Y.class");
1586
	File f = new File(OUTPUT_DIR + File.separator + "Y.class");
1587
	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
1587
	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);

Return to bug 334315