On Wed, Jul 22, 2009 at 11:54:04AM +0100, sebb AT ASF wrote:
> In:
> 
> AbstractMessageParser.parse()
> 
> Findbugs points out that the field "this.state" is overwritten by the
> fall-through.
> 
> It looks like the state can never be left set to HEADERS, and the
> switch statement could be eliminated entirely.
> 

Sebastian

It is all kosher. This is needed in case the method is terminated as a result
of SocketTimeoutException. For details see HTTPCORE-191

Cheers

Oleg

https://issues.apache.org/jira/browse/HTTPCORE-191



> On 22/07/2009, [email protected] <[email protected]> wrote:
> > Author: sebb
> >  Date: Wed Jul 22 10:40:27 2009
> >  New Revision: 796661
> >
> >  URL: http://svn.apache.org/viewvc?rev=796661&view=rev
> >  Log:
> >  Annotate switch fall-through to stop Eclipse complaining
> >
> >  Modified:
> >     
> > httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java
> >     
> > httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
> >
> >  Modified: 
> > httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java
> >  URL: 
> > http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java?rev=796661&r1=796660&r2=796661&view=diff
> >  
> > ==============================================================================
> >  --- 
> > httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java
> >  (original)
> >  +++ 
> > httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java
> >  Wed Jul 22 10:40:27 2009
> >  @@ -254,6 +254,7 @@
> >                  throw new ProtocolException(px.getMessage(), px);
> >              }
> >              this.state = HEADERS;
> >  +            //$FALL-THROUGH$
> >          case HEADERS:
> >              Header[] headers = AbstractMessageParser.parseHeaders(
> >                      this.sessionBuffer,
> >
> >  Modified: 
> > httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
> >  URL: 
> > http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java?rev=796661&r1=796660&r2=796661&view=diff
> >  
> > ==============================================================================
> >  --- 
> > httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
> >  (original)
> >  +++ 
> > httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
> >  Wed Jul 22 10:40:27 2009
> >  @@ -230,6 +230,7 @@
> >                      "Unexpected content at the end of chunk");
> >              }
> >              state = CHUNK_LEN;
> >  +            //$FALL-THROUGH$
> >          case CHUNK_LEN:
> >              this.buffer.clear();
> >              i = this.in.readLine(this.buffer);
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to