ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siwiec, Tomasz" <>
Subject Problem with the defined collection.
Date Thu, 19 May 2005 12:30:25 GMT
Dear All,
I have a problem with my own collection of objects that I pass to my
I have a AntFileInfoSet collection that store AntFileInfo objects (both
of them inherits from ProjectComponent).
The AntFileInfoSet looks like that:

public class AntFileInfoSet extends ProjectComponent {
    private String refid = null;
    private List antFileInfos = new ArrayList();

    public void setRefid(String refid) {... }

    public void addFile(AntFileInfo afi) {
    public List getAntFileInfos() {
        if (refid != null) {
            return ((AntFileInfoSet)
getProject().getReference(refid)).getAntFileInfos(); (HERE I KEEP
GETTING ClassCastException)
        } else {
            return antFileInfos;

The type & task definitions looks like that:
    <taskdef name="myTask" classname="com...MyTask"
    <typedef name="download_files" classname="com.....AntFileInfoSet"
    <typedef name="file" classname="com.....AntFileInfo"
    <myTask .......>        
<download_files id="flashline.flieInfos">
            	<file name="xxx" .../>
            	<file name="xxx" .../>

The way I use it in my task is:
public class MyTask extends Task {
    private AntFileInfoSet antFileInfoSet = null;
    public void addDownload_files(AntFileInfoSet afis) {
        antFileInfoSet = afis;

   public void execute() {
	List antFileInfoList = antFileInfoSet.getAntFileInfos();  (HERE
I KEEP GETTING above Exception)

The main problem is I can't debug this problem as it works ok under
InteliJ (there is no ClasscastException) but it doesn't outside. I use
Ant 1.6.2.
Do you have any idea?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message