auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Object serializeQueryCondition( SerializerProvider serializerProvider, JsonSerializer<?> serializer, String key, QueryCondition condition) { if (condition instanceof SimpleQueryCondition) { SimpleQueryCondition simple = (SimpleQueryCondition) condition; if (!simple.requiresSerialization() || simple.getValue() == null) { return simple.getValue(); } else { if (!isOperator(key)) { serializer = findQuerySerializer(false, key, serializerProvider, serializer); } return serializeQueryField(simple.getValue(), serializer, serializerProvider, key); } } else if (condition instanceof CollectionQueryCondition) { CollectionQueryCondition coll = (CollectionQueryCondition) condition; if (!isOperator(key)) { serializer = findQuerySerializer(coll.targetIsCollection(), key, serializerProvider, serializer); } List<Object> serializedConditions = new ArrayList<Object>(); for (QueryCondition item : coll.getValues()) { serializedConditions.add(serializeQueryCondition( serializerProvider, serializer, "$", item)); } return serializedConditions; } else { CompoundQueryCondition compound = (CompoundQueryCondition) condition; <START> if (!key.startsWith("$")) { <END> serializer = findQuerySerializer(compound.targetIsCollection(), key, serializerProvider, serializer); } return serializeQuery(serializerProvider, serializer, compound.getQuery()); } }</code><technical_language>change this isOperator</technical_language>

Target:
private static Object serializeQueryCondition( SerializerProvider serializerProvider, JsonSerializer<?> serializer, String key, QueryCondition condition) { if (condition instanceof SimpleQueryCondition) { SimpleQueryCondition simple = (SimpleQueryCondition) condition; if (!simple.requiresSerialization() || simple.getValue() == null) { return simple.getValue(); } else { if (!isOperator(key)) { serializer = findQuerySerializer(false, key, serializerProvider, serializer); } return serializeQueryField(simple.getValue(), serializer, serializerProvider, key); } } else if (condition instanceof CollectionQueryCondition) { CollectionQueryCondition coll = (CollectionQueryCondition) condition; if (!isOperator(key)) { serializer = findQuerySerializer(coll.targetIsCollection(), key, serializerProvider, serializer); } List<Object> serializedConditions = new ArrayList<Object>(); for (QueryCondition item : coll.getValues()) { serializedConditions.add(serializeQueryCondition( serializerProvider, serializer, "$", item)); } return serializedConditions; } else { CompoundQueryCondition compound = (CompoundQueryCondition) condition; if (!isOperator(key)) { serializer = findQuerySerializer(compound.targetIsCollection(), key, serializerProvider, serializer); } return serializeQuery(serializerProvider, serializer, compound.getQuery()); } }
Source:
<code>public boolean hasSubTypes() <START> { <END> if (linkedType!=null) { return linkedType.hasSubTypes(); } else return false; }</code><technical_language>linkedType null</technical_language>

Target:
public boolean hasSubTypes() { return linkedType.hasSubTypes(); }
Source:
<code>public FirebaseIndexListAdapter(Activity activity, Class<T> modelClass, @LayoutRes int modelLayout, Query keyQuery, DatabaseReference dataRef) { <START> init(activity, new FirebaseIndexArray<>(keyQuery, dataRef, this), modelClass, modelLayout); <END> }</code><technical_language>Hmm I happened here. init protected called super class "smells" wrong. problem is circular reference adapter array, SnapshotParser interface. thoughts this better</technical_language>

Target:
public FirebaseIndexListAdapter(Activity activity, Class<T> modelClass, @LayoutRes int modelLayout, Query keyQuery, DatabaseReference dataRef) { this(activity, new ClassSnapshotParser<>(modelClass), modelLayout, keyQuery, dataRef); }
Source:
<code>private ValueMetaInterface getValueFromSQLType( ResultSetMetaData rm, int i, boolean ignoreLength, boolean lazyConversion ) throws KettleDatabaseException, SQLException { <START> String name = null; <END> if ( databaseMeta.isMySQLVariant() ) { name = databaseMeta.getDatabaseInterface().getLegacyColumnName( getDatabaseMetaData(), rm, i ); } if ( Utils.isEmpty( name ) || Const.onlySpaces( name ) ) { name = "Field" + ( i + 1 ); } ValueMetaInterface valueMeta = null; for ( ValueMetaInterface valueMetaClass : valueMetaPluginClasses ) { ValueMetaInterface v = valueMetaClass.getValueFromSQLType( databaseMeta, name, rm, i, ignoreLength, lazyConversion ); if ( v != null ) { valueMeta = v; break; } } if ( valueMeta != null ) { return valueMeta; } throw new KettleDatabaseException( "Unable to handle database column '" + name + "', on column index " + i + " : not a handled data type" ); }</code><technical_language>need init a string in Java. initialized null</technical_language>

Target:
private ValueMetaInterface getValueFromSQLType( ResultSetMetaData rm, int i, boolean ignoreLength, boolean lazyConversion ) throws KettleDatabaseException, SQLException { String name; if ( databaseMeta.isMySQLVariant() ) { name = databaseMeta.getDatabaseInterface().getLegacyColumnName( getDatabaseMetaData(), rm, i ); } else { name = new String( rm.getColumnName( i ) ); } if ( Utils.isEmpty( name ) || Const.onlySpaces( name ) ) { name = "Field" + ( i + 1 ); } ValueMetaInterface valueMeta = null; for ( ValueMetaInterface valueMetaClass : valueMetaPluginClasses ) { ValueMetaInterface v = valueMetaClass.getValueFromSQLType( databaseMeta, name, rm, i, ignoreLength, lazyConversion ); if ( v != null ) { valueMeta = v; break; } } if ( valueMeta != null ) { return valueMeta; } throw new KettleDatabaseException( "Unable to handle database column '" + name + "', on column index " + i + " : not a handled data type" ); }
Source:
<code><START> public RepositoryObject setModel(Model model) { <END> this.model = model; return this; }</code><technical_language>Out of curiosity, is return type of this setter void</technical_language>

