commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van den Bemt <mll...@mvdb.net>
Subject Re: [feedparser] RSS enclosures without length attribute
Date Thu, 05 Jan 2006 18:30:48 GMT
Hi Andrew,

Could you put this (and the other patch you send to the list) in bugzilla, so we don't forget
about it ?

Please also realize that this component is going to be moved to dormant 
(https://svn.apache.org/repos/asf/jakarta/commons/feedparser) pretty soon and will therefore
not see 
the light with a release. If the community gets excited about a component in dormant mode
again and 
stays excited for a while, the component could move back again to proper (no guarantees though,

since a vote is needed for that).
This is just to give you the opportunity to bail out and eg fork feedparser if you don't like
the 
situation feedparser is in and will stay in for a while.
I just volunteer to apply patches for it if people (in this case you) supply them, while in
dormant 
mode, since some people offered to supply patches.

Mvgr,
Martin

Andrew McCall wrote:
> Hi,
> 
>    In using the feedparser API I've encountered a number of RSS feeds 
> that are missing the lenght attribute for enclosures. This causes 
> feedparser to throw a NPE. The standard does say that length is a 
> required element, but in practice it's being ignored. I've attached a 
> patch if anyone is interested. The length if not provided in the feed is 
> set to 0.
> 
> You'll need to apply the patches I submited yesterday first.
> 
> Cheers,
> Andrew McCall
> 
> 
> ------------------------------------------------------------------------
> 
> Index: src/java/org/apache/commons/feedparser/RSSFeedParser.java
> ===================================================================
> --- src/java/org/apache/commons/feedparser/RSSFeedParser.java	(revision 365922)
> +++ src/java/org/apache/commons/feedparser/RSSFeedParser.java	(working copy)
> @@ -297,7 +297,9 @@
>          String type = element.getAttributeValue( "type" );
>          String href = element.getAttributeValue( "url" );
>          String title = null;
> -        long length = Integer.parseInt( element.getAttributeValue( "length" ) );
> +        long length = 0;
> +        if (element.getAttributeValue("length") != null)
> +        	length = Integer.parseInt( element.getAttributeValue( "length" ) );
>  
>          linkFeedParserListener.onLink( state,
>                                         rel,
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message