想請問一下,以下這段是使用JD-GUI解譯出來的其中一段程式碼,
private List<ContentEntityObject> findBlogPosts(SearchResults searchResults) {
Lists.newArrayList(Collections2.transform(
his.searchManager.convertToEntities(searchResults,
SearchManager.EntityVersionPolicy.LATEST_VERSION), new Function() {
public ContentEntityObject apply(Searchable searchable) {
return (ContentEntityObject) searchable;
}
}));
}
但是放到Eclipse裡會有些部分有紅線如下:
findBlogPosts(SearchResults searchResults)
2 quick fixes available:
Add return statement => 變成 return Lists.newArrayList(Collections2...
Change return type to 'void'
new Function() {
1 quick fix available:
Add unimplemented methods => 變成增加如下片段:
@Override
public Object apply(Object input) {
return null;
}
不確定是不是解譯有錯,Java有method裡面還可以new Function() {....}這種語法嗎
這是Lambda?