### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ClassFile.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java,v retrieving revision 1.204 diff -u -r1.204 ClassFile.java --- compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 5 Jan 2011 19:57:26 -0000 1.204 +++ compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 14 Jan 2011 15:32:52 -0000 @@ -3901,20 +3901,35 @@ if (aType.isInterface()) { superclassNameIndex = this.constantPool.literalIndexForType(ConstantPool.JavaLangObjectConstantPoolName); } else { - superclassNameIndex = - (aType.superclass == null ? 0 : this.constantPool.literalIndexForType(aType.superclass)); + if (aType.superclass != null) { + if ((aType.superclass.tagBits & TagBits.HasMissingType) != 0) { + superclassNameIndex = this.constantPool.literalIndexForType(ConstantPool.JavaLangObjectConstantPoolName); + } else { + superclassNameIndex = this.constantPool.literalIndexForType(aType.superclass); + } + } else { + superclassNameIndex = 0; + } } this.contents[this.contentsOffset++] = (byte) (superclassNameIndex >> 8); this.contents[this.contentsOffset++] = (byte) superclassNameIndex; ReferenceBinding[] superInterfacesBinding = aType.superInterfaces(); int interfacesCount = superInterfacesBinding.length; - this.contents[this.contentsOffset++] = (byte) (interfacesCount >> 8); - this.contents[this.contentsOffset++] = (byte) interfacesCount; + int interfacesCountPosition = this.contentsOffset; + this.contentsOffset += 2; + int interfaceCounter = 0; for (int i = 0; i < interfacesCount; i++) { - int interfaceIndex = this.constantPool.literalIndexForType(superInterfacesBinding[i]); + ReferenceBinding binding = superInterfacesBinding[i]; + if ((binding.tagBits & TagBits.HasMissingType) != 0) { + continue; + } + interfaceCounter++; + int interfaceIndex = this.constantPool.literalIndexForType(binding); this.contents[this.contentsOffset++] = (byte) (interfaceIndex >> 8); this.contents[this.contentsOffset++] = (byte) interfaceIndex; } + this.contents[interfacesCountPosition++] = (byte) (interfaceCounter >> 8); + this.contents[interfacesCountPosition] = (byte) interfaceCounter; this.creatingProblemType = createProblemType; // retrieve the enclosing one guaranteed to be the one matching the propagated flow info #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java,v retrieving revision 1.39 diff -u -r1.39 ProblemTypeAndMethodTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java 17 Dec 2010 09:39:06 -0000 1.39 +++ src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java 14 Jan 2011 15:32:53 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -1579,9 +1579,9 @@ false, false); - // check Y superclass in problem classfile + // check Y superclass in problem classfile: shoud not be Z otherwise the class cannot load String expectedOutput = - "public class Y extends Z {\n"; + "public class Y {\n"; File f = new File(OUTPUT_DIR + File.separator + "Y.class"); byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);