Skip to content

Commit

Permalink
Merge pull request #627 from basil/reflection
Browse files Browse the repository at this point in the history
Reduce reflection in `CpsFlowExecution`
  • Loading branch information
jglick authored Dec 5, 2022
2 parents c7abfb1 + 67a4565 commit 4bd9b8c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,13 @@ private static void cleanUpClassHelperCache(@NonNull Class<?> clazz) throws Exce
}

private static void cleanUpObjectStreamClassCaches(@NonNull Class<?> clazz) throws Exception {
int releaseVersion = JavaSpecificationVersion.forCurrentJVM().toReleaseVersion();
VersionNumber javaVersion = new VersionNumber(System.getProperty("java.version"));
if ((releaseVersion < 11)
|| (releaseVersion == 11 && javaVersion.isOlderThan(new VersionNumber("11.0.16")))
|| (releaseVersion > 11 && releaseVersion < 17)
|| (releaseVersion == 17 && javaVersion.isOlderThan(new VersionNumber("17.0.4")))
|| (releaseVersion == 18 && javaVersion.isOlderThan(new VersionNumber("18.0.2")))) {
Class<?> cachesC = Class.forName("java.io.ObjectStreamClass$Caches");
for (String cacheFName : new String[] {"localDescs", "reflectors"}) {
Field cacheF = cachesC.getDeclaredField(cacheFName);
Expand All @@ -1502,6 +1509,7 @@ private static void cleanUpObjectStreamClassCaches(@NonNull Class<?> clazz) thro
}
}
}
}
}

synchronized @CheckForNull FlowHead getFirstHead() {
Expand Down

0 comments on commit 4bd9b8c

Please sign in to comment.