8034209: [parfait] JNI exception pending in jdk/src/macosx/native/sun/awt/CClipboard.m
authorserb
Fri, 28 Feb 2014 18:16:11 +0400
changeset 23610 5eee22a40e7b
parent 23609 e5d09a0f6bdc
child 23611 72d34c61dc4a
8034209: [parfait] JNI exception pending in jdk/src/macosx/native/sun/awt/CClipboard.m Reviewed-by: pchelko, azvegint
jdk/src/macosx/native/sun/awt/CClipboard.m
--- a/jdk/src/macosx/native/sun/awt/CClipboard.m	Fri Feb 28 17:56:53 2014 +0400
+++ b/jdk/src/macosx/native/sun/awt/CClipboard.m	Fri Feb 28 18:16:11 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
@@ -23,14 +23,13 @@
  * questions.
  */
 
-#include "CClipboard.h"
-#include "CDataTransferer.h"
+#import "CClipboard.h"
+#import "CDataTransferer.h"
+#import "ThreadUtilities.h"
+#import "jni_util.h" 
 #import <Cocoa/Cocoa.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
-#include "ThreadUtilities.h"
-
-
 static CClipboard *sClipboard = nil;
 
 //
@@ -246,6 +245,7 @@
 JNF_COCOA_ENTER(env);
     jint nBytes = (*env)->GetArrayLength(env, inBytes);
     jbyte *rawBytes = (*env)->GetPrimitiveArrayCritical(env, inBytes, NULL);
+    CHECK_NULL(rawBytes);
     NSData *bytesAsData = [NSData dataWithBytes:rawBytes length:nBytes];
     (*env)->ReleasePrimitiveArrayCritical(env, inBytes, rawBytes, JNI_ABORT);
     NSString *format = formatForIndex(inFormat);