title: Referring to a non-final variable data inside an inner class
body: <p>Im doing a program in GWT. Here is the snippet where Im having problem</p>
  
  <pre><code> private String[] populateRSSData() {
    1==&gt;&gt; String[] data = null;
    try {
     new RequestBuilder(RequestBuilder.GET,
       "../database.php?action=populaterss").sendRequest(null,
       new RequestCallback() {
  
        @Override
        public void onResponseReceived(Request request,
          Response response) {
         2==&gt;&gt; data=response.getText().split("~");
        }
  
        @Override
        public void onError(Request request, Throwable exception) {
         Window.alert(exception.getMessage());
        }
       });
    } catch (RequestException e) {
     Window.alert(e.getMessage());
    }
  
    return data;
   }
  </code></pre>
  
  <p>Now the problem arises that I get an error that the variable <code>1==&gt;&gt;</code> <code>data</code> should be declared <code>final</code>. But if I declare it as <code>final</code> then i cannot store the datas in <code>2==&gt;&gt;</code></p>
  
  <p>The error i get </p>
  
  <p><code>Cannot refer to a non-final variable data inside an inner class defined in a different method RSS_Manager.java</code></p>
  
  <p>Please suggest</p>