Issue Details (XML | Word | Printable)

Key: JDO-397
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Craig Russell
Reporter: Ilan Kirsh
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

Locale instances are shared by different PMs (when in use as FCO)

Created: 19/Jul/06 09:40 AM   Updated: 12/Aug/07 02:43 AM
Return to search
Component/s: specification, tck2
Affects Version/s: JDO 2 final
Fix Version/s: JDO 2 maintenance release 1

Time Tracking:
Not Specified

Resolution Date: 12/Aug/07 02:43 AM


 Description  « Hide
Tests in org.apache.jdo.tck.models.fieldtypes are using fields of Locale that are defined as FCO. The definition is only a hint to the implementation but when a FCO is actually used, the same JVM static Locale instances are persisted using different PersistenceManagers and tests fail.

The solution:

In org.apache.jdo.tck.models.fieldtypes.TestUtil lines 142-148:
                  case(5):
                      vec.add(0, Locale.CHINA.clone());
                      vec.add(1, Locale.FRANCE.clone());
                      vec.add(2, Locale.GERMANY.clone());
                      vec.add(3, Locale.JAPAN.clone());
                      vec.add(4, Locale.ITALY.clone());
                      break;
similar to cloning strings few lines above:
                  case(3):
                      vec.add(0, new String("Hello"));
                      vec.add(1, new String("Welcome"));
                      vec.add(2, new String("To The"));
                      vec.add(3, new String("Beautiful"));
                      vec.add(4, new String("World"));
                      break;

And also in org.apache.jdo.tck.pc.fieldtypes.AllTypes:

    public static final Locale[] Locale_values = {
        (Locale)Locale.US.clone(),
        (Locale)Locale.UK.clone(),
        (Locale)Locale.FRANCE.clone(),
        (Locale)Locale.GERMANY.clone(),
        (Locale)Locale.CANADA.clone(),
        (Locale)Locale.JAPAN.clone(),
        (Locale)Locale.ITALY.clone(),
        (Locale)Locale.CHINA.clone(),
        (Locale)Locale.KOREA.clone(),
        (Locale)Locale.TAIWAN.clone()
    };

similar to cloning strings few lines above:

    public static final String[] String_values = {
        new String(""), new String("hello world"),
        new String("JDO has a very nice persistence API"), new String("JDO"),
        new String("Java"), new String("abcde"),
        new String("abcdef"), new String("JDO is a breeze to use"),
        new String("Java"), new String("Long-live JDO")
    };


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michael Bouschen made changes - 23/Jul/06 08:45 PM
Field Original Value New Value
Component/s tck20 [ 11652 ]
Affects Version/s JDO 2 final [ 12310830 ]
Craig Russell made changes - 29/Jul/06 08:02 PM
Fix Version/s JDO 2 maintenance release 1 [ 12310923 ]
Craig Russell made changes - 11/Dec/06 03:22 AM
Component/s specification [ 12311332 ]
Craig Russell made changes - 06/Feb/07 10:22 PM
Assignee Craig Russell [ clr ]
Craig Russell made changes - 14/Mar/07 08:44 PM
Assignee Craig Russell [ clr ] Michelle Caisse [ mcaisse ]
Michelle Caisse made changes - 17/May/07 10:22 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Michelle Caisse made changes - 18/May/07 11:40 PM
Assignee Michelle Caisse [ mcaisse ] Craig Russell [ clr ]
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Craig Russell made changes - 12/Aug/07 02:43 AM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]