Target:
public void setModel(Model model) { this.model = model; }
Source:
<code>public static @CheckForNull Fingerprint load(@NonNull File file) throws IOException { XmlFile configFile = getConfigFile(file); <START> if(!configFile.exists()) <END> return null; try { Object loaded = configFile.read(); if (!(loaded instanceof Fingerprint)) { throw new IOException("Unexpected Fingerprint type. Expected " + Fingerprint.class + " or subclass but got " + (loaded != null ? loaded.getClass() : "null")); } Fingerprint f = (Fingerprint) loaded; return f; } catch (IOException e) { if(file.exists() && file.length()==0) { logger.log(Level.WARNING, "Size zero fingerprint. Disk corruption? {0}", configFile); file.delete(); return null; } String parseError = messageOfParseException(e); if (parseError != null) { logger.log(Level.WARNING, "Malformed XML in {0}: {1}", new Object[] {configFile, parseError}); file.delete(); return null; } logger.log(Level.WARNING, "Failed to load "+configFile,e); throw e; } }</code><technical_language>Curlies</technical_language>

Target:
public static @CheckForNull Fingerprint load(@NonNull File file) throws IOException { XmlFile configFile = getConfigFile(file); if(!configFile.exists()) { return null; } try { Object loaded = configFile.read(); if (!(loaded instanceof Fingerprint)) { throw new IOException("Unexpected Fingerprint type. Expected " + Fingerprint.class + " or subclass but got " + (loaded != null ? loaded.getClass() : "null")); } Fingerprint f = (Fingerprint) loaded; return f; } catch (IOException e) { if(file.exists() && file.length() == 0) { logger.log(Level.WARNING, "Size zero fingerprint. Disk corruption? {0}", configFile); file.delete(); return null; } String parseError = messageOfParseException(e); if (parseError != null) { logger.log(Level.WARNING, "Malformed XML in {0}: {1}", new Object[] {configFile, parseError}); file.delete(); return null; } logger.log(Level.WARNING, "Failed to load " + configFile, e); throw e; } }
Source:
<code>public static OGCGeometry createFromEsriGeometry(Geometry geometry, boolean multiType) { Geometry.Type type = geometry.getType(); switch (type) { case Polygon: { if (!multiType && ((Polygon) geometry).getExteriorRingCount() <= 1) { return new OGCPolygon((Polygon) geometry, null); } else { return new OGCMultiPolygon((Polygon) geometry, null); } } case Polyline: { if (!multiType && ((Polyline) geometry).getPathCount() <= 1) { return new OGCLineString((Polyline) geometry, 0, null); } else { return new OGCMultiLineString((Polyline) geometry, null); <START> } <END> } case MultiPoint: { if (!multiType && ((MultiPoint) geometry).getPointCount() <= 1) { if (geometry.isEmpty()) { return new OGCPoint(new Point(), null); } else { return new OGCPoint(((MultiPoint) geometry).getPoint(0), null); } } else { return new OGCMultiPoint((MultiPoint) geometry, null); } } case Point: { if (!multiType) { return new OGCPoint((Point) geometry, null); } else { return new OGCMultiPoint((Point) geometry, null); } } default: throw new IllegalArgumentException("Unexpected geometry type: " + type); } }</code><technical_language>is slice() call needed here</technical_language>

Target:
private static OGCGeometry createFromEsriGeometry(Geometry geometry, boolean multiType) { Geometry.Type type = geometry.getType(); switch (type) { case Polygon: { if (!multiType && ((Polygon) geometry).getExteriorRingCount() <= 1) { return new OGCPolygon((Polygon) geometry, null); } return new OGCMultiPolygon((Polygon) geometry, null); } case Polyline: { if (!multiType && ((Polyline) geometry).getPathCount() <= 1) { return new OGCLineString((Polyline) geometry, 0, null); } return new OGCMultiLineString((Polyline) geometry, null); } case MultiPoint: { if (!multiType && ((MultiPoint) geometry).getPointCount() <= 1) { if (geometry.isEmpty()) { return new OGCPoint(new Point(), null); } return new OGCPoint(((MultiPoint) geometry).getPoint(0), null); } return new OGCMultiPoint((MultiPoint) geometry, null); } case Point: { if (!multiType) { return new OGCPoint((Point) geometry, null); } return new OGCMultiPoint((Point) geometry, null); } default: throw new IllegalArgumentException("Unexpected geometry type: " + type); } }
Source:
<code><START> public boolean <END> checkPreConditions(Vendor<? extends T> vendor, IEclipseContext context) { final List<PreCondition> preConditionList = new ArrayList<PreCondition>(); final PreCondition[] preConditions = vendor.getClass().getAnnotationsByType(PreCondition.class); preConditionList.addAll(Arrays.asList(preConditions)); final PreConditions conditions = vendor.getClass().getAnnotation(PreConditions.class); if (conditions != null) { preConditionList.addAll(Arrays.asList(conditions.preConditions())); } for (final PreCondition preCondition : preConditionList) { if (!checkPreCondition(preCondition, vendor, context)) { return false; } } return true; }</code><technical_language>this protected visibility</technical_language>

Target:
public boolean checkPreConditions(Vendor<? extends T> vendor, IEclipseContext context) { final List<PreCondition> preConditionList = new ArrayList<PreCondition>(); final PreCondition preConditionAnnotation = vendor.getClass().getAnnotation(PreCondition.class); if (preConditionAnnotation != null) { preConditionList.add(preConditionAnnotation); } final PreConditions conditions = vendor.getClass().getAnnotation(PreConditions.class); if (conditions != null) { preConditionList.addAll(Arrays.asList(conditions.preConditions())); } for (final PreCondition preCondition : preConditionList) { if (!checkPreCondition(preCondition, vendor, context)) { return false; } } return true; }
Source:
<code>public int run() throws IOException { Preconditions.checkArgument(targets != null && targets.size() == 1, "A data file is required."); String source = targets.get(0); CodecFactory codecFactory = Codecs.avroCodec(compressionCodecName); Schema schema; if (avroSchemaFile != null) { schema = Schemas.fromAvsc(open(avroSchemaFile)); } else { schema = getAvroSchema(source); } Schema projection = filterSchema(schema, columns); Path outPath = qualifiedPath(outputPath); <START> FileSystem outFS = outPath.getFileSystem(getConf()); <END> if (!overwrite && outFS.exists(outPath)) { throw new FileAlreadyExistsException("Output file " + outputPath + " already exists"); } Iterable<Record> reader = openDataFile(source, projection); boolean threw = true; long count = 0; try { DatumWriter<Record> datumWriter = new GenericDatumWriter<>(schema); DataFileWriter<Record> w = new DataFileWriter<>(datumWriter); w.setCodec(codecFactory); try (DataFileWriter<Record> writer = w.create(projection, create(outputPath))) { for (Record record : reader) { writer.append(record); count += 1; } } threw = false; } catch (RuntimeException e) { throw new RuntimeException("Failed on record " + count, e); } finally { if (reader instanceof Closeable) { Closeables.close((Closeable) reader, threw); } } return 0; }</code><technical_language>SchemaCommand problem. Instead of throwing exception if file exists, adding a new method BaseCommand for overwrite case, creating file in this command (and in SchemaCommand)? this: a new createWithNoOverwrite, calls private create extra overwrite=false flag, fs.create this parameter value. this sound? remove this delete file section in this case, call createWithNoOverwrite overwrite is true, call create otherwise</technical_language>

