octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46200] octave automatically converts java str


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #46200] octave automatically converts java strings into char arrays
Date: Tue, 13 Oct 2015 12:51:01 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.3.0

URL:
  <http://savannah.gnu.org/bugs/?46200>

                 Summary: octave automatically converts java strings into char
arrays
                 Project: GNU Octave
            Submitted by: carandraug
            Submitted on: Tue 13 Oct 2015 12:51:00 GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

Octave automatically converts specific java objects into Octave data types as
Matlab supposedly does.  This includes converting a java.lang.String into a
char array.  According to Matlab documentation
http://uk.mathworks.com/help/matlab/matlab_external/handling-data-returned-from-a-java-method.html#f61197

> When a method call returns data of type java.lang.Object, MATLAB converts
its value, depending on its actual type, according to the following table.

However, it seems that our interpretation of Matlab documentation was
incorrect (see
https://github.com/openmicroscopy/bioformats/pull/2017#discussion_r41634730
for the origin of this)


>> version = loci.formats.FormatTools.VERSION;
>> class(version)

ans =

java.lang.String



Could it be that Matlab documentation meant that it performs an implicit
conversion to char when required and not as soon as the java method returns? I
don't know what's the way to Matlab compatibility.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46200>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]