auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>String getPaymentMethod(OpenOfferListItem item) { String result = ""; if (item != null) { Offer offer = item.getOffer(); checkNotNull(offer); checkNotNull(offer.getPaymentMethod()); <START> String method = Res.get(offer.getPaymentMethod().getId() + "_SHORT"); <END> String methodCountryCode = offer.getCountryCode(); if (methodCountryCode != null) result = method + " (" + methodCountryCode + ")"; else result = method; } return result; }</code><technical_language>guarantee Res.get(paymentMethod.getId() + "_SHORT") find translation? If unsure, wrap in try-catch</technical_language>

Target:
String getPaymentMethod(OpenOfferListItem item) { String result = ""; if (item != null) { Offer offer = item.getOffer(); checkNotNull(offer); checkNotNull(offer.getPaymentMethod()); result = offer.getPaymentMethodNameWithCountryCode(); } return result; }
Source:
<code>public KeyValueScanner preStoreScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store, final Scan scan, final NavigableSet<byte[]> targetCols, final KeyValueScanner s) throws IOException { if (storeFileScanDoesntNeedAlteration(store, scan)) { <START> return s; <END> } if (s!=null) { s.close(); } ScanInfo scanInfo = ScanInfoUtil.cloneScanInfoWithKeepDeletedCells(store, store.getScanInfo()); return ScanInfoUtil.createStoreScanner(store, scanInfo, scan, targetCols, c.getEnvironment().getRegion().getReadpoint(scan.getIsolationLevel())); }</code><technical_language>nit: is weird this indentation</technical_language>

Target:
public KeyValueScanner preStoreScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store, final Scan scan, final NavigableSet<byte[]> targetCols, final KeyValueScanner s) throws IOException { if (storeFileScanDoesntNeedAlteration(store, scan)) { return s; } if (s != null) { s.close(); } ScanInfo scanInfo = ScanInfoUtil.cloneScanInfoWithKeepDeletedCells(store.getScanInfo()); return ScanInfoUtil.createStoreScanner(store, scanInfo, scan, targetCols, c.getEnvironment().getRegion().getReadpoint(scan.getIsolationLevel())); }
Source:
<code><START> private static String getNextOffset(String currentOffset) { <END> return currentOffset.equals(EventHubSystemConsumer.END_OF_STREAM) ? currentOffset : String.valueOf(Long.parseLong(currentOffset) + 1); }</code><technical_language>reason this static</technical_language>

Target:
private String getNextOffset(String currentOffset) { return currentOffset.equals(EventHubSystemConsumer.END_OF_STREAM) ? currentOffset : String.valueOf(Long.parseLong(currentOffset) + 1); }
Source:
<code>void shouldFailSelectOneAuthorUsingMapperClassWithTwoResultHandlers() { Configuration configuration = new Configuration(sqlMapper.getConfiguration().getEnvironment()); configuration.addMapper(AuthorMapperWithMultipleHandlers.class); SqlSessionFactory sqlMapperWithMultipleHandlers = new DefaultSqlSessionFactory(configuration); <START> try (SqlSession sqlSession = sqlMapperWithMultipleHandlers.openSession()) { <END> DefaultResultHandler handler1 = new DefaultResultHandler(); DefaultResultHandler handler2 = new DefaultResultHandler(); AuthorMapperWithMultipleHandlers mapper = sqlSession.getMapper(AuthorMapperWithMultipleHandlers.class); Assertions.assertThrows(BindingException.class, () -> mapper.selectAuthor(101, handler1, handler2)); } }</code><technical_language>This change match PR title. Please divide PR</technical_language>

Target:
void shouldFailSelectOneAuthorUsingMapperClassWithTwoResultHandlers() { Configuration configuration = new Configuration(sqlMapper.getConfiguration().getEnvironment()); configuration.addMapper(AuthorMapperWithMultipleHandlers.class); SqlSessionFactory sqlMapperWithMultipleHandlers = new DefaultSqlSessionFactory(configuration); try (SqlSession sqlSession = sqlMapperWithMultipleHandlers.openSession();) { DefaultResultHandler handler1 = new DefaultResultHandler(); DefaultResultHandler handler2 = new DefaultResultHandler(); AuthorMapperWithMultipleHandlers mapper = sqlSession.getMapper(AuthorMapperWithMultipleHandlers.class); Assertions.assertThrows(BindingException.class, () -> mapper.selectAuthor(101, handler1, handler2)); } }
Source:
<code>static IQueryable<IInstallableUnit> getQueryableMetadata(URI[] repos, IProgressMonitor monitor) throws CoreException { IMetadataRepositoryManager manager = getRepoManager(); if (repos == null) { repos = manager.getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL); } int repoCount = repos.length; SubMonitor subMonitor = <START> SubMonitor.convert(monitor, <END> repoCount * 10); List<IMetadataRepository> result = new ArrayList<IMetadataRepository>(repoCount); MultiStatus repoStatus = new MultiStatus(PDECore.PLUGIN_ID, 0, Messages.IUBundleContainer_ProblemsLoadingRepositories, null); for (int i = 0; i < repoCount; ++i) { try { result.add(manager.loadRepository(repos[i], subMonitor.newChild(10))); } catch (ProvisionException e) { repoStatus.add(e.getStatus()); } } if (result.size() != repos.length) { throw new CoreException(repoStatus); } if (result.size() == 1) { return result.get(0); } return QueryUtil.compoundQueryable(result); }</code><technical_language>"multiply 10" pattern is a workaround for SubProgressMonitor's resolution bug. SubMonitor bug, cleaner simply "repoCount" for ticks consume 1 tick invocation of newChild(...)</technical_language>

Target:
static IQueryable<IInstallableUnit> getQueryableMetadata(URI[] repos, IProgressMonitor monitor) throws CoreException { IMetadataRepositoryManager manager = getRepoManager(); if (repos == null) { repos = manager.getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL); } int repoCount = repos.length; SubMonitor subMonitor = SubMonitor.convert(monitor, repoCount); List<IMetadataRepository> result = new ArrayList<IMetadataRepository>(repoCount); MultiStatus repoStatus = new MultiStatus(PDECore.PLUGIN_ID, 0, Messages.IUBundleContainer_ProblemsLoadingRepositories, null); for (int i = 0; i < repoCount; ++i) { try { result.add(manager.loadRepository(repos[i], subMonitor.newChild(1))); } catch (ProvisionException e) { repoStatus.add(e.getStatus()); } } if (result.size() != repos.length) { throw new CoreException(repoStatus); } if (result.size() == 1) { return result.get(0); } return QueryUtil.compoundQueryable(result); }
Source:
<code><START> protected void closeOutputStreams() throws IOException { <END> if (outputHolder != null) { outputHolder.getStream().close(); if (outputHolder.getWrappedStream() != null) { outputHolder.getWrappedStream().close(); } outputHolder = null; } }</code><technical_language>is necessary wrap in try/catch (but propagate exception end) if fails other close() is bypassed</technical_language>

