changeset 13468:a5912f64ba49

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
author aivanov
date Fri, 08 Mar 2019 18:38:50 +0000
parents c3e189117c37
children 64d3fca73167
files test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java
diffstat 1 files changed, 15 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java	Fri Mar 08 16:16:40 2019 +0000
+++ b/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java	Fri Mar 08 18:38:50 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * 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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,32 +28,27 @@
    @author Semyon Sadetsky
 */
 
-import javax.swing.*;
+import javax.swing.JTextField;
 import javax.swing.SwingUtilities;
 import javax.swing.text.BadLocationException;
-import java.lang.Override;
-import java.lang.Runnable;
 
 public class I18NViewNoWrapMinSpan {
 
     public static void main(String[] args) throws Exception {
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    JTextField textField = new JTextField(15);
-                    textField.setText("ม12345");
-                    float noSpaceMin = textField.getUI().getRootView(textField)
-                            .getMinimumSpan(0);
-                    textField.getDocument().insertString(3, " ", null);
-                    if (noSpaceMin > textField.getUI().getRootView(textField)
-                            .getMinimumSpan(0)) {
-                        throw new RuntimeException(
-                                "Minimum span is calculated for wrapped text");
-                    }
-                } catch (BadLocationException e) {
-                    throw new RuntimeException(e);
+        SwingUtilities.invokeAndWait(() -> {
+            try {
+                JTextField textField = new JTextField(15);
+                textField.setText("\u0E2112345");
+                float noSpaceMin = textField.getUI().getRootView(textField)
+                        .getMinimumSpan(0);
+                textField.getDocument().insertString(3, " ", null);
+                if (noSpaceMin > textField.getUI().getRootView(textField)
+                        .getMinimumSpan(0)) {
+                    throw new RuntimeException(
+                            "Minimum span is calculated for wrapped text");
                 }
+            } catch (BadLocationException e) {
+                throw new RuntimeException(e);
             }
         });
         System.out.println("ok");