[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: redundant field initializers

From: Dalibor Topic
Subject: Re: redundant field initializers
Date: Mon, 20 Sep 2004 11:56:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5

Jeroen Frijters wrote:
Hi Jeroen,

-  private static InitialContextFactoryBuilder icfb = null;
+  private static InitialContextFactoryBuilder icfb;
Making this change removes the need for the compiler to create a static

Does everyone agree that this is a good idea? If so, how far should we
take this? How about this change:

Looks good and useful to me.

Index: java/awt/
RCS file:
retrieving revision 1.4
diff -u -r1.4
--- java/awt/   31 May 2004 21:11:46 -0000
+++ java/awt/   19 Sep 2004 09:52:47 -0000
@@ -42,14 +42,14 @@
class EventDispatchThread extends Thread
-  private static int dispatchThreadNum = 1;
+  private static int dispatchThreadNum;
private EventQueue queue; EventDispatchThread(EventQueue queue)
-    setName("AWT-EventQueue-" + dispatchThreadNum++);
+    setName("AWT-EventQueue-" + ++dispatchThreadNum);
     this.queue = queue;
     setPriority(NORM_PRIORITY + 1);

I like the idea. I think that's OK for private fields, that are not used in inner classes. But Tom's patch should make them explicitely non-privat, so that's the only temporal caveat I can think of.

dalibor topic

reply via email to

[Prev in Thread] Current Thread [Next in Thread]