auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public CompositeIOException(String message, @NonNull List<IOException> exceptions) { super(message); if (exceptions.size() > EXCEPTION_LIMIT) { this.exceptions = new ArrayList<>(exceptions.subList(0, EXCEPTION_LIMIT)); <START> this.exceptions.add(new ExceptionLimitReached(exceptions.size() - EXCEPTION_LIMIT)); <END> } else { this.exceptions = exceptions; } this.exceptions.forEach(this::addSuppressed); }</code><technical_language>add message imo, weird another object for this</technical_language>

Target:
public CompositeIOException(String message, @NonNull List<IOException> exceptions) { super(message + getDiscardedExceptionsMessage(exceptions)); if (exceptions.size() > EXCEPTION_LIMIT) { this.exceptions = new ArrayList<>(exceptions.subList(0, EXCEPTION_LIMIT)); } else { this.exceptions = exceptions; } this.exceptions.forEach(this::addSuppressed); }
Source:
<code>public BasicBatchInformation(int batchSize, Task task, Column column ) { <START> Preconditions.checkNotNull(task); <END> Preconditions.checkNotNull(column); this.batchSize = batchSize; this.task = task; this.column = column; }</code><technical_language>this, = null()</technical_language>

Target:
public BasicBatchInformation(int batchSize, Task task, Column column ) { this.task = Preconditions.checkNotNull(task); this.column = Preconditions.checkNotNull(column); Preconditions.checkArgument(batchSize > 0); this.batchSize = batchSize; }
Source:
<code>private void addSystemWideContainerSettings(String workspaceId, boolean isDev, CheServiceImpl composeService) throws IOException { List<String> portsToExpose; List<String> volumes; Map<String, String> env; if (isDev) { portsToExpose = devMachinePortsToExpose; volumes = new ArrayList<>(devMachineSystemVolumes.size() + 1); volumes.addAll(devMachineSystemVolumes); String projectFolderVolume = format("%s:%s", workspaceFolderPathProvider.getPath(workspaceId), projectFolderPath); <START> if (volumeOptions != null && !volumeOptions.isEmpty()) { <END> projectFolderVolume = projectFolderVolume + ":" + volumeOptions; } volumes.add(SystemInfo.isWindows() ? escapePath(projectFolderVolume) : projectFolderVolume); env = new HashMap<>(devMachineEnvVariables); env.put(DockerInstanceRuntimeInfo.CHE_WORKSPACE_ID, workspaceId); env.put(DockerInstanceRuntimeInfo.USER_TOKEN, getUserToken(workspaceId)); } else { portsToExpose = commonMachinePortsToExpose; env = commonMachineEnvVariables; volumes = commonMachineSystemVolumes; } composeService.getExpose().addAll(portsToExpose); composeService.getEnvironment().putAll(env); composeService.getVolumes().addAll(volumes); composeService.getNetworks().addAll(additionalNetworks); }</code><technical_language>guava helper isNullOrEmpty / com.google.common.base.Strings.isNullOrEmpty;</technical_language>

Target:
private void addSystemWideContainerSettings(String workspaceId, boolean isDev, CheServiceImpl composeService) throws IOException { List<String> portsToExpose; List<String> volumes; Map<String, String> env; if (isDev) { portsToExpose = devMachinePortsToExpose; volumes = devMachineSystemVolumes; env = new HashMap<>(devMachineEnvVariables); env.put(DockerInstanceRuntimeInfo.CHE_WORKSPACE_ID, workspaceId); env.put(DockerInstanceRuntimeInfo.USER_TOKEN, getUserToken(workspaceId)); } else { portsToExpose = commonMachinePortsToExpose; env = commonMachineEnvVariables; volumes = commonMachineSystemVolumes; } composeService.getExpose().addAll(portsToExpose); composeService.getEnvironment().putAll(env); composeService.getVolumes().addAll(volumes); composeService.getNetworks().addAll(additionalNetworks); }
Source:
<code>protected NonNullList<ItemStack> harvestBlock(World world, BlockPos pos) { NonNullList<ItemStack> harvested = NonNullList.create(); <START> if (PluginIC2.rubberWood != null && ItemStackUtil.equals(world.getBlockState(pos).getBlock(), PluginIC2.rubberWood)) { <END> harvested.add(PluginIC2.resin.copy()); } else if (PluginTechReborn.RUBBER_WOOD != null && ItemStackUtil.equals(world.getBlockState(pos).getBlock(), PluginTechReborn.RUBBER_WOOD)) { harvested.add(PluginTechReborn.sap.copy()); } PacketFXSignal packet = new PacketFXSignal(PacketFXSignal.VisualFXType.BLOCK_BREAK, PacketFXSignal.SoundFXType.BLOCK_BREAK, pos, blockState); NetworkUtil.sendNetworkPacket(packet, pos, world); world.setBlockState(pos, replantState, Constants.FLAG_BLOCK_SYNC); return harvested; }</code><technical_language>Store world.getBlockState(pos).getBlock() in a variable is called twice</technical_language>

Target:
protected NonNullList<ItemStack> harvestBlock(World world, BlockPos pos) { NonNullList<ItemStack> harvested = NonNullList.create(); Block harvestBlock = world.getBlockState(pos).getBlock(); if (PluginIC2.rubberWood != null && ItemStackUtil.equals(harvestBlock, PluginIC2.rubberWood)) { harvested.add(PluginIC2.resin.copy()); } else if (PluginTechReborn.RUBBER_WOOD != null && ItemStackUtil.equals(harvestBlock, PluginTechReborn.RUBBER_WOOD)) { harvested.add(PluginTechReborn.sap.copy()); } PacketFXSignal packet = new PacketFXSignal(PacketFXSignal.VisualFXType.BLOCK_BREAK, PacketFXSignal.SoundFXType.BLOCK_BREAK, pos, blockState); NetworkUtil.sendNetworkPacket(packet, pos, world); world.setBlockState(pos, replantState, Constants.FLAG_BLOCK_SYNC); return harvested; }
Source:
<code>public <T> void put(final String dataType, final long id, final T value) { if (!router.isLocal(id)) { <START> LOG.log(Level.INFO, "This id is not local: {0}", id); <END> return; } readWriteLock.writeLock().lock(); try { if (!dataMap.containsKey(dataType)) { dataMap.put(dataType, new TreeMap<Long, Object>()); } dataMap.get(dataType).put(id, value); } finally { readWriteLock.writeLock().unlock(); } }</code><technical_language>This a WARNING, if Exception, user needs put succeeded not</technical_language>

Target:
public <T> void put(final String dataType, final long id, final T value) { if (!router.isLocal(id)) { LOG.log(Level.WARNING, "This id is not local: {0}", id); return; } readWriteLock.writeLock().lock(); try { if (!dataMap.containsKey(dataType)) { dataMap.put(dataType, new TreeMap<Long, Object>()); } dataMap.get(dataType).put(id, value); } finally { readWriteLock.writeLock().unlock(); } }
Source:
<code>public static boolean saveNote(Note note, boolean shouldUpdate) { getDb().beginTransaction(); boolean saved = false; try { <START> if (!shouldUpdate && NotificationsTable.getNoteById(note.getId()) != null) { <END> return false; } saved = putNote(note); getDb().setTransactionSuccessful(); } finally { getDb().endTransaction(); } return saved; }</code><technical_language>ok nitpicking here: querying for existing of ID in database, obtaining, reading inflating a Note object peek ID</technical_language>

Target:
public static boolean saveNote(Note note, boolean shouldUpdate) { getDb().beginTransaction(); boolean saved = false; try { if (!shouldUpdate && isNoteAvailable(note.getId())) { return false; } saved = putNote(note); getDb().setTransactionSuccessful(); } finally { getDb().endTransaction(); } return saved; }
Source:
<code>private void checkParameters(List<String> geneIds, String species, String assembly, Integer bufferValue) throws IllegalArgumentException { List<String> filteredGeneIds = geneIds.stream().filter(geneId -> geneId.isEmpty() == false). collect(Collectors.toList()); geneIds.clear(); geneIds.addAll(filteredGeneIds); <START> if (geneIds.size() == 0) { <END> throw new IllegalArgumentException("Please specify geneIds"); } if (species.isEmpty()) { throw new IllegalArgumentException("Please specify a species"); } if (assembly.isEmpty()) { throw new IllegalArgumentException("Please specify an assembly"); } if (bufferValue < 0) { throw new IllegalArgumentException("Pleas specify a non-negative integer value for buffer"); } }</code><technical_language>suggestion if (geneIds.isEmpty()) {</technical_language>

Target:
private void checkParameters(List<String> geneIds, String species, String assembly, Integer bufferValue) throws IllegalArgumentException { List<String> filteredGeneIds = geneIds.stream().filter(geneId -> geneId.isEmpty() == false). collect(Collectors.toList()); geneIds.clear(); geneIds.addAll(filteredGeneIds); if (geneIds.isEmpty()) { throw new IllegalArgumentException("Please specify geneIds"); } if (species.isEmpty()) { throw new IllegalArgumentException("Please specify a species"); } if (assembly.isEmpty()) { throw new IllegalArgumentException("Please specify an assembly"); } if (bufferValue < 0) { throw new IllegalArgumentException("Pleas specify a non-negative integer value for buffer"); } }
Source:
<code><START> public long getRecentlyPlayedCutoffTimeMillis() { <END> return getCutoffTimeMillis(LAST_PLAYED_CUTOFF); }</code><technical_language>is of in seconds other in milliseconds</technical_language>

Target:
public long getRecentlyPlayedCutoffTimeMillis() { return getCutoffTimeMillis(RECENTLY_PLAYED_CUTOFF); }
Source:
<code>public String createSubscription(SitemapSubscriptionCallback callback) { <START> if (callbacks.size() >= maxSubscriptions) { <END> logger.debug("No new subscription delivered as limit ({}) is already reached", maxSubscriptions); return null; } String subscriptionId = UUID.randomUUID().toString(); callbacks.put(subscriptionId, callback); logger.debug("Created new subscription with id ({} active subscriptions for a max of {})", subscriptionId, callbacks.size(), maxSubscriptions); return subscriptionId; }</code><technical_language>If Java if (maxSubscriptions > 0 && callbacks.size() >= maxSubscriptions) { allow user a negative number for unlimited subscriptions. I if this sense. "user" maximal integer get behavior. if want behavior default point a negative number. I if unlimited needs supported all, it</technical_language>

Target:
public String createSubscription(SitemapSubscriptionCallback callback) { if (maxSubscriptions >= 0 && callbacks.size() >= maxSubscriptions) { logger.debug("No new subscription delivered as limit ({}) is already reached", maxSubscriptions); return null; } String subscriptionId = UUID.randomUUID().toString(); callbacks.put(subscriptionId, callback); logger.debug("Created new subscription with id ({} active subscriptions for a max of {})", subscriptionId, callbacks.size(), maxSubscriptions); return subscriptionId; }
Source:
<code>Integer safeGet(String key) { if (containsKey(key)) { return get(key); } else { <START> System.out.println(key + " unknown"); <END> return get("UNK"); } }</code><technical_language>Is a leftover debugging purpose</technical_language>

Target:
Integer safeGet(String key) { if (containsKey(key)) { return get(key); } else { return get("UNK"); } }
Source:
<code>public void autoGC(ProgressMonitor monitor) { boolean background = monitor instanceof NullProgressMonitor && gcAutoDetach(); File gcLog = new <START> File(getDirectory(), <END> "gc.log"); final LockFile lck = new LockFile(gcLog); try { if (!lck.lock()) { return; } } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } try { FileTime lastModified = Files.getLastModifiedTime(gcLog.toPath()); if (lastModified.toInstant().compareTo(getLogExpiry()) < 0) { try { if (!background) { String oldError = new String(Files.readAllBytes(gcLog.toPath())); throw new JGitInternalException("A previous GC run reported an error: " + oldError + "\nAutomatic gc will fail until the file " + gcLog + " is removed"); } } finally { lck.unlock(); } return; } } catch (NoSuchFileException e) { } catch (IOException | ParseException e) { throw new JGitInternalException(e.getMessage(), e); } Runnable gcTask = () -> { try { GC gc = new GC(this); gc.setPackConfig(new PackConfig(this)); gc.setProgressMonitor(monitor); gc.setAuto(true); gc.gc(); lck.unlock(); gcLog.delete(); } catch (IOException | ParseException e) { if (background) { try { lck.write(e.getMessage().getBytes()); lck.commit(); } catch (IOException e2) { e2.addSuppressed(e); LOG.error(e2.getMessage(), e); lck.unlock(); } } else { throw new JGitInternalException(e.getMessage(), e); } } }; if (background) { Thread thread = new Thread(gcTask); thread.start(); } else { gcTask.run(); } }</code><technical_language>nice encapsulate do this log file a class, GcLog</technical_language>

Target:
public void autoGC(ProgressMonitor monitor) { GcLog gcLog = new GcLog(this); boolean background = monitor instanceof NullProgressMonitor && shouldAutoDetach(); if (gcLog.lock(background)) { return; } Runnable gcTask = () -> { try { GC gc = new GC(this); gc.setPackConfig(new PackConfig(this)); gc.setProgressMonitor(monitor); gc.setAuto(true); gc.gc(); gcLog.cleanUp(); } catch (IOException | ParseException e) { if (background) { try { gcLog.write(e.getMessage().getBytes()); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); gcLog.write(sw.toString().getBytes(StandardCharsets.UTF_8)); gcLog.commit(); } catch (IOException e2) { e2.addSuppressed(e); LOG.error(e2.getMessage(), e2); } } else { throw new JGitInternalException(e.getMessage(), e); } } finally { gcLog.unlock(); } }; if (background) { Thread thread = new Thread(gcTask); thread.start(); } else { gcTask.run(); } }
Source:
<code>void setUp() { <START> boundedContext = BlackBoxBoundedContext.singletenant() <END> .with(new DotSpace()); }</code><technical_language>a reason format expression that</technical_language>

