JDK-6477587 : TypeElement's members table gets corrupted by calling Elements.getAllMembers(...)
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-10-03
  • Updated: 2011-02-16
  • Resolved: 2006-10-03
Related Reports
Duplicate :  
Description
The problem is caused by calling sym.members().dupUnshared() in JavacElements.getAllMembers(...). This call creates a Scope with the new member table that shares its entries with the original member table. Now, imagine the situation that original_table[i] points to Entry1 that shadows Entry2. By adding closure type members to the newly created Scope in the JavacElements.getAllMembers(...) a necessity for dble() the new member table may appear. During dble() all entries of a new table are rehashed so that new_table[j] now points to Entry1, new_table[k] points to Entry2 and the shadow link between Entry1 and Entry2 is removed. However, since the entries were shared between the original and new tables, the original_table[i] still points to Entry1 and the link to Entry2 is lost.

Comments
SUGGESTED FIX Attached see suggested fix
03-10-2006