[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jdt-ui-dev] Compiler check / warning for the usage of new Integer or new Boolean?
|
This is not a appropriate question for the JDT UI or Core mailing lists.
Please search Bugzilla for an enhancement request, or file a new one if
there's none.
new Integer(int) and new Boolean(boolean) are not wrong per se, but often
indeed not appropriate.
Markus
From: Lars Vogel <lars.vogel@xxxxxxxxxxx>
To: "Eclipse JDT UI developers list." <jdt-ui-dev@xxxxxxxxxxx>
Date: 2016-03-08 18:42
Subject: [jdt-ui-dev] Compiler check / warning for the usage of new
Integer or new Boolean?
Sent by: jdt-ui-dev-bounces@xxxxxxxxxxx
Hi,
AFAIK using new Integer() is wrong and Integer.valueof(int) should be
prefered.
See
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Integer.html#valueOf%28int%29
Is there a way / trick to tell JDT to warn about new Integer(int) or
new Boolean(value) statements in a code base?
I think I check all entries in Error/Warnings but did not see anything
fitting.
Best regards, Lars
P.S. I tried posting to JDT core but got the message that the email is
unprocessed
--
Eclipse Platform UI and e4 project co-lead
CEO vogella GmbH
Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web:
http://www.vogella.com
_______________________________________________
jdt-ui-dev mailing list
jdt-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/jdt-ui-dev