Target:
void setUp() { boundedContext = BlackBoxBoundedContext .newInstance() .with(new DotSpace()); }
Source:
<code>private void processWeakCounterConfiguration(XMLExtendedStreamWriter writer, ModelNode weakConfiguration) throws XMLStreamException { writer.writeStartElement(Element.WEAK_COUNTER.getLocalName()); this.writeRequired(writer, Attribute.NAME, weakConfiguration, ModelKeys.NAME); <START> this.writeRequired(writer, Attribute.INITIAL_VALUE, weakConfiguration, ModelKeys.INITIAL_VALUE); <END> this.writeRequired(writer, Attribute.STORAGE, weakConfiguration, ModelKeys.STORAGE); this.writeOptional(writer, Attribute.CONCURRENCY_LEVEL, weakConfiguration, ModelKeys.CONCURRENCY_LEVEL); writer.writeEndElement(); }</code><technical_language>required attribute is name. remaining attributes optional</technical_language>

Target:
private void processWeakCounterConfiguration(XMLExtendedStreamWriter writer, ModelNode weakConfiguration) throws XMLStreamException { writer.writeStartElement(Element.WEAK_COUNTER.getLocalName()); this.writeRequired(writer, Attribute.NAME, weakConfiguration, ModelKeys.NAME); this.writeOptional(writer, Attribute.INITIAL_VALUE, weakConfiguration, ModelKeys.INITIAL_VALUE); this.writeOptional(writer, Attribute.STORAGE, weakConfiguration, ModelKeys.STORAGE); this.writeOptional(writer, Attribute.CONCURRENCY_LEVEL, weakConfiguration, ModelKeys.CONCURRENCY_LEVEL); writer.writeEndElement(); }
Source:
<code>synchronized List<IngestModuleError> process(FileIngestTask task) { List<IngestModuleError> errors = new ArrayList<>(); if (!this.job.isCancelled()) { AbstractFile file = task.getFile(); for (PipelineModule module : this.modules) { try { FileIngestPipeline.ingestManager.setIngestTaskProgress(task, module.getDisplayName()); this.job.setCurrentFileIngestModule(module.getDisplayName(), task.getFile().getName()); module.process(file); } catch (Throwable ex) { errors.add(new IngestModuleError(module.getDisplayName(), ex)); String msg = ex.getMessage(); if (msg == null) { msg = ex.toString(); } MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "FileIngestPipeline.moduleError.title.text", module.getDisplayName()), msg); } if (this.job.isCancelled()) { break; } } try{ file.save(Case.getCurrentCase().getSleuthkitCase()); } catch (TskCoreException ex){ Logger.getLogger(FileIngestPipeline.class.getName()).log(Level.SEVERE, "Failed to save data", ex); } <START> <END> file.close(); if (!this.job.isCancelled()) { IngestManager.getInstance().fireFileIngestDone(file); } } FileIngestPipeline.ingestManager.setIngestTaskProgressCompleted(task); return errors; }</code><technical_language>I do here: 1. Move this code job cancellation check conditional. do need do a database trip if changed. 2. Add object id of file error message debugging easier</technical_language>

Target:
synchronized List<IngestModuleError> process(FileIngestTask task) { List<IngestModuleError> errors = new ArrayList<>(); if (!this.job.isCancelled()) { AbstractFile file = task.getFile(); for (PipelineModule module : this.modules) { try { FileIngestPipeline.ingestManager.setIngestTaskProgress(task, module.getDisplayName()); this.job.setCurrentFileIngestModule(module.getDisplayName(), task.getFile().getName()); module.process(file); } catch (Throwable ex) { errors.add(new IngestModuleError(module.getDisplayName(), ex)); String msg = ex.getMessage(); if (msg == null) { msg = ex.toString(); } MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "FileIngestPipeline.moduleError.title.text", module.getDisplayName()), msg); } if (this.job.isCancelled()) { break; } } if (!this.job.isCancelled()) { try{ file.save(Case.getCurrentCase().getSleuthkitCase()); } catch (TskCoreException ex){ Logger.getLogger(FileIngestPipeline.class.getName()).log(Level.SEVERE, "Failed to save data for file " + file.getId(), ex); } IngestManager.getInstance().fireFileIngestDone(file); } file.close(); } FileIngestPipeline.ingestManager.setIngestTaskProgressCompleted(task); return errors; }
Source:
<code>public void clearAllStores(AccessMode mode) { <START> runnableWithReadLockAndAvailabilityCheck(() -> { <END> Consumer<CacheWriter> clearWriter = writer -> { if (writer instanceof AdvancedCacheWriter) { if (mode.canPerform(getStoreConfig(writer))) { ((AdvancedCacheWriter) writer).clear(); } } }; nonTxWriters.forEach(clearWriter); txWriters.forEach(clearWriter); }); }</code><technical_language>admit I biggest fan of extra allocations . I hope JIT eventually inline this invocations. if allowing a BiConsumer storing lambdas help. do a check for long 0 in writeToAllNonTxStores method call other one. problem is methods 3 parameters primitives</technical_language>