Target:
public int run() throws IOException { Preconditions.checkArgument(targets != null && targets.size() == 1, "A data file is required."); String source = targets.get(0); CodecFactory codecFactory = Codecs.avroCodec(compressionCodecName); final Schema schema; if (avroSchemaFile != null) { schema = Schemas.fromAvsc(open(avroSchemaFile)); } else { schema = getAvroSchema(source); } final Schema projection = filterSchema(schema, columns); Iterable<Record> reader = openDataFile(source, projection); boolean threw = true; long count = 0; DatumWriter<Record> datumWriter = new GenericDatumWriter<>(schema); try (DataFileWriter<Record> fileWriter = new DataFileWriter<>(datumWriter)) { fileWriter.setCodec(codecFactory); try (OutputStream os = overwrite ? create(outputPath) : createWithNoOverwrite(outputPath); DataFileWriter<Record> writer = fileWriter.create(projection, os)) { for (Record record : reader) { writer.append(record); count += 1; } } threw = false; } catch (RuntimeException e) { throw new RuntimeException("Failed on record " + count, e); } finally { if (reader instanceof Closeable) { Closeables.close((Closeable) reader, threw); } } return 0; }
Source:
<code>private void handleError(Exception e, VDSStatus status) { log.errorFormat( "Host installation failed for host {0}, {1}.", getVds().getId(), getVds().getName(), e ); setVdsStatus(status); setSucceeded(false); _failureMessage = getErrorMessage(e.getMessage()); <START> addCustomValue("FailedInstallMessage", _failureMessage); <END> }</code><technical_language>extracted this code, notice this line is redundant done line 80. getError message line is done line 80 anyway.. For consideration</technical_language>

Target:
private void handleError(Exception e, VDSStatus status) { log.errorFormat( "Host installation failed for host {0}, {1}.", getVds().getId(), getVds().getName(), e ); setVdsStatus(status); setSucceeded(false); _failureMessage = e.getMessage(); }
Source:
<code>public void handleClusterCreationFailure(StackView stackView, Exception exception) { if (stackView.getClusterView() != null) { String errorMessage = getErrorMessageFromException(exception); clusterService.updateClusterStatusByStackId(stackView.getId(), CREATE_FAILED, errorMessage); <START> stackUpdater.updateStackStatus(stackView.getId(), DetailedStackStatus.AVAILABLE); <END> flowMessageService.fireEventAndLog(stackView.getId(), CREATE_FAILED.name(), CLUSTER_CREATE_FAILED, errorMessage); } else { LOGGER.info("Cluster was null. Flow action was not required."); } }</code><technical_language>Duplication ClusterCreationService</technical_language>

Target:
public void handleClusterCreationFailure(StackView stackView, Exception exception) { if (stackView.getClusterView() != null) { String errorMessage = clusterCreationService.getErrorMessageFromException(exception); clusterService.updateClusterStatusByStackId(stackView.getId(), UPDATE_FAILED, errorMessage); stackUpdater.updateStackStatus(stackView.getId(), DetailedStackStatus.AVAILABLE); flowMessageService.fireEventAndLog(stackView.getId(), UPDATE_FAILED.name(), CLUSTER_SALT_UPDATE_FAILED, errorMessage); } else { LOGGER.info("Cluster was null. Flow action was not required."); } }
Source:
<code>public static Status fromValue(String value) { Optional<Status> status = Enums.getIfPresent(Status.class, value.toUpperCase()); <START> checkArgument(status.isPresent(), "%s is not a valid value", value); <END> return status.get(); }</code><technical_language>print values _are_ valid in error</technical_language>

Target:
public static Status fromValue(String value) { Optional<Status> status = Enums.getIfPresent(Status.class, value.toUpperCase()); checkArgument(status.isPresent(), "Expected one of %s but was %s", Joiner.on(',').join(Status.values()), value); return status.get(); }
Source:
<code>protected ChartDataBase(Chart chartContainer) { this.container = chartContainer; chartContainer.addDataComponent(this); initChartData(); <START> DataSourceValue(""); <END> threadRunner = Executors.newSingleThreadExecutor(); container.$form().registerForOnBeforeInitialize(this); }</code><technical_language>initialize other defaults in initChartData. this moved there</technical_language>

Target:
protected ChartDataBase(Chart chartContainer) { this.container = chartContainer; chartContainer.addDataComponent(this); initChartData(); DataSourceKey(""); threadRunner = Executors.newSingleThreadExecutor(); }
Source:
<code>public ConceptName getShortNameInLocale(Locale locale) { ConceptName bestMatch = null; <START> if (locale != null && !getShortNames().isEmpty()) { <END> for (ConceptName shortName : getShortNames()) { Locale nameLocale = shortName.getLocale(); if (nameLocale.equals(locale)) { return shortName; } if (OpenmrsUtil.nullSafeEquals(locale.getLanguage(), nameLocale.getLanguage())) { bestMatch = shortName; } else if (bestMatch == null && StringUtils.isNotBlank(locale.getCountry()) && locale.getCountry().equals(nameLocale.getCountry())) { bestMatch = shortName; } } } return bestMatch; }</code><technical_language>CollectionUtils.isNotEmpty()</technical_language>

