-
Bug
-
Resolution: Fixed
-
P2
-
1.1
-
1.1fcs
-
generic
-
generic
-
Not verified
masayoshi.okutsu@Eng 1996-12-20
A method name in non-ASCII characters cannot be found using
Class.getMethod() or Class.getDeclaredMethod().
To reproduce, run the following:
Source program:
import java.lang.reflect.*;
public class methodmini{
//
public static void main(String[] args){
Method method;
testMethod testmethod = new testMethod();
Class c = testmethod.getClass();
String methodName = "\u30c6\u30b9\u30c8";
Class[] parameterList = null;
//
// getMethod()
//
try{
method = c.getMethod(methodName,parameterList);
}
catch(NoSuchMethodException e){ e.printStackTrace(); }
catch(SecurityException e){ e.printStackTrace(); }
//
// getDeclaredMethod()
//
try{
method = c.getDeclaredMethod(methodName,parameterList);
}
catch(NoSuchMethodException e){ e.printStackTrace(); }
catch(SecurityException e){ e.printStackTrace(); }
}
}
//
// class testMethod
//
class testMethod{
public testMethod(){}
public static void \u30c6\u30b9\u30c8(){}
}
Execution:
% java methodmini
java.lang.NoSuchMethodException
at java.lang.Class.getMethod(Class.java)
at methodmini.main(methodmini.java:15)
java.lang.NoSuchMethodException
at java.lang.Class.getDeclaredMethod(Class.java)
at methodmini.main(methodmini.java:23)
- relates to
-
JDK-4023100 Class.getField()/getDeclaredField() doesn't find non-ASCII field name
-
- Closed
-
-
JDK-4023102 (i18n) Class.forName doesn't work with a non-ASCII name
-
- Closed
-