From: markspace on
Patricia Shanahan wrote:
>
> There would be no need to create a new assertEquals. Junit's
> assertEquals already handles two String arguments.


I was trying to be facetious. Declare an argument type of Object, and
with auto-boxing one loses all control of type. "Object" will literally
accept any type of argument at all. Type troubles will go away, but
like weakly typed languages like PHP, you might find other troubles
surface later.


> It is not a general solution, because there is no general guarantee that
> actual.toString() gives a different result from expected.toString() in
> all failure cases.


Like this one. ;)




From: Pitch on
In article <8a4c111a-63ae-4ede-adb4-6008cc99a207
@j4g2000yqa.googlegroups.com>, lew(a)lewscanon.com says...

> Pitch wrote:
> > So if both types are from a third party, there is nothing he can do
> > about the performance, but read the documentation and choose what's the
> > best aproach to keep data integrity.
> >
>
> There isn't a performance issue here in the first place.

I thought he was talking about micro-optimizations and avoiding two
conversions.


--
stirr your cofee properly
From: Lew on
Pitch wrote:
>>> So if both types are from a third party, there is nothing he can do
>>> about the performance, but read the documentation and choose what's the
>>> best aproach to keep data integrity.

Lew wrote:
>> There isn't a performance issue here in the first place.

Pitch wrote:
> I thought he was talking about micro-optimizations and avoiding two
> conversions.

There weren't two conversions, only one. The one is a widening from int to
long, hardly expensive enough to constitute a performance issue. All Hotpost
would have to do is load the int into a 64=bit register and the conversion is
essentially free. There isn't a performance issue here in the first place.

--
Lew
From: Patricia Shanahan on
markspace wrote:
> Patricia Shanahan wrote:
>>
>> There would be no need to create a new assertEquals. Junit's
>> assertEquals already handles two String arguments.
>
>
> I was trying to be facetious. ...

Sorry - my facetiousness meter seems to be broken this week.

Patricia
From: Mike Schilling on
Lew wrote:
> Pitch wrote:
>>>> So if both types are from a third party, there is nothing he can
>>>> do
>>>> about the performance, but read the documentation and choose
>>>> what's the best aproach to keep data integrity.
>
> Lew wrote:
>>> There isn't a performance issue here in the first place.
>
> Pitch wrote:
>> I thought he was talking about micro-optimizations and avoiding two
>> conversions.
>
> There weren't two conversions, only one. The one is a widening from
> int to long, hardly expensive enough to constitute a performance
> issue. All Hotpost would have to do is load the int into a 64=bit
> register and the conversion is essentially free. There isn't a
> performance issue here in the first place.

These are unit tests, and the assertEquals call is to verify the
correctness of some presmably non-trivial operation. There wouldn't
be a performance issue even if there were 12 conversions.


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9
Prev: JDK 1.5.0_21 released
Next: LWUIT and J2ME