kriegaex commented on code in PR #133: URL: https://github.com/apache/xalan-java/pull/133#discussion_r1412268214
########## xalan/src/main/java/org/apache/xalan/Version.java: ########## @@ -51,12 +49,24 @@ public class Version private static boolean snapshot; static { - readProperties(); - parseVersionNumber(); + parseVersionNumber(readVersionNumber()); + } + + static String readVersionNumber() { + try (InputStream fromResource = getPropertiesStream()) { + Properties properties = new Properties(); + if (fromResource != null) { + properties.load(fromResource); + return properties.getProperty("version", NO_VERSION); + } + } catch (Exception e) { + new RuntimeException("Cannot read properties file to extract Xalan version number information: ", e) + .printStackTrace(); + } Review Comment: `Exception` does cover all exception types, just not all throwable types. For instance, `Error`s ought not be caught. They are supposed to be escalated and ought to exit the application, which is why I am only catching exceptions. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org For additional commands, e-mail: dev-h...@xalan.apache.org