nus-yam/ex-repair huggingface dataset:
Program: 34335
Project: 34335
Buggy source:
@Override protected void fillInMetadata(ContentPreferences contentPreferences,Individual<?,?> individual,Context ctx){
  super.fillInMetadata(contentPreferences,individual,ctx);
  T template=containerTemplate();
  individual.addValue(ctx.property(RDF.TYPE),ctx.reference(containerType())).addValue(ctx.property(template.membershipRelation().term()),ctx.value(template.membershipPredicate()));
  if (!isRoot()) {
    individual.addValue(ctx.property(LDP.MEMBERSHIP_RESOURCE),ctx.newIndividual(parent()));
  }
}

Fixed version (ground truth):
@Override protected void fillInMetadata(ContentPreferences contentPreferences,Individual<?,?> individual,Context ctx){
  super.fillInMetadata(contentPreferences,individual,ctx);
  T template=containerTemplate();
  individual.addValue(ctx.property(RDF.TYPE),ctx.reference(containerType())).addValue(ctx.property(template.membershipRelation().term()),ctx.reference(template.membershipPredicate()));
  Individual<?,?> membershipResource=null;
  if (!isRoot()) {
    membershipResource=ctx.newIndividual(parent());
  }
 else {
    membershipResource=ctx.reference(LDP.MEMBER_SUBJECT);
  }
  individual.addValue(ctx.property(LDP.MEMBERSHIP_RESOURCE),membershipResource);
  if (contentPreferences.mayInclude(Preference.MEMBERSHIP_TRIPLES)) {
    fillInMemberMetadata(contentPreferences,membershipResource,ctx);
  }
}
Program: 34336
Project: 34336
Buggy source:
public Value reference(Term term){
  return reference(term.as(URI.class));
}

Fixed version (ground truth):
public Individual<?,?> reference(Term term){
  return reference(term.as(URI.class));
}
Program: 34337
Project: 34337
Buggy source:
protected void configureValidationConstraints(ValidatorBuilder builder,Individual<?,?> individual,DataSet metadata){
  builder.withPropertyConstraint(ValidationConstraintFactory.mandatoryPropertyValues(individual.property(RDF.TYPE.as(URI.class))));
  for (  AttachedTemplate attachedTemplate : template().attachedTemplates()) {
    URI propertyId=attachedTemplate.predicate().or(HAS_ATTACHMENT);
    Property property=individual.property(propertyId);
    if (property != null) {
      builder.withPropertyConstraint(ValidationConstraintFactory.readOnlyProperty(individual.property(propertyId)));
      configureAdditionalValidationConstraints(builder,individual,metadata,attachments().get(attachedTemplate.id()));
    }
 else {
      builder.withPropertyConstraint(ValidationConstraintFactory.readOnlyProperty(individual.id(),propertyId));
    }
  }
}

Fixed version (ground truth):
protected void configureValidationConstraints(ValidatorBuilder builder,Individual<?,?> individual,DataSet metadata){
  builder.withPropertyConstraint(ValidationConstraintFactory.mandatoryPropertyValues(individual.property(RDF.TYPE.as(URI.class))));
  Set<URI> properties=Sets.newHashSet();
  for (  AttachedTemplate attachedTemplate : template().attachedTemplates()) {
    URI propertyId=attachedTemplate.predicate().or(HAS_ATTACHMENT);
    if (!properties.contains(propertyId)) {
      Property property=individual.property(propertyId);
      if (property != null) {
        builder.withPropertyConstraint(ValidationConstraintFactory.readOnlyProperty(property));
        configureAdditionalValidationConstraints(builder,individual,metadata,attachments().get(attachedTemplate.id()));
      }
 else {
        builder.withPropertyConstraint(ValidationConstraintFactory.readOnlyProperty(individual.id(),propertyId));
      }
      properties.add(propertyId);
    }
  }
}
Program: 34338
Project: 34338
Buggy source:
@Override public boolean mustBeChecked(){
  return this.predicate != null;
}

Fixed version (ground truth):
@Override public boolean mustBeChecked(){
  return this.individualId != null && !this.values.isEmpty();
}
Program: 34340
Project: 34340
Buggy source:
@Override public void visitIndividual(Individual<?,?> value){
  builder.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(value.id()).append(NL);
}

Fixed version (ground truth):
@Override public void visitIndividual(Individual<?,?> value){
  builder.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(FormatUtils.formatId(value)).append(NL);
}
Program: 34342
Project: 34342
Buggy source:
@Override public void visitLiteral(Literal<?> value){
  builder.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(value.get()).append(NL);
}

Fixed version (ground truth):
@Override public void visitLiteral(Literal<?> value){
  Object rawValue=value.get();
  builder.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(rawValue).append("String_Node_Str").append(rawValue.getClass().getCanonicalName()).append("String_Node_Str").append(NL);
}
Program: 34343
Project: 34343
Buggy source:
public Response options(OperationContext context){
  Capabilities capabilities=context.resource().capabilities();
  ResponseBuilder builder=Response.ok();
  EndpointControllerUtils.populateAllowedHeaders(builder,capabilities);
  addRequiredHeaders(context,builder);
  return builder.build();
}

Fixed version (ground truth):
public Response options(OperationContext context){
  Capabilities capabilities=context.resource().capabilities();
  ResponseBuilder builder=Response.ok();
  EndpointControllerUtils.populateAllowedHeaders(builder,capabilities);
  addRequiredHeaders(context,builder);
  addAcceptPostHeaders(context,builder);
  return builder.build();
}
Program: 34344
Project: 34344
Buggy source:
private Response doGet(OperationContext context,boolean includeEntity){
  Variant variant=context.expectedVariant();
  context.checkOperationSupport().checkPreconditions();
  ResponseBuilder builder=Response.serverError();
  String body=null;
  Status status=null;
  try {
    PublicResource resource=context.applicationContext().findResource(endpoint());
    DataSet entity=resource.entity();
    body=context.serializeResource(entity,variant.getMediaType());
    status=Status.OK;
    builder.variant(variant);
  }
 catch (  ApplicationExecutionException e) {
    status=Status.INTERNAL_SERVER_ERROR;
    body=Throwables.getStackTraceAsString(e);
    builder.type(MediaType.TEXT_PLAIN).language(Locale.ENGLISH);
  }
  addRequiredHeaders(context,builder);
  builder.status(status.getStatusCode()).header(ExistingEndpointController.CONTENT_LENGTH_HEADER,body.length());
  if (includeEntity) {
    builder.entity(body);
  }
  return builder.build();
}

