continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r698083 - in /continuum/trunk: continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Tue, 23 Sep 2008 03:38:44 GMT
Author: ctan
Date: Mon Sep 22 20:38:44 2008
New Revision: 698083

URL: http://svn.apache.org/viewvc?rev=698083&view=rev
Log:
[CONTINUUM-1886] fix NPE

Modified:
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=698083&r1=698082&r2=698083&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Mon Sep 22 20:38:44 2008
@@ -247,16 +247,18 @@
     public File getReleaseOutputDirectory()
     {
         File releaseOutputDirectory = generalConfiguration.getReleaseOutputDirectory();
-        if ( releaseOutputDirectory == null )
-        {
-            releaseOutputDirectory = getFile( systemConf.getReleaseOutputDirectory() );
-            setReleaseOutputDirectory( releaseOutputDirectory );
-        }
+
         return releaseOutputDirectory;
     }
 
     public void setReleaseOutputDirectory( File releaseOutputDirectory )
     {
+        if ( releaseOutputDirectory == null )
+        {
+            generalConfiguration.setReleaseOutputDirectory( releaseOutputDirectory );
+            return;
+        }
+
         File f = releaseOutputDirectory;
         try
         {
@@ -314,6 +316,11 @@
 
     public File getReleaseOutputDirectory( int projectGroupId )
     {
+        if ( getReleaseOutputDirectory() == null )
+        {
+            return null;
+        }
+        
         File dir = new File( getReleaseOutputDirectory(), Integer.toString( projectGroupId
) );
         
         try
@@ -332,6 +339,11 @@
     {
         File dir = getReleaseOutputDirectory( projectGroupId );
 
+        if ( dir == null )
+        {
+            return null;
+        }
+        
         if ( !dir.exists() && !dir.mkdirs() )
         {
             throw new ConfigurationException(

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=698083&r1=698082&r2=698083&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Sep 22 20:38:44 2008
@@ -802,16 +802,20 @@
             Project project = getProjectWithBuilds( projectId );
 
             List<ContinuumReleaseResult> releaseResults = releaseResultDao.getContinuumReleaseResultsByProject(
projectId );
-            
+
             try
             {
                 for ( ContinuumReleaseResult releaseResult : releaseResults )
                 {
                     releaseResultDao.removeContinuumReleaseResult( releaseResult );
                 }
-                
+
                 File releaseOutputDirectory = configurationService.getReleaseOutputDirectory(
project.getProjectGroup().getId() );
-                FileUtils.deleteDirectory( releaseOutputDirectory );
+
+                if ( releaseOutputDirectory != null )
+                {
+                    FileUtils.deleteDirectory( releaseOutputDirectory );
+                }
             }
             catch ( ContinuumStoreException e )
             {



Mime
View raw message