mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r779560 - /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
Date Thu, 28 May 2009 11:03:10 GMT
Author: srowen
Date: Thu May 28 11:03:10 2009
New Revision: 779560

URL: http://svn.apache.org/viewvc?rev=779560&view=rev
Log:
Better exception in case where dataModel has no items

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java?rev=779560&r1=779559&r2=779560&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
Thu May 28 11:03:10 2009
@@ -97,6 +97,9 @@
     if (dataModel == null) {
       throw new IllegalArgumentException("dataModel is null");
     }
+    if (dataModel.getNumItems() < 1) {
+      throw new IllegalArgumentException("dataModel has no items");
+    }
     if (maxEntries <= 0L) {
       throw new IllegalArgumentException("maxEntries must be positive");
     }



Mime
View raw message