You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Derek Baum (JIRA)" <ji...@apache.org> on 2010/06/29 18:19:49 UTC

[jira] Resolved: (FELIX-2455) [gogo API] the Function interface used for Closures, takes an unused session parameter

     [ https://issues.apache.org/jira/browse/FELIX-2455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Derek Baum resolved FELIX-2455.
-------------------------------

    Resolution: Not A Problem

not a problem - other implementations of Function may use the session parameter.


> [gogo API] the Function interface used for Closures, takes an unused session parameter
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-2455
>                 URL: https://issues.apache.org/jira/browse/FELIX-2455
>             Project: Felix
>          Issue Type: Improvement
>          Components: Gogo Runtime
>            Reporter: Derek Baum
>
> The org.osgi.service.command.Function interface (used for Closures), takes a session argument, which is not used in the implementation:
> The Closure constructor takes a session parameter. This is used by the execute() method, which ignores its own session parameter.
> Unless there is another reason for execute() taking a session parameter, I suggest we change the API to remove this parameter
> (deprecating the existing method to keep backward compatibility).
> public interface Function {
>   Object execute(CommandSession session, List<Object> arguments) throws Exception;
> }
> Closure.java:113:
>     // implements Function interface
>     // XXX: session arg x not used?
>     public Object execute(CommandSession x, List<Object> values) throws Exception
>     {
>         try
>         {
>             location.remove();
>             session.variables.remove(LOCATION);
>             return execute(values);
>         }
>         catch (Exception e)
>         {
>             throw setLocation(e);
>         }
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.