Skip to content

Commit

Permalink
Added security manager check.
Browse files Browse the repository at this point in the history
Signed-off-by: Tomáš Kraus <tomas.kraus@oracle.com>
  • Loading branch information
Tomas-Kraus committed Apr 19, 2023
1 parent b8a7881 commit a47fa16
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions impl/src/main/java/org/eclipse/parsson/JsonContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ private static Integer getIntSystemProperty(String propertyName) throws JsonExce

@SuppressWarnings("removal")
private static String getSystemProperty(String propertyName) throws JsonException {
return AccessController.doPrivileged(
(PrivilegedAction<String>) () -> System.getProperty(propertyName));
}

private static String propertyAction(String propertyName) {
return System.getProperty(propertyName);
if (System.getSecurityManager() != null) {
return AccessController.doPrivileged(
(PrivilegedAction<String>) () -> System.getProperty(propertyName));
} else {
return System.getProperty(propertyName);
}
}

private static int propertyStringToInt(String propertyName, String propertyValue) throws JsonException {
Expand Down

0 comments on commit a47fa16

Please sign in to comment.