Target:
public ConceptName getShortNameInLocale(Locale locale) { ConceptName bestMatch = null; if (locale != null && CollectionUtils.isNotEmpty(getShortNames())) { for (ConceptName shortName : getShortNames()) { Locale nameLocale = shortName.getLocale(); if (nameLocale.equals(locale)) { return shortName; } if (OpenmrsUtil.nullSafeEquals(locale.getLanguage(), nameLocale.getLanguage())) { bestMatch = shortName; } else if (bestMatch == null && StringUtils.isNotBlank(locale.getCountry()) && locale.getCountry().equals(nameLocale.getCountry())) { bestMatch = shortName; } } } return bestMatch; }
Source:
<code>private JLoadProfileRps(Builder builder) { <START> Objects.nonNull(builder); <END> this.requestsPerSecond = builder.requestsPerSecond; this.maxLoadThreads = builder.maxLoadThreads; this.warmUpTimeInSeconds = builder.warmUpTimeInSeconds; this.tickInterval = builder.tickInterval; }</code><technical_language>Objects.requireNonNull</technical_language>

Target:
private JLoadProfileRps(Builder builder) { Objects.requireNonNull(builder); this.requestsPerSecond = builder.requestsPerSecond; this.maxLoadThreads = builder.maxLoadThreads; this.warmUpTimeInSeconds = builder.warmUpTimeInSeconds; this.tickInterval = builder.tickInterval; }
Source:
<code>protected void onPostExecute(LoginStatus status) { super.onPostExecute(status); if (status!=LoginStatus.OK) { Toast.makeText(appContext, appContext.getString(R.string.error_sync, appContext.getString(status.str)), Toast.LENGTH_LONG).show(); for (Throwable e : exceptions) { Toast.makeText(appContext, e.getClass().getName() + ": " + e.getMessage(), Toast.LENGTH_LONG).show(); } } syncActive = false; for (ICallback callback : callbacks) { callback.onFinish(); } if(syncScheduled) { scheduleSync(false); } <START> } <END></code><technical_language>I this removed. receive changes server (new note, deleted notes updated notes), widgets updated</technical_language>

Target:
protected void onPostExecute(LoginStatus status) { super.onPostExecute(status); if (status!=LoginStatus.OK) { Toast.makeText(appContext, appContext.getString(R.string.error_sync, appContext.getString(status.str)), Toast.LENGTH_LONG).show(); for (Throwable e : exceptions) { Toast.makeText(appContext, e.getClass().getName() + ": " + e.getMessage(), Toast.LENGTH_LONG).show(); } } syncActive = false; for (ICallback callback : callbacks) { callback.onFinish(); } dbHelper.notifyNotesChanged(); if(syncScheduled) { scheduleSync(false); } }
Source:
<code>public DispatchCall(ExceptionHandler exceptionHandler, SecurityCookieAccessor securityCookieAccessor, A action, AsyncCallback<R> callback) { this.action = action; this.callback = callback; this.exceptionHandler = exceptionHandler; this.securityCookieAccessor = securityCookieAccessor; <START> prepareCall(); <END> }</code><technical_language>This done in class life cycle (not in ctor)</technical_language>

Target:
public DispatchCall( ExceptionHandler exceptionHandler, SecurityCookieAccessor securityCookieAccessor, A action, AsyncCallback<R> callback) { this.action = action; this.callback = callback; this.exceptionHandler = exceptionHandler; this.securityCookieAccessor = securityCookieAccessor; }
Source:
<code>public Object compute(Map<String, Object> combinedAggregators) { <START> fn = getCompiledScript(); <END> final Object[] args = new Object[fieldNames.size()]; int i = 0; for (String field : fieldNames) { args[i++] = combinedAggregators.get(field); } return fn.apply(args); }</code><technical_language>above, introduce a local variable getCompiledScript() in expression, reassign volatile field</technical_language>

Target:
public Object compute(Map<String, Object> combinedAggregators) { Function fn = getCompiledScript(); final Object[] args = new Object[fieldNames.size()]; int i = 0; for (String field : fieldNames) { args[i++] = combinedAggregators.get(field); } return fn.apply(args); }
Source:
<code>protected boolean canDoAction() { boolean toReturn = false; if (VdcActionType.RecoveryStoragePool.equals(getActionType()) && !IrsBrokerCommand.tryLockIrsProxyData(getStoragePool().getId())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_DURING_RECONSTRUCT); <START> return false; <END> } else { IrsBrokerCommand.lockIrsProxyData(getStoragePool().getId()); } try { toReturn = performChecks(); } catch (Exception e) { toReturn = false; } finally { IrsBrokerCommand.unLockIrsProxyData(getStoragePool().getId()); } return toReturn; }</code><technical_language>addCanDoActionMessage + return false = failCanDoAction</technical_language>

Target:
protected boolean canDoAction() { boolean toReturn = false; if (VdcActionType.RecoveryStoragePool.equals(getActionType()) && !IrsBrokerCommand.tryLockIrsProxyData(getStoragePool().getId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_DURING_RECONSTRUCT); } else { if (!IrsBrokerCommand.lockIrsProxyData(getStoragePool().getId())) { return false; } } try { toReturn = performChecks(); } catch (Exception e) { toReturn = false; } finally { if (toReturn) { IrsBrokerCommand.unLockIrsProxyData(getStoragePool().getId()); } } return toReturn; }
Source:
<code>private void findTargetGroupsAndFire( <START> final ReturnFire returnFire, <END> final String stepName, final boolean defending, final GamePlayer firingPlayer, final Predicate<Unit> firingUnitPredicate, final Collection<Unit> firingUnits, final Collection<Unit> firingUnitsWaitingToDie, final Collection<Unit> enemyUnits, final Collection<Unit> enemyUnitsWaitingToDie) { Collection<Unit> firing = new ArrayList<>(firingUnits); firing.addAll(firingUnitsWaitingToDie); firing = CollectionUtils.getMatches(firing, firingUnitPredicate); if (!defending && !Properties.getAlliedAirIndependent(gameData)) { firing = CollectionUtils.getMatches(firing, Matches.unitIsOwnedBy(attacker)); } final List<Unit> allEnemyUnitsAliveOrWaitingToDie = new ArrayList<>(enemyUnits); allEnemyUnitsAliveOrWaitingToDie.addAll(enemyUnitsWaitingToDie); final List<Unit> allFriendlyUnitsAliveOrWaitingToDie = new ArrayList<>(firingUnits); allFriendlyUnitsAliveOrWaitingToDie.addAll(firingUnitsWaitingToDie); for (final TargetGroup firingGroup : TargetGroup.newTargetGroups(firing, enemyUnits)) { fire( stepName, firingGroup.getFiringUnits(firing), firingGroup.getTargetUnits(enemyUnits), allEnemyUnitsAliveOrWaitingToDie, allFriendlyUnitsAliveOrWaitingToDie, defending, returnFire, firingGroup.getMessage(firingPlayer)); } }</code><technical_language>Method findTargetGroupsAndFire 9 arguments (exceeds 4 allowed). Consider refactoring</technical_language>

