nus-yam/ex-repair huggingface dataset:
Program: 163501
Project: 163501
Buggy source:
/** 
 * Parses the next record from the input. Note that   {@link AbstractParser#beginParsing(Reader)} must have been invoked once before calling this method.If the end of the input is reached, then this method will return null. Additionally, all resources will be closed automatically at the end of the input or if any error happens while parsing.
 * @return The record parsed from the input or null if there's no more characters to read.
 */
public final String[] parseNext(){
  try {
    while (!context.stopped) {
      ch=input.nextChar();
      if (ch == comment) {
        input.skipLines(1);
        continue;
      }
      output.clear();
      parseRecord();
      String[] row=output.rowParsed();
      if (row != null) {
        if (recordsToRead > 0 && context.currentRecord() >= recordsToRead) {
          context.stop();
        }
        return row;
      }
    }
    stopParsing();
    return null;
  }
 catch (  EOFException ex) {
    if (output.appender.length() > 0) {
      output.valueParsed();
    }
    String[] row=output.rowParsed();
    stopParsing();
    return row;
  }
catch (  Exception ex) {
    try {
      throw new TextParsingException(context,ex);
    }
  finally {
      stopParsing();
    }
  }
}

Fixed version (ground truth):
/** 
 * Parses the next record from the input. Note that   {@link AbstractParser#beginParsing(Reader)} must have been invoked once before calling this method.If the end of the input is reached, then this method will return null. Additionally, all resources will be closed automatically at the end of the input or if any error happens while parsing.
 * @return The record parsed from the input or null if there's no more characters to read.
 */
public final String[] parseNext(){
  try {
    while (!context.stopped && (ch=input.nextChar()) != '\0') {
      if (ch == comment) {
        input.skipLines(1);
        continue;
      }
      output.clear();
      parseRecord();
      String[] row=output.rowParsed();
      if (row != null) {
        if (recordsToRead > 0 && context.currentRecord() >= recordsToRead) {
          context.stop();
        }
        return row;
      }
    }
    stopParsing();
    return null;
  }
 catch (  Exception ex) {
    try {
      throw new TextParsingException(context,ex);
    }
  finally {
      stopParsing();
    }
  }
}
Program: 163502
Project: 163502
Buggy source:
/** 
 * Gets all values parsed in the   {@link ParserOutput#parsedValues} array
 * @return the sequence of parsed values in a record.
 */
