You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2008/09/30 00:47:12 UTC

svn commit: r700296 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyAntSettings.java

Author: maartenc
Date: Mon Sep 29 15:47:12 2008
New Revision: 700296

URL: http://svn.apache.org/viewvc?rev=700296&view=rev
Log:
FIX: StackOverflow when using ivy:settings with "ivy.instance" as id (IVY-924)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=700296&r1=700295&r2=700296&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Sep 29 15:47:12 2008
@@ -89,6 +89,7 @@
 - FIX: Properties needed to parse version in POM (IVY-914) (thanks to Tom Widmer)
 - FIX: build.xml: checkstyle + checkstyle-report dont work together (IVY-919)
 - FIX: Maven packaging of "pom" should add a "jar" artifact if present (IVY-920)
+- FIX: StackOverflow when using ivy:settings with "ivy.instance" as id (IVY-924)
 
    2.0.0-rc1
 =====================================

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java?rev=700296&r1=700295&r2=700296&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java Mon Sep 29 15:47:12 2008
@@ -178,7 +178,7 @@
     public void setProject(Project p) {
         super.setProject(p);
         
-        if ("ivy.instance".equals(id) && getProject().getReference(id) == null) {
+        if ("ivy.instance".equals(id) && getProject().getReferences().get(id) == null) {
             // register ourselfs as default settings, just in case the id attribute is not set
             getProject().addReference("ivy.instance", this);
             autoRegistered = true;



Re: svn commit: r700296 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyAntSettings.java

Posted by Gilles Scokart <gs...@gmail.com>.
At a first glence (=reading the method name and the API), the two code
should do the same.

When I look into the latest ant code, the only difference between the two is :

        if (!key.equals(MagicNames.REFID_PROPERTY_HELPER)) {
            try {
                if
(PropertyHelper.getPropertyHelper(this).containsProperties(key)) {
                    log("Unresolvable reference " + key
                            + " might be a misuse of property
expansion syntax.", MSG_WARN);
                }
            } catch (Exception e) {
                //ignore
            }
        }

I guess the intention of this code was to be explicitely harmless.  I
didn't understand how it is not.

Could you explain what in this code trigger the StackOverflow ?  I
didn't find it by reading the code.

There is maybe something to fix in ant also (or a comment to add).

Gilles

2008/9/30  <ma...@apache.org>:
> Author: maartenc
> Date: Mon Sep 29 15:47:12 2008
> New Revision: 700296
>
> URL: http://svn.apache.org/viewvc?rev=700296&view=rev
> Log:
> FIX: StackOverflow when using ivy:settings with "ivy.instance" as id (IVY-924)
>
> Modified:
>    ant/ivy/core/trunk/CHANGES.txt
>    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
>
> Modified: ant/ivy/core/trunk/CHANGES.txt
> URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=700296&r1=700295&r2=700296&view=diff
> ==============================================================================
> --- ant/ivy/core/trunk/CHANGES.txt (original)
> +++ ant/ivy/core/trunk/CHANGES.txt Mon Sep 29 15:47:12 2008
> @@ -89,6 +89,7 @@
>  - FIX: Properties needed to parse version in POM (IVY-914) (thanks to Tom Widmer)
>  - FIX: build.xml: checkstyle + checkstyle-report dont work together (IVY-919)
>  - FIX: Maven packaging of "pom" should add a "jar" artifact if present (IVY-920)
> +- FIX: StackOverflow when using ivy:settings with "ivy.instance" as id (IVY-924)
>
>    2.0.0-rc1
>  =====================================
>
> Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
> URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java?rev=700296&r1=700295&r2=700296&view=diff
> ==============================================================================
> --- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java (original)
> +++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java Mon Sep 29 15:47:12 2008
> @@ -178,7 +178,7 @@
>     public void setProject(Project p) {
>         super.setProject(p);
>
> -        if ("ivy.instance".equals(id) && getProject().getReference(id) == null) {
> +        if ("ivy.instance".equals(id) && getProject().getReferences().get(id) == null) {
>             // register ourselfs as default settings, just in case the id attribute is not set
>             getProject().addReference("ivy.instance", this);
>             autoRegistered = true;
>
>
>



-- 
Gilles Scokart

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