Target:
protected void closeOutputStreams() throws IOException { if (outputHolder != null) { outputHolder.close(); outputHolder = null; } }
Source:
<code>protected Map<Event, Position> analyzePosition(Position position) { if (Context.getIdentityManager().getById(position.getDeviceId()) == null || !Context.getIdentityManager().isLatestPosition(position)) { return null; } Position lastPosition = Context.getIdentityManager().getLastPosition(position.getDeviceId()); if (lastPosition == null) { return null; } Map<Event, Position> events = new HashMap<>(); for (long maintenanceId : Context.getMaintenancesManager().getAllDeviceItems(position.getDeviceId())) { Maintenance maintenance = Context.getMaintenancesManager().getById(maintenanceId); if (maintenance.getLapse() != 0) { <START> double oldValue = lastPosition.getDouble(maintenance.getType()); <END> double newValue = position.getDouble(maintenance.getType()); if (oldValue != 0.0 && newValue != 0.0 && (long) ((oldValue - maintenance.getStart()) / maintenance.getLapse()) < (long) ((newValue - maintenance.getStart()) / maintenance.getLapse())) { Event event = new Event(Event.TYPE_MAINTENANCE, position.getDeviceId(), position.getId()); event.setMaintenanceId(maintenanceId); event.set(maintenance.getType(), newValue); events.put(event, position); } } } return events; }</code><technical_language>I if is easy add simple time-based maintenance, I this pull request is big enough if requests</technical_language>

Target:
protected Map<Event, Position> analyzePosition(Position position) { if (Context.getIdentityManager().getById(position.getDeviceId()) == null || !Context.getIdentityManager().isLatestPosition(position)) { return null; } Position lastPosition = Context.getIdentityManager().getLastPosition(position.getDeviceId()); if (lastPosition == null) { return null; } Map<Event, Position> events = new HashMap<>(); for (long maintenanceId : Context.getMaintenancesManager().getAllDeviceItems(position.getDeviceId())) { Maintenance maintenance = Context.getMaintenancesManager().getById(maintenanceId); if (maintenance.getPeriod() != 0) { double oldValue = lastPosition.getDouble(maintenance.getType()); double newValue = position.getDouble(maintenance.getType()); if (oldValue != 0.0 && newValue != 0.0 && (long) ((oldValue - maintenance.getStart()) / maintenance.getPeriod()) < (long) ((newValue - maintenance.getStart()) / maintenance.getPeriod())) { Event event = new Event(Event.TYPE_MAINTENANCE, position.getDeviceId(), position.getId()); event.setMaintenanceId(maintenanceId); event.set(maintenance.getType(), newValue); events.put(event, position); } } } return events; }
Source:
<code>public LocalDocument insertLocalDocument(final String docId, final DocumentBody body) throws DocumentException { Preconditions.checkState(this.isOpen(), "Database is closed"); CouchUtils.validateDocumentId(docId); Preconditions.checkNotNull(body, "Input document body can not be null"); try { return queue.submitTransaction(new SQLQueueCallable<LocalDocument>() { @Override public LocalDocument call(SQLDatabase db) throws Exception { ContentValues values = new ContentValues(); values.put("docid", docId); values.put("json", body.asBytes()); long rowId = db.insertWithOnConflict("localdocs", values, SQLDatabase .CONFLICT_REPLACE); if (rowId < 0) { <START> throw new DocumentException("Failed to insert local document"); <END> } else { logger.finer(String.format("Local doc inserted: %d , %s", rowId, docId)); } return doGetLocalDocument(db, docId); } }).get(); } catch (InterruptedException e) { logger.log(Level.SEVERE, "Failed to create local document", e); } catch (ExecutionException e) { logger.log(Level.SEVERE,"Failed to create local document",e); throw new DocumentException("Cannot insert new local document",e); } return null; }</code><technical_language>log messages exception messages a bit varied: "failed/cannot", "create/insert" - consistent</technical_language>

Target:
public LocalDocument insertLocalDocument(final String docId, final DocumentBody body) throws DocumentException { Preconditions.checkState(this.isOpen(), "Database is closed"); CouchUtils.validateDocumentId(docId); Preconditions.checkNotNull(body, "Input document body can not be null"); try { return queue.submitTransaction(new SQLQueueCallable<LocalDocument>() { @Override public LocalDocument call(SQLDatabase db) throws Exception { ContentValues values = new ContentValues(); values.put("docid", docId); values.put("json", body.asBytes()); long rowId = db.insertWithOnConflict("localdocs", values, SQLDatabase .CONFLICT_REPLACE); if (rowId < 0) { throw new DocumentException("Failed to insert local document"); } else { logger.finer(String.format("Local doc inserted: %d , %s", rowId, docId)); } return doGetLocalDocument(db, docId); } }).get(); } catch (InterruptedException e) { logger.log(Level.SEVERE, "Failed to insert local document", e); } catch (ExecutionException e) { logger.log(Level.SEVERE,"Failed to insert local document",e); throw new DocumentException("Cannot insert local document",e); } return null; }
Source:
<code>protected SmppSplitter createSplitter(Message message) { SmppSplitter splitter; if (message.getHeaders().containsKey(SmppConstants.DATA_SPLITTER)){ splitter = message.getHeader(SmppConstants.DATA_SPLITTER, SmppSplitter.class); if (null != splitter){ return splitter; } <START> logger.warn("Invalid splitter given. Must be instance of SmppSplitter"); <END> } Alphabet alphabet = determineAlphabet(message); String body = message.getBody(String.class); if (SmppUtils.is8Bit(alphabet)) { splitter = new Smpp8BitSplitter(body.length()); } else if (alphabet == Alphabet.ALPHA_UCS2) { splitter = new SmppUcs2Splitter(body.length()); } else { splitter = new SmppDefaultSplitter(body.length()); } return splitter; }</code><technical_language>throw exception</technical_language>

