Buggy code:
public class SignJar extends AbstractJarSignerTask { private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; protected String sigfile ; protected File signedjar ; protected boolean internalsf ; protected boolean sectionsonly ; private boolean preserveLastModified ; protected boolean lazy ; protected File destDir ; private FileNameMapper mapper ; protected String tsaurl ; protected String tsacert ; public static final String ERROR_TODIR_AND_SIGNEDJAR = "'destdir'<seq2seq4repair_space>and<seq2seq4repair_space>'signedjar'<seq2seq4repair_space>cannot<seq2seq4repair_space>both<seq2seq4repair_space>be<seq2seq4repair_space>set" ; public static final String ERROR_TOO_MANY_MAPPERS = "Too<seq2seq4repair_space>many<seq2seq4repair_space>mappers" ; public static final String ERROR_SIGNEDJAR_AND_PATHS = "You<seq2seq4repair_space>cannot<seq2seq4repair_space>specify<seq2seq4repair_space>the<seq2seq4repair_space>signed<seq2seq4repair_space>JAR<seq2seq4repair_space>when<seq2seq4repair_space>using<seq2seq4repair_space>paths<seq2seq4repair_space>or<seq2seq4repair_space>filesets" ; public static final String ERROR_BAD_MAP = "Cannot<seq2seq4repair_space>map<seq2seq4repair_space>source<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>anything<seq2seq4repair_space>sensible:<seq2seq4repair_space>" ; public static final String ERROR_MAPPER_WITHOUT_DEST = "The<seq2seq4repair_space>destDir<seq2seq4repair_space>attribute<seq2seq4repair_space>is<seq2seq4repair_space>required<seq2seq4repair_space>if<seq2seq4repair_space>a<seq2seq4repair_space>mapper<seq2seq4repair_space>is<seq2seq4repair_space>set" ; public static final String ERROR_NO_ALIAS = "alias<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set" ; public static final String ERROR_NO_STOREPASS = "storepass<seq2seq4repair_space>attribute<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set" ; public void setSigfile ( final String sigfile ) { } public void setSignedjar ( final File signedjar ) { } public void setInternalsf ( final boolean internalsf ) { } public void setSectionsonly ( final boolean sectionsonly ) { } public void setLazy ( final boolean lazy ) { } public void setDestDir ( File destDir ) { } public void add ( FileNameMapper newMapper ) { } public FileNameMapper getMapper ( ) { } public String getTsaurl ( ) { } public void setTsaurl ( String tsaurl ) { } public String getTsacert ( ) { } public void setTsacert ( String tsacert ) { } public void execute ( ) throws BuildException { } private void signOneJar ( File jarSource , File jarTarget ) throws BuildException { File targetFile = jarTarget ; if ( targetFile == null ) { targetFile = jarSource ; } if ( isUpToDate ( jarSource , targetFile ) ) { return ; } long lastModified = jarSource . lastModified ( ) ; final ExecTask cmd = createJarSigner ( ) ; setCommonOptions ( cmd ) ; bindToKeystore ( cmd ) ; if ( null != ( sigfile ) ) { addValue ( cmd , "-sigfile" ) ; String value = this . sigfile ; addValue ( cmd , value ) ; } <START_BUG> if ( ( null != targetFile ) && ( ! ( jarSource . equals ( targetFile ) ) ) ) { <END_BUG> addValue ( cmd , "-signedjar" ) ; addValue ( cmd , targetFile . getPath ( ) ) ; } if ( internalsf ) { addValue ( cmd , "-internalsf" ) ; } if ( sectionsonly ) { addValue ( cmd , "-sectionsonly" ) ; } addTimestampAuthorityCommands ( cmd ) ; addValue ( cmd , jarSource . getPath ( ) ) ; addValue ( cmd , alias ) ; log ( ( ( ( ( ( "Signing<seq2seq4repair_space>JAR:<seq2seq4repair_space>" + ( jarSource . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( targetFile . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>as<seq2seq4repair_space>" ) + ( alias ) ) ) ; cmd . execute ( ) ; if ( preserveLastModified ) { targetFile . setLastModified ( lastModified ) ; } } private void addTimestampAuthorityCommands ( final ExecTask cmd ) { } protected boolean isUpToDate ( File jarFile , File signedjarFile ) { } protected boolean isSigned ( File file ) { } public void setPreserveLastModified ( boolean preserveLastModified ) { } }

Fix:
if ( ! ( jarSource . equals ( targetFile ) ) ) {