Fixed version (ground truth):
private Response doGet(OperationContext context,boolean includeEntity){
  Variant variant=context.expectedVariant();
  context.checkOperationSupport().checkPreconditions();
  ResponseBuilder builder=Response.serverError();
  String body=null;
  Status status=null;
  try {
    PublicResource resource=context.applicationContext().findResource(endpoint());
    DataSet entity=resource.entity();
    LOGGER.trace("String_Node_Str",entity);
    body=context.serializeResource(entity,variant.getMediaType());
    status=Status.OK;
    builder.variant(variant);
  }
 catch (  ApplicationExecutionException e) {
    status=Status.INTERNAL_SERVER_ERROR;
    body=Throwables.getStackTraceAsString(e);
    builder.type(MediaType.TEXT_PLAIN).language(Locale.ENGLISH);
  }
  addRequiredHeaders(context,builder);
  builder.status(status.getStatusCode()).header(ExistingEndpointController.CONTENT_LENGTH_HEADER,body.length());
  if (includeEntity) {
    builder.entity(body);
  }
  return builder.build();
}
Program: 34345
Project: 34345
Buggy source:
@Override public DataSet dataSet(){
  if (this.dataSet == null) {
    MediaType mediaType=contentVariant().getMediaType();
    IMediaTypeProvider provider=RuntimeInstance.getInstance().getMediaTypeProvider(mediaType);
    if (provider == null) {
      throw new UnsupportedContentException(endpoint,this,contentVariant());
    }
    Unmarshaller unmarshaller=provider.newUnmarshaller(ImmutableContext.newInstance(base().resolve(endpoint.path()),resourceResolver()));
    try {
      this.dataSet=unmarshaller.unmarshall(this.entity,mediaType);
    }
 catch (    ContentTransformationException e) {
      throw new ContentProcessingException("String_Node_Str" + mediaType + "String_Node_Str",endpoint,this);
    }
  }
  return this.dataSet;
}

Fixed version (ground truth):
@Override public DataSet dataSet(){
  if (this.dataSet == null) {
    LOGGER.trace("String_Node_Str",this.entity);
    MediaType mediaType=contentVariant().getMediaType();
    IMediaTypeProvider provider=RuntimeInstance.getInstance().getMediaTypeProvider(mediaType);
    if (provider == null) {
      throw new UnsupportedContentException(endpoint,this,contentVariant());
    }
    Unmarshaller unmarshaller=provider.newUnmarshaller(ImmutableContext.newInstance(base().resolve(endpoint.path()),resourceResolver()));
    try {
      this.dataSet=unmarshaller.unmarshall(this.entity,mediaType);
    }
 catch (    ContentTransformationException e) {
      throw new ContentProcessingException("String_Node_Str" + mediaType + "String_Node_Str",endpoint,this);
    }
  }
  return this.dataSet;
}
Program: 34346
Project: 34346
Buggy source:
public static URI resolve(URI base,URI target){
  if (!base.getScheme().equals(target.getScheme()) || !base.getAuthority().equals(target.getAuthority())) {
    return target;
  }
  return walkthrough(base.normalize(),target.normalize());
}

Fixed version (ground truth):
public static URI resolve(URI base,URI target){
  if (!base.getScheme().equals(target.getScheme()) || !base.getAuthority().equals(target.getAuthority())) {
    return target;
  }
  URI result=walkthrough(base.normalize(),target.normalize());
  System.out.printf("String_Node_Str",base,target,result);
  System.out.flush();
  return result;
}
Program: 34347
Project: 34347
Buggy source:
private static URI walkthrough(URI base,URI target){
  String[] basePath=base.getPath().split("String_Node_Str");
  String[] targetPath=target.getPath().split("String_Node_Str");
  int common=findCommons(basePath,targetPath);
  List<String> segments=getSegments(targetPath,common,basePath.length - common);
  return recreateFromSegments(segments,target);
}

