mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1134456 [6/6] - in /mahout/trunk: core/src/main/java/org/apache/mahout/cf/taste/common/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ core/src/main/java/org/apache/mahout/cf...
Date Fri, 10 Jun 2011 21:58:23 GMT
Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/ItineraryPanel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/ItineraryPanel.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/ItineraryPanel.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/ItineraryPanel.java Fri Jun 10 21:58:14 2011
@@ -17,12 +17,13 @@
 
 package org.apache.mahout.ga.watchmaker.travellingsalesman;
 
+import com.google.common.collect.Lists;
+
 import java.awt.BorderLayout;
 import java.awt.Container;
 import java.awt.GridLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.TreeSet;
 
@@ -47,7 +48,7 @@ final class ItineraryPanel extends JPane
     super(new BorderLayout());
     
     Container checkBoxPanel = new JPanel(new GridLayout(0, 1));
-    checkBoxes = new ArrayList<JCheckBox>(cities.size());
+    checkBoxes = Lists.newArrayListWithCapacity(cities.size());
     for (String city : cities) {
       JCheckBox checkBox = new JCheckBox(city, false);
       checkBoxes.add(checkBox);

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java (original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java Fri Jun 10 21:58:14 2011
@@ -75,18 +75,15 @@ public final class SplitBayesInputTest e
     for (String[] entry : ClassifierData.DATA) {
       if (!entry[0].equals(currentLabel)) {
         currentLabel = entry[0];
-        if (writer != null) {
-          IOUtils.quietClose(writer);
-        }
+        Closeables.closeQuietly(writer);
         
-        writer = new BufferedWriter(
-            new OutputStreamWriter(
-                fs.create(new Path(tempInputDirectory, currentLabel)), Charsets.UTF_8));
+        writer = new BufferedWriter(new OutputStreamWriter(fs.create(new Path(tempInputDirectory, currentLabel)),
+            Charsets.UTF_8));
       }
       countMap.adjustOrPutValue(currentLabel, 1, 1);
       writer.write(currentLabel + '\t' + entry[1] + '\n');
     }
-    IOUtils.quietClose(writer);
+    Closeables.closeQuietly(writer);
   }
 
   private void writeSingleInputFile() throws IOException {

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java (original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java Fri Jun 10 21:58:14 2011
@@ -17,10 +17,10 @@
 
 package org.apache.mahout.ga.watchmaker.cd.hadoop;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -43,7 +43,7 @@ public final class CDMahoutEvaluatorTest
     int target = 1;
 
     // random rules
-    List<Rule> rules = new ArrayList<Rule>();
+    List<Rule> rules = Lists.newArrayList();
     for (int index = 0; index < nbrules; index++) {
       rules.add(new RandomRule(index, target, rng));
     }
@@ -55,7 +55,7 @@ public final class CDMahoutEvaluatorTest
     CDMahoutEvaluator.initializeDataSet(input);
 
     // evaluate the rules
-    List<CDFitness> results = new ArrayList<CDFitness>();
+    List<CDFitness> results = Lists.newArrayList();
     Path output = getTestTempDirPath("output");
     fs = output.getFileSystem(new Configuration());
     fs.delete(output, true); // It's unhappy if this directory exists

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java (original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java Fri Jun 10 21:58:14 2011
@@ -17,11 +17,11 @@
 
 package org.apache.mahout.ga.watchmaker.cd.hadoop;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
 import java.util.Set;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.mapreduce.Reducer;
@@ -44,7 +44,7 @@ public final class CDReducerTest extends
   public void setUp() throws Exception {
     super.setUp();
     // generate random evaluatons and calculate expectations
-    evaluations = new ArrayList<CDFitness>();
+    evaluations = Lists.newArrayList();
     Random rng = RandomUtils.getRandom();
     int tp = 0;
     int fp = 0;

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java (original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java Fri Jun 10 21:58:14 2011
@@ -17,6 +17,7 @@
 
 package org.apache.mahout.ga.watchmaker.cd.tool;
 
+import com.google.common.collect.Lists;
 import com.google.common.io.Closeables;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataOutputStream;
@@ -32,7 +33,6 @@ import org.junit.Test;
 import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
@@ -220,12 +220,12 @@ public final class CDInfosToolTest exten
       randomDataset(fs, inpath, descriptors, descriptions);
 
       // Start the tool
-      List<String> result = new ArrayList<String>();
+      List<String> result = Lists.newArrayList();
       fs.delete(output, true); // It's unhappy if this directory exists
       CDInfosTool.gatherInfos(descriptors, inpath, output, result);
 
       // check the results
-      Collection<String> target = new ArrayList<String>();
+      Collection<String> target = Lists.newArrayList();
 
       assertEquals(nbNonIgnored(descriptors), result.size());
       int rindex = 0;

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtilsTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtilsTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtilsTest.java (original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtilsTest.java Fri Jun 10 21:58:14 2011
@@ -17,10 +17,10 @@
 
 package org.apache.mahout.ga.watchmaker.cd.tool;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.examples.MahoutTestCase;
 import org.junit.Test;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
@@ -45,7 +45,7 @@ public final class DescriptionUtilsTest 
   @Test
   public void testExtractNominalValues() {
     String description = "val1,val2,val3";
-    Collection<String> target = new ArrayList<String>();
+    Collection<String> target = Lists.newArrayList();
 
     DescriptionUtils.extractNominalValues(description, target);
 

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducerTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducerTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducerTest.java (original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducerTest.java Fri Jun 10 21:58:14 2011
@@ -17,11 +17,11 @@
 
 package org.apache.mahout.ga.watchmaker.cd.tool;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.io.Text;
 import org.apache.mahout.examples.MahoutTestCase;
 import org.junit.Test;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
@@ -64,7 +64,7 @@ public final class ToolReducerTest exten
 
     String description = reducer.nominalDescription(values.iterator());
 
-    Collection<String> actual = new ArrayList<String>();
+    Collection<String> actual = Lists.newArrayList();
     DescriptionUtils.extractNominalValues(description, actual);
 
     assertEquals(expected.size(), actual.size());
@@ -72,7 +72,7 @@ public final class ToolReducerTest exten
   }
 
   static List<Text> asList(String... strings) {
-    List<Text> values = new ArrayList<Text>();
+    List<Text> values = Lists.newArrayList();
 
     for (String value : strings) {
       values.add(new Text(value));

Modified: mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/utils/RandomRuleResults.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/utils/RandomRuleResults.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/utils/RandomRuleResults.java (original)
+++ mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/utils/RandomRuleResults.java Fri Jun 10 21:58:14 2011
@@ -17,14 +17,14 @@
 
 package org.apache.mahout.ga.watchmaker.cd.utils;
 
+import com.google.common.collect.Maps;
 import org.apache.mahout.ga.watchmaker.cd.CDFitness;
 
-import java.util.HashMap;
 import java.util.Map;
 
 public final class RandomRuleResults {
 
-  private static final Map<Integer, CDFitness> results = new HashMap<Integer, CDFitness>();
+  private static final Map<Integer, CDFitness> results = Maps.newHashMap();
 
   private RandomRuleResults() {
   }

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/benchmark/VectorBenchmarks.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/benchmark/VectorBenchmarks.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/benchmark/VectorBenchmarks.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/benchmark/VectorBenchmarks.java Fri Jun 10 21:58:14 2011
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.BitSet;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -29,6 +28,8 @@ import java.util.Random;
 import java.util.Map.Entry;
 import java.util.regex.Pattern;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.google.common.io.Closeables;
 import org.apache.commons.cli2.CommandLine;
 import org.apache.commons.cli2.Group;
@@ -73,16 +74,16 @@ public class VectorBenchmarks {
   private final Vector[][] vectors;
   private final Vector[] clusters;
   private final SparseMatrix clusterDistances;
-  private final List<Vector> randomVectors = new ArrayList<Vector>();
-  private final List<int[]> randomVectorIndices = new ArrayList<int[]>();
-  private final List<double[]> randomVectorValues = new ArrayList<double[]>();
+  private final List<Vector> randomVectors = Lists.newArrayList();
+  private final List<int[]> randomVectorIndices = Lists.newArrayList();
+  private final List<double[]> randomVectorValues = Lists.newArrayList();
   private final int cardinality;
   private final int sparsity;
   private final int numVectors;
   private final int loop;
   private final int opsPerUnit;
-  private final Map<String,Integer> implType = new HashMap<String,Integer>();
-  private final Map<String,List<String[]>> statsMap = new HashMap<String,List<String[]>>();
+  private final Map<String,Integer> implType = Maps.newHashMap();
+  private final Map<String,List<String[]>> statsMap = Maps.newHashMap();
   private final int numClusters;
   
   public VectorBenchmarks(int cardinality, int sparsity, int numVectors, int numClusters, int loop, int opsPerUnit) {
@@ -187,7 +188,7 @@ public class VectorBenchmarks {
   private void buildVectorIncrementally(TimingStatistics stats, int randomIndex, Vector v, boolean useSetQuick) {
     int[] indexes = randomVectorIndices.get(randomIndex);
     double[] values = randomVectorValues.get(randomIndex);
-    List<Integer> randomOrder = new ArrayList<Integer>();
+    List<Integer> randomOrder = Lists.newArrayList();
     for (int i = 0; i < indexes.length; i++) {
       randomOrder.add(i);
     }
@@ -814,7 +815,7 @@ public class VectorBenchmarks {
       }
     }
     sb.append('\n');
-    List<String> keys = new ArrayList<String>(statsMap.keySet());
+    List<String> keys = Lists.newArrayList(statsMap.keySet());
     Collections.sort(keys);
     for (String benchmarkName : keys) {
       List<String[]> implTokenizedStats = statsMap.get(benchmarkName);

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java Fri Jun 10 21:58:14 2011
@@ -22,12 +22,12 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
 import javax.sql.DataSource;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.NoSuchItemException;
 import org.apache.mahout.cf.taste.common.NoSuchUserException;
 import org.apache.mahout.cf.taste.common.Refreshable;
@@ -284,7 +284,7 @@ public abstract class AbstractJDBCDataMo
       log.debug("Executing SQL query: {}", getUserSQL);
       rs = stmt.executeQuery();
 
-      List<Preference> prefs = new ArrayList<Preference>();
+      List<Preference> prefs = Lists.newArrayList();
       while (rs.next()) {
         prefs.add(buildPreference(rs));
       }
@@ -324,7 +324,7 @@ public abstract class AbstractJDBCDataMo
       rs = stmt.executeQuery(getAllUsersSQL);
 
       Long currentUserID = null;
-      List<Preference> currentPrefs = new ArrayList<Preference>();
+      List<Preference> currentPrefs = Lists.newArrayList();
       while (rs.next()) {
         long nextUserID = getLongColumn(rs, 1);
         if (currentUserID != null && !currentUserID.equals(nextUserID) && !currentPrefs.isEmpty()) {
@@ -534,7 +534,7 @@ public abstract class AbstractJDBCDataMo
 
       log.debug("Executing SQL query: {}", getPrefsForItemSQL);
       rs = stmt.executeQuery();
-      List<Preference> prefs = new ArrayList<Preference>();
+      List<Preference> prefs = Lists.newArrayList();
       while (rs.next()) {
         prefs.add(buildPreference(rs));
       }

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/GenericJDBCDataModel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/GenericJDBCDataModel.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/GenericJDBCDataModel.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/GenericJDBCDataModel.java Fri Jun 10 21:58:14 2011
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
 
+import com.google.common.io.Closeables;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent;
 import org.apache.mahout.common.IOUtils;
@@ -136,7 +137,7 @@ public final class GenericJDBCDataModel 
         props.load(is);
         return props;
       } finally {
-        IOUtils.quietClose(is);
+        Closeables.closeQuietly(is);
       }
     } catch (IOException ioe) {
       throw new TasteException(ioe);

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/mongodb/MongoDBDataModel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/mongodb/MongoDBDataModel.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/mongodb/MongoDBDataModel.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/mongodb/MongoDBDataModel.java Fri Jun 10 21:58:14 2011
@@ -19,7 +19,6 @@ package org.apache.mahout.cf.taste.impl.
 
 import java.text.DateFormat;
 import java.text.ParseException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
@@ -31,6 +30,7 @@ import java.text.SimpleDateFormat;
 import java.util.regex.Pattern;
 
 import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastByIDMap;
@@ -404,8 +404,8 @@ public final class MongoDBDataModel impl
     while (cursor.hasNext()) {
       Map<String,Object> user = (Map<String,Object>) cursor.next().toMap();
       String userID = getID(user.get(mongoUserID), true);
-      Collection<List<String>> items = new ArrayList<List<String>>();
-      List<String> item = new ArrayList<String>();
+      Collection<List<String>> items = Lists.newArrayList();
+      List<String> item = Lists.newArrayList();
       item.add(getID(user.get(mongoItemID), false));
       item.add(Float.toString(getPreference(user.get(mongoPreference))));
       items.add(item);
@@ -427,8 +427,8 @@ public final class MongoDBDataModel impl
       Map<String,Object> user = (Map<String,Object>) cursor.next().toMap();
       if (!user.containsKey("deleted_at")) {
         String userID = getID(user.get(mongoUserID), true);
-        Collection<List<String>> items = new ArrayList<List<String>>();
-        List<String> item = new ArrayList<String>();
+        Collection<List<String>> items = Lists.newArrayList();
+        List<String> item = Lists.newArrayList();
         item.add(getID(user.get(mongoItemID), false));
         item.add(Float.toString(getPreference(user.get(mongoPreference))));
         items.add(item);
@@ -566,7 +566,7 @@ public final class MongoDBDataModel impl
           float ratingValue = getPreference(user.get(mongoPreference));
           Collection<Preference> userPrefs = userIDPrefMap.get(userID);
           if (userPrefs == null) {
-            userPrefs = new ArrayList<Preference>(2);
+            userPrefs = Lists.newArrayListWithCapacity(2);
             userIDPrefMap.put(userID, userPrefs);
           }
           userPrefs.add(new GenericPreference(userID, itemID, ratingValue));

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/cdbw/CDbwEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/cdbw/CDbwEvaluator.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/cdbw/CDbwEvaluator.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/cdbw/CDbwEvaluator.java Fri Jun 10 21:58:14 2011
@@ -17,12 +17,12 @@
 
 package org.apache.mahout.clustering.cdbw;
 
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.mahout.clustering.Cluster;
@@ -48,7 +48,7 @@ public class CDbwEvaluator {
   private static final Logger log = LoggerFactory.getLogger(CDbwEvaluator.class);
 
   private final Map<Integer, List<VectorWritable>> representativePoints;
-  private final Map<Integer, Double> stDevs = new HashMap<Integer, Double>();
+  private final Map<Integer, Double> stDevs = Maps.newHashMap();
   private final List<Cluster> clusters;
   private final DistanceMeasure measure;
   private boolean pruned;
@@ -102,7 +102,7 @@ public class CDbwEvaluator {
    * @return a List<Cluster> of the clusters
    */
   private static List<Cluster> loadClusters(Configuration conf, Path clustersIn) {
-    List<Cluster> clusters = new ArrayList<Cluster>();
+    List<Cluster> clusters = Lists.newArrayList();
     for (Cluster value :
          new SequenceFileDirValueIterable<Cluster>(clustersIn, PathType.LIST, PathFilters.logsCRCFilter(), conf)) {
       clusters.add(value);

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/InputMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/InputMapper.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/InputMapper.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/InputMapper.java Fri Jun 10 21:58:14 2011
@@ -20,10 +20,10 @@ package org.apache.mahout.clustering.con
 import java.io.IOException;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.regex.Pattern;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
@@ -42,7 +42,7 @@ public class InputMapper extends Mapper<
 
     String[] numbers = InputMapper.SPACE.split(values.toString());
     // sometimes there are multiple separator spaces
-    Collection<Double> doubles = new ArrayList<Double>();
+    Collection<Double> doubles = Lists.newArrayList();
     for (String value : numbers) {
       if (value.length() > 0) {
         doubles.add(Double.valueOf(value));

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/meanshift/InputMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/meanshift/InputMapper.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/meanshift/InputMapper.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/meanshift/InputMapper.java Fri Jun 10 21:58:14 2011
@@ -18,10 +18,10 @@
 package org.apache.mahout.clustering.conversion.meanshift;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.regex.Pattern;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Mapper;
@@ -40,7 +40,7 @@ public class InputMapper extends Mapper<
   protected void map(LongWritable key, Text values, Context context) throws IOException, InterruptedException {
     String[] numbers = InputMapper.SPACE.split(values.toString());
     // sometimes there are multiple separator spaces
-    Collection<Double> doubles = new ArrayList<Double>();
+    Collection<Double> doubles = Lists.newArrayList();
     for (String value : numbers) {
       if (value.length() > 0) {
         doubles.add(Double.valueOf(value));

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/ClusterEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/ClusterEvaluator.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/ClusterEvaluator.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/ClusterEvaluator.java Fri Jun 10 21:58:14 2011
@@ -17,11 +17,11 @@
 
 package org.apache.mahout.clustering.evaluation;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.mahout.clustering.Cluster;
@@ -88,7 +88,7 @@ public class ClusterEvaluator {
    * @return a List<Cluster> of the clusters
    */
   private static List<Cluster> loadClusters(Configuration conf, Path clustersIn) {
-    List<Cluster> clusters = new ArrayList<Cluster>();
+    List<Cluster> clusters = Lists.newArrayList();
     for (Cluster value :
          new SequenceFileDirValueIterable<Cluster>(clustersIn, PathType.LIST, PathFilters.logsCRCFilter(), conf)) {
       clusters.add(value);

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsDriver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsDriver.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsDriver.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsDriver.java Fri Jun 10 21:58:14 2011
@@ -18,11 +18,11 @@
 package org.apache.mahout.clustering.evaluation;
 
 import java.io.IOException;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
+import com.google.common.collect.Maps;
 import com.google.common.io.Closeables;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
@@ -167,7 +167,7 @@ public final class RepresentativePointsD
                                       DistanceMeasure measure) throws IOException {
 
     Map<Integer, List<VectorWritable>> repPoints = RepresentativePointsMapper.getRepresentativePoints(conf, stateIn);
-    Map<Integer, WeightedVectorWritable> mostDistantPoints = new HashMap<Integer, WeightedVectorWritable>();
+    Map<Integer, WeightedVectorWritable> mostDistantPoints = Maps.newHashMap();
     FileSystem fs = FileSystem.get(clusteredPointsIn.toUri(), conf);
     for (Pair<IntWritable,WeightedVectorWritable> record :
          new SequenceFileDirIterable<IntWritable,WeightedVectorWritable>(

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsMapper.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsMapper.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsMapper.java Fri Jun 10 21:58:14 2011
@@ -18,11 +18,11 @@
 package org.apache.mahout.clustering.evaluation;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.IntWritable;
@@ -41,7 +41,7 @@ public class RepresentativePointsMapper
 
   private Map<Integer, List<VectorWritable>> representativePoints;
 
-  private final Map<Integer, WeightedVectorWritable> mostDistantPoints = new HashMap<Integer, WeightedVectorWritable>();
+  private final Map<Integer, WeightedVectorWritable> mostDistantPoints = Maps.newHashMap();
 
   private DistanceMeasure measure = new EuclideanDistanceMeasure();
 
@@ -106,7 +106,7 @@ public class RepresentativePointsMapper
   }
 
   public static Map<Integer, List<VectorWritable>> getRepresentativePoints(Configuration conf, Path statePath) {
-    Map<Integer, List<VectorWritable>> representativePoints = new HashMap<Integer, List<VectorWritable>>();
+    Map<Integer, List<VectorWritable>> representativePoints = Maps.newHashMap();
     for (Pair<IntWritable,VectorWritable> record
          : new SequenceFileDirIterable<IntWritable,VectorWritable>(statePath,
                                                                    PathType.LIST,
@@ -115,7 +115,7 @@ public class RepresentativePointsMapper
       int keyValue = record.getFirst().get();
       List<VectorWritable> repPoints = representativePoints.get(keyValue);
       if (repPoints == null) {
-        repPoints = new ArrayList<VectorWritable>();
+        repPoints = Lists.newArrayList();
         representativePoints.put(keyValue, repPoints);
       }
       repPoints.add(record.getSecond());

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java Fri Jun 10 21:58:14 2011
@@ -18,6 +18,8 @@
 package org.apache.mahout.clustering.lda;
 
 import com.google.common.base.Charsets;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.google.common.io.Closeables;
 import org.apache.commons.cli2.CommandLine;
 import org.apache.commons.cli2.Group;
@@ -42,12 +44,10 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.PriorityQueue;
@@ -170,7 +170,7 @@ public final class LDAPrintTopics {
           out.println("Topic " + i);
           out.println("===========");
         }
-        List<Pair<String,Double>> topKasList = new ArrayList<Pair<String,Double>>(topK.size());
+        List<Pair<String,Double>> topKasList = Lists.newArrayListWithCapacity(topK.size());
         for(Pair<String,Double> wordWithScore : topK) {
           topKasList.add(wordWithScore);
         }
@@ -196,8 +196,8 @@ public final class LDAPrintTopics {
                                                                     Configuration job,
                                                                     List<String> wordList,
                                                                     int numWordsToPrint) {
-    List<Queue<Pair<String,Double>>> queues = new ArrayList<Queue<Pair<String,Double>>>();
-    Map<Integer,Double> expSums = new HashMap<Integer, Double>();
+    List<Queue<Pair<String,Double>>> queues = Lists.newArrayList();
+    Map<Integer,Double> expSums = Maps.newHashMap();
     for (Pair<IntPairWritable,DoubleWritable> record :
          new SequenceFileDirIterable<IntPairWritable, DoubleWritable>(
              new Path(dir, "part-*"), PathType.GLOB, null, null, true, job)) {

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/text/SequenceFilesFromDirectory.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/text/SequenceFilesFromDirectory.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/text/SequenceFilesFromDirectory.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/text/SequenceFilesFromDirectory.java Fri Jun 10 21:58:14 2011
@@ -20,9 +20,9 @@ package org.apache.mahout.text;
 import java.io.IOException;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
 import java.util.Map;
 
+import com.google.common.collect.Maps;
 import com.google.common.io.Closeables;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -132,7 +132,7 @@ public class SequenceFilesFromDirectory 
    * super() otherwise standard options (input/output dirs etc) will not be available.
    */
   protected Map<String, String> parseOptions() throws IOException {
-    Map<String, String> options = new HashMap<String, String>();
+    Map<String, String> options = Maps.newHashMap();
     options.put(CHUNK_SIZE_OPTION[0], getOption(CHUNK_SIZE_OPTION[0]));
     options.put(FILE_FILTER_CLASS_OPTION[0], getOption(FILE_FILTER_CLASS_OPTION[0]));
     options.put(CHARSET_OPTION[0], getOption(CHARSET_OPTION[0]));

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/utils/clustering/ClusterDumper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/utils/clustering/ClusterDumper.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/utils/clustering/ClusterDumper.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/utils/clustering/ClusterDumper.java Fri Jun 10 21:58:14 2011
@@ -21,7 +21,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
@@ -32,6 +31,7 @@ import java.util.Map;
 import java.util.TreeMap;
 
 import com.google.common.base.Charsets;
+import com.google.common.collect.Lists;
 import com.google.common.io.Closeables;
 import com.google.common.io.Files;
 import org.apache.commons.lang.StringUtils;
@@ -246,7 +246,7 @@ public final class ClusterDumper extends
       int keyValue = record.getFirst().get();
       List<WeightedVectorWritable> pointList = result.get(keyValue);
       if (pointList == null) {
-        pointList = new ArrayList<WeightedVectorWritable>();
+        pointList = Lists.newArrayList();
         result.put(keyValue, pointList);
       }
       pointList.add(record.getSecond());
@@ -265,7 +265,7 @@ public final class ClusterDumper extends
 
   public static String getTopFeatures(Vector vector, String[] dictionary, int numTerms) {
 
-    List<TermIndexWeight> vectorTerms = new ArrayList<TermIndexWeight>();
+    List<TermIndexWeight> vectorTerms = Lists.newArrayList();
 
     Iterator<Vector.Element> iter = vector.iterateNonZero();
     while (iter.hasNext()) {

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/ARFFIterator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/ARFFIterator.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/ARFFIterator.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/ARFFIterator.java Fri Jun 10 21:58:14 2011
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.util.regex.Pattern;
 
 import com.google.common.collect.AbstractIterator;
+import com.google.common.io.Closeables;
 import org.apache.mahout.common.IOUtils;
 import org.apache.mahout.math.DenseVector;
 import org.apache.mahout.math.RandomAccessSparseVector;
@@ -54,7 +55,7 @@ final class ARFFIterator extends Abstrac
       throw new IllegalStateException(ioe);
     }
     if (line == null) {
-      IOUtils.quietClose(reader);
+      Closeables.closeQuietly(reader);
       return endOfData();
     }
     Vector result;

Modified: mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/MapBackedARFFModel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/MapBackedARFFModel.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/MapBackedARFFModel.java (original)
+++ mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/MapBackedARFFModel.java Fri Jun 10 21:58:14 2011
@@ -17,6 +17,8 @@
 
 package org.apache.mahout.utils.vectors.arff;
 
+import com.google.common.collect.Maps;
+
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -51,10 +53,10 @@ public class MapBackedARFFModel implemen
   public MapBackedARFFModel(Map<String,Long> words, long wordCount, Map<String,Map<String,Integer>> nominalMap) {
     this.words = words;
     this.wordCount = wordCount;
-    labelBindings = new HashMap<String,Integer>();
-    idxLabel = new HashMap<Integer,String>();
-    typeMap = new HashMap<Integer,ARFFType>();
-    dateMap = new HashMap<Integer,DateFormat>();
+    labelBindings = Maps.newHashMap();
+    idxLabel = Maps.newHashMap();
+    typeMap = Maps.newHashMap();
+    dateMap = Maps.newHashMap();
     this.nominalMap = nominalMap;
     
   }
@@ -210,7 +212,7 @@ public class MapBackedARFFModel implemen
   public void addNominal(String label, String nominal, int idx) {
     Map<String,Integer> noms = nominalMap.get(label);
     if (noms == null) {
-      noms = new HashMap<String,Integer>();
+      noms = Maps.newHashMap();
       nominalMap.put(label, noms);
     }
     noms.put(nominal, idx);

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java Fri Jun 10 21:58:14 2011
@@ -18,10 +18,10 @@
 package org.apache.mahout.clustering;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -110,7 +110,7 @@ public final class TestClusterDumper ext
   }
   
   private void getSampleData(String[] docs2) throws IOException {
-    sampleData = new ArrayList<VectorWritable>();
+    sampleData = Lists.newArrayList();
     RAMDirectory directory = new RAMDirectory();
     IndexWriter writer = new IndexWriter(directory, new StandardAnalyzer(
         Version.LUCENE_31), true, IndexWriter.MaxFieldLength.UNLIMITED);

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterEvaluator.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterEvaluator.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterEvaluator.java Fri Jun 10 21:58:14 2011
@@ -18,11 +18,11 @@
 package org.apache.mahout.clustering;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -61,9 +61,9 @@ public final class TestClusterEvaluator 
   private static final double[][] REFERENCE = { {1, 1}, {2, 1}, {1, 2}, {2, 2},
       {3, 3}, {4, 4}, {5, 4}, {4, 5}, {5, 5}};
   
-  private List<VectorWritable> referenceData = new ArrayList<VectorWritable>();
+  private List<VectorWritable> referenceData = Lists.newArrayList();
   
-  private final List<VectorWritable> sampleData = new ArrayList<VectorWritable>();
+  private final List<VectorWritable> sampleData = Lists.newArrayList();
   
   private Map<Integer,List<VectorWritable>> representativePoints;
   
@@ -148,7 +148,7 @@ public final class TestClusterEvaluator 
    *          the DistanceMeasure
    */
   private void initData(double dC, double dP, DistanceMeasure measure) {
-    clusters = new ArrayList<Cluster>();
+    clusters = Lists.newArrayList();
     clusters.add(new Canopy(new DenseVector(new double[] {-dC, -dC}), 1,
         measure));
     clusters
@@ -157,9 +157,9 @@ public final class TestClusterEvaluator 
         .add(new Canopy(new DenseVector(new double[] {dC, dC}), 5, measure));
     clusters
         .add(new Canopy(new DenseVector(new double[] {dC, -dC}), 7, measure));
-    representativePoints = new HashMap<Integer,List<VectorWritable>>();
+    representativePoints = Maps.newHashMap();
     for (Cluster cluster : clusters) {
-      List<VectorWritable> points = new ArrayList<VectorWritable>();
+      List<VectorWritable> points = Lists.newArrayList();
       representativePoints.put(cluster.getId(), points);
       points.add(new VectorWritable(cluster.getCenter().clone()));
       points.add(new VectorWritable(cluster.getCenter().plus(
@@ -252,7 +252,7 @@ public final class TestClusterEvaluator 
     Canopy cluster = new Canopy(new DenseVector(new double[] {10, 10}), 19,
         measure);
     clusters.add(cluster);
-    List<VectorWritable> points = new ArrayList<VectorWritable>();
+    List<VectorWritable> points = Lists.newArrayList();
     representativePoints.put(cluster.getId(), points);
     ClusterEvaluator evaluator = new ClusterEvaluator(representativePoints,
         clusters, measure);
@@ -271,7 +271,7 @@ public final class TestClusterEvaluator 
     Canopy cluster = new Canopy(new DenseVector(new double[] {0, 0}), 19,
         measure);
     clusters.add(cluster);
-    List<VectorWritable> points = new ArrayList<VectorWritable>();
+    List<VectorWritable> points = Lists.newArrayList();
     points.add(new VectorWritable(cluster.getCenter().plus(
         new DenseVector(new double[] {1, 1}))));
     representativePoints.put(cluster.getId(), points);
@@ -299,7 +299,7 @@ public final class TestClusterEvaluator 
     Canopy cluster = new Canopy(new DenseVector(new double[] {0, 0}), 19,
         measure);
     clusters.add(cluster);
-    List<VectorWritable> points = new ArrayList<VectorWritable>();
+    List<VectorWritable> points = Lists.newArrayList();
     points.add(new VectorWritable(cluster.getCenter()));
     points.add(new VectorWritable(cluster.getCenter()));
     points.add(new VectorWritable(cluster.getCenter()));

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java Fri Jun 10 21:58:14 2011
@@ -18,12 +18,12 @@
 package org.apache.mahout.clustering.cdbw;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -70,9 +70,9 @@ public final class TestCDbwEvaluator ext
   
   private FileSystem fs;
   
-  private final Collection<VectorWritable> sampleData = new ArrayList<VectorWritable>();
+  private final Collection<VectorWritable> sampleData = Lists.newArrayList();
   
-  private List<VectorWritable> referenceData = new ArrayList<VectorWritable>();
+  private List<VectorWritable> referenceData = Lists.newArrayList();
   
   private Path testdata;
   
@@ -104,7 +104,7 @@ public final class TestCDbwEvaluator ext
    *          the DistanceMeasure
    */
   private void initData(double dC, double dP, DistanceMeasure measure) {
-    clusters = new ArrayList<Cluster>();
+    clusters = Lists.newArrayList();
     clusters.add(new Canopy(new DenseVector(new double[] {-dC, -dC}), 1,
         measure));
     clusters
@@ -113,9 +113,9 @@ public final class TestCDbwEvaluator ext
         .add(new Canopy(new DenseVector(new double[] {dC, dC}), 5, measure));
     clusters
         .add(new Canopy(new DenseVector(new double[] {dC, -dC}), 7, measure));
-    representativePoints = new HashMap<Integer,List<VectorWritable>>();
+    representativePoints = Maps.newHashMap();
     for (Cluster cluster : clusters) {
-      List<VectorWritable> points = new ArrayList<VectorWritable>();
+      List<VectorWritable> points = Lists.newArrayList();
       representativePoints.put(cluster.getId(), points);
       points.add(new VectorWritable(cluster.getCenter().clone()));
       points.add(new VectorWritable(cluster.getCenter().plus(
@@ -218,7 +218,7 @@ public final class TestCDbwEvaluator ext
     Canopy cluster = new Canopy(new DenseVector(new double[] {10, 10}), 19,
         measure);
     clusters.add(cluster);
-    List<VectorWritable> points = new ArrayList<VectorWritable>();
+    List<VectorWritable> points = Lists.newArrayList();
     representativePoints.put(cluster.getId(), points);
     CDbwEvaluator evaluator = new CDbwEvaluator(representativePoints, clusters,
         measure);
@@ -240,7 +240,7 @@ public final class TestCDbwEvaluator ext
     Canopy cluster = new Canopy(new DenseVector(new double[] {0, 0}), 19,
         measure);
     clusters.add(cluster);
-    List<VectorWritable> points = new ArrayList<VectorWritable>();
+    List<VectorWritable> points = Lists.newArrayList();
     points.add(new VectorWritable(cluster.getCenter().plus(
         new DenseVector(new double[] {1, 1}))));
     representativePoints.put(cluster.getId(), points);
@@ -271,7 +271,7 @@ public final class TestCDbwEvaluator ext
     Canopy cluster = new Canopy(new DenseVector(new double[] {0, 0}), 19,
         measure);
     clusters.add(cluster);
-    List<VectorWritable> points = new ArrayList<VectorWritable>();
+    List<VectorWritable> points = Lists.newArrayList();
     points.add(new VectorWritable(cluster.getCenter()));
     points.add(new VectorWritable(cluster.getCenter()));
     points.add(new VectorWritable(cluster.getCenter()));
@@ -302,8 +302,8 @@ public final class TestCDbwEvaluator ext
     Canopy cluster = new Canopy(new DenseVector(new double[] {0, 0}), 19,
         measure);
     clusters.add(cluster);
-    List<VectorWritable> points = new ArrayList<VectorWritable>();
-    Vector delta = new DenseVector(new double[] {0, Double.MIN_NORMAL});
+    List<VectorWritable> points = Lists.newArrayList();
+    Vector delta = new DenseVector(new double[] { 0, Double.MIN_NORMAL });
     points.add(new VectorWritable(delta.clone()));
     points.add(new VectorWritable(delta.clone()));
     points.add(new VectorWritable(delta.clone()));

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/dirichlet/TestL1ModelClustering.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/dirichlet/TestL1ModelClustering.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/dirichlet/TestL1ModelClustering.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/dirichlet/TestL1ModelClustering.java Fri Jun 10 21:58:14 2011
@@ -18,12 +18,12 @@
 package org.apache.mahout.clustering.dirichlet;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 
+import com.google.common.collect.Lists;
 import com.google.common.io.Closeables;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.document.Document;
@@ -99,7 +99,7 @@ public final class TestL1ModelClustering
   private List<VectorWritable> sampleData;
 
   private void getSampleData(String[] docs2) throws IOException {
-    sampleData = new ArrayList<VectorWritable>();
+    sampleData = Lists.newArrayList();
     RAMDirectory directory = new RAMDirectory();
     IndexWriter writer = new IndexWriter(directory,
                                          new StandardAnalyzer(Version.LUCENE_31),

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/text/SequenceFilesFromMailArchivesTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/text/SequenceFilesFromMailArchivesTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/text/SequenceFilesFromMailArchivesTest.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/text/SequenceFilesFromMailArchivesTest.java Fri Jun 10 21:58:14 2011
@@ -20,6 +20,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.util.zip.GZIPOutputStream;
 
+import com.google.common.io.Closeables;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
@@ -63,7 +64,7 @@ public final class SequenceFilesFromMail
       gzOut.write(testMailMessages.getBytes("UTF-8"));
       gzOut.finish();
     } finally {
-      IOUtils.quietClose(gzOut);
+      Closeables.closeQuietly(gzOut);
     }    
   }
 

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/text/TestSequenceFilesFromDirectory.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/text/TestSequenceFilesFromDirectory.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/text/TestSequenceFilesFromDirectory.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/text/TestSequenceFilesFromDirectory.java Fri Jun 10 21:58:14 2011
@@ -19,10 +19,10 @@ package org.apache.mahout.text;
 
 import java.io.IOException;
 import java.io.OutputStreamWriter;
-import java.util.HashMap;
 import java.util.Map;
 
 import com.google.common.base.Charsets;
+import com.google.common.collect.Maps;
 import com.google.common.io.Closeables;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
@@ -145,7 +145,7 @@ public final class TestSequenceFilesFrom
     assertEquals("chunk-0", fstats[0].getPath().getName());
     
 
-    Map<String,String> fileToData = new HashMap<String,String>();
+    Map<String,String> fileToData = Maps.newHashMap();
     for (String[] aData : data) {
       if (inputType == ParserType.CSV) {
         fileToData.put(prefix + aData[0], aData[1]);

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluatorTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluatorTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluatorTest.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluatorTest.java Fri Jun 10 21:58:14 2011
@@ -17,9 +17,11 @@
 
 package org.apache.mahout.utils.eval;
 
+import com.google.common.io.Closeables;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.mahout.cf.taste.hadoop.als.eval.ParallelFactorizationEvaluator;
 import org.apache.mahout.cf.taste.impl.TasteTestCase;
 import org.apache.mahout.common.IOUtils;
 import org.apache.mahout.math.hadoop.MathHelper;
@@ -69,7 +71,7 @@ public class ParallelFactorizationEvalua
       double rmse = Double.parseDouble(reader.readLine());
       assertEquals(0.89342, rmse, EPSILON);
     } finally {
-      IOUtils.quietClose(reader);
+      Closeables.closeQuietly(reader);
     }
 
   }

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java Fri Jun 10 21:58:14 2011
@@ -18,7 +18,6 @@
 package org.apache.mahout.utils.vectors;
 
 import java.util.Iterator;
-import java.util.NoSuchElementException;
 import java.util.Random;
 
 import com.google.common.base.Function;

Modified: mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/io/VectorWriterTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/io/VectorWriterTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/io/VectorWriterTest.java (original)
+++ mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/io/VectorWriterTest.java Fri Jun 10 21:58:14 2011
@@ -18,9 +18,9 @@
 package org.apache.mahout.utils.vectors.io;
 
 import java.io.StringWriter;
-import java.util.ArrayList;
 import java.util.Collection;
 
+import com.google.common.collect.Lists;
 import com.google.common.io.Closeables;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -59,7 +59,7 @@ public final class VectorWriterTest exte
     StringWriter strWriter = new StringWriter();
     VectorWriter writer = new TextualVectorWriter(strWriter);
     try {
-      Collection<Vector> vectors = new ArrayList<Vector>();
+      Collection<Vector> vectors = Lists.newArrayList();
       vectors.add(new DenseVector(new double[]{0.3, 1.5, 4.5}));
       vectors.add(new DenseVector(new double[]{1.3, 1.5, 3.5}));
       writer.write(vectors);

Modified: mahout/trunk/math/src/main/java/org/apache/mahout/math/AbstractMatrix.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/AbstractMatrix.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/math/src/main/java/org/apache/mahout/math/AbstractMatrix.java (original)
+++ mahout/trunk/math/src/main/java/org/apache/mahout/math/AbstractMatrix.java Fri Jun 10 21:58:14 2011
@@ -24,7 +24,6 @@ import org.apache.mahout.math.function.P
 import org.apache.mahout.math.function.DoubleFunction;
 import org.apache.mahout.math.function.VectorFunction;
 
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.NoSuchElementException;
@@ -141,7 +140,7 @@ public abstract class AbstractMatrix imp
   @Override
   public void set(String rowLabel, int row, double[] rowData) {
     if (rowLabelBindings == null) {
-      rowLabelBindings = new HashMap<String, Integer>();
+      rowLabelBindings = Maps.newHashMap();
     }
     rowLabelBindings.put(rowLabel, row);
     set(row, rowData);
@@ -163,11 +162,11 @@ public abstract class AbstractMatrix imp
   @Override
   public void set(String rowLabel, String columnLabel, int row, int column, double value) {
     if (rowLabelBindings == null) {
-      rowLabelBindings = new HashMap<String, Integer>();
+      rowLabelBindings = Maps.newHashMap();
     }
     rowLabelBindings.put(rowLabel, row);
     if (columnLabelBindings == null) {
-      columnLabelBindings = new HashMap<String, Integer>();
+      columnLabelBindings = Maps.newHashMap();
     }
     columnLabelBindings.put(columnLabel, column);
 

Modified: mahout/trunk/math/src/main/java/org/apache/mahout/math/OrthonormalityVerifier.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/OrthonormalityVerifier.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/math/src/main/java/org/apache/mahout/math/OrthonormalityVerifier.java (original)
+++ mahout/trunk/math/src/main/java/org/apache/mahout/math/OrthonormalityVerifier.java Fri Jun 10 21:58:14 2011
@@ -17,7 +17,8 @@
 
 package org.apache.mahout.math;
 
-import java.util.ArrayList;
+import com.google.common.collect.Lists;
+
 import java.util.List;
 
 public final class OrthonormalityVerifier {
@@ -28,7 +29,7 @@ public final class OrthonormalityVerifie
   public static VectorIterable pairwiseInnerProducts(Iterable<MatrixSlice> basis) {
     DenseMatrix out = null;
     for (MatrixSlice slice1 : basis) {
-      List<Double> dots = new ArrayList<Double>();
+      List<Double> dots = Lists.newArrayList();
       for (MatrixSlice slice2 : basis) {
         dots.add(slice1.vector().dot(slice2.vector()));
       }

Modified: mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/HebbianSolver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/HebbianSolver.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/HebbianSolver.java (original)
+++ mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/HebbianSolver.java Fri Jun 10 21:58:14 2011
@@ -21,8 +21,7 @@ import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 
-import java.util.ArrayList;
-
+import com.google.common.collect.Lists;
 import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.math.AbstractMatrix;
 import org.apache.mahout.math.DenseMatrix;
@@ -173,7 +172,7 @@ public class HebbianSolver {
                              int desiredRank) {
     int cols = corpus.numCols();
     Matrix eigens = new DenseMatrix(desiredRank, cols);
-    List<Double> eigenValues = new ArrayList<Double>();
+    List<Double> eigenValues = Lists.newArrayList();
     log.info("Finding " + desiredRank + " singular vectors of matrix with " + corpus.numRows() + " rows, via Hebbian");
     /**
      * The corpusProjections matrix is a running cache of the residual projection of each corpus vector against all

Modified: mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/TrainingState.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/TrainingState.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/TrainingState.java (original)
+++ mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/TrainingState.java Fri Jun 10 21:58:14 2011
@@ -17,9 +17,9 @@
 
 package org.apache.mahout.math.decomposer.hebbian;
 
-import java.util.ArrayList;
 import java.util.List;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.math.DenseVector;
 import org.apache.mahout.math.Matrix;
 import org.apache.mahout.math.Vector;
@@ -44,7 +44,7 @@ public class TrainingState {
     trainingIndex = 0;
     helperVector = new DenseVector(eigens.numRows());
     firstPass = true;
-    statusProgress = new ArrayList<EigenStatus>();
+    statusProgress = Lists.newArrayList();
     activationNumerator = 0;
     activationDenominatorSquared = 0;
     numEigensProcessed = 0;

Modified: mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/lanczos/LanczosState.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/lanczos/LanczosState.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/lanczos/LanczosState.java (original)
+++ mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/lanczos/LanczosState.java Fri Jun 10 21:58:14 2011
@@ -1,11 +1,11 @@
 package org.apache.mahout.math.decomposer.lanczos;
 
+import com.google.common.collect.Maps;
 import org.apache.mahout.math.DenseMatrix;
 import org.apache.mahout.math.Matrix;
 import org.apache.mahout.math.Vector;
 import org.apache.mahout.math.VectorIterable;
 
-import java.util.HashMap;
 import java.util.Map;
 
 public class LanczosState {
@@ -26,13 +26,13 @@ public class LanczosState {
     setBasisVector(0, initialVector);
     scaleFactor = 0;
     diagonalMatrix = new DenseMatrix(desiredRank, desiredRank);
-    singularValues = new HashMap<Integer, Double>();
+    singularValues = Maps.newHashMap();
     iterationNumber = 1;
   }
 
   protected void intitializeBasisAndSingularVectors(int numCols, int rank) {
-    basis = new HashMap<Integer, Vector>();
-    singularVectors = new HashMap<Integer, Vector>();
+    basis = Maps.newHashMap();
+    singularVectors = Maps.newHashMap();
   }
 
   public Matrix getDiagonalMatrix() {

Modified: mahout/trunk/math/src/test/java/org/apache/mahout/math/MatrixTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/test/java/org/apache/mahout/math/MatrixTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/math/src/test/java/org/apache/mahout/math/MatrixTest.java (original)
+++ mahout/trunk/math/src/test/java/org/apache/mahout/math/MatrixTest.java Fri Jun 10 21:58:14 2011
@@ -17,13 +17,13 @@
 
 package org.apache.mahout.math;
 
+import com.google.common.collect.Maps;
 import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.math.function.Functions;
 import org.apache.mahout.math.function.VectorFunction;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Random;
@@ -598,13 +598,13 @@ public abstract class MatrixTest extends
         {1, 4, 2}});
     assertNull("row bindings", m.getRowLabelBindings());
     assertNull("col bindings", m.getColumnLabelBindings());
-    Map<String, Integer> rowBindings = new HashMap<String, Integer>();
+    Map<String, Integer> rowBindings = Maps.newHashMap();
     rowBindings.put("Fee", 0);
     rowBindings.put("Fie", 1);
     rowBindings.put("Foe", 2);
     m.setRowLabelBindings(rowBindings);
     assertEquals("row", rowBindings, m.getRowLabelBindings());
-    Map<String, Integer> colBindings = new HashMap<String, Integer>();
+    Map<String, Integer> colBindings = Maps.newHashMap();
     colBindings.put("Foo", 0);
     colBindings.put("Bar", 1);
     colBindings.put("Baz", 2);
@@ -638,13 +638,13 @@ public abstract class MatrixTest extends
         {1, 4, 2}});
     assertNull("row bindings", m.getRowLabelBindings());
     assertNull("col bindings", m.getColumnLabelBindings());
-    Map<String, Integer> rowBindings = new HashMap<String, Integer>();
+    Map<String, Integer> rowBindings = Maps.newHashMap();
     rowBindings.put("Fee", 0);
     rowBindings.put("Fie", 1);
     rowBindings.put("Foe", 2);
     m.setRowLabelBindings(rowBindings);
     assertEquals("row", rowBindings, m.getRowLabelBindings());
-    Map<String, Integer> colBindings = new HashMap<String, Integer>();
+    Map<String, Integer> colBindings = Maps.newHashMap();
     colBindings.put("Foo", 0);
     colBindings.put("Bar", 1);
     colBindings.put("Baz", 2);

Modified: mahout/trunk/math/src/test/java/org/apache/mahout/math/TestMatrixView.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/test/java/org/apache/mahout/math/TestMatrixView.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/math/src/test/java/org/apache/mahout/math/TestMatrixView.java (original)
+++ mahout/trunk/math/src/test/java/org/apache/mahout/math/TestMatrixView.java Fri Jun 10 21:58:14 2011
@@ -17,11 +17,11 @@
 
 package org.apache.mahout.math;
 
+import com.google.common.collect.Maps;
 import org.apache.mahout.math.function.Functions;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.HashMap;
 import java.util.Map;
 
 public final class TestMatrixView extends MahoutTestCase {
@@ -448,12 +448,12 @@ public final class TestMatrixView extend
   public void testLabelBindings() {
     assertNull("row bindings", test.getRowLabelBindings());
     assertNull("col bindings", test.getColumnLabelBindings());
-    Map<String, Integer> rowBindings = new HashMap<String, Integer>();
+    Map<String, Integer> rowBindings = Maps.newHashMap();
     rowBindings.put("Fee", 0);
     rowBindings.put("Fie", 1);
     test.setRowLabelBindings(rowBindings);
     assertEquals("row", rowBindings, test.getRowLabelBindings());
-    Map<String, Integer> colBindings = new HashMap<String, Integer>();
+    Map<String, Integer> colBindings = Maps.newHashMap();
     colBindings.put("Foo", 0);
     colBindings.put("Bar", 1);
     test.setColumnLabelBindings(colBindings);
@@ -482,13 +482,13 @@ public final class TestMatrixView extend
   public void testLabelBindingSerialization() {
     assertNull("row bindings", test.getRowLabelBindings());
     assertNull("col bindings", test.getColumnLabelBindings());
-    Map<String, Integer> rowBindings = new HashMap<String, Integer>();
+    Map<String, Integer> rowBindings = Maps.newHashMap();
     rowBindings.put("Fee", 0);
     rowBindings.put("Fie", 1);
     rowBindings.put("Foe", 2);
     test.setRowLabelBindings(rowBindings);
     assertEquals("row", rowBindings, test.getRowLabelBindings());
-    Map<String, Integer> colBindings = new HashMap<String, Integer>();
+    Map<String, Integer> colBindings = Maps.newHashMap();
     colBindings.put("Foo", 0);
     colBindings.put("Bar", 1);
     colBindings.put("Baz", 2);

Modified: mahout/trunk/math/src/test/java/org/apache/mahout/math/decomposer/SolverTest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/math/src/test/java/org/apache/mahout/math/decomposer/SolverTest.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/math/src/test/java/org/apache/mahout/math/decomposer/SolverTest.java (original)
+++ mahout/trunk/math/src/test/java/org/apache/mahout/math/decomposer/SolverTest.java Fri Jun 10 21:58:14 2011
@@ -17,6 +17,7 @@
 
 package org.apache.mahout.math.decomposer;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.math.DenseMatrix;
 import org.apache.mahout.math.DenseVector;
 import org.apache.mahout.math.MahoutTestCase;
@@ -30,7 +31,6 @@ import org.apache.mahout.math.function.F
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
 
@@ -42,7 +42,7 @@ public abstract class SolverTest extends
   }
 
   public static void assertOrthonormal(Matrix currentEigens, double errorMargin) {
-    List<String> nonOrthogonals = new ArrayList<String>();
+    List<String> nonOrthogonals = Lists.newArrayList();
     for (int i = 0; i < currentEigens.numRows(); i++) {
       Vector ei = currentEigens.getRow(i);
       for (int j = 0; j <= i; j++) {
@@ -66,7 +66,7 @@ public abstract class SolverTest extends
 
   public static void assertOrthonormal(LanczosState state) {
     double errorMargin = 1.0e-5;
-    List<String> nonOrthogonals = new ArrayList<String>();
+    List<String> nonOrthogonals = Lists.newArrayList();
     for (int i = 0; i < state.getIterationNumber(); i++) {
       Vector ei = state.getRightSingularVector(i);
       for (int j = 0; j <= i; j++) {



Mime
View raw message