View | Details | Raw Unified | Return to bug 28504
Collapse All | Expand All

(-)src/main/org/apache/tools/ant/taskdefs/Ear.java (-2 / +8 lines)
Lines 42-49 Link Here
42
     */
42
     */
43
    public Ear() {
43
    public Ear() {
44
        super();
44
        super();
45
        archiveType = "ear";
45
        archiveType = "EAR";
46
        emptyBehavior = "create";
46
        // handled by super: emptyBehavior = "create";
47
    }
47
    }
48
48
49
    /**
49
    /**
Lines 131-134 Link Here
131
        descriptorAdded = false;
131
        descriptorAdded = false;
132
        super.cleanUp();
132
        super.cleanUp();
133
    }
133
    }
134
135
    public void reset() {
136
        super.reset();
137
        archiveType = "EAR";
138
    }
139
134
}
140
}
(-)src/main/org/apache/tools/ant/taskdefs/Jar.java (-3 / +6 lines)
Lines 118-124 Link Here
118
    /** constructor */
118
    /** constructor */
119
    public Jar() {
119
    public Jar() {
120
        super();
120
        super();
121
        archiveType = "jar";
121
        archiveType = "JAR";
122
        emptyBehavior = "create";
122
        emptyBehavior = "create";
123
        setEncoding("UTF8");
123
        setEncoding("UTF8");
124
        rootEntries = new Vector();
124
        rootEntries = new Vector();
Lines 603-609 Link Here
603
603
604
        ZipOutputStream zOut = null;
604
        ZipOutputStream zOut = null;
605
        try {
605
        try {
606
            log("Building MANIFEST-only jar: "
606
            log("Building manifest-only JAR: "
607
                + getDestFile().getAbsolutePath());
607
                + getDestFile().getAbsolutePath());
608
            zOut = new ZipOutputStream(new FileOutputStream(getDestFile()));
608
            zOut = new ZipOutputStream(new FileOutputStream(getDestFile()));
609
609
Lines 616-622 Link Here
616
            initZipOutputStream(zOut);
616
            initZipOutputStream(zOut);
617
            finalizeZipOutputStream(zOut);
617
            finalizeZipOutputStream(zOut);
618
        } catch (IOException ioe) {
618
        } catch (IOException ioe) {
619
            throw new BuildException("Could not create almost empty JAR archive"
619
            throw new BuildException("Could not create almost empty JAR"
620
                                     + " (" + ioe.getMessage() + ")", ioe,
620
                                     + " (" + ioe.getMessage() + ")", ioe,
621
                                     getLocation());
621
                                     getLocation());
622
        } finally {
622
        } finally {
Lines 665-670 Link Here
665
        mergeManifestsMain = false;
665
        mergeManifestsMain = false;
666
        manifestFile = null;
666
        manifestFile = null;
667
        index = false;
667
        index = false;
668
        archiveType = "JAR";
669
        emptyBehavior = "create";
670
        setEncoding("UTF8");
668
    }
671
    }
669
672
670
    public static class FilesetManifestConfig extends EnumeratedAttribute {
673
    public static class FilesetManifestConfig extends EnumeratedAttribute {
(-)src/main/org/apache/tools/ant/taskdefs/War.java (-2 / +8 lines)
Lines 59-66 Link Here
59
59
60
    public War() {
60
    public War() {
61
        super();
61
        super();
62
        archiveType = "war";
62
        archiveType = "WAR";
63
        emptyBehavior = "create";
63
        // handled by super: emptyBehavior = "create";
64
    }
64
    }
65
65
66
    /**
66
    /**
Lines 169-172 Link Here
169
        descriptorAdded = false;
169
        descriptorAdded = false;
170
        super.cleanUp();
170
        super.cleanUp();
171
    }
171
    }
172
173
    public void reset() {
174
        super.reset();
175
        archiveType = "WAR";
176
    }
177
172
}
178
}
(-)src/main/org/apache/tools/ant/taskdefs/Zip.java (-3 / +3 lines)
Lines 72-78 Link Here
72
    // shadow of the above if the value is altered in execute
72
    // shadow of the above if the value is altered in execute
73
    private boolean savedDoUpdate = false;
73
    private boolean savedDoUpdate = false;
74
    private boolean doFilesonly = false;
74
    private boolean doFilesonly = false;
75
    protected String archiveType = "zip";
75
    protected String archiveType = "ZIP";
76
76
77
    // For directories:
77
    // For directories:
78
    private static final long EMPTY_CRC = new CRC32 ().getValue ();
78
    private static final long EMPTY_CRC = new CRC32 ().getValue ();
Lines 327-333 Link Here
327
    public void executeMain() throws BuildException {
327
    public void executeMain() throws BuildException {
328
328
329
        if (baseDir == null && filesets.size() == 0
329
        if (baseDir == null && filesets.size() == 0
330
            && groupfilesets.size() == 0 && "zip".equals(archiveType)) {
330
            && groupfilesets.size() == 0 && "ZIP".equals(archiveType)) {
331
            throw new BuildException("basedir attribute must be set, "
331
            throw new BuildException("basedir attribute must be set, "
332
                                     + "or at least "
332
                                     + "or at least "
333
                                     + "one fileset must be given!");
333
                                     + "one fileset must be given!");
Lines 1160-1166 Link Here
1160
        baseDir = null;
1160
        baseDir = null;
1161
        groupfilesets.removeAllElements();
1161
        groupfilesets.removeAllElements();
1162
        duplicate = "add";
1162
        duplicate = "add";
1163
        archiveType = "zip";
1163
        archiveType = "ZIP";
1164
        doCompress = true;
1164
        doCompress = true;
1165
        emptyBehavior = "skip";
1165
        emptyBehavior = "skip";
1166
        doUpdate = false;
1166
        doUpdate = false;

Return to bug 28504