Fixed version (ground truth):
private static URI walkthrough(URI base,URI target){
  System.out.printf("String_Node_Str",base,target);
  String[] basePath=base.getPath().split("String_Node_Str");
  String[] targetPath=target.getPath().split("String_Node_Str");
  int common=findCommons(basePath,targetPath);
  System.out.printf("String_Node_Str",base.getPath());
  System.out.printf("String_Node_Str",Arrays.toString(basePath));
  System.out.printf("String_Node_Str",base.getPath());
  System.out.printf("String_Node_Str",Arrays.toString(basePath));
  System.out.printf("String_Node_Str",common);
  if (targetPath.length == common) {
    URI result=null;
    if (base.getPath().endsWith("String_Node_Str") && !target.getPath().endsWith("String_Node_Str")) {
      result=URI.create("String_Node_Str" + basePath[common - 1]);
    }
 else     if (!base.getPath().endsWith("String_Node_Str") && target.getPath().endsWith("String_Node_Str")) {
      result=URI.create("String_Node_Str" + basePath[common - 1] + "String_Node_Str");
    }
 else     if (base.getPath().equals(target.getPath())) {
      result=URI.create("String_Node_Str");
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
    return result;
  }
 else {
    List<String> segments=getSegments(targetPath,common,basePath.length - common);
    return recreateFromSegments(segments,target);
  }
}
Program: 34348
Project: 34348
Buggy source:
private void verifyResolution(String base,String target,String resolution,boolean query,boolean fragment){
  String extendedTarget=extend(target,query,fragment);
  String extendedResolution=extend(resolution,query,fragment);
  URI baseURI=URI.create(base);
  URI targetURI=URI.create(extendedTarget);
  URI resolutionURI=URI.create(extendedResolution);
  assertThat(URIUtils.resolve(baseURI,targetURI),equalTo(resolutionURI));
  assertThat(baseURI.resolve(resolutionURI),equalTo(targetURI));
}

Fixed version (ground truth):
private void verifyResolution(String base,String target,String resolution,boolean query,boolean fragment){
  assertThat(URI.create(base).resolve(URI.create(resolution)),equalTo(URI.create(target)));
  String extendedTarget=extend(target,query,fragment);
  String extendedResolution=extend(resolution,query,fragment);
  URI baseURI=URI.create(base);
  URI targetURI=URI.create(extendedTarget);
  URI resolutionURI=URI.create(extendedResolution);
  URI relative=URIUtils.resolve(baseURI,targetURI);
  assertThat(relative,equalTo(resolutionURI));
  assertThat(baseURI.resolve(resolutionURI),equalTo(targetURI));
  assertThat(baseURI.resolve(relative),equalTo(targetURI));
}
Program: 34349
Project: 34349
Buggy source:
@Test public void testResolve$siblings$targetBigger(){
  String base="String_Node_Str";
  String target="String_Node_Str";
  String resolution="String_Node_Str";
  verifyResolution(base,target,resolution,false,false);
  verifyResolution(base,target,resolution,false,true);
  verifyResolution(base,target,resolution,true,false);
  verifyResolution(base,target,resolution,true,true);
}

Fixed version (ground truth):
@Test public void testResolve$siblings$targetBigger(){
  String base="String_Node_Str";
  String target="String_Node_Str";
  String resolution="String_Node_Str";
  assertThat(URI.create(base).resolve(URI.create(resolution)),equalTo(URI.create(target)));
  verifyResolution(base,target,resolution,false,false);
  verifyResolution(base,target,resolution,false,true);
  verifyResolution(base,target,resolution,true,false);
  verifyResolution(base,target,resolution,true,true);
}
Program: 34350
Project: 34350
Buggy source:
private String writeURI(URI uri){
  String result=null;
  String prefix=namespaceTable.get(uri.getNamespace());
  if (prefix != null) {
    result=String.format("String_Node_Str",prefix,uri.getLocalName());
  }
 else {
    result=String.format("String_Node_Str",TurtleUtil.encodeURIString(resolve(uri).toString()));
  }
  return result;
}

Fixed version (ground truth):
private String writeURI(URI uri){
  String result=null;
  String prefix=namespaceTable.get(uri.getNamespace());
  if (prefix != null) {
    result=String.format("String_Node_Str",prefix,uri.getLocalName());
  }
 else {
    result=String.format("String_Node_Str",TurtleUtil.encodeURIString(uri.toString()));
  }
  return result;
}
Program: 34351
Project: 34351
Buggy source:
@Test public void testToString$sameAsBase() throws Exception {
  System.out.println(sut.toString(vf.createURI(BASE)));
}

Fixed version (ground truth):
@Test public void testToString$sameAsBase() throws Exception {
  System.out.println("String_Node_Str" + sut.toString(vf.createURI(BASE)));
}
Program: 34352
Project: 34352
Buggy source:
@Test public void testToString$child() throws Exception {
  System.out.println(sut.toString(vf.createURI(BASE + "String_Node_Str")));
}

Fixed version (ground truth):
@Test public void testToString$child() throws Exception {
  System.out.println("String_Node_Str" + sut.toString(vf.createURI(BASE + "String_Node_Str")));
}
Program: 34353
Project: 34353
Buggy source:
@Test public void testToString$baseAsResource() throws Exception {
  System.out.println(sut.toString(vf.createURI(BASE.substring(0,BASE.length() - 1))));
}

Fixed version (ground truth):
@Test public void testToString$baseAsResource() throws Exception {
  System.out.println("String_Node_Str" + sut.toString(vf.createURI(BASE.substring(0,BASE.length() - 1))));
}
Program: 34354
Project: 34354
Buggy source:
@Test public void testToString$ancestor() throws Exception {
  System.out.println(sut.toString(vf.createURI(BASE + "String_Node_Str")));
}

Fixed version (ground truth):
@Test public void testToString$ancestor() throws Exception {
  System.out.println("String_Node_Str" + sut.toString(vf.createURI(BASE + "String_Node_Str")));
}
Program: 34355
Project: 34355
Buggy source:
@Test public void testToString$self() throws Exception {
  System.out.println(sut.toString(vf.createURI(BASE.concat("String_Node_Str"))));
}

Fixed version (ground truth):
@Test public void testToString$self() throws Exception {
  System.out.println("String_Node_Str" + sut.toString(vf.createURI(BASE.concat("String_Node_Str"))));
}
Program: 34357
Project: 34357
Buggy source:
@Override public Binary get(Object key){
  if (!(key instanceof Binary))   return null;
  final Binary bKey=(Binary)key;
  final byte[] keyData=bKey.getValue();
  final int keySize=keyData.length;
  final int hash=Math.abs(hashFunction.apply(keyData));
  final long offset=hash % partitionCount;
  long locationAddress=unsafe.getAddress(partitionAddress + (offset * addressSize));
  if (locationAddress == 0)   return null;
  int entryCount=unsafe.getInt(locationAddress);
  locationAddress+=Integer.BYTES;
  for (long locationOffset=0; locationOffset < entryCount; locationOffset++) {
    long keyAddress=unsafe.getAddress(locationAddress + (locationOffset * addressSize * 2));
    int size=unsafe.getInt(keyAddress);
    if (size != keySize)     continue;
    keyAddress+=Integer.BYTES;
    boolean isEqual=true;
    for (int keyOffset=0; keyOffset < keySize; keyOffset++) {
      if (keyData[keyOffset] != unsafe.getByte(keyAddress + keyOffset)) {
        isEqual=false;
        break;
      }
    }
    if (isEqual) {
      long valueAddress=unsafe.getAddress(locationAddress + (locationOffset * addressSize * 2) + addressSize);
      if (valueAddress == 0)       return null;
      int valueSize=unsafe.getInt(valueAddress);
      byte[] valueData=new byte[valueSize];
      valueAddress+=Integer.BYTES;
      for (int valueOffset=0; valueOffset < valueSize; valueOffset++) {
        valueData[valueOffset]=unsafe.getByte(valueAddress + valueOffset);
      }
      return new Binary(valueData);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Binary get(Object key){
  if (!(key instanceof Binary))   return null;
  final Binary bKey=(Binary)key;
  final byte[] keyData=bKey.getValue();
  final int keySize=keyData.length;
  final long offset=getPartitionOffset(keyData);
  long locationAddress=unsafe.getAddress(partitionAddress + (offset * addressSize));
  if (locationAddress == 0)   return null;
  int entryCount=unsafe.getInt(locationAddress);
  locationAddress+=Integer.BYTES;
  for (long locationOffset=0; locationOffset < entryCount; locationOffset++) {
    long keyAddress=unsafe.getAddress(locationAddress + (locationOffset * addressSize * 2));
    int size=unsafe.getInt(keyAddress);
    if (size != keySize)     continue;
    keyAddress+=Integer.BYTES;
    boolean isEqual=true;
    for (int keyOffset=0; keyOffset < keySize; keyOffset++) {
      if (keyData[keyOffset] != unsafe.getByte(keyAddress + keyOffset)) {
        isEqual=false;
        break;
      }
    }
    if (isEqual) {
      long valueAddress=unsafe.getAddress(locationAddress + (locationOffset * addressSize * 2) + addressSize);
      if (valueAddress == 0)       return null;
      int valueSize=unsafe.getInt(valueAddress);
      byte[] valueData=new byte[valueSize];
      valueAddress+=Integer.BYTES;
      for (int valueOffset=0; valueOffset < valueSize; valueOffset++) {
        valueData[valueOffset]=unsafe.getByte(valueAddress + valueOffset);
      }
      return new Binary(valueData);
    }
  }
  return null;
}
Program: 34358
Project: 34358
Buggy source:
@Override public boolean containsKey(Object key){
  if (!(key instanceof Binary))   return false;
  final Binary bKey=(Binary)key;
  final byte[] keyData=bKey.getValue();
  final int keySize=keyData.length;
  final int hash=Math.abs(hashFunction.apply(keyData));
  final long offset=hash % partitionCount;
  long locationAddress=unsafe.getAddress(partitionAddress + (offset * addressSize));
  if (locationAddress == 0)   return false;
  int entryCount=unsafe.getInt(locationAddress);
  locationAddress+=Integer.BYTES;
  for (long locationOffset=0; locationOffset < entryCount; locationOffset++) {
    long keyAddress=unsafe.getAddress(locationAddress + (locationOffset * addressSize * 2));
    int size=unsafe.getInt(keyAddress);
    if (size != keySize)     continue;
    keyAddress+=Integer.BYTES;
    boolean isEqual=true;
    for (int keyOffset=0; keyOffset < keySize; keyOffset++) {
      if (keyData[keyOffset] != unsafe.getByte(keyAddress + keyOffset)) {
        isEqual=false;
        break;
      }
    }
    if (isEqual)     return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean containsKey(Object key){
  if (!(key instanceof Binary))   return false;
  final Binary bKey=(Binary)key;
  final byte[] keyData=bKey.getValue();
  final int keySize=keyData.length;
  final long offset=getPartitionOffset(keyData);
  long locationAddress=unsafe.getAddress(partitionAddress + (offset * addressSize));
  if (locationAddress == 0)   return false;
  int entryCount=unsafe.getInt(locationAddress);
  locationAddress+=Integer.BYTES;
  for (long locationOffset=0; locationOffset < entryCount; locationOffset++) {
    long keyAddress=unsafe.getAddress(locationAddress + (locationOffset * addressSize * 2));
    int size=unsafe.getInt(keyAddress);
    if (size != keySize)     continue;
    keyAddress+=Integer.BYTES;
    boolean isEqual=true;
    for (int keyOffset=0; keyOffset < keySize; keyOffset++) {
      if (keyData[keyOffset] != unsafe.getByte(keyAddress + keyOffset)) {
        isEqual=false;
        break;
      }
    }
    if (isEqual)     return true;
  }
  return false;
}
Program: 34359
Project: 34359
Buggy source:
@Override public boolean containsValue(Object value){
  if (value != null && !(value instanceof Binary))   return false;
  final Binary bValue=(Binary)value;
  final byte[] valueData=bValue == null ? null : bValue.getValue();
  final int valueSize=valueData == null ? -1 : valueData.length;
  for (long offset=0; offset < partitionCount; offset++) {
    long locationAddress=unsafe.getAddress(partitionAddress + (offset * addressSize));
    if (locationAddress == 0)     continue;
    int entryCount=unsafe.getInt(locationAddress);
    locationAddress+=Integer.BYTES;
    locationAddress+=Long.BYTES;
    for (long locationOffset=0; locationOffset < entryCount; locationOffset++) {
      long valueAddress=unsafe.getAddress(locationAddress + (locationOffset * addressSize * 2));
      if (valueAddress == 0) {
        if (bValue == null)         return true;
 else         continue;
      }
      int size=unsafe.getInt(valueAddress);
      if (size != valueSize)       continue;
      valueAddress+=Integer.BYTES;
      boolean isEqual=true;
      for (int valueOffset=0; valueOffset < valueSize; valueOffset++) {
        if (valueData[valueOffset] != unsafe.getByte(valueAddress + valueOffset)) {
          isEqual=false;
          break;
        }
      }
      if (isEqual)       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean containsValue(Object value){
  if (value != null && !(value instanceof Binary))   return false;
  final Binary bValue=(Binary)value;
  final byte[] valueData=bValue == null ? null : bValue.getValue();
  final int valueSize=valueData == null ? -1 : valueData.length;
  for (long offset=0; offset < partitionCount; offset++) {
    long locationAddress=unsafe.getAddress(partitionAddress + (offset * addressSize));
    if (locationAddress == 0)     continue;
    int entryCount=unsafe.getInt(locationAddress);
    locationAddress+=Integer.BYTES;
    locationAddress+=addressSize;
    for (long locationOffset=0; locationOffset < entryCount; locationOffset++) {
      long valueAddress=unsafe.getAddress(locationAddress + (locationOffset * addressSize * 2));
      if (valueAddress == 0) {
        if (bValue == null)         return true;
 else         continue;
      }
      int size=unsafe.getInt(valueAddress);
      if (size != valueSize)       continue;
      valueAddress+=Integer.BYTES;
      boolean isEqual=true;
      for (int valueOffset=0; valueOffset < valueSize; valueOffset++) {
        if (valueData[valueOffset] != unsafe.getByte(valueAddress + valueOffset)) {
          isEqual=false;
          break;
        }
      }
      if (isEqual)       return true;
    }
  }
  return false;
}
Program: 34361
Project: 34361
Buggy source:
@Override public boolean hasNext(){
  long locationAddress=map.unsafe.getAddress(map.partitionAddress + (offset * map.addressSize));
  if (locationAddress == 0) {
    offset++;
    return hasNext();
  }
  return offset < map.partitionCount;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  while (offset < map.partitionCount) {
    long locationAddress=map.unsafe.getAddress(map.partitionAddress + (offset * map.addressSize));
    if (locationAddress == 0) {
      offset++;
      continue;
    }
    break;
  }
  return offset < map.partitionCount;
}
Program: 34364
Project: 34364
Buggy source:
/** 
 * @param msg MqttMessage
 * @param format an object of String which contains format such as json
 * @throws UnsupportedEncodingException if encoding is other than UTF-8
 */
public Message(MqttMessage msg,String format) throws UnsupportedEncodingException {
  final String METHOD="String_Node_Str";
  this.rawPayload=msg.getPayload();
  this.payloadInString=new String(msg.getPayload(),"String_Node_Str");
  this.payload=msg.getPayload();
  if ("String_Node_Str".equalsIgnoreCase(format)) {
    try {
      JsonObject payloadJson=JSON_PARSER.parse(payloadInString).getAsJsonObject();
      if (payloadJson.has("String_Node_Str")) {
        try {
          timestamp=DT_PARSER.parseDateTime(payloadJson.get("String_Node_Str").getAsString());
        }
 catch (        IllegalArgumentException e) {
          timestamp=DateTime.now();
        }
      }
 else {
        timestamp=DateTime.now();
      }
    }
 catch (    JsonSyntaxException e) {
      LoggerUtility.warn(CLASS_NAME,METHOD,"String_Node_Str");
    }
catch (    JsonParseException jpe) {
      LoggerUtility.warn(CLASS_NAME,METHOD,"String_Node_Str");
    }
  }
 else   if ("String_Node_Str".equalsIgnoreCase(format)) {
    timestamp=DateTime.now();
  }
 else {
    this.payload=this.payloadInString;
    timestamp=DateTime.now();
  }
}

Fixed version (ground truth):
/** 
 * @param msg MqttMessage
 * @param format an object of String which contains format such as json
 * @throws UnsupportedEncodingException if encoding is other than UTF-8
 */
public Message(MqttMessage msg,String format) throws UnsupportedEncodingException {
  final String METHOD="String_Node_Str";
  this.rawPayload=msg.getPayload();
  this.payloadInString=new String(msg.getPayload(),"String_Node_Str");
  this.payload=msg.getPayload();
  if ("String_Node_Str".equalsIgnoreCase(format)) {
    try {
      JsonObject payloadJson=JSON_PARSER.parse(payloadInString).getAsJsonObject();
      if (payloadJson.has("String_Node_Str")) {
        try {
          timestamp=DT_PARSER.parseDateTime(payloadJson.get("String_Node_Str").getAsString());
        }
 catch (        IllegalArgumentException e) {
          timestamp=DateTime.now();
        }
      }
 else {
        timestamp=DateTime.now();
      }
      this.payload=payloadJson;
    }
 catch (    JsonSyntaxException e) {
      LoggerUtility.warn(CLASS_NAME,METHOD,"String_Node_Str");
    }
catch (    JsonParseException jpe) {
      LoggerUtility.warn(CLASS_NAME,METHOD,"String_Node_Str");
    }
  }
 else   if ("String_Node_Str".equalsIgnoreCase(format)) {
    timestamp=DateTime.now();
  }
 else {
    this.payload=this.payloadInString;
    timestamp=DateTime.now();
  }
}
Program: 34366
Project: 34366
Buggy source:
public String getGWDeviceId(){
  String id;
  id=options.getProperty("String_Node_Str");
  if (id == null) {
    return getDeviceId();
  }
  return trimedValue(id);
}

Fixed version (ground truth):
public String getGWDeviceId(){
  String id;
  id=options.getProperty("String_Node_Str");
  if (id == null) {
    return super.getDeviceId();
  }
  return trimedValue(id);
}
Program: 34367
Project: 34367
Buggy source:
private void configureConnOptions(){
  final String METHOD="String_Node_Str";
  String protocol=null;
  int port=0;
  if (isWebSocket()) {
    protocol="String_Node_Str";
    port=WSS_PORT;
  }
 else {
    protocol="String_Node_Str";
    port=MQTTS_PORT;
  }
  String serverURI=protocol + getOrgId() + "String_Node_Str"+ MESSAGING+ "String_Node_Str"+ this.getDomain()+ "String_Node_Str"+ port;
  try {
    mqttAsyncClient=new MqttAsyncClient(serverURI,clientId,DATA_STORE);
    mqttAsyncClient.setCallback(mqttCallback);
    mqttClientOptions=new MqttConnectOptions();
    if (clientUsername != null) {
      mqttClientOptions.setUserName(clientUsername);
    }
    if (clientPassword != null) {
      mqttClientOptions.setPassword(clientPassword.toCharArray());
    }
    mqttClientOptions.setCleanSession(this.isCleanSession());
    if (this.keepAliveInterval != -1) {
      mqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);
    }
    mqttClientOptions.setMaxInflight(getMaxInflight());
    mqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());
    SSLContext sslContext=SSLContext.getInstance("String_Node_Str");
    sslContext.init(null,null,null);
    mqttClientOptions.setSocketFactory(sslContext.getSocketFactory());
  }
 catch (  MqttException|GeneralSecurityException e) {
    LoggerUtility.warn(CLASS_NAME,METHOD,"String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void configureConnOptions(){
  final String METHOD="String_Node_Str";
  String protocol=null;
  int port=getPortNumber();
  if (isWebSocket()) {
    protocol="String_Node_Str";
    if (port == -1) {
      port=WSS_PORT;
    }
  }
 else {
    protocol="String_Node_Str";
    if (port == -1) {
      port=MQTTS_PORT;
    }
  }
  String serverURI=protocol + getOrgId() + "String_Node_Str"+ MESSAGING+ "String_Node_Str"+ this.getDomain()+ "String_Node_Str"+ port;
  try {
    mqttAsyncClient=new MqttAsyncClient(serverURI,clientId,DATA_STORE);
    mqttAsyncClient.setCallback(mqttCallback);
    mqttClientOptions=new MqttConnectOptions();
    if (clientUsername != null) {
      mqttClientOptions.setUserName(clientUsername);
    }
    if (clientPassword != null) {
      mqttClientOptions.setPassword(clientPassword.toCharArray());
    }
    mqttClientOptions.setCleanSession(this.isCleanSession());
    if (this.keepAliveInterval != -1) {
      mqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);
    }
    mqttClientOptions.setMaxInflight(getMaxInflight());
    mqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());
    SSLContext sslContext=SSLContext.getInstance("String_Node_Str");
    sslContext.init(null,null,null);
    mqttClientOptions.setSocketFactory(sslContext.getSocketFactory());
  }
 catch (  MqttException|GeneralSecurityException e) {
    LoggerUtility.warn(CLASS_NAME,METHOD,"String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}
Program: 34368
Project: 34368
Buggy source:
private void configureMqtt(){
  String protocol=null;
  int port;
  if (isWebSocket()) {
    protocol="String_Node_Str";
    port=WS_PORT;
  }
 else {
    protocol="String_Node_Str";
    port=MQTT_PORT;
  }
  String serverURI=protocol + getOrgId() + "String_Node_Str"+ MESSAGING+ "String_Node_Str"+ this.getDomain()+ "String_Node_Str"+ port;
  try {
    persistence=new MemoryPersistence();
    mqttAsyncClient=new MqttAsyncClient(serverURI,clientId,persistence);
    mqttAsyncClient.setCallback(mqttCallback);
    mqttClientOptions=new MqttConnectOptions();
    if (clientUsername != null) {
      mqttClientOptions.setUserName(clientUsername);
    }
    if (clientPassword != null) {
      mqttClientOptions.setPassword(clientPassword.toCharArray());
    }
    mqttClientOptions.setCleanSession(this.isCleanSession());
    if (this.keepAliveInterval != -1) {
      mqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);
    }
    mqttClientOptions.setMaxInflight(getMaxInflight());
  }
 catch (  MqttException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void configureMqtt(){
  String protocol=null;
  int port=getPortNumber();
  if (isWebSocket()) {
    protocol="String_Node_Str";
    if (port == -1) {
      port=WS_PORT;
    }
  }
 else {
    protocol="String_Node_Str";
    if (port == -1) {
      port=MQTT_PORT;
    }
  }
  String serverURI=protocol + getOrgId() + "String_Node_Str"+ MESSAGING+ "String_Node_Str"+ this.getDomain()+ "String_Node_Str"+ port;
  try {
    persistence=new MemoryPersistence();
    mqttAsyncClient=new MqttAsyncClient(serverURI,clientId,persistence);
    mqttAsyncClient.setCallback(mqttCallback);
    mqttClientOptions=new MqttConnectOptions();
    if (clientUsername != null) {
      mqttClientOptions.setUserName(clientUsername);
    }
    if (clientPassword != null) {
      mqttClientOptions.setPassword(clientPassword.toCharArray());
    }
    mqttClientOptions.setCleanSession(this.isCleanSession());
    if (this.keepAliveInterval != -1) {
      mqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);
    }
    mqttClientOptions.setMaxInflight(getMaxInflight());
  }
 catch (  MqttException e) {
    e.printStackTrace();
  }
}
Program: 34369
Project: 34369
Buggy source:
/** 
 * Returns the payload sent by the Watson IoT Platform in byte[] format
 * @return
 */
public byte[] getRawPayload(){
  return this.rawPayload;
}

Fixed version (ground truth):
/** 
 * Returns the payload sent by the Watson IoT Platform in byte[] format
 * @return Raw payload in byte[]
 */
public byte[] getRawPayload(){
  return this.rawPayload;
}
Program: 34370
Project: 34370
Buggy source:
/** 
 * @return the domain
 */
protected String getDomain(Properties options){
  String domain;
  domain=options.getProperty("String_Node_Str");
  if (domain == null) {
    domain=options.getProperty("String_Node_Str");
  }
  domain=trimedValue(domain);
  if (domain != null && !("String_Node_Str".equals(domain))) {
    return domain;
  }
 else {
    return AbstractClient.DEFAULT_DOMAIN;
  }
}

Fixed version (ground truth):
/** 
 * @param options List of properties 
 * @return the domain
 */
protected String getDomain(Properties options){
  String domain;
  domain=options.getProperty("String_Node_Str");
  if (domain == null) {
    domain=options.getProperty("String_Node_Str");
  }
  domain=trimedValue(domain);
  if (domain != null && !("String_Node_Str".equals(domain))) {
    return domain;
  }
 else {
    return AbstractClient.DEFAULT_DOMAIN;
  }
}
Program: 34376
Project: 34376
Buggy source:
/** 
 * <p>While Gateway publishes events on behalf of the devices connected to it,  the Gateway can publish its own events as well. This method publishes event with the  specified name and specified QOS.</p> This method allows QoS to be passed as an argument
 * @param event Name of the dataset under which to publish the data
 * @param data Object to be added to the payload as the dataset
 * @param qos Quality of Service - should be 0, 1 or 2
 * @return Whether the send was successful.
 * @throws Exception 
 */
public boolean publishGatewayEvent(String event,Object data,String format,int qos) throws Exception {
  return publishDeviceEvent(this.getGWDeviceType(),this.getGWDeviceId(),event,data,format,qos);
}

Fixed version (ground truth):
/** 
 * <p>While Gateway publishes events on behalf of the devices connected to it,  the Gateway can publish its own events as well. This method publishes event with the  specified name and specified QOS.</p> This method allows QoS to be passed as an argument
 * @param event Name of the dataset under which to publish the data
 * @param data Object to be added to the payload as the dataset
 * @param format the format of the event
 * @param qos Quality of Service - should be 0, 1 or 2
 * @return Whether the send was successful.
 * @throws Exception when the publish operation fails
 */
public boolean publishGatewayEvent(String event,Object data,String format,int qos) throws Exception {
  return publishDeviceEvent(this.getGWDeviceType(),this.getGWDeviceId(),event,data,format,qos);
}
Program: 34377
Project: 34377
Buggy source:
/** 
 * Following are actions that needs to be taken after receiving the command If mgmt.firmware.state is not 0 ("Idle") an error should be reported with  response code 400, and an optional message text. If the action can be initiated immediately, set rc to 202. If mgmt.firmware.url is not set or is not a valid URL, set rc to 400. If firmware download attempt fails, set rc to 500 and optionally set message accordingly. If firmware download is not supported, set rc to 501 and optionally set message accordingly.
 */
@Override public void handleRequest(JsonObject jsonRequest){
  final String METHOD="String_Node_Str";
  ResponseCode rc;
  JsonObject response=new JsonObject();
  response.add("String_Node_Str",jsonRequest.get("String_Node_Str"));
  DeviceFirmware deviceFirmware=getDMClient().getDeviceData().getDeviceFirmware();
  if (deviceFirmware == null || getDMClient().getFirmwareHandler() == null) {
    rc=ResponseCode.DM_FUNCTION_NOT_IMPLEMENTED;
  }
 else   if (deviceFirmware.getState() != DeviceFirmware.FirmwareState.IDLE.getState()) {
    rc=ResponseCode.DM_BAD_REQUEST;
  }
 else {
    if (deviceFirmware.getUrl() != null) {
      LoggerUtility.fine(CLASS_NAME,METHOD,"String_Node_Str");
      getDMClient().getFirmwareHandler().downloadFirmware(deviceFirmware);
      rc=ResponseCode.DM_ACCEPTED;
    }
 else {
      rc=ResponseCode.DM_BAD_REQUEST;
      LoggerUtility.severe(CLASS_NAME,METHOD,"String_Node_Str");
    }
  }
  response.add("String_Node_Str",new JsonPrimitive(rc.getCode()));
  respond(response);
}

Fixed version (ground truth):
/** 
 * Following are actions that needs to be taken after receiving the command If mgmt.firmware.state is not 0 ("Idle") an error should be reported with  response code 400, and an optional message text. If the action can be initiated immediately, set rc to 202. If mgmt.firmware.url is not set or is not a valid URL, set rc to 400. If firmware download attempt fails, set rc to 500 and optionally set message accordingly. If firmware download is not supported, set rc to 501 and optionally set message accordingly.
 */
@Override public void handleRequest(JsonObject jsonRequest){
  final String METHOD="String_Node_Str";
  ResponseCode rc;
  JsonObject response=new JsonObject();
  response.add("String_Node_Str",jsonRequest.get("String_Node_Str"));
  DeviceFirmware deviceFirmware=getDMClient().getDeviceData().getDeviceFirmware();
  if (deviceFirmware == null || getDMClient().getFirmwareHandler() == null) {
    rc=ResponseCode.DM_FUNCTION_NOT_IMPLEMENTED;
  }
 else   if (deviceFirmware.getState() != DeviceFirmware.FirmwareState.IDLE.getState()) {
    rc=ResponseCode.DM_BAD_REQUEST;
  }
 else {
    if (deviceFirmware.getUrl() != null) {
      rc=ResponseCode.DM_ACCEPTED;
    }
 else {
      rc=ResponseCode.DM_BAD_REQUEST;
      LoggerUtility.severe(CLASS_NAME,METHOD,"String_Node_Str");
    }
  }
  response.add("String_Node_Str",new JsonPrimitive(rc.getCode()));
  respond(response);
  if (rc == ResponseCode.DM_ACCEPTED) {
    LoggerUtility.fine(CLASS_NAME,METHOD,"String_Node_Str");
    getDMClient().getFirmwareHandler().downloadFirmware(deviceFirmware);
  }
}
Program: 34379
Project: 34379
Buggy source:
/** 
 * Initiates a device management request, such as reboot.
 * @param request JSON object containing the management request
 * @return JSON object containing the response from Watson IoT Platform
 * @throws IoTFCReSTException Failure in initiating a DM request
 */
public JsonObject initiateDMRequest(JsonObject request) throws IoTFCReSTException {
  final String METHOD="String_Node_Str";
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(orgId).append('.').append(this.domain).append(BASIC_API_V0002_URL).append("String_Node_Str");
  int code=0;
  HttpResponse response=null;
  JsonElement jsonResponse=null;
  String method="String_Node_Str";
  try {
    response=connect(method,sb.toString(),request.toString(),null);
    code=response.getStatusLine().getStatusCode();
    if (code == 202) {
      String result=this.readContent(response,METHOD);
      jsonResponse=new JsonParser().parse(result);
      return jsonResponse.getAsJsonObject();
    }
    String reason=null;
switch (code) {
case 500:
      reason=IoTFCReSTException.HTTP_INITIATE_DM_REQUEST_ERR_500;
    break;
default :
  reason=IoTFCReSTException.HTTP_ERR_UNEXPECTED;
}
throw new IoTFCReSTException(method,sb.toString(),request.toString(),code,reason,null);
}
 catch (Exception e) {
IoTFCReSTException ex=new IoTFCReSTException("String_Node_Str" + "String_Node_Str" + e.getMessage());
ex.initCause(e);
throw ex;
}
}

Fixed version (ground truth):
/** 
 * Initiates a device management request, such as reboot.
 * @param request JSON object containing the management request
 * @return JSON object containing the response from Watson IoT Platform
 * @throws IoTFCReSTException Failure in initiating a DM request
 */
public JsonObject initiateDMRequest(JsonObject request) throws IoTFCReSTException {
  final String METHOD="String_Node_Str";
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(orgId).append('.').append(this.domain).append(BASIC_API_V0002_URL).append("String_Node_Str");
  int code=0;
  HttpResponse response=null;
  JsonElement jsonResponse=null;
  String method="String_Node_Str";
  IoTFCReSTException ex=null;
  try {
    response=connect(method,sb.toString(),request.toString(),null);
    code=response.getStatusLine().getStatusCode();
switch (code) {
case 202:
      String result=this.readContent(response,METHOD);
    jsonResponse=new JsonParser().parse(result);
  break;
case 500:
ex=new IoTFCReSTException(method,sb.toString(),request.toString(),code,IoTFCReSTException.HTTP_INITIATE_DM_REQUEST_ERR_500,null);
break;
default :
ex=new IoTFCReSTException(method,sb.toString(),request.toString(),code,IoTFCReSTException.HTTP_ERR_UNEXPECTED,null);
}
}
 catch (Exception e) {
ex=new IoTFCReSTException("String_Node_Str" + "String_Node_Str" + e.getMessage());
ex.initCause(e);
}
if (jsonResponse != null) {
return jsonResponse.getAsJsonObject();
}
 else {
if (ex != null) {
throw ex;
}
return null;
}
}
Program: 34380
Project: 34380
Buggy source:
public APIClient(Properties opt) throws NoSuchAlgorithmException, KeyManagementException {
  boolean isGateway=false;
  String authKeyPassed=null;
  if ("String_Node_Str".equals(getAuthMethod(opt))) {
    isGateway=true;
  }
 else {
    authKeyPassed=opt.getProperty("String_Node_Str");
    if (authKeyPassed == null) {
      authKeyPassed=opt.getProperty("String_Node_Str");
    }
    authKey=trimedValue(authKeyPassed);
  }
  String token=opt.getProperty("String_Node_Str");
  if (token == null) {
    token=opt.getProperty("String_Node_Str");
  }
  authToken=trimedValue(token);
  String org=null;
  org=opt.getProperty("String_Node_Str");
  if (org == null) {
    org=opt.getProperty("String_Node_Str");
  }
  this.orgId=trimedValue(org);
  this.domain=getDomain(opt);
  if (isGateway) {
    authKey="String_Node_Str" + this.orgId + '/'+ this.getGWDeviceType(opt)+ '/'+ this.getGWDeviceId(opt);
  }
  sslContext=SSLContext.getInstance("String_Node_Str");
  sslContext.init(null,null,null);
}

Fixed version (ground truth):
public APIClient(Properties opt) throws NoSuchAlgorithmException, KeyManagementException {
  boolean isGateway=false;
  String authKeyPassed=null;
  if ("String_Node_Str".equals(getAuthMethod(opt))) {
    isGateway=true;
  }
 else {
    authKeyPassed=opt.getProperty("String_Node_Str");
    if (authKeyPassed == null) {
      authKeyPassed=opt.getProperty("String_Node_Str");
    }
    authKey=trimedValue(authKeyPassed);
  }
  String token=opt.getProperty("String_Node_Str");
  if (token == null) {
    token=opt.getProperty("String_Node_Str");
  }
  authToken=trimedValue(token);
  String org=null;
  org=opt.getProperty("String_Node_Str");
  if (org == null) {
    org=opt.getProperty("String_Node_Str");
  }
  this.orgId=trimedValue(org);
  this.domain=getDomain(opt);
  if (isGateway) {
    authKey="String_Node_Str" + this.orgId + '/'+ this.getGWDeviceType(opt)+ '/'+ this.getGWDeviceId(opt);
  }
  TrustManager[] trustAllCerts=new TrustManager[]{new X509TrustManager(){
    public java.security.cert.X509Certificate[] getAcceptedIssuers(){
      return new X509Certificate[0];
    }
    public void checkClientTrusted(    java.security.cert.X509Certificate[] certs,    String authType){
    }
    public void checkServerTrusted(    java.security.cert.X509Certificate[] certs,    String authType){
    }
  }
};
  sslContext=SSLContext.getInstance("String_Node_Str");
  sslContext.init(null,trustAllCerts,null);
}
Program: 34381
Project: 34381
Buggy source:
/** 
 * Note that this class does not have a default constructor <br> This class has only accessors and no mutators and later on might be made final <br>
 * @param command Actual command in the form of String passed
 * @param format Format is a String which can contain values such as "json"
 * @param msg MqttMessage 
 * @see <a href="http://www.eclipse.org/paho/files/javadoc/index.html">Paho Client Library</a> 
 * @throws UnsupportedEncodingException
 */
public Command(String command,String format,MqttMessage msg) throws UnsupportedEncodingException {
  super(msg);
  this.command=command;
  this.format=format;
}

Fixed version (ground truth):
/** 
 * Note that this class does not have a default constructor <br> This class has only accessors and no mutators and later on might be made final <br>
 * @param command Actual command in the form of String passed
 * @param format Format is a String which can contain values such as "json"
 * @param msg MqttMessage 
 * @see <a href="http://www.eclipse.org/paho/files/javadoc/index.html">Paho Client Library</a> 
 * @throws UnsupportedEncodingException When the Format is not UTF-8
 */
public Command(String command,String format,MqttMessage msg) throws UnsupportedEncodingException {
  super(msg);
  this.command=command;
  this.format=format;
}
Program: 34382
Project: 34382
Buggy source:
/** 
 * Create a device client for the IBM Watson IoT Platform. <br> Connecting to a specific account on the IoTF.
 * @throws Exception When there is a failure in parsing the properties passed 
 */
public DeviceClient(Properties options) throws Exception {
  super(options);
  LoggerUtility.fine(CLASS_NAME,"String_Node_Str","String_Node_Str" + options);
  this.clientId="String_Node_Str" + CLIENT_ID_DELIMITER + getOrgId()+ CLIENT_ID_DELIMITER+ getDeviceType()+ CLIENT_ID_DELIMITER+ getDeviceId();
  if (getAuthMethod() == null) {
    this.clientUsername=null;
    this.clientPassword=null;
  }
 else   if (!getAuthMethod().equals("String_Node_Str")) {
    throw new Exception("String_Node_Str" + getAuthMethod());
  }
 else {
    this.clientUsername="String_Node_Str";
    this.clientPassword=getAuthToken();
  }
  createClient(this.new MqttDeviceCallBack());
}

Fixed version (ground truth):
/** 
 * Create a device client for the IBM Watson IoT Platform. <br>
 * @param options the list of options containing the device registration details
 * @throws Exception When there is a failure in parsing the properties passed 
 */
public DeviceClient(Properties options) throws Exception {
  super(options);
  LoggerUtility.fine(CLASS_NAME,"String_Node_Str","String_Node_Str" + options);
  this.clientId="String_Node_Str" + CLIENT_ID_DELIMITER + getOrgId()+ CLIENT_ID_DELIMITER+ getDeviceType()+ CLIENT_ID_DELIMITER+ getDeviceId();
  if (getAuthMethod() == null) {
    this.clientUsername=null;
    this.clientPassword=null;
  }
 else   if (!getAuthMethod().equals("String_Node_Str")) {
    throw new Exception("String_Node_Str" + getAuthMethod());
  }
 else {
    this.clientUsername="String_Node_Str";
    this.clientPassword=getAuthToken();
  }
  createClient(this.new MqttDeviceCallBack());
}