-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new record pattern test, fix FMT processor ref
- Loading branch information
Showing
7 changed files
with
218 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package pkg; | ||
|
||
import java.lang.runtime.TemplateRuntime; | ||
import java.util.FormatProcessor; | ||
|
||
public class TestFmtProcessor { | ||
public void test() { | ||
String s = "Hello";// 7 | ||
int i = 42;// 8 | ||
double d = 3.14159;// 9 | ||
System.out.println(TemplateRuntime.processStringTemplate<"process",FormatProcessor::FMT,"Text: %s"," %4d"," %.2f","">(FormatProcessor.FMT, s, i, d));// 11 | ||
}// 12 | ||
} | ||
|
||
class 'pkg/TestFmtProcessor' { | ||
method 'test ()V' { | ||
0 7 | ||
1 7 | ||
2 7 | ||
3 8 | ||
4 8 | ||
5 8 | ||
6 9 | ||
7 9 | ||
8 9 | ||
9 9 | ||
a 10 | ||
b 10 | ||
c 10 | ||
d 10 | ||
e 10 | ||
f 10 | ||
10 10 | ||
11 10 | ||
12 10 | ||
13 10 | ||
14 10 | ||
15 10 | ||
16 10 | ||
17 10 | ||
18 10 | ||
19 10 | ||
1a 10 | ||
1b 11 | ||
} | ||
} | ||
|
||
Lines mapping: | ||
7 <-> 8 | ||
8 <-> 9 | ||
9 <-> 10 | ||
11 <-> 11 | ||
12 <-> 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package pkg; | ||
|
||
public class TestRecordPatterns2 { | ||
public void test1(TestRecordPatterns2.R r) { | ||
if (r instanceof TestRecordPatterns2.R) { | ||
TestRecordPatterns2.R var10000 = r; | ||
|
||
try { | ||
var6 = var10000.x(); | ||
} catch (Throwable var5) {// 9 | ||
throw new MatchException(var5.toString(), var5); | ||
} | ||
|
||
int var4 = var6; | ||
System.out.println(var4);// 10 | ||
} | ||
}// 12 | ||
|
||
static record R(int x) { | ||
} | ||
} | ||
|
||
class 'pkg/TestRecordPatterns2' { | ||
method 'test1 (Lpkg/TestRecordPatterns2$R;)V' { | ||
0 4 | ||
1 4 | ||
2 4 | ||
3 4 | ||
4 4 | ||
7 5 | ||
9 5 | ||
a 8 | ||
d 13 | ||
e 13 | ||
f 14 | ||
10 14 | ||
12 14 | ||
13 14 | ||
14 14 | ||
15 14 | ||
16 14 | ||
1c 9 | ||
21 10 | ||
22 10 | ||
23 10 | ||
24 10 | ||
25 10 | ||
29 10 | ||
2a 16 | ||
} | ||
} | ||
|
||
Lines mapping: | ||
9 <-> 10 | ||
10 <-> 15 | ||
12 <-> 17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package pkg; | ||
|
||
public class TestRecordPatterns2 { | ||
record R(int x) { | ||
|
||
} | ||
|
||
public void test1(R r) { | ||
if (r instanceof R(int z)) { | ||
System.out.println(z); | ||
} | ||
} | ||
} |