Target:
private void findTargetGroupsAndFire( final ReturnFire returnFire, final String stepName, final boolean defending, final GamePlayer firingPlayer, final Predicate<Unit> firingUnitPredicate, final Collection<Unit> firingUnits, final Collection<Unit> firingUnitsWaitingToDie, final Collection<Unit> enemyUnits, final Collection<Unit> enemyUnitsWaitingToDie) { Collection<Unit> firing = new ArrayList<>(firingUnits); firing.addAll(firingUnitsWaitingToDie); firing = CollectionUtils.getMatches(firing, firingUnitPredicate); if (!defending && !Properties.getAlliedAirIndependent(gameData)) { firing = CollectionUtils.getMatches(firing, Matches.unitIsOwnedBy(attacker)); } final List<Unit> allEnemyUnitsAliveOrWaitingToDie = new ArrayList<>(enemyUnits); allEnemyUnitsAliveOrWaitingToDie.addAll(enemyUnitsWaitingToDie); final List<Unit> allFriendlyUnitsAliveOrWaitingToDie = new ArrayList<>(firingUnits); allFriendlyUnitsAliveOrWaitingToDie.addAll(firingUnitsWaitingToDie); for (final TargetGroup firingGroup : TargetGroup.newTargetGroups(firing, enemyUnits)) { fire( stepName, firingGroup.getFiringUnits(firing), firingGroup.getTargetUnits(enemyUnits), allEnemyUnitsAliveOrWaitingToDie, allFriendlyUnitsAliveOrWaitingToDie, defending, returnFire, firingPlayer.getName() + " fire, "); } }
Source:
<code>public void testNestedExpressions() { <START> exressionTransformTest("${Prop1:${Prop2:default}1}", "default1"); <END> }</code><technical_language>is a valid expression - ${Prop1:${Prop2:default}} -> default</technical_language>

Target:
public void testNestedExpressions() { expressionTransformTest("${Prop1:${Prop2:default}}", "default"); }
Source:
<code>protected void localFileReflectionAttack(HttpMessage msg) { Matcher matcher; String localFile; String response; String payload = null; try { String requestBody = createLfrPayload(msg.getRequestBody().toString()); <START> <END> for (int idx = 0; idx < LOCAL_FILE_TARGETS.length; idx++) { localFile = LOCAL_FILE_TARGETS[idx]; payload = MessageFormat.format(requestBody, localFile); msg.setRequestBody(payload); sendAndReceive(msg); response = msg.getResponseBody().toString(); matcher = LOCAL_FILE_PATTERNS[idx].matcher(response); if (matcher.find()) { newAlert() .setConfidence(Alert.CONFIDENCE_MEDIUM) .setAttack(payload) .setEvidence(matcher.group()) .setMessage(msg) .raise(); } if (isStop()) { return; } } } catch (IOException ex) { log.warn( "XXE Injection vulnerability check failed for payload [" + payload + "] due to an I/O error", ex); } }</code><technical_language>suggestion</technical_language>

Target:
private void localFileReflectionAttack(HttpMessage msg) { String payload = null; try { String requestBody = createLfrPayload(msg.getRequestBody().toString()); for (int idx = 0; idx < LOCAL_FILE_TARGETS.length; idx++) { String localFile = LOCAL_FILE_TARGETS[idx]; payload = MessageFormat.format(requestBody, localFile); msg.setRequestBody(payload); sendAndReceive(msg); String response = msg.getResponseBody().toString(); Matcher matcher = LOCAL_FILE_PATTERNS[idx].matcher(response); if (matcher.find()) { newAlert() .setConfidence(Alert.CONFIDENCE_MEDIUM) .setAttack(payload) .setEvidence(matcher.group()) .setMessage(msg) .raise(); } if (isStop()) { return; } } } catch (IOException ex) { log.warn( "XXE Injection vulnerability check failed for payload [" + payload + "] due to an I/O error", ex); } }
Source:
<code>public void testTagWithColon() { final SAMRecordSetBuilder samBuilder = new SAMRecordSetBuilder(); samBuilder.addUnmappedFragment("Hi,Mom!"); final SAMRecord rec = samBuilder.iterator().next(); final String valueWithColons = "A:B::C:::"; rec.setAttribute(SAMTag.CQ.name(), valueWithColons); final ByteArrayOutputStream os = new ByteArrayOutputStream(); final SAMFileWriter textWriter = new SAMFileWriterFactory().makeSAMWriter(samBuilder.getHeader(), true, os); textWriter.addAlignment(rec); textWriter.close(); <START> final SamReader reader = SamReaderFactory.makeDefault().open(SamInputResource.of(new ByteArrayInputStream(os.toByteArray()))); <END> final SAMRecord recFromText = reader.iterator().next(); Assert.assertEquals(recFromText.getAttribute(SAMTag.CQ.name()), valueWithColons); }</code><technical_language>close reader</technical_language>

Target:
public void testTagWithColon() { final SAMRecordSetBuilder samBuilder = new SAMRecordSetBuilder(); samBuilder.addUnmappedFragment("Hi,Mom!"); final SAMRecord rec = samBuilder.iterator().next(); final String valueWithColons = "A:B::C:::"; rec.setAttribute(SAMTag.CQ.name(), valueWithColons); final ByteArrayOutputStream os = new ByteArrayOutputStream(); final SAMFileWriter textWriter = new SAMFileWriterFactory().makeSAMWriter(samBuilder.getHeader(), true, os); textWriter.addAlignment(rec); textWriter.close(); final SamReader reader = SamReaderFactory.makeDefault().open(SamInputResource.of(new ByteArrayInputStream(os.toByteArray()))); final SAMRecord recFromText = reader.iterator().next(); Assert.assertEquals(recFromText.getAttribute(SAMTag.CQ.name()), valueWithColons); CloserUtil.close(reader); }
Source:
<code>public void testGetAllEntitiesForStorageDomain() { List<OvfEntityData> ovfEntityDataList = dao.getAllForStorageDomainByEntityType(FixturesTool.STORAGE_DOAMIN_NFS2_1, null); <START> assertTrue("There should be entities fetched for the specified storage domain", !ovfEntityDataList.isEmpty()); <END> assertEquals("A Template and a VM should be fetched for the specified storage domain", 2, ovfEntityDataList.size()); }</code><technical_language>point in asserting list empty - check size next line. do is assert null</technical_language>

