[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62930] error comparing octave_java objects
From: |
Pantxo Diribarne |
Subject: |
[Octave-bug-tracker] [bug #62930] error comparing octave_java objects |
Date: |
Wed, 24 Aug 2022 18:18:23 -0400 (EDT) |
Update of bug #62930 (project octave):
Status: Patch Submitted => Patch Reviewed
_______________________________________________________
Follow-up Comment #3:
I tested the patch with the original test case and that returns true as
expected, as it does for float and double types, but it returns false for
mixed numeric classes while with native octave types it would return true:
f1 = javaObject ("java.lang.Float",1.0);
d2 = javaObject ("java.lang.Double",1.0);
isequal (f1, d2)
## -> 0
isequal (single (1.0), double (1.0))
## -> 1
The good news is that Matlab online seems to behave the same.
I also tested with other xml related java objects and they all seem to feature
the "equals" method :
javaaddpath ("/usr/share/java/xml-apis.jar");
javaaddpath ("/usr/share/java/xercesImpl.jar");
doc = javaObject ("org.apache.xerces.dom.DocumentImpl");
root = doc.createElement ("RootNode");
isequal (doc, doc)
## -> 1
isequal (root, root)
## -> 1
root2 = root;
isequal (root, root2)
## -> 1
isequal (doc, root)
## -> 0
So this looks robust enough and I think the patch can be pushed.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62930>
_______________________________________________
Message posté via Savannah
https://savannah.gnu.org/