Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class MeasureBaselineMemoryFootprint extends org.netbeans.junit.NbPerform

private static final String [][] SUPPORTED_PLATFORMS = {
{"Linux,i386",UNIX},
{"SunOS,sparc",UNIX},
{"Windows_NT,x86",WINDOWS},
{"Windows_2000,x86",WINDOWS},
{"Windows_XP,x86",WINDOWS},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ public static void register() {
public static void initialize(String prefix) {
Assert.assertNotNull(prefix);

if (! (System.getSecurityManager() instanceof CountingSecurityManager)) {
setAllowedReplace(true);
System.setSecurityManager(new CountingSecurityManager());
setAllowedReplace(false);
}
setAllowedReplace(true);
System.setSecurityManager(new CountingSecurityManager());
setAllowedReplace(false);

if (!System.getSecurityManager().getClass().getName().equals(CountingSecurityManager.class.getName())) {
throw new IllegalStateException("Wrong security manager: " + System.getSecurityManager());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static long getIdeMemoryFootPrint() throws MemoryMeasurementFailedExcepti
public static long getProcessMemoryFootPrint(long pid) throws MemoryMeasurementFailedException {
String platform = getPlatform();
//System.out.println("PLATFORM = "+getPlatform());
if (platform.equals(SOLARIS)|platform.equals(LINUX)) {
if (platform.equals(LINUX)) {
// call unix method
return getProcessMemoryFootPrintOnUnix(pid);
} else if (platform.equals(WINDOWS)) {
Expand All @@ -98,13 +98,11 @@ public static long getProcessMemoryFootPrint(long pid) throws MemoryMeasurementF
/** */
private static final long UNKNOWN_VALUE = -1;

private static final String SOLARIS = "solaris";
private static final String LINUX = "linux";
private static final String WINDOWS = "win32";
private static final String UNKNOWN = "unknown";

private static final String [][] SUPPORTED_PLATFORMS = {
{"SunOS",SOLARIS},
{"Linux",LINUX},
{"Windows NT",WINDOWS},
{"Windows 2000",WINDOWS},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public int waitResult() throws InterruptedException {
return -1;
}

if (osFamily == OSFamily.LINUX || osFamily == OSFamily.SUNOS) {
if (osFamily == OSFamily.LINUX) {
File f = new File("/proc/" + pid); // NOI18N

while (f.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public static enum CpuFamily {

public static enum OSFamily {

SUNOS,
LINUX,
WINDOWS,
MACOSX,
Expand All @@ -45,7 +44,6 @@ public boolean isUnix() {
switch (this) {
case LINUX:
case MACOSX:
case SUNOS:
case FREEBSD:
return true;
case WINDOWS:
Expand All @@ -58,7 +56,7 @@ public boolean isUnix() {
}

/**
* Returns CamelCase name of the family. Like: SunOS; Linux; Windows;
* Returns CamelCase name of the family. Like: Linux; Windows;
* MacOSX.
*
* @return CamelCase name
Expand All @@ -69,8 +67,6 @@ public String cname() {
return "Linux"; // NOI18N
case MACOSX:
return "MacOSX"; // NOI18N
case SUNOS:
return "SunOS"; // NOI18N
case FREEBSD:
return "FreeBSD"; // NOI18N
case WINDOWS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ public static boolean isSupportedFor(ExecutionEnvironment executionEnvironment)
|| hostInfo.getCpuFamily().equals(CpuFamily.SPARC)
|| (hostInfo.getCpuFamily().equals(CpuFamily.ARM) && Boolean.getBoolean("cnd.pty.arm.support"))
|| hostInfo.getCpuFamily().equals(CpuFamily.AARCH64);
case SUNOS:
return true;
case FREEBSD:
return false;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public static String getLDPathEnvName(ExecutionEnvironment execEnv) {
case MACOSX:
return "DYLD_LIBRARY_PATH"; // NOI18N
case LINUX:
case SUNOS:
case FREEBSD:
return "LD_LIBRARY_PATH"; // NOI18N
case WINDOWS:
Expand Down Expand Up @@ -152,7 +151,6 @@ public static String getLDPreloadEnvName(ExecutionEnvironment execEnv) {
case MACOSX:
return "DYLD_INSERT_LIBRARIES"; // NOI18N
case LINUX:
case SUNOS:
case FREEBSD:
return "LD_PRELOAD"; // NOI18N
case WINDOWS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ protected final void setupPredefined(ExpanderStyle style) {
soext = "dylib"; // NOI18N
osname = "MacOSX"; // NOI18N
break;
case SUNOS:
soext = "so"; // NOI18N
osname = "SunOS"; // NOI18N
break;
case LINUX:
soext = "so"; // NOI18N
osname = "Linux"; // NOI18N
Expand Down Expand Up @@ -285,11 +281,7 @@ protected final void setupPredefined(ExpanderStyle style) {
platform = "intel"; // NOI18N
}

if (hostInfo.getOSFamily() == HostInfo.OSFamily.SUNOS) { // NOI18N
platform += "-S2"; // NOI18N
} else {
platform += "-" + osname; // NOI18N
}
platform += "-" + osname; // NOI18N
}

predefinedMacros.put("platform", platform); // NOI18N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ public Result check(File localFile, String remotePath)
args = new String[] { remotePath }; // NOI18N
first = false;
break;
case SUNOS:
cmd = "/usr/bin/digest"; // NOI18N
args = new String[] {"-a", "md5", remotePath }; //NOI18N
first = true;
break;
case MACOSX:
cmd = "sh"; // NOI18N
args = new String [] {"-c", String.format("md5 %s || openssl -md5 %s", remotePath, remotePath)}; //NOI18N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,32 +114,7 @@ private static class ResizeListener implements PropertyChangeListener {
private final boolean pxlsAware;

ResizeListener(final ExecutionEnvironment env, final String tty) throws IOException, CancellationException {
final HostInfo hinfo = HostInfoUtils.getHostInfo(env);

if (OSFamily.SUNOS.equals(hinfo.getOSFamily())) {
pxlsAware = true;

// See IZ 192063 - Input is duplicated in internal terminal
// See CR 7009510 - Changing winsize (SIGWINCH) of pts causes entered text duplication

// In case OpenSolaris/Solaris 11 will not react on window size
// change... This causes 'problems' with, say, vi started
// in the internal terminal... But 'solves' problems with input
// duplication, which is more important...

String version = hinfo.getOS().getVersion();
if (version.contains("Solaris 11.")) { // NOI18N
// update for IZ 236261: in Solaris 11+ this seems to work, so
// will not disable listener for it...

// update: the same is valid for 11.2
// assuming it was fixed in 11 - disabling this fix for 11.*
} else if (version.contains("OpenSolaris") || version.contains("Solaris 11")) { // NOI18N
return;
}
} else {
pxlsAware = false;
}
pxlsAware = false;

this.task = rp.create(new Runnable() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public boolean isSupported(HostInfo hostInfo) {
try {
switch (hostInfo.getOS().getFamily()) {
case MACOSX:
case SUNOS:
case LINUX:
try {
return getLocalFile(hostInfo) != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public boolean isSupported(ExecutionEnvironment env, SIGNAL_SCOPE scope) {

switch (hostInfo.getOSFamily()) {
case LINUX:
case SUNOS:
return true;
case FREEBSD:
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ public enum Mode {
public static void initialize(String prefix, Mode mode, Set<String> allowedFiles) {
System.setProperty("counting.security.disabled", "true");

if (System.getSecurityManager() instanceof CountingSecurityManager) {
// ok
} else {
System.setSecurityManager(new CountingSecurityManager());
}
System.setSecurityManager(new CountingSecurityManager());
setCnt(0);
msgs = new StringWriter();
pw = new PrintWriter(msgs);
Expand All @@ -113,7 +109,6 @@ public static void initialize(String prefix, Mode mode, Set<String> allowedFiles
static void assertReflection(int maxCount, String whitelist) {
System.setProperty("counting.reflection.whitelist", whitelist);
RuntimePermission checkMemberAccessPermission = new RuntimePermission("accessDeclaredMembers");
System.getSecurityManager().checkPermission(checkMemberAccessPermission);
System.getProperties().remove("counting.reflection.whitelist");
}

Expand All @@ -127,7 +122,7 @@ public Integer call() throws Exception {
}

public static boolean isEnabled() {
return System.getSecurityManager() instanceof Callable<?>;
return false;
}

public static void assertCounts(String msg, int expectedCnt) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,11 @@ public CheckBoxRenderrer () {

private Border getNoFocusBorder () {
Border border = UIManager.getBorder("List.cellNoFocusBorder");
if (System.getSecurityManager () != null) {
if (border != null) {
return border;
}
return SAFE_NO_FOCUS_BORDER;
} else {
if (border != null &&
(noFocusBorder == null ||
noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
return border;
}
return noFocusBorder;
if (border != null &&
(noFocusBorder == null || noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
return border;
}
return noFocusBorder;
}

public Component getListCellRendererComponent (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,11 @@ public CheckBoxRenderrer () {

private Border getNoFocusBorder () {
Border border = UIManager.getBorder("List.cellNoFocusBorder");
if (System.getSecurityManager () != null) {
if (border != null) {
return border;
}
return SAFE_NO_FOCUS_BORDER;
} else {
if (border != null &&
(noFocusBorder == null ||
noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
return border;
}
return noFocusBorder;
if (border != null &&
(noFocusBorder == null || noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
return border;
}
return noFocusBorder;
}

public Component getListCellRendererComponent (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class GetOwnerTest extends NbTestCase {

protected File dataRootDir;
private StatFiles accessMonitor;
private SecurityManager defaultSecurityManager;
protected File versionedFolder;
protected File unversionedFolder;

Expand Down Expand Up @@ -69,9 +68,6 @@ protected void setUp() throws Exception {
userdir.mkdirs();
System.setProperty("netbeans.user", userdir.getAbsolutePath());
if(accessMonitor != null) {
if(defaultSecurityManager == null) {
defaultSecurityManager = System.getSecurityManager();
}
System.setSecurityManager(accessMonitor);
}
}
Expand All @@ -80,7 +76,8 @@ protected void setUp() throws Exception {
protected void tearDown() throws Exception {
super.tearDown();
if(accessMonitor != null) {
System.setSecurityManager(defaultSecurityManager);
// FIXME - throws UnsupportedOperationException unconditionally, regardless of arg.
System.setSecurityManager(null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,11 @@ public AnalyserCellRenderer () {

private Border getNoFocusBorder() {
Border border = UIManager.getBorder("List.cellNoFocusBorder");
if (System.getSecurityManager() != null) {
if (border != null) return border;
return SAFE_NO_FOCUS_BORDER;
} else {
if (border != null &&
(noFocusBorder == null ||
noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
return border;
}
return noFocusBorder;
if (border != null &&
(noFocusBorder == null || noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
return border;
}
return noFocusBorder;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,12 @@ public void run(CompilationController parameter) throws Exception {

TypeElement string = parameter.getElements().getTypeElement("test.test2");

SecurityManager old = System.getSecurityManager();

System.setSecurityManager(new SecMan());

TreePathHandle.create(string, parameter);

System.setSecurityManager(old);

// FIXME - throws UnsupportedOperationException unconditionally, regardless of arg.
System.setSecurityManager(null);
}
}, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ public static void register() {
public static void initialize(String prefix) {
Assert.assertNotNull(prefix);

if (! (System.getSecurityManager() instanceof CountingSecurityManager)) {
setAllowedReplace(true);
System.setSecurityManager(new CountingSecurityManager());
setAllowedReplace(false);
}
if (!System.getSecurityManager().getClass().getName().equals(CountingSecurityManager.class.getName())) {
throw new IllegalStateException("Wrong security manager: " + System.getSecurityManager());
}
setAllowedReplace(true);
System.setSecurityManager(new CountingSecurityManager());
setAllowedReplace(false);

cnt = 0;
msgs = new StringWriter();
pw = new PrintWriter(msgs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ public abstract class MemoryFootprintTestCase extends PerformanceTestCase {
*/
private static final String[][] SUPPORTED_PLATFORMS = {
{"Linux,i386", UNIX},
{"SunOS,sparc", UNIX},
{"SunOS,x86", UNIX},
{"Windows_NT,x86", WINDOWS},
{"Windows_2000,x86", WINDOWS},
{"Windows_XP,x86", WINDOWS},
Expand Down
Loading
Loading