You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <ga...@gmail.com> on 2011/09/07 20:26:51 UTC

[lang] Better Validate.isInstance messages

Hi All:

The message for the exception thrown by Validate.isInstance does not mention
the actual type, only the expected type.

Is there any objection to changing this?

trunk: "The validated object is not an instance of %s"

Proposal (1): "The validated object is expected to be an instance of %s, not
a %s"

Or more succinctly (2): "Expected an instance of %s, got a %"

Or more succinctly (3), a la JUnit: "Expected: %s, actual: %"

Thoughts?

Gary


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: http://s.apache.org/rl
Spring Batch in Action: http://s.apache.org/HOq
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [lang] Better Validate.isInstance messages

Posted by Gary Gregory <ga...@gmail.com>.
Now in SVN :)

Gary

On Thu, Sep 8, 2011 at 2:22 AM, Henri Yandell <fl...@gmail.com> wrote:

> +1 :)
>
> On Wed, Sep 7, 2011 at 12:54 PM, Gary Gregory <ga...@gmail.com>
> wrote:
> > On Wed, Sep 7, 2011 at 2:42 PM, sebb <se...@gmail.com> wrote:
> >
> >> On 7 September 2011 19:26, Gary Gregory <ga...@gmail.com> wrote:
> >> > Hi All:
> >> >
> >> > The message for the exception thrown by Validate.isInstance does not
> >> mention
> >> > the actual type, only the expected type.
> >> >
> >> > Is there any objection to changing this?
> >> >
> >> > trunk: "The validated object is not an instance of %s"
> >> >
> >> > Proposal (1): "The validated object is expected to be an instance of
> %s,
> >> not
> >> > a %s"
> >> >
> >> > Or more succinctly (2): "Expected an instance of %s, got a %"
> >> >
> >> > Or more succinctly (3), a la JUnit: "Expected: %s, actual: %"
> >> >
> >> > Thoughts?
> >>
> >> (3) seems fine.
> >>
> >
> > Here are examples of what I have in my local sandbox (not in SVN yet):
> >
> > - isAssignableFrom: "Cannot assign a java.lang.String to a java.util.List
> > - isInstance: "Expected type: java.util.List, actual: java.lang.String"
> >
> > Tracking here: https://issues.apache.org/jira/browse/LANG-751
> >
> > Gary
> >
> >
> >>
> >> > Gary
> >> >
> >> >
> >> > --
> >> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> >> > JUnit in Action, 2nd Ed: http://s.apache.org/rl
> >> > Spring Batch in Action: http://s.apache.org/HOq
> >> > Blog: http://garygregory.wordpress.com
> >> > Home: http://garygregory.com/
> >> > Tweet! http://twitter.com/GaryGregory
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >>
> >>
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > JUnit in Action, 2nd Ed: http://s.apache.org/rl
> > Spring Batch in Action: http://s.apache.org/HOq
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: http://s.apache.org/rl
Spring Batch in Action: http://s.apache.org/HOq
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [lang] Better Validate.isInstance messages

Posted by Henri Yandell <fl...@gmail.com>.
+1 :)

On Wed, Sep 7, 2011 at 12:54 PM, Gary Gregory <ga...@gmail.com> wrote:
> On Wed, Sep 7, 2011 at 2:42 PM, sebb <se...@gmail.com> wrote:
>
>> On 7 September 2011 19:26, Gary Gregory <ga...@gmail.com> wrote:
>> > Hi All:
>> >
>> > The message for the exception thrown by Validate.isInstance does not
>> mention
>> > the actual type, only the expected type.
>> >
>> > Is there any objection to changing this?
>> >
>> > trunk: "The validated object is not an instance of %s"
>> >
>> > Proposal (1): "The validated object is expected to be an instance of %s,
>> not
>> > a %s"
>> >
>> > Or more succinctly (2): "Expected an instance of %s, got a %"
>> >
>> > Or more succinctly (3), a la JUnit: "Expected: %s, actual: %"
>> >
>> > Thoughts?
>>
>> (3) seems fine.
>>
>
> Here are examples of what I have in my local sandbox (not in SVN yet):
>
> - isAssignableFrom: "Cannot assign a java.lang.String to a java.util.List
> - isInstance: "Expected type: java.util.List, actual: java.lang.String"
>
> Tracking here: https://issues.apache.org/jira/browse/LANG-751
>
> Gary
>
>
>>
>> > Gary
>> >
>> >
>> > --
>> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> > JUnit in Action, 2nd Ed: http://s.apache.org/rl
>> > Spring Batch in Action: http://s.apache.org/HOq
>> > Blog: http://garygregory.wordpress.com
>> > Home: http://garygregory.com/
>> > Tweet! http://twitter.com/GaryGregory
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: http://s.apache.org/rl
> Spring Batch in Action: http://s.apache.org/HOq
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [lang] Better Validate.isInstance messages

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Sep 7, 2011 at 2:42 PM, sebb <se...@gmail.com> wrote:

> On 7 September 2011 19:26, Gary Gregory <ga...@gmail.com> wrote:
> > Hi All:
> >
> > The message for the exception thrown by Validate.isInstance does not
> mention
> > the actual type, only the expected type.
> >
> > Is there any objection to changing this?
> >
> > trunk: "The validated object is not an instance of %s"
> >
> > Proposal (1): "The validated object is expected to be an instance of %s,
> not
> > a %s"
> >
> > Or more succinctly (2): "Expected an instance of %s, got a %"
> >
> > Or more succinctly (3), a la JUnit: "Expected: %s, actual: %"
> >
> > Thoughts?
>
> (3) seems fine.
>

Here are examples of what I have in my local sandbox (not in SVN yet):

- isAssignableFrom: "Cannot assign a java.lang.String to a java.util.List
- isInstance: "Expected type: java.util.List, actual: java.lang.String"

Tracking here: https://issues.apache.org/jira/browse/LANG-751

Gary


>
> > Gary
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > JUnit in Action, 2nd Ed: http://s.apache.org/rl
> > Spring Batch in Action: http://s.apache.org/HOq
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: http://s.apache.org/rl
Spring Batch in Action: http://s.apache.org/HOq
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [lang] Better Validate.isInstance messages

Posted by sebb <se...@gmail.com>.
On 7 September 2011 19:26, Gary Gregory <ga...@gmail.com> wrote:
> Hi All:
>
> The message for the exception thrown by Validate.isInstance does not mention
> the actual type, only the expected type.
>
> Is there any objection to changing this?
>
> trunk: "The validated object is not an instance of %s"
>
> Proposal (1): "The validated object is expected to be an instance of %s, not
> a %s"
>
> Or more succinctly (2): "Expected an instance of %s, got a %"
>
> Or more succinctly (3), a la JUnit: "Expected: %s, actual: %"
>
> Thoughts?

(3) seems fine.

> Gary
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: http://s.apache.org/rl
> Spring Batch in Action: http://s.apache.org/HOq
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org