The original author has opted for Runtime exceptions. - It is somewhat controversial to use runtime exceptions in your code. - if you really mean it, we should not log it IMO. - Those get handled by the JVM at the end of the day. (like nullpointers)
I think we should use checked exceptions here.. On Thu, Jan 9, 2014 at 2:21 PM, Lahiru Sandaruwan <[email protected]> wrote: > Hi, > > $subject. I think the correct way is to log without throwing... > > > > String jndiPropertiesDir = > System.getProperty(CartridgeAgentConstants.JNDI_PROPERTIES_DIR); > if(StringUtils.isBlank(jndiPropertiesDir)) { > throw new RuntimeException(String.format("System property not > found: %s", CartridgeAgentConstants.JNDI_PROPERTIES_DIR)); > } > > String payloadPath = > System.getProperty(CartridgeAgentConstants.PARAM_FILE_PATH); > if(StringUtils.isBlank(payloadPath)) { > throw new RuntimeException(String.format("System property not > found: %s", CartridgeAgentConstants.PARAM_FILE_PATH)); > } > > String extensionsDir = > System.getProperty(CartridgeAgentConstants.EXTENSIONS_DIR); > if(StringUtils.isBlank(extensionsDir)) { > throw new RuntimeException(String.format("System property not > found: %s", CartridgeAgentConstants.EXTENSIONS_DIR)); > } > > Thanks. > -- > -- > Lahiru Sandaruwan > Software Engineer, > Platform Technologies, > WSO2 Inc., http://wso2.com > lean.enterprise.middleware > > email: [email protected] cell: (+94) 773 325 954 > blog: http://lahiruwrites.blogspot.com/ > twitter: http://twitter.com/lahirus > linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146 > > -- Pradeep Fernando. http://pradeepfernando.blogspot.com/
