changeset 9604:50f46b8416bb

8035756: [parfait] JNI exception pending in windows/native/sun/java2d/windows/WindowsFlags.cpp Reviewed-by: serb, pchelko
author azvegint
date Wed, 05 Mar 2014 15:47:27 +0400
parents 0e914bbdc744
children 166f72ffcf18
files src/windows/native/sun/java2d/windows/WindowsFlags.cpp
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/java2d/windows/WindowsFlags.cpp	Wed Mar 05 16:36:49 2014 +0400
+++ b/src/windows/native/sun/java2d/windows/WindowsFlags.cpp	Wed Mar 05 15:47:27 2014 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,12 +47,15 @@
 {
     wFlagsClassID = (jclass)env->NewGlobalRef(wFlagsClass);
     d3dEnabledID = env->GetStaticFieldID(wFlagsClass, "d3dEnabled", "Z");
+    CHECK_NULL(d3dEnabledID);
     d3dSetID = env->GetStaticFieldID(wFlagsClass, "d3dSet", "Z");
+    CHECK_NULL(d3dSetID);
 }
 
 BOOL GetStaticBoolean(JNIEnv *env, jclass wfClass, const char *fieldName)
 {
     jfieldID fieldID = env->GetStaticFieldID(wfClass, fieldName, "Z");
+    CHECK_NULL_RETURN(fieldID, FALSE);
     return env->GetStaticBooleanField(wfClass, fieldID);
 }
 
@@ -60,6 +63,7 @@
                         const char *signature)
 {
     jfieldID fieldID = env->GetStaticFieldID(wfClass, fieldName, signature);
+    CHECK_NULL_RETURN(fieldID, NULL);
     return env->GetStaticObjectField(wfClass, fieldID);
 }
 
@@ -90,15 +94,17 @@
     forceD3DUsage = d3dSet;
     g_offscreenSharing = GetStaticBoolean(env, wFlagsClass,
                                           "offscreenSharingEnabled");
+    JNU_CHECK_EXCEPTION(env);
     accelReset = GetStaticBoolean(env, wFlagsClass, "accelReset");
+    JNU_CHECK_EXCEPTION(env);
     checkRegistry = GetStaticBoolean(env, wFlagsClass, "checkRegistry");
+    JNU_CHECK_EXCEPTION(env);
     disableRegistry = GetStaticBoolean(env, wFlagsClass, "disableRegistry");
-    jstring javaVersionString = (jstring)GetStaticObject(env, wFlagsClass,
-                                                         "javaVersion",
-                                                         "Ljava/lang/String;");
+    JNU_CHECK_EXCEPTION(env);
 
     setHighDPIAware =
         (IS_WINVISTA && GetStaticBoolean(env, wFlagsClass, "setHighDPIAware"));
+    JNU_CHECK_EXCEPTION(env);
 
     J2dTraceLn(J2D_TRACE_INFO, "WindowsFlags (native):");
     J2dTraceLn1(J2D_TRACE_INFO, "  d3dEnabled = %s",
@@ -166,6 +172,7 @@
                                                      jclass wFlagsClass)
 {
     SetIDs(env, wFlagsClass);
+    JNU_CHECK_EXCEPTION(env);
     GetFlagValues(env, wFlagsClass);
 }