Bug 14592 - IType#getTypes and IType#getDeclaringType are not coherent with Hastable
Summary: IType#getTypes and IType#getDeclaringType are not coherent with Hastable
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14315
  Show dependency tree
 
Reported: 2002-04-25 08:05 EDT by David Audel CLA
Modified: 2002-04-30 06:54 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2002-04-25 08:05:31 EDT
With the Hastable IType do getTypes(). One of these memberTypes is Hashtable$1.
With the Hashtable$1 IType do getDeclaringType. The result is null.
Comment 1 David Audel CLA 2002-04-25 09:01:11 EDT
I see this problem with rt.jar of jdk 1.4 or 1.3.1
Comment 2 Olivier Thomann CLA 2002-04-25 10:58:19 EDT
For the JDK1.4, I disassemble the java/util/Hashtable.class using our disassembler and I 
got:
Inner classes attributes:
	[inner class info name: #92 
java/util/Hashtable$1
		outer class info name: #50 java/util/Hashtable
		inner name: 
#0
		accessflags: 0 ], 
	[inner class info name: #87 
java/util/Hashtable$EmptyIterator
		outer class info name: #50 
java/util/Hashtable
		inner name: #95 EmptyIterator
		accessflags: 10 private static ], 

	[inner class info name: #85 java/util/Hashtable$EmptyEnumerator
		outer class info 
name: #50 java/util/Hashtable
		inner name: #96 EmptyEnumerator
		accessflags: 10 
private static ], 
	[inner class info name: #64 java/util/Hashtable$Enumerator
		outer 
class info name: #50 java/util/Hashtable
		inner name: #97 Enumerator
		accessflags: 2 
private ], 
	[inner class info name: #21 java/util/Hashtable$Entry
		outer class info 
name: #50 java/util/Hashtable
		inner name: #98 Entry
		accessflags: 10 private static ], 

	[inner class info name: #72 java/util/Hashtable$ValueCollection
		outer class info 
name: #50 java/util/Hashtable
		inner name: #99 ValueCollection
		accessflags: 2 
private ], 
	[inner class info name: #70 java/util/Hashtable$EntrySet
		outer class info 
name: #50 java/util/Hashtable
		inner name: #100 EntrySet
		accessflags: 2 private ], 

	[inner class info name: #67 java/util/Hashtable$KeySet
		outer class info name: #50 
java/util/Hashtable
		inner name: #101 KeySet
		accessflags: 2 private ], 
	[inner 
class info name: #44 java/util/Map$Entry
		outer class info name: #75 
java/util/Map
		inner name: #98 Entry
		accessflags: 1545 public static abstract 
]

The first entry should not have a outer class info name. This index is supposed to be equals to 
0 is the inner class is not a member. This means the inner attribute in the .class file is incorrect 
and doesn't follow the JVM specifications. I added an extra check in the getMembers() methods of 
the ClassFileReader. Now I get the following list of members for 
java.util.Hashtable:
java/util/Hashtable$EmptyIterator
java/util/Hashtable$EmptyEnumerator
java/util/Hashtable$Enumerator
java/util/Hashtable$Entry
java/util/Hashtable$ValueCollection
java/util/Hashtable$EntrySet
java/util/Hashtable$KeySet

java/util/Hashtable$1 
is not in the list anymore.

The problem is exactly the same with the rt.jar from the jdk 1.3.1. 
So I will keep the extra check in the getMembers() methods.
Fixed and released in HEAD.