nus-yam/ex-repair huggingface dataset:
Program: 178588
Project: 178588
Buggy source:
private BundleDescription[] getReexportedBundles(final BundleDescription bundleDescription){
  Assert.notNull(bundleDescription);
  Assert.assertTrue(bundleDescription.isResolved(),"String_Node_Str");
  final Set<BundleDescription> resultSet=new LinkedHashSet<BundleDescription>();
  for (  BundleSpecification specification : bundleDescription.getRequiredBundles()) {
    if (specification.isExported()) {
      final BundleDescription reexportedBundle=(BundleDescription)specification.getSupplier();
      resultSet.add(reexportedBundle);
      for (      BundleDescription rereexportedBundle : getReexportedBundles(reexportedBundle)) {
        resultSet.add(rereexportedBundle);
      }
    }
  }
  for (  BundleDescription fragment : bundleDescription.getFragments()) {
    resultSet.add(fragment);
    for (    BundleDescription reexportedBundle : getReexportedBundles(fragment)) {
      resultSet.add(reexportedBundle);
    }
  }
  return resultSet.toArray(new BundleDescription[resultSet.size()]);
}

Fixed version (ground truth):
private BundleDescription[] getReexportedBundles(final BundleDescription bundleDescription){
  Assert.notNull(bundleDescription);
  if (!bundleDescription.isResolved()) {
    String resolverErrors=TargetPlatformImpl.dumpResolverErrors(bundleDescription);
    String bundleInfo=TargetPlatformImpl.getBundleInfo(bundleDescription);
    throw new RuntimeException(String.format("String_Node_Str",bundleInfo,resolverErrors));
  }
  final Set<BundleDescription> resultSet=new LinkedHashSet<BundleDescription>();
  for (  BundleSpecification specification : bundleDescription.getRequiredBundles()) {
    if (specification.isExported()) {
      final BundleDescription reexportedBundle=(BundleDescription)specification.getSupplier();
      resultSet.add(reexportedBundle);
      for (      BundleDescription rereexportedBundle : getReexportedBundles(reexportedBundle)) {
        resultSet.add(rereexportedBundle);
      }
    }
  }
  for (  BundleDescription fragment : bundleDescription.getFragments()) {
    resultSet.add(fragment);
    for (    BundleDescription reexportedBundle : getReexportedBundles(fragment)) {
      resultSet.add(reexportedBundle);
    }
  }
  return resultSet.toArray(new BundleDescription[resultSet.size()]);
}
Program: 178589
Project: 178589
Buggy source:
/** 
 * <p> </p>
 * @param bundleDescription
 * @return
 */
public List<BundleDependency> resolveBundleClasspath(final BundleDescription bundleDescription){
  Assert.notNull(bundleDescription);
  if (!bundleDescription.isResolved()) {
    throw new RuntimeException("String_Node_Str");
  }
  for (  ExportPackageDescription exportPackageDescription : bundleDescription.getResolvedImports()) {
    addImportedPackage(exportPackageDescription);
  }
  for (  BundleDescription requiredBundle : bundleDescription.getResolvedRequires()) {
    addRequiredBundle(requiredBundle);
    for (    BundleDescription reexportedBundle : getReexportedBundles(requiredBundle)) {
      addRequiredBundle(reexportedBundle);
    }
  }
  return new LinkedList<BundleDependency>(_resolvedBundles.values());
}

Fixed version (ground truth):
/** 
 * <p> </p>
 * @param bundleDescription
 * @return
 */
public List<BundleDependency> resolveBundleClasspath(final BundleDescription bundleDescription){
  Assert.notNull(bundleDescription);
  if (!bundleDescription.isResolved()) {
    String resolverErrors=TargetPlatformImpl.dumpResolverErrors(bundleDescription);
    String bundleInfo=TargetPlatformImpl.getBundleInfo(bundleDescription);
    throw new RuntimeException(String.format("String_Node_Str",bundleInfo,resolverErrors));
  }
  for (  ExportPackageDescription exportPackageDescription : bundleDescription.getResolvedImports()) {
    addImportedPackage(exportPackageDescription);
  }
  for (  BundleDescription requiredBundle : bundleDescription.getResolvedRequires()) {
    addRequiredBundle(requiredBundle);
    for (    BundleDescription reexportedBundle : getReexportedBundles(requiredBundle)) {
      addRequiredBundle(reexportedBundle);
    }
  }
  return new LinkedList<BundleDependency>(_resolvedBundles.values());
}
Program: 178590
Project: 178590
Buggy source:
/** 
 * <p> </p>
 * @return
 */
private State resolve(){
  final State state=StateObjectFactory.defaultFactory.createState(true);
  for (  BundleDescription bundleDescription : getAllBundleDescriptions(this._configuration.isPreferProjects())) {
    final BundleDescription copy=StateObjectFactory.defaultFactory.createBundleDescription(bundleDescription);
    copy.setUserObject(bundleDescription.getUserObject());
    if (!state.addBundle(copy)) {
      throw new RuntimeException("String_Node_Str" + bundleDescription + "String_Node_Str");
    }
    if (A4ELogging.isTraceingEnabled()) {
      A4ELogging.trace("String_Node_Str",getBundleInfo(bundleDescription));
    }
  }
  final Properties platformProperties=this._configuration.getConfigurationProperties();
  if (A4ELogging.isDebuggingEnabled()) {
    A4ELogging.debug(Utilities.toString("String_Node_Str",platformProperties));
  }
  state.setPlatformProperties(platformProperties);
  state.resolve();
  final BundleDescription[] bundleDescriptions=state.getBundles();
  if (A4ELogging.isDebuggingEnabled()) {
    for (int i=0; i < bundleDescriptions.length; i++) {
      final BundleDescription description=bundleDescriptions[i];
      final ResolverError[] errors=state.getResolverErrors(description);
      if (!description.isResolved() || ((errors != null) && (errors.length != 0))) {
        if ((errors != null) && (errors.length == 1) && (errors[0].getType() == ResolverError.SINGLETON_SELECTION)) {
          A4ELogging.debug("String_Node_Str",getBundleInfo(description));
        }
 else {
          A4ELogging.debug("String_Node_Str",getBundleInfo(description));
          for (int j=0; j < errors.length; j++) {
            final ResolverError error=errors[j];
            A4ELogging.debug("String_Node_Str",error);
          }
        }
      }
    }
  }
  return state;
}

