You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Vadim Gritsenko <va...@reverycodes.com> on 2005/02/25 16:22:56 UTC

Incompatible change in xalan-java [Fwd: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) failed]

Hi All,

It seems that Xalan XPath API has been changed [1] some time ago, this change 
was not backward compatible, and old method was not deprecated but removed 
completely. This can be seen in Gump messages [2] (snippet below).

Would it be possible to re-instate old API, you can make it deprecated, but 
please provide smooth migration path for the downstream projects?

Xindice depends on old API, and without deprecation messages it's not possible 
to see what is the proper migration path.

Thanks,
Vadim

[1] 
http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java?r1=1.37&r2=1.38&diff_format=h
[2] http://marc.theaimsgroup.com/?t=109761492700003&r=1


-------- Original Message --------
Subject: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) failed
Date: Mon, 21 Feb 2005 02:17:47 PST
From: Sam Ruby <ru...@us.ibm.com>
Reply-To: xindice-dev@xml.apache.org
To: xindice-dev@xml.apache.org

To whom it may engage...

     [javac] 
/home/gump/workspaces2/public/workspace/xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java:163: 
cannot resolve symbol
     [javac] symbol  : constructor Compiler 
(org.apache.xml.utils.DefaultErrorHandler,<nulltype>)
     [javac] location: class org.apache.xpath.compiler.Compiler
     [javac]                 cmp = new Compiler(errorListener, null);
     [javac]                       ^
     [javac] 1 error


Re: Incompatible change in xalan-java [Fwd: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) failed]

Posted by Vadim Gritsenko <va...@reverycodes.com>.
dbrosius@qis.net wrote:
> I've put a patch on bugzilla that fixes this issue for xindice.

I'll be updating bugzilla issue as soon as my mail gets through to xalan list.

In short:

   * Use of reflection to work around incompatible changes in xalan
     api is not the best way to fix the problem. Best way to fix it
     is to fix the root of the problem, i.e. xalan api.

   * If best way is not achievable we will see what kludges we can plug
     into our code base, or see when we can upgrade to latest xalan.
     But it means trouble to users of older xindice or older
     xalan. So here reflection will come in handy.

   * Passing null into the constructor, IIUC, will cause xpath to
     fail when built-in xpath function is used (as function table
     will be null). I might be mistaken here - have you run a test
     suite with your patch & cvs xalan?


Vadim

Re: Incompatible change in xalan-java [Fwd: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) failed]

Posted by db...@qis.net.
I've put a patch on bugzilla that fixes this issue for xindice.

Quoting Vadim Gritsenko <va...@reverycodes.com>:

> Hi All,
> 
> It seems that Xalan XPath API has been changed [1] some time ago, this change
> 
> was not backward compatible, and old method was not deprecated but removed 
> completely. This can be seen in Gump messages [2] (snippet below).
> 
> Would it be possible to re-instate old API, you can make it deprecated, but 
> please provide smooth migration path for the downstream projects?
> 
> Xindice depends on old API, and without deprecation messages it's not
> possible 
> to see what is the proper migration path.
> 
> Thanks,
> Vadim
> 
> [1] 
>
http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java?r1=1.37&r2=1.38&diff_format=h
> [2] http://marc.theaimsgroup.com/?t=109761492700003&r=1
> 
> 
> -------- Original Message --------
> Subject: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) failed
> Date: Mon, 21 Feb 2005 02:17:47 PST
> From: Sam Ruby <ru...@us.ibm.com>
> Reply-To: xindice-dev@xml.apache.org
> To: xindice-dev@xml.apache.org
> 
> To whom it may engage...
> 
>      [javac] 
>
/home/gump/workspaces2/public/workspace/xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java:163:
> 
> cannot resolve symbol
>      [javac] symbol  : constructor Compiler 
> (org.apache.xml.utils.DefaultErrorHandler,<nulltype>)
>      [javac] location: class org.apache.xpath.compiler.Compiler
>      [javac]                 cmp = new Compiler(errorListener, null);
>      [javac]                       ^
>      [javac] 1 error
> 




Re: Incompatible change in xalan-java [Fwd: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) failed]

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Terry Rosenbaum wrote:
> 
> WRT the "new Compiler" problem, xalan developers removed
> static methods from the FunctionTable class.

<snip/>

Yep, all true.

> Instantiating a FuntionTable is simple - org.apache.xpath.XPath does it 
> like this:
> 
>         private void initFunctionTable(){
>                     m_funcTable = new FunctionTable();
>         }

<snip/>

Thanks for the tip.


> However, fixing this issue means that xindice must upgrade to the
> latest release of xalan (and that may cause problems for people
> who must use older release for some other reasons).
> 
> Could use reflection to detect which constructor is available (old or new)
> and be compatible with either old or new xalan library.

Yep. It'd be nice to have migration path though. The change has not been 
released yet so we probably still have a chance.

Vadim


