This repository was archived by the owner on May 28, 2018. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed 
core-common/src/main/java/org/glassfish/jersey/message/internal 
tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/client Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -743,6 +743,8 @@ public void setWorkers(MessageBodyWorkers workers) {
743743     *         {@code false} otherwise. 
744744     */ 
745745    public  boolean  hasEntity () {
746+         entityContent .ensureNotClosed ();
747+ 
746748        try  {
747749            return  !entityContent .isEmpty ();
748750        } catch  (IllegalStateException  ex ) {
Original file line number Diff line number Diff line change 4949import  org .glassfish .jersey .test .JerseyTest ;
5050
5151import  org .junit .Test ;
52- import  static  org .junit .Assert .assertFalse ;
5352import  static  org .junit .Assert .fail ;
5453
5554/** 
@@ -160,10 +159,10 @@ public void testHasEntityAfterClose() {
160159        final  Response  response  = target ().path ("simple" ).request ().get (Response .class );
161160        response .close ();
162161        try  {
163-             final  boolean  hasEntity  = response .hasEntity ();
164-             assertFalse ("Should return false when the connection is already closed" , hasEntity );
165-         } catch  (final  IllegalStateException  ex ) {
162+             response .hasEntity ();
166163            fail ("IllegalStateException should have been caught inside hasEntity." );
164+         } catch  (final  IllegalStateException  ex ) {
165+             // expected 
167166        }
168167    }
169168}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments