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

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

[Octave-bug-tracker] [bug #51804] java-9: java.base/java.lang.Double can


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #51804] java-9: java.base/java.lang.Double cannot be cast to java.base/java.lang.Integer
Date: Sun, 20 Aug 2017 16:59:59 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #6, bug #51804 (project octave):

Ok, this may be the problem


x = javaObject ("java.lang.Integer", 0)
methods (x)


With Java 8, the list contains


  [1,13] = int compareTo(java.lang.Integer)
  [1,14] = int compareTo(java.lang.Object)


in that order. So when Octave iterates through the available methods, it finds
the Integer one first, and everything works as expected. With Java 9, I get
the following


  [1,13] = int compareTo(java.lang.Object)
  [1,14] = int compareTo(java.lang.Integer)


in the opposite order. Octave finds the one that takes an Object first,
assumes that that should work when given a double-valued argument, and calls
it. If that method actually exists and works, then this should work. But it's
like Java is reporting that this compareTo(Object) method exists, but when
it's called it is actually calling the one that takes an Integer.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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