Is method DownloadableResource.isResourceModified() named incorrectly?

Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2011

From the JavaDoc:

/**
* Returns true if the plugin resource has been modified. The implementing class is responsible for
* setting any appropriate response codes or headers on the response.
*
* If the resource has been modified, the resource shouldn't be served.
*/
boolean isResourceModified(HttpServletRequest request, HttpServletResponse response);
What?? If resource has been modified, it should not be served? Isn't the logic normally the opposite?
Let's take a look at an implementation in AbstractDownloadableResource. Here's the JavaDoc:
/**
* Checks any "If-Modified-Since" header from the request against the
* plugin's loading time, since plugins can't be modified after they've been
* loaded this is a good way to determine if a plugin resource has been
* modified or not. If this method returns true, don't do any more
* processing on the request -- the response code has already been set to
* "304 Not Modified" for you, and you don't need to serve the file.
*/
So the method "isResourceModified()" returns true when it sets HTTP 304 response, "Not Modified".
Am I missing something? Shouldn't it be named isResourceNotModified() instead?
And if not, since this is an interface method, I guess it is too late to rename it - but probably someone should clear this up in the JavaDoc.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2011

sorry about condensed text, I'm tired of fighting with the formatting controls here...

TAGS
AUG Leaders

Atlassian Community Events