ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wohlgemuth <berlinguyi...@gmail.com>
Subject weird problem with Class instanceOf
Date Wed, 09 Aug 2006 01:50:22 GMT
hi,

at first I work since a long time with ant and wrote arround 50 ant
tasks sofar, I thought I know what I do...
...I was wrong

anyway thats my problem:

I have 3 classes

1. ClusterInitialzieTask, parent class:Task

-> used to intialize a cluster and contains objects of type 2. or 3.

2. ClusterParameter, parent class: ProjectComponent

-> a configuration parameter

3. Configuration, parent class: DataType

-> my configuration containing objects of type 2.

now I want to access the object configuration over a refrence

<config id="conf">
 <parameter name="username" value="my name" />
</config>			


<initialize factory="tada">
 <config refid="conf"/>
</initialize>

and always get:

conf doesn't denote a config
	at org.apache.tools.ant.types.DataType.getCheckedRef(DataType.java:156)
	at edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.Configuration.getContent(Configuration.java:68)
	at edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.ClusterInitializeTask.getProperties(ClusterInitializeTask.java:122)

method where the call happens:

Object o = this.getCheckedRef(Configuration.class, "config");


when I access the refrence object direclty in the setRefId method and
make a simple System.err:

System.err.println(reference.getReferencedObject() instanceof
edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.Configuration);

System.err.println(reference.getReferencedObject().getClass());

i become an output like this:

[initialize] false
[initialize] class
edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.Configuration

I know they are both from the same instance I just don't know why my
instanceof gives me a "false" and not a "true".

does anybody has an idea? I can also provide the sourcecode if requested.

thx for your help,

g.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message