[Bug libgcj/20273] New: LinkedHashMap breaks linked list when access() is called

2005-03-01 Thread soleger at nc dot rr dot com
File: gcc/libjava/java/util/LinkedHashMap.java
CVS Version: 1.6

When using "accessOrder"-based sorting in LinkedHashMap, the linked list appears
to become broken after calling get(). I believe that this is due to a missing
line in the access() function. I believe that the following line needs to be
added after line 188:

root.pred = this;

This will relink "root.pred" to the "this" object which has been moved to the
"tail" of the linked list. Otherwise, root.pred will point to the
2nd-from-the-tail element which breaks the semantics of the linked list used in
the class. I will post some test code that exposes this problem shortly.

-- 
   Summary: LinkedHashMap breaks linked list when access() is called
   Product: gcc
   Version: 3.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: soleger at nc dot rr dot com
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org,mckinlay at redhat dot com
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20273


[Bug libgcj/20273] LinkedHashMap breaks linked list when access() is called

2005-03-01 Thread soleger at nc dot rr dot com

--- Additional Comments From soleger at nc dot rr dot com  2005-03-02 03:34 
---
Created an attachment (id=8309)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8309&action=view)
Java test case for LinkedHashMapEntry.access() bug

Simply compile and run the class with gcj. The expected output should be:

Key: 1
Key: 2
Key: 3

but the output I am getting is:

Key: 1
Key: 2

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20273