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

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

[Octave-bug-tracker] [bug #62406] Common java classes (String, Number) d


From: Rik
Subject: [Octave-bug-tracker] [bug #62406] Common java classes (String, Number) do not have overloaded display routines as in Matlab
Date: Wed, 4 May 2022 13:25:33 -0400 (EDT)

Update of bug #62406 (project octave):

                  Status:                    None => Confirmed              
                 Release:                   7.1.0 => dev                    
                 Summary: javaObject() java.lang.String Has Different Output
with MATLAB => Common java classes (String, Number) do not have overloaded
display routines as in Matlab

    _______________________________________________________

Follow-up Comment #7:

The javaObject command is generic in the sense that it can create any object
from any class in Java, and there are thousands of possible classes.  Hence,
Octave applies a generic display strategy reporting what the variable is "Java
object" and what class it is an instance of "java.lang.String".

Matlab does the same thing, in general.  For example, try


obj = javaObject ('java.lang.Object')


which creates a very, very basic Java object.  All Matlab reports is


obj =

java.lang.Object


Because java.lang.String is so common, and interconvertible with character
arrays or strings in Matlab, they seem to have written a specific display
routine for it.

Octave could do the same thing.  I'm not sure where, exactly, this would live.
 Maybe in unboxing routines in ov-java.cc, or maybe in the display code. 
Another strategy might be to call __java2mat__ and if that is successful then
print the resulting octave_value using Octave's normal display routines.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62406>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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