@@ -17,6 +17,7 @@ package org.openrewrite.java.tree
17
17
18
18
import org.assertj.core.api.Assertions.assertThat
19
19
import org.junit.jupiter.api.Assertions.assertTrue
20
+ import org.junit.jupiter.api.Disabled
20
21
import org.junit.jupiter.api.Test
21
22
import org.openrewrite.java.JavaParser
22
23
import org.openrewrite.java.JavaTreeTest
@@ -27,7 +28,7 @@ interface MethodDeclarationTest : JavaTreeTest {
27
28
28
29
@Test
29
30
fun default (jp : JavaParser ) = assertParsePrintAndProcess(
30
- jp, CompilationUnit , """
31
+ jp, CompilationUnit , """
31
32
public @interface A {
32
33
String foo() default "foo";
33
34
}
@@ -36,7 +37,7 @@ interface MethodDeclarationTest : JavaTreeTest {
36
37
37
38
@Test
38
39
fun constructor (jp : JavaParser ) = assertParsePrintAndProcess(
39
- jp, CompilationUnit , """
40
+ jp, CompilationUnit , """
40
41
public class A {
41
42
public A() { }
42
43
}
@@ -45,7 +46,7 @@ interface MethodDeclarationTest : JavaTreeTest {
45
46
46
47
@Test
47
48
fun typeArguments (jp : JavaParser ) = assertParsePrintAndProcess(
48
- jp, Class , """
49
+ jp, Class , """
49
50
public <P, R> R foo(P p, String s, String... args) {
50
51
return null;
51
52
}
@@ -54,7 +55,7 @@ interface MethodDeclarationTest : JavaTreeTest {
54
55
55
56
@Test
56
57
fun interfaceMethodDecl (jp : JavaParser ) = assertParsePrintAndProcess(
57
- jp, CompilationUnit , """
58
+ jp, CompilationUnit , """
58
59
public interface A {
59
60
String getName() ;
60
61
}
@@ -63,31 +64,31 @@ interface MethodDeclarationTest : JavaTreeTest {
63
64
64
65
@Test
65
66
fun throws (jp : JavaParser ) = assertParsePrintAndProcess(
66
- jp, Class , """
67
+ jp, Class , """
67
68
public void foo() throws Exception { }
68
69
"""
69
70
)
70
71
71
72
@Test
72
73
fun nativeModifier (jp : JavaParser ) = assertParsePrintAndProcess(
73
- jp, Class , """
74
+ jp, Class , """
74
75
public native void foo();
75
76
"""
76
77
)
77
78
78
79
@Test
79
80
fun methodWithSuffixMultiComment (jp : JavaParser ) = assertParsePrintAndProcess(
80
- jp, Class , """
81
+ jp, Class , """
81
82
public void foo() { }/*Comments*/
82
83
"""
83
84
)
84
85
85
86
@Test
86
87
fun hasModifier (jp : JavaParser ) {
87
88
val a = jp.parse(
88
- """
89
+ """
89
90
public class A {
90
- private static boolean foo() { return true; };
91
+ private static boolean foo() { return true; }
91
92
}
92
93
"""
93
94
)[0 ]
@@ -97,4 +98,18 @@ interface MethodDeclarationTest : JavaTreeTest {
97
98
assertTrue(inv .hasModifier(J .Modifier .Type .Private ))
98
99
assertTrue(inv .hasModifier(J .Modifier .Type .Static ))
99
100
}
101
+
102
+ @Test()
103
+ @Disabled(" Issue #405" )
104
+ fun unicodeCharacterLiterals (jp : JavaParser ) = assertParsePrintAndProcess(jp, CompilationUnit ,
105
+ """
106
+ public class A {
107
+ private boolean isSockJsSpecialChar(char ch) {
108
+ return (ch <= '\u001F') || (ch >= '\u200C' && ch <= '\u200F') ||
109
+ (ch >= '\u2028' && ch <= '\u202F') || (ch >= '\u2060' && ch <= '\u206F') ||
110
+ (ch >= '\uFFF0') || (ch >= '\uD800' && ch <= '\uDFFF');
111
+ }
112
+ }
113
+ """
114
+ )
100
115
}
0 commit comments