8034211: [parfait] JNI exception pending in jdk/src/macosx/native/sun/awt/CFileDialog.m
Reviewed-by: pchelko, azvegint
--- 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]);