Target:
protected SmppSplitter createSplitter(Message message) throws SmppException { SmppSplitter splitter; if (message.getHeaders().containsKey(SmppConstants.DATA_SPLITTER)) { splitter = message.getHeader(SmppConstants.DATA_SPLITTER, SmppSplitter.class); if (null != splitter) { return splitter; } throw new SmppException("Invalid splitter given. Must be instance of SmppSplitter"); } Alphabet alphabet = determineAlphabet(message); String body = message.getBody(String.class); if (SmppUtils.is8Bit(alphabet)) { splitter = new Smpp8BitSplitter(body.length()); } else if (alphabet == Alphabet.ALPHA_UCS2) { splitter = new SmppUcs2Splitter(body.length()); } else { splitter = new SmppDefaultSplitter(body.length()); } return splitter; }
Source:
<code>protected boolean isFinished() { <START> return false; <END> }</code><technical_language>Returning false fine, return (enable == modifier.isEnabled()) clearer</technical_language>

Target:
protected boolean isFinished() { return true; }
Source:
<code>public static TimelineFeedback create( @JsonProperty("date_of_night") final String dateOfNight, @JsonProperty("old_time_of_event") final String oldTimeOfEvent, @JsonProperty("new_time_of_event") final String newTimeOfEvent, @JsonProperty("event_type") final String eventTypeString) { final DateTime date = DateTime.parse(dateOfNight); final DateTime realDate = new DateTime(date.getMillis(), DateTimeZone.UTC).withTimeAtStartOfDay(); final Event.Type eventType = Event.Type.fromString(eventTypeString); <START> return new TimelineFeedback(0L, realDate, oldTimeOfEvent, newTimeOfEvent, eventType, Optional.<Long>absent(),Optional.<Long>absent()); <END> }</code><technical_language>if set 0L need for Optional<Long>, right</technical_language>

Target:
public static TimelineFeedback create( @JsonProperty("date_of_night") final String dateOfNight, @JsonProperty("old_time_of_event") final String oldTimeOfEvent, @JsonProperty("new_time_of_event") final String newTimeOfEvent, @JsonProperty("event_type") final String eventTypeString) { final DateTime date = DateTime.parse(dateOfNight); final DateTime realDate = new DateTime(date.getMillis(), DateTimeZone.UTC).withTimeAtStartOfDay(); final Event.Type eventType = Event.Type.fromString(eventTypeString); return new TimelineFeedback(realDate, oldTimeOfEvent, newTimeOfEvent, eventType, Optional.<Long>absent(),Optional.<Long>absent(), null); }
Source:
<code>private static void updateStepMessage(CommandBase<?> cmd, Guid vdsForExecution) { StepEnum stepEnum = null; try { stepEnum = StepEnum.valueOf(getStepWithHostname(cmd)); } catch (IllegalArgumentException e) { log.debug("No StepEnum found for " + getStepWithHostname(cmd)); return; } Step step = cmd.getExecutionContext().getStep(); Map<String, String> jobProperties = cmd.getJobMessageProperties(); jobProperties.put(VdcObjectType.VDS.name().toLowerCase(), getVdsDao().get(vdsForExecution).getName()); step.setDescription(ExecutionMessageDirector.resolveStepMessage(stepEnum, jobProperties)); getStepDao().update(step); <START> cmd.addCustomValues(jobProperties); <END> new AuditLogDirector().log(cmd, AuditLogType.USER_MERGE_SNAPSHOT_ON_HOST); }</code><technical_language>I of this signature done instead simply by: jobProperties.entrySet().stream().forEach((k) -> cmd.addCustomValue(k.getKey(), k.getValue())); I need add another method for this specifically case. In addition, I coupling plance holders naming Jobs resources file audit-log-director is welcome, changing affect other</technical_language>

Target:
private static void updateStepMessage(CommandBase<?> cmd, Guid vdsForExecution) { StepEnum stepEnum = null; try { stepEnum = StepEnum.valueOf(getStepWithHostname(cmd)); } catch (IllegalArgumentException e) { log.debug("No StepEnum found for " + getStepWithHostname(cmd)); return; } Step step = cmd.getExecutionContext().getStep(); Map<String, String> jobProperties = cmd.getJobMessageProperties(); jobProperties.put(VdcObjectType.VDS.name().toLowerCase(), getVdsDao().get(vdsForExecution).getName()); step.setDescription(ExecutionMessageDirector.resolveStepMessage(stepEnum, jobProperties)); getStepDao().update(step); AuditLogType logType = null; try { logType = AuditLogType.valueOf(getAuditLogType(cmd)); } catch (IllegalArgumentException e) { log.debug("No AuditLogType found for " + getAuditLogType(cmd)); return; } jobProperties.entrySet().stream().forEach(entry -> cmd.addCustomValue(entry.getKey(), entry.getValue())); Injector.get(AuditLogDirector.class).log(cmd, logType); }
Source:
<code>private boolean progressGraph() throws IOException { finishedNodes.swap(); HashSet<ExecutableNode> nodesToCheck = new HashSet<ExecutableNode>(); for (ExecutableNode node : finishedNodes) { Set<String> outNodeIds = node.getOutNodes(); ExecutableFlowBase parentFlow = node.getParentFlow(); <START> if (node.getStatus() == Status.FAILED || (node.getStatus() == Status.KILLED && node.isKilledBySLA())) { <END> if (!retryJobIfPossible(node)) { propagateStatus(node.getParentFlow(), Status.FAILED_FINISHING); if (failureAction == FailureAction.CANCEL_ALL) { this.kill(); } this.flowFailed = true; } else { nodesToCheck.add(node); continue; } } if (outNodeIds.isEmpty()) { finalizeFlow(parentFlow); finishExecutableNode(parentFlow); if (!(parentFlow instanceof ExecutableFlow)) { outNodeIds = parentFlow.getOutNodes(); parentFlow = parentFlow.getParentFlow(); } } for (String nodeId : outNodeIds) { ExecutableNode outNode = parentFlow.getExecutableNode(nodeId); nodesToCheck.add(outNode); } } boolean jobsRun = false; for (ExecutableNode node : nodesToCheck) { if (Status.isStatusFinished(node.getStatus()) || Status.isStatusRunning(node.getStatus())) { continue; } jobsRun |= runReadyJob(node); } if (jobsRun || finishedNodes.getSize() > 0) { updateFlow(); return true; } return false; }</code><technical_language>check statuses here. is Killed, other is isKilledBySLA. firstly? if miss of progressGraph. happen</technical_language>

