bugGNU Octave - Bugs: bug #38821, Support for java.lang.Byte /...

 
 

bug #38821: Support for java.lang.Byte / NoSuchMethodException

Submitter:  Scott Haynes <scotth2o>
Submitted:  Wed 24 Apr 2013 05:28:17 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Scott Haynes Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 23 Apr 2015 09:22:50 PM UTC, comment #5: 
Carnë Draug <carandraug>
Group Member
Tue 21 Apr 2015 02:32:01 PM UTC, comment #4: 

I came across this bug while fixing another (see comment #5 on bug #44882). Just for reference, my patch seems to this but has not been pushed yet.

Carnë Draug <carandraug>
Group Member
Thu 25 Apr 2013 07:24:18 PM UTC, comment #3: 

Thanks.
Rik pointed to a similar, or the same, pages a while back. In that thread, Michael Goffioul has clarified how Octave and Java are supposed to interact and pass/convert objects/classes/types to each other.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 24 Apr 2013 10:05:31 PM UTC, comment #2: 

I ran across a couple pages on TMW web site that list how types should be converted between the interpreter and Java, the box and unbox operations in our Java interface. This seems as good a spec as any to try to aim for:

http://www.mathworks.com/help/matlab/matlab_external/passing-data-to-a-java-method.html
http://www.mathworks.com/help/matlab/matlab_external/handling-data-returned-from-a-java-method.html

It is explicitly stated that int8 and uint8 should convert to a Java byte (the "unbox" direction in our library).

Mike Miller <mtmiller>
Group Member
Wed 24 Apr 2013 07:14:47 PM UTC, comment #1: 

See this discussion:
https://mailman.cae.wisc.edu/pipermail/help-octave/2013-April/058242.html

Workaround for the OF Java package is something like:

aa = javaObject ("java.lang.Short", 1).byteValue

This doesn't work in core Octave (dev version) as Java Byte is boxed to an Octave double; so unlike Matlab there's no way to create a java.lang.Byte in Octave.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 24 Apr 2013 05:28:17 PM UTC, original submission:  

Using the java package version 1.2.9 the following line yields a no such method error in octave 3.4.3.


octave:1> aa= javaObject('java.lang.Byte',uint8(1));
error: [java] java.lang.NoSuchMethodException: java.lang.Byte


The equivalent in Matlab yields a class java.lang.Byte as shown below.


>> aa= javaObject('java.lang.Byte',uint8(1));
>> whos
  Name      Size            Bytes  Class             Attributes

  aa        1x1                    java.lang.Byte

>> aa

aa =

1


Scott Haynes <scotth2o>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bkurtz (interested in this bug)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by scotth2o (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-23 carandraug StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2014-04-30 bkurtz Carbon-Copy- Added bkurtz
    2013-04-24 philipnienhuis CategoryOctave Package Libraries
        StatusNone Confirmed
        Release3.4.3 dev
        Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code