Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 186829 Details for
Bug 334315
[compiler] Problem types with missing superclass or superinterfaces should use Object for missing types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + updated regression test
patch_334315.txt (text/plain), 4.01 KB, created by
Olivier Thomann
on 2011-01-14 10:33:21 EST
(
hide
)
Description:
Proposed fix + updated regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2011-01-14 10:33:21 EST
Size:
4.01 KB
patch
obsolete
>### 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);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 334315
: 186829