Fortify scanning issue in Android Studio

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.

I follow the compliant solution recommended by Fortify in this website.
I even use Fortify to scan the recommended code from the website, and get the same issue.

My code is shown below:

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 < 0) || (mmData_bits < 0) || (mmStop_bits < 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");
}

}

I really need some help!

In your native methods, you have them declared as public:

public native FileDescriptor open(...);
public native void close();

The site you linked to in your question says that in order to resolve the Unsafe JNI issue, the native methods must be marked as private, making the only way you can reach the native method is through your public wrapper method that sanitizes the input parameters.