From: <die...@us...> - 2011-02-09 13:53:24
|
Revision: 3328 http://openutils.svn.sourceforge.net/openutils/?rev=3328&view=rev Author: diego_schivo Date: 2011-02-09 13:53:17 +0000 (Wed, 09 Feb 2011) Log Message: ----------- MEDIA-216 exclude null items from iterator Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-02-09 10:14:51 UTC (rev 3327) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-02-09 13:53:17 UTC (rev 3328) @@ -63,6 +63,7 @@ import org.slf4j.LoggerFactory; import com.google.common.base.Function; +import com.google.common.base.Predicates; import com.google.common.collect.Iterators; @@ -856,16 +857,19 @@ playlistNode = (Content) obj; } - return Iterators.transform(PlaylistIterateUtils.iterate(playlistNode), new Function<MediaNodeAndEntryPath, Content>() - { + Iterator<Content> iter = Iterators.transform( + PlaylistIterateUtils.iterate(playlistNode), + new Function<MediaNodeAndEntryPath, Content>() + { - /** - * {@inheritDoc} - */ - public Content apply(MediaNodeAndEntryPath from) - { - return from.getMediaNode(); - } - }); + /** + * {@inheritDoc} + */ + public Content apply(MediaNodeAndEntryPath from) + { + return from.getMediaNode(); + } + }); + return Iterators.filter(iter, Predicates.notNull()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |