title: strange problem in an array
body: <p>I'm working on a little server app with Java. So, I'm getting informations from different client, and if information comes in, the following method is called:</p>
  
  <pre><code>public void writeToArray(String data) {
      data = trim(data);
      String[] netInput = new String[5];
      netInput[0]="a";
      netInput[1]="a";
      netInput[2]="a";
      netInput[3]="a";
      netInput[4]="a";
      netInput = split(data, ",");
      pos_arr = PApplet.parseInt(netInput[0]);
      rohr_value = PApplet.parseInt(netInput[1]); // THIS LINE KICKS OUT THE ERROR.
      if(pos_arr &gt;0 &amp;&amp; pos_arr&lt;100) {
          fernrohre[pos_arr] = rohr_value;
          println("pos arr length: " + fernrohre[pos_arr]);
          println("pos arr: " + pos_arr);
      }
  </code></pre>
  
  <p>The console on OS X gives me the following error:</p>
  
  <pre><code>Exception in thread "Animation Thread"
  java.lang.ArrayIndexOutOfBoundsException:1
   at server_app.writeToArray(server_app.java:108) at server_app.draw(server_app.java:97)
   at processing.core.PApplet.handleDraw(PApplet.java:1606)
   at processing.core.PApplet.run(PApplet.java:1503)
   at java.lang.Thread.run(Thread.java:637)
  </code></pre>
  
  <p>As you can see, I tried to fill the array netInput with at least 5 entries, so there can't be an ArrayIndexOutOfBoundsException.</p>
  
  <p>I don't understand that, and I'm thankful for your help!</p>
  
  <p>It would work already for me, if I can catch the error and keep the app continuing.</p>