Target:
public void testGetAllEntitiesForStorageDomain() { List<OvfEntityData> ovfEntityDataList = dao.getAllForStorageDomainByEntityType(FixturesTool.STORAGE_DOAMIN_NFS2_1, null); assertEquals("A Template and a VM should be fetched for the specified storage domain", 2, ovfEntityDataList.size()); }
Source:
<code>protected static URI makeURI(String host, String requestURI, String rawQueryString) { try { return new URI( "http", host, requestURI, rawQueryString == null ? null : URLDecoder.decode(rawQueryString, "UTF-8"), null ); } catch (UnsupportedEncodingException | URISyntaxException e) { <START> log.error(e, "Unable to rewrite URI", e.getMessage()); <END> throw Throwables.propagate(e); } }</code><technical_language>log.error simply print out extraneous arguments</technical_language>

Target:
protected static URI makeURI(String host, String requestURI, String rawQueryString) { try { return new URI( "http", host, requestURI, rawQueryString == null ? null : URLDecoder.decode(rawQueryString, "UTF-8"), null ); } catch (UnsupportedEncodingException | URISyntaxException e) { log.error(e, "Unable to rewrite URI [%s]", e.getMessage()); throw Throwables.propagate(e); } }
Source:
<code>private void populateChangeRow(final int row, final ChangeInfo c, final ChangeRowFormatter changeRowFormatter) { ChangeCache cache = ChangeCache.get(c.getId()); cache.getChangeInfoCache().set(c); table.setWidget(row, C_ARROW, null); if (Gerrit.isSignedIn()) { table.setWidget(row, C_STAR, StarredChanges.createIcon(c.getId(), c.isStarred())); } String s = Util.cropSubject(c.getSubject()); if (c.getStatus() != null && c.getStatus() != Change.Status.NEW) { s += " (" + c.getStatus().name() + ")"; } if (changeRowFormatter != null) { removeChangeStyle(row, changeRowFormatter); final String rowStyle = changeRowFormatter.getRowStyle(c); if (rowStyle != null) { table.getRowFormatter().addStyleName(row, rowStyle); } s = changeRowFormatter.getDisplayText(c, s); } table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c)); table.setWidget(row, C_OWNER, link(c.getOwner())); table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey(), c .getStatus())); table.setWidget(row, C_BRANCH, new BranchLink(c.getProject().getKey(), c .getStatus(), c.getBranch(), c.getTopic())); <START> table.setText(row, C_PATCHSET_NUM, "" + c.getPatchSetId().get()); <END> table.setText(row, C_LAST_UPDATE, shortFormat(c.getLastUpdatedOn())); setRowItem(row, c); }</code><technical_language>c.getPatchSetId() returns null here. This is clicking a change in dependencies list fails. question is ChangeDetailFactory is setting it</technical_language>

Target:
private void populateChangeRow(final int row, final ChangeInfo c, final ChangeRowFormatter changeRowFormatter) { ChangeCache cache = ChangeCache.get(c.getId()); cache.getChangeInfoCache().set(c); table.setWidget(row, C_ARROW, null); if (Gerrit.isSignedIn()) { table.setWidget(row, C_STAR, StarredChanges.createIcon(c.getId(), c.isStarred())); } String s = Util.cropSubject(c.getSubject()); if (c.getStatus() != null && c.getStatus() != Change.Status.NEW) { s += " (" + c.getStatus().name() + ")"; } if (changeRowFormatter != null) { removeChangeStyle(row, changeRowFormatter); final String rowStyle = changeRowFormatter.getRowStyle(c); if (rowStyle != null) { table.getRowFormatter().addStyleName(row, rowStyle); } s = changeRowFormatter.getDisplayText(c, s); } table.setWidget(row, C_SUBJECT, new TableChangeLink(s, c)); table.setWidget(row, C_OWNER, link(c.getOwner())); table.setWidget(row, C_PROJECT, new ProjectLink(c.getProject().getKey(), c .getStatus())); table.setWidget(row, C_BRANCH, new BranchLink(c.getProject().getKey(), c .getStatus(), c.getBranch(), c.getTopic())); final PatchSet.Id patchSetId = c.getPatchSetId(); String patchSetNumber = "-"; if (patchSetId != null) { patchSetNumber = "" + patchSetId.get(); } table.setText(row, C_PATCHSET_NUM, patchSetNumber); table.setText(row, C_LAST_UPDATE, shortFormat(c.getLastUpdatedOn())); setRowItem(row, c); }
Source:
<code>private static String getDescription(@NotNull Throwable t) { boolean isAndroid = false; for (StackTraceElement el : t.getStackTrace()) { if (el.getClassName().contains("android")) { isAndroid = true; break; } } String prefix = isAndroid ? "android:" : ""; <START> String desc = prefix + t.toString(); <END> if (desc.length() > 150) { desc = desc.substring(0, 150); } return desc; }</code><technical_language>t.getClass().getSimpleName(); + filename + line number</technical_language>

Target:
public static String getDescription(@NotNull Throwable t) { boolean isAndroid = false; for (StackTraceElement el : t.getStackTrace()) { if (el.getClassName().contains("android")) { isAndroid = true; break; } } String sourceLocation = ""; if (t.getStackTrace().length > 0) { StackTraceElement loc = t.getStackTrace()[0]; sourceLocation = " @ " + loc.getFileName() + ":" + loc.getLineNumber(); } String prefix = isAndroid ? "android:" : ""; String desc = prefix + t.getClass().getSimpleName() + sourceLocation; if (desc.length() > 150) { desc = desc.substring(0, 150); } return desc; }
Source:
<code>@Override public void spiStart(@Nullable String igniteInstanceName) throws IgniteSpiException { initializeImpl(); MetricRegistry discoReg = <START> ((IgniteEx)ignite()).context().metric().registry(metricName("io", "discovery")); <END> stats = new TcpDiscoveryStatistics(discoReg); discoReg.register("MessageWorkerQueueSize", () -> impl.getMessageWorkerQueueSize(), "Message worker queue current size"); discoReg.register("CurrentTopologyVersion", () -> impl.getCurrentTopologyVersion(), "Current topology version"); discoReg.register("Coordinator", () -> impl.getCoordinator(), UUID.class, "Coordinator ID"); registerMBean(igniteInstanceName, new TcpDiscoverySpiMBeanImpl(this), TcpDiscoverySpiMBean.class); impl.spiStart(igniteInstanceName); }</code><technical_language>Do want a set of constants for ("io", "discovery")</technical_language>

