nus-yam/ex-repair huggingface dataset:
Program: 24383
Project: 24383
Buggy source:
public OCMap(){
  map=new HashMap<K,E>();
  mapList=new HashMap<K,List<E>>();
}

Fixed version (ground truth):
public OCMap(Map<? extends K,? extends E> map){
  map=this.map;
  mapList=new HashMap<K,List<E>>();
}
Program: 24384
Project: 24384
Buggy source:
@Override public void beforeDecode(Decoder decoder,BytesInputStream in,CodecParameter param) throws IOException {
  int codeLen=verifier.verifyLength();
  byte[] srcCode=new byte[codeLen];
  in.setCursor(in.getCount() - codeLen);
  in.read(srcCode);
  in.moveHead();
  byte[] bytes=in.getDirectBytes();
  in.offset(0,codeLen);
  Object code=verifier.update(null,bytes,in.position(),in.getCount());
  byte[] codes=verifier.getVerifyCode(code,param.isLittleEndian());
  if (log.isDebugEnabled()) {
    log.debug(StringHelper.buffer("String_Node_Str",ByteHelper.toHexString(srcCode),"String_Node_Str",ByteHelper.toHexString(codes),"String_Node_Str",verifier.getClass()));
  }
  for (int i=0; i < codeLen; i++) {
    if (srcCode[i] != codes[i]) {
      throw new VerifyException("String_Node_Str" + ByteHelper.toHexString(srcCode) + "String_Node_Str"+ ByteHelper.toHexString(codes));
    }
  }
}

Fixed version (ground truth):
@Override public void beforeDecode(Decoder decoder,BytesInputStream in,CodecParameter param) throws IOException {
  int codeLen=verifier.verifyLength();
  byte[] srcCode=new byte[codeLen];
  in.setCursor(in.getCount() - codeLen);
  in.read(srcCode);
  in.moveHead();
  byte[] bytes=in.getDirectBytes();
  in.offset(0,codeLen);
  Object code=verifier.update(null,bytes,in.position(),in.getCount());
  byte[] codes=verifier.getVerifyCode(code,param.isLittleEndian());
  if (codes == null) {
    throw new VerifyException("String_Node_Str" + verifier);
  }
  if (log.isDebugEnabled()) {
    log.debug(StringHelper.buffer("String_Node_Str",ByteHelper.toHexString(srcCode),"String_Node_Str",ByteHelper.toHexString(codes),"String_Node_Str",verifier.getClass()));
  }
  for (int i=0; i < codeLen; i++) {
    if (srcCode[i] != codes[i]) {
      throw new VerifyException("String_Node_Str" + ByteHelper.toHexString(srcCode) + "String_Node_Str"+ ByteHelper.toHexString(codes));
    }
  }
}
Program: 24385
Project: 24385
Buggy source:
@Override public void afterEncode(Encoder encoder,BytesOutputStream out,CodecParameter param) throws IOException {
  computeTotalLength(out,verifier.verifyLength(),param.getCodecConfig());
  Object code=null;
  if (out.getHead() != null) {
    for (    ByteBuffer buf : out.getHead()) {
      code=verifier.update(code,buf.array());
    }
  }
  code=verifier.update(code,out.getDirectBytes(),0,out.size());
  if (out.getTail() != null) {
    for (    ByteBuffer buf : out.getTail()) {
      code=verifier.update(code,buf.array());
    }
  }
  byte[] codes=verifier.getVerifyCode(code,param.isLittleEndian());
  out.newBufferTailEnd(codes.length).put(codes);
}

Fixed version (ground truth):
@Override public void afterEncode(Encoder encoder,BytesOutputStream out,CodecParameter param) throws IOException {
  computeTotalLength(out,verifier.verifyLength(),param.getCodecConfig());
  Object code=null;
  if (out.getHead() != null) {
    for (    ByteBuffer buf : out.getHead()) {
      code=verifier.update(code,buf.array());
    }
  }
  code=verifier.update(code,out.getDirectBytes(),0,out.size());
  if (out.getTail() != null) {
    for (    ByteBuffer buf : out.getTail()) {
      code=verifier.update(code,buf.array());
    }
  }
  byte[] codes=verifier.getVerifyCode(code,param.isLittleEndian());
  if (codes == null) {
    throw new VerifyException("String_Node_Str" + verifier);
  }
  out.newBufferTailEnd(codes.length).put(codes);
}
Program: 24386
Project: 24386
Buggy source:
public static VerifyWrapper CRC16(){
  return new VerifyWrapper(new CRC16());
}

