1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
Description: Fixes the compatibility with the version of plexus-container-default in Debian
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/src/main/java/org/codehaus/plexus/component/factory/bsh/BshComponentFactory.java
+++ b/src/main/java/org/codehaus/plexus/component/factory/bsh/BshComponentFactory.java
@@ -25,6 +25,11 @@
public class BshComponentFactory
extends AbstractComponentFactory
{
+ public String getId()
+ {
+ return "bsh";
+ }
+
public Object newInstance( ComponentDescriptor componentDescriptor, ClassRealm containerRealm,
PlexusContainer container )
throws ComponentInstantiationException
@@ -69,23 +74,23 @@
{
containerRealm.display();
- container.getLogger().info( "Error text: " + evalError.getErrorText() );
+ ((org.codehaus.plexus.DefaultPlexusContainer) container).getLogger().info( "Error text: " + evalError.getErrorText() );
throw new ComponentInstantiationException( "Cannot build component for: " +
- componentDescriptor.getComponentKey() +
+ componentDescriptor.getHumanReadableKey() +
"; unable to read BeanShell script", evalError );
}
catch ( FileNotFoundException e )
{
containerRealm.display();
throw new ComponentInstantiationException( "Cannot build component for: " +
- componentDescriptor.getComponentKey() +
+ componentDescriptor.getHumanReadableKey() +
"; unable to read BeanShell script", e );
}
catch ( IOException e )
{
throw new ComponentInstantiationException( "Cannot build component for: " +
- componentDescriptor.getComponentKey() +
+ componentDescriptor.getHumanReadableKey() +
"; unable to read BeanShell script", e );
}
finally
--- a/src/test/java/org/codehaus/plexus/component/factory/bsh/BshComponentFactoryTest.java
+++ b/src/test/java/org/codehaus/plexus/component/factory/bsh/BshComponentFactoryTest.java
@@ -12,7 +12,7 @@
public void testComponent()
throws Exception
{
- Hello hello = (Hello) lookup( Hello.ROLE );
+ Hello hello = (Hello) lookup( Hello.class );
assertNotNull( hello );
|