harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivanov, Alexey A" <alexey.a.iva...@intel.com>
Subject RE: svn commit: r478636 - in /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt: Canvas.java Component.java Font.java MenuComponent.java Toolkit.java Window.java geom/Area.java
Date Fri, 24 Nov 2006 07:53:31 GMT
>-----Original Message-----
>From: Alexey Petrenko [mailto:alexey.a.petrenko@gmail.com]
>Sent: Friday, November 24, 2006 10:32 AM
>To: dev@harmony.apache.org
>Subject: Re: svn commit: r478636 - in
>/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/
awt:
>Canvas.java Component.java Font.java MenuComponent.java Toolkit.java
>Window.java geom/Area.java
>
>2006/11/23, Tim Ellison <t.p.ellison@gmail.com>:
>> apetrenko@apache.org wrote:
>> > -    public void add(Area area) {
>> > +    public void add(Area area) throws
>org.apache.harmony.luni.util.NotImplementedException {
>> >          throw new RuntimeException("Not implemented");
//$NON-NLS-1$
>> >      }
>> Sorry if I'm getting annoying ;-) but why not :
>> (1) import the NotYetImplementedException like we do everywhere else
for
>> type we reference, and
>It's just easier to remove. Remove it soon I hope :)

Eclipse easily handles adding and removing imports for you. Just press
Ctrl+Shift+O -- it's done. (I believe IDEA supports this too.) And the
code is clearer without these long package names :)

>> (2) actually throw it rather than a generic RuntimeException?

+1 for throwing NIE.

>What for? User will see that the method is not implemented anyway :)
>japitools does not look inside.
>It does not matter anyway.

But why not throwing NIE? It's easier: you don't need to type in the
message and adding non-localizable comment. And again it's clearer:
you'll see instance of NIE in stack trace.


Regards,
--
Alexey A. Ivanov
Intel Enterprise Solutions Software Division

Mime
View raw message