Target:
private boolean progressGraph() throws IOException { this.finishedNodes.swap(); final HashSet<ExecutableNode> nodesToCheck = new HashSet<>(); for (final ExecutableNode node : this.finishedNodes) { Set<String> outNodeIds = node.getOutNodes(); ExecutableFlowBase parentFlow = node.getParentFlow(); if (node.getStatus() == Status.FAILED || (node.getStatus() == Status.KILLED && node.isKilledBySLA())) { if (!retryJobIfPossible(node)) { propagateStatus(node.getParentFlow(), Status.FAILED_FINISHING); if (this.failureAction == FailureAction.CANCEL_ALL) { this.kill(); } this.flowFailed = true; } else { nodesToCheck.add(node); continue; } } if (outNodeIds.isEmpty()) { finalizeFlow(parentFlow); finishExecutableNode(parentFlow); if (!(parentFlow instanceof ExecutableFlow)) { outNodeIds = parentFlow.getOutNodes(); parentFlow = parentFlow.getParentFlow(); } } for (final String nodeId : outNodeIds) { final ExecutableNode outNode = parentFlow.getExecutableNode(nodeId); nodesToCheck.add(outNode); } } boolean jobsRun = false; for (final ExecutableNode node : nodesToCheck) { if (notReadyToRun(node.getStatus())) { continue; } jobsRun |= runReadyJob(node); } if (jobsRun || this.finishedNodes.getSize() > 0) { updateFlow(); return true; } return false; }
Source:
<code>private void performPrimaryAction() { switch (getPrimaryAction()) { case PUBLISH_NOW: case UPDATE: case SCHEDULE: showPrepublishingNudgeBottomSheet(); <START> return; <END> case SUBMIT_FOR_REVIEW: case SAVE: uploadPost(false); break; } }</code><technical_language>confirmation dialog is anymore. want consider removing it. Wdyt</technical_language>

Target:
private void performPrimaryAction() { switch (getPrimaryAction()) { case PUBLISH_NOW: case UPDATE: case SCHEDULE: mAnalyticsTrackerWrapper.track(Stat.EDITOR_POST_PUBLISH_TAPPED); showPrepublishingNudgeBottomSheet(); return; case SUBMIT_FOR_REVIEW: case SAVE: uploadPost(false); break; } }
Source:
<code>protected io.gravitee.definition.model.endpoint.HttpEndpoint resolve(io.gravitee.definition.model.endpoint.HttpEndpoint endpoint) { endpoint.setTarget(convert(endpoint.getTarget())); if (endpoint.getHttpProxy() != null) { endpoint.getHttpProxy().setHost(convert(endpoint.getHttpProxy().getHost())); endpoint.getHttpProxy().setUsername(convert(endpoint.getHttpProxy().getUsername())); endpoint.getHttpProxy().setPassword(convert(endpoint.getHttpProxy().getPassword())); } <START> if (endpoint.getHeaders() != null && endpoint.getHeaders().isEmpty()) { <END> endpoint.getHeaders().replaceAll((key, value) -> convert(value)); } return endpoint; }</code><technical_language>I a !is missing in condition</technical_language>

Target:
protected io.gravitee.definition.model.endpoint.HttpEndpoint resolve(io.gravitee.definition.model.endpoint.HttpEndpoint endpoint) { endpoint.setTarget(convert(endpoint.getTarget())); if (endpoint.getHttpProxy() != null) { endpoint.getHttpProxy().setHost(convert(endpoint.getHttpProxy().getHost())); endpoint.getHttpProxy().setUsername(convert(endpoint.getHttpProxy().getUsername())); endpoint.getHttpProxy().setPassword(convert(endpoint.getHttpProxy().getPassword())); } if (endpoint.getHeaders() != null && !endpoint.getHeaders().isEmpty()) { endpoint.getHeaders().replaceAll((key, value) -> convert(value)); } return endpoint; }
Source:
<code>public void writeObject(ObjectOutput output, GroupAddedEvent obj) throws IOException { output.writeByte(VERSION_1); MarshallUtil.marshallString(obj.groupId, output); MarshallUtil.marshallString(obj.realmId, output); MarshallUtil.marshallString(obj.parentId, output); <START> } <END></code><technical_language>This VERSION_2 serialization, structure of message changed is read version 1 messages anymore exception</technical_language>

Target:
public void writeObject(ObjectOutput output, GroupAddedEvent obj) throws IOException { output.writeByte(VERSION_2); MarshallUtil.marshallString(obj.groupId, output); MarshallUtil.marshallString(obj.realmId, output); MarshallUtil.marshallString(obj.parentId, output); }
Source:
<code>public void testSinkTaskPut() throws Exception { setUp(); HdfsSinkTask task = new HdfsSinkTask(); String key = "key"; Schema schema = createSchema(); Struct record = createRecord(schema); Collection<SinkRecord> sinkRecords = new ArrayList<>(); for (TopicPartition tp : context.assignment()) { for (long offset = 0; offset < 7; offset++) { SinkRecord sinkRecord = new SinkRecord(tp.topic(), tp.partition(), Schema.STRING_SCHEMA, key, schema, record, offset); sinkRecords.add(sinkRecord); } } <START> properties.remove(StorageCommonConfig.STORE_URL_CONFIG); <END> task.initialize(context); task.start(properties); task.put(sinkRecords); task.stop(); AvroData avroData = task.getAvroData(); long[] validOffsets = {-1, 2, 5}; for (TopicPartition tp : context.assignment()) { String directory = tp.topic() + "/" + "partition=" + String.valueOf(tp.partition()); for (int j = 1; j < validOffsets.length; ++j) { long startOffset = validOffsets[j - 1] + 1; long endOffset = validOffsets[j]; Path path = new Path(FileUtils.committedFileName(url, topicsDir, directory, tp, startOffset, endOffset, extension, ZERO_PAD_FMT)); Collection<Object> records = schemaFileReader.readData(connectorConfig.getHadoopConfiguration(), path); long size = endOffset - startOffset + 1; assertEquals(records.size(), size); for (Object avroRecord : records) { assertEquals(avroRecord, avroData.fromConnectData(schema, record)); } } } }</code><technical_language>wondering if set of STORE_URL_CONFIG prop in io.confluent.connect.hdfs.TestWithSecureMiniDFSCluster#createProps (that is url for HDFS_URL_CONFIG is overridden)</technical_language>