String[] rowParsed(){
  if (column > 0) {
    if (!columnsToExtractInitialized) {
      initializeHeaders();
      if (settings.isHeaderExtractionEnabled()) {
        Arrays.fill(parsedValues,null);
        column=0;
        return null;
      }
    }
    currentRecord++;
    if (columnsReordered) {
      String[] reorderedValues=new String[selectedIndexes.length];
      for (int i=0; i < selectedIndexes.length; i++) {
        int index=selectedIndexes[i];
        if (index >= column) {
          reorderedValues[i]=nullValue;
        }
 else {
          reorderedValues[i]=parsedValues[index];
        }
      }
      column=0;
      return reorderedValues;
    }
 else {
      String[] out=new String[column];
      System.arraycopy(parsedValues,0,out,0,column);
      column=0;
      return out;
    }
  }
 else   if (!skipEmptyLines) {
    if (!columnsToExtractInitialized) {
      initializeHeaders();
    }
    currentRecord++;
    if (columnsReordered) {
      String[] out=new String[selectedIndexes.length];
      Arrays.fill(out,nullValue);
      return out;
    }
    return ArgumentUtils.EMPTY_STRING_ARRAY;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets all values parsed in the   {@link ParserOutput#parsedValues} array
 * @return the sequence of parsed values in a record.
 */
String[] rowParsed(){
  if (column > 0) {
    if (!columnsToExtractInitialized) {
      initializeHeaders();
      if (settings.isHeaderExtractionEnabled()) {
        Arrays.fill(parsedValues,null);
        return null;
      }
    }
    currentRecord++;
    if (columnsReordered) {
      String[] reorderedValues=new String[selectedIndexes.length];
      for (int i=0; i < selectedIndexes.length; i++) {
        int index=selectedIndexes[i];
        if (index >= column) {
          reorderedValues[i]=nullValue;
        }
 else {
          reorderedValues[i]=parsedValues[index];
        }
      }
      return reorderedValues;
    }
 else {
      String[] out=new String[column];
      System.arraycopy(parsedValues,0,out,0,column);
      return out;
    }
  }
 else   if (!skipEmptyLines) {
    if (!columnsToExtractInitialized) {
      initializeHeaders();
    }
    currentRecord++;
    if (columnsReordered) {
      String[] out=new String[selectedIndexes.length];
      Arrays.fill(out,nullValue);
      return out;
    }
    return ArgumentUtils.EMPTY_STRING_ARRAY;
  }
  return null;
}
Program: 163503
Project: 163503
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final char nextChar(){
  if (length == -1) {
    throw new EOFException();
  }
  char ch=buffer[i - 1];
  if (i >= length) {
    if (length != -1) {
      updateBuffer();
    }
 else {
      throw new EOFException();
    }
  }
  i++;
  if (lineSeparator1 == ch && (lineSeparator2 == '\0' || lineSeparator2 == buffer[i - 1])) {
    lineCount++;
    if (lineSeparator2 != '\0') {
      ch=normalizedLineSeparator;
      if (i >= length) {
        if (length != -1) {
          updateBuffer();
        }
 else {
          throw new EOFException();
        }
      }
      if (i < length) {
        i++;
      }
    }
  }
  return ch;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final char nextChar(){
  if (length == -1) {
    return '\0';
  }
  char ch=buffer[i - 1];
  if (i >= length) {
    if (length != -1) {
      updateBuffer();
    }
 else {
      return '\0';
    }
  }
  i++;
  if (lineSeparator1 == ch && (lineSeparator2 == '\0' || lineSeparator2 == buffer[i - 1])) {
    lineCount++;
    if (lineSeparator2 != '\0') {
      ch=normalizedLineSeparator;
      if (i >= length) {
        if (length != -1) {
          updateBuffer();
        }
 else {
          return '\0';
        }
      }
      if (i < length) {
        i++;
      }
    }
  }
  return ch;
}
Program: 163504
Project: 163504
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final void skipLines(int lines){
  if (lines < 1) {
    return;
  }
  int expectedLineCount=this.lineCount + lines;
  char ch='\0';
  try {
    do {
      ch=nextChar();
    }
 while (lineCount < expectedLineCount && ch != '\0');
    if (lineCount < lines) {
      throw new IllegalArgumentException("String_Node_Str" + lines + "String_Node_Str"+ (expectedLineCount - lines)+ "String_Node_Str");
    }
  }
 catch (  EOFException ex) {
    throw new IllegalArgumentException("String_Node_Str" + lines + "String_Node_Str"+ (expectedLineCount - lines)+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final void skipLines(int lines){
  if (lines < 1) {
    return;
  }
  int expectedLineCount=this.lineCount + lines;
  char ch='\0';
  do {
    ch=nextChar();
  }
 while (lineCount < expectedLineCount && ch != '\0');
  if (ch == '\0' && lineCount < lines) {
    throw new IllegalArgumentException("String_Node_Str" + lines + "String_Node_Str"+ (expectedLineCount - lines)+ "String_Node_Str");
  }
}
Program: 163505
Project: 163505
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void parseRecord(){
  if (ch <= ' ' && ignoreLeadingWhitespace) {
    skipWhitespace();
  }
  while (ch != newLine) {
    parseField();
    if (ch != newLine) {
      ch=input.nextChar();
      if (ch == newLine) {
        output.emptyParsed();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void parseRecord(){
  if (ch <= ' ' && ignoreLeadingWhitespace) {
    skipWhitespace();
  }
  while (ch != newLine && ch != '\0') {
    parseField();
    if (ch != newLine) {
      ch=input.nextChar();
      if (ch == newLine) {
        output.emptyParsed();
      }
    }
  }
}
Program: 163506
Project: 163506
Buggy source:
private void parseQuotedValue(){
  char prev='\0';
  ch=input.nextChar();
  while (!(prev == quote && (ch == delimiter || ch <= ' '))) {
    if (ch != quote) {
      output.appender.append(ch);
      prev=ch;
    }
 else     if (prev == quoteEscape) {
      output.appender.append(quote);
      prev='\0';
    }
 else {
      prev=ch;
    }
    ch=input.nextChar();
  }
  if (ch <= ' ') {
    skipWhitespace();
  }
}

Fixed version (ground truth):
private void parseQuotedValue(){
  char prev='\0';
  ch=input.nextChar();
  while (!(prev == quote && (ch == delimiter || ch <= ' ')) && ch != '\0') {
    if (ch != quote) {
      output.appender.append(ch);
      prev=ch;
    }
 else     if (prev == quoteEscape) {
      output.appender.append(quote);
      prev='\0';
    }
 else {
      prev=ch;
    }
    ch=input.nextChar();
  }
  if (ch <= ' ') {
    skipWhitespace();
  }
}
Program: 163507
Project: 163507
Buggy source:
private void parseValue(){
  if (ignoreTrailingWhitespace) {
    while (ch != delimiter && ch != newLine) {
      output.appender.appendIgnoringWhitespace(ch);
      ch=input.nextChar();
    }
  }
 else {
    while (ch != delimiter && ch != newLine) {
      output.appender.append(ch);
      ch=input.nextChar();
    }
  }
}

Fixed version (ground truth):
private void parseValue(){
  if (ignoreTrailingWhitespace) {
    while (ch != delimiter && ch != newLine && ch != '\0') {
      output.appender.appendIgnoringWhitespace(ch);
      ch=input.nextChar();
    }
  }
 else {
    while (ch != delimiter && ch != newLine && ch != '\0') {
      output.appender.append(ch);
      ch=input.nextChar();
    }
  }
}
Program: 163508
Project: 163508
Buggy source:
private void skipWhitespace(){
  while (ch <= ' ' && ch != delimiter && ch != newLine) {
    ch=input.nextChar();
  }
}

Fixed version (ground truth):
private void skipWhitespace(){
  while (ch <= ' ' && ch != delimiter && ch != newLine && ch != '\0') {
    ch=input.nextChar();
  }
}
Program: 163509
Project: 163509
Buggy source:
private void readValueUntilNewLine(){
  if (ignoreTrailingWhitespace) {
    while (length-- > 0 && ch != newLine) {
      output.appender.appendIgnoringWhitespaceAndPadding(ch);
      ch=input.nextChar();
    }
  }
 else {
    while (length-- > 0 && ch != newLine) {
      output.appender.appendIgnoringPadding(ch);
      ch=input.nextChar();
    }
  }
}

Fixed version (ground truth):
private void readValueUntilNewLine(){
  if (ignoreTrailingWhitespace) {
    while (length-- > 0 && ch != newLine && ch != '\0') {
      output.appender.appendIgnoringWhitespaceAndPadding(ch);
      ch=input.nextChar();
    }
  }
 else {
    while (length-- > 0 && ch != newLine && ch != '\0') {
      output.appender.appendIgnoringPadding(ch);
      ch=input.nextChar();
    }
  }
}
Program: 163510
Project: 163510
Buggy source:
private void readValue(){
  if (ignoreTrailingWhitespace) {
    while (length-- > 0) {
      output.appender.appendIgnoringWhitespaceAndPadding(ch);
      ch=input.nextChar();
    }
  }
 else {
    while (length-- > 0) {
      output.appender.appendIgnoringPadding(ch);
      ch=input.nextChar();
    }
  }
}

Fixed version (ground truth):
private void readValue(){
  if (ignoreTrailingWhitespace) {
    while (length-- > 0 && ch != '\0') {
      output.appender.appendIgnoringWhitespaceAndPadding(ch);
      ch=input.nextChar();
    }
  }
 else {
    while (length-- > 0 && ch != '\0') {
      output.appender.appendIgnoringPadding(ch);
      ch=input.nextChar();
    }
  }
}
Program: 163511
Project: 163511
Buggy source:
private void skipToNewLine(){
  while (ch != newLine) {
    ch=input.nextChar();
  }
}

Fixed version (ground truth):
private void skipToNewLine(){
  while (ch != newLine && ch != '\0') {
    ch=input.nextChar();
  }
}
Program: 163512
Project: 163512
Buggy source:
private void skipPadding(){
  while (ch == padding && length-- > 0) {
    ch=input.nextChar();
  }
}

Fixed version (ground truth):
private void skipPadding(){
  while (ch == padding && length-- > 0 && ch != '\0') {
    ch=input.nextChar();
  }
}
Program: 163513
Project: 163513
Buggy source:
private void skipWhitespace(){
  while (ch <= ' ' && length-- > 0) {
    ch=input.nextChar();
  }
}

Fixed version (ground truth):
private void skipWhitespace(){
  while (ch <= ' ' && length-- > 0 && ch != '\0') {
    ch=input.nextChar();
  }
}
Program: 163515
Project: 163515
Buggy source:
@Test public void inputContextWithLifespanTest() throws AIServiceException {
  final AIDataService aiDataService=createDataService();
  final AIContext weatherContext=new AIContext("String_Node_Str");
  weatherContext.setParameters(Collections.singletonMap("String_Node_Str","String_Node_Str"));
  weatherContext.setLifespan(3);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  aiRequest.setContexts(Collections.singletonList(weatherContext));
  final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
  assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
  assertNotNull(aiResponse.getResult().getContext("String_Node_Str"));
  AIResponse nextResponse=null;
  for (int i=0; i < 2; i++) {
    nextResponse=makeRequest(aiDataService,new AIRequest("String_Node_Str"));
  }
  assertNotNull(nextResponse.getResult().getContext("String_Node_Str"));
  nextResponse=makeRequest(aiDataService,new AIRequest("String_Node_Str"));
  assertNull(nextResponse.getResult().getContext("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void inputContextWithLifespanTest() throws AIServiceException {
  final AIDataService aiDataService=createDataService();
  final AIContext weatherContext=new AIContext("String_Node_Str");
  weatherContext.setParameters(Collections.singletonMap("String_Node_Str","String_Node_Str"));
  weatherContext.setLifespan(3);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  aiRequest.setContexts(Collections.singletonList(weatherContext));
  final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
  assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
  assertNotNull(aiResponse.getResult().getContext("String_Node_Str"));
  AIResponse nextResponse=null;
  for (int i=0; i < 1; i++) {
    nextResponse=makeRequest(aiDataService,new AIRequest("String_Node_Str"));
  }
  assertNotNull(nextResponse.getResult().getContext("String_Node_Str"));
  nextResponse=makeRequest(aiDataService,new AIRequest("String_Node_Str"));
  assertNull(nextResponse.getResult().getContext("String_Node_Str"));
}
Program: 163516
Project: 163516
Buggy source:
public AIConfiguration(final String clientAccessToken,final SupportedLanguages language,final RecognitionEngine recognitionEngine){
  super(clientAccessToken);
  this.recognitionEngine=recognitionEngine;
  if (recognitionEngine == RecognitionEngine.Speaktoit && language == SupportedLanguages.Korean) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}

Fixed version (ground truth):
public AIConfiguration(final String clientAccessToken,final SupportedLanguages language,final RecognitionEngine recognitionEngine){
  super(clientAccessToken,language);
  this.recognitionEngine=recognitionEngine;
  if (recognitionEngine == RecognitionEngine.Speaktoit && language == SupportedLanguages.Korean) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}
Program: 163517
Project: 163517
Buggy source:
protected boolean checkPermissions(){
  final int permissionCheck=ContextCompat.checkSelfPermission(context,Manifest.permission.RECORD_AUDIO);
  if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkPermissions(){
  boolean granted=true;
  try {
    granted=ContextCompat.checkSelfPermission(context,Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED;
  }
 catch (  final Exception ignored) {
  }
  return granted;
}
Program: 163518
Project: 163518
Buggy source:
@Override public void onError(final int error){
  if (error == SpeechRecognizer.ERROR_NO_MATCH && isAndroid5()) {
    return;
  }
  if (recognitionActive) {
    recognitionActive=false;
    final AIError aiError;
    if (errorMessages.containsKey(error)) {
      final String description=errorMessages.get(error);
      aiError=new AIError("String_Node_Str" + description);
    }
 else {
      aiError=new AIError("String_Node_Str" + error);
    }
    GoogleRecognitionServiceImpl.this.onError(aiError);
  }
}

Fixed version (ground truth):
@Override public void onError(final int error){
  if (error == SpeechRecognizer.ERROR_NO_MATCH && affectedWithGoogleSearchProblem() && !wasReadyForSpeech) {
    return;
  }
  if (recognitionActive) {
    recognitionActive=false;
    final AIError aiError;
    if (errorMessages.containsKey(error)) {
      final String description=errorMessages.get(error);
      aiError=new AIError("String_Node_Str" + description);
    }
 else {
      aiError=new AIError("String_Node_Str" + error);
    }
    GoogleRecognitionServiceImpl.this.onError(aiError);
  }
}
Program: 163519
Project: 163519
Buggy source:
@Override public void startListening(final RequestExtras requestExtras){
  if (!recognitionActive) {
    this.requestExtras=requestExtras;
    final Intent sttIntent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    final String language=config.getLanguage().replace('-','_');
    sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,language);
    sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE,language);
    sttIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS,true);
    sttIntent.putExtra("String_Node_Str",new String[]{});
    runInUiThread(new Runnable(){
      @Override public void run(){
        initializeRecognizer();
        speechRecognizer.startListening(sttIntent);
        recognitionActive=true;
      }
    }
);
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void startListening(final RequestExtras requestExtras){
  if (!recognitionActive) {
    this.requestExtras=requestExtras;
    final Intent sttIntent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    final String language=config.getLanguage().replace('-','_');
    sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,language);
    sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE,language);
    sttIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS,true);
    sttIntent.putExtra("String_Node_Str",new String[]{});
    runInUiThread(new Runnable(){
      @Override public void run(){
        initializeRecognizer();
        wasReadyForSpeech=false;
        speechRecognizer.startListening(sttIntent);
        recognitionActive=true;
      }
    }
);
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
}
Program: 163520
Project: 163520
Buggy source:
protected void initializeRecognizer(){
synchronized (speechRecognizerLock) {
    if (speechRecognizer != null) {
      speechRecognizer.destroy();
      speechRecognizer=null;
    }
    final ComponentName googleRecognizerComponent=RecognizerChecker.findGoogleRecognizer(context);
    if (googleRecognizerComponent == null) {
      speechRecognizer=SpeechRecognizer.createSpeechRecognizer(context);
    }
 else {
      speechRecognizer=SpeechRecognizer.createSpeechRecognizer(context,googleRecognizerComponent);
    }
    speechRecognizer.setRecognitionListener(new InternalRecognitionListener());
  }
}

Fixed version (ground truth):
protected void initializeRecognizer(){
  if (speechRecognizer != null && affectedWithGoogleSearchProblem()) {
    return;
  }
synchronized (speechRecognizerLock) {
    if (speechRecognizer != null) {
      speechRecognizer.destroy();
      speechRecognizer=null;
    }
    final ComponentName googleRecognizerComponent=RecognizerChecker.findGoogleRecognizer(context);
    if (googleRecognizerComponent == null) {
      speechRecognizer=SpeechRecognizer.createSpeechRecognizer(context);
    }
 else {
      speechRecognizer=SpeechRecognizer.createSpeechRecognizer(context,googleRecognizerComponent);
    }
    speechRecognizer.setRecognitionListener(new InternalRecognitionListener());
  }
}
Program: 163521
Project: 163521
Buggy source:
public GoogleRecognitionServiceImpl(final Context context,final AIConfiguration config){
  super(config,context);
  final ComponentName googleRecognizerComponent=RecognizerChecker.findGoogleRecognizer(context);
  if (googleRecognizerComponent == null) {
    Log.w(TAG,"String_Node_Str");
  }
  handler=new Handler(context.getMainLooper());
}

Fixed version (ground truth):
public GoogleRecognitionServiceImpl(final Context context,final AIConfiguration config){
  super(config,context);
  final ComponentName googleRecognizerComponent=RecognizerChecker.findGoogleRecognizer(context);
  if (googleRecognizerComponent == null) {
    Log.w(TAG,"String_Node_Str");
  }
  handler=new Handler(context.getMainLooper());
  googleRecognizerVersion=RecognizerChecker.getGoogleRecognizerVersion(context);
}
Program: 163522
Project: 163522
Buggy source:
@Override public void onReadyForSpeech(final Bundle params){
  if (recognitionActive) {
    GoogleRecognitionServiceImpl.this.onListeningStarted();
  }
}

Fixed version (ground truth):
@Override public void onReadyForSpeech(final Bundle params){
  if (recognitionActive) {
    GoogleRecognitionServiceImpl.this.onListeningStarted();
  }
  wasReadyForSpeech=true;
}
Program: 163523
Project: 163523
Buggy source:
@Override public void onError(final int error){
  if (error == SpeechRecognizer.ERROR_NO_MATCH && affectedWithGoogleSearchProblem() && !wasReadyForSpeech) {
    return;
  }
  if (recognitionActive) {
    recognitionActive=false;
    final AIError aiError;
    if (errorMessages.containsKey(error)) {
      final String description=errorMessages.get(error);
      aiError=new AIError("String_Node_Str" + description);
    }
 else {
      aiError=new AIError("String_Node_Str" + error);
    }
    GoogleRecognitionServiceImpl.this.onError(aiError);
  }
}

Fixed version (ground truth):
@Override public void onError(final int error){
  if (error == SpeechRecognizer.ERROR_NO_MATCH && !wasReadyForSpeech) {
    return;
  }
  if (recognitionActive) {
    recognitionActive=false;
    final AIError aiError;
    if (errorMessages.containsKey(error)) {
      final String description=errorMessages.get(error);
      aiError=new AIError("String_Node_Str" + description);
    }
 else {
      aiError=new AIError("String_Node_Str" + error);
    }
    GoogleRecognitionServiceImpl.this.onError(aiError);
  }
}
Program: 163524
Project: 163524
Buggy source:
protected void initializeRecognizer(){
  if (speechRecognizer != null && affectedWithGoogleSearchProblem()) {
    return;
  }
synchronized (speechRecognizerLock) {
    if (speechRecognizer != null) {
      speechRecognizer.destroy();
      speechRecognizer=null;
    }
    final ComponentName googleRecognizerComponent=RecognizerChecker.findGoogleRecognizer(context);
    if (googleRecognizerComponent == null) {
      speechRecognizer=SpeechRecognizer.createSpeechRecognizer(context);
    }
 else {
      speechRecognizer=SpeechRecognizer.createSpeechRecognizer(context,googleRecognizerComponent);
    }
    speechRecognizer.setRecognitionListener(new InternalRecognitionListener());
  }
}

Fixed version (ground truth):
protected void initializeRecognizer(){
  if (speechRecognizer != null) {
    return;
  }
synchronized (speechRecognizerLock) {
    if (speechRecognizer != null) {
      speechRecognizer.destroy();
      speechRecognizer=null;
    }
    final ComponentName googleRecognizerComponent=RecognizerChecker.findGoogleRecognizer(context);
    if (googleRecognizerComponent == null) {
      speechRecognizer=SpeechRecognizer.createSpeechRecognizer(context);
    }
 else {
      speechRecognizer=SpeechRecognizer.createSpeechRecognizer(context,googleRecognizerComponent);
    }
    speechRecognizer.setRecognitionListener(new InternalRecognitionListener());
  }
}
Program: 163525
Project: 163525
Buggy source:
public GoogleRecognitionServiceImpl(final Context context,final AIConfiguration config){
  super(config,context);
  final ComponentName googleRecognizerComponent=RecognizerChecker.findGoogleRecognizer(context);
  if (googleRecognizerComponent == null) {
    Log.w(TAG,"String_Node_Str");
  }
  handler=new Handler(context.getMainLooper());
  googleRecognizerVersion=RecognizerChecker.getGoogleRecognizerVersion(context);
}

Fixed version (ground truth):
public GoogleRecognitionServiceImpl(final Context context,final AIConfiguration config){
  super(config,context);
  final ComponentName googleRecognizerComponent=RecognizerChecker.findGoogleRecognizer(context);
  if (googleRecognizerComponent == null) {
    Log.w(TAG,"String_Node_Str");
  }
  handler=new Handler(context.getMainLooper());
}
Program: 163527
Project: 163527
Buggy source:
@Test public void AIDataServiceDevRuTest(){
  if (isExperimentalTest()) {
    final AIConfiguration config=new AIConfiguration("String_Node_Str",getSubscriptionKey(),AIConfiguration.SupportedLanguages.Russian,AIConfiguration.RecognitionEngine.System);
    config.setWriteSoundLog(false);
    config.setExperimental(isExperimentalTest());
    final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
    final AIRequest aiRequest=new AIRequest();
    aiRequest.setQuery("String_Node_Str");
    try {
      final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
      assertFalse(TextUtils.isEmpty(aiResponse.getResult().getResolvedQuery()));
      assertEquals("String_Node_Str",aiResponse.getResult().getAction());
      assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
    }
 catch (    final AIServiceException e) {
      e.printStackTrace();
      assertTrue(e.getMessage(),false);
    }
  }
 else {
    assertTrue(true);
  }
}

Fixed version (ground truth):
@Test public void AIDataServiceDevRuTest(){
  final String devUrl=getDevUrl();
  if (!TextUtils.isEmpty(devUrl)) {
    final AIConfiguration config=new AIConfiguration("String_Node_Str",getSubscriptionKey(),AIConfiguration.SupportedLanguages.Russian,AIConfiguration.RecognitionEngine.System);
    config.setServiceUrl(devUrl);
    config.setWriteSoundLog(false);
    final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
    final AIRequest aiRequest=new AIRequest();
    aiRequest.setQuery("String_Node_Str");
    try {
      final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
      assertFalse(TextUtils.isEmpty(aiResponse.getResult().getResolvedQuery()));
      assertEquals("String_Node_Str",aiResponse.getResult().getAction());
      assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
    }
 catch (    final AIServiceException e) {
      e.printStackTrace();
      assertTrue(e.getMessage(),false);
    }
  }
 else {
    assertTrue(true);
  }
}
Program: 163528
Project: 163528
Buggy source:
@Test public void AIDataServiceDevTest(){
  if (isExperimentalTest()) {
    final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
    config.setWriteSoundLog(false);
    config.setExperimental(isExperimentalTest());
    final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
    final AIRequest aiRequest=new AIRequest();
    aiRequest.setQuery("String_Node_Str");
    try {
      final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
      assertFalse(TextUtils.isEmpty(aiResponse.getResult().getResolvedQuery()));
      assertEquals("String_Node_Str",aiResponse.getResult().getAction());
      assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
    }
 catch (    final AIServiceException e) {
      e.printStackTrace();
      assertTrue(e.getMessage(),false);
    }
  }
 else {
    assertTrue(true);
  }
}

Fixed version (ground truth):
@Test public void AIDataServiceDevTest(){
  final String devUrl=getDevUrl();
  if (!TextUtils.isEmpty(devUrl)) {
    final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
    config.setServiceUrl(devUrl);
    config.setWriteSoundLog(false);
    final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
    final AIRequest aiRequest=new AIRequest();
    aiRequest.setQuery("String_Node_Str");
    try {
      final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
      assertFalse(TextUtils.isEmpty(aiResponse.getResult().getResolvedQuery()));
      assertEquals("String_Node_Str",aiResponse.getResult().getAction());
      assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
    }
 catch (    final AIServiceException e) {
      e.printStackTrace();
      assertTrue(e.getMessage(),false);
    }
  }
 else {
    assertTrue(true);
  }
}
Program: 163529
Project: 163529
Buggy source:
@Test public void testBrazilLanguage(){
  final AIConfiguration config=new AIConfiguration(getPtBrAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.PortugueseBrazil,AIConfiguration.RecognitionEngine.System);
  config.setExperimental(isExperimentalTest());
  try {
    final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
    final AIRequest aiRequest=new AIRequest();
    aiRequest.setQuery("String_Node_Str");
    final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
    assertFalse(TextUtils.isEmpty(aiResponse.getResult().getResolvedQuery()));
    assertEquals("String_Node_Str",aiResponse.getResult().getAction());
    assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}

Fixed version (ground truth):
@Test public void testBrazilLanguage(){
  final AIConfiguration config=new AIConfiguration(getPtBrAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.PortugueseBrazil,AIConfiguration.RecognitionEngine.System);
  updateConfig(config);
  try {
    final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
    final AIRequest aiRequest=new AIRequest();
    aiRequest.setQuery("String_Node_Str");
    final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
    assertFalse(TextUtils.isEmpty(aiResponse.getResult().getResolvedQuery()));
    assertEquals("String_Node_Str",aiResponse.getResult().getAction());
    assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}
Program: 163530
Project: 163530
Buggy source:
@Test public void errorTextRequestTest(){
  final AIConfiguration config=new AIConfiguration("String_Node_Str",getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  config.setExperimental(isExperimentalTest());
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  try {
    final AIResponse aiResponse=aiDataService.request(aiRequest);
    assertTrue("String_Node_Str",false);
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertNotNull(e.getResponse());
    assertEquals("String_Node_Str",e.getResponse().getStatus().getErrorType());
    assertEquals("String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void errorTextRequestTest(){
  final AIConfiguration config=new AIConfiguration("String_Node_Str",getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  updateConfig(config);
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  try {
    final AIResponse aiResponse=aiDataService.request(aiRequest);
    assertTrue("String_Node_Str",false);
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertNotNull(e.getResponse());
    assertEquals("String_Node_Str",e.getResponse().getStatus().getErrorType());
    assertEquals("String_Node_Str",e.getMessage());
  }
}
Program: 163531
Project: 163531
Buggy source:
@Test public void resetContextsTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.Speaktoit);
  config.setExperimental(isExperimentalTest());
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  try {
{
      final AIRequest aiRequest=new AIRequest("String_Node_Str");
      final AIResponse aiResponse=aiDataService.request(aiRequest);
      assertContainsContext(aiResponse,"String_Node_Str");
      final boolean resetSucceed=aiDataService.resetContexts();
      assertTrue(resetSucceed);
    }
{
      final AIRequest aiRequest=new AIRequest("String_Node_Str");
      final AIResponse aiResponse=aiDataService.request(aiRequest);
      assertNotNull(aiResponse);
      assertFalse(aiResponse.getStatus().getErrorDetails(),aiResponse.isError());
      assertNotContainsContext(aiResponse,"String_Node_Str");
    }
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}

Fixed version (ground truth):
@Test public void resetContextsTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.Speaktoit);
  updateConfig(config);
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  try {
{
      final AIRequest aiRequest=new AIRequest("String_Node_Str");
      final AIResponse aiResponse=aiDataService.request(aiRequest);
      assertContainsContext(aiResponse,"String_Node_Str");
      final boolean resetSucceed=aiDataService.resetContexts();
      assertTrue(resetSucceed);
    }
{
      final AIRequest aiRequest=new AIRequest("String_Node_Str");
      final AIResponse aiResponse=aiDataService.request(aiRequest);
      assertNotNull(aiResponse);
      assertFalse(aiResponse.getStatus().getErrorDetails(),aiResponse.isError());
      assertNotContainsContext(aiResponse,"String_Node_Str");
    }
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}
Program: 163532
Project: 163532
Buggy source:
@Test public void outputContextTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  config.setExperimental(isExperimentalTest());
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  try {
    cleanContexts(aiDataService);
    final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
    final String action=aiResponse.getResult().getAction();
    assertEquals("String_Node_Str",action);
    assertNotNull(aiResponse.getResult().getContexts());
    assertContainsContext(aiResponse,"String_Node_Str");
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}

Fixed version (ground truth):
@Test public void outputContextTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  updateConfig(config);
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  try {
    cleanContexts(aiDataService);
    final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
    final String action=aiResponse.getResult().getAction();
    assertEquals("String_Node_Str",action);
    assertNotNull(aiResponse.getResult().getContexts());
    assertContainsContext(aiResponse,"String_Node_Str");
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}
Program: 163533
Project: 163533
Buggy source:
@Test public void testParameters(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  config.setExperimental(isExperimentalTest());
  try {
    final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
    final AIResponse response=aiDataService.request(new AIRequest("String_Node_Str"));
    assertNotNull(response.getResult().getParameters());
    assertFalse(response.getResult().getParameters().isEmpty());
    final AIOutputContext context=response.getResult().getContexts()[0];
    assertNotNull(context.getParameters());
    assertTrue(context.getParameters().containsKey("String_Node_Str"));
    final JsonElement contextParam=context.getParameters().get("String_Node_Str");
    assertEquals("String_Node_Str",contextParam.getAsString());
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}

Fixed version (ground truth):
@Test public void testParameters(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  updateConfig(config);
  try {
    final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
    final AIResponse response=aiDataService.request(new AIRequest("String_Node_Str"));
    assertNotNull(response.getResult().getParameters());
    assertFalse(response.getResult().getParameters().isEmpty());
    final AIOutputContext context=response.getResult().getContexts()[0];
    assertNotNull(context.getParameters());
    assertTrue(context.getParameters().containsKey("String_Node_Str"));
    final JsonElement contextParam=context.getParameters().get("String_Node_Str");
    assertEquals("String_Node_Str",contextParam.getAsString());
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}
Program: 163534
Project: 163534
Buggy source:
@Test public void errorVoiceRequestTest(){
  final AIConfiguration config=new AIConfiguration("String_Node_Str",getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  config.setExperimental(isExperimentalTest());
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final InputStream voiceStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  try {
    final AIResponse aiResponse=aiDataService.voiceRequest(voiceStream);
    assertTrue("String_Node_Str",false);
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertNotNull(e.getResponse());
    assertEquals("String_Node_Str",e.getResponse().getStatus().getErrorType());
    assertEquals("String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void errorVoiceRequestTest(){
  final AIConfiguration config=new AIConfiguration("String_Node_Str",getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  updateConfig(config);
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final InputStream voiceStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  try {
    final AIResponse aiResponse=aiDataService.voiceRequest(voiceStream);
    assertTrue("String_Node_Str",false);
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertNotNull(e.getResponse());
    assertEquals("String_Node_Str",e.getResponse().getStatus().getErrorType());
    assertEquals("String_Node_Str",e.getMessage());
  }
}
Program: 163536
Project: 163536
Buggy source:
@Test public void textRequestTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  config.setWriteSoundLog(false);
  config.setExperimental(isExperimentalTest());
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  try {
    final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
    assertFalse(TextUtils.isEmpty(aiResponse.getResult().getResolvedQuery()));
    assertEquals("String_Node_Str",aiResponse.getResult().getAction());
    assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}

Fixed version (ground truth):
@Test public void textRequestTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  updateConfig(config);
  config.setWriteSoundLog(false);
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  try {
    final AIResponse aiResponse=makeRequest(aiDataService,aiRequest);
    assertFalse(TextUtils.isEmpty(aiResponse.getResult().getResolvedQuery()));
    assertEquals("String_Node_Str",aiResponse.getResult().getAction());
    assertEquals("String_Node_Str",aiResponse.getResult().getFulfillment().getSpeech());
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}
Program: 163537
Project: 163537
Buggy source:
@Test public void wrongEntitiesTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  config.setWriteSoundLog(false);
  config.setExperimental(isExperimentalTest());
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  final Entity myDwarfs=new Entity("String_Node_Str");
  myDwarfs.addEntry(new EntityEntry("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}));
  myDwarfs.addEntry(new EntityEntry("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  final ArrayList<Entity> extraEntities=new ArrayList<>();
  extraEntities.add(myDwarfs);
  aiRequest.setEntities(extraEntities);
  final AIResponse aiResponse;
  try {
    aiResponse=makeRequest(aiDataService,aiRequest);
    assertTrue("String_Node_Str",false);
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(true);
  }
}

Fixed version (ground truth):
@Test public void wrongEntitiesTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.System);
  updateConfig(config);
  config.setWriteSoundLog(false);
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final AIRequest aiRequest=new AIRequest();
  aiRequest.setQuery("String_Node_Str");
  final Entity myDwarfs=new Entity("String_Node_Str");
  myDwarfs.addEntry(new EntityEntry("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}));
  myDwarfs.addEntry(new EntityEntry("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  final ArrayList<Entity> extraEntities=new ArrayList<>();
  extraEntities.add(myDwarfs);
  aiRequest.setEntities(extraEntities);
  final AIResponse aiResponse;
  try {
    aiResponse=makeRequest(aiDataService,aiRequest);
    assertTrue("String_Node_Str",false);
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(true);
  }
}
Program: 163538
Project: 163538
Buggy source:
@Test public void voiceRequestTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.Speaktoit);
  config.setWriteSoundLog(false);
  config.setExperimental(isExperimentalTest());
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final InputStream inputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  try {
    final AIResponse aiResponse=aiDataService.voiceRequest(inputStream);
    assertNotNull(aiResponse);
    assertFalse(aiResponse.getStatus().getErrorDetails(),aiResponse.isError());
    assertFalse(TextUtils.isEmpty(aiResponse.getId()));
    assertNotNull(aiResponse.getResult());
    final String resolvedQuery=aiResponse.getResult().getResolvedQuery();
    assertFalse(TextUtils.isEmpty(resolvedQuery));
    assertTrue(resolvedQuery.contains("String_Node_Str"));
    assertTrue(resolvedQuery.contains("String_Node_Str"));
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}

Fixed version (ground truth):
@Test public void voiceRequestTest(){
  final AIConfiguration config=new AIConfiguration(getAccessToken(),getSubscriptionKey(),AIConfiguration.SupportedLanguages.English,AIConfiguration.RecognitionEngine.Speaktoit);
  updateConfig(config);
  config.setWriteSoundLog(false);
  final AIDataService aiDataService=new AIDataService(Robolectric.application,config);
  final InputStream inputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  try {
    final AIResponse aiResponse=aiDataService.voiceRequest(inputStream);
    assertNotNull(aiResponse);
    assertFalse(aiResponse.getStatus().getErrorDetails(),aiResponse.isError());
    assertFalse(TextUtils.isEmpty(aiResponse.getId()));
    assertNotNull(aiResponse.getResult());
    final String resolvedQuery=aiResponse.getResult().getResolvedQuery();
    assertFalse(TextUtils.isEmpty(resolvedQuery));
    assertTrue(resolvedQuery.contains("String_Node_Str"));
    assertTrue(resolvedQuery.contains("String_Node_Str"));
  }
 catch (  final AIServiceException e) {
    e.printStackTrace();
    assertTrue(e.getMessage(),false);
  }
}