mirror of
https://github.com/corda/corda.git
synced 2025-06-22 17:09:00 +00:00
Merge remote branch 'origin/master' into openjdk
Conflicts: classpath/java/lang/String.java src/posix.cpp
This commit is contained in:
30
classpath/java/lang/SecurityManager.java
Normal file
30
classpath/java/lang/SecurityManager.java
Normal file
@ -0,0 +1,30 @@
|
||||
/* Copyright (c) 2010, Avian Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice appear
|
||||
in all copies.
|
||||
|
||||
There is NO WARRANTY for this software. See license.txt for
|
||||
details. */
|
||||
|
||||
package java.lang;
|
||||
|
||||
import java.security.AccessController;
|
||||
import java.security.Permission;
|
||||
import java.security.SecurityPermission;
|
||||
|
||||
public class SecurityManager {
|
||||
|
||||
public SecurityManager() {
|
||||
}
|
||||
|
||||
public void checkPermission(Permission perm) {
|
||||
AccessController.checkPermission(perm);
|
||||
}
|
||||
|
||||
public void checkSecurityAccess(String target) {
|
||||
checkPermission(new SecurityPermission(target));
|
||||
}
|
||||
|
||||
}
|
@ -235,19 +235,31 @@ public final class String
|
||||
}
|
||||
|
||||
public String toLowerCase() {
|
||||
char[] b = new char[length];
|
||||
for (int i = 0; i < length; ++i) {
|
||||
b[i] = Character.toLowerCase(charAt(i));
|
||||
for (int j = 0; j < length; ++j) {
|
||||
char ch = charAt(j);
|
||||
if (Character.toLowerCase(ch) != ch) {
|
||||
char[] b = new char[length];
|
||||
for (int i = 0; i < length; ++i) {
|
||||
b[i] = Character.toLowerCase(charAt(i));
|
||||
}
|
||||
return new String(b, 0, length, false);
|
||||
}
|
||||
}
|
||||
return new String(b, 0, length, false);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String toUpperCase() {
|
||||
char[] b = new char[length];
|
||||
for (int i = 0; i < length; ++i) {
|
||||
b[i] = Character.toUpperCase(charAt(i));
|
||||
for (int j = 0; j < length; ++j) {
|
||||
char ch = charAt(j);
|
||||
if (Character.toUpperCase(ch) != ch) {
|
||||
char[] b = new char[length];
|
||||
for (int i = 0; i < length; ++i) {
|
||||
b[i] = Character.toUpperCase(charAt(i));
|
||||
}
|
||||
return new String(b, 0, length, false);
|
||||
}
|
||||
}
|
||||
return new String(b, 0, length, false);
|
||||
return this;
|
||||
}
|
||||
|
||||
public int indexOf(int c) {
|
||||
@ -572,4 +584,20 @@ public final class String
|
||||
public int codePointCount(int start, int end) {
|
||||
return Character.codePointCount(this, start, end);
|
||||
}
|
||||
|
||||
public String toUpperCase(Locale locale) {
|
||||
if (locale == Locale.ENGLISH) {
|
||||
return toUpperCase();
|
||||
} else {
|
||||
throw new UnsupportedOperationException("toUpperCase("+locale+')');
|
||||
}
|
||||
}
|
||||
|
||||
public String toLowerCase(Locale locale) {
|
||||
if (locale == Locale.ENGLISH) {
|
||||
return toLowerCase();
|
||||
} else {
|
||||
throw new UnsupportedOperationException("toLowerCase("+locale+')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import java.util.Properties;
|
||||
public abstract class System {
|
||||
private static Property properties;
|
||||
|
||||
private static SecurityManager securityManager;
|
||||
// static {
|
||||
// loadLibrary("natives");
|
||||
// }
|
||||
@ -118,6 +119,14 @@ public abstract class System {
|
||||
public static void exit(int code) {
|
||||
Runtime.getRuntime().exit(code);
|
||||
}
|
||||
|
||||
public static SecurityManager getSecurityManager() {
|
||||
return securityManager;
|
||||
}
|
||||
|
||||
public static void setSecurityManager(SecurityManager securityManager) {
|
||||
System.securityManager = securityManager;
|
||||
}
|
||||
|
||||
private static class Property {
|
||||
public final String name;
|
||||
|
Reference in New Issue
Block a user