Tag: mws_bea300 User: obo Date: 2008-04-28 15:19:40+0000 Modified: dba/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
Log: INTEGRATION: CWS dba30beta_BEA300 (1.3.6); FILE MERGED 2008/04/22 10:30:27 oj 1.3.6.1: #i88503# merge changes from rptchart02 File Changes: Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/loader/ ===================================================================== File [changed]: InputRepositoryLoader.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java?r1=1.3&r2=1.3.4.1 Delta lines: +124 -130 ----------------------- --- InputRepositoryLoader.java 2008-04-10 17:27:31+0000 1.3 +++ InputRepositoryLoader.java 2008-04-28 15:19:38+0000 1.3.4.1 @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.loader; import java.net.URL; @@ -46,10 +44,11 @@ public class InputRepositoryLoader implements ResourceLoader { - private InputRepository inputRepository; + + private final InputRepository inputRepository; private ResourceManager resourceManager; - public InputRepositoryLoader (final InputRepository inputRepository) + public InputRepositoryLoader(final InputRepository inputRepository) { if (inputRepository == null) { @@ -67,11 +66,7 @@ */ public boolean isSupportedKey(final ResourceKey key) { - if (InputRepositoryLoader.class.getName().equals(key.getSchema())) - { - return true; - } - return false; + return InputRepositoryLoader.class.getName().equals(key.getSchema()); } /** @@ -87,18 +82,17 @@ final Map factoryKeys) throws ResourceKeyCreationException { - if (value instanceof String == false) + if (value instanceof String) { - return null; - } final String strVal = (String) value; - if (strVal.startsWith("sun:oo://") == false) + if (strVal.startsWith("sun:oo://")) { - return null; - } return new ResourceKey(InputRepositoryLoader.class.getName(), new InputResourceKey(inputRepository.getId(), strVal), factoryKeys); } + } + return null; + } /** * Derives a new resource key from the given key. If neither a path nor new @@ -116,7 +110,7 @@ final Map factoryKeys) throws ResourceKeyCreationException { - if (isSupportedKey(parent) == false) + if (!isSupportedKey(parent)) { throw new ResourceKeyCreationException("Assertation: Unsupported parent key type"); } @@ -127,7 +121,7 @@ { resource = path; } - else if (path.startsWith("/")) + else if (path.charAt(0) == '/') { resource = "sun:oo:/" + path; } @@ -155,10 +149,10 @@ return null; } - public ResourceData load (final ResourceKey key) + public ResourceData load(final ResourceKey key) throws ResourceLoadingException { - if (isSupportedKey(key) == false) + if (!isSupportedKey(key)) { throw new ResourceLoadingException("None of my keys."); } @@ -166,12 +160,12 @@ return new InputRepositoryResourceData(key, inputRepository); } - public void setResourceManager (final ResourceManager manager) + public void setResourceManager(final ResourceManager manager) { this.resourceManager = manager; } - public ResourceManager getResourceManager () + public ResourceManager getResourceManager() { return resourceManager; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