> -Terry
> 
> 
> Vadim Gritsenko wrote:
> 
>> Hi All,
>>
>> It seems that Xalan XPath API has been changed [1] some time ago, this 
>> change was not backward compatible, and old method was not deprecated 
>> but removed completely. This can be seen in Gump messages [2] (snippet 
>> below).
>>
>> Would it be possible to re-instate old API, you can make it 
>> deprecated, but please provide smooth migration path for the 
>> downstream projects?
>>
>> Xindice depends on old API, and without deprecation messages it's not 
>> possible to see what is the proper migration path.
>>
>> Thanks,
>> Vadim
>>
>> [1] 
>> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java?r1=1.37&r2=1.38&diff_format=h 
>>
>> [2] http://marc.theaimsgroup.com/?t=109761492700003&r=1
>>
>>
>> -------- Original Message --------
>> Subject: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) 
>> failed
>> Date: Mon, 21 Feb 2005 02:17:47 PST
>> From: Sam Ruby <ru...@us.ibm.com>
>> Reply-To: xindice-dev@xml.apache.org
>> To: xindice-dev@xml.apache.org
>>
>> To whom it may engage...
>>
>>     [javac] 
>> /home/gump/workspaces2/public/workspace/xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java:163: 
>> cannot resolve symbol
>>     [javac] symbol  : constructor Compiler 
>> (org.apache.xml.utils.DefaultErrorHandler,<nulltype>)
>>     [javac] location: class org.apache.xpath.compiler.Compiler
>>     [javac]                 cmp = new Compiler(errorListener, null);
>>     [javac]                       ^
>>     [javac] 1 error

Re: Incompatible change in xalan-java [Fwd: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) failed]

Posted by Terry Rosenbaum <Te...@AMICAS.com>.
Hi,

WRT the "new Compiler" problem, xalan developers removed
static methods from the FunctionTable class.

Now, when they instantiate a new Compiler, they pass
an instance of a function table to the Compiler instead
of having the Compiler use static methods of FunctionTable.

Previously-static methods of FunctionTable have been changed to instance
methods (apparently security changes?).

e.g. whereas previously org.apache.xpath.compiler.Compiler did this:

Function func = FunctionTable.getFunction(funcID);

Now it does this:

Function func = m_functionTable.getFunction(funcID);

(Where m_functionTable is the reference to the FunctionTable passed to 
the ctor of Compiler).

For an example of how the FunctionTable is created to be passed to compiler,
see source for org.apache.xpath.XPath class. Here's the diff for that class
showing the changes to use the new Compiler API:
      
http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/XPath.java?r1=1.31&r2=1.32&diff_format=h 
<http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/XPath.java?r1=1.31&r2=1.32&diff_format=h>

Instantiating a FuntionTable is simple - org.apache.xpath.XPath does it 
like this:

        / /**
          * The function table for xpath build-in functions
          */
         private transient FunctionTable m_funcTable = null;
       
         /**
          * initial the function table
          */
         private void initFunctionTable(){
                     m_funcTable = new FunctionTable();
         }/

So, /cmp = new Compiler(errorListener, null, new FunctionTable()); /(in 
org/apache/xindice/core/query/XPathQueryResolver)
would work, but probably better to cache the FunctionTable
instance somewhere instead of recreating it.

However, fixing this issue means that xindice must upgrade to the
latest release of xalan (and that may cause problems for people
who must use older release for some other reasons).

Could use reflection to detect which constructor is available (old or new)
and be compatible with either old or new xalan library.

-Terry


Vadim Gritsenko wrote:

> Hi All,
>
> It seems that Xalan XPath API has been changed [1] some time ago, this 
> change was not backward compatible, and old method was not deprecated 
> but removed completely. This can be seen in Gump messages [2] (snippet 
> below).
>
> Would it be possible to re-instate old API, you can make it 
> deprecated, but please provide smooth migration path for the 
> downstream projects?
>
> Xindice depends on old API, and without deprecation messages it's not 
> possible to see what is the proper migration path.
>
> Thanks,
> Vadim
>
> [1] 
> http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java?r1=1.37&r2=1.38&diff_format=h 
>
> [2] http://marc.theaimsgroup.com/?t=109761492700003&r=1
>
>
> -------- Original Message --------
> Subject: [GUMP@brutus]: Project xml-xindice (in module xml-xindice) 
> failed
> Date: Mon, 21 Feb 2005 02:17:47 PST
> From: Sam Ruby <ru...@us.ibm.com>
> Reply-To: xindice-dev@xml.apache.org
> To: xindice-dev@xml.apache.org
>
> To whom it may engage...
>
>     [javac] 
> /home/gump/workspaces2/public/workspace/xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java:163: 
> cannot resolve symbol
>     [javac] symbol  : constructor Compiler 
> (org.apache.xml.utils.DefaultErrorHandler,<nulltype>)
>     [javac] location: class org.apache.xpath.compiler.Compiler
>     [javac]                 cmp = new Compiler(errorListener, null);
>     [javac]                       ^
>     [javac] 1 error
>