Skip to content
This repository has been archived by the owner. It is now read-only.
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 with 5 additions and 1 deletion.
  1. +5 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
@@ -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);

0 comments on commit 32c7fcc

Please sign in to comment.