DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43467>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43467

           Summary: HTTPSampler may produce NullpointerException
           Product: JMeter
           Version: 2.2
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: HTTP
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


Hi,

i am currently writing some Samplers for JMeter and realized that the source
code in HTTPSampler may throw a NullpointerException in one special case,
because there is a logical programming error:

Look at the method sample(URL, String, boolean, int) in HTTPSampler:
On (my) line 404 you can find the following statement:
con = setupConnection(url, method, res);

The method used (setupConnection) may throw an IOException. This statement is
the first one in the surrounding try block to initialize the HttpURLConnection 
conn (which is initially set to null). If the setupConnection(...) method now
throws the IOException on the first execution, the conn object would still have
the null state. Now go to the catch block handling the IOException. There you
can see the following code:

res.sampleEnd();
conn.disconnect(); <= this is where a NullpointerException may be thrown

Naturally its a programming error of mine that the IOException is thrown here,
but it is not very useful if the debugging message is supressed, because the
NullpointerException is thrown here and no output is generated from the
IOException ... That is why I set it to trivial.

Would be nice if anyone of you guys could handle it.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to