[ http://issues.apache.org/jira/browse/XALANJ-2127?page=all ]
Nick Van den Bleeken updated XALANJ-2127:
-----------------------------------------
Attachment: CallFunction.patch
If you look to Callfunction.java, which is used when resolving functions
dynamicly you can see that className, methodName, nArgs and clazz are static
fields. This is a problem if you use xsltc in a multithreaded environment. If
two different transformers call a function that needs to be resolved dynamicly
the following can happen :
1) The first transformer sets the static fields
2) The second transformer sets the static fields (same fields)
3) The first stylesheet continues and calls the function of the second
transformer
It also can result in many other errors if the threads switch faster exceptions
like 'Function No tFound' and mismatching of the number of parameters, as a
result of a thread switch before all fields were updated.
This patch just removes the static fields and passes them as parameters.
> Add support to dynamicly invoke methods if required.
> ----------------------------------------------------
>
> Key: XALANJ-2127
> URL: http://issues.apache.org/jira/browse/XALANJ-2127
> Project: XalanJ2
> Type: Improvement
> Components: XSLTC
> Versions: CurrentCVS
> Reporter: Nick Van den Bleeken
> Attachments: CallFunction.patch, foo.xml, testcase.xsl
>
> In some cases functions needs to be reolved dynamicly. This functionality was
> introduced on 2/23/2004 (on org.apache.xalan.xsltc.compiler.FunctionCall
> revision 1.38) but removed after the release of 2.6. I know there was a
> problem with it in certain cases, but if you changed the code in the patch in
> typeCheckExternal(SymbolTable stable) to :
> else if(firstArgType instanceof ReferenceType){
> hasThisArgument = true;
> _thisArgument = (Expression) _arguments.elementAt(0);
> _arguments.remove(0); nArgs--;
> resolveDynamic = true;
> typeCheckArgs(stable);
> return _type = Type.String
> }
> The dynamic calling seems to work in 'more' cases ...
> The commit comments of the revert of this patch (revision 1.39) states
> 'Reverting latest patch by Arun. There are some problems with the new code to
> invoke functions dynamically (e.g. docbook reports a compile-time type check
> error). The approach taken to determine when to invoke methods dynamically
> needs to be revisted.'
> Can someone help me with what the exact problems are with 'The approach taken
> to determine when to invoke methods dynamically needs to be revisted.'.
> I'm willing to free some time to fix this problem, but I need some extra
> information because I don't understand what is wrong the riginal check if
> dynamic invoction of the method is required.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]