|
1 | 1 | /*
|
2 |
| - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
@@ -115,7 +115,7 @@ packetToByteArray(JNIEnv *env, jdwpPacket *str)
|
115 | 115 |
|
116 | 116 | /* total packet length is header + data */
|
117 | 117 | array = (*env)->NewByteArray(env, total_length);
|
118 |
| - if ((*env)->ExceptionOccurred(env)) { |
| 118 | + if ((*env)->ExceptionCheck(env)) { |
119 | 119 | return NULL;
|
120 | 120 | }
|
121 | 121 |
|
@@ -144,7 +144,7 @@ packetToByteArray(JNIEnv *env, jdwpPacket *str)
|
144 | 144 | if (data_length > 0) {
|
145 | 145 | (*env)->SetByteArrayRegion(env, array, JDWP_HEADER_SIZE,
|
146 | 146 | data_length, str->type.cmd.data);
|
147 |
| - if ((*env)->ExceptionOccurred(env)) { |
| 147 | + if ((*env)->ExceptionCheck(env)) { |
148 | 148 | return NULL;
|
149 | 149 | }
|
150 | 150 | }
|
@@ -174,7 +174,7 @@ byteArrayToPacket(JNIEnv *env, jbyteArray b, jdwpPacket *str)
|
174 | 174 | * Get the packet header
|
175 | 175 | */
|
176 | 176 | (*env)->GetByteArrayRegion(env, b, 0, sizeof(pktHeader), pktHeader);
|
177 |
| - if ((*env)->ExceptionOccurred(env)) { |
| 177 | + if ((*env)->ExceptionCheck(env)) { |
178 | 178 | /* b shorter than sizeof(pktHeader) */
|
179 | 179 | return;
|
180 | 180 | }
|
@@ -221,7 +221,7 @@ byteArrayToPacket(JNIEnv *env, jbyteArray b, jdwpPacket *str)
|
221 | 221 | }
|
222 | 222 |
|
223 | 223 | (*env)->GetByteArrayRegion(env, b, sizeof(pktHeader), /*sizeof(CmdPacket)+4*/ data_length, data);
|
224 |
| - if ((*env)->ExceptionOccurred(env)) { |
| 224 | + if ((*env)->ExceptionCheck(env)) { |
225 | 225 | free(data);
|
226 | 226 | return;
|
227 | 227 | }
|
@@ -326,7 +326,7 @@ JNIEXPORT void JNICALL Java_com_sun_tools_jdi_SharedMemoryConnection_sendPacket0
|
326 | 326 | jint rc;
|
327 | 327 |
|
328 | 328 | byteArrayToPacket(env, b, &packet);
|
329 |
| - if ((*env)->ExceptionOccurred(env)) { |
| 329 | + if ((*env)->ExceptionCheck(env)) { |
330 | 330 | return;
|
331 | 331 | }
|
332 | 332 |
|
|
0 commit comments