You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by gsmet <gi...@git.apache.org> on 2015/05/15 15:37:12 UTC

[GitHub] wicket pull request: WICKET-5906 Move StringResourceModel to a flu...

GitHub user gsmet opened a pull request:

    https://github.com/apache/wicket/pull/118

    WICKET-5906 Move StringResourceModel to a fluid API

    I was wondering if maybe setModel and setParameters should be more clear, such as setSubstitutionModel and setSubstitutionParameters.
    
    Comments welcome.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/openwide-java/wicket stringresourcemodel-fluid

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/wicket/pull/118.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #118
    
----
commit ebfe6e804c80abdc6748d6d45d3ae6e4128e86de
Author: Guillaume Smet <gu...@gmail.com>
Date:   2015-05-15T13:29:52Z

    WICKET-5906 Move StringResourceModel to a fluid API
    
    This commit breaks the API late in the release cycle of 7 but
    changes made to the constructors of StringResourceModel made
    some usages silently failing.
    
    We decided in favor of breaking the API to raise compilation
    errors so that users can fix their code.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: WICKET-5906 Move StringResourceModel to a flu...

Posted by gsmet <gi...@git.apache.org>.
Github user gsmet closed the pull request at:

    https://github.com/apache/wicket/pull/118


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: WICKET-5906 Move StringResourceModel to a flu...

Posted by gsmet <gi...@git.apache.org>.
Github user gsmet commented on the pull request:

    https://github.com/apache/wicket/pull/118#issuecomment-102404912
  
    Done. The tests tests both flavours.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: WICKET-5906 Move StringResourceModel to a flu...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/118#discussion_r30409143
  
    --- Diff: wicket-core/src/main/java/org/apache/wicket/model/StringResourceModel.java ---
    @@ -275,110 +276,70 @@ public void setObject(String object)
     	 * not be obtained from resource bundles that are held relative to a particular component or
     	 * page. However, for application that use only global resources then this parameter may be
     	 * null.
    -	 * <p>
    -	 * The model parameter is also optional and only needs to be supplied if value substitutions are
    -	 * to take place on either the resource key or the actual resource strings.
    -	 * <p>
    -	 * The parameters parameter is also optional and is used for substitutions.
     	 * 
     	 * @param resourceKey
     	 *            The resource key for this string resource
     	 * @param component
     	 *            The component that the resource is relative to
    -	 * @param model
    -	 *            The model to use for property substitutions
    -	 * @param parameters
    -	 *            The parameters to substitute using a Java MessageFormat object
     	 */
    -	public StringResourceModel(final String resourceKey, final Component component,
    -		final IModel<?> model, final Object... parameters)
    +	public StringResourceModel(final String resourceKey, final Component component)
    --- End diff --
    
    Keep it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: WICKET-5906 Move StringResourceModel to a flu...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/118#discussion_r30408568
  
    --- Diff: wicket-core/src/main/java/org/apache/wicket/model/StringResourceModel.java ---
    @@ -275,110 +276,70 @@ public void setObject(String object)
     	 * not be obtained from resource bundles that are held relative to a particular component or
     	 * page. However, for application that use only global resources then this parameter may be
     	 * null.
    -	 * <p>
    -	 * The model parameter is also optional and only needs to be supplied if value substitutions are
    -	 * to take place on either the resource key or the actual resource strings.
    -	 * <p>
    -	 * The parameters parameter is also optional and is used for substitutions.
     	 * 
     	 * @param resourceKey
     	 *            The resource key for this string resource
     	 * @param component
     	 *            The component that the resource is relative to
    -	 * @param model
    -	 *            The model to use for property substitutions
    -	 * @param parameters
    -	 *            The parameters to substitute using a Java MessageFormat object
     	 */
    -	public StringResourceModel(final String resourceKey, final Component component,
    -		final IModel<?> model, final Object... parameters)
    +	public StringResourceModel(final String resourceKey, final Component component)
    --- End diff --
    
    To make the migration easier I think it would be good to have one more constructor: 
    `public StringResourceModel(final String resourceKey, final Component component, final IModel<?> model)`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: WICKET-5906 Move StringResourceModel to a flu...

Posted by gsmet <gi...@git.apache.org>.
Github user gsmet commented on the pull request:

    https://github.com/apache/wicket/pull/118#issuecomment-103380018
  
    Thanks for merging it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: WICKET-5906 Move StringResourceModel to a flu...

Posted by gsmet <gi...@git.apache.org>.
Github user gsmet commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/118#discussion_r30409071
  
    --- Diff: wicket-core/src/main/java/org/apache/wicket/model/StringResourceModel.java ---
    @@ -275,110 +276,70 @@ public void setObject(String object)
     	 * not be obtained from resource bundles that are held relative to a particular component or
     	 * page. However, for application that use only global resources then this parameter may be
     	 * null.
    -	 * <p>
    -	 * The model parameter is also optional and only needs to be supplied if value substitutions are
    -	 * to take place on either the resource key or the actual resource strings.
    -	 * <p>
    -	 * The parameters parameter is also optional and is used for substitutions.
     	 * 
     	 * @param resourceKey
     	 *            The resource key for this string resource
     	 * @param component
     	 *            The component that the resource is relative to
    -	 * @param model
    -	 *            The model to use for property substitutions
    -	 * @param parameters
    -	 *            The parameters to substitute using a Java MessageFormat object
     	 */
    -	public StringResourceModel(final String resourceKey, final Component component,
    -		final IModel<?> model, final Object... parameters)
    +	public StringResourceModel(final String resourceKey, final Component component)
    --- End diff --
    
    And keep the setModel? Or should I also remove it?
    
    My goal was to have "model" and "parameters" on the same level.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: WICKET-5906 Move StringResourceModel to a flu...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the pull request:

    https://github.com/apache/wicket/pull/118#issuecomment-103379768
  
    The PR is merged but GitHub doesn't recognize it.
    @gsmet Please close the PR.
    Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---