Commit b77a32b
authored
chore: prepare showcase for GraalVM for JDK 17 (#3734)
Full context in [GraalVM 17 migration
doc](https://docs.google.com/document/d/1bOeGtVFLsq5ts71If5pFXCvHIeNpbtBRvF6XQfavLZs/edit?tab=t.loipy7ydvwga)
Confirmation that this works:
googleapis/java-shared-config@9530494
### Problem
JDK 17 `InputStreamReader` produces different bytes from JDK 18+. This
affects `ITHttpAnnotation#testComplianceGroup` because of the way
`compliance_suite.json` is parsed.
### Cause
JDK 18 was released including commit
[7fc854](openjdk/jdk@7fc8540)
which enables usage of UTF-8 by default. Before this commit, each JVM
will produce their own default Charset (_likely the reason we don't see
this error in other CI setups using java 17_). As a confirmation, if we
create an experiment test to print the default charset as in:
```java
@test
void verifyByteSizeOfExtremePayload() throws IOException {
System.out.println(System.getProperty("file.encoding"));
}
```
When using openjdk 17 we get the value `Cp1252`, and on openjdk 18 we
get the value `UTF-8`.
Solution
### Solution
Finally, the solution is to explicitly use UTF-8 with the
`InputStreamReader`1 parent 1c0841f commit b77a32b
File tree
1 file changed
+3
-1
lines changed- java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it
1 file changed
+3
-1
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
0 commit comments