The java Program gets stuck....I think i am not handling String object properly
<p>I am new to Java and trying to write a program..
here is the code. In the function reduce when count = 14, the program gets stuck...Plz let me know what am i doing wrong..</p>

<pre><code>public static class MerkleReducer extends MapReduceBase
implements Reducer&lt;LongWritable, Text, LongWritable, Text&gt; {

 static String[][] sarray = new String[5][14];
  static int count = 0;

 private void MerkleReducer() {
   for (int i=0;i&lt;5;i++)
      for (int j=0; j&lt;14;j++)
            sarray[i][j] += "";
 }

public void reduce(LongWritable key, Iterator&lt;Text&gt; values
  OutputCollector&lt;LongWritable, Text&gt; output, Reporter reporter) throws IOException {

    count++;
    Text hashval = new Text();
    while (values.hasNext()) {
           hashval = values.next();
    }
    sarray[0][(int)key.get()] += hashval.toString();
    if (count == 14) {
        for (int i=1; i&lt;5; i++) { 
         for (int j=0; j&lt;7; j = j++) { 
           int k = 2 * j;
           String hashv= new String();
           if ("".equals(sarray[i-1][k])) {
              break;
           }
           if ("".equals(sarray[i-1][k+1])) {
               sarray[i][j] = sarray[i-1][k];
               break;
           }
           hashv += sarray[i-1][k] + sarray[i-1][k+1];
           sarray[i][j] += hashv;

        }
       }
      output.collect(key, new Text(sarray[3][0]));

    } else {
        output.collect(key, new Text(hashval.toString()));
    }
</code></pre>

<p>}
 }</p>