Target:
public void clearAllStores(AccessMode mode) { storesMutex.readLock().lock(); try { checkStoreAvailability(); Consumer<CacheWriter> clearWriter = writer -> { if (writer instanceof AdvancedCacheWriter) { if (mode.canPerform(getStoreConfig(writer))) { ((AdvancedCacheWriter) writer).clear(); } } }; nonTxWriters.forEach(clearWriter); txWriters.forEach(clearWriter); } finally { storesMutex.readLock().unlock(); } }
Source:
<code>public void shouldDelegateToStatusOnPermanentlyRedirectToControllerInstance() throws Exception { Status status = mockResult(Status.class); result.permanentlyRedirectTo(new RandomController()); verify(status).movedPermanentlyTo(RandomController.class); <START> verify(messages).assertAbsenceOfErrors(); <END> }</code><technical_language>leave this verify for method is checking this behavior. need repeat all</technical_language>

Target:
public void shouldDelegateToStatusOnPermanentlyRedirectToControllerInstance() throws Exception { Status status = mockResult(Status.class); result.permanentlyRedirectTo(new RandomController()); verify(status).movedPermanentlyTo(RandomController.class); }
Source:
<code>public void process(final HashMap<String, String> json) { LOG.debug("Try to index " + json.get(Properties.ID.getName()) + " in ES type " + json.get(Properties.TYPE.getName()) + " Source:" + json.get(Properties.GRAPH.getName())); updateRequest = new UpdateRequest(indexName, json.get(Properties.TYPE.getName()), json.get(Properties.ID.getName())); updateRequest.doc(json.get(Properties.GRAPH.getName())); updateRequest.docAsUpsert(true); if (json.containsKey(Properties.PARENT.getName())) { updateRequest.parent(json.get(Properties.PARENT.getName())); } if (json.get(Properties.ID.getName()).startsWith("HT018786244")) { System.out.println(); <START> } <END> bulkRequest.add(updateRequest); docs++; while (docs > bulkSize && retries > 0) { try { bulkRequest.execute().actionGet(); docs = 0; bulkRequest = client.prepareBulk(); bulkRequest.setRefresh(false); break; } catch (final NoNodeAvailableException e) { retries--; try { Thread.sleep(10000); } catch (final InterruptedException x) { x.printStackTrace(); } LOG.warn("Retry indexing record" + json.get(Properties.ID.getName()) + ":" + e.getMessage() + " (" + retries + " more retries)"); } } }</code><technical_language>This a debugging leftover</technical_language>

Target:
public void process(final HashMap<String, String> json) { LOG.debug("Try to index " + json.get(Properties.ID.getName()) + " in ES type " + json.get(Properties.TYPE.getName()) + " Source:" + json.get(Properties.GRAPH.getName())); updateRequest = new UpdateRequest(indexName, json.get(Properties.TYPE.getName()), json.get(Properties.ID.getName())); updateRequest.doc(json.get(Properties.GRAPH.getName())); updateRequest.docAsUpsert(true); if (json.containsKey(Properties.PARENT.getName())) { updateRequest.parent(json.get(Properties.PARENT.getName())); } bulkRequest.add(updateRequest); docs++; while (docs > bulkSize && retries > 0) { try { bulkRequest.execute().actionGet(); docs = 0; bulkRequest = client.prepareBulk(); bulkRequest.setRefresh(false); break; } catch (final NoNodeAvailableException e) { retries--; try { Thread.sleep(10000); } catch (final InterruptedException x) { x.printStackTrace(); } LOG.warn("Retry indexing record" + json.get(Properties.ID.getName()) + ":" + e.getMessage() + " (" + retries + " more retries)"); } } }
Source:
<code>public void dispose() { phone.mCM.unregisterForRUIMReady(this); phone.mCM.unregisterForOffOrNotAvailable( this); phone.mCM.unSetOnIccRefresh(this); <START> this.removeCallbacksAndMessages(null); <END> this.recordsLoadedRegistrants = null; this.phone = null; }</code><technical_language>this.removeCallbacksAndMessages(null) instead. Done in Patch set 2</technical_language>

Target:
public void dispose() { phone.mCM.unregisterForRUIMReady(this); phone.mCM.unregisterForOffOrNotAvailable( this); phone.mCM.unSetOnIccRefresh(this); }
Source:
<code>public void refreshVdsRunTimeInfo() { <START> boolean isVdsUpOrGoingToMaintenance = vds.getStatus() == VDSStatus.Up <END> || vds.getStatus() == VDSStatus.PreparingForMaintenance || vds.getStatus() == VDSStatus.Error || vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (vdsManager.isTimeToRefreshStatistics() || vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(isVdsUpOrGoingToMaintenance); } else { refreshVdsRunTimeInfo(isVdsUpOrGoingToMaintenance); } } else { refreshCapabilities(); } } catch (VDSRecoveringException e) { handleVDSRecoveringException(vds, e); } catch (ClassCastException cce) { handleClassCastException(cce); } catch (Throwable t) { log.error("Failure to refresh host '{}' runtime info: {}", vds.getName(), t.getMessage()); log.debug("Exception", t); throw t; } }</code><technical_language>logic I move this check try block</technical_language>

Target:
public void refreshVdsRunTimeInfo() { try { boolean isVdsUpOrGoingToMaintenance = vds.getStatus() == VDSStatus.Up || vds.getStatus() == VDSStatus.PreparingForMaintenance || vds.getStatus() == VDSStatus.Error || vds.getStatus() == VDSStatus.NonOperational; if (isVdsUpOrGoingToMaintenance) { if (vdsManager.isTimeToRefreshStatistics() || vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(isVdsUpOrGoingToMaintenance); } else { refreshVdsRunTimeInfo(isVdsUpOrGoingToMaintenance); } } else { refreshCapabilities(); } } catch (VDSRecoveringException e) { handleVDSRecoveringException(vds, e); } catch (ClassCastException cce) { handleClassCastException(cce); } catch (Throwable t) { log.error("Failure to refresh host '{}' runtime info: {}", vds.getName(), t.getMessage()); log.debug("Exception", t); throw t; } }
Source:
<code>public static boolean isLivingOnLadder(@Nonnull IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EntityLivingBase entity, EnumFacing side) { boolean isSpectator = (entity instanceof EntityPlayer && ((EntityPlayer)entity).isSpectator()); if (isSpectator) return false; if (!ForgeModContainer.fullBoundingBoxLadders) { Block b1 = state.getBlock(); Block b2 = world.getBlockState(pos.offset(side)).getBlock(); <START> return b1.isLadder(state, world, pos, entity) || b1.isLadder(state, world, pos, entity, side) || b2.isLadder(state, world, pos, entity) || b2.isLadder(state, world, pos, entity, side); <END> } else { AxisAlignedBB bb = entity.getEntityBoundingBox().grow(0.1); int mX = MathHelper.floor(bb.minX); int mY = MathHelper.floor(bb.minY); int mZ = MathHelper.floor(bb.minZ); for (int y2 = mY; y2 < bb.maxY; y2++) { for (int x2 = mX; x2 < bb.maxX; x2++) { for (int z2 = mZ; z2 < bb.maxZ; z2++) { BlockPos tmp = new BlockPos(x2, y2, z2); state = world.getBlockState(tmp); if (state.getBlock().isLadder(state, world, tmp, entity, side)) { return true; } } } } return false; } }</code><technical_language>main difference lies I tell, this save calling deprecated function remove 2 checks</technical_language>

