ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32692] New: - Extension.getCompatibilityWith contains broken logic
Date Tue, 14 Dec 2004 11:24:43 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32692>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32692

           Summary: Extension.getCompatibilityWith contains broken logic
           Product: Ant
           Version: 1.6.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Keywords: PatchAvailable
          Severity: major
          Priority: P2
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: cernautan@gmail.com


The Extension class contains two logic errors in the getCompatibilityWith method.

Both checks, for Specification Version and for Implementation Version contains
the same error (I think it is caused by an automatic refactor action). Both
checks should imply the comparison of the currect Extension
specification/implementation version with the one suplied in the Extension
parameter.

Current code 1:
        // Available specification version must be >= required
        final DeweyDecimal specificationVersion
            = required.getSpecificationVersion();
        if (null != specificationVersion) {
            if (null == specificationVersion
                || !isCompatible(specificationVersion, specificationVersion)) {
                return REQUIRE_SPECIFICATION_UPGRADE;
            }
        }

Fixed code 1:
        final DeweyDecimal specificationVersion
            = required.getSpecificationVersion();
        if (null != specificationVersion) {
            if (null == this.specificationVersion
                || !isCompatible(this.specificationVersion, specificationVersion)) {
                return REQUIRE_SPECIFICATION_UPGRADE;
            }
        }

Current code 2:
        // Implementation version must be >= required
        final DeweyDecimal implementationVersion
            = required.getImplementationVersion();
        if (null != implementationVersion) {
            if (null == implementationVersion
                || !isCompatible(implementationVersion, implementationVersion)) {
                return REQUIRE_IMPLEMENTATION_UPGRADE;
            }
        }

Fixed code 2:
        // Implementation version must be >= required
        final DeweyDecimal implementationVersion
            = required.getImplementationVersion();
        if (null != implementationVersion) {
            if (null == this.implementationVersion
                || !isCompatible(this.implementationVersion,
implementationVersion)) {
                return REQUIRE_IMPLEMENTATION_UPGRADE;
            }
        }

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

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


Mime
View raw message