Buggy code:
public class GenerateKey extends Task { public static class DnameParam { private String name ; private String value ; public void setName ( String name ) { } public String getName ( ) { } public void setValue ( String value ) { } public String getValue ( ) { } } public static class DistinguishedName { private Vector params = new Vector ( ) ; public Object createParam ( ) { } public Enumeration getParams ( ) { } public String toString ( ) { } public String encode ( final String string ) { } } protected String alias ; protected String keystore ; protected String storepass ; protected String storetype ; protected String keypass ; protected String sigalg ; protected String keyalg ; protected String dname ; protected GenerateKey . DistinguishedName expandedDname ; protected int keysize ; protected int validity ; protected boolean verbose ; public GenerateKey . DistinguishedName createDname ( ) throws BuildException { } public void setDname ( final String dname ) { } public void setAlias ( final String alias ) { } public void setKeystore ( final String keystore ) { } public void setStorepass ( final String storepass ) { } public void setStoretype ( final String storetype ) { } public void setKeypass ( final String keypass ) { } public void setSigalg ( final String sigalg ) { } public void setKeyalg ( final String keyalg ) { } public void setKeysize ( final String keysize ) throws BuildException { } public void setValidity ( final String validity ) throws BuildException { } public void setVerbose ( final boolean verbose ) { } public void execute ( ) throws BuildException { if ( null == ( alias ) ) { throw new BuildException ( "alias<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set" ) ; } if ( null == ( storepass ) ) { throw new BuildException ( "storepass<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set" ) ; } if ( ( null == ( dname ) ) && ( null == ( expandedDname ) ) ) { throw new BuildException ( "dname<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set" ) ; } final StringBuffer sb = new StringBuffer ( ) ; sb . append ( "-genkey<seq2seq4repair_space>" ) ; if ( verbose ) { sb . append ( "-v<seq2seq4repair_space>" ) ; } sb . append ( "-alias<seq2seq4repair_space>\"" ) ; sb . append ( alias ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; if ( null != ( dname ) ) { sb . append ( "-dname<seq2seq4repair_space>\"" ) ; sb . append ( dname ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } if ( null != ( expandedDname ) ) { sb . append ( "-dname<seq2seq4repair_space>\"" ) ; sb . append ( expandedDname ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } if ( null != ( keystore ) ) { sb . append ( "-keystore<seq2seq4repair_space>\"" ) ; sb . append ( keystore ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } if ( null != ( storepass ) ) { sb . append ( "-storepass<seq2seq4repair_space>\"" ) ; sb . append ( storepass ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } if ( null != ( storetype ) ) { sb . append ( "-storetype<seq2seq4repair_space>\"" ) ; sb . append ( storetype ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } sb . append ( "-keypass<seq2seq4repair_space>\"" ) ; if ( null != ( keypass ) ) { sb . append ( keypass ) ; } else { sb . append ( storepass ) ; } sb . append ( "\"<seq2seq4repair_space>" ) ; if ( null != ( sigalg ) ) { sb . append ( "-sigalg<seq2seq4repair_space>\"" ) ; sb . append ( sigalg ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } if ( null != ( keyalg ) ) { sb . append ( "-keyalg<seq2seq4repair_space>\"" ) ; sb . append ( keyalg ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } if ( 0 < ( keysize ) ) { sb . append ( "-keysize<seq2seq4repair_space>\"" ) ; sb . append ( keysize ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } if ( 0 < ( validity ) ) { sb . append ( "-validity<seq2seq4repair_space>\"" ) ; sb . append ( validity ) ; sb . append ( "\"<seq2seq4repair_space>" ) ; } log ( ( "Generating<seq2seq4repair_space>Key<seq2seq4repair_space>for<seq2seq4repair_space>" + ( alias ) ) ) ; final ExecTask cmd = ( ( ExecTask ) ( getProject ( ) . createTask ( "exec" ) ) ) ; <START_BUG> cmd . setExecutable ( "keytool" ) ; <END_BUG> Commandline . Argument arg = cmd . createArg ( ) ; arg . setLine ( sb . toString ( ) ) ; cmd . setFailonerror ( true ) ; cmd . setTaskName ( getTaskName ( ) ) ; cmd . execute ( ) ; } }

Fix:
cmd . setExecutable ( JavaEnvUtils . getJdkExecutable ( "keytool" ) ) ;