Fixed version (ground truth):
/** 
 * <p> </p>
 * @return
 */
private State resolve(){
  final State state=StateObjectFactory.defaultFactory.createState(true);
  for (  BundleDescription bundleDescription : getAllBundleDescriptions(this._configuration.isPreferProjects())) {
    final BundleDescription copy=StateObjectFactory.defaultFactory.createBundleDescription(bundleDescription);
    copy.setUserObject(bundleDescription.getUserObject());
    if (!state.addBundle(copy)) {
      throw new RuntimeException("String_Node_Str" + bundleDescription + "String_Node_Str");
    }
    if (A4ELogging.isTraceingEnabled()) {
      A4ELogging.trace("String_Node_Str",getBundleInfo(bundleDescription));
    }
  }
  final Properties platformProperties=this._configuration.getConfigurationProperties();
  if (A4ELogging.isDebuggingEnabled()) {
    A4ELogging.debug(Utilities.toString("String_Node_Str",platformProperties));
  }
  state.setPlatformProperties(platformProperties);
  state.resolve();
  final BundleDescription[] bundleDescriptions=state.getBundles();
  if (A4ELogging.isDebuggingEnabled()) {
    for (    BundleDescription description : bundleDescriptions) {
      A4ELogging.debug(dumpResolverErrors(description));
    }
  }
  return state;
}
Program: 178591
Project: 178591
Buggy source:
/** 
 * @param bundleDescription
 * @return
 */
