<< Back to previous view

[JDATA-1] Handle primitive types and arrays Created: 01/Oct/11  Updated: 04/Oct/11

Status: Open
Project: java.data
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Herwig Hochleitner Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File java.data-primitive-array-support.patch    
Patch: Code and Test


Right now, there is no special handling for methods with primitive or array parameters.
This results in errors, when trying to use bean classes, that have such methods, with to-java and from-java.

The attached patch implements handling of primitives and arrays in the following manner:

  • When the :default methods of from-java and to-java see an array type, they extend the multimethods for that array type.
    Issue: Is Iterable the right interface to extend the multimethod to? Sequential also came to mind, but Iterable was used elsewhere.
  • Values that hit a numeric primitive slot (in to-java) are manually boxed, so they aren't passed as longs.

Comment by Cosmin Stejerean [ 04/Oct/11 7:35 AM ]

Committed in https://github.com/clojure/java.data/commit/487db7420ae07ca4b527b38c39064d3b139ce78d

Generated at Mon Jan 22 14:29:16 CST 2018 using JIRA 4.4#649-r158309.