harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Qiu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-5799) [classlib][luni] ArrayList may introduce data corruption.
Date Tue, 29 Apr 2008 06:55:56 GMT
[classlib][luni] ArrayList may introduce data corruption.
---------------------------------------------------------

                 Key: HARMONY-5799
                 URL: https://issues.apache.org/jira/browse/HARMONY-5799
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M6
            Reporter: Sean Qiu
             Fix For: 5.0M6


Harmony's ArrayList may cause data corruption.
The testcase is list as following:

        ArrayList list1 = new ArrayList();
        ArrayList list2 = new ArrayList();
        int location = 2;
        
        String[] strings = {"0","1","2","3","4","5","6"};
        int[] integers = {0,1,2,3,4,5,6,7,8,9};        
        for (int i = 0; i < 7; i++){
            list1.add(strings[i]);
        }
        for (int i = 0; i < 10; i++){
            list2.add(integers[i]);
        }
        list1.remove(location);
        list1.addAll(location,list2);
        
         for(Object element: list1){
             System.out.print(element+",");
         }

RI will print 
"0", "1", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "3", "4", "5", "6", 
While Harmony will print 
"0", "1", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "1", "3", "4", "5", 

The "6" is missing and "1" is duplicated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message