SUGGESTED FIX
*** /tmp/geta2149 28 17:50:25 2005
--- awt_Font.cpp 28 17:50:00 2005
***************
*** 708,713 ****
--- 708,714 ----
* extend buflen and bad things will happen.
*/
unsigned char* buffer = NULL;
+ jboolean unicodeUsed = env->GetBooleanField(fontDescriptor,AwtFont::useUnicodeID);
try {
buffer = (unsigned char *)
env->GetPrimitiveArrayCritical(convertedBytes, 0);
***************
*** 722,728 ****
*/
char* offsetBuffer = (char *)(buffer + 4);
! if (env->GetBooleanField(fontDescriptor,AwtFont::useUnicodeID)) {
VERIFY(!draw || ::TextOutW(hDC, x, y, (LPCWSTR)offsetBuffer, buflen / 2));
VERIFY(::GetTextExtentPoint32W(hDC, (LPCWSTR)offsetBuffer, buflen / 2, &temp));
}
--- 723,729 ----
*/
char* offsetBuffer = (char *)(buffer + 4);
! if (unicodeUsed) {
VERIFY(!draw || ::TextOutW(hDC, x, y, (LPCWSTR)offsetBuffer, buflen / 2));
VERIFY(::GetTextExtentPoint32W(hDC, (LPCWSTR)offsetBuffer, buflen / 2, &temp));
}
###@###.### 2005-1-28 14:53:52 GMT
|
EVALUATION
1.4.2_07:
(Haven't looked at 1.5+)
JNI Warning messages path:
checked_jni_GetBooleanField(JNIEnv_ * 0x007445c4, _jobject * 0x0076b220, _jfieldID * 0xebc9f863) line 991 + 172 bytes
JNIEnv_::GetBooleanField(_jobject * 0x0076b220, _jfieldID * 0xebc9f863) line 1255
src/windows/native/sun/windows/awt_Font.cpp:
800 unsigned char* buffer = NULL;
801 try {
802 buffer = (unsigned char *)
803 env->GetPrimitiveArrayCritical(convertedBytes, 0);
________________________________________________
804 int buflen = (buffer[0] << 24) | (buffer[1] << 16) |
805 (buffer[2] << 8) | buffer[3];
806
807 DASSERT(buflen >= 0);
808
809 /*
810 * the offsetBuffer, on the other hand, must be signed because
811 * TextOutA and GetTextExtentPoint32A expect it.
812 */
813 char* offsetBuffer = (char *)(buffer + 4);
814
815 if (env->GetBooleanField(fontDescriptor,AwtFont::useUnicodeID)) {
====================
Causes :
"Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical"
message in -Xcheck:jni
816 VERIFY(!draw || ::TextOutW(hDC, x, y, (LPCWSTR)offsetBuffer, buflen / 2));
817 VERIFY(::GetTextExtentPoint32W(hDC, (LPCWSTR)offsetBuffer, buflen / 2, &temp));
818 }
819 else {
820 VERIFY(!draw || ::TextOutA(hDC, x, y, offsetBuffer, buflen));
821 VERIFY(::GetTextExtentPoint32A(hDC, offsetBuffer, buflen, &temp));
822 }
823 } catch (...) {
824 if (buffer != NULL) {
825 env->ReleasePrimitiveArrayCritical(convertedBytes, buffer,
826 0);
827 }
828 throw;
829 }
830 env->ReleasePrimitiveArrayCritical(convertedBytes, buffer, 0);
AwtFont::DrawStringSize_sub(_jstring * 0x0006f408, HDC__ * 0x8c010447, _jobject * 0x0076b20c, long 0, long 0, int 0, unsigned int 0) line 815 + 18 bytes
AwtFont::getMFStringSize(HDC__ * 0x8c010447, _jobject * 0x0076b20c, _jstring * 0x0006f408, unsigned int 0) line 204 + 27 bytes
AwtFont::getMFStringWidth(HDC__ * 0x8c010447, _jobject * 0x0076b20c, _jstring * 0x0006f408) line 210 + 19 bytes
Java_sun_awt_windows_WFontMetrics_stringWidth(JNIEnv_ * 0x007445c4, _jobject * 0x0006f40c, _jstring * 0x0006f408) line 881 + 17 bytes
AwtToolkit::MessageLoop(void (void)* 0x187d86df AwtToolkit::PrimaryIdleFunc(void), int (tagMSG &)* 0x187d8709 AwtToolkit::CommonPeekMessageFunc(tagMSG &)) line 956
Java_sun_awt_windows_WToolkit_eventLoop(JNIEnv_ * 0x00795304, _jobject * 0x18d9fc40) line 1653
###@###.### 2004-12-16 20:06:32 GMT
Reproducible with last Tiger builds excluding updates.
Already fixed during 5076963 (fixed in Tiger update 3 and Mustang) and will be closed as duplicate.
###@###.### 2004-12-17 10:50:12 GMT
Possibly another bug not related with pointed above. Assign to 2D for make decision since awt_Font.cpp causes warning.
###@###.### 2004-12-20 13:15:54 GMT
It would be sufficient to move condition definition outside of GetPrimitiveArrayCritical/ReleasePrimitiveArrayCritical.
###@###.### 2005-1-28 14:53:52 GMT
|