Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327699

Summary: JPA2 test: SimpleSerializeFetchGroupTests find(,,Map) may report Type mismatch error on expected Employee not Object
Product: z_Archived Reporter: Michael OBrien <michael.f.obrien>
Component: EclipselinkAssignee: Michael OBrien <michael.f.obrien>
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: eclipselink.orm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
URL: https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8356
Whiteboard:
Attachments:
Description Flags
find api requires generics specified on 3rd map parameter none

Description Michael OBrien CLA 2010-10-13 14:34:20 EDT
>Getting the following on one machine view without any overrides of the 2.0 spec jar and 1.6 compile level in jpa.test
JPA2: SimpleSerializeFetchGroupTests find(,,Map) may report Type mismatch error on expected Employee not Object
>1 of 4
Description	Resource	Path	Location	Type
Type mismatch: cannot convert from Object to Employee	SimpleSerializeFetchGroupTests.java	/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups	line 884	Java Problem

>Fix is to use generics like other tests in the file

For the JPA 2.0 spec function
    public <T> T find(Class<T> entityClass, Object primaryKey, Map<String, Object> properties); 

>Compiling
        Map<String, Object> properties = new HashMap<String, Object>();
        Employee emp = em.find(Employee.class, minId, properties);

>broken
        HashMap hints = new HashMap(2);
        Employee empShared = em.find(Employee.class, id, hints);

>Trivial Fix is to specify generics in the map
        HashMap hints = new HashMap(2);
to
        HashMap<String, Object> hints = new HashMap<String, Object>(2);
or
        Map<String, Object> hints = new HashMap<String, Object>(2);
Comment 1 Michael OBrien CLA 2010-10-13 14:48:12 EDT
Created attachment 180813 [details]
find api requires generics specified on 3rd map parameter
Comment 2 Michael OBrien CLA 2010-10-13 16:04:14 EDT
>Regression Testing Results: OK
<testsuite errors="0" failures="0" hostname="t4400" name="org.eclipse.persistence.testing.tests.jpa.AllCMP3TestRunModel" tests="2156" time="2107.439" timestamp="2010-10-13T19:19:00">

>See SVN rev # 8356
https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8356
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:07:35 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink