Share

Heritrix: Internet Archive Web Crawler

Tracker: Bugs

5 oversight in CrawlURI; missing check for null - ID: 1119686
Last Update: Comment added ( karl-ia )

in the comments for getHttpRecorder it says that the
value can be null. that being the case, it seems that
the return should be checked for null before using it

public long getContentLength() {
if (this.contentLength < 0) {
////////////dave skinner
HttpRecorder rec = getHttpRecorder() ;
if ( rec != null )
this.contentLength =
rec.getResponseContentLength();
else
return 0 ;
////////dave skinner end
// original
// this.contentLength =
getHttpRecorder().getResponseContentLength(); }


dave skinner ( frodobay ) - 2005-02-09 22:36

5

Closed

Fixed

Nobody/Anonymous

None

None

Public


Comments ( 2 )

Date: 2007-03-14 00:20
Sender: karl-ia


This issue is now discussed in the new JIRA tracker at
http://webteam.archive.org/jira/browse/HER-357 -- please add further
comments at that location.


Date: 2005-02-09 23:10
Sender: stack-sfProject Admin

Logged In: YES
user_id=924942

Thanks Dave.

Closing. Tested and committed suggested patch.

Below is commit message:

Fix for '[ 1119686 ] oversight in CrawlURI'.
Patch submitted by Dave Skinner.
* src/java/org/archive/crawler/datamodel/CrawlURI.java
Add test for non-null http recorder before going to it
to find
content length (If null, return length of zero).



Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
resolution_id None 2005-02-09 23:10 stack-sf
summary oversight in CrawlURI 2005-02-09 23:10 stack-sf
close_date - 2005-02-09 23:10 stack-sf
status_id Open 2005-02-09 23:10 stack-sf