Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 9997 invoked from network); 30 Jun 2004 08:15:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 30 Jun 2004 08:15:34 -0000 Received: (qmail 69582 invoked by uid 500); 30 Jun 2004 08:15:44 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 69481 invoked by uid 500); 30 Jun 2004 08:15:41 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 69415 invoked by uid 99); 30 Jun 2004 08:15:40 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [134.132.72.99] (HELO junior.lgc.com) (134.132.72.99) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 30 Jun 2004 01:15:38 -0700 Received: from lgchvw01.lgc.com (lgchvw01.lgc.com [134.132.93.107]) by junior.lgc.com (8.11.7/8.11.3) with SMTP id i5U8Dk426477; Wed, 30 Jun 2004 03:13:46 -0500 (CDT) Received: from 134.132.93.152 by lgchvw01.lgc.com (InterScan E-Mail VirusWall NT); Wed, 30 Jun 2004 03:14:51 -0500 Received: by lgchexchbh.ad.lgc.com with Internet Mail Service (5.5.2657.72) id ; Wed, 30 Jun 2004 03:14:50 -0500 Message-ID: From: Dominique Devienne To: "'Stefan Bodewig '" , "'user@ant.apache.org '" Subject: RE: Problem using org.apache.tools.ant.taskdefs.Java Date: Wed, 30 Jun 2004 03:14:49 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) List-Subscribe: Content-Type: text/plain X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I'll post this again, in case it's useful. --DD /** * Configures a helper task to be used within another task. * * @param parent the parent (custom) task using the helper task. * @param helper the helper task to configure for use. * @return the configured helper task for call chaining. */ public static Task configureTask(Task parent, Task helper) { // Make helper share attributes of the parent helper.setProject(parent.getProject()); helper.setTaskName(parent.getTaskName()); helper.setOwningTarget(parent.getOwningTarget()); // Initialize (and return) the helper helper.init(); return helper; } -----Original Message----- From: Stefan Bodewig To: user@ant.apache.org Sent: 6/30/2004 1:06 AM Subject: Re: Problem using org.apache.tools.ant.taskdefs.Java On Wed, 30 Jun 2004, Robert Mark Bram wrote: > // Run common.guitools.Test as a Java task > Java testTask = new Java(); Ant usually does more than that, in particular it invokes setProject with a valid project reference - and without actually checking the code I'd bet the NPE you see is Ant trying to use that project reference. Java testTask = (Java) getProject().createTask("java"); would be the better approach. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org