Target:
public void testSinkTaskPut() throws Exception { setUp(); HdfsSinkTask task = new HdfsSinkTask(); String key = "key"; Schema schema = createSchema(); Struct record = createRecord(schema); Collection<SinkRecord> sinkRecords = new ArrayList<>(); for (TopicPartition tp : context.assignment()) { for (long offset = 0; offset < 7; offset++) { SinkRecord sinkRecord = new SinkRecord(tp.topic(), tp.partition(), Schema.STRING_SCHEMA, key, schema, record, offset); sinkRecords.add(sinkRecord); } } task.initialize(context); task.start(properties); task.put(sinkRecords); task.stop(); AvroData avroData = task.getAvroData(); long[] validOffsets = {-1, 2, 5}; for (TopicPartition tp : context.assignment()) { String directory = tp.topic() + "/" + "partition=" + String.valueOf(tp.partition()); for (int j = 1; j < validOffsets.length; ++j) { long startOffset = validOffsets[j - 1] + 1; long endOffset = validOffsets[j]; Path path = new Path(FileUtils.committedFileName(url, topicsDir, directory, tp, startOffset, endOffset, extension, ZERO_PAD_FMT)); Collection<Object> records = schemaFileReader.readData(connectorConfig.getHadoopConfiguration(), path); long size = endOffset - startOffset + 1; assertEquals(records.size(), size); for (Object avroRecord : records) { assertEquals(avroRecord, avroData.fromConnectData(schema, record)); } } } }
Source:
<code>private void refreshIndex( WritableFulltext index ) { try { index.maybeRefreshBlocking(); } catch ( IOException e ) <START> { <END> e.printStackTrace(); } }</code><technical_language>nice if event updater get some kind of criteria determine do this instead. provide ability test in easy refresh interval configurable</technical_language>

Target:
private void refreshIndex( WritableFulltext index ) { try { index.maybeRefreshBlocking(); } catch ( IOException e ) { log.error( "Failed to refresh fulltext after updates", e ); } }
Source:
<code>protected List<File> showFileDialog() { int style = SWT.NONE; if (getScoutFileChooser().isTypeLoad()) { style |= SWT.OPEN; } else { style |= SWT.SAVE; } if (getScoutFileChooser().isMultiSelect()) { style |= SWT.MULTI; } String[] extensions = new String[]{"*.*"}; if (getScoutFileChooser().getFileExtensions() != null) { List<String> extensionList = new ArrayList<String>(); for (String ext : getScoutFileChooser().getFileExtensions()) { extensionList.add("*." + ext); } <START> String allExtensions = StringUtility.join(";", extensionList.toArray(new String[extensionList.size()])); <END> extensionList.add(0, allExtensions); extensions = extensionList.toArray(new String[extensionList.size()]); } FileDialog dialog = new FileDialog(getParentShell(), style); dialog.setFilterExtensions(extensions); if (getScoutFileChooser().getDirectory() != null) { dialog.setFilterPath(getScoutFileChooser().getDirectory().getAbsolutePath()); } if (getScoutFileChooser().getFileName() != null) { dialog.setFileName(getScoutFileChooser().getFileName()); } dialog.open(); String filterPath = dialog.getFilterPath(); String[] fileNames = dialog.getFileNames(); List<File> result = new ArrayList<File>(); for (String fileName : fileNames) { result.add(new Path(filterPath).append(fileName).toFile()); } return result; }</code><technical_language>I write a StringUtility.join accepts a List<String></technical_language>

Target:
protected List<File> showFileDialog() { int style = SWT.NONE; if (getScoutFileChooser().isTypeLoad()) { style |= SWT.OPEN; } else { style |= SWT.SAVE; } if (getScoutFileChooser().isMultiSelect()) { style |= SWT.MULTI; } String[] extensions = new String[]{"*.*"}; if (getScoutFileChooser().getFileExtensions() != null) { List<String> extensionList = new ArrayList<String>(); for (String ext : getScoutFileChooser().getFileExtensions()) { extensionList.add("*." + ext); } String allExtensions = StringUtility.join(";", extensionList); extensionList.add(0, allExtensions); extensions = extensionList.toArray(new String[extensionList.size()]); } FileDialog dialog = new FileDialog(getParentShell(), style); dialog.setFilterExtensions(extensions); if (getScoutFileChooser().getDirectory() != null) { dialog.setFilterPath(getScoutFileChooser().getDirectory().getAbsolutePath()); } if (getScoutFileChooser().getFileName() != null) { dialog.setFileName(getScoutFileChooser().getFileName()); } dialog.open(); String filterPath = dialog.getFilterPath(); String[] fileNames = dialog.getFileNames(); List<File> result = new ArrayList<File>(); for (String fileName : fileNames) { result.add(new Path(filterPath).append(fileName).toFile()); } return result; }
Source:
<code>public static NewSessionPayload create(Capabilities caps) throws IOException { boolean forceMobileJSONWP = ofNullable(caps.getCapability(FORCE_MJSONWP)) <START> .map(o -> { <END> if (Boolean.class.isAssignableFrom(o.getClass())) { return Boolean.class.cast(o); } return false; }).orElse(false); HashMap<String, ?> capabilityMap = new HashMap<>(caps.asMap()); capabilityMap.remove(FORCE_MJSONWP); return create(ImmutableMap.of("desiredCapabilities", capabilityMap), forceMobileJSONWP); }</code><technical_language>ternary operator</technical_language>

