vlsi commented on code in PR #133: URL: https://github.com/apache/xalan-java/pull/133#discussion_r1411670964
########## 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: It might be a slightly better idea to use `catch(Throwable)` since `Exception` does not cover all the exception types. -- 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