[ 
https://issues.apache.org/jira/browse/TINKERPOP-2590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17384812#comment-17384812
 ] 

Stephen Mallette edited comment on TINKERPOP-2590 at 7/21/21, 10:18 AM:
------------------------------------------------------------------------

I've privately had some discussions about this issue in general so it's 
definitely an item on our radar. Better runtime exception messaging 
improvements would be helpful if you'd like to submit a contribution. I think 
you should target the 3.5-dev branch with any changes you submit. thanks.




was (Author: spmallette):
I've privately had some discussions about this issue in general so it's 
definitely an item on our radar. Better runtime exception messaging 
improvements would be helpful if you'd like to submit a contribution - thanks.



> ClassCastException when specifying "single cardinality" for edge property
> -------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2590
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2590
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: structure
>    Affects Versions: 3.4.8
>            Reporter: Christopher Smith
>            Priority: Major
>
> As I understand it, multi-properties are not supported on edges in Tinkerpop, 
> and this is an understandable limitation. However, my expectation as an API 
> client is that if I redundantly specify {{Cardinality.single}} when setting a 
> property on an edge, it would succeed silently. Instead 
> {{AddPropertyStep.java:151,153}} (as of 3.4.8) unconditionally casts the 
> traversal element to {{Vertex}} on seeing any {{Cardinality}} at all, 
> producing a confusing {{ClassCastException}}.
> (1) In the case of {{single}}, which specifies the correct semantics, the 
> call should succeed. (This is relevant when trying to reuse a method to 
> update a single-valued timestamp on a generic {{Element}}.)
> (2) It would be a major improvement to debugging to, instead of performing 
> inline casting, use a wrapper method producing an error message such as 
> "property cardinality may only be specified for a Vertex".
> There are many cases throughout the code where (2) applies; would you be 
> interested in contributions to retrofit enhanced error messages?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to