Target:
public static NewSessionPayload create(Capabilities caps) throws IOException { boolean forceMobileJSONWP = ofNullable(caps.getCapability(FORCE_MJSONWP)) .map(o -> Boolean.class.isAssignableFrom(o.getClass()) && Boolean.class.cast(o)) .orElse(false); HashMap<String, ?> capabilityMap = new HashMap<>(caps.asMap()); capabilityMap.remove(FORCE_MJSONWP); Map<String, ?> source = of(DESIRED_CAPABILITIES, capabilityMap); String json = new Json().toJson(source); return new NewSessionPayload(new StringReader(json), forceMobileJSONWP); }
Source:
<code>public void testDiagnosticRedrawingCalls() throws CoreException { IFile file = TestUtils.createUniqueTestFile(project, "Diagnostic Other Text\nDiagnostic Other Text"); IWorkspace workspace = ResourcesPlugin.getWorkspace(); <START> IResourceChangeListener listener = new IResourceChangeListener() { <END> @Override public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); if (delta == null) return; IResourceDelta[] childDeltas = delta.getAffectedChildren(); if (childDeltas.length == 0) return; childDeltas = childDeltas[0].getAffectedChildren(); if (childDeltas.length == 0 || childDeltas[0].getMarkerDeltas().length == 0) return; resourceChanges++; } }; workspace.addResourceChangeListener(listener); final Range range1 = new Range(new Position(0, 0), new Position(0, 10)); final Range range2 = new Range(new Position(1, 0), new Position(1, 10)); final Diagnostic pos1Info1 = createDiagnostic("1", "message1", range1, DiagnosticSeverity.Error, "source1"); final Diagnostic pos1Info2 = createDiagnostic("2", "message2", range1, DiagnosticSeverity.Error, "source2"); final Diagnostic pos2Info2 = createDiagnostic("2", "message2", range2, DiagnosticSeverity.Error, "source2"); try { confirmResourceChanges(file, pos1Info1, 2); confirmResourceChanges(file, pos1Info2, 1); confirmResourceChanges(file, pos2Info2, 1); confirmResourceChanges(file, pos1Info1, 1); confirmResourceChanges(file, pos1Info1, 0); } finally { workspace.removeResourceChangeListener(listener); } }</code><technical_language>nicer a dedicated interface implementing IResourceChangeListener IntSupplier</technical_language>

Target:
public void testDiagnosticRedrawingCalls() throws CoreException { IFile file = TestUtils.createUniqueTestFile(project, "Diagnostic Other Text\nDiagnostic Other Text"); final Range range1 = new Range(new Position(0, 0), new Position(0, 10)); final Range range2 = new Range(new Position(1, 0), new Position(1, 10)); final Diagnostic pos1Info1 = createDiagnostic("1", "message1", range1, DiagnosticSeverity.Error, "source1"); final Diagnostic pos1Info2 = createDiagnostic("2", "message2", range1, DiagnosticSeverity.Error, "source2"); final Diagnostic pos2Info2 = createDiagnostic("2", "message2", range2, DiagnosticSeverity.Error, "source2"); confirmResourceChanges(file, pos1Info1, 2); confirmResourceChanges(file, pos1Info2, 1); confirmResourceChanges(file, pos2Info2, 1); confirmResourceChanges(file, pos1Info1, 1); confirmResourceChanges(file, pos1Info1, 0); }
Source:
<code>protected void onPostExecute(Boolean result) { String message; String title = "Nominating for Deletion"; if (result){ title += ": Success"; message = "Successfully nominated " + media.getDisplayTitle() + " deletion."; } else { title += ": Failed"; message = "Could not request deletion."; } notificationBuilder.setDefaults(DEFAULT_ALL) .setContentTitle(title) .setStyle(new NotificationCompat.BigTextStyle() .bigText(message)) .setSmallIcon(R.drawable.ic_launcher) .setProgress(0,0,false) .setOngoing(false) .setPriority(PRIORITY_HIGH); <START> String urlForDelete=baseUrl+media.getFilename(); <END> Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlForDelete)); PendingIntent pendingIntent = PendingIntent.getActivity(context , 1 , browserIntent , PendingIntent.FLAG_UPDATE_CURRENT); notificationBuilder.setContentIntent(pendingIntent); notificationManager.notify(NOTIFICATION_DELETE, notificationBuilder.build()); }</code><technical_language>spacing = +</technical_language>

Target:
protected void onPostExecute(Boolean result) { String message; String title = "Nominating for Deletion"; if (result){ title += ": Success"; message = "Successfully nominated " + media.getDisplayTitle() + " deletion."; } else { title += ": Failed"; message = "Could not request deletion."; } notificationBuilder.setDefaults(DEFAULT_ALL) .setContentTitle(title) .setStyle(new NotificationCompat.BigTextStyle() .bigText(message)) .setSmallIcon(R.drawable.ic_launcher) .setProgress(0,0,false) .setOngoing(false) .setPriority(PRIORITY_HIGH); String urlForDelete = BuildConfig.COMMONS_URL + "/wiki/Commons:Deletion_requests/File:" + media.getFilename(); Intent browserIntent = new Intent(Intent.ACTION_VIEW , Uri.parse(urlForDelete)); PendingIntent pendingIntent = PendingIntent.getActivity(context , 1 , browserIntent , PendingIntent.FLAG_UPDATE_CURRENT); notificationBuilder.setContentIntent(pendingIntent); notificationManager.notify(NOTIFICATION_DELETE, notificationBuilder.build()); }
Source:
<code>public void processBody(final ParserContext context) { String documentBody = context.getBody(); try (InputStream stream = new ByteArrayInputStream(documentBody.getBytes(StandardCharsets.UTF_8))){ TexyRestService texyService = new TexyRestService(new URL("http://localhost:8022/TexyService.rest.php")); try (InputStream xhtmlIS = texyService.convertTexyToXhtml(stream)){ java.util.Scanner s = new java.util.Scanner(xhtmlIS, StandardCharsets.UTF_8.name()).useDelimiter("\\A"); String xhtmlString = s.hasNext() ? s.next() : ""; context.setBody(xhtmlString); } catch (IOException ex) { throw new RuntimeException("Couldn't convert:'" + context.getContentPath() + "': " + ex.getMessage(), ex); } <START> } <END> catch (IOException ex) { throw new RuntimeException("Failed opening String stream: " + ex.getMessage(), ex); } }</code><technical_language>This a candidate for another configuration option. a check if service is handle error</technical_language>

