Bug 334353 - PERF: dead code in AbstractRecord
Summary: PERF: dead code in AbstractRecord
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 minor (vote)
Target Milestone: ---   Edit
Assignee: James Sutherland CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2011-01-14 03:52 EST by Martin JANDA CLA
Modified: 2022-06-09 10:09 EDT (History)
2 users (show)

See Also:
jamesssss: iplog+


Attachments
patch (1.89 KB, patch)
2011-05-24 11:39 EDT, James Sutherland CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin JANDA CLA 2011-01-14 03:52:00 EST
Build Identifier: 2.2 revision 8831 - 01/14/2011 03:10 AM

DatabaseField.setIndex is never called in methods:
*) public Object get(DatabaseField key)
*) public Object getIndicatingNoEntry(DatabaseField key)

--- Original code
        index = this.fields.indexOf(key);
        if (index >= 0) {
            // PERF: If the fields index was not set, then set it.
            if (index == -1) {
                key.setIndex(index);
            }
            return this.values.get(index);
        } else {
            return null;
        }

--- Intended code
        index = this.fields.indexOf(key);
        if (index >= 0) {
            // PERF: If the fields index was not set, then set it.
!            if (key.getIndex() == -1) {
                key.setIndex(index);
            }
            return this.values.get(index);
        } else {
            return null;
        }

--- Impact
Access to record values are made through DatabaseFields with index already set.

According to my observation 'setIndex' should be called in ParameterExpression and in AbstractTransformationMapping.

Reproducible: Always
Comment 1 Tom Ware CLA 2011-02-03 09:45:32 EST
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 James Sutherland CLA 2011-05-17 10:40:20 EDT
Observation seems correct.

Fixing in 2.3.
Comment 3 James Sutherland CLA 2011-05-24 11:39:00 EDT
Created attachment 196450 [details]
patch
Comment 4 James Sutherland CLA 2011-06-01 14:02:44 EDT
Fixed in 2.3
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:09:39 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink