You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jay Dickon Glanville <di...@gmail.com> on 2007/06/28 17:46:17 UTC

"Overriding previous definition of reference" ... should I worry?

Hello all.

I have a build file with a set of patternsets that are declared in
alphabetical order.  There are some references between then (eg: A
references B, but A is declared first).

Because of these dependencies and their order, I'm getting warning
messages from ant, things like:
  Overriding previous definition of reference to dependee
Should I be worried?


As an example, I have a build file where the referrer is declared
before it's dependency is declared:
  <project basedir="." default="compile" name="example">
    <patternset id="depender">
      <patternset refid="dependee" />
    </patternset>
    <patternset id="dependee">
    </patternset>
    <target name="compile" >
      <echo>doing nothing</echo>
    </target>
  </project>
This produces the following output:
  Overriding previous definition of reference to dependee

  compile:
       [echo] doing nothing

  BUILD SUCCESSFUL
  Total time: 1 second

Should I be concerned with this override?


Thanks

JDG


-- 
Jay Dickon Glanville

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


Re: "Overriding previous definition of reference" ... should I worry?

Posted by Peter Reilly <pe...@gmail.com>.
On 6/28/07, Jay Dickon Glanville <di...@gmail.com> wrote:
> Dominique,
>
> "decoration" means "declaration" (as you can see, I rely too heavily
> on a spell checker that can't read my mind...)
>
> Because of your advice, I will reorder my patterset declarations so
> that they are declared before they are referred to.
>
> Thank you all for your help.
>
> JDG
>
> On 6/28/07, Dominique Devienne <dd...@gmail.com> wrote:
> > On 6/28/07, Jay Dickon Glanville <di...@gmail.com> wrote:
> > > If I can ask you, and the rest of the community, for a touch more clarification.
> > >
> > > In my example,
> > > 01]  <project basedir="." default="compile" name="example">
> > > 02]    <patternset id="depender">
> > > 03]      <patternset refid="dependee" />
> > > 04]    </patternset>
> > > 05]    <patternset id="dependee">
> > > 06]    </patternset>
> > > 07]    <target name="compile" >
> > > 08]      <echo>doing nothing</echo>
> > > 09]    </target>
> > > 10]  </project>
> > >
> > > Line 03, the reference to another patternset (one that hasn't been
> > > declared yet) in essence creates it.  It's initial value is probably
> > > an empty set.
> >
> > For historical and BC reasons, id's are handled at XML parse time, not
> > runtime. Your interpretation assumes runtime, which is incorrect.
> > OTOH, refid's are in fact handled at runtime only.

This has changed for ant 1.7.0 - code has been placed in to
handle ids at runtime, and at the same time try to keep back-compabily
if an id is not evalualed when the id is refererenced before being declared.

> >
> > > Later on, on line 05 (where the patternset officially gets declared)
> > > the patternset gets modified with whatever the decoration gives it.
> >
> > I'm not sure what you mean by decoration.
> >
> > > So, as long as all my patternset declarations are grouped together at
> > > the top of my build file, and there are no targets interspersed,
> > > everything should be fine for me.
> >
> > Since id's are handled at parse time, there can be some funny business...
> >
> > > Is my interpretation correct?
> >
> > Things could have changed, and Peter is the expert in these matters,
> > but I encourage you to add 'meat' to your patternsets, and exercise
> > them against a control set of files, to figure out for yourself.
> >
> > But in general, I don't think it's a good idea to use an id which
> > hasn't been declared beforehand, especially given the special nature
> > of id handling in Ant. You're asking for trouble ;-) --DD

This is very good advice!

Peter

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

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


Re: "Overriding previous definition of reference" ... should I worry?

Posted by Jay Dickon Glanville <di...@gmail.com>.
Dominique,