Target:
public void processBody(final ParserContext context) { String documentBody = context.getBody(); try (InputStream stream = new ByteArrayInputStream(documentBody.getBytes(StandardCharsets.UTF_8))){ TexyRestService texyService = new TexyRestService(new URL("http://localhost:8022/TexyService.rest.php")); String xhtmlString = null; try (InputStream xhtmlIS = texyService.convertTexyToXhtml(stream)){ java.util.Scanner s = new java.util.Scanner(xhtmlIS, StandardCharsets.UTF_8.name()).useDelimiter("\\A"); xhtmlString = s.hasNext() ? s.next() : ""; context.setBody(xhtmlString); if (!context.getDocumentModel().containsKey(Crawler.Attributes.TITLE)) { try { new TitleExtractor().tryExtractHighestHeader(context); } catch (Exception ex){ LOG.warn("Could not extract title from '{}': {}\nConverted XHTML: \n{}", context.getFile().getName(), ex.getMessage(), xhtmlString); } if (StringUtils.isBlank((String) context.getDocumentModel().get(Crawler.Attributes.TITLE))) context.getDocumentModel().put(Crawler.Attributes.TITLE, context.getFile().getName()); } } catch (IOException ex) { String msg = "Couldn't convert:'" + context.getFile().getPath() + "': " + ex.getMessage(); throw new RuntimeException(msg, ex); } } catch (IOException ex) { throw new RuntimeException("Failed opening String stream: " + ex.getMessage(), ex); } }
Source:
<code>public MainController(String applicationName, LibraryController libraryController, AppsController appsController, EnginesController enginesController, ContainersController containersController, InstallationsFeaturePanel installationsView, SettingsController settingsController, RepositoryManager repositoryManager, ThemeManager themeManager, JavaFxSettingsManager javaFxSettingsManager) { super(); this.applicationName = applicationName; this.mainWindow = new MainWindow(applicationName, libraryController.getView(), appsController.getView(), enginesController.getView(), containersController.getView(), installationsView, settingsController.getView(), themeManager, javaFxSettingsManager); this.themeManager = themeManager; this.javaFxSettingsManager = javaFxSettingsManager; repositoryManager.addCallbacks(this::setDefaultCategoryIcons, e -> { }); installationsView.setOnInstallationAdded(this.mainWindow::showInstallations); <START> this.mainWindow.getApplicationsTab().selectedProperty().addListener((observable, oldValue, newValue) -> { if (newValue && !repositoryManager.isRepositoryLoaded()) { repositoryManager.triggerRepositoryChange(); } }); this.mainWindow.getContainersTab().selectedProperty().addListener((observable, oldValue, newValue) -> { if (newValue && !repositoryManager.isRepositoryLoaded()) { repositoryManager.triggerRepositoryChange(); } }); <END> }</code><technical_language>extracting listener a local variable: java final ChangeListener<Boolean> tabListener = (observable, oldValue, newValue) -> { if (newValue && !repositoryManager.isRepositoryLoaded()) { repositoryManager.triggerRepositoryChange(); } }; this.mainWindow.getApplicationsTab().selectedProperty().addListener(tabListener); this.mainWindow.getContainersTab().selectedProperty().addListener(tabListener);</technical_language>

Target:
public MainController(String applicationName, LibraryController libraryController, AppsController appsController, EnginesController enginesController, ContainersController containersController, InstallationsFeaturePanel installationsView, SettingsController settingsController, RepositoryManager repositoryManager, ThemeManager themeManager, JavaFxSettingsManager javaFxSettingsManager) { super(); this.applicationName = applicationName; this.mainWindow = new MainWindow(applicationName, libraryController.getView(), appsController.getView(), enginesController.getView(), containersController.getView(), installationsView, settingsController.getView(), themeManager, javaFxSettingsManager); this.themeManager = themeManager; this.javaFxSettingsManager = javaFxSettingsManager; repositoryManager.addCallbacks(this::setDefaultCategoryIcons, e -> { }); installationsView.setOnInstallationAdded(this.mainWindow::showInstallations); final ChangeListener<Boolean> tabSelectedListener = (observable, oldValue, newValue) -> { if (newValue && !repositoryManager.isRepositoryLoaded()) { repositoryManager.triggerRepositoryChange(); } }; this.mainWindow.getApplicationsTab().selectedProperty().addListener(tabSelectedListener); this.mainWindow.getContainersTab().selectedProperty().addListener(tabSelectedListener); }
Source:
<code>public ContextMenuBuilder createPrimaryContextMenu(JsonTree node) { ContextMenuBuilder contextMenu = new ContextMenuBuilder(); <START> ContextMenuLevel primaryLevel = contextMenu.addLevel(LEVEL_PRIMARY); <END> primaryLevel.setVisible(true); JsonTreeValue.Type type = node.getValue().getType(); ENDED level. if ((type == JsonTreeValue.Type.ARRAY && !node.getValue().getKey().equals("contents")) || type == JsonTreeValue.Type.OBJECT) { ContextMenuLevel addLevel = contextMenu.addLevel(LEVEL_ADD_EXTENDED); primaryLevel.addOption(OPTION_ADD_EXTENDED, n -> contextMenu.getLevel(LEVEL_ADD_EXTENDED).setVisible(!addLevel.isVisible()), null, false); createAddContextMenu(node, addLevel); } if (type == JsonTreeValue.Type.ARRAY && node.getValue().getKey().equals("contents")) { primaryLevel.addOption(OPTION_ADD_WIDGET, externalConsumers.get(OPTION_ADD_WIDGET), node, true); } primaryLevel.addOption(OPTION_COPY, externalConsumers.get(OPTION_COPY), node, true); primaryLevel.addOption(OPTION_PASTE, externalConsumers.get(OPTION_PASTE), node, true); if (type != JsonTreeValue.Type.NULL && !(type == JsonTreeValue.Type.OBJECT && !node.isRoot() && node.getParent().getValue().getType() == JsonTreeValue.Type.ARRAY)) { primaryLevel.addOption(OPTION_EDIT, externalConsumers.get(OPTION_EDIT), node, true); } return contextMenu; }</code><technical_language>I this extra complexity named levels is necessary. constant LEVEL_PRIMARY get here</technical_language>

