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

 
 

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

Submitted by:  Carnë Draug <carandraug>
Submitted on:  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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Member
Mon 06 Apr 2015 03:59:34 AM UTC, comment #2: 
Carnë Draug <carandraug>
Project 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>
Project 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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project 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.5