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

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

[Octave-bug-tracker] [bug #60396] Java Methods expecting native java cha


From: Liang Tang
Subject: [Octave-bug-tracker] [bug #60396] Java Methods expecting native java char type input cannot be used
Date: Wed, 24 Nov 2021 05:48:07 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0

Follow-up Comment #1, bug #60396 (project octave):

I think this issue needs a fix or walkaround.  Many open source api cannot be
used because of this.  Equivalently, this issue is like one cannot pass 'o' as
a marker in plot command in Octave.  I build a simple code to demonstrate the
issue: 

import java.lang.String; 
import java.lang.Integer; 
import java.lang.Double; 
import java.lang.Character; 

public final class test_char {
        
        public test_char() {}
        
        public static Integer case_string(String s) {
        Integer ii = 1; 
        return ii;
        }
        public static Double  case_char(Character s){
        Double ii = 2.; 
        return ii;
        }
}
/**

I think this issue needs a fix or walkaround.  Many open source api cannot be
used because this.  Equivalently, this issue is like one cannot pass 'o' as a
marker in plot command.  I build a simple code to demonstrate this issue: 

The observations are:
(1) 'o' and javaObject('java.lang.String', 'o') are both passed to this java
code as string 
(2) No solution to create a java character.  


>> javaMethod('case_string', 'test_char', javaObject('java.lang.String',
'o'))
ans = 1
>> javaMethod('case_string', 'test_char', 'o')
ans = 1
>> javaMethod('case_char', 'test_char', 'o')
error: [java] java.lang.NoSuchMethodException: case_char

>> javaObject('java.lang.Character', '1')
error: [java] java.lang.NoSuchMethodException: java.lang.Character

(file #52336, file #52337)
    _______________________________________________________

Additional Item Attachment:

File name: test_char.java                 Size:1 KB
    <https://file.savannah.gnu.org/file/test_char.java?file_id=52336>

File name: test_char.jar                  Size:0 KB
    <https://file.savannah.gnu.org/file/test_char.jar?file_id=52337>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60396>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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