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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to