- Revision
- 940
- Author
- mauro
- Date
- 2008-09-21 12:50:06 -0500 (Sun, 21 Sep 2008)
Log Message
Removed redundant method.
Modified Paths
Diff
Modified: trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java (939 => 940)
--- trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java 2008-09-21 16:55:50 UTC (rev 939) +++ trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java 2008-09-21 17:50:06 UTC (rev 940) @@ -5,8 +5,6 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; -import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.NoSuchElementException; @@ -39,34 +37,11 @@ } public <T> T getComponent(Class<T> type) { - return getPicoComponent(type, null); + return getComponent(type, null); } public <T> T getComponent(Class<T> type, Object key) { - return getPicoComponent(type, key); - } - - public <T> Collection<Object> getComponentKeys(Class<T> type) { List<ComponentAdapter<T>> adapters = container.getComponentAdapters(type); - List<Object> keys = new ArrayList<Object>(); - for (ComponentAdapter<T> adapter : adapters) { - keys.add(adapter.getComponentKey()); - } - return keys; - } - - /** - * Returns an instance of a component of a given type and key from the - * delegate PicoContainer. - * - * @param type the component Class - * @param key the component key - * @return A component instance for the given type and key, if provided - * @throws NoComponentOfTypeException if no Component can be found of type - * @throws ComponentNotFoundException if Component not found for key - */ - private <T> T getPicoComponent(Class<T> type, Object key) { - List<ComponentAdapter<T>> adapters = container.getComponentAdapters(type); if (adapters.isEmpty()) { String message = format("No component registered in container of type {0}", type); throw new ComponentNotFoundException(message); @@ -87,16 +62,10 @@ } } - /** - * Builds PicoContainer from a given resource - * - * @param resource the String encoding the script path - * @return A PicoContainer - */ private PicoContainer buildContainer(String resource) { Reader script = getReader(resource, classLoader); ScriptedContainerBuilder builder = createContainerBuilder(script, classLoader); - return builder.buildContainer(null, null, true); + return builder.buildContainer(null, null, false); } private Reader getReader(String resource, ClassLoader classLoader) {
To unsubscribe from this list please visit:
