public static void validateOpenPort(String port,Application application) throws CheckException {
  try {
    Integer.parseInt(port);
  }
 catch (  NumberFormatException e) {
    String messageTranslated=messageSource.getMessage("port.format",null,Locale.ENGLISH);
    throw new CheckException(messageTranslated + " : " + port);
  }
  if (Integer.parseInt(port) <= 0) {
    String messageTranslated=messageSource.getMessage("port.format",null,Locale.ENGLISH);
    throw new CheckException(messageTranslated + " : " + port);
  }
}

public static void validateOpenPort ( String port , Application application ) throws CheckException { try { Integer . parseInt ( port ) ; } catch ( NumberFormatException e ) { String messageTranslated = messageSource . getMessage ( "port.format" , null , Locale . ENGLISH ) ; throw new CheckException ( messageTranslated + " : " + port ) ; } if ( Integer . parseInt ( port ) <= 0 ) { String messageTranslated = messageSource . getMessage ( "port.format" , null , Locale . ENGLISH ) ; throw new CheckException ( messageTranslated + " : " + port ) ; } }
validate the syntax port .
