I'm new to restlets; sorry if this is a 
well-understood issue.

In trying to debug a problem with XML conversion
I came across what looks like an obvious bug in
the score method of DefaultConverter in
org.restlet.engine.converter.

In the score method with 3 parameters, line 179 is:

  if (Representation.class.isAssignableFrom(target)) {

The corresponding line (line 237) of the toObject
method of the same class is:

  if (target.isAssignableFrom(source.getClass())) {

Two points:

1. shouldn't these tests be equivalent, in the
sense that they'd return the same value for every
source and target?

2. shouldn't the test on line 237 of toObject be the
test used on line 179 of the score method?
The test on line 179 of the score method, for
example, will be true if target has 
class DomRepresentation, regardless of the source object.

In my particular case the problem that arises
is that the needed XMLConverter is not used because
the score from the DefaultConverter is higher.
However, the toObject method then fails (returning
null) and I get a 415 error.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2815743

Reply via email to