[ 
https://issues.apache.org/jira/browse/WICKET-3049?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Grigorov updated WICKET-3049:
------------------------------------

    Fix Version/s: 1.5-M3
                       (was: 1.5-M2.1)

> CompoundPropertyModel constructor allows misuse of model object
> ---------------------------------------------------------------
>
>                 Key: WICKET-3049
>                 URL: https://issues.apache.org/jira/browse/WICKET-3049
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.12, 1.5-M2.1
>         Environment: all
>            Reporter: Ernesto Reinaldo Barreiro
>            Assignee: Peter Ertl
>            Priority: Trivial
>             Fix For: 1.5-M3
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Right now the constructor of CompoundPropertyModel is as follows:
>        /**
>         * Constructor
>         *
>         * @param object
>         *            The model object, which may or may not implement IModel
>         */
>        public CompoundPropertyModel(final Object object)
>        {
>                target = object;
>        }
> which allows users to do something like:
> new CompoundPropertyModel<XXX>(new YYY());
> without generating a compiler error. Would it make sense to replace
> this constructor by two constructors...
>        /**
>         * Constructor
>         *
>         * @param object
>         *            The model object
>         */
>        public CompoundPropertyModel(final T object)
>        {
>                target = object;
>        }
>        /**
>         * Constructor
>         *
>         * @param object
>         *            an instance of IModel<T>
>         */
>        public CompoundPropertyModel(final IModel<T> object)
>        {
>                target = object;
>        }
> at least on 1.5?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to