On Thu, 28 May 2009 17:42:02 +1000, Brett Henderson <[email protected]>
wrote:
> Line 43 of RelationMemberWriter above deals with the relation member
> role. Your osm file above is missing all of the role attributes on
> relation members which would cause this problem to occur.
>
> Perhaps xapi doesn't include the role attribute if it is empty ... I
> thought it was mandatory ...
So maybe we should add a
if (member.getRole() == null) {
throw new IllegalArgumentException("no role for reltion-member "
+ member.getElementID() + " of relation " + relation.getID());
}
to give better error-messages in this case.
or much better, add this to
RelationMenber:setRole(final String aRole)
so no illegal members can ever be created.
(and of cause call the setters from the constructor
as is good practice to make subclassing easier.)
Marcus
_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/dev