ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49659] New: Project.getReference(key) no longer returns certain references
Date Wed, 28 Jul 2010 15:17:26 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49659

           Summary: Project.getReference(key) no longer returns certain
                    references
           Product: Ant
           Version: 1.8.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: michael_rennie@ca.ibm.com


Working on updating Eclipse to use Ant 1.8.1 I found that we have numerous test
suite failures around popup /completion proposals. I tracked the problem back
to where we try to look up a path element by its id.

The following is the test build file that fails:

<project default="1">
    <path id="project.class.path">
        <pathelement location="lib/" />
        <pathelement path="${java.class.path}/" />
        <pathelement path="${additional.path}" />
    </path>

    <target name="1">
        <path id="project.class.path2">
            <path refid="project.class.path" />
        </path>
    </target>
    <target name="compile">
        <javac srcdir="src"
           destdir="dst"
           classpathref=""
           sourcepathref=""
           bootclasspathref=""
           debug="on" />
    </target>
    <target name= "depends" depends=" compile  , 1 ">
    </target>
    <property name="name with spaces" value="value with spaces"/>
    <fileset dir="dir" id="filesetTest">
        <include name="include"/>
        <exclude name="exclude"/>
    </fileset>
    <patternset id="patternSetTest">
            <include name="*.xml"/>
            <exclude name="**/*Test*"/>
    </patternset>
    <patternset id="patternSetTestBad">
        <includesfile name="nothere"/>
    </patternset>
    <echo>${name with spaces}</echo>
    <fileset refid="filesetTest">
        <patternset refid="patternSetTest"></patternset>
        <patternset refid="patternSetTestBad"></patternset>
    </fileset>
</project>

During our tests we try to look up the element "project.class.path". In
versions < 1.8.* this worked fine, however in Ant 1.8.1 the lookup will always
result in null being returned.

I tracked the cause to Project.getReference(key), where you used to lookup the
element in the idReferences map to try and resolve it if it did not appear in
the references mapping. 

Perhaps AntRefTable.get(..) needs to also consult the idReferences cache in the
event of a miss?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message