mirror of https://github.com/apache/activemq.git
Merge pull request #1128 from hyteio/AMQ-9216
[AMQ-9216] Remove deprecated java.lang.SecurityManager usage from activemq-client IdGenerator
This commit is contained in:
commit
99dced2fa7
|
@ -41,17 +41,7 @@ public class IdGenerator {
|
|||
|
||||
static {
|
||||
String stub = "";
|
||||
boolean canAccessSystemProps = true;
|
||||
try {
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
sm.checkPropertiesAccess();
|
||||
}
|
||||
} catch (SecurityException se) {
|
||||
canAccessSystemProps = false;
|
||||
}
|
||||
|
||||
if (canAccessSystemProps) {
|
||||
int idGeneratorPort = 0;
|
||||
ServerSocket ss = null;
|
||||
try {
|
||||
|
@ -85,7 +75,6 @@ public class IdGenerator {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hostName == null) {
|
||||
hostName = "localhost";
|
||||
|
|
|
@ -41,17 +41,6 @@ public class IdGenerator {
|
|||
|
||||
static {
|
||||
String stub = "";
|
||||
boolean canAccessSystemProps = true;
|
||||
try {
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) {
|
||||
sm.checkPropertiesAccess();
|
||||
}
|
||||
} catch (SecurityException se) {
|
||||
canAccessSystemProps = false;
|
||||
}
|
||||
|
||||
if (canAccessSystemProps) {
|
||||
|
||||
hostName = System.getProperty(PROPERTY_IDGENERATOR_HOSTNAME);
|
||||
int localPort = Integer.parseInt(System.getProperty(PROPERTY_IDGENERATOR_LOCALPORT, "0"));
|
||||
|
@ -97,7 +86,7 @@ public class IdGenerator {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fallback
|
||||
if (hostName == null) {
|
||||
hostName = "localhost";
|
||||
|
|
Loading…
Reference in New Issue