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

Hotspot execute a correct test cases and report NoClassDefFoundError

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Microsoft Windows 10 Professional
      10.0.19044 Build 19044
      AMD Ryzen 5 5600G with Radeon Graphics 3.90 GHz
      Memory 32 GB

      openjdk version "1.8.0_332"
      OpenJDK Runtime Environment (Temurin)(build 1.8.0_332-b09)
      OpenJDK 64-Bit Server VM (Temurin)(build 25.332-b09, mixed mode)

      openjdk version "11.0.15" 2022-04-19
      OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10)
      OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      In test case testCase20, we tried to call testCase20_2's test_mula () method after catching Throwable var1, but hotspot will report the java.lang. NoClassDefFoundError that caused the application to terminate.

      ACTUAL -
      Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class testCase20_2
              at testCase20.run(testCase20.java:15)
              at testCase20.main(testCase20.java:7)

      ---------- BEGIN SOURCE ----------

      public class testCase20 {
          public testCase20() {
          }

          public static void main(String[] var0) {
              (new testCase20()).run();
          }

          public void run() {
              try {
                  this.run();
              } catch (Throwable var1) {
                  double[] var10001 = new double[2];
                  testCase20_2.test_mula(var10001, var10001, var10001);
              }

          }
      }
      class testCase20_2 {
          public static int my_check_sum = 0;

          static {
              my_check_sum = check_sum.run(my_check_sum, my_check_sum);
          }

          public testCase20_2() {
          }

          public static void test_mula(double[] var0, double[] var1, double[] var2) {


          }
      }
      class check_sum {
          public check_sum() {
          }

          public static int run(int var0, int var1) {
              var0 += Integer.hashCode(var1);
              return Integer.hashCode(var0);
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            dholmes David Holmes
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: