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

IllegalArgumentException getMessage() becomes null after 16 calls.

    XMLWordPrintable

Details

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10. Java 1.8u152

      A DESCRIPTION OF THE PROBLEM :
      I expect the same exception type with the same message for each call of attached source code.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run attached source code.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the same exception type with the same message for each call.
      ACTUAL -
      The message changes after 16th invocation.

      ---------- BEGIN SOURCE ----------
      package test;

      import java.lang.reflect.Method;

      public class Start {

          public static int method(byte a, int b) {
              return b + a;
          }

          public static void main(String[] args) throws Exception {
              int i = 0;
              Method m = Start.class.getMethod("method", new Class<?>[] { byte.class, int.class });
              while (i < 17) {
                  try {
                      m.invoke(null, new Double(0), new Integer(0));
                  } catch (IllegalArgumentException e) {
                      // e.printStackTrace();
                      System.out.println(e.getMessage());
                  }
                  i++;
              }

          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              darcy Joe Darcy
              webbuggrp Webbug Group
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: