title: java.lang.indexoutofboundsexception index 0 size 0
body: <p>I've been getting this java.lang.indexoutofboundsexception error when adding system functions objects in an array through checkbox:   </p>
  
  <pre><code>SEVERE: Servlet.service() for servlet spis threw exception
  java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  at java.util.ArrayList.rangeCheck(ArrayList.java:604)
  at java.util.ArrayList.get(ArrayList.java:382)
  at com.spis.dao.impl.CodesValueDaoImpl.getDescription(CodesValueDaoImpl.java:95)
  at com.spis.bo.impl.CodesValueBoImpl.getDescription(CodesValueBoImpl.java:103)
  at com.spis.controller.SystemUserController.viewPaged(SystemUserController.java:408)
  at com.spis.controller.SystemUserController.systemUser(SystemUserController.java:48)
  </code></pre>
  
  <p>Here is the for the systemFunctions: whenever i add systemFunction to a user it displays the error or when the systemFunction colummn in the database is null. But when i set systemFunction=" " in the database the page displays correctly although withouth the array of systemFunctions obviously..</p>
  
  <pre><code>String[] systemFunctions=(String[])request.getParameterValues("systemFunctions");
  String appendedSysFunctions ="";
  
  //Append system functions
  if(systemFunctions!=null){
      for(int i=0;i&lt;systemFunctions.length;i++){
          if(i==(systemFunctions.length-1)){
          appendedSysFunctions+=systemFunctions[i];
          }
          else{
          appendedSysFunctions+=systemFunctions[i] + ",";
          }
      }
  }
  </code></pre>
  
  <p>Another code:</p>
  
  <pre><code>StringTokenizer st = new StringTokenizer(su.getAllowedSysFunc(), ",");
  while (st.hasMoreTokens()){
      appendedSystemFunc = appendedSystemFunc + codesValueMethods.getDescription 
      (3, st.nextToken());
      if(st.hasMoreTokens()){
      appendedSystemFunc = appendedSystemFunc + ", \n";
      }
  }
  </code></pre>