The "ant.properties" map incorrectly acquires a "size" entry after inserting any property


(gmaslov) #1

After inserting anything into the ant.properties map, a new entry named ‘size’ with a type of java.lang.Integer also appears. Here is a test case for the problem:

task bug << {
    assert ant.properties['size'] == null // OK
    ant.properties['foo'] = 'bar'
    assert ant.properties['size'] == null // Fail!
}

I discovered this behaviour when the AndroMDA Ant task choked on ‘size’ while iterating through the properties, since it has a type of Integer (when properties should be a Map from String to String). I worked around it by setting ant.properties[‘size’] to an empty string – using ant.properties.remove(‘size’) led to a NullPointerException within Gradle.

------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------
  Build time:
 2014-02-11 11:34:39 UTC
Build number: none
Revision:
   a831fa866d46cbee94e61a09af15f9dd95987421
  Groovy:
     1.8.6
Ant:
        Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:
        2.2.0
JVM:
        1.7.0_51 (Oracle Corporation 24.45-b08)
OS:
         Linux 2.6.32-431.5.1.el6.x86_64 amd64

(Peter Niederwieser) #2

Confirmed with 1.11 and raised GRADLE-3038.