You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Dmitry Markman <di...@simplayer.com> on 2001/02/24 05:32:55 UTC
mod_jserv/7311: servlet throws exception in runtime if was return from within synchronized block
>Number: 7311
>Category: mod_jserv
>Synopsis: servlet throws exception in runtime if was return from within synchronized block
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: jserv
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Fri Feb 23 20:40:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: dima@simplayer.com
>Release: Linux RedHat 6.2 distribution
>Organization:
apache
>Environment:
Linux x86 RedHat 6.2
>Description:
if servlet's doGet method uses code where you try return from within
synchronized block:
synchronized(foo){
...
if(condition) return;
...
}
you will receive exception in runtime - something like that: invalid word
<return>
>How-To-Repeat:
yes, always
>Fix:
no, only if you will change your code:
boolean needReturn = false;
synchronized(foo){
...
if(condition) needReturn = true;
if(!needReturn){
...
}
}
if(needReturn) return;
>Release-Note:
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or ]
["Re: general/1098:"). If the subject doesn't match this ]
[pattern, your message will be misfiled and ignored. The ]
["apbugs" address is not added to the Cc line of messages from ]
[the database automatically because of the potential for mail ]
[loops. If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request from a ]
[developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]