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

Throwable().getMessage() returns empty string on x86

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • hotspot
    • None
    • generic
    • generic

      The following code is an example of this bug where an exception occurs, the string with which the Throwable was created returns nothing. Only the name of the exception is printed.

      Note this occurs on x86 platform only.

      public static int run(String args[],PrintStream out) {
      Coordinates u;
      Pair x;
      Triple y;

      x = new Pair(0.1f, -3.14f);
      u = x;
      try {
      y = (Triple) u;
      } catch (ClassCastException e) {
      out.println(e);
      out.println(e.getMessage());
      return 1;
      }
      y.print("y", out);
      return 1;
      }

      Actual output:
      java.lang.ClassCastException:

      Expected output:
      java.lang.ClassCastException: javasoft.sqe.tests.java_spec.expr018.Pair
      javasoft.sqe.tests.java_spec.expr018.Pair

            never Tom Rodriguez
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: