W3C home > Mailing lists > Public > www-validator-cvs@w3.org > June 2010

unicorn commit: fixed: threw a npe if messages.properties does not exist

From: Mercurial notifier <nobody@w3.org>
Date: Fri, 18 Jun 2010 16:19:01 -0400
To: Unicorn Updates <www-validator-cvs@w3.org>
Message-Id: <E1OPi1l-0005lB-Lp@blinky.w3.org>
changeset:   1275:ac55724157c7
tag:         tip
user:        Thomas Gambet <tgambet@w3.org>
date:        Fri Jun 18 16:21:25 2010 -0400
files:       src/org/w3c/unicorn/Framework.java
description:
fixed: threw a npe if messages.properties does not exist


diff -r 2f327d07c235 -r ac55724157c7 src/org/w3c/unicorn/Framework.java
--- a/src/org/w3c/unicorn/Framework.java	Fri Jun 18 16:12:39 2010 -0400
+++ b/src/org/w3c/unicorn/Framework.java	Fri Jun 18 16:21:25 2010 -0400
@@ -567,6 +567,13 @@
 		logger.debug("-------------------------------------------------------");
 		logger.debug("Loading messages from messages.properties");
 		
+		InputStream stream = Framework.class.getResourceAsStream("/messages.properties");
+		
+		if (stream == null) {
+			logger.info("File messages.properties not found in classpath. No default message has been added.");
+			return;
+		}
+		
 		Properties props = new Properties();
 		try {
 			props.load(Framework.class.getResourceAsStream("/messages.properties"));
Received on Friday, 18 June 2010 20:21:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:21 GMT