title: new BigInteger(String) gives Sonar warning
body: <p>I am using IntelliJ IDEA 2018.1.3 Ultimate Edition, and need to compare to large integers (large enough to not fit into a <code>long</code>, for example <code>20180531234240565494</code>) represented as strings:</p>
  
  <pre><code>public int compareNumeric(String compareTo) {
      return new BigInteger(version).compareTo(new BigInteger(compareTo));
  }
  </code></pre>
  
  <p>This is the solution proposed <a href="https://stackoverflow.com/a/15717251/1421925">here</a>, which I always thought was the correct way to create a <code>BigInteger</code> from a <code>String</code>.</p>
  
  <p>However, IntelliJ gives <a href="https://rules.sonarsource.com/java/RSPEC-2129" rel="nofollow noreferrer">the following warning</a>, through a Sonar plugin:</p>
  
  <blockquote>
    <p><strong>Constructors should not be used to instantiate "String", "BigInteger", "BigDecimal" and primitive-wrapper classes</strong><br/><br/>
    squid:S2129<br/>
    Constructors for Strings, BigInteger, BigDecimal and the objects used to wrap primitives should never be used. Doing so is less clear and uses more memory than simply using the desired value in the case of strings, and using valueOf for everything else.<br/>
    Further, these constructors are deprecated in Java 9, which is an indication that they will eventually be removed from the language altogether.<br/><br/>
    <strong>Noncompliant Code Example</strong></p>
  
  <pre><code>String empty = new String(); // Noncompliant; yields essentially "", so just use that.
  String nonempty = new String("Hello world"); // Noncompliant
  Double myDouble = new Double(1.1); // Noncompliant; use valueOf
  Integer integer = new Integer(1); // Noncompliant
  Boolean bool = new Boolean(true); // Noncompliant
  BigInteger bigInteger = new BigInteger("1"); // Noncompliant
  BigDecimal bigDecimal = new BigDecimal(1.1); // Noncompliant&lt;br/&gt;
  </code></pre>
    
    <p><strong>Compliant Solution</strong></p>
  
  <pre><code>String empty = "";
  String nonempty = "Hello world";
  Double myDouble = Double.valueOf(1.1);
  Integer integer = Integer.valueOf(1);
  Boolean bool = Boolean.valueOf(true);
  BigInteger bigInteger = BigInteger.valueOf(1);
  BigDecimal bigDecimal = BigDecimal.valueOf(1.1);
  </code></pre>
  </blockquote>
  
  <p>First of all, I don't see <a href="https://docs.oracle.com/javase/9/docs/api/java/math/BigInteger.html#BigInteger-java.lang.String-" rel="nofollow noreferrer">the constructor</a> being deprecated in Java 9, is Sonar wrong here?</p>
  
  <p>Am I doing the comparison wrong and triggered a false positive, or should the comparison be made in some other way?</p>
  
  <p>The only other way I can think of is to compare the strings directly, but that would also force me to first check that the strings are numeric.</p>