You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <va...@reverycodes.com> on 2004/11/23 17:14:34 UTC

Re: svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

joerg@apache.org wrote:
> Author: joerg
> Date: Tue Nov 23 06:27:10 2004
> New Revision: 106302
> 
> Modified:
>    cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java
> Log:
> fixed the way of fixing the handling for null namespace URIs ...
> 
> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java
> Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java?view=diff&rev=106302&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java&r1=106301&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java&r2=106302
> ==============================================================================
> --- cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java	(original)
> +++ cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java	Tue Nov 23 06:27:10 2004
> @@ -213,7 +213,7 @@
>       */
>      public void startElement(String uri, String loc, String raw, Attributes a)
>      throws SAXException {

IMHO, adding single line would be simplier:

            if (uri == null) uri = "";

And it can not be null anyway, so logging a warning is an option.

Vadim


> -        if ((uri == null || this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
> +        if (((uri == null && this.extractURI.equals("")) || this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
>              extractLevel++;
>              fragmentID++;
>              if (getLogger().isDebugEnabled()) {

Re: svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

Posted by Joerg Heinicke <jo...@gmx.de>.
On 24.11.2004 01:24, Vadim Gritsenko wrote:

>>> IMHO, adding single line would be simplier:
>>>
>>>            if (uri == null) uri = "";
>>>
>>> And it can not be null anyway, so logging a warning is an option.
>>>
>>>> -        if ((uri == null || this.extractURI.equals(uri)) && 
>>>> this.extractElement.equals(loc)) {
>>>> +        if (((uri == null && this.extractURI.equals("")) || 
>>>> this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
>>
>>
>>
>> I had this in mind too, but should a transformer fix the behaviour of 
>> another component? In theory you can add this fix to every transformer 
>> or serializer.
> 
> 
> Well, if you decide not to fix - than we should rollback the change! Not 
> that I'm against it, though :)

That would be consequent then :-) Ok, I will fix it tomorrow by the one 
liner.

Joerg

Re: svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Joerg Heinicke wrote:
> On 23.11.2004 17:14, Vadim Gritsenko wrote:
> 
>> IMHO, adding single line would be simplier:
>>
>>            if (uri == null) uri = "";
>>
>> And it can not be null anyway, so logging a warning is an option.
>>
>>> -        if ((uri == null || this.extractURI.equals(uri)) && 
>>> this.extractElement.equals(loc)) {
>>> +        if (((uri == null && this.extractURI.equals("")) || 
>>> this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {
> 
> 
> I had this in mind too, but should a transformer fix the behaviour of 
> another component? In theory you can add this fix to every transformer 
> or serializer.

Well, if you decide not to fix - than we should rollback the change! Not that 
I'm against it, though :)

Vadim

Re: svn commit: r106302 - /cocoon/branches/BRANCH_2_1_X/src/blocks/batik/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java

Posted by Joerg Heinicke <jo...@gmx.de>.
On 23.11.2004 17:14, Vadim Gritsenko wrote:

> IMHO, adding single line would be simplier:
> 
>            if (uri == null) uri = "";
> 
> And it can not be null anyway, so logging a warning is an option.
> 
>> -        if ((uri == null || this.extractURI.equals(uri)) && 
>> this.extractElement.equals(loc)) {
>> +        if (((uri == null && this.extractURI.equals("")) || 
>> this.extractURI.equals(uri)) && this.extractElement.equals(loc)) {

I had this in mind too, but should a transformer fix the behaviour of 
another component? In theory you can add this fix to every transformer 
or serializer.

Joerg