Unexpected behaviour of setParseIntegerOnly(true)
<p>Following is clearly mentioned in java docs about <strong><a href="http://java.sun.com/j2se/1.3/docs/api/java/text/NumberFormat.html#setParseIntegerOnly" rel="nofollow">java.text.NumberFormat</a></strong> class :-</p>

<p><strong>setParseIntegerOnly</strong> : only affects parsing, e.g. if true, "3456.78" -> 3456 (and leaves the parse position just after index 6) if false, "3456.78" -> 3456.78 (and leaves the parse position just after index 8) <strong>This is independent of formatting.</strong></p>

<p>Here is an example :-</p>

<pre><code>import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;

public class NFTest {
  public static void main(String args[]) throws Exception {
    NumberFormat numberFormat = NumberFormat.getInstance();

    //statement which is not going well
    numberFormat = NumberFormat.getNumberInstance(Locale.CHINESE);
    numberFormat.setParseIntegerOnly(true);


    String usersNumber = "1976.0826" ;

    try{
        Number num = numberFormat.parse(usersNumber) ;
        System.out.println(num);
    }
    catch(ParseException pe){
        System.out.println(pe);
    }
  }
}
</code></pre>

<p>o/p :-</p>

<p><strong>1976</strong></p>

<p>Now, here again the same example with a slight change :-</p>

<pre><code>import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;

public class NFTest {
  public static void main(String args[]) throws Exception {
    NumberFormat numberFormat = NumberFormat.getInstance();

    numberFormat.setParseIntegerOnly(true);
    //result is getting affected, if I change the
    //position of following statement
    numberFormat = NumberFormat.getNumberInstance(Locale.CHINESE);


    String usersNumber = "1976.0826" ;

    try{
        Number num = numberFormat.parse(usersNumber) ;
        System.out.println(num);
    }
    catch(ParseException pe){
        System.out.println(pe);
    }
  }
}
</code></pre>

<p>o/p :-</p>

<p><strong>1976.0826</strong></p>

<p>Why the result is getting affected due to change in the position of statements???</p>
