Skip to content

Commit 0dd032e

Browse files
dnestorogradinac
authored andcommitted
Allow type reachable from java.lang if the name is also from java.lang
1 parent df4284a commit 0dd032e

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

.github/workflows/test-changed-metadata.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ jobs:
6767
sudo bash -c "cat ./.github/workflows/dockerd.service > /etc/systemd/system/docker.service.d/http-proxy.conf"
6868
sudo systemctl daemon-reload
6969
sudo systemctl restart docker
70-
- name: "🧪 Run '${{ matrix.coordinates }}' tests"
71-
run: |
72-
./gradlew test -Pcoordinates=${{ matrix.coordinates }}
7370
- name: "🔎 Check metadata config files content"
7471
run: |
7572
./gradlew checkConfigFiles --coordinates=${{ matrix.coordinates }}
73+
- name: "🧪 Run '${{ matrix.coordinates }}' tests"
74+
run: |
75+
./gradlew test -Pcoordinates=${{ matrix.coordinates }}
7676
7777
all-metadata-passed:
7878
name: "🧪 All metadata tests have passed"

metadata/javax.cache/cache-api/1.1.1/serialization-config.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@
2525
"typeReachable": "javax.cache.expiry.EternalExpiryPolicy"
2626
},
2727
"name": "javax.cache.expiry.EternalExpiryPolicy"
28+
},
29+
{
30+
"condition": {
31+
"typeReachable": "java.lang.Object"
32+
},
33+
"name": "java.lang.String"
34+
},
35+
{
36+
"condition": {
37+
"typeReachable": "java.lang.Object"
38+
},
39+
"name": "java.lang.Number"
40+
},
41+
{
42+
"condition": {
43+
"typeReachable": "java.lang.Object"
44+
},
45+
"name": "java.lang.Integer"
2846
}
2947
]
3048
}

tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ConfigFilesChecker.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,25 @@ private boolean containsDuplicatedEntries(List<Map<String, Object>> entries, Fil
264264

265265
@SuppressWarnings("unchecked")
266266
private boolean checkTypeReachable(Map<String, Object> entry, File file) {
267-
// check if condition entry exists
268267
Map<String, Object> condition = (Map<String, Object>) entry.get("condition");
268+
String entryName = (String) entry.get("name");
269+
270+
// check if condition entry exists
269271
if (condition == null) {
270272
System.out.println("ERROR: In file " + file.toURI() + " there is an entry " + entry + " with missing condition field.");
271273
return true;
272274
}
273275

274-
// check if typeReachable exists inside condition entry
275276
String typeReachable = (String) condition.get("typeReachable");
277+
278+
// check if both entry name and typeReachable are from java.lang since there are some cases where this is allowed
279+
if (entryName != null && entryName.startsWith("java.lang") && typeReachable.startsWith("java.lang")) {
280+
return false;
281+
}
282+
283+
// check if typeReachable exists inside condition entry
276284
if (ILLEGAL_TYPE_VALUES.stream().anyMatch(typeReachable::startsWith)) {
277285
// get name of entry that misses typeReachable. If name cannot be determinate, write whole entry
278-
String entryName = (String) entry.get("name");
279286
if (entryName == null) {
280287
entryName = entry.toString();
281288
}

0 commit comments

Comments
 (0)