Remove dead code and unused imports
Fix dead exception case Exception was previously being thrown if replyTo address was null, however this was unreachable code as replyTo is always assigned a new Address. Logic has been changed to throw the same exception if the default response routing key is found to be null.
This commit is contained in:
@@ -61,7 +61,6 @@ public class ErlangTemplate extends ErlangAccessor implements ErlangOperations {
|
||||
|
||||
if (result instanceof OtpErlangTuple) {
|
||||
OtpErlangTuple msg = (OtpErlangTuple)result;
|
||||
OtpErlangObject[] elements = msg.elements();
|
||||
if (msg.elementAt(0) instanceof OtpErlangAtom)
|
||||
{
|
||||
OtpErlangAtom responseAtom = (OtpErlangAtom)msg.elementAt(0);
|
||||
|
||||
@@ -72,7 +72,6 @@ public class Background {
|
||||
{
|
||||
StringBuffer escaped;
|
||||
String[] execCmd;
|
||||
Runtime r;
|
||||
|
||||
escaped = new StringBuffer();
|
||||
for(int i=0; i<cmd.length; i++){
|
||||
@@ -105,10 +104,6 @@ public class Background {
|
||||
File errFile, boolean appendErr)
|
||||
throws IOException
|
||||
{
|
||||
String[] logargs;
|
||||
String[] execCmd;
|
||||
ArrayList tmpCmd = new ArrayList();
|
||||
Runtime r;
|
||||
ArrayList<String> tmpCmd = new ArrayList<String>();
|
||||
|
||||
tmpCmd.add("cmd");
|
||||
@@ -126,7 +121,7 @@ public class Background {
|
||||
(appendErr == true ? ">>" : " >") +
|
||||
Escape.escape(errFile.getAbsolutePath()));
|
||||
|
||||
Process p = Runtime.getRuntime().exec((String [])tmpCmd.toArray(cmd));
|
||||
Runtime.getRuntime().exec((String [])tmpCmd.toArray(cmd));
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Escape {
|
||||
* (such as whitespace, quotes, slashes, etc.)
|
||||
*/
|
||||
public static String escape(String in){
|
||||
char[] inChars, outChars, resChars;
|
||||
char[] inChars, outChars;
|
||||
int numOut;
|
||||
|
||||
inChars = new char[in.length()];
|
||||
|
||||
@@ -112,8 +112,6 @@ public class Execute {
|
||||
return cmd;
|
||||
}
|
||||
else if ( Os.isFamily("windows") ) {
|
||||
String osname =
|
||||
System.getProperty("os.name").toLowerCase(Locale.US);
|
||||
String[] cmd = {"cmd", "/c", "set" };
|
||||
return cmd;
|
||||
}
|
||||
|
||||
@@ -73,16 +73,10 @@ public class PumpStreamHandler implements ExecuteStreamHandler {
|
||||
public void stop() {
|
||||
if( ! running ) return;
|
||||
try {
|
||||
//if( log.isDebugEnabled() ) log.debug("Joining it");
|
||||
// inputThread.interrupt();
|
||||
inputThread.join(1000);
|
||||
//if( log.isDebugEnabled() ) log.debug("Joined" );
|
||||
} catch(InterruptedException e) {}
|
||||
try {
|
||||
//if( log.isDebugEnabled() ) log.debug("Joining it");
|
||||
// errorThread.interrupt();
|
||||
errorThread.join(1000);
|
||||
//if( log.isDebugEnabled() ) log.debug("Joined" );
|
||||
} catch(InterruptedException e) {}
|
||||
try {
|
||||
err.flush();
|
||||
@@ -119,7 +113,4 @@ public class PumpStreamHandler implements ExecuteStreamHandler {
|
||||
return result;
|
||||
}
|
||||
|
||||
private static org.apache.commons.logging.Log log=
|
||||
org.apache.commons.logging.LogFactory.getLog( PumpStreamHandler.class );
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user