private Snippet checkValidSnippet ( Snippet sn ) { if ( sn == null ) { throw new NullPointerException ( messageFormat ( "jshell.exc.null" ) ) ; } else { if ( sn . key ( ) . state ( ) != this ) { throw new IllegalArgumentException ( messageFormat ( "jshell.exc.alien" ) ) ; } return sn ; } }
Check a Snippet parameter coming from the API user