Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Sep 26, 2024
1 parent e49610d commit 9124bcc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ buildscript {
}
} else {
// This is triggered to work on openjdk 1.8.0_91
// The ProcessEnvironment$Variable is the key of the map
java.lang.Class variableClass = (java.lang.Class) java.lang.Class.forName("java.lang.ProcessEnvironment$Variable");
// The ProcessEnvironment\$Variable is the key of the map
java.lang.Class variableClass = (java.lang.Class) java.lang.Class.forName("java.lang.ProcessEnvironment\$Variable");
var convertToVariable = variableClass.getMethod("valueOf", String.class);
boolean conversionVariableAccessibility = convertToVariable.isAccessible();
convertToVariable.setAccessible(true);

// The ProcessEnvironment$Value is the value fo the map
java.lang.Class valueClass = (java.lang.Class) java.lang.Class.forName("java.lang.ProcessEnvironment$Value");
// The ProcessEnvironment\$Value is the value fo the map
java.lang.Class valueClass = (java.lang.Class) java.lang.Class.forName("java.lang.ProcessEnvironment\$Value");
var convertToValue = valueClass.getMethod("valueOf", String.class);
boolean conversionValueAccessibility = convertToValue.isAccessible();
convertToValue.setAccessible(true);
Expand All @@ -55,7 +55,7 @@ buildscript {
var theCaseInsensitiveEnvironmentField = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
boolean insensitiveAccessibility = theCaseInsensitiveEnvironmentField.isAccessible();
theCaseInsensitiveEnvironmentField.setAccessible(true);
// Not entirely sure if this needs to be casted to ProcessEnvironment$Variable and $Value as well
// Not entirely sure if this needs to be casted to ProcessEnvironment\$Variable and \$Value as well
Map cienv = (Map) theCaseInsensitiveEnvironmentField.get(null);
if (value == null) {
// remove if null
Expand All @@ -71,8 +71,8 @@ buildscript {
// we could not find theEnvironment
Map<String, String> env = System.getenv();
Stream.of(Collections.class.getDeclaredClasses())
// obtain the declared classes of type $UnmodifiableMap
.filter(c1 -> "java.util.Collections$UnmodifiableMap".equals(c1.getName()))
// obtain the declared classes of type \$UnmodifiableMap
.filter(c1 -> "java.util.Collections\$UnmodifiableMap".equals(c1.getName()))
.map(c1 -> {
try {
return c1.getDeclaredField("m");
Expand Down

0 comments on commit 9124bcc

Please sign in to comment.