@@ -175,41 +175,6 @@ int printExceptionAndFreeV(JNIEnv *env, jthrowable exc, int noPrintFlags,
175175 excErrno = EINTERNAL ;
176176 }
177177
178- // Print exception using Java System.out.println and printStackTrace
179- {
180- jclass systemClass = (* env )-> FindClass (env , "java/lang/System" );
181- if (systemClass ) {
182- jfieldID outField = (* env )-> GetStaticFieldID (env , systemClass , "out" , "Ljava/io/PrintStream;" );
183- if (outField ) {
184- jobject outStream = (* env )-> GetStaticObjectField (env , systemClass , outField );
185- if (outStream ) {
186- jclass printStreamClass = (* env )-> FindClass (env , "java/io/PrintStream" );
187- if (printStreamClass ) {
188- jmethodID printlnMethod = (* env )-> GetMethodID (env , printStreamClass , "println" , "(Ljava/lang/String;)V" );
189- if (printlnMethod ) {
190- jstring message = (* env )-> NewStringUTF (env , "Exception occurred:" );
191- (* env )-> CallVoidMethod (env , outStream , printlnMethod , message );
192- (* env )-> DeleteLocalRef (env , message );
193- }
194- (* env )-> DeleteLocalRef (env , printStreamClass );
195- }
196- (* env )-> DeleteLocalRef (env , outStream );
197- }
198- }
199- (* env )-> DeleteLocalRef (env , systemClass );
200- }
201-
202- // Call printStackTrace on the exception
203- jclass excClass = (* env )-> GetObjectClass (env , exc );
204- if (excClass ) {
205- jmethodID printStackTraceMethod = (* env )-> GetMethodID (env , excClass , "printStackTrace" , "()V" );
206- if (printStackTraceMethod ) {
207- (* env )-> CallVoidMethod (env , exc , printStackTraceMethod );
208- }
209- (* env )-> DeleteLocalRef (env , excClass );
210- }
211- }
212-
213178 // We don't want to use ExceptionDescribe here, because that requires a
214179 // pending exception. Instead, use ExceptionUtils.
215180 rootCause = getExceptionUtilString (env , exc , "getRootCauseMessage" );
0 commit comments