Target:
@Override public void spiStart(@Nullable String igniteInstanceName) throws IgniteSpiException { initializeImpl(); registerMBean(igniteInstanceName, new TcpDiscoverySpiMBeanImpl(this), TcpDiscoverySpiMBean.class); impl.spiStart(igniteInstanceName); }
Source:
<code>protected void executeCommand() { executeInNewTransaction(new TransactionMethod<Void>() { public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Locked, getCompensationContext()); getCompensationContext().stateChanged(); return null; } }); Map<String, Map<Long, List<VDS>>> lunToSize = refreshLunSizeAllVds(getParameters().getLunIds()); List<String> succeededRefreshLuns = new ArrayList<>(); for (Map.Entry<String, Map<Long, List<VDS>>> entry : lunToSize.entrySet()) { if (entry.getValue().size() != 1) { <START> log.error("Failed to refresh device " + entry.getKey() + " Not all VDS are seeing the same size"); <END> } else{ String lunId = entry.getKey(); Long pvSize = resizePV(lunId); succeededRefreshLuns.add(lunId); log.error("PV size " + entry.getKey() + " :" + pvSize); } } updateStorageDomainData(); refreshPVAllVds(succeededRefreshLuns); executeInNewTransaction(new TransactionMethod<Void>() { public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Active, null); getCompensationContext().resetCompensation(); return null; } }); setSucceeded(true); }</code><technical_language>need more info in this error. expected size reported vdsm run getDeviceList. print uuid name of hosts size. Also, errors hidden - this method succeed, if some luns failed resize</technical_language>

Target:
protected void executeCommand() { executeInNewTransaction(new TransactionMethod<Void>() { public Void runInTransaction() { setStorageDomainStatus(StorageDomainStatus.Locked, getCompensationContext()); getCompensationContext().stateChanged(); return null; } }); setSucceeded(false); List<String> lunsToRefresh = getParameters().getLunIds(); Map<String, List<VDS>> lunToFailedVDS = refreshLunSizeAllVds(lunsToRefresh); if (!lunToFailedVDS.isEmpty()) { ArrayList<String> failedVds = new ArrayList<>(); for (Map.Entry<String, List<VDS>> entry : lunToFailedVDS.entrySet()) { String lunId = entry.getKey(); List<VDS> vdsList = entry.getValue(); log.error("Failed to refresh device " + lunId + " Not all VDS are seeing the same size " + "VDS :" + vdsList); String vdsListString = StringUtils.join(getVdsNameList(vdsList), ", "); failedVds.add("LUN :" + lunId + "VDS: " + vdsListString); } changeStorageDomainToActive(); throw new VdcBLLException(VdcBllErrors.REFRESH_LUN_ERROR, "Failed to refresh LUNs. Not all VDS are seeing the same size " + failedVds); } resizePVs(lunsToRefresh); updateStorageDomainData(); refreshPVAllVds(lunsToRefresh); changeStorageDomainToActive(); setSucceeded(true); }
Source:
<code>public MotorConstant(String name, Motor motor, double motorSpeed) { <START> super("motorConstant", motor); <END> this.motor = motor; this.motorSpeed = motorSpeed; }</code><technical_language>setName(name); addRequirements(motor)</technical_language>

Target:
public MotorConstant(String name, Motor motor, double motorSpeed) { super(); setName(name); this.motor = motor; this.motorSpeed = motorSpeed; addRequirements(motor); }
Source:
<code>void transportFactory() { @SuppressWarnings("unchecked") <START> TransportFactory factory = InMemoryTransportFactory.newInstance(); <END> assertEquals(factory, builder.setTransportFactory(factory) .getTransportFactory() .get()); }</code><technical_language>Please fix alignment</technical_language>

Target:
void transportFactory() { TransportFactory factory = InMemoryTransportFactory.newInstance(); assertEquals(factory, builder.setTransportFactory(factory) .getTransportFactory() .get()); }
Source:
<code>static TrileadVersionSupport getTrileadSupport() { try { Thread.currentThread().getContextClassLoader().loadClass("com.trilead.ssh2.signature.KeyAlgorithmManager"); return createaVersion9Instance(); <START> } catch (ReflectiveOperationException e) { <END> return new LegacyTrileadVersionSupport(); } }</code><technical_language>catch exceptions</technical_language>

