compiler bug with ternary operator and typed static method [message #515486] |
Thu, 18 February 2010 17:50  |
Eclipse User |
|
|
|
i'm posting this in the forum first as i found nothing in bugzilla with some of the keywords from this topic's title.
i'm running eclipse 3.5
this code causes a compiler error on the last line
List<RemotePageSummary> getChildren(long parentId) {
final List<RemotePageSummary> childrenList = parentToChildPageMap.get(new Long(parentId));
return childrenList == null ? Collections.emptyList() : childrenList;
}
while this doesnt
List<RemotePageSummary> getChildren(long parentId) {
final List<RemotePageSummary> childrenList = parentToChildPageMap.get(new Long(parentId));
if (childrenList == null) {
return Collections.emptyList();
} else {
return childrenList;
}
}
is this a bug or is there a good reason for the compiler to complain ?
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05937 seconds