Fixed version (ground truth):
public static VerifyWrapper CRC16(){
  return new VerifyWrapper(new CRC16Verifier());
}
Program: 24387
Project: 24387
Buggy source:
@Override public void checkConfiguration() throws RuntimeConfigurationException {
  if (!(PHONEGAP_PATH.equals("String_Node_Str"))) {
    throw new RuntimeConfigurationException("String_Node_Str");
  }
  if (!(PHONEGAP_COMMAND.equals("String_Node_Str"))) {
    throw new RuntimeConfigurationException("String_Node_Str");
  }
  if ((!(PHONEGAP_PLATFORM.equals("String_Node_Str")) || (!(PHONEGAP_PLATFORM.equals("String_Node_Str"))) || (!(PHONEGAP_PLATFORM.equals("String_Node_Str"))))) {
    throw new RuntimeConfigurationException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void checkConfiguration() throws RuntimeConfigurationException {
  if (!(PHONEGAP_PATH.equals("String_Node_Str"))) {
    throw new RuntimeConfigurationException("String_Node_Str");
  }
  if (!(PHONEGAP_COMMAND.equals("String_Node_Str"))) {
    throw new RuntimeConfigurationException("String_Node_Str");
  }
  if (!(PHONEGAP_PLATFORM.equals("String_Node_Str") || PHONEGAP_PLATFORM.equals("String_Node_Str") || PHONEGAP_PLATFORM.equals("String_Node_Str"))) {
    throw new RuntimeConfigurationException("String_Node_Str");
  }
}
Program: 24388
Project: 24388
Buggy source:
@SuppressWarnings("String_Node_Str") public static <T>T createNewService(String apiEndpointUrl,Class<T> restServiceClass,BaseHttpClient client){
  T service;
  if (restServiceClass.isAnnotationPresent(RestApi.class)) {
    String restClassName=restServiceClass.getName();
    service=(T)cachedServices.get(restClassName);
    if (service == null) {
      service=(T)Proxy.newProxyInstance(restServiceClass.getClassLoader(),new Class[]{restServiceClass},new RestServiceInvocationHandler(apiEndpointUrl));
      T found=(T)cachedServices.putIfAbsent(restClassName,service);
      if (found != null) {
        service=found;
      }
      setupMethodMetaDataCache(restServiceClass,client);
    }
  }
 else {
    throw new IllegalArgumentException(restServiceClass + "String_Node_Str");
  }
  return service;
}

Fixed version (ground truth):
public static <T>T createNewService(String apiEndpointUrl,Class<T> restServiceClass,BaseHttpClient client,boolean debugMode){
  if (debugMode) {
    GlobalSettings.DEBUG=true;
  }
 else {
    GlobalSettings.DEBUG=false;
  }
  return createNewService(apiEndpointUrl,restServiceClass,client);
}
Program: 24389
Project: 24389
Buggy source:
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  RestMethodMetaDataCache methodMetaDataCache=cachedMethodMetaData.get(method);
  try {
    if (methodMetaDataCache != null) {
      return methodMetaDataCache.invoke(baseUrl,args);
    }
 else {
      return method.invoke(this,args);
    }
  }
 catch (  InvocationTargetException e) {
    throw e.getCause();
  }
}

Fixed version (ground truth):
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  RestApiMethodMetadata methodMetaDataCache=cachedMethodMetaData.get(method);
  try {
    if (methodMetaDataCache != null) {
      return methodMetaDataCache.invoke(baseUrl,args);
    }
 else {
      return method.invoke(this,args);
    }
  }
 catch (  InvocationTargetException e) {
    throw e.getCause();
  }
}
Program: 24390
Project: 24390
Buggy source:
/** 
 * Initialize method meta data cache for every method
 * @param restServiceClass {@link T}
 * @param client {@link ApacheHttpClient}
 */
private static void setupMethodMetaDataCache(Class<?> restServiceClass,BaseHttpClient httpClient){
  for (  Method method : restServiceClass.getMethods()) {
    if (method.isAnnotationPresent(Get.class) || method.isAnnotationPresent(Post.class)) {
      cachedMethodMetaData.putIfAbsent(method,new RestMethodMetaDataCache(method,httpClient));
    }
  }
}

Fixed version (ground truth):
/** 
 * Initialize method meta data cache for every method
 * @param restServiceClass {@link T}
 * @param client {@link ApacheHttpClient}
 */
private static void setupMethodMetaDataCache(Class<?> restServiceClass,BaseHttpClient httpClient){
  for (  Method method : restServiceClass.getMethods()) {
    if (method.isAnnotationPresent(Get.class) || method.isAnnotationPresent(Post.class)) {
      cachedMethodMetaData.putIfAbsent(method,new RestApiMethodMetadata(method,httpClient));
    }
  }
}
Program: 24391
Project: 24391
Buggy source:
/** 
 * Handle cookies with cookie-handler
 */
private void setupCookieManager(){
  CookieManager cookieManager=new CookieManager();
  CookieHandler.setDefault(cookieManager);
}

Fixed version (ground truth):
/** 
 * Handle cookies with cookie-handler
 */
private void setupCookieManager(){
  CookieManager cookieManager=new CookieManager();
  CookieHandler.setDefault(cookieManager);
  Logger.log("String_Node_Str");
}
Program: 24392
Project: 24392
Buggy source:
/** 
 * @param url
 * @param nameValuePairs
 * @exception IOException ,  {@link HttpCredentialException},   {@link BaseException},   {@link HttpEndpointNotFoundException}
 * @return {@link String}
 */
private HttpResponse doHttpGet(String url,List<NameValuePair> nameValuePairs) throws IOException {
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + url);
  HttpGet get=createHttpGetRequest(url,nameValuePairs);
  return executeHttpRequest(get);
}

Fixed version (ground truth):
/** 
 * @param url
 * @param nameValuePairs
 * @exception IOException ,  {@link HttpCredentialException},   {@link BaseException},   {@link HttpEndpointNotFoundException}
 * @return {@link String}
 */
private HttpResponse doHttpGet(String url,List<NameValuePair> nameValuePairs) throws IOException {
  Logger.log("String_Node_Str" + url);
  HttpGet get=createHttpGetRequest(url,nameValuePairs);
  return executeHttpRequest(get);
}
Program: 24393
Project: 24393
Buggy source:
/** 
 * Execute the post request and return content. Reuse the createHttpPostRequest and executeHttpRequest methods
 * @param url
 * @param nameValuePairs
 * @exception IOException ,  {@link HttpCredentialException},   {@link BaseException},   {@link HttpEndpointNotFoundException}
 * @return {@link String}
 */
private HttpResponse doHttpPost(String url,List<NameValuePair> nameValuePairs) throws IOException {
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + url);
  HttpPost post=createHttpPostRequest(url,nameValuePairs);
  return executeHttpRequest(post);
}

Fixed version (ground truth):
/** 
 * Execute the post request and return content. Reuse the createHttpPostRequest and executeHttpRequest methods
 * @param url
 * @param nameValuePairs
 * @exception IOException ,  {@link HttpCredentialException},   {@link BaseException},   {@link HttpEndpointNotFoundException}
 * @return {@link String}
 */