Target:
public static boolean isLivingOnLadder(@Nonnull IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EntityLivingBase entity, EnumFacing side) { boolean isSpectator = (entity instanceof EntityPlayer && ((EntityPlayer)entity).isSpectator()); if (isSpectator) return false; if (side == null) return false; if (!ForgeModContainer.fullBoundingBoxLadders) { return state.getBlock().isLadder(state, world, pos, entity, side) || world.getBlockState(pos.offset(side)).getBlock().isLadder(state, world, pos, entity, side); } else { AxisAlignedBB bb = entity.getEntityBoundingBox().grow(0.1); int mX = MathHelper.floor(bb.minX); int mY = MathHelper.floor(bb.minY); int mZ = MathHelper.floor(bb.minZ); for (int y2 = mY; y2 < bb.maxY; y2++) { for (int x2 = mX; x2 < bb.maxX; x2++) { for (int z2 = mZ; z2 < bb.maxZ; z2++) { BlockPos tmp = new BlockPos(x2, y2, z2); state = world.getBlockState(tmp); if (state.getBlock().isLadder(state, world, tmp, entity, side)) { return true; } } } } return false; } }
Source:
<code>public void recognizeEntitiesForFaultyText() { StepVerifier.create(client.recognizeEntities("!@#%%")) <START> .verifyComplete(); <END> }</code><technical_language>assert</technical_language>

Target:
public void recognizeEntitiesForFaultyText() { StepVerifier.create(client.recognizeEntities("!@#%%")) .expectNextCount(0) .verifyComplete(); }
Source:
<code>@Override public ExecuteBatchResult executeBatch(StatementHandle h, List<List<TypedValue>> updateBatches) throws NoSuchStatementException { try { final StatementInfo info = statementCache.getIfPresent(h.id); if (null == info) { throw new NoSuchStatementException(h); } final PreparedStatement preparedStmt = (PreparedStatement) info.statement; for (List<TypedValue> batch : updateBatches) { int i = 1; for (TypedValue value : batch) { <START> preparedStmt.setObject(i++, value.value); <END> } preparedStmt.addBatch(); } return new ExecuteBatchResult(preparedStmt.executeBatch()); } catch (SQLException e) { throw propagate(e); } }</code><technical_language>this work for null values? Proper setNull(index, sqltype, sqltypename)</technical_language>

Target:
@Override public ExecuteBatchResult executeBatch(StatementHandle h, List<List<TypedValue>> updateBatches) throws NoSuchStatementException { try { final StatementInfo info = statementCache.getIfPresent(h.id); if (null == info) { throw new NoSuchStatementException(h); } final PreparedStatement preparedStmt = (PreparedStatement) info.statement; int rowUpdate = 1; for (List<TypedValue> batch : updateBatches) { int i = 1; for (TypedValue value : batch) { try { preparedStmt.setObject(i, value.toJdbc(calendar)); i++; } catch (SQLException e) { throw new RuntimeException("Failed to set value on row #" + rowUpdate + " and column #" + i, e); } rowUpdate++; } preparedStmt.addBatch(); } return new ExecuteBatchResult(preparedStmt.executeBatch()); } catch (SQLException e) { throw propagate(e); } }
Source:
<code>private void startConfiguration() throws Exception { <START> for (final ClientBootstrapResolver clientBootstrapResolver : configuration.getClientBootstrapResolvers()) { <END> Barrier barrier = clientBootstrapResolver.getBarrier(); if (barrier != null) { barrier.getFuture().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { connectClient(clientBootstrapResolver); } }); } else { connectClient(clientBootstrapResolver); } } }</code><technical_language>clientResolver (not clientBootstrapResolver) match serverResolver, right</technical_language>

Target:
private void startConfiguration() throws Exception { for (final ClientBootstrapResolver clientResolver : configuration.getClientResolvers()) { Barrier barrier = clientResolver.getBarrier(); if (barrier != null) { barrier.getFuture().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { connectClient(clientResolver); } }); } else { connectClient(clientResolver); } } }
Source:
<code>public void postsMessageAndInvitesFriends() throws Exception { final MkBase base = new MkBase(); final URN urn = new URN("urn:test:1"); final User user = base.user(urn); final String jeff = "Jeff"; user.aliases().add(jeff); final String frank = "Frank"; final User friend = base.user(new URN("urn:test:2")); friend.aliases().add(frank); final String post = "message"; final String head = new RsPrint( new TkForward(new TkStart(base)).act( new RqWithTester( urn, new RqFake( "GET", String.format( <START> "/start?post=%s&invite=%s", <END> post, frank ) ) ) ) ).printHead(); final Matcher matcher = Pattern.compile( "^Location:.*/b/(\\d+)$", Pattern.MULTILINE ).matcher(head); MatcherAssert.assertThat("Location header is correct", matcher.find()); final long number = Long.parseLong(matcher.group(1)); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(number); final Message message = bout.messages().iterate().iterator().next(); MatcherAssert.assertThat(message.author(), Matchers.equalTo(jeff)); MatcherAssert.assertThat(message.text(), Matchers.equalTo(post)); MatcherAssert.assertThat( bout.friends().iterate().iterator().next().alias(), Matchers.equalTo(frank) ); }</code><technical_language>@komaz please add more invite param requested in original ticket</technical_language>

