Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4023101

Class.getMethod()/getDeclaredMethod() doesn't find non-ASCII method name

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1fcs
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Description


      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)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nsaraiyasunw Nakul Saraiya (Inactive)
              Reporter:
              okutsu Masayoshi Okutsu
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: