ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant ProjectHelper.java
Date Fri, 11 Aug 2000 12:29:35 GMT
bodewig     00/08/11 05:29:34

  Modified:    src/main/org/apache/tools/ant ProjectHelper.java
  Log:
  Work around a problem with a NullPointerException on IBM JDK
  1.3/Linux.
  
  buildFile.getParent() returns null if buildFile is not absolute.
  
  Revision  Changes    Path
  1.23      +3 -2      jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ProjectHelper.java	2000/07/31 14:20:11	1.22
  +++ ProjectHelper.java	2000/08/11 12:29:34	1.23
  @@ -233,10 +233,11 @@
               if (project.getProperty("basedir") != null) {
                   project.setBasedir(project.getProperty("basedir"));
               } else {
  +                String buildFileParent = (new File(buildFile.getAbsolutePath())).getParent();
                   if (baseDir == null) {
  -                    project.setBasedir((new File(buildFile.getParent())).getAbsolutePath());
  +                    project.setBasedir((new File(buildFileParent)).getAbsolutePath());
                   } else {
  -                    project.setBasedir((new File(buildFile.getParent(), baseDir)).getAbsolutePath());
  +                    project.setBasedir((new File(buildFileParent, baseDir)).getAbsolutePath());
                   }
               }
   
  
  
  

Mime
View raw message