This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove NullPointerExceptions in FileDialog


Tom Tromey wrote:
"Fernando" == Fernando Nasser <fnasser@redhat.com> writes:


Fernando> If you mistype: Fernando> g = null Fernando> you are in serous trouble Fernando> while if you mistype Fernando> null = g Fernando> you get a compiler error.

In Java this problem isn't nearly as serious as it is in C++, because
there is no conversion from a reference type to boolean.  You almost
always just get a compilation error if you make this typo.


I see. For Java it only applies if g is boolean and you are comparing it with true or false...


And what about the patch itself? Nobody commented on the logical part of the change. It does get rid of the exceptions.

--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]