title: Java: Weird String/Integer error on single PC
body: <p>This code:</p>
  
  <pre><code>private boolean yearIsValid(String v) {
     if (Utilities.noString(v) || v.length() &lt; 4)
       return false;
     v = v.substring(0, 4);
     if (!Utilities.IsInteger(v))
       return false;
     int i = Integer.parseInt(v);
     return i &gt;= 1800 &amp;&amp; i &lt;= 2100;
   }
  </code></pre>
  
  <p>on one single computer, it returns false for the input value 2015-05-28T06:26:27-05:00. On every other computer it runs on (100s all across the world) it succeeds. The computer on which it fails is localised to USA. </p>
  
  <p>I have no idea what to look for (except I'm pretty sure it's not a secret BOM, the value comes from an XML attribute in a DOM)</p>
  
  <p>For reference</p>
  
  <pre><code>public static boolean noString(String v) { 
    return v == null || v.equals(""); 
  }
  
  public static boolean IsInteger(String string) {
      try {
          int i = Integer.parseInt(string);
          return i != i+1;
      } catch (Exception e) {
          return false;
      }
  }
  </code></pre>