This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 181284 - nb-overrideproperty task should not subclass property task
Summary: nb-overrideproperty task should not subclass property task
Status: RESOLVED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Build System (show other bugs)
Version: 6.x
Hardware: PC Other
: P1 normal (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-26 09:03 UTC by Adam Sotona
Modified: 2010-03-01 22:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Sotona 2010-02-26 09:03:51 UTC
Ant 1.8 significantly changed behavior of org.apache.tools.ant.Project

public void setProperty(java.lang.String name,
                        java.lang.String value)

    Set a property. Any existing property of the same name is overwritten, unless it is a user property.

    Parameters:
        name - The name of property to set. Must not be null.
        value - The new value of the property. Must not be null.


The new implementation prohibits overrides of any property. 

The new Ant implementation breaks functionality of <nb-overrideproperty> task that is critical part of Mobility project build system.

Following test returns "b" on Ant 1.7 and "a" on Ant 1.8:
<project name="test" default="test">
  <target name="test">
    <taskdef resource="org/netbeans/mobility/antext/defs.properties" classpath="org-netbeans-modules-mobility-antext.jar"/>
    <property name="test" value="a"/>
    <nb-overrideproperty name="test" value="b"/>
    <echo>${test}</echo>
  </target>
</project>
Comment 1 Jesse Glick 2010-02-26 10:47:10 UTC
Reproducible and filed upstream: https://issues.apache.org/bugzilla/show_bug.cgi?id=48825

Anyway you should not be using this method; delete <nb-overrideproperty>. Ant properties are designed to be single assignment. I don't exactly follow the purpose of ${buildsystem.baton} - it seems to be a strange pattern - but if you really need to pass state between targets you can do so using a properties file (as in e.g. c01e2c997e19). More likely the system of inserting build-impl.xml fragments should be fixed so that they directly specify the directories they wish to work with.
Comment 2 Jesse Glick 2010-02-27 09:15:30 UTC
(In reply to comment #1)
> https://issues.apache.org/bugzilla/show_bug.cgi?id=48825

See resolution there. The change was in Property, not Project. Subclassing other tasks is generally a poor idea.
Comment 3 Adam Sotona 2010-03-01 07:09:34 UTC
fixed in http://hg.netbeans.org/main/rev/d1d7fdf20478
Comment 4 Quality Engineering 2010-03-01 22:09:23 UTC
Integrated into 'main-golden', will be available in build *201003020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d1d7fdf20478
User: asotona@netbeans.org
Log: fixed issue #181284 nb-overrideproperty task should not subclass property task