Buggy code:
public abstract class AbstractResource implements IResource { private static final long serialVersionUID = 1L ; public static final Set < String > INTERNAL_HEADERS ; public AbstractResource ( ) { } protected abstract AbstractResource . ResourceResponse newResourceResponse ( Attributes attributes ) { } public static class ResourceResponse { private Integer errorCode ; private String errorMessage ; private String fileName = null ; private ContentDisposition contentDisposition = ContentDisposition . INLINE ; private String contentType = null ; private String textEncoding ; private long contentLength = - 1 ; private Time lastModified = null ; private AbstractResource . WriteCallback writeCallback ; private Duration cacheDuration ; private CacheScope cacheScope ; private final HttpHeaderCollection headers ; public ResourceResponse ( ) { } public void setError ( Integer errorCode ) { } public void setError ( Integer errorCode , String errorMessage ) { } public Integer getErrorCode ( ) { } public String getErrorMessage ( ) { } public void setFileName ( String fileName ) { } public String getFileName ( ) { } public void setContentDisposition ( ContentDisposition contentDisposition ) { } public ContentDisposition getContentDisposition ( ) { } public void setContentType ( String contentType ) { } public String getContentType ( ) { } public void setTextEncoding ( String textEncoding ) { } protected String getTextEncoding ( ) { } public void setContentLength ( long contentLength ) { } public long getContentLength ( ) { } public void setLastModified ( Time lastModified ) { } public Time getLastModified ( ) { } public boolean dataNeedsToBeWritten ( Attributes attributes ) { } public void disableCaching ( ) { } public void setCacheDurationToMaximum ( ) { } public void setCacheDuration ( Duration duration ) { } public Duration getCacheDuration ( ) { } public CacheScope getCacheScope ( ) { } public void setCacheScope ( WebResponse . CacheScope scope ) { } public void setWriteCallback ( final AbstractResource . WriteCallback writeCallback ) { } public AbstractResource . WriteCallback getWriteCallback ( ) { } public HttpHeaderCollection getHeaders ( ) { } } protected void configureCache ( final AbstractResource . ResourceResponse data , final Attributes attributes ) { } public final void respond ( final Attributes attributes ) { AbstractResource . ResourceResponse data = newResourceResponse ( attributes ) ; setResponseHeaders ( data , attributes ) ; <START_BUG> if ( ! ( data . dataNeedsToBeWritten ( attributes ) ) ) { <END_BUG> return ; } if ( ( data . getWriteCallback ( ) ) == null ) { throw new IllegalStateException ( "ResourceResponse#setWriteCallback()<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>set." ) ; } data . getWriteCallback ( ) . writeData ( attributes ) ; } private void checkHeaderAccess ( String name ) { } protected void setResponseHeaders ( final AbstractResource . ResourceResponse data , final Attributes attributes ) { } public abstract static class WriteCallback { public abstract void writeData ( Attributes attributes ) { } protected final void writeStream ( Attributes attributes , InputStream stream ) { } } }

Fix:
if ( ( ! ( data . dataNeedsToBeWritten ( attributes ) ) ) || ( ( data . getErrorCode ( ) ) != null ) ) {