Target:
static TrileadVersionSupport getTrileadSupport() { try { if (isAfterTrilead8()) { return createVersion9Instance(); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Could not create Trilead support class. Using legacy Trilead features", e); } return new LegacyTrileadVersionSupport(); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { IReplicationController rc = getSelectedElement(event, IReplicationController.class); if(rc != null) { scaleUsing(event, rc, rc.getName()); return null; } IServiceWrapper deployment = getSelectedElement(event, IServiceWrapper.class); if(deployment == null) { IResourceWrapper<?, IOpenshiftUIElement<?,?>> wrapper = getSelectedElement(event, IResourceWrapper.class); if(wrapper != null && wrapper.getWrapped() instanceof IPod && !ResourceUtils.isBuildPod((IPod)wrapper.getWrapped())) { <START> deployment = (IServiceWrapper)wrapper.getParent(); <END> } } if(deployment != null) { Collection<IResourceWrapper<?, ?>> rcs = deployment.getResourcesOfKind(ResourceKind.REPLICATION_CONTROLLER); if(!rcs.isEmpty()) { rc = (IReplicationController) rcs.iterator().next().getWrapped(); scaleUsing(event, rc, deployment.getWrapped().getName()); } } return null; }</code><technical_language>parent of wrapped resource is a IServiceWrapper? lines ideal candidate for method for improved readability, ex #getServiceWrapper()</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IReplicationController rc = getSelectedElement(event, IReplicationController.class); if(rc != null) { scaleUsing(event, rc, rc.getName()); } else { IServiceWrapper deployment = getSelectedElement(event, IServiceWrapper.class); if(deployment == null) { IResourceWrapper<?, IOpenshiftUIElement<?,?>> wrapper = getSelectedElement(event, IResourceWrapper.class); deployment = getServiceWrapperForRunningPod(wrapper); } if (deployment != null) { rc = getReplicationController(deployment); if (rc != null) { scaleUsing(event, rc, deployment.getWrapped().getName()); } } } return null; }
Source:
<code>public void completeDefaultIpConfiguration(IpConfiguration ipConfiguration) { <START> if (ipConfiguration.getIPv4Addresses().isEmpty()) { <END> final IPv4Address ipv4Address = NetworkCommonUtils.createDefaultIpv4Address(); ipConfiguration.setIPv4Addresses(Collections.singletonList(ipv4Address)); } if (ipConfiguration.getIpV6Addresses().isEmpty()) { final IpV6Address ipv6Address = NetworkCommonUtils.createDefaultIpv6Address(); ipConfiguration.setIpV6Addresses(Collections.singletonList(ipv6Address)); } }</code><technical_language>In case 'ipConfiguration' is null, NPE here</technical_language>

Target:
private void completeDefaultIpConfiguration(IpConfiguration ipConfiguration) { if (ipConfiguration.getIPv4Addresses().isEmpty()) { final IPv4Address ipv4Address = NetworkCommonUtils.createDefaultIpv4Address(); ipConfiguration.setIPv4Addresses(Collections.singletonList(ipv4Address)); } if (ipConfiguration.getIpV6Addresses().isEmpty()) { final IpV6Address ipv6Address = NetworkCommonUtils.createDefaultIpv6Address(); ipConfiguration.setIpV6Addresses(Collections.singletonList(ipv6Address)); } }
Source:
<code>public void testOneWayMapping() { LUNs model = new LUNs(); model.setVendorId("vendor_id_1"); model.setProductId("product_id_1"); model.setLunMapping(5); model.setSerial("some_serial"); model.setvolume_group_id("volume_group_id_1"); model.setStorageDomainId(Guid.Empty); model.setDiskId(Guid.Empty); model.setStatus(org.ovirt.engine.core.common.businessentities.LunStatus.Free); LogicalUnit entity = StorageLogicalUnitMapper.map(model, (LogicalUnit)null); assertEquals(entity.getVendorId(), "vendor_id_1"); assertEquals(entity.getProductId(), "product_id_1"); assertEquals(entity.getSerial(), "some_serial"); assertEquals(entity.getLunMapping(), new Integer(5)); assertEquals(entity.getVolumeGroupId(), "volume_group_id_1"); assertEquals(entity.getStorageDomainId(), Guid.Empty.toString()); assertEquals(entity.getDiskId(), Guid.Empty.toString()); <START> assertEquals(entity.getStatus(), LunStatus.Free.name()); <END> }</code><technical_language>value() instead of .name()</technical_language>

Target:
public void testOneWayMapping() { LUNs model = new LUNs(); model.setVendorId("vendor_id_1"); model.setProductId("product_id_1"); model.setLunMapping(5); model.setSerial("some_serial"); model.setvolume_group_id("volume_group_id_1"); model.setStorageDomainId(Guid.Empty); model.setDiskId(Guid.Empty); model.setStatus(org.ovirt.engine.core.common.businessentities.LunStatus.Free); LogicalUnit entity = StorageLogicalUnitMapper.map(model, (LogicalUnit)null); assertEquals(entity.getVendorId(), "vendor_id_1"); assertEquals(entity.getProductId(), "product_id_1"); assertEquals(entity.getSerial(), "some_serial"); assertEquals(entity.getLunMapping(), new Integer(5)); assertEquals(entity.getVolumeGroupId(), "volume_group_id_1"); assertEquals(entity.getStorageDomainId(), Guid.Empty.toString()); assertEquals(entity.getDiskId(), Guid.Empty.toString()); assertEquals(entity.getStatus(), LunStatus.Free.value()); }
Source:
<code>public void deleteFile(String path) { <START> boolean isFolder = path.substring(path.length() - 1).equals("/"); <END> if (!isFolder) { deleteObject(path); } else { throw new RuntimeException("Folder was passed in to deleteFile: " + path); } }</code><technical_language>path.endsWith('/')</technical_language>

Target:
public void deleteFile(String path) { if (!path.endsWith(PATH_SEPARATOR)) { deleteObject(path); } else { throw new RuntimeException("Folder was passed in to deleteFile: " + path); } }
Source:
<code>private void clearVm(VM vm, VmExitStatus exitStatus, String exitMessage) { if (vm.getStatus() != VMStatus.MigratingFrom) { if (vm.getStatus() != VMStatus.Suspended && vm.getStatus() != VMStatus.Down) { ResourceManager.getInstance().InternalSetVmStatus(vm, VMStatus.Down, exitStatus, exitMessage); } <START> vm.getDynamicData().setCpuName(null); <END> addVmDynamicToList(vm.getDynamicData()); addVmStatisticsToList(vm.getStatisticsData()); addVmInterfaceStatisticsToList(vm.getInterfaces()); if (!ResourceManager.getInstance().IsVmInAsyncRunningList(vm.getId())) { _vmsMovedToDown.add(vm.getId()); } } }</code><technical_language>please move resourceManager.resetVmAttributes</technical_language>

Target:
private void clearVm(VM vm, VmExitStatus exitStatus, String exitMessage) { if (vm.getStatus() != VMStatus.MigratingFrom) { if (vm.getStatus() != VMStatus.Suspended && vm.getStatus() != VMStatus.Down) { ResourceManager.getInstance().InternalSetVmStatus(vm, VMStatus.Down, exitStatus, exitMessage); } addVmDynamicToList(vm.getDynamicData()); addVmStatisticsToList(vm.getStatisticsData()); addVmInterfaceStatisticsToList(vm.getInterfaces()); if (!ResourceManager.getInstance().IsVmInAsyncRunningList(vm.getId())) { _vmsMovedToDown.add(vm.getId()); } } }