[
https://issues.apache.org/jira/browse/FELIX-2455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883587#action_12883587
]
Guillaume Nodet commented on FELIX-2455:
----------------------------------------
How do you plan to access session variables (both read and write modes) if you
don't pass the session as an argument on the function execution ?
> [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.