Re: Integer / Long comparison
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Wed, 09 Sep 2009 21:38:16 -0400
Mike Schilling wrote:
Arne Vajhøj wrote:Patricia Shanahan wrote:Even if the value of a Long is supposed to be in the Integer range, aVery relevant point.
unit test should check that it is in range, not assume it.
It is not good to check if some code is OK by
assuming that the code is OK.
I'm also wondering why Longs and Integers insread of longs and ints. (assertEquals(long, int) would unambiguously call the (long, long) overload).Without seeing the code it's hard to tell, but I wonder if it should be using primitives, but autoboxing had made using objects instead transparent until this cropped up.
Maybe they need to be nullable.
But changing them to simple types would absolute help on the problem.
Arne
.
- References:
- Integer / Long comparison
- From: grz01
- Re: Integer / Long comparison
- From: Patricia Shanahan
- Re: Integer / Long comparison
- From: Arne Vajhøj
- Re: Integer / Long comparison
- From: Mike Schilling
- Integer / Long comparison
- Prev by Date: Re: Integer / Long comparison
- Next by Date: Re: Method Name extraction
- Previous by thread: Re: Integer / Long comparison
- Next by thread: Re: Integer / Long comparison
- Index(es):
Relevant Pages
|