private HttpResponse doHttpPost(String url,List<NameValuePair> nameValuePairs) throws IOException {
  Logger.log("String_Node_Str" + url);
  HttpPost post=createHttpPostRequest(url,nameValuePairs);
  return executeHttpRequest(post);
}
Program: 24394
Project: 24394
Buggy source:
private Response handleHttpResponse(HttpResponse httpResponse) throws IOException {
  int statusCode=httpResponse.getStatusLine().getStatusCode();
  InputStream contentStream=httpResponse.getEntity().getContent();
  Log.d(TAG,"String_Node_Str" + statusCode);
switch (statusCode) {
case 200:
    return new Response(statusCode,StringHelper.EMPTY,com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
case 401:
  httpResponse.getEntity().consumeContent();
return new Response(statusCode,httpResponse.getStatusLine().toString(),com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
case 404:
httpResponse.getEntity().consumeContent();
return new Response(statusCode,httpResponse.getStatusLine().toString(),com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
case 500:
httpResponse.getEntity().consumeContent();
return new Response(statusCode,httpResponse.getStatusLine().toString(),com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
default :
httpResponse.getEntity().consumeContent();
return new Response(statusCode,httpResponse.getStatusLine().toString(),com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
}
}

Fixed version (ground truth):
private Response handleHttpResponse(HttpResponse httpResponse) throws IOException {
  int statusCode=httpResponse.getStatusLine().getStatusCode();
  InputStream contentStream=httpResponse.getEntity().getContent();
  Logger.log("String_Node_Str" + statusCode);
switch (statusCode) {
case 200:
    return new Response(statusCode,StringHelper.EMPTY,com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
case 401:
  httpResponse.getEntity().consumeContent();
return new Response(statusCode,httpResponse.getStatusLine().toString(),com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
case 404:
httpResponse.getEntity().consumeContent();
return new Response(statusCode,httpResponse.getStatusLine().toString(),com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
case 500:
httpResponse.getEntity().consumeContent();
return new Response(statusCode,httpResponse.getStatusLine().toString(),com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
default :
httpResponse.getEntity().consumeContent();
return new Response(statusCode,httpResponse.getStatusLine().toString(),com.windigo.http.Header.convertFromApacheHeaders(httpResponse.getAllHeaders()),contentStream);
}
}
Program: 24395
Project: 24395
Buggy source:
/** 
 * Create   {@link HttpGet} request with given {@link String} urland  {@link NameValuePair} request parameters
 * @param url
 * @param nameValuePairs
 * @return {@link HttpGet}
 */
public HttpGet createHttpGetRequest(String url,List<NameValuePair> nameValuePairs){
  String queryString=URLEncodedUtils.format(sanitizeParameters(nameValuePairs),HTTP.UTF_8);
  String fullUrlString=new StringBuilder(url + "String_Node_Str" + queryString).toString();
  HttpGet httpGet=new HttpGet(fullUrlString);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + httpGet.getURI());
  return httpGet;
}

Fixed version (ground truth):
/** 
 * Create   {@link HttpGet} request with given {@link String} urland  {@link NameValuePair} request parameters
 * @param url
 * @param nameValuePairs
 * @return {@link HttpGet}
 */
public HttpGet createHttpGetRequest(String url,List<NameValuePair> nameValuePairs){
  String queryString=URLEncodedUtils.format(sanitizeParameters(nameValuePairs),HTTP.UTF_8);
  String fullUrlString=new StringBuilder(url + "String_Node_Str" + queryString).toString();
  HttpGet httpGet=new HttpGet(fullUrlString);
  Logger.log("String_Node_Str" + httpGet.getURI());
  return httpGet;
}
Program: 24396
Project: 24396
Buggy source:
/** 
 * Remove the null parameters from the list of   {@link NameValuePair} pairs
 * @param paramPairs
 * @return {@link List}
 */
private List<NameValuePair> sanitizeParameters(List<NameValuePair> paramPairs){
  List<NameValuePair> params=new ArrayList<NameValuePair>();
  for (  NameValuePair param : paramPairs) {
    if (param.getValue() != null) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str" + param);
      params.add(param);
    }
  }
  return params;
}

Fixed version (ground truth):
/** 
 * Remove the null parameters from the list of   {@link NameValuePair} pairs
 * @param paramPairs
 * @return {@link List}
 */
private List<NameValuePair> sanitizeParameters(List<NameValuePair> paramPairs){
  List<NameValuePair> params=new ArrayList<NameValuePair>();
  for (  NameValuePair param : paramPairs) {
    if (param.getValue() != null) {
      Logger.log("String_Node_Str" + param.getName() + "String_Node_Str"+ param.getValue());
      params.add(param);
    }
  }
  return params;
}
Program: 24397
Project: 24397
Buggy source:
/** 
 * Execute the given   {@link HttpRequestBase}. Closes all the expired  connection pool items and set heeaders if present.
 * @param httpRequest
 * @throws IOException
 * @return {@link HttpResponse}
 */
public HttpResponse executeHttpRequest(HttpRequestBase httpRequest) throws IOException {
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + httpRequest.getURI().toString());
  if (headers != null && headers.length > 0) {
    httpRequest.setHeaders(headers);
  }
  try {
    mHttpClient.getConnectionManager().closeExpiredConnections();
    return mHttpClient.execute(httpRequest);
  }
 catch (  IOException e) {
    httpRequest.abort();
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Execute the given   {@link HttpRequestBase}. Closes all the expired  connection pool items and set heeaders if present.
 * @param httpRequest
 * @throws IOException
 * @return {@link HttpResponse}
 */
public HttpResponse executeHttpRequest(HttpRequestBase httpRequest) throws IOException {
  Logger.log("String_Node_Str" + httpRequest.getURI().toString());
  if (headers != null && headers.length > 0) {
    httpRequest.setHeaders(headers);
    Logger.log("String_Node_Str" + headers.length + "String_Node_Str");
  }
  try {
    mHttpClient.getConnectionManager().closeExpiredConnections();
    return mHttpClient.execute(httpRequest);
  }
 catch (  IOException e) {
    httpRequest.abort();
    throw e;
  }
}
Program: 24398
Project: 24398
Buggy source:
@Override public Response execute(Request request) throws IOException {
  Response response=null;
  headers=com.windigo.http.Header.convertToApacheHeaders(request.getHeaders());
  setupCookieManager();
switch (request.getHttpRequestType()) {
case GET:
    HttpResponse httpGetResponse=doHttpGet(request.getFullUrl(),request.getQueryParams());
  response=handleHttpResponse(httpGetResponse);
return response;
case POST:
HttpResponse httpPostResponse=doHttpPost(request.getFullUrl(),request.getBodyParams());
response=handleHttpResponse(httpPostResponse);
return response;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public Response execute(Request request) throws IOException {
  if (request == null)   throw new IllegalArgumentException("String_Node_Str");
  Logger.log(request.toString());
  Response response=null;
  headers=com.windigo.http.Header.convertToApacheHeaders(request.getHeaders());
  setupCookieManager();
switch (request.getHttpRequestType()) {
case GET:
    HttpResponse httpGetResponse=doHttpGet(request.getFullUrl(),request.getQueryParams());
  response=handleHttpResponse(httpGetResponse);
return response;
case POST:
HttpResponse httpPostResponse=doHttpPost(request.getFullUrl(),request.getBodyParams());
response=handleHttpResponse(httpPostResponse);
return response;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}
Program: 24399
Project: 24399
Buggy source:
/** 
 * Handle cookies with cookie-handler
 */
private void setupCookieManager(){
  CookieManager cookieManager=new CookieManager();
  CookieHandler.setDefault(cookieManager);
}

Fixed version (ground truth):
/** 
 * Handle cookies with cookie-handler
 */
private void setupCookieManager(){
  CookieManager cookieManager=new CookieManager();
  CookieHandler.setDefault(cookieManager);
  Logger.log("String_Node_Str");
}
Program: 24400
Project: 24400
Buggy source:
/** 
 * Set the header list to   {@link URLConnection} object
 * @param headers
 */
private void addHeaders(List<Header> headers){
  if (headers.size() == 0)   return;
  for (  Header header : headers) {
    connection.addRequestProperty(header.getName(),header.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Set the header list to   {@link URLConnection} object
 * @param headers
 */
private void addHeaders(List<Header> headers){
  if (headers.size() == 0)   return;
  for (  Header header : headers) {
    connection.addRequestProperty(header.getName(),header.getValue());
    Logger.log("String_Node_Str" + header.getName() + "String_Node_Str"+ header.getValue());
  }
}
Program: 24401
Project: 24401
Buggy source:
/** 
 * Open http url connection to url and return connection
 * @param request
 * @return {@link HttpURLConnection}
 * @throws MalformedURLException
 * @throws IOException
 */
protected HttpURLConnection openHttpURLConnection(Request request) throws MalformedURLException, IOException {
  HttpURLConnection connection=(HttpURLConnection)new URL(request.getFullUrl()).openConnection();
  connection.setRequestMethod(request.getHttpRequestType().toString());
  connection.setConnectTimeout(GlobalSettings.CONNNECTION_TIMEOUT);
  connection.setReadTimeout(GlobalSettings.CONNECTION_READ_TIMEOUT);
  return connection;
}

Fixed version (ground truth):
/** 
 * Open http url connection to url and return connection
 * @param request
 * @return {@link HttpURLConnection}
 * @throws MalformedURLException
 * @throws IOException
 */
protected HttpURLConnection openHttpURLConnection(Request request) throws MalformedURLException, IOException {
  HttpURLConnection connection=(HttpURLConnection)new URL(request.getFullUrl()).openConnection();
  connection.setRequestMethod(request.getHttpRequestType().toString());
  connection.setConnectTimeout(GlobalSettings.CONNNECTION_TIMEOUT);
  connection.setReadTimeout(GlobalSettings.CONNECTION_READ_TIMEOUT);
  Logger.log("String_Node_Str" + GlobalSettings.CONNNECTION_TIMEOUT);
  Logger.log("String_Node_Str" + GlobalSettings.CONNECTION_READ_TIMEOUT);
  return connection;
}
Program: 24402
Project: 24402
Buggy source:
/** 
 * Form response wrapper with   {@link Response} object
 * @return {@link Response}
 * @throws IOException
 */
private Response getResponse() throws IOException {
  String reason=connection.getResponseMessage();
  reason=(reason == null ? "String_Node_Str" : reason);
  List<Header> headers=getResponseHeaders();
  int statusCode=connection.getResponseCode();
  InputStream is;
  if (statusCode >= 400) {
    is=connection.getErrorStream();
  }
 else {
    is=connection.getInputStream();
  }
  return new Response(statusCode,reason,headers,is);
}

Fixed version (ground truth):
/** 
 * Form response wrapper with   {@link Response} object
 * @return {@link Response}
 * @throws IOException
 */
private Response getResponse() throws IOException {
  String reason=connection.getResponseMessage();
  reason=(reason == null ? "String_Node_Str" : reason);
  List<Header> headers=getResponseHeaders();
  int statusCode=connection.getResponseCode();
  Logger.log("String_Node_Str" + statusCode);
  InputStream is;
  if (statusCode >= 400) {
    is=connection.getErrorStream();
  }
 else {
    is=connection.getInputStream();
  }
  return new Response(statusCode,reason,headers,is);
}
Program: 24403
Project: 24403
Buggy source:
/** 
 * Read response header to   {@link List}
 * @return {@link List} of {@link Header}
 */
private List<Header> getResponseHeaders(){
  List<Header> headers=new ArrayList<Header>();
  for (  Map.Entry<String,List<String>> fieldEntry : connection.getHeaderFields().entrySet()) {
    String nameString=fieldEntry.getKey();
    for (    String value : fieldEntry.getValue()) {
      headers.add(new Header(nameString,value));
    }
  }
  return headers;
}

Fixed version (ground truth):
/** 
 * Read response header to   {@link List}
 * @return {@link List} of {@link Header}
 */
private List<Header> getResponseHeaders(){
  List<Header> headers=new ArrayList<Header>();
  for (  Map.Entry<String,List<String>> fieldEntry : connection.getHeaderFields().entrySet()) {
    String nameString=fieldEntry.getKey();
    for (    String value : fieldEntry.getValue()) {
      Logger.log("String_Node_Str" + nameString + "String_Node_Str"+ value);
      headers.add(new Header(nameString,value));
    }
  }
  return headers;
}
Program: 24404
Project: 24404
Buggy source:
/** 
 * Setup   {@link HttpURLConnection} to remote urlset some configuration and body if exist
 * @param request
 * @throws MalformedURLException
 * @throws IOException
 */
private void setupHttpUrlConnectionClient(HttpURLConnection connection,Request request) throws MalformedURLException, IOException {
  connection.setDoInput(true);
  addHeaders(request.getHeaders());
  if (request.hasBody()) {
    connection.setDoOutput(true);
    OutputStream os=connection.getOutputStream();
    BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(os,"String_Node_Str"));
    bw.write(writeBodyParams(request.getBodyParams()));
    bw.flush();
    bw.close();
    os.close();
  }
}

Fixed version (ground truth):
/** 
 * Setup   {@link HttpURLConnection} to remote urlset some configuration and body if exist
 * @param request
 * @throws MalformedURLException
 * @throws IOException
 */
private void setupHttpUrlConnectionClient(HttpURLConnection connection,Request request) throws MalformedURLException, IOException {
  connection.setDoInput(true);
  Logger.log("String_Node_Str" + request.getHeaders().size() + "String_Node_Str");
  addHeaders(request.getHeaders());
  if (request.hasBody()) {
    connection.setDoOutput(true);
    OutputStream os=connection.getOutputStream();
    BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(os,"String_Node_Str"));
    bw.write(writeBodyParams(request.getBodyParams()));
    bw.flush();
    bw.close();
    os.close();
  }
}
Program: 24405
Project: 24405
Buggy source:
/** 
 * Writes body parameters to as %s=%s url encoded format
 * @param bodyParams
 * @return {@link String}
 * @throws UnsupportedEncodingException
 */
private String writeBodyParams(List<NameValuePair> bodyParams) throws UnsupportedEncodingException {
  StringBuilder bodyBuilder=new StringBuilder();
  for (  NameValuePair param : bodyParams) {
    bodyBuilder.append(URLEncoder.encode(param.getName(),"String_Node_Str"));
    bodyBuilder.append("String_Node_Str");
    bodyBuilder.append(URLEncoder.encode(param.getValue(),"String_Node_Str"));
  }
  return bodyBuilder.toString();
}

Fixed version (ground truth):
/** 
 * Writes body parameters to as %s=%s url encoded format
 * @param bodyParams
 * @return {@link String}
 * @throws UnsupportedEncodingException
 */
private String writeBodyParams(List<NameValuePair> bodyParams) throws UnsupportedEncodingException {
  StringBuilder bodyBuilder=new StringBuilder();
  for (  NameValuePair param : bodyParams) {
    bodyBuilder.append(URLEncoder.encode(param.getName(),"String_Node_Str"));
    bodyBuilder.append("String_Node_Str");
    bodyBuilder.append(URLEncoder.encode(param.getValue(),"String_Node_Str"));
  }
  Logger.log("String_Node_Str" + bodyBuilder.toString());
  return bodyBuilder.toString();
}
Program: 24406
Project: 24406
Buggy source:
@Override public Response execute(Request request) throws IOException {
  if (request == null)   throw new IllegalArgumentException("String_Node_Str");
  Logger.log(HttpUrlConnectionClient.class,request.toString());
  setupCookieManager();
  connection=openHttpURLConnection(request);
  setupHttpUrlConnectionClient(connection,request);
  return getResponse();
}

Fixed version (ground truth):
@Override public Response execute(Request request) throws IOException {
  if (request == null)   throw new IllegalArgumentException("String_Node_Str");
  Logger.log(request.toString());
  setupCookieManager();
  connection=openHttpURLConnection(request);
  setupHttpUrlConnectionClient(connection,request);
  return getResponse();
}
Program: 24407
Project: 24407
Buggy source:
/** 
 * Creates a compound converter resulting from the combined transformation of the specified converters.
 * @param left the left converter.
 * @param right the right converter.
 * @throws IllegalArgumentException if either the left or right converter are </code>null</code>
 */
public Pair(UnitConverter left,UnitConverter right){
  this.left=left;
  this.right=right;
}

Fixed version (ground truth):
/** 
 * Creates a compound converter resulting from the combined transformation of the specified converters.
 * @param left the left converter.
 * @param right the right converter.
 * @throws IllegalArgumentException if either the left or right converter are <code>null</code>
 */
public Pair(UnitConverter left,UnitConverter right){
  this.left=left;
  this.right=right;
}
Program: 24408
Project: 24408
Buggy source:
/** 
 * Casts this quantity to a parameterized unit of specified nature or throw a <code>ClassCastException</code> if the dimension of the specified quantity and this measure unit's dimension do not match. For example: <br/> <code> Measure<Length> length = Quantities.getQuantity("2 km").asType(Length.class); </code>
 * @param type the quantity class identifying the nature of the quantity.
 * @return this quantity parameterized with the specified type.
 * @throws ClassCastException if the dimension of this unit is different from the specified quantity dimension.
 * @throws UnsupportedOperationException if the specified quantity class does not have a public static field named "UNIT" holding the SI unit for the quantity.
 * @see Unit#asType(Class)
 */
@SuppressWarnings("String_Node_Str") public final <T extends Quantity<T>>Quantity<T> asType(Class<T> type) throws ClassCastException {
  this.getUnit().asType(type);
  return (Quantity<T>)this;
}

Fixed version (ground truth):
/** 
 * Casts this quantity to a parameterized unit of specified nature or throw a <code>ClassCastException</code> if the dimension of the specified quantity and this measure unit's dimension do not match. For example: <br> <code> Measure&lt;Length&gt; length = Quantities.getQuantity("2 km").asType(Length.class); </code>
 * @param type the quantity class identifying the nature of the quantity.
 * @return this quantity parameterized with the specified type.
 * @throws ClassCastException if the dimension of this unit is different from the specified quantity dimension.
 * @throws UnsupportedOperationException if the specified quantity class does not have a public static field named "UNIT" holding the SI unit for the quantity.
 * @see Unit#asType(Class)
 */
@SuppressWarnings("String_Node_Str") public final <T extends Quantity<T>>Quantity<T> asType(Class<T> type) throws ClassCastException {
  this.getUnit().asType(type);
  return (Quantity<T>)this;
}
Program: 24409
Project: 24409
Buggy source:
/** 
 * Annotates the specified unit. Annotation does not change the unit semantic. Annotations are often written between curly braces behind units. For example: <code> Unit<Volume> PERCENT_VOL = Units.PERCENT.annotate("vol"); // "%{vol}" AbstractUnit<Mass> KG_TOTAL = Units.KILOGRAM.annotate("total"); // "kg{total}" AbstractUnit<Dimensionless> RED_BLOOD_CELLS = ONE.annotate("RBC"); // "{RBC}" </code> Note: Annotations of system units are not considered themselves as system units.
 * @param annotation the unit annotation.
 * @return the annotated unit.
 */
public AnnotatedUnit<Q> annotate(String annotation){
  return new AnnotatedUnit<Q>(this,annotation);
}

Fixed version (ground truth):
/** 
 * Annotates the specified unit. Annotation does not change the unit semantic. Annotations are often written between curly braces behind units. For example: <code> Unit&lt;Volume&gt; PERCENT_VOL = Units.PERCENT.annotate("vol"); // "%{vol}" AbstractUnit&lt;Mass&gt; KG_TOTAL = Units.KILOGRAM.annotate("total"); // "kg{total}" AbstractUnit&lt;Dimensionless&gt; RED_BLOOD_CELLS = ONE.annotate("RBC"); // "{RBC}" </code> Note: Annotations of system units are not considered themselves as system units.
 * @param annotation the unit annotation.
 * @return the annotated unit.
 */
public AnnotatedUnit<Q> annotate(String annotation){
  return new AnnotatedUnit<Q>(this,annotation);
}
Program: 24410
Project: 24410
Buggy source:
/** 
 * Returns the system unit (unscaled SI unit) from which this unit is derived. They can be be used to identify a quantity given the unit. For example:[code] static boolean isAngularVelocity(AbstractUnit<?> unit) { return unit.getSystemUnit().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. [/code]
 * @return the unscaled metric unit from which this unit is derived.
 */
public final AbstractUnit<Q> getSystemUnit(){
  return toSystemUnit();
}

Fixed version (ground truth):
/** 
 * Returns the system unit (unscaled SI unit) from which this unit is derived. They can be be used to identify a quantity given the unit. For example:[code] static boolean isAngularVelocity(AbstractUnit&lt;?&gt; unit) { return unit.getSystemUnit().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. [/code]
 * @return the unscaled metric unit from which this unit is derived.
 */
public final AbstractUnit<Q> getSystemUnit(){
  return toSystemUnit();
}
Program: 24411
Project: 24411
Buggy source:
/** 
 * Returns the unscaled standard (SI) unit from which this unit is derived. The SI unit can be be used to identify a quantity given the unit. For example:<code> static boolean isAngularVelocity(AbstractUnit<?> unit) { return unit.toSystemUnit().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. </code>
 * @return the unscaled metric unit from which this unit is derived.
 */
protected abstract AbstractUnit<Q> toSystemUnit();

Fixed version (ground truth):
/** 
 * Returns the unscaled standard (SI) unit from which this unit is derived. The SI unit can be be used to identify a quantity given the unit. For example:<code> static boolean isAngularVelocity(AbstractUnit&lt;?&gt; unit) { return unit.toSystemUnit().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. </code>
 * @return the unscaled metric unit from which this unit is derived.
 */
protected abstract AbstractUnit<Q> toSystemUnit();
Program: 24412
Project: 24412
Buggy source:
/** 
 * Returns the physics unit represented by the specified characters. Locale-sensitive unit parsing may be handled using the OSGi   {@link javax.measure.spi.UnitFormatService} or for non-OSGi applications instances of{@link SimpleUnitFormat}. <p> Note: The standard format supports dimensionless units.[code] AbstractUnit<Dimensionless> PERCENT = AbstractUnit.parse("100").inverse().asType(Dimensionless.class); [/code] </p>
 * @param charSequence the character sequence to parse.
 * @return <code>SimpleUnitFormat.getInstance().parse(csq)</code>
 * @throws ParserException if the specified character sequence cannot be parsed correctly.
 */
public static Unit<?> parse(CharSequence charSequence){
  return SimpleUnitFormat.getInstance().parse(charSequence);
}

Fixed version (ground truth):
/** 
 * Returns the physics unit represented by the specified characters. Locale-sensitive unit parsing may be handled using the OSGi   {@link javax.measure.spi.UnitFormatService} or for non-OSGi applications instances of{@link SimpleUnitFormat}. <p> Note: The standard format supports dimensionless units.[code] AbstractUnit&lt;Dimensionless&gt; PERCENT = AbstractUnit.parse("100").inverse().asType(Dimensionless.class); [/code] </p>
 * @param charSequence the character sequence to parse.
 * @return <code>SimpleUnitFormat.getInstance().parse(csq)</code>
 * @throws ParserException if the specified character sequence cannot be parsed correctly.
 */
public static Unit<?> parse(CharSequence charSequence){
  return SimpleUnitFormat.getInstance().parse(charSequence);
}
Program: 24413
Project: 24413
Buggy source:
/** 
 * Returns the decimal quantity of unknown type corresponding to the specified representation. This method can be used to parse dimensionless quantities.<br/> <code> Quantity<Dimensionless> proportion = NumberQuantity.parse("0.234").asType(Dimensionless.class); </code> <p> Note: This method handles only   {@link tec.units.ri.SimpleUnitFormat.UnitFormat#getStandard standard} unit format.</p>
 * @param csq the decimal value and its unit (if any) separated by space(s).
 * @return <code>QuantityFormat.getInstance().parse(csq)</code>
 */
public static Quantity<?> parse(CharSequence csq){
  return QuantityFormat.getInstance().parse(csq);
}

Fixed version (ground truth):
/** 
 * Returns the decimal quantity of unknown type corresponding to the specified representation. This method can be used to parse dimensionless quantities.<br> <code> Quantity&lt;Dimensionless&gt; proportion = NumberQuantity.parse("0.234").asType(Dimensionless.class); </code> <p> Note: This method handles only   {@link tec.units.ri.SimpleUnitFormat.UnitFormat#getStandard standard} unit format.</p>
 * @param csq the decimal value and its unit (if any) separated by space(s).
 * @return <code>QuantityFormat.getInstance().parse(csq)</code>
 */
public static Quantity<?> parse(CharSequence csq){
  return QuantityFormat.getInstance().parse(csq);
}
Program: 24415
Project: 24415
Buggy source:
@Override public void onZoomChange(int zoomValue,boolean stopped,Camera camera){
}

Fixed version (ground truth):
@Override public synchronized void onZoomChange(int zoomValue,boolean stopped,Camera camera){
}
Program: 24416
Project: 24416
Buggy source:
/** 
 * Handle glass tap gestures
 */
@Override public boolean onGesture(Gesture g){
switch (g) {
case TAP:
    if (cameraMode == CAMERA_MODE.PHOTO_MODE) {
      String s=mCamera.getParameters().getFocusMode();
      if (!s.equalsIgnoreCase("String_Node_Str")) {
        mCamera.autoFocus(new AutoFocusCallback(){
          @Override public void onAutoFocus(          boolean success,          Camera camera){
            if (success)             camera.takePicture(null,null,mPictureCallback);
          }
        }
);
      }
 else {
        mCamera.takePicture(null,null,mPictureCallback);
      }
    }
 else {
      Intent intent=new Intent();
      intent.putExtra(CuxtomIntent.FILE_PATH,videofile.getPath());
      intent.putExtra(CuxtomIntent.FILE_TYPE,FILE_TYPE.VIDEO);
      setResult(RESULT_OK,intent);
      finish();
    }
  return true;
case SWIPE_RIGHT:
if (enablezoom) mPreview.zoomIn();
return true;
case SWIPE_LEFT:
if (enablezoom) mPreview.zoomOut();
return true;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * Handle glass tap gestures
 */
@Override public synchronized boolean onGesture(Gesture g){
switch (g) {
case TAP:
    if (cameraMode == CAMERA_MODE.PHOTO_MODE) {
      String s=mCamera.getParameters().getFocusMode();
      if (!s.equalsIgnoreCase("String_Node_Str")) {
        mCamera.autoFocus(new AutoFocusCallback(){
          @Override public void onAutoFocus(          boolean success,          Camera camera){
            if (success)             camera.takePicture(null,null,mPictureCallback);
          }
        }
);
      }
 else {
        mCamera.takePicture(null,null,mPictureCallback);
      }
    }
 else {
      Intent intent=new Intent();
      intent.putExtra(CuxtomIntent.FILE_PATH,videofile.getPath());
      intent.putExtra(CuxtomIntent.FILE_TYPE,FILE_TYPE.VIDEO);
      setResult(RESULT_OK,intent);
      finish();
    }
  return true;
case SWIPE_RIGHT:
if (enablezoom) mPreview.zoomIn();
return true;
case SWIPE_LEFT:
if (enablezoom) mPreview.zoomOut();
return true;
default :
return false;
}
}
Program: 24417
Project: 24417
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.e(tag,"String_Node_Str");
  mSoundEffects=new SoundEffectPlayer();
  mSoundEffects.setup(this);
  LoadExtras(getIntent());
  Log.e(tag,"String_Node_Str");
  loadUI();
  Log.e(tag,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.e(tag,"String_Node_Str");
  mSoundEffects=new SoundEffectPlayer();
  mSoundEffects.setup(this);
  loadExtras(getIntent());
  Log.e(tag,"String_Node_Str");
  loadUI();
  Log.e(tag,"String_Node_Str");
}
Program: 24418
Project: 24418
Buggy source:
/** 
 * Create a sub directory to save photos and videos
 */
private void createSubDirectory(){
  if (cameraMode == CAMERA_MODE.PHOTO_MODE) {
    folderPath=folderPath + File.separator + PHOTO_DIRECTORY;
  }
 else {
    folderPath=folderPath + File.separator + VIDEO_DIRECTORY;
  }
}

Fixed version (ground truth):
/** 
 * Create a sub directory to save photos and videos
 */
private void createSubDirectory(){
  if (cameraMode == CAMERA_MODE.VIDEO_MODE) {
    folderPath=folderPath + File.separator + VIDEO_DIRECTORY;
  }
 else {
    folderPath=folderPath + File.separator + PHOTO_DIRECTORY;
  }
}
Program: 24419
Project: 24419
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  if (mCamera != null) {
    mCamera.stopPreview();
    mCamera.release();
    mCamera=null;
  }
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  if (mCamera != null) {
    mCamera.stopPreview();
    mCamera.release();
    mCamera=null;
  }
  mHolder=null;
}
Program: 24420
Project: 24420
Buggy source:
@Override public void surfaceCreated(SurfaceHolder holder){
  if (mCamera != null) {
    try {
      if (mCamera.getParameters().isZoomSupported()) {
        mCamera.setZoomChangeListener(this);
        zoomOffset=mCamera.getParameters().getMaxZoom() / 4;
      }
      mCamera.setPreviewDisplay(holder);
      mCamera.startPreview();
    }
 catch (    IOException e) {
      Log.e("String_Node_Str",e.getMessage());
    }
  }
}

Fixed version (ground truth):
@Override public synchronized void surfaceCreated(SurfaceHolder holder){
  if (mCamera != null) {
    try {
      if (mCamera.getParameters().isZoomSupported()) {
        mCamera.setZoomChangeListener(this);
        zoomOffset=mCamera.getParameters().getMaxZoom() / 4;
      }
      mCamera.setPreviewDisplay(holder);
      mCamera.startPreview();
    }
 catch (    IOException e) {
      Log.e("String_Node_Str",e.getMessage());
    }
  }
}
Program: 24421
Project: 24421
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mSoundEffects=new SoundEffectPlayer();
  mSoundEffects.setup(this);
  LoadExtras(getIntent());
  loadUI();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.e(tag,"String_Node_Str");
  mSoundEffects=new SoundEffectPlayer();
  mSoundEffects.setup(this);
  LoadExtras(getIntent());
  Log.e(tag,"String_Node_Str");
  loadUI();
  Log.e(tag,"String_Node_Str");
}
Program: 24422
Project: 24422
Buggy source:
/** 
 * Handle glass tap gestures
 */
@Override public synchronized boolean onGesture(Gesture g){
switch (g) {
case TAP:
    if (cameraMode == CAMERA_MODE.PHOTO_MODE) {
      mOverlay.setMode(CameraOverlay.Mode.FOCUS);
      mCamera.takePicture(null,null,mPictureCallback);
      mSoundEffects.shutter();
    }
 else {
      try {
        recorder.stop();
      }
 catch (      Exception e) {
        Log.e("String_Node_Str",e.getMessage());
      }
      mExecutorService.shutdown();
      mCamera.stopPreview();
      mSoundEffects.camcorderStop();
      mOverlay.setMode(Mode.PLAIN);
      Intent intent=new Intent();
      intent.putExtra(CuxtomIntent.FILE_PATH,videofile.getPath());
      intent.putExtra(CuxtomIntent.FILE_TYPE,FILE_TYPE.VIDEO);
      setResult(RESULT_OK,intent);
      MediaScannerConnection.scanFile(getApplicationContext(),new String[]{videofile.getPath()},null,CuxtomCamActivity.this);
    }
  return true;
case SWIPE_RIGHT:
if (enablezoom) mPreview.zoomIn();
return true;
case SWIPE_LEFT:
if (enablezoom) mPreview.zoomOut();
return true;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * Handle glass tap gestures
 */
@Override public synchronized boolean onGesture(Gesture g){
switch (g) {
case TAP:
    if (cameraMode == CAMERA_MODE.PHOTO_MODE) {
      mOverlay.setMode(CameraOverlay.Mode.FOCUS);
      mCamera.takePicture(null,null,mPictureCallback);
      mSoundEffects.shutter();
    }
 else {
      try {
        recorder.stop();
      }
 catch (      Exception e) {
        Log.e("String_Node_Str",e.getMessage());
      }
      mExecutorService.shutdown();
      mCamera.stopPreview();
      try {
        mCamera.reconnect();
      }
 catch (      IOException e) {
        Log.e("String_Node_Str",e.getMessage());
      }
      mSoundEffects.camcorderStop();
      mOverlay.setMode(Mode.PLAIN);
      Intent intent=new Intent();
      intent.putExtra(CuxtomIntent.FILE_PATH,videofile.getPath());
      intent.putExtra(CuxtomIntent.FILE_TYPE,FILE_TYPE.VIDEO);
      setResult(RESULT_OK,intent);
      MediaScannerConnection.scanFile(getApplicationContext(),new String[]{videofile.getPath()},null,CuxtomCamActivity.this);
    }
  return true;
case SWIPE_RIGHT:
if (enablezoom) mPreview.zoomIn();
return true;
case SWIPE_LEFT:
if (enablezoom) mPreview.zoomOut();
return true;
default :
return false;
}
}
Program: 24423
Project: 24423
Buggy source:
@Override public void onScanCompleted(String path,Uri uri){
  releaseMediaRecorder();
  System.gc();
  CuxtomCamActivity.this.finish();
}

Fixed version (ground truth):
@Override public void onScanCompleted(String path,Uri uri){
  releaseMediaRecorder();
  previewCameraLayout.removeAllViewsInLayout();
  CuxtomCamActivity.this.finish();
  System.gc();
  Log.e(tag,"String_Node_Str");
}
Program: 24424
Project: 24424
Buggy source:
@Override public void run(){
  startVideoRecorder();
  mSoundEffects.camcorder();
  initVideoRecordingUI();
}

Fixed version (ground truth):
@Override public void run(){
  Log.e(tag,"String_Node_Str");
  mCamera.stopPreview();
  mCamera.unlock();
  startVideoRecorder();
  Log.e(tag,"String_Node_Str");
  mSoundEffects.camcorder();
  initVideoRecordingUI();
  Log.e(tag,"String_Node_Str");
}
Program: 24425
Project: 24425
Buggy source:
private void releaseMediaRecorder(){
  if (recorder != null) {
    recorder.reset();
    recorder.release();
    recorder=null;
    mCamera=null;
  }
}

Fixed version (ground truth):
private void releaseMediaRecorder(){
  if (recorder != null) {
    recorder.reset();
    recorder.release();
    recorder=null;
  }
  mCamera=null;
  mPreview.surfaceDestroyed(null);
}
Program: 24427
Project: 24427
Buggy source:
@Override public void onInfo(MediaRecorder mr,int what,int extra){
  if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED) {
    mExecutorService.shutdown();
    mCamera.stopPreview();
    mSoundEffects.camcorderStop();
    mOverlay.setMode(Mode.PLAIN);
    Intent intent=new Intent();
    intent.putExtra(CuxtomIntent.FILE_PATH,videofile.getPath());
    intent.putExtra(CuxtomIntent.FILE_TYPE,FILE_TYPE.VIDEO);
    setResult(RESULT_OK,intent);
    MediaScannerConnection.scanFile(CuxtomCamActivity.this,new String[]{videofile.getPath()},null,CuxtomCamActivity.this);
  }
}

Fixed version (ground truth):
@Override public void onInfo(MediaRecorder mr,int what,int extra){
  if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED) {
    mExecutorService.shutdown();
    mCamera.stopPreview();
    try {
      mCamera.reconnect();
    }
 catch (    IOException e) {
      Log.e("String_Node_Str",e.getMessage());
    }
    mSoundEffects.camcorderStop();
    mOverlay.setMode(Mode.PLAIN);
    Intent intent=new Intent();
    intent.putExtra(CuxtomIntent.FILE_PATH,videofile.getPath());
    intent.putExtra(CuxtomIntent.FILE_TYPE,FILE_TYPE.VIDEO);
    setResult(RESULT_OK,intent);
    MediaScannerConnection.scanFile(CuxtomCamActivity.this,new String[]{videofile.getPath()},null,CuxtomCamActivity.this);
  }
}
Program: 24428
Project: 24428
Buggy source:
@Override public void onCameraInit(){
  if (cameraMode == CAMERA_MODE.VIDEO_MODE) {
    mOverlay.setMode(Mode.RECORDING);
    new Handler().postDelayed(new Runnable(){
      @Override public void run(){
        startVideoRecorder();
        mSoundEffects.camcorder();
        initVideoRecordingUI();
      }
    }
,1000);
  }
}

Fixed version (ground truth):
@Override public synchronized void onCameraInit(){
  Log.e(tag,"String_Node_Str");
  if (cameraMode == CAMERA_MODE.VIDEO_MODE) {
    Log.e(tag,"String_Node_Str");
    runOnUiThread(new Runnable(){
      @Override public void run(){
        Log.e(tag,"String_Node_Str");
        mCamera.stopPreview();
        mCamera.unlock();
        startVideoRecorder();
        Log.e(tag,"String_Node_Str");
        mSoundEffects.camcorder();
        initVideoRecordingUI();
        Log.e(tag,"String_Node_Str");
      }
    }
);
  }
}