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

Improve error handling in src/share/vm/services/management.cpp

XMLWordPrintable

      JNIEXPORT jobject JNICALL
      Java_sun_management_MemoryPoolImpl_getUsage0
        (JNIEnv *env, jobject pool)
      {
          jobject usage = jmm_interface->GetMemoryPoolUsage(env, pool);
          if (usage == NULL) {
              // Throw internal error since this implementation expects the
              // pool will never become invalid.
              JNU_ThrowInternalError(env, "Memory Pool not found");
          }
          return usage;
      }

      This function as well as Java_sun_management_MemoryPoolImpl_getMemoryManagers0, Java_sun_management_MemoryPoolImpl_getPeakUsage0 should propagate the exception that may be returned by the jmm call rather than throw InternalError.

            jgeorge Jini George (Inactive)
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: