Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316597 - Useless null check in org.eclipse.jetty.util.resource.Resource.defangURI()
Summary: Useless null check in org.eclipse.jetty.util.resource.Resource.defangURI()
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.1.3   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 7.2.0.RC0   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 08:38 EDT by Richard Hash CLA
Modified: 2010-06-17 13:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Hash CLA 2010-06-11 08:38:49 EDT
Build Identifier: Build id: M20090917-0800

In org.eclipse.jetty.util.resource.Resource(), the following code might want to be a little less certain about buf being null:

    private static String defangURI(String raw) 
    {
        StringBuffer buf = null;
        
        if (buf==null)
        {

Reproducible: Always

Steps to Reproduce:
1. Open org.eclipse.jetty.util.resource.Resource.defangURI()
2. Look at code.
3. Slap head and say doh!
Comment 1 Greg Wilkins CLA 2010-06-15 00:20:56 EDT
defang URI!   who even wrote that method!!!!  (will probably turn out to be me!)
Comment 2 Greg Wilkins CLA 2010-06-15 00:35:21 EDT
DOH!
it was me.  Fixed and given a better method name: hrefEncodeURI
r2003
Comment 3 Michael Gorovoy CLA 2010-06-17 13:36:36 EDT
Marking as resolved.