#13 NullPointerException in CCTask.execute

closed-fixed
nobody
None
5
2004-04-22
2002-10-31
Anonymous
No

If I don't specify objdir or outfile, and I didn't
because the documentation didn't say either was
required, then a NullPointerException occurs at line
689 of CCTask.execute:

if(!_objDir.exists()) {

Discussion

  • Curt Arnold

    Curt Arnold - 2004-04-22
    • status: open --> closed-fixed
     
  • Curt Arnold

    Curt Arnold - 2004-04-22

    Logged In: YES
    user_id=27193

    If neither outfile or objdir is specified, the current working
    directory will be used as the object directory.

    Index: CCTask.java

    =====================
    RCS file: /cvsroot/ant-
    contrib/cpptasks/src/net/sf/antcontrib/cpptasks/CCTask.java,
    v
    retrieving revision 1.50
    diff -u -r1.50 CCTask.java
    --- CCTask.java 22 Apr 2004 17:13:17 -0000 1.50
    +++ CCTask.java 22 Apr 2004 17:19:27 -0000
    @@ -495,9 +495,14 @@
    //
    // if link type allowed objdir to be defaulted
    // provide it from outfile
    - if (_objDir == null && _outfile != null) {
    - _objDir = new File(_outfile.getParent());
    + if (_objDir == null) {
    + if(_outfile != null) {
    + _objDir = new File(_outfile.getParent());
    + } else {
    + _objDir = new File(".");
    + }
    }
    +
    //
    // if the object directory does not exist
    //

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks