title: java.lang.NumberFormatException: For input string: "100" while executing MapReduce
body: <p>I'm writing a MapReduce job for finding common friends on facebook.</p>
  
  <p>This is the input for my mapper :</p>
  
  <pre><code>100, 200 300 400 500 600
  200, 100 300 400
  300, 100 200 400 500
  400, 100 200 300
  500, 100 300
  600, 100
  </code></pre>
  
  <p>And this is part of my mapper code:</p>
  
  <pre><code>map{
          String line = value.toString();
          String[] LineSplits = line.split(",");
  
  
          String[] friends = LineSplits[1].trim().split(" ");
          for(int i =0; i&lt;friends.length;i++) {
              int friend2 = Integer.parseInt(friends[i]);
              System.out.println(friend2);
          }
  
          int friend1 = Integer.parseInt(LineSplits[0]);
          System.out.println(friend1);
  }                                            
  </code></pre>
  
  <p>When I execute this,I am getting correct values in <code>friend2</code>. (<code>Intege.parseInt</code> is working fine here).  The variable friend1 is supposed to get the value as '100'. But <code>Integer.ParseInt</code> is not working and I am getting an error like this:</p>
  
  <pre><code>java.lang.Exception: java.lang.NumberFormatException: For input string: "100"
      at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:354)
  Caused by: java.lang.NumberFormatException: For input string: "100"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.lang.Integer.parseInt(Integer.java:580)
      at java.lang.Integer.parseInt(Integer.java:615)
      at com.hadoop.CFMapper.map(CFMapper.java:29)
      at com.hadoop.CFMapper.map(CFMapper.java:1)
      at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
      at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:430)
      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:366)
      at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:223)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>So I got stuck here. Why am I getting a NumberFormatException for this? and how can I rectify this?</p>