Is there a way around local variable may not have been initialized
<p>I am getting the error the local variable may not have been initialized on the following line of code</p>

<pre><code>final StingBuilder personSearchURLOne = personSearchURLOne.append(getName.getName1(searchOne));
</code></pre>

<p>I cannot initialize by having final StringBuilder personSearchURLOne = null; at first because then I will not be able to change it later so im trying to initialize it final in the instance i need it. It has to be final because if it isnt I get the error: Cannot refer to a non-final variable inside an inner class defined in a different method.</p>

<p>Here is my other class</p>

<pre><code>import android.widget.EditText;

public class getName {
static String nameOne = null;
static String nameTwo = null;

static StringBuilder personURLOne = new StringBuilder();
static StringBuilder personURLTwo = new StringBuilder();

public static String personURL = "http://api.themoviedb.org/3/search/person?api_key=bb0b6d66c2899aefb4d0863b0d37dc4e&amp;query=";

public static StringBuilder getName1(EditText searchOne){
    nameOne = searchOne.getText().toString();


    nameOne = nameOne.replace(" ", "_");


    personURLOne.append(personURL); 
    personURLOne = personURLOne.append(nameOne);



    return personURLOne;

}

public static StringBuilder getName2(EditText searchTwo){
    nameTwo = searchTwo.getText().toString();
    nameTwo = nameTwo.replace(" ", "_");

    personURLTwo.append(personURL);
    personURLTwo = personURLTwo.append(nameTwo);

    return personURLTwo;
}


}
</code></pre>
