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

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

[Octave-bug-tracker] [bug #48013] Java integration: conversion to double


From: Ernst Reissner
Subject: [Octave-bug-tracker] [bug #48013] Java integration: conversion to double
Date: Tue, 2 Aug 2016 12:41:09 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0

Follow-up Comment #14, bug #48013 (project octave):

Hi Mike, 

Update: 
Although you are right, saying: 
'The test for whether jobj is a java.lang.Number is redundant now with the new
helper function, so I deleted it. ' 
I would prefer not to do so for performance reasons. 
Instead I would like to add a comment like: 


     // 1st condition logically redundant, added for performance 
     if (jni_env->IsInstanceOf (jobj, cls) 
          && is_auto_convertible_number (jni_env, jobj))


The problem is namely, that without this condition, 
for non-numbers the whole cascade of tests in is_auto_convertible_number is
done. 
The interface is really awfully slow at the moment. 
Have a look at scripts/java/org/octave/ClassHelper, 
at many places the author has redundant checks of that kind also. 
And this is ok and good, I think. 

Secondly, 
at the moment, you do not need a java class for test. 
Just try the following with and without patch. 
octave:3> bd=javaObject('java.math.BigDecimal',3)

The correct result is 
bd =

<Java object: java.math.BigDecimal>

bad is just bd=3. 

Still I think  you are right, we need a testclass. 
You did not answer my last post and so I just add my local file. 
Please adapt as I suggested in my last post. 

best regards, 
Ernst 


(file #38076)
    _______________________________________________________

Additional Item Attachment:

File name: OctaveInterfaceTester.java     Size:1 KB


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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