title: Fortify scanning issue in Android Studio
body: <p>I get an "Unsafe JNI (Input Validation and Representation, Semantic)" issue after I use Fortify to scan my code. I had referred to the recommendations from Fortify and searched some solution on website, but I can't fix the problem.</p>
  
  <p>I follow the compliant solution recommended by Fortify in this <a href="https://www.securecoding.cert.org/confluence/display/java/JNI00-J.+Define+wrappers+around+native+methods" rel="nofollow noreferrer">website</a>. 
  I even use Fortify to scan the recommended code from the website, and get the same issue.</p>
  
  <p>My code is shown below:</p>
  
  <pre><code>public final class JNI_Related {
  
  // JNI
  public native FileDescriptor open(String path, int baudrate, int data_bits, char parity, int stop_bits);
  
  public native void close();
  
  public FileDescriptor DoOpen(String mPath, int mBaudrate, int mData_bits, char mParity, int mStop_bits){
  
      if(mmPath.length() == 0){
          throw new NullPointerException();
      }
  
      if((mmBaudrate &lt; 0) || (mmData_bits &lt; 0) || (mmStop_bits &lt; 0) || (mmParity == 'a')){
          throw new IllegalArgumentException();
      }
      mFd = open(mmPath, mmBaudrate, mmData_bits, mmParity, mmStop_bits);
  
      if(mFd == null){
          throw new IllegalArgumentException();
      }
      return mFd;
  }
  
  public void DoClose(){
      close();
  }
  
  static {
      System.loadLibrary("jniutill");
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I really need some help!</p>