Issue Details (XML | Word | Printable)

Key: JERSEY-1570
Type: Bug Bug
Status: Resolved Resolved
Resolution: Works as designed
Priority: Critical Critical
Assignee: Miroslav Fuksa
Reporter: Miroslav Fuksa
Votes: 0
Watchers: 0
Operations

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

Resoure.from(Object resource, List<ResourceModelIssue> issueList) does not create Resource based on instance (Object resource)

Created: 09/Nov/12 10:13 AM   Updated: 12/Dec/12 04:22 PM   Resolved: 11/Dec/12 05:29 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0-m11, 2.0

Time Tracking:
Original Estimate: 3 hours
Original Estimate - 3 hours
Remaining Estimate: 0 minutes
Remaining Estimate - 0 minutes
Time Spent: 3 hours
Time Spent - 3 hours

Tags:
Participants: Miroslav Fuksa


 Description  « Hide

This code does not store instance but only uses the class of the instance (the instance is ignored):

public static Resource from(Object resource, List<ResourceModelIssue> issueList) {
        final Builder builder = new IntrospectionModeller(resource.getClass(), issueList).createResourceBuilder(true);
        return builder.isEmpty() ? null : builder.build();
    }

MethodHadnler is then class based and not instance based.

The instance should be kept and used for request dispatching.



Martin Matula made changes - 15/Nov/12 12:44 PM
Field Original Value New Value
Fix Version/s 2.0-m11 [ 16165 ]
Fix Version/s 2.0 [ 15271 ]
Fix Version/s 2.0-unplanned [ 15288 ]
Pavel Bucek made changes - 15/Nov/12 02:04 PM
Fix Version/s 2.0 [ 15271 ]
Fix Version/s 2.0-m11 [ 16171 ]
Fix Version/s 2.0-m11-tmp [ 16165 ]
Miroslav Fuksa logged work - 03/Dec/12 04:23 PM
Time Worked: 2 hours
implemented
Miroslav Fuksa made changes - 03/Dec/12 05:41 PM
Assignee mfuksa [ mfuksa ]
Miroslav Fuksa made changes - 03/Dec/12 05:41 PM
Status Open [ 1 ] In Progress [ 3 ]
Miroslav Fuksa made changes - 11/Dec/12 04:23 PM
Remaining Estimate 3 hours [ 10800 ] 1 hour [ 3600 ]
Time Spent 2 hours [ 7200 ]
Miroslav Fuksa added a comment - 11/Dec/12 05:29 PM

Finally agreed with Marek that the current functionality works as desired. We do not want to create Resources which have instance based Method Handler. Preferable way it to create class based resources and register instance as a singleton.

So, current methods (Resource.from(Object) and Resource.builder(Object)) are really intended to create class based method handlers.


Miroslav Fuksa made changes - 11/Dec/12 05:29 PM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Works as designed [ 7 ]
Marek Potociar logged work - 12/Dec/12 04:22 PM
Time Worked: 1 hour
Updated patch.
Marek Potociar made changes - 12/Dec/12 04:22 PM
Remaining Estimate 1 hour [ 3600 ] 0 minutes [ 0 ]
Time Spent 2 hours [ 7200 ] 3 hours [ 10800 ]