<commit_before>package org.frameworkset.spi.remote.http;

import java.io.IOException;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.ResponseHandler;
import org.apache.http.util.EntityUtils;

public class StringResponseHandler implements ResponseHandler<String> {

	public StringResponseHandler() {
		// TODO Auto-generated constructor stub
	}
	
	 @Override
     public String handleResponse(final HttpResponse response)
             throws ClientProtocolException, IOException {
         int status = response.getStatusLine().getStatusCode();

         if (status >= 200 && status < 300) {
             HttpEntity entity = response.getEntity();

             return entity != null ? EntityUtils.toString(entity) : null;
         } else {
             HttpEntity entity = response.getEntity();
             if (entity != null )
                 return EntityUtils.toString(entity);
             else
                 throw new ClientProtocolException("Unexpected response status: " + status);
         }
     }

}<commit_msg>请求字符串时，如果响应异常，则抛出异常<commit_after>package org.frameworkset.spi.remote.http;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.ResponseHandler;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

public class StringResponseHandler implements ResponseHandler<String> {

	public StringResponseHandler() {
		// TODO Auto-generated constructor stub
	}
	
	 @Override
     public String handleResponse(final HttpResponse response)
             throws ClientProtocolException, IOException {
         int status = response.getStatusLine().getStatusCode();

         if (status >= 200 && status < 300) {
             HttpEntity entity = response.getEntity();

             return entity != null ? EntityUtils.toString(entity) : null;
         } else {
             HttpEntity entity = response.getEntity();
             if (entity != null )
                 throw new ClientProtocolException(EntityUtils.toString(entity));
             else
                 throw new ClientProtocolException("Unexpected response status: " + status);
         }
     }

}
{'fraction_non_alphanumeric': 0.09106678230702515, 'fraction_numerical': 0.005203816131830009, 'mean_word_length': 2.8969594594594597, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3525080', 'n_tokens_mistral': 584, 'n_tokens_neox': 568, 'n_words': 133}