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 47623] New: Task.log(Throwable, int) throws NullPointerException on messageless exceptions
Date Sun, 02 Aug 2009 18:42:48 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47623

           Summary: Task.log(Throwable, int) throws NullPointerException
                    on messageless exceptions
           Product: Ant
           Version: 1.7.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: tomer+asf+bugzilla@tomergabel.com


While creating a custom task I've found that logging a Throwable with no
message will cause a NullPointerException. This is caused because
Task.log(Throwable, int) forwards the error message to Project.log(Task,
String, Throwable, int) which does not support null messages.

To reproduce:

public class Example extends Task {
    @Override
    public final void execute() throws BuildException {
        final Throwable t = new Exception();
        this.log( t, Project.MSG_ERR );
    }
}

Suggested behavior: either modify API to throw IllegalArgumentException with a
messageless Throwable, or (preferably) modify error message mangling to support
nulls.

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