"decoration" means "declaration" (as you can see, I rely too heavily
on a spell checker that can't read my mind...)

Because of your advice, I will reorder my patterset declarations so
that they are declared before they are referred to.

Thank you all for your help.

JDG

On 6/28/07, Dominique Devienne <dd...@gmail.com> wrote:
> On 6/28/07, Jay Dickon Glanville <di...@gmail.com> wrote:
> > If I can ask you, and the rest of the community, for a touch more clarification.
> >
> > In my example,
> > 01]  <project basedir="." default="compile" name="example">
> > 02]    <patternset id="depender">
> > 03]      <patternset refid="dependee" />
> > 04]    </patternset>
> > 05]    <patternset id="dependee">
> > 06]    </patternset>
> > 07]    <target name="compile" >
> > 08]      <echo>doing nothing</echo>
> > 09]    </target>
> > 10]  </project>
> >
> > Line 03, the reference to another patternset (one that hasn't been
> > declared yet) in essence creates it.  It's initial value is probably
> > an empty set.
>
> For historical and BC reasons, id's are handled at XML parse time, not
> runtime. Your interpretation assumes runtime, which is incorrect.
> OTOH, refid's are in fact handled at runtime only.
>
> > Later on, on line 05 (where the patternset officially gets declared)
> > the patternset gets modified with whatever the decoration gives it.
>
> I'm not sure what you mean by decoration.
>
> > So, as long as all my patternset declarations are grouped together at
> > the top of my build file, and there are no targets interspersed,
> > everything should be fine for me.
>
> Since id's are handled at parse time, there can be some funny business...
>
> > Is my interpretation correct?
>
> Things could have changed, and Peter is the expert in these matters,
> but I encourage you to add 'meat' to your patternsets, and exercise
> them against a control set of files, to figure out for yourself.
>
> But in general, I don't think it's a good idea to use an id which
> hasn't been declared beforehand, especially given the special nature
> of id handling in Ant. You're asking for trouble ;-) --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Jay Dickon Glanville

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


Re: "Overriding previous definition of reference" ... should I worry?

Posted by Dominique Devienne <dd...@gmail.com>.
On 6/28/07, Jay Dickon Glanville <di...@gmail.com> wrote:
> If I can ask you, and the rest of the community, for a touch more clarification.
>
> In my example,
> 01]  <project basedir="." default="compile" name="example">
> 02]    <patternset id="depender">
> 03]      <patternset refid="dependee" />
> 04]    </patternset>
> 05]    <patternset id="dependee">
> 06]    </patternset>
> 07]    <target name="compile" >
> 08]      <echo>doing nothing</echo>
> 09]    </target>
> 10]  </project>
>
> Line 03, the reference to another patternset (one that hasn't been
> declared yet) in essence creates it.  It's initial value is probably
> an empty set.

For historical and BC reasons, id's are handled at XML parse time, not
runtime. Your interpretation assumes runtime, which is incorrect.
OTOH, refid's are in fact handled at runtime only.

> Later on, on line 05 (where the patternset officially gets declared)
> the patternset gets modified with whatever the decoration gives it.

I'm not sure what you mean by decoration.

> So, as long as all my patternset declarations are grouped together at
> the top of my build file, and there are no targets interspersed,
> everything should be fine for me.

Since id's are handled at parse time, there can be some funny business...

> Is my interpretation correct?

Things could have changed, and Peter is the expert in these matters,
but I encourage you to add 'meat' to your patternsets, and exercise
them against a control set of files, to figure out for yourself.

But in general, I don't think it's a good idea to use an id which
hasn't been declared beforehand, especially given the special nature
of id handling in Ant. You're asking for trouble ;-) --DD

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


Re: "Overriding previous definition of reference" ... should I worry?

Posted by Jay Dickon Glanville <di...@gmail.com>.
Thanks Jurgen.

If I can ask you, and the rest of the community, for a touch more clarification.

In my example,
01]  <project basedir="." default="compile" name="example">
02]    <patternset id="depender">
03]      <patternset refid="dependee" />
04]    </patternset>
05]    <patternset id="dependee">
06]    </patternset>
07]    <target name="compile" >
08]      <echo>doing nothing</echo>
09]    </target>
10]  </project>

Line 03, the reference to another patternset (one that hasn't been
declared yet) in essence creates it.  It's initial value is probably
an empty set.

