You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Emond Papegaaij <em...@topicus.nl> on 2012/11/26 22:21:30 UTC

Changing Label constructor to take Serializable (WICKET-4889)

Hi all,

I've hit this problem quite a few times now, so I decided to fix it. I
changed this constructor:
  public Label(final String id, String label)
to:
  public Label(final String id, Serializable label)

AFAIK, this should not introduce any compatibility issues, however I'm
getting this error from clirr:
org.apache.wicket.markup.html.basic.Label: Parameter 2 of 'public
Label(java.lang.String, java.lang.String)' has changed its type to
java.io.Serializable.

Do I miss something, or is this a bug in clirr? Changing a constructor
argument to accept a wider type should not be a problem. You can't override
a constructor as you can with a method, you can only call it from a
subclass, which should still work. Shall I add this to the ignore list?

Best regards,
Emond

Re: Changing Label constructor to take Serializable (WICKET-4889)

Posted by Emond Papegaaij <em...@gmail.com>.
Good one, I didn't think of that. I've added the constructor and closed the
ticket.


On Mon, Nov 26, 2012 at 10:30 PM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> No. I think you should add an additional constructor.
> There are apps which are built against String and if they just drop the new
> jar with Serializable then the linker wont be able to find the method,
> because the signature in the app bytecode uses String.
>
>
> On Mon, Nov 26, 2012 at 10:21 PM, Emond Papegaaij <
> emond.papegaaij@topicus.nl> wrote:
>
> > Hi all,
> >
> > I've hit this problem quite a few times now, so I decided to fix it. I
> > changed this constructor:
> >   public Label(final String id, String label)
> > to:
> >   public Label(final String id, Serializable label)
> >
> > AFAIK, this should not introduce any compatibility issues, however I'm
> > getting this error from clirr:
> > org.apache.wicket.markup.html.basic.Label: Parameter 2 of 'public
> > Label(java.lang.String, java.lang.String)' has changed its type to
> > java.io.Serializable.
> >
> > Do I miss something, or is this a bug in clirr? Changing a constructor
> > argument to accept a wider type should not be a problem. You can't
> override
> > a constructor as you can with a method, you can only call it from a
> > subclass, which should still work. Shall I add this to the ignore list?
> >
> > Best regards,
> > Emond
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>

Re: Changing Label constructor to take Serializable (WICKET-4889)

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

No. I think you should add an additional constructor.
There are apps which are built against String and if they just drop the new
jar with Serializable then the linker wont be able to find the method,
because the signature in the app bytecode uses String.


On Mon, Nov 26, 2012 at 10:21 PM, Emond Papegaaij <
emond.papegaaij@topicus.nl> wrote:

> Hi all,
>
> I've hit this problem quite a few times now, so I decided to fix it. I
> changed this constructor:
>   public Label(final String id, String label)
> to:
>   public Label(final String id, Serializable label)
>
> AFAIK, this should not introduce any compatibility issues, however I'm
> getting this error from clirr:
> org.apache.wicket.markup.html.basic.Label: Parameter 2 of 'public
> Label(java.lang.String, java.lang.String)' has changed its type to
> java.io.Serializable.
>
> Do I miss something, or is this a bug in clirr? Changing a constructor
> argument to accept a wider type should not be a problem. You can't override
> a constructor as you can with a method, you can only call it from a
> subclass, which should still work. Shall I add this to the ignore list?
>
> Best regards,
> Emond
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>