commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ludwig Magnusson" <>
Subject RE: [Lang] Null safe date comparisson
Date Thu, 06 Jan 2011 17:34:32 GMT
By appropriate I mean that I don't really have a specification for the
behavior. All I need is a method that can handle null without throwing an
exception. If such methods were to exist, the creators would surely have
thought of different ways to solve null arguments and they would probably
have solved it in some way if the code standard was good (and apaches
usually is).


My question was. Does such a method/library exist to anyone's knowledge?

If not, perhaps we could build one if people are interested and then we
could discuss what behavior is "appropriate".




From: sebb [] 
Sent: den 6 januari 2011 17:39
To: Commons Users List
Subject: Re: [Lang] Null safe date comparisson


On 6 January 2011 16:31, Ludwig Magnusson <> wrote:
> Hi!
> I'm looking for a way to do null safe date comparison. Something like:
> public static boolean isBefore(Date first, Date second);
> The method would handle null in an appropriate way.

What do you mean by appropriate?

Does null mean beginning of time, or end of time, or now, or Y2K or
something else?

How does one choose the default?

> I haven't found any method like that in DateUtils.
> Is there one somewhere?
> /Ludwig

To unsubscribe, e-mail:
For additional commands, e-mail:


No virus found in this message.
Checked by AVG -
Version: 10.0.1191 / Virus Database: 1435/3362 - Release Date: 01/05/11

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message