felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r800024 - /felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java
Date Sun, 02 Aug 2009 10:57:01 GMT
Author: dsavage
Date: Sun Aug  2 10:57:01 2009
New Revision: 800024

URL: http://svn.apache.org/viewvc?rev=800024&view=rev
Log:
Prevent NPE, throw meaningful runtime exception in it's place, FELIX-1438

Modified:
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java?rev=800024&r1=800023&r2=800024&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java
(original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java
Sun Aug  2 10:57:01 2009
@@ -169,8 +169,12 @@
         //int level = findLevel( key + LEVEL, type, prefs );
         ArrayList<IRepositoryModel> reps = new ArrayList<IRepositoryModel>();
         for ( String s : PrefsUtils.stringToArray( getPreferences().getString( REPOSITORY_DEFAULT_SET
) ) )
-        {
-            reps.add( findRepository( s ) );
+        {   
+            IRepositoryModel rep = findRepository( s );
+            if ( rep == null ) {
+                throw new IllegalStateException( "Missing repository for " + s );
+            }
+            reps.add( rep );
         }
         return new RepositorySet( reps );
     }
@@ -184,7 +188,11 @@
             ArrayList<IRepositoryModel> reps = new ArrayList<IRepositoryModel>();
             for ( String s : PrefsUtils.stringToArray( getPreferences().getString( key )
) )
             {
-                reps.add( findRepository( s ) );
+                IRepositoryModel rep = findRepository( s );
+                if ( rep == null ) {
+                    throw new IllegalStateException( "Missing repository for " + s );
+                }
+                reps.add( rep );
             }
             return new RepositorySet( reps );
         }



Mime
View raw message