< prev index next >
src/com/sun/javatest/agent/AgentMain.java
Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg
*** 373,383 ****
switch (mode) {
case ACTIVE:
try {
Class<?> c = Class.forName(pkg + ".ActiveConnectionFactory");
! Constructor m = c.getConstructor(new Class[] {String.class, int.class});
Object[] args = { activeHost, new Integer(activePort) };
return (ConnectionFactory)(m.newInstance(args));
}
catch (Throwable e) {
Throwable t = unwrapInvocationTargetException(e);
--- 373,383 ----
switch (mode) {
case ACTIVE:
try {
Class<?> c = Class.forName(pkg + ".ActiveConnectionFactory");
! Constructor<?> m = c.getConstructor(new Class<?>[] {String.class, int.class});
Object[] args = { activeHost, new Integer(activePort) };
return (ConnectionFactory)(m.newInstance(args));
}
catch (Throwable e) {
Throwable t = unwrapInvocationTargetException(e);
*** 390,400 ****
}
case PASSIVE:
try {
Class<?> c = Class.forName(pkg + ".PassiveConnectionFactory");
! Constructor m = c.getConstructor(new Class[] {int.class, int.class});
Object[] args = { new Integer(passivePort), new Integer(concurrency + 1) };
return (ConnectionFactory)(m.newInstance(args));
}
catch (Throwable e) {
Throwable t = unwrapInvocationTargetException(e);
--- 390,400 ----
}
case PASSIVE:
try {
Class<?> c = Class.forName(pkg + ".PassiveConnectionFactory");
! Constructor<?> m = c.getConstructor(new Class<?>[] {int.class, int.class});
Object[] args = { new Integer(passivePort), new Integer(concurrency + 1) };
return (ConnectionFactory)(m.newInstance(args));
}
catch (Throwable e) {
Throwable t = unwrapInvocationTargetException(e);
*** 411,421 ****
}
case SERIAL:
try {
Class<?> c = Class.forName(pkg + ".SerialPortConnectionFactory");
! Constructor m = c.getConstructor(new Class[] {String.class, String.class, int.class});
Object[] args = {serialPort, Agent.productName, new Integer(10*1000)};
return (ConnectionFactory)(m.newInstance(args));
}
catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
--- 411,421 ----
}
case SERIAL:
try {
Class<?> c = Class.forName(pkg + ".SerialPortConnectionFactory");
! Constructor<?> m = c.getConstructor(new Class<?>[] {String.class, String.class, int.class});
Object[] args = {serialPort, Agent.productName, new Integer(10*1000)};
return (ConnectionFactory)(m.newInstance(args));
}
catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
*** 458,468 ****
Agent agent = new Agent(cf, concurrency);
agent.setTracing(tracing);
if (observerClassName != null) {
try {
! Class observerClass = Class.forName(observerClassName);
Agent.Observer observer = (Agent.Observer)(observerClass.newInstance());
agent.addObserver(observer);
}
catch (ClassCastException e) {
throw new Fault("observer is not of type " +
--- 458,468 ----
Agent agent = new Agent(cf, concurrency);
agent.setTracing(tracing);
if (observerClassName != null) {
try {
! Class<?> observerClass = Class.forName(observerClassName);
Agent.Observer observer = (Agent.Observer)(observerClass.newInstance());
agent.addObserver(observer);
}
catch (ClassCastException e) {
throw new Fault("observer is not of type " +
*** 619,627 ****
}
public void completed(Agent agent, Connection c) {
}
! private Class connectExceptionClass;
! private Class unknownHostExceptionClass;
}
}
--- 619,627 ----
}
public void completed(Agent agent, Connection c) {
}
! private Class<?> connectExceptionClass;
! private Class<?> unknownHostExceptionClass;
}
}
< prev index next >