Target:
public ContextMenuBuilder createPrimaryContextMenu(JsonTree node) { ContextMenuBuilder contextMenu = new ContextMenuBuilder(); ContextMenuLevel primaryLevel = contextMenu.addLevel(true); JsonTreeValue.Type type = node.getValue().getType(); ENDED level. if ((type == JsonTreeValue.Type.ARRAY && !node.getValue().getKey().equals("contents")) || type == JsonTreeValue.Type.OBJECT) { ContextMenuLevel addLevel = contextMenu.addLevel(false); primaryLevel.addNavigationOption(OPTION_ADD_EXTENDED, addLevel); createAddContextMenu(node, addLevel); } if (type == JsonTreeValue.Type.ARRAY && node.getValue().getKey().equals("contents")) { primaryLevel.addOption(OPTION_ADD_WIDGET, externalConsumers.get(OPTION_ADD_WIDGET), node, true); } primaryLevel.addOption(OPTION_COPY, externalConsumers.get(OPTION_COPY), node, true); primaryLevel.addOption(OPTION_PASTE, externalConsumers.get(OPTION_PASTE), node, true); if (type != JsonTreeValue.Type.NULL && !(type == JsonTreeValue.Type.OBJECT && !node.isRoot() && node.getParent().getValue().getType() == JsonTreeValue.Type.ARRAY)) { primaryLevel.addOption(OPTION_EDIT, externalConsumers.get(OPTION_EDIT), node, true); } return contextMenu; }
Source:
<code>public T getValue() { if (!this.started) { throw ClusteringServerLogger.ROOT_LOGGER.notStarted(this.context.getServiceName().getCanonicalName()); } try { Map<Node, CommandResponse<Optional<T>>> responses = this.context.getCommandDispatcher().executeOnCluster(new SingletonValueCommand<T>()); List<Map.Entry<Node, Optional<T>>> result = responses.entrySet().stream().map(entry -> { try { return new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue().get()); } catch (ExecutionException e) { throw new IllegalArgumentException(e); } }).filter(entry -> entry.getValue() != null).collect(Collectors.toList()); if (result.size() > 1) { throw ClusteringServerLogger.ROOT_LOGGER.multiplePrimaryProvidersDetected(this.context.getServiceName().getCanonicalName(), result.stream().map(Map.Entry::getKey).collect(Collectors.toList())); } <START> for (Map.Entry<Node, Optional<T>> nodeOptionalEntry : result) { <END> return Optional.of(nodeOptionalEntry).orElseThrow(() -> ClusteringServerLogger.ROOT_LOGGER.noResponseFromMaster(this.context.getServiceName().getCanonicalName())).getValue().orElse(null); } return Optional.<Map.Entry<Node, Optional<T>>>empty().orElseThrow(() -> ClusteringServerLogger.ROOT_LOGGER.noResponseFromMaster(this.context.getServiceName().getCanonicalName())).getValue().orElse(null); } catch (CommandDispatcherException e) { throw new IllegalArgumentException(e); } }</code><technical_language>Unnecessary Optional wrapping. Replace this code with: java for (Map.Entry<Node, Optional<T>> entry : result) { return entry.getValue().orElse(null); } throw ClusteringServerLogger.ROOT_LOGGER.noResponseFromMaster(this.context.getServiceName().getCanonicalName());</technical_language>

Target:
public T getValue() { if (!this.started) { throw ClusteringServerLogger.ROOT_LOGGER.notStarted(this.context.getServiceName().getCanonicalName()); } try { Map<Node, CommandResponse<Optional<T>>> responses = this.context.getCommandDispatcher().executeOnCluster(new SingletonValueCommand<T>()); List<Map.Entry<Node, Optional<T>>> result = responses.entrySet().stream().map(entry -> { try { return new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue().get()); } catch (ExecutionException e) { throw new IllegalArgumentException(e); } }).filter(entry -> entry.getValue() != null).collect(Collectors.toList()); if (result.size() > 1) { throw ClusteringServerLogger.ROOT_LOGGER.multiplePrimaryProvidersDetected(this.context.getServiceName().getCanonicalName(), result.stream().map(Map.Entry::getKey).collect(Collectors.toList())); } if (result.isEmpty()) { throw ClusteringServerLogger.ROOT_LOGGER.noResponseFromMaster(this.context.getServiceName().getCanonicalName()); } return result.get(0).getValue().orElse(null); } catch (CommandDispatcherException e) { throw new IllegalArgumentException(e); } }
Source:
<code>protected ThingHandler createHandler(Thing thing) { <START> return new FSInternetRadioHandler(thing); <END> }</code><technical_language>I agree framework call this function if type is part of supported ones. @kaikreuzer If is supported type, I rely fact framework calls this function if consists of respective type. trust OSGi framwork calls functions (activate, bind, etc.) correct arguments</technical_language>

Target:
protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(THING_TYPE_RADIO)) { return new FSInternetRadioHandler(thing); } return null; }
Source:
<code>Coordinator(TestSuite testSuite, ComponentRegistry componentRegistry, CoordinatorParameters coordinatorParameters, WorkerParameters workerParameters, ClusterLayoutParameters clusterLayoutParameters, ClusterLayout clusterLayout) { this.outputDirectory = ensureExistingDirectory(new File(System.getProperty("user.dir"), testSuite.getId())); <START> echoLocal("Output directory: " + outputDirectory.getAbsolutePath()); <END> this.testSuite = testSuite; this.componentRegistry = componentRegistry; this.coordinatorParameters = coordinatorParameters; this.workerParameters = workerParameters; this.clusterLayoutParameters = clusterLayoutParameters; this.hdrHistogramContainer = new HdrHistogramContainer(outputDirectory, performanceStateContainer); this.failureContainer = new FailureContainer( outputDirectory, componentRegistry, testSuite.getTolerableFailures()); this.simulatorProperties = coordinatorParameters.getSimulatorProperties(); this.bash = new Bash(simulatorProperties); this.clusterLayout = clusterLayout; this.hazelcastJARs = HazelcastJARs.newInstance(bash, simulatorProperties, clusterLayout.getVersionSpecs()); this.lastTestPhaseToSync = coordinatorParameters.getLastTestPhaseToSync(); logConfiguration(); }</code><technical_language>done in logConfiguration(), constructor get polluted</technical_language>

Target:
Coordinator(TestSuite testSuite, ComponentRegistry componentRegistry, CoordinatorParameters coordinatorParameters, WorkerParameters workerParameters, ClusterLayoutParameters clusterLayoutParameters, ClusterLayout clusterLayout) { this.outputDirectory = ensureExistingDirectory(new File(System.getProperty("user.dir"), testSuite.getId())); this.testSuite = testSuite; this.componentRegistry = componentRegistry; this.coordinatorParameters = coordinatorParameters; this.workerParameters = workerParameters; this.clusterLayoutParameters = clusterLayoutParameters; this.hdrHistogramContainer = new HdrHistogramContainer(outputDirectory, performanceStateContainer); this.failureContainer = new FailureContainer( outputDirectory, componentRegistry, testSuite.getTolerableFailures()); this.simulatorProperties = coordinatorParameters.getSimulatorProperties(); this.bash = new Bash(simulatorProperties); this.clusterLayout = clusterLayout; this.hazelcastJARs = HazelcastJARs.newInstance(bash, simulatorProperties, clusterLayout.getVersionSpecs()); this.lastTestPhaseToSync = coordinatorParameters.getLastTestPhaseToSync(); logConfiguration(); }