8034211: [parfait] JNI exception pending in jdk/src/macosx/native/sun/awt/CFileDialog.m
authorserb
Fri, 28 Feb 2014 18:45:22 +0400
changeset 23611 72d34c61dc4a
parent 23610 5eee22a40e7b
child 23612 bac7b20c12f4
8034211: [parfait] JNI exception pending in jdk/src/macosx/native/sun/awt/CFileDialog.m Reviewed-by: pchelko, azvegint
jdk/src/macosx/native/sun/awt/CFileDialog.m
--- a/jdk/src/macosx/native/sun/awt/CFileDialog.m	Fri Feb 28 18:16:11 2014 +0400
+++ b/jdk/src/macosx/native/sun/awt/CFileDialog.m	Fri Feb 28 18:45:22 2014 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -223,9 +223,8 @@
         NSArray *urls = [dialogDelegate URLs];
         jsize count = [urls count];
 
-        jclass stringClass = (*env)->FindClass(env, "java/lang/String");
-        returnValue = (*env)->NewObjectArray(env, count, stringClass, NULL);
-        (*env)->DeleteLocalRef(env, stringClass);
+        static JNF_CLASS_CACHE(jc_String, "java/lang/String");
+        returnValue = JNFNewObjectArray(env, &jc_String, count);
 
         [urls enumerateObjectsUsingBlock:^(id url, NSUInteger index, BOOL *stop) {
             jstring filename = JNFNormalizedJavaStringForPath(env, [url path]);