title: How to work with int values in gwt jsni methods
body: <p>How is it possible to work with int values in jsni methods?</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Person extends JavaScriptObject{                                                                                                                     
  
     // some other methods
  
     public final native void setPoints(int i)/*-{
         this.points= this.points + i;
     }-*/;
  
     public final native int getPoints()/*-{
          return this.points;
     }-*/;                                                                                    
  }
  </code></pre>
  
  <p>I am using this in a method combined with a JsArray</p>
  
  <pre><code>public static boolean moreThanZeroPoints(JsArray&lt;Person&gt; arr, int index){
       if(arr.get(index).getPoints() &gt; 0){
           return true;
       }
       return false;
  }
  </code></pre>
  
  <p>In <code>arr.get(index).getPoints()</code> gives the following error-message:</p>
  
  <pre><code>    uncaught: Exception caught: Exception: caught: something other than an int was returned from JSNI method.
      package-path:: getPoints(): JS value of type undefined, expected int
  </code></pre>
  
  <p>For <code>arr.get(index).setPoints(1)</code> i get the same error-message.
  What is wrong?
  Please help.</p>