private static String getBundleInfo(final BundleDescription bundleDescription){
  final BundleSource bundleSource=BundleSource.getBundleSource(bundleDescription);
  final StringBuffer buffer=new StringBuffer();
  buffer.append(bundleDescription.getSymbolicName()).append("String_Node_Str").append(bundleDescription.getVersion().toString()).append("String_Node_Str");
  if (bundleSource.isEclipseProject()) {
    buffer.append("String_Node_Str").append(bundleSource.getAsEclipseProject().getFolder());
  }
 else {
    buffer.append(bundleSource.getAsFile().getAbsolutePath());
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * <p> Returns the bundle info of the given bundle description. </p>
 * @param description the bundle description.
 * @return the bundle info of the given bundle description.
 */
static String getBundleInfo(final BundleDescription description){
  Assert.notNull(description);
  final BundleSource bundleSource=BundleSource.getBundleSource(description);
  final StringBuffer buffer=new StringBuffer();
  buffer.append(description.getSymbolicName()).append("String_Node_Str").append(description.getVersion().toString()).append("String_Node_Str");
  if (bundleSource.isEclipseProject()) {
    buffer.append("String_Node_Str").append(bundleSource.getAsEclipseProject().getFolder());
  }
 else {
    buffer.append(bundleSource.getAsFile().getAbsolutePath());
  }
  return buffer.toString();
}
Program: 178593
Project: 178593
Buggy source:
/** 
 * <p> </p>
 */
private void initialize(){
  assertTrue(!isInitialized(),"String_Node_Str");
  final Iterator<Object> iterator=this._serviceOrdering.iterator();
  while (iterator.hasNext()) {
    final Object service=iterator.next();
    if (service instanceof Lifecycle) {
      try {
        ((Lifecycle)service).initialize();
      }
 catch (      final Exception e) {
        throw new Ant4EclipseException(CoreExceptionCode.SERVICE_COULD_NOT_BE_INITIALIZED,e,service.getClass().getName());
      }
    }
  }
  setInitialized(true);
}

Fixed version (ground truth):
/** 
 * <p> </p>
 */
private void initialize(){
  assertTrue(!isInitialized(),"String_Node_Str");
  final Iterator<Object> iterator=this._serviceOrdering.iterator();
  while (iterator.hasNext()) {
    final Object service=iterator.next();
    if (service instanceof Lifecycle) {
      try {
        ((Lifecycle)service).initialize();
      }
 catch (      final Exception e) {
        throw new Ant4EclipseException(e,CoreExceptionCode.SERVICE_COULD_NOT_BE_INITIALIZED,service.getClass().getName());
      }
    }
  }
  setInitialized(true);
}
Program: 178594
Project: 178594
Buggy source:
@Override protected void doExecute(){
  for (  ScopedMacroDefinition<String> scopedMacroDefinition : this._macroExecutionDelegate.getScopedMacroDefinitions()) {
    MacroExecutionValues values=new MacroExecutionValues();
    values.getProperties().put("String_Node_Str",counter + "String_Node_Str");
    counter++;
    this._macroExecutionDelegate.executeMacroInstance(scopedMacroDefinition.getMacroDef(),values);
  }
}

Fixed version (ground truth):
@Override protected void doExecute(){
  for (  ScopedMacroDefinition<String> scopedMacroDefinition : this._macroExecutionDelegate.getScopedMacroDefinitions()) {
    this._macroExecutionDelegate.executeMacroInstance(scopedMacroDefinition.getMacroDef(),new MacroExecutionValuesProvider(){
      public MacroExecutionValues provideMacroExecutionValues(      MacroExecutionValues values){
        values.getProperties().put("String_Node_Str",counter + "String_Node_Str");
        counter++;
        return values;
      }
    }
);
  }
}
Program: 178596
Project: 178596
Buggy source:
/** 
 * Substitutes all occurences of an eclipse <b>variable</b> (aka as <b>property</b> in ant)in the given string. The value for a variable in <code>string</code> is first searched in <code>otherProperties</code>. If the value cannot be found there it will be resolved as eclipse would do it. If a variable contains an <b>argument</b> (<code>${workspace_loc:/path/to/myWorkspace}</code>) the <b>argument</b> is ignored.
 * @param string The string with variables
 * @param project The project that should be used for resolving variables like <code>project_loc</code>
 * @param otherProperties Table with variable names as keys and their values as values. Might be null.
 */
public final String resolveEclipseVariables(final String string,final EclipseProject project,final Map<String,String> otherProperties){
  Assert.notNull(string);
  final Map<String,String> eclipseVariables=getEclipseVariables(project);
  if (otherProperties != null) {
    eclipseVariables.putAll(otherProperties);
  }
  final String resolvedString=resolveProperties(string,eclipseVariables);
  return resolvedString;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final String resolveEclipseVariables(final String string,final EclipseProject project,final Map<String,String> otherProperties){
  Assert.notNull(string);
  final Map<String,String> eclipseVariables=getEclipseVariables(project);
  if (otherProperties != null) {
    eclipseVariables.putAll(otherProperties);
  }
  final String resolvedString=resolveProperties(string,eclipseVariables);
  return resolvedString;
}
Program: 178597
Project: 178597
Buggy source:
/** 
 * Returns a map with the eclipse variables where each key corresponds to a key allowing to access it's value.
 * @param project The Eclipse project allowing to produce some project specific variables.
 * @return The map providing the necessary (key, value) pairs.
 */
public final Map<String,String> getEclipseVariables(final EclipseProject project){
  final Map<String,String> eclipseVariables=new Hashtable<String,String>();
  eclipseVariables.putAll(this._eclipsevariables);
  if (project != null) {
    eclipseVariables.put("String_Node_Str",project.getFolder().getAbsolutePath());
    eclipseVariables.put("String_Node_Str","String_Node_Str");
    eclipseVariables.put("String_Node_Str",project.getFolder().getAbsolutePath());
    eclipseVariables.put("String_Node_Str",project.getFolderName());
    eclipseVariables.put("String_Node_Str",project.getFolderName());
  }
  return eclipseVariables;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final Map<String,String> getEclipseVariables(final EclipseProject project){
  final Map<String,String> eclipseVariables=new Hashtable<String,String>();
  eclipseVariables.putAll(this._eclipsevariables);
  if (project != null) {
    eclipseVariables.put("String_Node_Str",project.getFolder().getAbsolutePath());
    eclipseVariables.put("String_Node_Str","String_Node_Str");
    eclipseVariables.put("String_Node_Str",project.getFolder().getAbsolutePath());
    eclipseVariables.put("String_Node_Str",project.getFolderName());
    eclipseVariables.put("String_Node_Str",project.getFolderName());
  }
  return eclipseVariables;
}
Program: 178598
Project: 178598
Buggy source:
public void clear(){
  this._eclipsevariables.clear();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void clear(){
  this._eclipsevariables.clear();
}
Program: 178599
Project: 178599
Buggy source:
public boolean isInitialized(){
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean isInitialized(){
  return false;
}
Program: 178600
Project: 178600
Buggy source:
public void dispose(){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void dispose(){
}
Program: 178601
Project: 178601
Buggy source:
public void initialize(){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void initialize(){
}
Program: 178602
Project: 178602
Buggy source:
/** 
 * Changes a variable for this instance.
 * @param key The name of the variable.
 * @param value The value of the variable. A value of null causes the variable to be removed.
 */
public final void setEclipseVariable(final String key,final String value){
  if (value == null) {
    this._eclipsevariables.remove(key);
  }
 else {
    this._eclipsevariables.put(key,value);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final void setEclipseVariable(final String key,final String value){
  if (value == null) {
    this._eclipsevariables.remove(key);
  }
 else {
    this._eclipsevariables.put(key,value);
  }
}
Program: 178603
Project: 178603
Buggy source:
/** 
 * {@inheritDoc}
 */
public RawClasspathEntry[] getRawClasspathEntries(final int entrykind){
  final LinkedList<ClasspathEntry> templist=new LinkedList<ClasspathEntry>();
  for (  final ClasspathEntry entry : templist) {
    if (entry.getEntryKind() == entrykind) {
      templist.add(entry);
    }
  }
  final RawClasspathEntry[] result=new RawClasspathEntry[templist.size()];
  templist.toArray(result);
  return (result);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public RawClasspathEntry[] getRawClasspathEntries(final int entrykind){
  final LinkedList<ClasspathEntry> templist=new LinkedList<ClasspathEntry>();
  for (  final ClasspathEntry entry : this._eclipseClasspathEntries) {
    if (entry.getEntryKind() == entrykind) {
      templist.add(entry);
    }
  }
  final RawClasspathEntry[] result=new RawClasspathEntry[templist.size()];
  templist.toArray(result);
  return (result);
}
Program: 178605
Project: 178605
Buggy source:
@Override public void setUp() throws Exception {
  super.setUp();
  setupBuildFile("String_Node_Str");
  new EclipseProjectBuilder("String_Node_Str").withNature("String_Node_Str").createIn(_workspaceDir);
}

Fixed version (ground truth):
@Override public void setUp() throws Exception {
  super.setUp();
  setupBuildFile("String_Node_Str");
  new EclipseProjectBuilder("String_Node_Str").withNature("String_Node_Str").createIn(getWorkspaceDir());
}
Program: 178606
Project: 178606
Buggy source:
private static void configureAnt4Eclipse(final Ant4EclipseLogger logger,final Ant4EclipseConfiguration configuration){
  if (!ServiceRegistry.isConfigured()) {
    ServiceRegistry.configure(new ServiceRegistryConfiguration(){
      public void configure(      final ConfigurationContext context){
        context.registerService(logger,Ant4EclipseLogger.class.getName());
        context.registerService(configuration,Ant4EclipseConfiguration.class.getName());
        PropertiesBasedServiceRegistryConfiguration propertiesConfiguration=new PropertiesBasedServiceRegistryConfiguration(configuration);
        propertiesConfiguration.configure(context);
      }
    }
);
  }
}

Fixed version (ground truth):
private static void configureAnt4Eclipse(final Ant4EclipseLogger logger,final Ant4EclipseConfiguration configuration){
  ServiceRegistry.configure(new ServiceRegistryConfiguration(){
    public void configure(    final ConfigurationContext context){
      context.registerService(logger,Ant4EclipseLogger.class.getName());
      context.registerService(configuration,Ant4EclipseConfiguration.class.getName());
      PropertiesBasedServiceRegistryConfiguration propertiesConfiguration=new PropertiesBasedServiceRegistryConfiguration(configuration);
      propertiesConfiguration.configure(context);
    }
  }
);
}
Program: 178607
Project: 178607
Buggy source:
/** 
 * <p> Configures the   {@link ServiceRegistry}. The registry has to be configured before it can be used. </p>
 * @param configuration the service registry configuration
 */
public static void configure(final ServiceRegistryConfiguration configuration){
  parameterNotNull("String_Node_Str",configuration);
  assertTrue(!isConfigured(),"String_Node_Str");
  _instance=new ServiceRegistry();
  configuration.configure(_instance.new ConfigurationContextImpl());
  _configured=true;
  _instance.initialize();
}

Fixed version (ground truth):
/** 
 * <p> Configures the   {@link ServiceRegistry}. The registry has to be configured before it can be used. </p>
 * @param configuration the service registry configuration
 */
public static void configure(final ServiceRegistryConfiguration configuration){
  parameterNotNull("String_Node_Str",configuration);
  assertTrue(!isConfigured(),"String_Node_Str");
  _instance=new ServiceRegistry();
  configuration.configure(_instance.new ConfigurationContextImpl());
  _instance.initialize();
  _configured=true;
}
Program: 178608
Project: 178608
Buggy source:
/** 
 * <p> </p>
 */
private void dispose(){
  assertTrue(isInitialized(),"String_Node_Str");
  final Iterator<Object> iterator=this._serviceOrdering.iterator();
  while (iterator.hasNext()) {
    final Object service=iterator.next();
    if (service instanceof Lifecycle) {
      try {
        ((Lifecycle)service).dispose();
      }
 catch (      final Exception e) {
        throw new Ant4EclipseException(CoreExceptionCode.SERVICE_COULD_NOT_BE_DISPOSED,e,service.getClass().getName(),e.getMessage());
      }
    }
  }
  setInitialized(false);
}

Fixed version (ground truth):
/** 
 * <p> </p>
 */
private void dispose(){
  assertTrue(isInitialized(),"String_Node_Str");
  final Iterator<Object> iterator=this._serviceOrdering.iterator();
  while (iterator.hasNext()) {
    final Object service=iterator.next();
    if (service instanceof Lifecycle) {
      try {
        ((Lifecycle)service).dispose();
      }
 catch (      final Exception e) {
        System.err.println(String.format(CoreExceptionCode.SERVICE_COULD_NOT_BE_DISPOSED.getMessage(),service));
      }
    }
  }
  setInitialized(false);
}
Program: 178609
Project: 178609
Buggy source:
/** 
 * <p> Configures the   {@link ServiceRegistry}. The registry has to be configured before it can be used. </p>
 * @param configuration the service registry configuration
 */
public static void configure(final ServiceRegistryConfiguration configuration){
  parameterNotNull("String_Node_Str",configuration);
  assertTrue(!isConfigured(),"String_Node_Str");
  _instance=new ServiceRegistry();
  configuration.configure(_instance.new ConfigurationContextImpl());
  _instance.initialize();
  _configured=true;
}

Fixed version (ground truth):
/** 
 * <p> Configures the   {@link ServiceRegistry}. The registry has to be configured before it can be used. </p>
 * @param configuration the service registry configuration
 */
public static void configure(final ServiceRegistryConfiguration configuration){
  parameterNotNull("String_Node_Str",configuration);
  assertTrue(!isConfigured(),"String_Node_Str");
  _instance=new ServiceRegistry();
  configuration.configure(_instance.new ConfigurationContextImpl());
  _configured=true;
  try {
    _instance.initialize();
  }
 catch (  RuntimeException exception) {
    _configured=false;
    throw exception;
  }
}
Program: 178612
Project: 178612
Buggy source:
public int getString16Length(int pos){
  return 2 + getShort(pos);
}

Fixed version (ground truth):
public int getString16Length(int pos){
  return 2 + getShort(pos) * 2;
}
Program: 178613
Project: 178613
Buggy source:
public byte getHeight(){
  return getByte(17 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}

Fixed version (ground truth):
public byte getHeight(){
  return getByte(19 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}
Program: 178614
Project: 178614
Buggy source:
public byte getUnknown(){
  return getByte(16 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}

Fixed version (ground truth):
public byte getUnknown(){
  return getByte(18 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}
Program: 178615
Project: 178615
Buggy source:
public byte getDimension(){
  return getByte(15 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}

Fixed version (ground truth):
public byte getDimension(){
  return getByte(17 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}
Program: 178616
Project: 178616
Buggy source:
public byte getMaxPlayers(){
  return getByte(18 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}

Fixed version (ground truth):
public byte getMaxPlayers(){
  return getByte(20 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}
Program: 178620
Project: 178620
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder();
  boolean first=true;
  for (int cnt=0; cnt < end - start; cnt++) {
    if (!first) {
      sb.append("String_Node_Str");
    }
 else {
      first=false;
    }
    sb.append(Integer.toHexString(getByte(cnt) & 0xFF));
  }
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean first=true;
  for (int cnt=0; cnt < end - start; cnt++) {
    if (!first) {
      sb.append("String_Node_Str");
    }
 else {
      first=false;
    }
    sb.append(Integer.toHexString(getByte(cnt) & 0xFF));
  }
  return sb.append("String_Node_Str").toString();
}
Program: 178621
Project: 178621
Buggy source:
public byte getUnknown(){
  return getByte(18 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}

Fixed version (ground truth):
public byte getUnknown(){
  return getByte(getModeStart() + 8);
}
Program: 178622
Project: 178622
Buggy source:
public byte getDimension(){
  return getByte(17 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}

Fixed version (ground truth):
public int getDimension(){
  return getInt(getModeStart() + 4);
}
Program: 178623
Project: 178623
Buggy source:
public byte getMaxPlayers(){
  return getByte(20 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}

Fixed version (ground truth):
public byte getMaxPlayers(){
  return getByte(getModeStart() + 10);
}
Program: 178624
Project: 178624
Buggy source:
public int getMode(){
  return getInt(13 + getString16Length(5) + getString16Length(13 + getString16Length(5)));
}

Fixed version (ground truth):
public int getMode(){
  return getInt(getModeStart());
}
Program: 178625
Project: 178625
Buggy source:
public String getLevelType(){
  return getString16(13 + getString16Length(5));
}

Fixed version (ground truth):
public String getLevelType(){
  return getString16(getLevelStringStart());
}
Program: 178626
Project: 178626
Buggy source:
public short getHeight(){
  return getShort(4);
}

Fixed version (ground truth):
public short getHeight(){
  return getShort(7);
}
Program: 178627
Project: 178627
Buggy source:
public Packet09Respawn(byte dimension,byte unknown,byte creative,short height,long seed,String levelType){
  super(14 + levelType.length() + 2);
  super.writeByte((byte)0x09);
  super.writeByte(dimension);
  super.writeByte(unknown);
  super.writeByte(creative);
  super.writeShort(height);
  super.writeLong(seed);
  super.writeString16(levelType);
}

Fixed version (ground truth):
public Packet09Respawn(int dimension,byte difficulty,byte creative,short height,String levelType){
  super(14 + levelType.length() + 2);
  super.writeByte((byte)0x09);
  super.writeInt(dimension);
  super.writeByte(difficulty);
  super.writeByte(creative);
  super.writeShort(height);
  super.writeString16(levelType);
}
Program: 178628
Project: 178628
Buggy source:
public byte getDimension(){
  return getByte(1);
}

Fixed version (ground truth):
public int getDimension(){
  return getInt(1);
}
Program: 178629
Project: 178629
Buggy source:
public byte getCreative(){
  return getByte(3);
}

Fixed version (ground truth):
public byte getCreative(){
  return getByte(6);
}
Program: 178636
Project: 178636
Buggy source:
public byte getDimension(){
  return getByte(13 + getString16Length(5));
}

Fixed version (ground truth):
public byte getDimension(){
  return getByte(15 + getString16Length(5));
}
Program: 178637
Project: 178637
Buggy source:
public Packet09Respawn(byte dimension){
  super(2);
  super.writeByte((byte)0x09);
  super.writeByte(dimension);
}

Fixed version (ground truth):
public Packet09Respawn(byte dimension,byte unknown,byte creative,short height,long seed){
  super(14);
  super.writeByte((byte)0x09);
  super.writeByte(dimension);
  super.writeByte(unknown);
  super.writeByte(creative);
  super.writeShort(height);
  super.writeLong(seed);
}
Program: 178638
Project: 178638
Buggy source:
public Packet46Bed(int state){
  super(2);
  super.writeByte((byte)0x46);
  super.writeByte((byte)state);
}

Fixed version (ground truth):
public Packet46Bed(int state,int aux){
  super(3);
  super.writeByte((byte)0x46);
  super.writeByte((byte)state);
  super.writeByte((byte)aux);
}
Program: 178639
Project: 178639
Buggy source:
public void run(){
  c=new Compressor(ptc,fm,ptc.proxyListener.hs);
  AtomicBoolean compressing=ptc.connectionInfo.cacheInUse;
  while (!killed()) {
    Packet p=queue.poll();
    if (p != null) {
      int packetId=p.getByte(0) & 0xFF;
      if (packetId == 0x33) {
        if (compressing.get()) {
          Packet compressed=c.compress(p);
          fm.addPacketToLowQueue(out,compressed,t);
          ptc.connectionInfo.uploaded.addAndGet(compressed.end - compressed.start);
        }
 else {
          fm.addPacketToLowQueue(out,p,t);
          ptc.connectionInfo.uploaded.addAndGet(p.end - p.start);
        }
      }
 else       if (packetId == 0x51) {
        Packet decompressed=c.decompress(p,ptc);
        if (decompressed == null) {
          ptc.printLogMessage("String_Node_Str");
          ptc.interrupt();
        }
 else {
          fm.addPacketToLowQueue(out,decompressed,t);
          ptc.connectionInfo.uploaded.addAndGet(decompressed.end - decompressed.start);
        }
      }
 else {
        fm.addPacketToLowQueue(out,p,t);
        ptc.connectionInfo.uploaded.addAndGet(p.end - p.start);
      }
    }
synchronized (compSync) {
      try {
        if (!queue.isEmpty()) {
          continue;
        }
        compSync.wait(1000);
      }
 catch (      InterruptedException e) {
        kill();
        continue;
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  c=new Compressor(ptc,fm,ptc.proxyListener.hs);
  AtomicBoolean compressing=ptc.connectionInfo.cacheInUse;
  while ((!queue.isEmpty()) || (!killed())) {
    Packet p=queue.poll();
    if (p != null) {
      int packetId=p.getByte(0) & 0xFF;
      if (packetId == 0x33) {
        if (compressing.get()) {
          Packet compressed=c.compress(p);
          fm.addPacketToLowQueue(out,compressed,t);
          ptc.connectionInfo.uploaded.addAndGet(compressed.end - compressed.start);
        }
 else {
          fm.addPacketToLowQueue(out,p,t);
          ptc.connectionInfo.uploaded.addAndGet(p.end - p.start);
        }
      }
 else       if (packetId == 0x51) {
        Packet decompressed=c.decompress(p,ptc);
        if (decompressed == null) {
          ptc.printLogMessage("String_Node_Str");
          ptc.interrupt();
        }
 else {
          fm.addPacketToLowQueue(out,decompressed,t);
          ptc.connectionInfo.uploaded.addAndGet(decompressed.end - decompressed.start);
        }
      }
 else {
        fm.addPacketToLowQueue(out,p,t);
        ptc.connectionInfo.uploaded.addAndGet(p.end - p.start);
      }
    }
    if (!killed()) {
synchronized (compSync) {
        try {
          if (!queue.isEmpty()) {
            continue;
          }
          compSync.wait(1000);
        }
 catch (        InterruptedException e) {
          kill();
          continue;
        }
      }
    }
  }
}
Program: 178641
Project: 178641
Buggy source:
FairnessManager(){
  outputManager=new OutputManager();
  outputManager.start();
  outputManager.setName("String_Node_Str");
}

Fixed version (ground truth):
FairnessManager(){
}
Program: 178643
Project: 178643
Buggy source:
public void setByte(int pos,byte b){
  buffer[(pos++) & mask]=b;
}

Fixed version (ground truth):
public void setByte(int pos,byte b){
  buffer[(start + pos++) & mask]=b;
}
Program: 178644
Project: 178644
Buggy source:
public void setShort(int pos,short s){
  buffer[(pos++) & mask]=(byte)(s >> 8);
  buffer[(pos++) & mask]=(byte)(s >> 0);
}

Fixed version (ground truth):
public void setShort(int pos,short s){
  buffer[(start + pos++) & mask]=(byte)(s >> 8);
  buffer[(start + pos++) & mask]=(byte)(s >> 0);
}
Program: 178645
Project: 178645
Buggy source:
public void setInt(int pos,int i){
  buffer[(pos++) & mask]=(byte)(i >> 24);
  buffer[(pos++) & mask]=(byte)(i >> 16);
  buffer[(pos++) & mask]=(byte)(i >> 8);
  buffer[(pos++) & mask]=(byte)(i >> 0);
}

Fixed version (ground truth):
public void setInt(int pos,int i){
  buffer[(start + pos++) & mask]=(byte)(i >> 24);
  buffer[(start + pos++) & mask]=(byte)(i >> 16);
  buffer[(start + pos++) & mask]=(byte)(i >> 8);
  buffer[(start + pos++) & mask]=(byte)(i >> 0);
}
Program: 178646
Project: 178646
Buggy source:
public void setLong(int pos,long i){
  buffer[(pos++) & mask]=(byte)(i >> 56);
  buffer[(pos++) & mask]=(byte)(i >> 48);
  buffer[(pos++) & mask]=(byte)(i >> 40);
  buffer[(pos++) & mask]=(byte)(i >> 32);
  buffer[(pos++) & mask]=(byte)(i >> 24);
  buffer[(pos++) & mask]=(byte)(i >> 16);
  buffer[(pos++) & mask]=(byte)(i >> 8);
  buffer[(pos++) & mask]=(byte)(i >> 0);
}

Fixed version (ground truth):
public void setLong(int pos,long i){
  buffer[(start + pos++) & mask]=(byte)(i >> 56);
  buffer[(start + pos++) & mask]=(byte)(i >> 48);
  buffer[(start + pos++) & mask]=(byte)(i >> 40);
  buffer[(start + pos++) & mask]=(byte)(i >> 32);
  buffer[(start + pos++) & mask]=(byte)(i >> 24);
  buffer[(start + pos++) & mask]=(byte)(i >> 16);
  buffer[(start + pos++) & mask]=(byte)(i >> 8);
  buffer[(start + pos++) & mask]=(byte)(i >> 0);
}
Program: 178649
Project: 178649
Buggy source:
public void run(){
  while (!killed()) {
    long nextFlushLocal=nextFlush.get();
    long currentTime=System.currentTimeMillis();
    if (nextFlushLocal != 0 && nextFlushLocal + maxLatency < currentTime) {
      if (lock.tryLock()) {
        try {
          flush();
        }
 catch (        IOException e) {
        }
 finally {
          lock.unlock();
        }
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
synchronized (syncObj) {
      nextFlushLocal=nextFlush.get();
      currentTime=System.currentTimeMillis();
      long delay=Math.max(10L,Math.min(maxLatency,nextFlushLocal - currentTime));
      try {
        if (nextFlushLocal == 0) {
          syncObj.wait(500);
        }
 else {
          syncObj.wait(delay);
        }
      }
 catch (      InterruptedException ie) {
        kill();
        continue;
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (!killed()) {
    long nextFlushLocal=nextFlush.get();
    long currentTime=System.currentTimeMillis();
    if (nextFlushLocal != 0 && nextFlushLocal + maxLatency < currentTime) {
      if (lock.tryLock()) {
        try {
          flush();
        }
 catch (        IOException e) {
        }
 finally {
          lock.unlock();
        }
      }
 else {
      }
    }
synchronized (syncObj) {
      nextFlushLocal=nextFlush.get();
      currentTime=System.currentTimeMillis();
      long delay=Math.max(10L,Math.min(maxLatency,nextFlushLocal - currentTime));
      try {
        if (nextFlushLocal == 0) {
          syncObj.wait(500);
        }
 else {
          syncObj.wait(delay);
        }
      }
 catch (      InterruptedException ie) {
        kill();
        continue;
      }
    }
  }
}
Program: 178651
Project: 178651
Buggy source:
@Override public void addActionListener(ActionListener actionListener){
  this.actionListener=actionListener;
}

Fixed version (ground truth):
@Override public void addActionListener(ActionListener actionListener){
  actionListeners.add(actionListener);
}
Program: 178652
Project: 178652
Buggy source:
@Override public void fireActionActivated(){
  if (this.actionListener == null)   return;
  ActionEvent e=new ActionEvent(this,0,"String_Node_Str");
  this.actionListener.actionPerformed(e);
}

Fixed version (ground truth):
@Override public void fireActionActivated(){
  ActionEvent e=new ActionEvent(this,0,"String_Node_Str");
  for (  ActionListener anActionListener : this.actionListeners) {
    anActionListener.actionPerformed(e);
  }
}
Program: 178653
Project: 178653
Buggy source:
@Test public void testAdapterNativeListener() throws MalformedURLException {
  NativeTrayMock nativeTrayMock=new NativeTrayMock();
  LinuxTrayIconAdapter linuxTrayIconAdapter=makeSubject(nativeTrayMock);
  ActionListener actionListener=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      actionsPerformed.append("String_Node_Str");
    }
  }
;
  linuxTrayIconAdapter.addActionListener(actionListener);
  linuxTrayIconAdapter.fireActionActivated();
  linuxTrayIconAdapter.fireMenuAction(1);
  String actionList=actionsPerformed.toString().trim();
  Assert.assertEquals("String_Node_Str" + "String_Node_Str",actionList);
}

Fixed version (ground truth):
@Test public void testAdapterNativeListener() throws MalformedURLException {
  NativeTrayMock nativeTrayMock=new NativeTrayMock();
  LinuxTrayIconAdapter linuxTrayIconAdapter=makeSubject(nativeTrayMock);
  linuxTrayIconAdapter.fireActionActivated();
  ActionListener actionListener=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      actionsPerformed.append("String_Node_Str");
    }
  }
;
  linuxTrayIconAdapter.addActionListener(actionListener);
  ActionListener actionListener2=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      actionsPerformed.append("String_Node_Str");
    }
  }
;
  linuxTrayIconAdapter.addActionListener(actionListener2);
  linuxTrayIconAdapter.fireActionActivated();
  linuxTrayIconAdapter.fireMenuAction(1);
  String actionList=actionsPerformed.toString().trim();
  Assert.assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str",actionList);
}
Program: 178654
Project: 178654
Buggy source:
public ArgumentListBuilder getToolCmd(EnvVars envVars){
  ArgumentListBuilder toolCmd=new ArgumentListBuilder();
  if (getTool().equals("String_Node_Str")) {
    toolCmd.add("String_Node_Str","String_Node_Str");
    if (!StringUtils.isEmpty(getOutput())) {
      toolCmd.add("String_Node_Str",getOutput());
    }
  }
 else {
    toolCmd.add(getTool());
    if (!StringUtils.isEmpty(getOutput())) {
      toolCmd.add("String_Node_Str",getOutput());
    }
  }
  if (!StringUtils.isEmpty(getAdditionalOpts())) {
    toolCmd.addTokenized(envVars.expand(getAdditionalOpts()));
  }
  if (!StringUtils.isEmpty(getBuildCommand())) {
    toolCmd.add(getBuildCommand());
  }
  return toolCmd;
}

Fixed version (ground truth):
public ArgumentListBuilder getToolCmd(EnvVars envVars){
  ArgumentListBuilder toolCmd=new ArgumentListBuilder();
  if (getTool().equals("String_Node_Str")) {
    toolCmd.add("String_Node_Str","String_Node_Str");
    if (!StringUtils.isEmpty(getOutput())) {
      toolCmd.add("String_Node_Str",getOutput());
    }
  }
 else {
    toolCmd.add(getTool());
    if (!StringUtils.isEmpty(getOutput())) {
      toolCmd.add("String_Node_Str",getOutput());
    }
  }
  if (!StringUtils.isEmpty(getAdditionalOpts())) {
    toolCmd.addTokenized(envVars.expand(getAdditionalOpts()));
  }
  if (!StringUtils.isEmpty(getBuildCommand())) {
    toolCmd.addTokenized(envVars.expand(getBuildCommand()));
  }
  return toolCmd;
}
Program: 178655
Project: 178655
Buggy source:
public List<String> call() throws IOException {
  List<String> validFiles=new ArrayList<String>();
  HashSet<String> buildSpecFiles=new HashSet<String>();
  populateFileList();
  try (Scanner scanner=new Scanner(Paths.get(buildSpec))){
    while (scanner.hasNextLine()) {
      processBuildSpecLine(scanner.nextLine(),buildSpecFiles);
    }
  }
   for (  String file : fileList) {
    if (buildSpecFiles.contains(file)) {
      validFiles.add(file);
    }
  }
  return validFiles;
}

Fixed version (ground truth):
public List<String> call() throws IOException {
  List<String> validFiles=new ArrayList<String>();
  HashSet<String> buildSpecFiles=new HashSet<String>();
  populateFileList();
  try (Scanner scanner=new Scanner(Paths.get(buildSpec))){
    while (scanner.hasNextLine()) {
      processBuildSpecLine(scanner.nextLine(),buildSpecFiles);
    }
  }
   for (  String file : fileList) {
    for (    String bsFile : buildSpecFiles) {
      if ((bsFile.contains("String_Node_Str") && bsFile.toLowerCase().equals(file.toLowerCase())) || (!bsFile.contains("String_Node_Str") && bsFile.equals(file))) {
        validFiles.add(file);
      }
    }
  }
  return validFiles;
}
Program: 178656
Project: 178656
Buggy source:
public static ByteArrayOutputStream executeCommandParseOutput(Launcher launcher,FilePath buildDir,EnvVars envVars,ArgumentListBuilder cmds) throws AbortException {
  if (launcher.isUnix()) {
    cmds=new ArgumentListBuilder("String_Node_Str","String_Node_Str",cmds.toString());
  }
 else {
    cmds=cmds.toWindowsCommand();
  }
  try {
    ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
    launcher.launch().stdout(outputStream).stderr(outputStream).pwd(buildDir).envs(envVars).cmds(cmds).join();
    return outputStream;
  }
 catch (  IOException|InterruptedException ex) {
    throw new AbortException(ex.getMessage());
  }
}

Fixed version (ground truth):
public static ByteArrayOutputStream executeCommandParseOutput(Launcher launcher,FilePath buildDir,EnvVars envVars,ArgumentListBuilder cmds) throws AbortException {
  if (launcher.isUnix()) {
    cmds=new ArgumentListBuilder("String_Node_Str","String_Node_Str",cmds.toString());
  }
 else {
    cmds.add("String_Node_Str","String_Node_Str","String_Node_Str");
    cmds=new ArgumentListBuilder("String_Node_Str","String_Node_Str",cmds.toString());
  }
  try {
    ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
    launcher.launch().stdout(outputStream).stderr(outputStream).pwd(buildDir).envs(envVars).cmds(cmds).join();
    return outputStream;
  }
 catch (  IOException|InterruptedException ex) {
    throw new AbortException(ex.getMessage());
  }
}
Program: 178657
Project: 178657
Buggy source:
public static int executeCommand(Launcher launcher,TaskListener listener,FilePath buildDir,EnvVars envVars,ArgumentListBuilder cmds,boolean ignoreReturnCode) throws AbortException {
  if (launcher.isUnix()) {
    cmds=new ArgumentListBuilder("String_Node_Str","String_Node_Str",cmds.toString());
  }
 else {
    cmds=cmds.toWindowsCommand();
  }
  try {
    int returnCode=launcher.launch().stdout(listener).stderr(listener.getLogger()).pwd(buildDir).envs(envVars).cmds(cmds).join();
    listener.getLogger().println("String_Node_Str" + Integer.toString(returnCode));
    if (!ignoreReturnCode && returnCode != 0) {
      throw new AbortException("String_Node_Str");
    }
 else {
      return returnCode;
    }
  }
 catch (  IOException|InterruptedException ex) {
    throw new AbortException(ex.getMessage());
  }
}

Fixed version (ground truth):
public static int executeCommand(Launcher launcher,TaskListener listener,FilePath buildDir,EnvVars envVars,ArgumentListBuilder cmds,boolean ignoreReturnCode) throws AbortException {
  if (launcher.isUnix()) {
    cmds=new ArgumentListBuilder("String_Node_Str","String_Node_Str",cmds.toString());
  }
 else {
    cmds.add("String_Node_Str","String_Node_Str","String_Node_Str");
    cmds=new ArgumentListBuilder("String_Node_Str","String_Node_Str",cmds.toString());
  }
  try {
    int returnCode=launcher.launch().stdout(listener).stderr(listener.getLogger()).pwd(buildDir).envs(envVars).cmds(cmds).join();
    listener.getLogger().println("String_Node_Str" + Integer.toString(returnCode));
    if (!ignoreReturnCode && returnCode != 0) {
      throw new AbortException("String_Node_Str");
    }
 else {
      return returnCode;
    }
  }
 catch (  IOException|InterruptedException ex) {
    throw new AbortException(ex.getMessage());
  }
}
Program: 178658
Project: 178658
Buggy source:
public ArgumentListBuilder getKwcheckRunCmd(EnvVars envVars,FilePath workspace,String diffList) throws IOException, InterruptedException {
  ArgumentListBuilder kwcheckRunCmd=new ArgumentListBuilder("String_Node_Str","String_Node_Str");
  kwcheckRunCmd.add("String_Node_Str",getKwlpDir(workspace,envVars).getRemote());
  String licenseHost=envVars.get(KlocworkConstants.KLOCWORK_LICENSE_HOST);
  if (!StringUtils.isEmpty(licenseHost)) {
    kwcheckRunCmd.add("String_Node_Str",licenseHost);
  }
  String licensePort=envVars.get(KlocworkConstants.KLOCWORK_LICENSE_PORT);
  if (!StringUtils.isEmpty(licensePort)) {
    kwcheckRunCmd.add("String_Node_Str",licensePort);
  }
  String xmlReport=envVars.expand(KlocworkUtil.getDefaultKwcheckReportFile(reportFile));
  kwcheckRunCmd.add("String_Node_Str","String_Node_Str","String_Node_Str",xmlReport);
  kwcheckRunCmd.add("String_Node_Str",envVars.expand(KlocworkUtil.getDefaultBuildSpec(buildSpec)));
  if (!StringUtils.isEmpty(additionalOpts)) {
    kwcheckRunCmd.addTokenized(envVars.expand(additionalOpts));
  }
  kwcheckRunCmd.addTokenized(diffList);
  return kwcheckRunCmd;
}

Fixed version (ground truth):
public ArgumentListBuilder getKwcheckRunCmd(EnvVars envVars,FilePath workspace,String diffList) throws IOException, InterruptedException {
  ArgumentListBuilder kwcheckRunCmd=new ArgumentListBuilder("String_Node_Str","String_Node_Str");
  kwcheckRunCmd.add("String_Node_Str",getKwlpDir(workspace,envVars).getRemote());
  if (!StringUtils.isEmpty(envVars.get(KlocworkConstants.KLOCWORK_LICENSE_HOST))) {
    kwcheckRunCmd.add("String_Node_Str",envVars.get(KlocworkConstants.KLOCWORK_LICENSE_HOST));
    if (!StringUtils.isEmpty(envVars.get(KlocworkConstants.KLOCWORK_LICENSE_PORT))) {
      kwcheckRunCmd.add("String_Node_Str",envVars.get(KlocworkConstants.KLOCWORK_LICENSE_PORT));
    }
  }
  String xmlReport=envVars.expand(KlocworkUtil.getDefaultKwcheckReportFile(reportFile));
  kwcheckRunCmd.add("String_Node_Str","String_Node_Str","String_Node_Str",xmlReport);
  kwcheckRunCmd.add("String_Node_Str",envVars.expand(KlocworkUtil.getDefaultBuildSpec(buildSpec)));
  if (!StringUtils.isEmpty(additionalOpts)) {
    kwcheckRunCmd.addTokenized(envVars.expand(additionalOpts));
  }
  kwcheckRunCmd.addTokenized(diffList);
  return kwcheckRunCmd;
}
Program: 178659
Project: 178659
Buggy source:
public ArgumentListBuilder getKwbuildprojectCmd(EnvVars envVars) throws AbortException {
  ArgumentListBuilder kwbuildprojectCmd=new ArgumentListBuilder("String_Node_Str");
  kwbuildprojectCmd.add("String_Node_Str",envVars.expand(KlocworkUtil.getDefaultKwtablesDir(tablesDir)));
  kwbuildprojectCmd.add("String_Node_Str");
  kwbuildprojectCmd.add(envVars.get(KlocworkConstants.KLOCWORK_LICENSE_HOST));
  kwbuildprojectCmd.add("String_Node_Str");
  kwbuildprojectCmd.add(envVars.get(KlocworkConstants.KLOCWORK_LICENSE_PORT));
  kwbuildprojectCmd.add("String_Node_Str");
  kwbuildprojectCmd.add(KlocworkUtil.getKlocworkProjectUrl(envVars));
  if (incrementalAnalysis) {
    kwbuildprojectCmd.add("String_Node_Str");
  }
 else {
    kwbuildprojectCmd.add("String_Node_Str");
  }
  if (!StringUtils.isEmpty(additionalOpts)) {
    kwbuildprojectCmd.addTokenized(envVars.expand(additionalOpts));
  }
  kwbuildprojectCmd.add(envVars.expand(KlocworkUtil.getDefaultBuildSpec(buildSpec)));
  return kwbuildprojectCmd;
}

Fixed version (ground truth):
public ArgumentListBuilder getKwbuildprojectCmd(EnvVars envVars) throws AbortException {
  ArgumentListBuilder kwbuildprojectCmd=new ArgumentListBuilder("String_Node_Str");
  kwbuildprojectCmd.add("String_Node_Str",envVars.expand(KlocworkUtil.getDefaultKwtablesDir(tablesDir)));
  kwbuildprojectCmd.add("String_Node_Str");
  kwbuildprojectCmd.add(KlocworkUtil.getKlocworkProjectUrl(envVars));
  if (!StringUtils.isEmpty(envVars.get(KlocworkConstants.KLOCWORK_LICENSE_HOST))) {
    kwbuildprojectCmd.add("String_Node_Str",envVars.get(KlocworkConstants.KLOCWORK_LICENSE_HOST));
    if (!StringUtils.isEmpty(envVars.get(KlocworkConstants.KLOCWORK_LICENSE_PORT))) {
      kwbuildprojectCmd.add("String_Node_Str",envVars.get(KlocworkConstants.KLOCWORK_LICENSE_PORT));
    }
  }
  if (incrementalAnalysis) {
    kwbuildprojectCmd.add("String_Node_Str");
  }
 else {
    kwbuildprojectCmd.add("String_Node_Str");
  }
  if (!StringUtils.isEmpty(additionalOpts)) {
    kwbuildprojectCmd.addTokenized(envVars.expand(additionalOpts));
  }
  kwbuildprojectCmd.add(envVars.expand(KlocworkUtil.getDefaultBuildSpec(buildSpec)));
  return kwbuildprojectCmd;
}