提交 44ea06ca 编写于 作者: A aivanov

8133731: [TEST_BUG] Unmappable in ASCII character such as Thai should be...

8133731: [TEST_BUG] Unmappable in ASCII character such as Thai should be escaped in the regtests targeted for a regular non-I18n runs
Summary: Lambdafy, and replace character string literal characters with unicode.
Reviewed-by: serb, alexsch
上级 1a80de80
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -28,32 +28,27 @@ ...@@ -28,32 +28,27 @@
@author Semyon Sadetsky @author Semyon Sadetsky
*/ */
import javax.swing.*; import javax.swing.JTextField;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
import java.lang.Override;
import java.lang.Runnable;
public class I18NViewNoWrapMinSpan { public class I18NViewNoWrapMinSpan {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
SwingUtilities.invokeAndWait(new Runnable() { SwingUtilities.invokeAndWait(() -> {
@Override try {
public void run() { JTextField textField = new JTextField(15);
try { textField.setText("\u0E2112345");
JTextField textField = new JTextField(15); float noSpaceMin = textField.getUI().getRootView(textField)
textField.setText("ม12345"); .getMinimumSpan(0);
float noSpaceMin = textField.getUI().getRootView(textField) textField.getDocument().insertString(3, " ", null);
.getMinimumSpan(0); if (noSpaceMin > textField.getUI().getRootView(textField)
textField.getDocument().insertString(3, " ", null); .getMinimumSpan(0)) {
if (noSpaceMin > textField.getUI().getRootView(textField) throw new RuntimeException(
.getMinimumSpan(0)) { "Minimum span is calculated for wrapped text");
throw new RuntimeException(
"Minimum span is calculated for wrapped text");
}
} catch (BadLocationException e) {
throw new RuntimeException(e);
} }
} catch (BadLocationException e) {
throw new RuntimeException(e);
} }
}); });
System.out.println("ok"); System.out.println("ok");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册