Later on, on line 05 (where the patternset officially gets declared)
the patternset gets modified with whatever the decoration gives it.

So, as long as all my patternset declarations are grouped together at
the top of my build file, and there are no targets interspersed,
everything should be fine for me.

Is my interpretation correct?

Thanks again.

JDG



On 6/28/07, Knuplesch, Jürgen <Ju...@icongmbh.de> wrote:
> Hello,
>
> You are able to change values of patternsets ids etc.
> You are in general not able to change properties (immutability).
>
> The warning means: If you dont want to change the value of this id, then you are in trouble.
> But if this is exactly want you want, then everythings fine.
>
> Greetings
>
> --
> Jürgen Knuplesch                    www.icongmbh.de
> icon Systemhaus GmbH                Tel. +49 711 806098-275
> Sophienstraße 40
> D-70178 Stuttgart                   Fax. +49 711 806098-299
>
> Geschäftsführer: Uwe Seltmann
> HRB Stuttgart 17655
> USt-IdNr.: DE 811944121
> -----Ursprüngliche Nachricht-----
> Von: Jay Dickon Glanville [mailto:dickon.glanville@gmail.com]
> Gesendet: Donnerstag, 28. Juni 2007 17:46
> An: Ant User
> Betreff: "Overriding previous definition of reference" ... should I worry?
>
> Hello all.
>
> I have a build file with a set of patternsets that are declared in alphabetical order.  There are some references between then (eg: A references B, but A is declared first).
>
> Because of these dependencies and their order, I'm getting warning messages from ant, things like:
>   Overriding previous definition of reference to dependee Should I be worried?
>
>
> As an example, I have a build file where the referrer is declared before it's dependency is declared:
>   <project basedir="." default="compile" name="example">
>     <patternset id="depender">
>       <patternset refid="dependee" />
>     </patternset>
>     <patternset id="dependee">
>     </patternset>
>     <target name="compile" >
>       <echo>doing nothing</echo>
>     </target>
>   </project>
> This produces the following output:
>   Overriding previous definition of reference to dependee
>
>   compile:
>        [echo] doing nothing
>
>   BUILD SUCCESSFUL
>   Total time: 1 second
>
> Should I be concerned with this override?
>
>
> Thanks
>
> JDG
>
>
> --
> Jay Dickon Glanville
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Jay Dickon Glanville

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


AW: "Overriding previous definition of reference" ... should I worry?

Posted by Knuplesch, Jürgen <Ju...@icongmbh.de>.
Hello,

You are able to change values of patternsets ids etc. 
You are in general not able to change properties (immutability).

The warning means: If you dont want to change the value of this id, then you are in trouble.
But if this is exactly want you want, then everythings fine.

Greetings

-- 
Jürgen Knuplesch                    www.icongmbh.de
icon Systemhaus GmbH                Tel. +49 711 806098-275
Sophienstraße 40                    
D-70178 Stuttgart                   Fax. +49 711 806098-299

Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 
-----Ursprüngliche Nachricht-----
Von: Jay Dickon Glanville [mailto:dickon.glanville@gmail.com] 
Gesendet: Donnerstag, 28. Juni 2007 17:46
An: Ant User
Betreff: "Overriding previous definition of reference" ... should I worry?

Hello all.

I have a build file with a set of patternsets that are declared in alphabetical order.  There are some references between then (eg: A references B, but A is declared first).

Because of these dependencies and their order, I'm getting warning messages from ant, things like:
  Overriding previous definition of reference to dependee Should I be worried?


As an example, I have a build file where the referrer is declared before it's dependency is declared:
  <project basedir="." default="compile" name="example">
    <patternset id="depender">
      <patternset refid="dependee" />
    </patternset>
    <patternset id="dependee">
    </patternset>
    <target name="compile" >
      <echo>doing nothing</echo>
    </target>
  </project>
This produces the following output:
  Overriding previous definition of reference to dependee

  compile:
       [echo] doing nothing

  BUILD SUCCESSFUL
  Total time: 1 second

Should I be concerned with this override?


Thanks

JDG


--
Jay Dickon Glanville

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


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