rid eclipse warnings

This commit is contained in:
Doug MacEachern 2006-03-04 03:17:05 +00:00
parent e63e0ff456
commit c13a918e32
9 changed files with 12 additions and 23 deletions

View File

@ -586,7 +586,6 @@ public abstract class ShellBase
throws PageFetchException throws PageFetchException
{ {
PrintStream out; PrintStream out;
PageControl curPage;
PageList data; PageList data;
boolean lineNumberMode; boolean lineNumberMode;

View File

@ -228,7 +228,6 @@ public class Proxy {
String type = method.getName().substring(3); String type = method.getName().substring(3);
Class attrClass = method.getReturnType(); Class attrClass = method.getReturnType();
Class[] paramTypes;
if (isNonStringArg(method)) { if (isNonStringArg(method)) {
continue; continue;
@ -406,6 +405,7 @@ public class Proxy {
} catch (SigarException e) { } catch (SigarException e) {
String msg = String msg =
type + " failed: " + e.getMessage(); type + " failed: " + e.getMessage();
System.err.println(msg);
return null; return null;
} }
} }
@ -426,11 +426,7 @@ public class Proxy {
output("ourPid=" + ourPid); output("ourPid=" + ourPid);
if (args.length >= 2) { if (args.length >= 2) {
String type = args[0], arg = null, attr = args[args.length - 1]; String type = args[0], attr = args[args.length - 1];
if (args.length == 3) {
arg = args[1];
}
if (type.equals("leaktest")) { if (type.equals("leaktest")) {
int num = Integer.parseInt(args[1]); int num = Integer.parseInt(args[1]);
@ -448,6 +444,8 @@ public class Proxy {
throw new SigarException(e.getMessage()); throw new SigarException(e.getMessage());
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
throw new SigarException(e.getMessage()); throw new SigarException(e.getMessage());
} finally {
s.close();
} }
} }

View File

@ -62,7 +62,7 @@ public class RunThreadCpu {
for (int i=0; i<iter; i++) { for (int i=0; i<iter; i++) {
s += System.getProperty("java.home"); s += System.getProperty("java.home");
for (int j=0; j<s.length(); j++) { for (int j=0; j<s.length(); j++) {
char c = s.charAt(j); s.charAt(j);
} }
} }
printTimes(start); printTimes(start);

View File

@ -69,14 +69,14 @@ public class TestFileInfo extends SigarTestCase {
} }
else { else {
try { try {
DirStat stats = sigar.getDirStat(file); sigar.getDirStat(file);
assertTrue(false); assertTrue(false);
} catch (SigarException e) { } catch (SigarException e) {
assertTrue(true); assertTrue(true);
} }
} }
FileInfo link = sigar.getLinkInfo(file); sigar.getLinkInfo(file);
} }
public void testCreate() throws Exception { public void testCreate() throws Exception {

View File

@ -82,7 +82,7 @@ public class TestInvoker extends SigarTestCase {
SigarInvokerJMX invoker = SigarInvokerJMX invoker =
SigarInvokerJMX.getInstance(proxy, query[0]); SigarInvokerJMX.getInstance(proxy, query[0]);
try { try {
Object o = invoker.invoke(query[1]); invoker.invoke(query[1]);
assertTrue(false); assertTrue(false);
} catch (SigarException e) { } catch (SigarException e) {
traceln(query[0] + ":" + query[1] + "=" + e.getMessage()); traceln(query[0] + ":" + query[1] + "=" + e.getMessage());

View File

@ -52,8 +52,7 @@ public class TestNetIf extends SigarTestCase {
//test bogus arg results in exception (and not a segfault) //test bogus arg results in exception (and not a segfault)
try { try {
traceln("testing bogus getNetInterfaceStat"); traceln("testing bogus getNetInterfaceStat");
NetInterfaceStat ifstat = sigar.getNetInterfaceStat("were switching to night vision");
sigar.getNetInterfaceStat("were switching to night vision");
fail("switched to night vision"); fail("switched to night vision");
} catch (SigarException e) { } catch (SigarException e) {
//expected //expected
@ -62,8 +61,7 @@ public class TestNetIf extends SigarTestCase {
//test bogus arg results in exception (and not a segfault) //test bogus arg results in exception (and not a segfault)
try { try {
traceln("testing bogus getNetInterfaceConfig"); traceln("testing bogus getNetInterfaceConfig");
NetInterfaceConfig ifconfig = sigar.getNetInterfaceConfig("happy meal");
sigar.getNetInterfaceConfig("happy meal");
fail("unexpected treat in happy meal"); fail("unexpected treat in happy meal");
} catch (SigarException e) { } catch (SigarException e) {
//expected //expected

View File

@ -24,10 +24,9 @@ public class TestProcExe extends SigarTestCase {
//assertTrue(new File(cwd).isDirectory()); //assertTrue(new File(cwd).isDirectory());
File exeFile = new File(exe.getName());
traceln("exe='" + exe.getName() + "'"); traceln("exe='" + exe.getName() + "'");
//assertTrue(exeFile.exists()); //assertTrue(new File(exeFile).exists());
} catch (SigarNotImplementedException e) { } catch (SigarNotImplementedException e) {
//ok //ok
} }

View File

@ -27,8 +27,6 @@ public class TestThreads extends TestCase {
boolean useGlobal = false; boolean useGlobal = false;
public void run() { public void run() {
int expire = 1000;
Sigar sigar; Sigar sigar;
SigarProxy proxy; SigarProxy proxy;

View File

@ -2,7 +2,6 @@ package net.hyperic.sigar.win32.test;
import net.hyperic.sigar.test.SigarTestCase; import net.hyperic.sigar.test.SigarTestCase;
import net.hyperic.sigar.win32.Pdh; import net.hyperic.sigar.win32.Pdh;
import net.hyperic.sigar.win32.Win32Exception;
public class TestPdh extends SigarTestCase { public class TestPdh extends SigarTestCase {
@ -39,9 +38,7 @@ public class TestPdh extends SigarTestCase {
*/ */
} }
public void testPdh () throws Exception { public void testPdh() throws Exception {
Pdh pdh = new Pdh();
String[] iface = Pdh.getKeys("Thread"); String[] iface = Pdh.getKeys("Thread");