Target:
public void postsMessageAndInvitesFriends() throws Exception { final MkBase base = new MkBase(); final URN urn = new URN("urn:test:1"); final User user = base.user(urn); final String name = "Jeff"; user.aliases().add(name); final Alias[] friends = new Alias[] { base.randomAlias(), base.randomAlias(), }; final String post = "message"; final String head = new RsPrint( new TkForward(new TkStart(base)).act( new RqWithTester( urn, new RqFake( "GET", String.format( "/start?post=%s&invite=%s&invite=%s", post, friends[0].name(), friends[1].name() ) ) ) ) ).printHead(); final Matcher matcher = Pattern.compile( "^Location:.*/b/(\\d+)$", Pattern.MULTILINE ).matcher(head); MatcherAssert.assertThat("Location header is correct", matcher.find()); final Bout bout = user.aliases().iterate().iterator().next().inbox() .bout(Long.parseLong(matcher.group(1))); final Message message = bout.messages().iterate().iterator().next(); MatcherAssert.assertThat(message.author(), Matchers.equalTo(name)); MatcherAssert.assertThat(message.text(), Matchers.equalTo(post)); MatcherAssert.assertThat( Iterables.transform( bout.friends().iterate(), new Function<Friend, String>() { @Override public String apply(final Friend friend) { try { return friend.alias(); } catch (final IOException ex) { throw new IllegalStateException(ex); } } } ), Matchers.containsInAnyOrder(friends[0].name(), friends[1].name()) ); }
Source:
<code>public void testStickContextFinalization() throws Exception { <START> VertxInternal vertx = (VertxInternal) Vertx.vertx(); <END> try { AtomicReference<WeakReference<Context>> ref = new AtomicReference<>(); Thread t = new Thread(() -> { Context context = vertx.getOrCreateContext(); ref.set(new WeakReference<>(context)); CountDownLatch latch = new CountDownLatch(1); context.runOnContext(v -> { latch.countDown(); }); try { latch.await(10, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }); t.start(); t.join(10_000); t = null; long now = System.currentTimeMillis(); while (true) { assertTrue(System.currentTimeMillis() - now < 20_000); RUNNER.runSystemGC(); if (ref.get().get() == null) { break; } } } finally { vertx.close(ar -> { testComplete(); }); } await(); }</code><technical_language>need cast here</technical_language>

Target:
public void testStickContextFinalization() throws Exception { Vertx vertx = Vertx.vertx(); try { AtomicReference<WeakReference<Context>> ref = new AtomicReference<>(); Thread t = new Thread(() -> { Context context = vertx.getOrCreateContext(); ref.set(new WeakReference<>(context)); CountDownLatch latch = new CountDownLatch(1); context.runOnContext(v -> { latch.countDown(); }); try { latch.await(10, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }); t.start(); t.join(10_000); t = null; long now = System.currentTimeMillis(); while (true) { assertTrue(System.currentTimeMillis() - now < 20_000); RUNNER.runSystemGC(); if (ref.get().get() == null) { break; } } } finally { vertx.close(ar -> { testComplete(); }); } await(); }
Source:
<code>public Object[] getElements(Object inputElement) { Object[] elements = contentProvider.getElements(inputElement); <START> Object[] oElements = Arrays.copyOf(elements, elements.length + fNumFillerRows); <END> for (int i = 0; i < fNumFillerRows; i++) { oElements[elements.length + i] = FILLER; } return oElements; }</code><technical_language>This change a java.lang.ArrayStoreException()</technical_language>

Target:
public Object[] getElements(Object inputElement) { Object[] elements = contentProvider.getElements(inputElement); Object[] oElements = Arrays.copyOf(elements, elements.length + fNumFillerRows, new Object[0].getClass()); for (int i = 0; i < fNumFillerRows; i++) { oElements[elements.length + i] = FILLER; } return oElements; }
Source:
<code>public void replace() { assertThat( value.apply( "hello" ).replace( "l", "w" ), equalTo( value.apply( "hewwo" ) ) ); assertThat( value.apply( "hello" ).replace( "ell", "ipp" ), equalTo( value.apply( "hippo" ) ) ); <START> assertThat( value.apply( "hello" ).replace( "a", "x" ), equalTo( value.apply( "hello" ) ) ); <END> }</code><technical_language>Worth putting in replacing empty string</technical_language>

Target:
public void replace() { assertThat( value.apply( "hello" ).replace( "l", "w" ), equalTo( value.apply( "hewwo" ) ) ); assertThat( value.apply( "hello" ).replace( "ell", "ipp" ), equalTo( value.apply( "hippo" ) ) ); assertThat( value.apply( "hello" ).replace( "a", "x" ), equalTo( value.apply( "hello" ) ) ); assertThat( value.apply( "hello" ).replace( "e", "" ), equalTo( value.apply( "hllo" ) ) ); assertThat( value.apply( "" ).replace( "", "⁻" ), equalTo( value.apply( "⁻" ) ) ); }
Source:
<code>protected void InitOverUtilizedList() { List<VDS> relevantVdss = LinqUtils.filter(getAllRelevantVdss(), new Predicate<VDS>() { @Override public boolean eval(VDS p) { return p.getUsageCpuPercent() >= p.getHighUtilization() && p.getCpuOverCommitTimestamp() != null <START> && (new Date().getTime() - p.getCpuOverCommitTimestamp().getTime()) >= p <END> .getCpuOverCommitDurationMinutes() * 1000L * 60L; } }); Collections.sort(relevantVdss, createDescendingCpuComparator()); setOverUtilizedServers(LinqUtils.toMap(relevantVdss, new DefaultMapper<VDS, Guid>() { @Override public Guid createKey(VDS vds) { return vds.getId(); } })); log.infoFormat("VdsLoadBalancer: number of over utilized vdss found: {0}.", getOverUtilizedServers().size()); }</code><technical_language>a minor unrelated change</technical_language>

Target:
protected void InitOverUtilizedList() { List<VDS> relevantVdss = LinqUtils.filter(getAllRelevantVdss(), new Predicate<VDS>() { @Override public boolean eval(VDS p) { return p.getUsageCpuPercent() >= p.getHighUtilization() && p.getCpuOverCommitTimestamp() != null && (new Date().getTime() - p.getCpuOverCommitTimestamp().getTime()) >= (long)p .getCpuOverCommitDurationMinutes() * 1000L * 60L; } }); Collections.sort(relevantVdss, createDescendingCpuComparator()); setOverUtilizedServers(LinqUtils.toMap(relevantVdss, new DefaultMapper<VDS, Guid>() { @Override public Guid createKey(VDS vds) { return vds.getId(); } })); log.infoFormat("VdsLoadBalancer: number of over utilized vdss found: {0}.", getOverUtilizedServers().size()); }
Source:
<code>protected String toSqlType(Type type) { if (REAL.equals(type)) { return "float"; } if (TIME_WITH_TIME_ZONE.equals(type)) { return "time"; } if (TIMESTAMP.equals(type) || TIMESTAMP_WITH_TIME_ZONE.equals(type)) { return "datetime"; } if (VARBINARY.equals(type)) { <START> return "varbinary"; <END> } if (isVarcharType(type)) { VarcharType varcharType = (VarcharType) type; if (varcharType.isUnbounded()) { return "longtext"; } if (varcharType.getLengthSafe() <= 255) { return "tinytext"; } if (varcharType.getLengthSafe() <= 65535) { return "text"; } if (varcharType.getLengthSafe() <= 16777215) { return "mediumtext"; } return "longtext"; } return super.toSqlType(type); }</code><technical_language>return mediumblob. I guess returning varbinary is conscious, in case..</technical_language>

Target:
protected String toSqlType(Type type) { if (REAL.equals(type)) { return "float"; } if (TIME_WITH_TIME_ZONE.equals(type)) { return "time"; } if (TIMESTAMP.equals(type) || TIMESTAMP_WITH_TIME_ZONE.equals(type)) { return "datetime"; } if (VARBINARY.equals(type)) { return "mediumblob"; } if (isVarcharType(type)) { VarcharType varcharType = (VarcharType) type; if (varcharType.isUnbounded()) { return "longtext"; } if (varcharType.getLengthSafe() <= 255) { return "tinytext"; } if (varcharType.getLengthSafe() <= 65535) { return "text"; } if (varcharType.getLengthSafe() <= 16777215) { return "mediumtext"; } return "longtext"; } return super.toSqlType(type); }
Source:
<code>private static PrivateKey privateKeyFromPkcs8(String privateKeyPem) throws IOException { Reader reader = new StringReader(privateKeyPem); Section section = PemReader.readFirstSectionAndClose(reader, "PRIVATE KEY"); if (section == null) { throw new IOException("Invalid PKCS8 data."); } byte[] bytes = section.getBase64DecodedBytes(); PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes); Exception unexpectedException = null; try { KeyFactory keyFactory = SecurityUtils.getRsaKeyFactory(); PrivateKey privateKey = keyFactory.generatePrivate(keySpec); return privateKey; } catch (NoSuchAlgorithmException exception) { <START> unexpectedException = exception; <END> } catch (InvalidKeySpecException exception) { unexpectedException = exception; } throw new IOException("Unexpected expcetion reading PKCS data", unexpectedException); }</code><technical_language>Replace with: catch (NoSuchAlgorithmException | InvalidKeySpecException e) { remove unexpectedException variable</technical_language>

Target:
private static PrivateKey privateKeyFromPkcs8(String privateKeyPem) throws IOException { Reader reader = new StringReader(privateKeyPem); Section section = PemReader.readFirstSectionAndClose(reader, "PRIVATE KEY"); if (section == null) { throw new IOException("Invalid PKCS8 data."); } byte[] bytes = section.getBase64DecodedBytes(); PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes); try { KeyFactory keyFactory = SecurityUtils.getRsaKeyFactory(); PrivateKey privateKey = keyFactory.generatePrivate(keySpec); return privateKey; } catch (NoSuchAlgorithmException | InvalidKeySpecException exception) { throw new IOException("Unexpected expcetion reading PKCS data", exception); } }
Source:
<code><START> public void updateDataSourceListModel() { <END> getDataSourceListModel().removeAllElements(); for (String dsName : getDataSourceArray()) { getDataSourceListModel().addElement(dsName); } setComponentsEnabled(); firePropertyChange(Bundle.DropdownSingleTermSearchPanel_selected(), null, null); }</code><technical_language>need public</technical_language>

Target:
void updateDataSourceListModel() { getDataSourceListModel().removeAllElements(); for (String dsName : getDataSourceArray()) { getDataSourceListModel().addElement(dsName); } setComponentsEnabled(); firePropertyChange(Bundle.DropdownSingleTermSearchPanel_selected(), null, null); }
Source:
<code>public void worksWithMockedGists() throws Exception { final Gist gist = new MkGithub().gists().create( Collections.singletonList("test-file-name.txt") ); final String file = "t.txt"; gist.write(file, "hello, everybody!"); MatcherAssert.assertThat( gist.read(file), Matchers.startsWith("hello, ") ); <START> MatcherAssert.assertThat( <END> gist.starred(), Matchers.equalTo(false) ); gist.star(); MatcherAssert.assertThat( gist.starred(), Matchers.equalTo(true) ); }</code><technical_language>a bad idea put test assertions test method. anti pattern called "test all": <LINK_0></technical_language>

Target:
public void worksWithMockedGists() throws Exception { final Gist gist = new MkGithub().gists().create( Collections.singletonList("test-file-name.txt") ); final String file = "t.txt"; gist.write(file, "hello, everybody!"); MatcherAssert.assertThat( gist.read(file), Matchers.startsWith("hello, ") ); }
Source:
<code>private void checkForUnknownCssClasses(JMethod method, ExtendedCssTree extendedCssTree) throws UnableToCompleteException { JClassType returnType = (JClassType) method.getReturnType(); JMethod[] methods = returnType.getMethods(); ImmutableList.Builder<String> methodNamesBuilder = ImmutableList.builder(); for (JMethod jMethod : methods) { <START> methodNamesBuilder.add(jMethod.getName()); <END> } new UnassignedCssClassVisitor(extendedCssTree.getCssTree().getMutatingVisitController(), methodNamesBuilder.build(), errorManager) .runPass(); checkErrors(); }</code><technical_language>method getClassName() name of style class is necessaraly name of method (@ClassName annotation name of class)</technical_language>

Target:
private void checkForUnknownCssClasses(JMethod method, ExtendedCssTree extendedCssTree) throws UnableToCompleteException { JClassType returnType = (JClassType) method.getReturnType(); JMethod[] inheritablemethods = returnType.getInheritableMethods(); ImmutableList.Builder<String> methodNamesBuilder = ImmutableList.builder(); for (JMethod jMethod : inheritablemethods) { methodNamesBuilder.add(jMethod.getName()); } new UnassignedCssClassVisitor(extendedCssTree.getCssTree().getMutatingVisitController(), methodNamesBuilder.build(), errorManager) .runPass(); checkErrors(); }
Source:
<code>public Optional<Page> addInput(Page inputPage) { List<Optional<Block>> partialDistinctMasks = new ArrayList<>(accumulators.size()); long memorySize = 0; for (InternalPartialAccumulator accumulator : accumulators) { partialDistinctMasks.add(accumulator.addInput(inputPage)); memorySize += accumulator.getEstimatedSize(); } systemMemoryContext.setBytes(memorySize); if (!intermediateLayout.hasDistinct()) { return Optional.empty(); } <START> return intermediateLayout.buildPartialDistinctRows(inputPage, partialDistinctMasks); <END> }</code><technical_language>lots of duplicate values, generating small pages. E.g. appears generate output page for input page. Is this intended behavior</technical_language>

Target:
public Optional<Page> addInput(Page inputPage) { List<Optional<Block>> partialDistinctMasks = new ArrayList<>(accumulators.size()); for (InternalPartialAccumulator accumulator : accumulators) { partialDistinctMasks.add(accumulator.addInput(inputPage)); } updateMemoryUsage(); if (!intermediateLayout.hasDistinct()) { return Optional.empty(); } return intermediateLayout.buildPartialDistinctRows(inputPage, partialDistinctMasks); }
Source:
<code>protected boolean runSerially() { boolean useful = false; processDisconnects(); final long timestamp = clock.getTicks(); final int n = epoll.poll(); int watermark = pending.size(); int offset = 0; if (n > 0) { LOG.debug().$("epoll [n=").$(n).$(']').$(); for (int i = 0; i < n; i++) { epoll.setOffset(offset); offset += EpollAccessor.SIZEOF_EVENT; final long id = epoll.getData(); if (id == 0) { accept(timestamp); } else { int row = pending.binarySearch(id, M_ID); if (row < 0) { LOG.error().$("internal error: epoll returned unexpected id [id=").$(id).$(']').$(); continue; } publishOperation( (epoll.getEvent() & EpollAccessor.EPOLLIN) > 0 ? IOOperation.READ : IOOperation.WRITE, pending.get(row) ); pending.deleteRow(row); watermark--; } } if (watermark < pending.size()) { enqueuePending(watermark); } useful = true; } <START> if (idleConnectionTimeout > 0) { <END> final long deadline = timestamp - idleConnectionTimeout; if (pending.size() > 0 && pending.get(0, M_TIMESTAMP) < deadline) { processIdleConnections(deadline); useful = true; } } return processRegistrations(timestamp) || useful; }</code><technical_language>configured idelConnectionTimeout is set 0 is negative, automatically set Long.MIN_VALUE?. this is case need extra if</technical_language>

Target:
protected boolean runSerially() { boolean useful = false; processDisconnects(); final long timestamp = clock.getTicks(); final int n = epoll.poll(); int watermark = pending.size(); int offset = 0; if (n > 0) { LOG.debug().$("epoll [n=").$(n).$(']').$(); for (int i = 0; i < n; i++) { epoll.setOffset(offset); offset += EpollAccessor.SIZEOF_EVENT; final long id = epoll.getData(); if (id == 0) { accept(timestamp); } else { int row = pending.binarySearch(id, M_ID); if (row < 0) { LOG.error().$("internal error: epoll returned unexpected id [id=").$(id).$(']').$(); continue; } publishOperation( (epoll.getEvent() & EpollAccessor.EPOLLIN) > 0 ? IOOperation.READ : IOOperation.WRITE, pending.get(row) ); pending.deleteRow(row); watermark--; } } if (watermark < pending.size()) { enqueuePending(watermark); } useful = true; } final long deadline = timestamp - idleConnectionTimeout; if (pending.size() > 0 && pending.get(0, M_TIMESTAMP) < deadline) { processIdleConnections(deadline); useful = true; } return processRegistrations(timestamp) || useful; }
Source:
<code>protected void executeCommand() { for (int i = 0; i < getParameters().getStoresCount(); i++) { CreateOvfVolumeForStorageDomainCommandParameters parameters = new CreateOvfVolumeForStorageDomainCommandParameters(getParameters().getStoragePoolId(), getParameters().getStorageDomainId()); parameters.setSkipDomainChecks(getParameters().isSkipDomainChecks()); if (hasParentCommand()) { parameters.setParentCommand(getParameters().getParentCommand()); parameters.setParentParameters(getParameters().getParentParameters()); } else { parameters.setParentCommand(getActionType()); parameters.setParentParameters(getParameters()); <START> } <END> VdcReturnValueBase vdcReturnValueBase = runInternalAction(VdcActionType.CreateOvfVolumeForStorageDomain, parameters); getReturnValue().getInternalVdsmTaskIdList().addAll(vdcReturnValueBase.getInternalVdsmTaskIdList()); } setSucceeded(true); }</code><technical_language>Please extract this a seperate method, called getCreateOvfVolumeForStorageDomainParameters (same done for createProcessOvfUpdateForDomainParams)</technical_language>

Target:
protected void executeCommand() { for (int i = 0; i < getParameters().getStoresCount(); i++) { CreateOvfVolumeForStorageDomainCommandParameters parameters = createCreateOvfVolumeForStorageDomainParams(); VdcReturnValueBase vdcReturnValueBase = runInternalAction(VdcActionType.CreateOvfVolumeForStorageDomain, parameters); getReturnValue().getInternalVdsmTaskIdList().addAll(vdcReturnValueBase.getInternalVdsmTaskIdList()); } setSucceeded(true); }
Source:
<code>public void testIterator() throws Throwable { Iterator<Map.Entry<String, Long>> iterator = stats.iterator(); assertThat(iterator.hasNext()) .describedAs("iterator.hasNext()") .isFalse(); <START> assertThatThrownBy(iterator::next); <END> }</code><technical_language>asserting NoSuchElementException()</technical_language>

Target:
public void testIterator() throws Throwable { Iterator<Map.Entry<String, Long>> iterator = stats.iterator(); assertThat(iterator.hasNext()) .describedAs("iterator.hasNext()") .isFalse(); intercept(NoSuchElementException.class, iterator::next); }