Buggy code:
public class AJInstaller extends MatchingTask { static final String INCLUDE_CLASSES = "$installer$//org//aspectj//*.class" ; static final String MAIN_CLASS = "$installer$.org.aspectj.Main" ; static final String CONTENTS_FILE = "$installer$//org//aspectj//resources//contents.txt" ; private String htmlSrc ; public void setHtmlSrc ( String v ) { } private String resourcesSrc ; public void setResourcesSrc ( String v ) { } private String mainclass ; public void setMainclass ( String v ) { } private File installerClassJar ; public void setInstallerclassjar ( String v ) { } protected List contentsNames = new ArrayList ( ) ; protected long contentsBytes = 0 ; protected void addToContents ( File file , String vPath ) { } String [ ] getFiles ( File baseDir ) { } protected Copy getCopyTask ( ) { } protected void finishZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { writeContents ( zOut ) ; writeManifest ( zOut ) ; File tempDir = setupTempDir ( ) ; String tmp = tempDir . getAbsolutePath ( ) ; Expand expand = new Expand ( ) ; expand . setProject ( getProject ( ) ) ; expand . setSrc ( installerClassJar ) ; expand . setDest ( new File ( tmp ) ) ; PatternSet patterns = new PatternSet ( ) ; patterns . setIncludes ( AJInstaller . INCLUDE_CLASSES ) ; expand . addPatternset ( patterns ) ; expand . execute ( ) ; Copy cd = getCopyTask ( ) ; fileset = new FileSet ( ) ; fileset . setDir ( new File ( resourcesSrc ) ) ; fileset . setIncludes ( "*" ) ; fileset . setExcludes ( "contents.txt,properties.txt" ) ; cd . addFileset ( fileset ) ; cd . setTodir ( new File ( ( tmp + "//$installer$//org//aspectj//resources" ) ) ) ; cd . execute ( ) ; <START_BUG> project . addFilter ( "installer.main.class" , this . mainclass ) ; <END_BUG> Copy cf = getCopyTask ( ) ; fileset = new FileSet ( ) ; fileset . setDir ( new File ( resourcesSrc ) ) ; fileset . setIncludes ( "properties.txt" ) ; cf . setFiltering ( true ) ; cf . addFileset ( fileset ) ; cf . setTodir ( new File ( ( tmp + "//$installer$//org//aspectj//resources" ) ) ) ; cf . execute ( ) ; cd = getCopyTask ( ) ; fileset = new FileSet ( ) ; fileset . setDir ( new File ( htmlSrc ) ) ; fileset . setIncludes ( "*" ) ; cd . addFileset ( fileset ) ; cd . setTodir ( new File ( ( tmp + "//$installer$//org//aspectj//resources" ) ) ) ; cd . execute ( ) ; setBasedir ( tmp ) ; writeFiles ( zOut , getFiles ( tempDir ) ) ; Delete dt = ( ( Delete ) ( project . createTask ( "delete" ) ) ) ; if ( null == dt ) { dt = new Delete ( ) ; dt . setProject ( getProject ( ) ) ; } dt . setDir ( tempDir ) ; dt . execute ( ) ; tempDir = null ; } static final char NEWLINE = '\n' ; protected void writeContents ( ZipOutputStream zOut ) throws IOException { } protected void writeManifest ( ZipOutputStream zOut ) throws IOException { } private File zipFile ; private File baseDir ; private boolean doCompress = true ; protected String archiveType = "zip" ; public void setZipfile ( String zipFilename ) { } public void setBasedir ( String baseDirname ) { } public void setCompress ( String compress ) { } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected void zipDir ( File dir , ZipOutputStream zOut , String vPath ) throws IOException { } protected void zipFile ( InputStream in , ZipOutputStream zOut , String vPath , long lastModified ) throws IOException { } protected void zipFile ( File file , ZipOutputStream zOut , String vPath ) throws IOException { } private File setupTempDir ( ) throws BuildException { } public void execute ( ) throws BuildException { } protected void writeDirs ( ZipOutputStream zOut , String [ ] dirs ) throws IOException { } protected void writeFiles ( ZipOutputStream zOut , String [ ] files ) throws IOException { } }

Fix:
project . getGlobalFilterSet ( ) . addFilter ( "installer.main.class" , this . mainclass ) ;