bugGNU Octave - Bugs: bug #42702, isa() does not check parent class...

 
 

bug #42702: isa() does not check parent class of java object

Submitter:  Carnë Draug <carandraug>
Submitted:  Mon 07 Jul 2014 11:29:17 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 06 Apr 2015 04:11:46 AM UTC, comment #3: 

I forgot to mention that this only fixed the original report, i.e., does not work for java objects.

I was unable to confirm comment #1 about this also failing for classdef. Maybe it was fixed in the mean time, or maybe I am not testing it correctly, but here's what I did:


$ cat parent.m
classdef parent
endclassdef
$ cat child.m
classdef child < parent
endclassdef
$ octave
octave:1> isa (child (), "parent")
ans =  1


Carnë Draug <carandraug>
Group Member
Mon 06 Apr 2015 03:59:34 AM UTC, comment #2: 
Carnë Draug <carandraug>
Group Member
Thu 10 Jul 2014 11:23:07 PM UTC, comment #1: 

I can confirm that this doesn't apply for classdef objects (in Octave 4.1.0+) either.

sergey plotnikov <nul0m>
Mon 07 Jul 2014 11:29:17 PM UTC, original submission:  

The function isa() should return true not only when the object is of the specified class, but also when it's derived of it. However, for java objects this does not apply:


octave-cli-3.8.1> x = javaObject ('java.lang.Double', 10)
x =

<Java object: java.lang.Double>

octave-cli-3.8.1> isa (x, 'java.lang.Number')
ans = 0


while in Matlab:


>> x = javaObject ('java.lang.Double', 10);
>> isa (x, 'java.lang.Number')

ans =

     1


Carnë Draug <carandraug>
Group Member

 

(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 mtmiller (Updated the item)
  • -email is unavailable- added by nul0m (Posted a comment)
  • -email is unavailable- added by carandraug (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-06 carandraug StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-02-22 mtmiller CategoryNone Libraries
        Item GroupNone Incorrect Result
        StatusNone Confirmed
        Release3.8.1 dev
        Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code