Skip to content
Permalink
Browse files
8263490: [macos] Crash occurs on JPasswordField with activated InputM…
…ethod

Reviewed-by: dmarkov, serb, kizune
  • Loading branch information
Toshio Nakamura authored and Dmitry Markov committed Mar 15, 2021
1 parent 8afec70 commit 32c7fcc67010e44411918cc73681422fd8b7a67a
Showing 1 changed file with 5 additions and 1 deletion.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2021, 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
@@ -1164,8 +1164,12 @@ - (NSAttributedString *) attributedSubstringForProposedRange:(NSRange)theRange a
#ifdef IM_DEBUG
fprintf(stderr, "AWTView InputMethod Selector Called : [attributedSubstringFromRange] location=%lu, length=%lu\n", (unsigned long)theRange.location, (unsigned long)theRange.length);
#endif // IM_DEBUG
if (!fInputMethodLOCKABLE) {
return nil;
}

JNIEnv *env = [ThreadUtilities getJNIEnv];
GET_CIM_CLASS_RETURN(nil);
DECLARE_METHOD_RETURN(jm_substringFromRange, jc_CInputMethod, "attributedSubstringFromRange", "(II)Ljava/lang/String;", nil);
jobject theString = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_substringFromRange, theRange.location, theRange.length);
CHECK_EXCEPTION_NULL_RETURN(theString, nil);

1 comment on commit 32c7fcc

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 32c7fcc Mar 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.