cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject Re: Java 5 - '(String) null'
Date Wed, 09 Mar 2005 17:38:12 GMT
On Mie, 9 de Marzo de 2005, 7:43, Vadim Gritsenko dijo:
> Antonio Gallardo wrote:
>> On Mie, 9 de Marzo de 2005, 2:14, Reinhard Poetz dijo:
>>
>>>antonio@apache.org wrote:
>>>
>>>
>>>>+        this.addItem(c.getTime(), (String)null);
>>>
>>>I guess Java 5 needs this strange casts "(String) null". What's the
>>> reason
>>>for this?
>>
>>
>> Not only java 5. The build was broken even using 1.4.2. I just did a
>> quick
>> fix hoping somebody else will note it.
>>
>> Seems like there are to methods for addItem(c.getTime(), null):
>>
>> protected void addItem(Object value, String label)
>> protected void addItem(Object value, XMLizable label)
>>
>> See:
>>
>> src/blocks/forms/java/org/apache/cocoon/forms/datatype/AbstractJavaSelectionList.java
>>
>> Please fix it. ;-)
>
> I'm not following you. What should be fixed now?

See:
src/blocks/forms/java/org/apache/cocoon/forms/samples/DateTestJavaSelectionList.java

In the buld method() there where originally 3 nulls instead of the "fast
fixed" (String)null.

Without the casting of the null the compiler in 1.4.2_07 said it was not
able to decide wich of this 2 methods use:

protected void addItem(Object value, String label)
protected void addItem(Object value, XMLizable label)

This is why I casted them to (String). I don't carefully checked the code,
I just wanted the code to compile and test other things. Since we are near
to a release I am doing full builds now (Sorry, my fault).

All in all, Since the class is under the o.a.c.forms.samples package, then
I don't think it is an important one. Hence I thought will be OK a quick
fix here.

If someone know better where is used this code and why, please review the
fix and change it as the best it can be.

Best Regards,

Antonio Gallardo.



Mime
View raw message