Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] Avoiding new Object[0]

Friends of Platform UI,

I frequently see in our code base the creation of an empty array via
new Object[0];

IMHO this creates unnecessary instances of arrays. We should avoid
this unnecessary object creation, e.g., by providing a static field in
core.runtime or in equinox.

Or does Java provide something like Collections.emptyList() for Arrays?

I created https://bugs.eclipse.org/bugs/show_bug.cgi?id=477780 for
this discussion, in case you prefer to discuss via Bugzilla.

Best regards, Lars

-- 
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 (032) 221739404, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com


Back to the top