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 34136] New: - P4Sync.setLabel(null) throws NPE, "" does not behave as expected
Date Tue, 22 Mar 2005 20:02:46 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=34136>.
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=34136

           Summary: P4Sync.setLabel(null) throws NPE, "" does not behave as
                    expected
           Product: Ant
           Version: 1.6.2
          Platform: All
               URL: http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apach
                    e/tools/ant/taskdefs/optional/perforce/P4Sync.java?view=
                    markup
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P3
         Component: Optional SCM tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: dilum.ranatunga@webifysolutions.com


A quick inspection of the code indicates what appears to be a non-sensical
condition:
  if (str == null && !str.equals("")) { ... }

See link, or snippet below:

public class P4Sync extends P4Base {
    ...
    public void setLabel(String label) throws BuildException {
        if (label == null && !label.equals("")) {
            throw new BuildException("P4Sync: Labels cannot be Null or Empty");
        }
    ...

Work around is to extend P4Sync, and put some guards in place.

-- 
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