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 ( JavaEnvUtils . isJavaVersion ( JAVA_1_1 ) ) { throw new BuildException ( ( "The<seq2seq4repair_space>genkey<seq2seq4repair_space>task<seq2seq4repair_space>is<seq2seq4repair_space>only<seq2seq4repair_space>available<seq2seq4repair_space>on<seq2seq4repair_space>JDK" + "<seq2seq4repair_space>versions<seq2seq4repair_space>1.2<seq2seq4repair_space>or<seq2seq4repair_space>greater" ) ) ; } 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 ) ) ) ; <START_BUG> final ExecTask cmd = ( ( ExecTask ) ( project . createTask ( "exec" ) ) ) ; <END_BUG> cmd . setExecutable ( "keytool" ) ; Commandline . Argument arg = cmd . createArg ( ) ; arg . setLine ( sb . toString ( ) ) ; cmd . setFailonerror ( true ) ; cmd . setTaskName ( getTaskName ( ) ) ; cmd . execute ( ) ; } }

Fix:
final ExecTask cmd = ( ( ExecTask ) ( getProject ( ) . createTask ( "exec" ) ) ) ;