- From: Mercurial notifier <nobody@w3.org>
- Date: Mon, 10 Jan 2011 10:48:33 +0000
- To: Unicorn Updates <www-validator-cvs@w3.org>
changeset: 1592:078cd812a21d user: Thomas Gambet <tgambet@w3.org> date: Mon Jan 10 11:47:44 2011 +0100 files: src/org/w3c/unicorn/output/OutputFactory.java description: ~ cleaned diff -r 816f5e6cb891 -r 078cd812a21d src/org/w3c/unicorn/output/OutputFactory.java --- a/src/org/w3c/unicorn/output/OutputFactory.java Mon Jan 10 11:45:14 2011 +0100 +++ b/src/org/w3c/unicorn/output/OutputFactory.java Mon Jan 10 11:47:44 2011 +0100 @@ -73,7 +73,7 @@ logger.debug("Output format : " + sOutputFormat + "."); logger.debug("Language : " + sLang + "."); - OutputFormater aOutputFormater; + OutputFormater aOutputFormater = null; String sFormaterName = Property.getProps("output.properties").getProperty(sOutputFormat + ".formater"); String mimeType = Property.getProps("output.properties").getProperty(sOutputFormat + ".mimetype"); @@ -83,18 +83,13 @@ if (mimeType == null) mimeType = "text/plain"; - if (null != sFormaterName) { - try { - final Class<?> aFormaterClass = Class.forName("org.w3c.unicorn.output." + sFormaterName); - final Class<?>[] tClassParamType = { String.class, String.class, String.class }; - final Object[] tObjectParamValue = { sOutputFormat, sLang, mimeType }; - aOutputFormater = (OutputFormater) aFormaterClass.getConstructor(tClassParamType).newInstance(tObjectParamValue); - } catch (Exception e) { - logger.error("Error instanciating outputFormater: " + sFormaterName + ". Using SimpleOutputFormater instead.", e); - aOutputFormater = new SimpleOutputFormater(sOutputFormat, sLang, mimeType); - } - } - else { + try { + final Class<?> aFormaterClass = Class.forName("org.w3c.unicorn.output." + sFormaterName); + final Class<?>[] tClassParamType = { String.class, String.class, String.class }; + final Object[] tObjectParamValue = { sOutputFormat, sLang, mimeType }; + aOutputFormater = (OutputFormater) aFormaterClass.getConstructor(tClassParamType).newInstance(tObjectParamValue); + } catch (Exception e) { + logger.error("Error instanciating outputFormater: " + sFormaterName + ". Using SimpleOutputFormater instead.", e); aOutputFormater = new SimpleOutputFormater(sOutputFormat, sLang, mimeType); }
Received on Monday, 10 January 2011 10:48:34 UTC