@Nullable private File validateJdkPath(@NotNull File file){
  if (checkForJdk(file)) {
    return file;
  }
  if (SystemInfo.isMac) {
    File potentialPath=new File(file,MAC_JDK_CONTENT_PATH);
    if (potentialPath.isDirectory() && checkForJdk(potentialPath)) {
      myJdkLocationTextField.setText(potentialPath.getPath());
      return potentialPath;
    }
  }
  return null;
}

@ Nullable private File validateJdkPath ( @ NotNull File file ) { if ( checkForJdk ( file ) ) { return file ; } if ( SystemInfo . isMac ) { File potentialPath = new File ( file , MAC_JDK_CONTENT_PATH ) ; if ( potentialPath . isDirectory ( ) && checkForJdk ( potentialPath ) ) { myJdkLocationTextField . setText ( potentialPath . getPath ( ) ) ; return potentialPath ; } } return null ; }
validates that the given directory belongs to a jdk installation .
