auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void iterationWithoutReloadTest() throws IOException { String storeName = "store"; List<CompactionDetails> detailsList = getCompactionDetails(5); assertFalse("Compaction should not be in progress", CompactionLog.isCompactionInProgress(tempDirStr, storeName)); CompactionLog log = new CompactionLog(tempDirStr, storeName, time, detailsList); assertTrue("Compaction should should be in progress", CompactionLog.isCompactionInProgress(tempDirStr, storeName)); for (CompactionDetails details : detailsList) { verifyEquality(details, log.getCompactionDetails()); assertEquals("Should be in the PREPARE phase", CompactionLog.Phase.PREPARE, log.getCompactionPhase()); log.markCopyStart(); assertEquals("Should be in the COPY phase", CompactionLog.Phase.COPY, log.getCompactionPhase()); StoreFindToken safeToken = new StoreFindToken(new MockId("dummy"), new Offset(LogSegmentNameHelper.generateFirstSegmentName(5), 0), new UUID(1, 1)); log.setSafeToken(safeToken); assertEquals("Returned token not the same as the one that was set", safeToken, log.getSafeToken()); log.markSwitchStart(); assertEquals("Should be in the SWITCH phase", CompactionLog.Phase.SWITCH, log.getCompactionPhase()); log.markCleanupStart(); assertEquals("Should be in the CLEANUP phase", CompactionLog.Phase.CLEANUP, log.getCompactionPhase()); log.markCycleComplete(); } assertEquals("Should be in the DONE phase", CompactionLog.Phase.DONE, log.getCompactionPhase()); log.close(); assertFalse("Compaction should not be in progress", CompactionLog.isCompactionInProgress(tempDirStr, storeName)); }

Target:
public void iterationWithoutReloadTest() throws IOException { String storeName = "store"; List<CompactionDetails> detailsList = getCompactionDetails(5); assertFalse("Compaction should not be in progress", CompactionLog.isCompactionInProgress(tempDirStr, storeName)); CompactionLog log = new CompactionLog(tempDirStr, storeName, time, detailsList); assertTrue("Compaction should be in progress", CompactionLog.isCompactionInProgress(tempDirStr, storeName)); for (CompactionDetails details : detailsList) { verifyEquality(details, log.getCompactionDetails()); assertEquals("Should be in the PREPARE phase", CompactionLog.Phase.PREPARE, log.getCompactionPhase()); log.markCopyStart(); assertEquals("Should be in the COPY phase", CompactionLog.Phase.COPY, log.getCompactionPhase()); StoreFindToken safeToken = new StoreFindToken(new MockId("dummy"), new Offset(LogSegmentNameHelper.generateFirstSegmentName(5), 0), new UUID(1, 1)); log.setSafeToken(safeToken); assertEquals("Returned token not the same as the one that was set", safeToken, log.getSafeToken()); log.markSwitchStart(); assertEquals("Should be in the SWITCH phase", CompactionLog.Phase.SWITCH, log.getCompactionPhase()); log.markCleanupStart(); assertEquals("Should be in the CLEANUP phase", CompactionLog.Phase.CLEANUP, log.getCompactionPhase()); log.markCycleComplete(); } assertEquals("Should be in the DONE phase", CompactionLog.Phase.DONE, log.getCompactionPhase()); log.close(); assertFalse("Compaction should not be in progress", CompactionLog.isCompactionInProgress(tempDirStr, storeName)); }
Source:
private static String buildExceptionMessage(Error error) { Assert.notNull(error, "Error argument cannot be null."); StringBuilder sb = new StringBuilder(); sb.append("HTTP ").append(error.getStatus()); String requestId = error.getRequestId(); if (Strings.hasText(requestId)) { sb.append(", RequestId: ").append(error.getRequestId()); } sb.append(", Stormpath ").append(error.getCode()) .append(" (").append(error.getMoreInfo()).append("): ") .append(error.getDeveloperMessage()); return sb.toString(); }

Target:
private static String buildExceptionMessage(Error error) { Assert.notNull(error, "Error argument cannot be null."); StringBuilder sb = new StringBuilder(); sb.append("HTTP ").append(error.getStatus()) .append(", Stormpath ").append(error.getCode()) .append(" (").append(error.getMoreInfo()).append(")"); String requestId = error.getRequestId(); if (Strings.hasText(requestId)) { sb.append(", RequestId ").append(error.getRequestId()); } return sb.append(": ").append(error.getDeveloperMessage()).toString(); }
Source:
public WriteTxnMarkersResponse(Map<Long, Map<TopicPartition, Errors>> errors) { List<WritableTxnMarkerResult> markers = new ArrayList<>(); for (Map.Entry<Long, Map<TopicPartition, Errors>> markerEntry : errors.entrySet()) { Map<String, WritableTxnMarkerTopicResult> responseTopicDataMap = new HashMap<>(); for (Map.Entry<TopicPartition, Errors> topicEntry : markerEntry.getValue().entrySet()) { TopicPartition topicPartition = topicEntry.getKey(); String topicName = topicPartition.topic(); WritableTxnMarkerTopicResult topic = responseTopicDataMap.getOrDefault(topicName, new WritableTxnMarkerTopicResult()); if (topic.name().equals("")) { topic.setName(topicName); } topic.partitions().add(new WritableTxnMarkerPartitionResult() .setErrorCode(topicEntry.getValue().code()) .setPartitionIndex(topicPartition.partition()) ); responseTopicDataMap.put(topicName, topic); } markers.add(new WritableTxnMarkerResult() .setProducerId(markerEntry.getKey()) .setTopics(new ArrayList<>(responseTopicDataMap.values())) ); } this.errors = errors; this.data = new WriteTxnMarkersResponseData() .setMarkers(markers); }

Target:
public WriteTxnMarkersResponse(Map<Long, Map<TopicPartition, Errors>> errors) { List<WritableTxnMarkerResult> markers = new ArrayList<>(); for (Map.Entry<Long, Map<TopicPartition, Errors>> markerEntry : errors.entrySet()) { Map<String, WritableTxnMarkerTopicResult> responseTopicDataMap = new HashMap<>(); for (Map.Entry<TopicPartition, Errors> topicEntry : markerEntry.getValue().entrySet()) { TopicPartition topicPartition = topicEntry.getKey(); String topicName = topicPartition.topic(); WritableTxnMarkerTopicResult topic = responseTopicDataMap.getOrDefault(topicName, new WritableTxnMarkerTopicResult().setName(topicName)); topic.partitions().add(new WritableTxnMarkerPartitionResult() .setErrorCode(topicEntry.getValue().code()) .setPartitionIndex(topicPartition.partition()) ); responseTopicDataMap.put(topicName, topic); } markers.add(new WritableTxnMarkerResult() .setProducerId(markerEntry.getKey()) .setTopics(new ArrayList<>(responseTopicDataMap.values())) ); } this.errors = errors; this.data = new WriteTxnMarkersResponseData() .setMarkers(markers); }
Source:
public static Version getEffective(Version vmCustomCompatibilityVersion, Version vdsGroupCompatibilityVersion, Version defaultVersion) { if (vmCustomCompatibilityVersion != null) { return vmCustomCompatibilityVersion; } else if (vdsGroupCompatibilityVersion != null) { return vdsGroupCompatibilityVersion; } else { return defaultVersion; } }

Target:
public static Version getEffective(Version vmCustomCompatibilityVersion, Version vdsGroupCompatibilityVersion, Version defaultVersion) { if (vmCustomCompatibilityVersion != null) { return vmCustomCompatibilityVersion; } if (vdsGroupCompatibilityVersion != null) { return vdsGroupCompatibilityVersion; } return defaultVersion; }
Source:
public void receiveEndInSource(BubbleMergeWithSearchMessage incomingMsg) { BubbleMergeWithSearchVertexValueWritable vertex = getVertexValue(); vertex.getArrayOfPathList().add(incomingMsg.getPathList()); vertex.getArrayOfInternalKmer().add(incomingMsg.getInternalKmer()); vertex.getArrayOfEdgeTypes().add(incomingMsg.getEdgeTypeList()); int numBranches = vertex.getNumBranches(); numBranches--; vertex.setNumBranches(numBranches); if (numBranches == 0) { int k = 1; VKmerList pathList = vertex.getArrayOfPathList().get(k); VKmer mergeKmer = vertex.getArrayOfInternalKmer().get(k); EdgeTypeList edgeTypes = vertex.getArrayOfEdgeTypes().get(k); vertex.setInternalKmer(mergeKmer); vertex.getEdgeMap(vertex.getArrayOfEdgeTypes().get(k).get(0)).remove(pathList.getPosition(1)); for (int i = 1; i < pathList.size(); i++) { VKmer dest = new VKmer(pathList.getPosition(i)); outgoingMsg.reset(); outgoingMsg.setFlag(State.KILL_MESSAGE_FROM_SOURCE); VKmerList kmerList = new VKmerList(); kmerList.append(pathList.getPosition(i - 1)); if (i + 1 < pathList.size()) { kmerList.append(pathList.getPosition(i + 1)); } outgoingMsg.setPathList(kmerList); outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i - 1).mirror()); if (i < edgeTypes.size()) outgoingMsg.getEdgeTypeList().add(edgeTypes.get(i)); sendMsg(dest, outgoingMsg); } } }

Target:
public void receiveEndInSource(BubbleMergeWithSearchMessage incomingMsg) { BubbleMergeWithSearchVertexValueWritable vertex = getVertexValue(); vertex.getArrayOfPathList().add(incomingMsg.getPathList()); vertex.getArrayOfInternalKmer().add(incomingMsg.getInternalKmer()); vertex.getArrayOfEdgeTypes().add(incomingMsg.getEdgeTypeList()); int numBranches = vertex.getNumBranches(); vertex.setNumBranches(--numBranches); if (numBranches == 0) { pickBestPath(); } }
Source:
public static int binToInt(String bits, boolean unsignd) throws IrregularStringOfBitsException { if ((bits.length() > 32) || (unsignd && bits.length() == 32 && bits.charAt(0) == '1') || !isBinaryString(bits)) { throw new IrregularStringOfBitsException(); } if (!unsignd && bits.length() == 32 && isOverflow(bits)) { return (int)(-Math.pow(2.0, 32.0)); } if (unsignd) { return getUnsignedIntValue(bits); } else { if (bits.charAt(0) == '0') { return Converter.binToInt(bits.substring(1), true); } else{ String s = Converter.twoComplement(bits); return -1 * Converter.binToInt(s, true); } } }

Target:
public static int binToInt(String bits, boolean unsignd) throws IrregularStringOfBitsException { if ((bits.length() > 32) || (unsignd && bits.length() == 32 && bits.charAt(0) == '1') || !isBinaryString(bits)) { throw new IrregularStringOfBitsException(); } if (!unsignd && bits.length() == 32 && isOverflow(bits)) { return OVERFLOW_32; } if (unsignd) { return getUnsignedIntValue(bits); } else { if (bits.charAt(0) == '0') { return Converter.binToInt(bits.substring(1), true); } else{ String s = Converter.twoComplement(bits); return -1 * Converter.binToInt(s, true); } } }
Source:
public void activateImage() throws ProtocolAdapterException, ImageTransferException { final MethodResultCode imageActivate = this.imageTransferCosem.callMethod(Method.IMAGE_ACTIVATE.getValue(), DataObject.newInteger8Data((byte) 0)); if (imageActivate == null) { throw new ProtocolAdapterException(EXCEPTION_MSG_IMAGE_VERIFY_NOT_CALLED); } if (imageActivate == MethodResultCode.TEMPORARY_FAILURE) { final Future<Integer> newStatus = EXECUTOR_SERVICE.submit(new ImageTransferStatusChangeWatcher( ImageTransferStatus.ACTIVATION_INITIATED, properties.getActivationStatusCheckInterval(), properties .getActivationStatusCheckTimeout(), true)); int status; try { status = newStatus.get(); } catch (InterruptedException | ExecutionException e) { throw new ProtocolAdapterException(EXCEPTION_MSG_WAITING_FOR_IMAGE_ACTIVATION, e); } if (status == ImageTransferStatus.ACTIVATION_FAILED.getValue()) { throw new ImageTransferException(EXCEPTION_MSG_IMAGE_TO_ACTIVATE_NOT_OK); } if (status == ImageTransferStatus.ACTIVATION_INITIATED.getValue()) { throw new ImageTransferException(EXCEPTION_MSG_ACTIVATION_TAKING_TOO_LONG); } return; } if (imageActivate != MethodResultCode.SUCCESS) { throw new ImageTransferException(EXCEPTION_MSG_IMAGE_ACTIVATE_NOT_SUCCESS); } }

Target:
public void activateImage() throws ProtocolAdapterException, ImageTransferException { this.connector.getDlmsMessageListener().setDescription( "ImageTransfer call image_activate " + ", call method: " + JdlmsObjectToStringUtil.describeMethod(this.imageTransferCosem.createMethodParameter( Method.IMAGE_ACTIVATE, DataObject.newInteger8Data((byte) 0)))); final MethodResultCode imageActivate = this.imageTransferCosem.callMethod(Method.IMAGE_ACTIVATE, DataObject.newInteger8Data((byte) 0)); if (imageActivate == null) { throw new ProtocolAdapterException(EXCEPTION_MSG_IMAGE_VERIFY_NOT_CALLED); } if (imageActivate == MethodResultCode.TEMPORARY_FAILURE) { this.waitForImageActivation(); return; } if (imageActivate != MethodResultCode.SUCCESS) { throw new ImageTransferException(EXCEPTION_MSG_IMAGE_ACTIVATE_NOT_SUCCESS); } }
Source:
private boolean predefinedSamplesCount() { return totalSamplesRequested != -1; }

Target:
private boolean predefinedSamplesCount() { return totalSamplesCountRequested != -1; }
Source:
public Map<String, SourceFile> processImports(String repositoryId, String content, Version version, SourceCodeRepoInterface sourceCodeRepoInterface, String filepath) { Pattern pattern = Pattern.compile("(?i)(?m)^[ \t]*includeConfig(.*)"); final Matcher matcher = pattern.matcher(content); Set<String> suspectedConfigImports = new HashSet<>(); while (matcher.find()) { suspectedConfigImports.add(CharMatcher.is('\'').trimFrom(matcher.group(1).trim())); } final Configuration configuration = NextflowUtilities.grabConfig(content); Map<String, SourceFile> imports = new HashMap<>(); String mainScriptPath = "main.nf"; if (configuration.containsKey("manifest.mainScript")) { mainScriptPath = configuration.getString("manifest.mainScript"); } suspectedConfigImports.add(mainScriptPath); for (String filename : suspectedConfigImports) { String filenameAbsolutePath = convertRelativePathToAbsolutePath(filepath, filename); Optional<SourceFile> sourceFile = sourceCodeRepoInterface .readFile(repositoryId, version, SourceFile.FileType.NEXTFLOW, filenameAbsolutePath); if (sourceFile.isPresent()) { sourceFile.get().setPath(filename); imports.put(filename, sourceFile.get()); } } List<String> strings = sourceCodeRepoInterface.listFiles(repositoryId, "/", version.getReference()); handleNextFlowImports(repositoryId, version, sourceCodeRepoInterface, imports, strings, "lib"); handleNextFlowImports(repositoryId, version, sourceCodeRepoInterface, imports, strings, "bin"); return imports; }

Target:
public Map<String, SourceFile> processImports(String repositoryId, String content, Version version, SourceCodeRepoInterface sourceCodeRepoInterface, String filepath) { final Matcher matcher = INCLUDE_CONFIG_PATTERN.matcher(content); Set<String> suspectedConfigImports = new HashSet<>(); while (matcher.find()) { suspectedConfigImports.add(CharMatcher.is('\'').trimFrom(matcher.group(1).trim())); } final Configuration configuration = NextflowUtilities.grabConfig(content); Map<String, SourceFile> imports = new HashMap<>(); String mainScriptPath = "main.nf"; if (configuration.containsKey("manifest.mainScript")) { mainScriptPath = configuration.getString("manifest.mainScript"); } suspectedConfigImports.add(mainScriptPath); for (String filename : suspectedConfigImports) { String filenameAbsolutePath = convertRelativePathToAbsolutePath(filepath, filename); Optional<SourceFile> sourceFile = sourceCodeRepoInterface .readFile(repositoryId, version, SourceFile.FileType.NEXTFLOW, filenameAbsolutePath); if (sourceFile.isPresent()) { sourceFile.get().setPath(filename); imports.put(filename, sourceFile.get()); } } List<String> strings = sourceCodeRepoInterface.listFiles(repositoryId, "/", version.getReference()); handleNextFlowImports(repositoryId, version, sourceCodeRepoInterface, imports, strings, "lib"); handleNextFlowImports(repositoryId, version, sourceCodeRepoInterface, imports, strings, "bin"); return imports; }
Source:
public FilePath basePath() { return FilePathCreator.create(getExternalFileDirWithBiggerAvailableSpace().getAbsolutePath(), "/downloads/"); }

Target:
public FilePath basePath() { return FilePathCreator.create(getExternalFileDirWithBiggerAvailableSpace().getAbsolutePath(), DOWNLOADS_DIR); }
Source:
public void deletePreset(final String crop, final Integer presetId) { final ProgramPreset programPreset = presetService.getProgramPresetById(presetId); if (programPreset == null) { errors = new MapBindingResult(new HashMap<String, String>(), PresetDTO.class.getName()); errors.reject("preset.not.found", ""); throw new ResourceNotFoundException(errors.getAllErrors().get(0)); } validateUserIsAProgramMember(crop, securityService.getCurrentlyLoggedInUser().getName(), programPreset.getProgramUuid()); presetService.deleteProgramPreset(presetId); }

Target:
public void deletePreset(final String crop, final Integer presetId) { final ProgramPreset programPreset = presetService.getProgramPresetById(presetId); if (programPreset == null) { errors = new MapBindingResult(new HashMap<String, String>(), PresetDTO.class.getName()); errors.reject("preset.not.found", ""); throw new ResourceNotFoundException(errors.getAllErrors().get(0)); } this.validateUserIsAProgramMember(crop, securityService.getCurrentlyLoggedInUser().getName(), programPreset.getProgramUuid()); presetService.deleteProgramPreset(presetId); }
Source:
public QueryBuilder doRewrite(QueryRewriteContext context) throws IOException { OsStats.Cpu cpu = osService.stats().getCpu(); return super.doRewrite(c -> c.test(cpu)); }

Target:
public QueryBuilder doRewrite(QueryRewriteContext context) throws IOException { OsStats.Cpu cpu = osService.stats().getCpu(); return super.doRewrite(condition -> condition.test(cpu)); }
Source:
TaskTerminationData(InternalJob internalJob, RunningTaskData taskData, TerminationStatus terminationStatus, TaskResultImpl taskResult) { this.taskData = taskData; this.terminationStatus = terminationStatus; taskResult.setPropagatedVariables(SerializationUtil.serializeVariableMap(restoreNonInheritedTaskVariables(taskResult))); this.taskResult = taskResult; this.internalJob = internalJob; }

Target:
TaskTerminationData(InternalJob internalJob, RunningTaskData taskData, TerminationStatus terminationStatus, TaskResultImpl taskResult) { this.taskData = taskData; this.terminationStatus = terminationStatus; if (taskResult != null) { taskResult.setPropagatedVariables(restoreNonInheritedTaskVariables(taskResult)); } this.taskResult = taskResult; this.internalJob = internalJob; }
Source:
public void testNoLocalWrite() { try { addEntries(listFile, "singlefile1/file1"); createFiles("singlefile1/file1", "target"); Configuration conf = new Configuration(getConf()); conf.set("fs.file.impl", MockFileSystem.class.getName()); conf.setBoolean("fs.file.impl.disable.cache", true); runTest(listFile, target, false, false, false, false, true, conf); checkResult(target, 1); } catch (IOException e) { LOG.error("Exception encountered while testing distcp", e); Assert.fail("distcp failure"); } finally { TestDistCpUtils.delete(fs, root); } }

Target:
public void testNoLocalWrite() throws IOException { try { addEntries(listFile, "singlefile1/file1"); createFiles("singlefile1/file1", "target"); Configuration conf = new Configuration(getConf()); conf.set("fs.file.impl", MockFileSystem.class.getName()); conf.setBoolean("fs.file.impl.disable.cache", true); runTest(listFile, target, false, false, false, false, true, conf); checkResult(target, 1); } finally { TestDistCpUtils.delete(fs, root); } }
Source:
public void mouseMove(MouseEvent event) { if (fDragState == DRAG_RANGE) { int offset = event.x - fStartPosition; setOffset(offset); fCanvas.redraw(); return; } else if (fDragState == DRAG_ZOOM) { long endTime = getTimestamp(event.x); fRangeDuration = endTime - fRangeStartTime; fCanvas.redraw(); return; } super.mouseMove(event); }

Target:
public void mouseMove(MouseEvent event) { if (fDragState == DRAG_RANGE) { int offset = Math.max(fMinOffset, Math.min(fMaxOffset, event.x - fStartPosition)); setOffset(offset); fCanvas.redraw(); return; } else if (fDragState == DRAG_ZOOM) { long endTime = Math.max(getStartTime(), Math.min(getEndTime(), getTimestamp(event.x))); fRangeDuration = endTime - fRangeStartTime; fCanvas.redraw(); return; } super.mouseMove(event); }
Source:
public ListenableFuture<?> sync(final boolean nofsync) { return m_es.submit(new Runnable() { @Override public void run() { new SyncRunnable(nofsync).run(); } }); }

Target:
public ListenableFuture<?> sync(final boolean nofsync) { return m_es.submit(new SyncRunnable(nofsync)); }
Source:
public int compareTo(Key that) { return this.date.compareTo(that.date); }

Target:
public int compareTo(Key that) { int comp = this.channelId.compareTo(that.channelId); if (comp != 0) return comp; comp = this.source.compareTo(that.source); if (comp != 0) return comp; comp = this.date.compareTo(that.date); if (comp != 0) return comp; return 0; }
Source:
public void remove() { PsiElement psi = getPsi(); if (psi != null) { PsiElement prePsi = UsefulPsiTreeUtil.getPrevSiblingSkipWhiteSpaces(psi, true); PsiElement nextPsi = UsefulPsiTreeUtil.getNextSiblingNoSpaces(psi); TextRange range = psi.getTextRange(); if (prePsi != null && prePsi.getText().equals(",")) { range = range.union(prePsi.getTextRange()); } else if (nextPsi != null && nextPsi.getText().equals(",")) { range = range.union(nextPsi.getTextRange()); } getDocument().replaceElementText(range, ""); } }

Target:
public void remove() { PsiElement psi = getPsi(); if (psi != null) { PsiElement prePsi = UsefulPsiTreeUtil.getPrevSiblingSkipWhiteSpaces(psi, true); PsiElement nextPsi = UsefulPsiTreeUtil.getNextSiblingNoSpaces(psi); TextRange range = psi.getTextRange(); StripSpaces stripSpaces = StripSpaces.NONE; if (prePsi != null && prePsi.getText().equals(",")) { range = range.union(prePsi.getTextRange()); stripSpaces = StripSpaces.BEFORE; } else if (nextPsi != null && nextPsi.getText().equals(",")) { range = range.union(nextPsi.getTextRange()); stripSpaces = StripSpaces.AFTER; } getDocument().replaceElementText(range, "", stripSpaces); } }
Source:
public void setActiveEditor(IEditorPart part) { if (part != null && part.getEditorInput() instanceof SessionEditorInput && ((SessionEditorInput) part.getEditorInput()).getStatus() == null) { boolean updateCreateMenus = part != activeEditor && part != null; super.setActiveEditor(part); if (updateCreateMenus && activeEditor instanceof AbstractDTableEditor) { AbstractDTableViewerManager tableViewer = ((AbstractDTableEditor) activeEditor).getTableViewer(); if (tableViewer instanceof DTableViewerManager) { addCreateLineMenu(((DTableViewerManager) tableViewer).getCreateLineMenu()); } } if (activeEditor instanceof DTableCrossEditor) { DTableCrossEditor tableCrossEditor = (DTableCrossEditor) activeEditor; IEditorActionBarContributor actionBarContributor = tableCrossEditor.getEditorSite().getActionBarContributor(); if (actionBarContributor instanceof DTableActionBarContributor) { DTableActionBarContributor dTableActionBarContributor = (DTableActionBarContributor) actionBarContributor; AbstractDTableViewerManager tableViewer = tableCrossEditor.getTableViewer(); if (tableViewer instanceof DTableViewerManager) { DTableViewerManager dTableViewerManager = (DTableViewerManager) tableViewer; dTableActionBarContributor.addCreateTargetColumnMenu(dTableViewerManager.getCreateTargetColumnMenu()); } } } } }

Target:
public void setActiveEditor(IEditorPart part) { if (part != null && part.getEditorInput() instanceof SessionEditorInput && ((SessionEditorInput) part.getEditorInput()).getStatus().getSeverity() < IStatus.ERROR) { boolean updateCreateMenus = part != activeEditor && part != null; super.setActiveEditor(part); if (updateCreateMenus && activeEditor instanceof AbstractDTableEditor) { AbstractDTableViewerManager tableViewer = ((AbstractDTableEditor) activeEditor).getTableViewer(); if (tableViewer instanceof DTableViewerManager) { addCreateLineMenu(((DTableViewerManager) tableViewer).getCreateLineMenu()); } } if (activeEditor instanceof DTableCrossEditor) { DTableCrossEditor tableCrossEditor = (DTableCrossEditor) activeEditor; IEditorActionBarContributor actionBarContributor = tableCrossEditor.getEditorSite().getActionBarContributor(); if (actionBarContributor instanceof DTableActionBarContributor) { DTableActionBarContributor dTableActionBarContributor = (DTableActionBarContributor) actionBarContributor; AbstractDTableViewerManager tableViewer = tableCrossEditor.getTableViewer(); if (tableViewer instanceof DTableViewerManager) { DTableViewerManager dTableViewerManager = (DTableViewerManager) tableViewer; dTableActionBarContributor.addCreateTargetColumnMenu(dTableViewerManager.getCreateTargetColumnMenu()); } } } } }
Source:
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("diskId", disk.getId()) .append("addressMap", addressMap.toString()); }

Target:
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("diskId", disk.getId()) .append("addressMap", addressMap); }
Source:
private static String getNodeName(URL file, GenerationConfig config) { try { String fileName = FilenameUtils.getName(URLDecoder.decode(file.toString(), "UTF-8")); String[] extensions = config.getFileExtensions(); boolean extensionRemoved = false; for (int i = 0; i < extensions.length; i++) { String extension = extensions[i]; if (extension.length() == 0) { continue; } if (!extension.startsWith(".")) { extension = "." + extension; } if (fileName.endsWith(extension)) { fileName = fileName.substring(0, fileName.length() - extension.length()); extensionRemoved = true; break; } } if (!extensionRemoved) { fileName = FilenameUtils.getBaseName(fileName); } return fileName; } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(String.format("Unable to generate node name from URL: %s", file.toString()), e); } }

Target:
private static String getNodeName(URL file, GenerationConfig config) { try { String fileName = FilenameUtils.getName(URLDecoder.decode(file.toString(), "UTF-8")); String[] extensions = config.getFileExtensions(); boolean extensionRemoved = false; for (int i = 0; i < extensions.length; i++) { String extension = extensions[i]; if (extension.length() == 0) { continue; } if (!extension.startsWith(".")) { extension = "." + extension; } if (fileName.endsWith(extension)) { fileName = removeEnd(fileName, extension); extensionRemoved = true; break; } } if (!extensionRemoved) { fileName = FilenameUtils.getBaseName(fileName); } return fileName; } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(String.format("Unable to generate node name from URL: %s", file.toString()), e); } }
Source:
public String toString() { String consumerType = (this.getType() != null) ? this.getType().getLabel() : "null"; return String.format("Consumer [id: %s, uuid: %s, type: %s, name: %s]", this.getId(), this.getUuid(), consumerType, this.getName()); }

Target:
public String toString() { String consumerType = (this.getType() != null) ? this.getType().getLabel() : "null"; return String.format("Consumer [id: %s, uuid: %s, consumerType: %s, name: %s]", this.getId(), this.getUuid(), consumerType, this.getName()); }
Source:
private void handleNotification(ExecuteCommandParams params) { String command = params.getCommand(); List<Object> arguments = params.getArguments(); switch (command) { case Notifications.UPDATE_PROJECTS_CLASSPATH: { List<Object> fixedPathList = new ArrayList<>(arguments.size()); for (Object uri : arguments) { String uriString = convertToJson(uri).getAsString(); String projectPath = removePrefixUri(uriString); fixedPathList.add(projectPath); projectManager .get(projectPath) .ifPresent( project -> { try { LOG.info("updating projectconfig for {}", projectPath); eventService.publish(new ProjectClassPathChangedEvent(project.getPath())); projectManager.update(project); } catch (ForbiddenException | ServerException | NotFoundException | ConflictException | BadRequestException e) { throw toJsonRpcException(e); } }); } params.setArguments(fixedPathList); notifyTransmitter.sendNotification(params); break; } case Notifications.MAVEN_PROJECT_CREATED: { List<Object> fixedPathList = new ArrayList<>(arguments.size()); for (Object uri : arguments) { String uriString = convertToJson(uri).getAsString(); String projectPath = removePrefixUri(uriString); fixedPathList.add(projectPath); projectSynchronizer.ensureMavenProject(projectPath); } params.setArguments(fixedPathList); notifyTransmitter.sendNotification(params); break; } } }

Target:
private void handleNotification(ExecuteCommandParams params) { String command = params.getCommand(); List<Object> arguments = params.getArguments(); switch (command) { case Notifications.UPDATE_PROJECTS_CLASSPATH: { List<Object> fixedPathList = new ArrayList<>(arguments.size()); for (Object uri : arguments) { String uriString = convertToJson(uri).getAsString(); String projectPath = removePrefixUri(uriString); fixedPathList.add(projectPath); projectManager .get(projectPath) .ifPresent( project -> { try { LOG.info("updating projectconfig for {}", projectPath); eventService.publish(new ProjectClassPathChangedEvent(project.getPath())); projectManager.update(project); } catch (ForbiddenException | ServerException | NotFoundException | ConflictException | BadRequestException e) { throw toJsonRpcException(e); } }); } params.setArguments(fixedPathList); notifyClient(params); break; } case Notifications.MAVEN_PROJECT_CREATED: { List<Object> fixedPathList = new ArrayList<>(arguments.size()); for (Object uri : arguments) { String uriString = convertToJson(uri).getAsString(); String projectPath = removePrefixUri(uriString); fixedPathList.add(projectPath); projectSynchronizer.ensureMavenProject(projectPath); } params.setArguments(fixedPathList); notifyClient(params); break; } } }
Source:
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + AMPLITUDE_STORE_TABLE_NAME); db.execSQL(CREATE_AMPLITUDE_STORE_TABLE); db.execSQL("DROP TABLE IF EXISTS " + EVENT_TABLE_NAME); db.execSQL(CREATE_EVENTS_TABLE); }

Target:
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { switch (oldVersion) { case 1: db.execSQL(CREATE_STORE_TABLE); case 2: break; default: Log.e(TAG, "onUpgrade() with unknown oldVersion " + oldVersion); resetDatabase(db); } }
Source:
public boolean init() { if (!ClientSession.isConnected()) { return false; } try{ ScpClient scpclient = new ScpClient(); scpclient.transfer(filename,"/tmp/"+ filename.substring(filename.lastIndexOf('/')+1)); } catch (IOException e) { e.printStackTrace(); } catch (JSchException e) { e.printStackTrace(); } scriptid = ClientSession.getNewScriptId(); final DMRequest subreq = new DMRequest(DMRequest.SUBSCRIBE,scriptid, filename,session.getcid(), 0, isGuru); if (!session.sendRequest(subreq)) { } session.addSubscription(scriptid); try { Thread.sleep(500); } catch (InterruptedException ie) final DMResponse subrep = session.recvResponse(scriptid); if (subrep.isValid()) { scriptid = subrep.getscriptID(); logger = new LoggingStreamDaemon(); inputListeners.add(logger); try{ pos = new PipedOutputStream(); pis = new PipedInputStream(pos); pos.flush(); }catch (IOException e) { new ErrorMessage("Could not subscribe!", "See stderr for more details").open(); e.printStackTrace(); } inputGobbler = new StreamGobbler(pis); addInputStreamListener(logger); return true; } else { session.delSubscription(scriptid); new ErrorMessage("Could not subscribe!", "Response from Server not valid \n See stderr for more details").open(); return false; } }

Target:
public boolean init() { if (!ClientSession.isConnected()) { return false; } try{ ScpClient scpclient = new ScpClient(); scpclient.transfer(filename,"/tmp/"+ filename.substring(filename.lastIndexOf('/')+1)); } catch (IOException e) { e.printStackTrace(); } catch (JSchException e) { e.printStackTrace(); } scriptid = ClientSession.getNewScriptId(); final DMRequest subreq = new DMRequest(DMRequest.SUBSCRIBE,scriptid, filename,session.getcid(), 0, isGuru); if (!session.sendRequest(subreq)) { } session.addSubscription(scriptid); try { Thread.sleep(500); } catch (InterruptedException ie) final DMResponse subrep = session.recvResponse(scriptid); if (subrep.isValid()) { scriptid = subrep.getscriptID(); logger = new LoggingStreamDaemon(); inputListeners.add(logger); try{ pos = new PipedOutputStream(); pis = new PipedInputStream(pos); pos.flush(); }catch (IOException e) { new ErrorMessage("Could not subscribe!", "See stderr for more details").open(); } inputGobbler = new StreamGobbler(pis); addInputStreamListener(logger); return true; } else { session.delSubscription(scriptid); new ErrorMessage("Could not subscribe!", "Response from Server not valid \n See stderr for more details").open(); return false; } }
Source:
private void addHookStepToTestCaseMap(Map<String, Object> currentStepOrHookMap, HookType hookType) { String hookName; if (hookType.toString().contains("after")) hookName = "after"; else hookName = "before"; Map<String, Object> mapToAddTo; if (hookType == HookType.After || hookType == HookType.Before) { mapToAddTo = currentTestCaseMap; } else { if (hookType == HookType.AfterStep) mapToAddTo = currentStepsList.get(currentStepsList.size() - 1); else mapToAddTo = currentBeforeStepHookList; } if (!mapToAddTo.containsKey(hookName)) { mapToAddTo.put(hookName, new ArrayList<Map<String, Object>>()); } ((List<Map<String, Object>>)mapToAddTo.get(hookName)).add(currentStepOrHookMap); }

Target:
private void addHookStepToTestCaseMap(Map<String, Object> currentStepOrHookMap, HookType hookType) { String hookName; if (hookType.toString().contains("after")) hookName = "after"; else hookName = "before"; Map<String, Object> mapToAddTo; switch (hookType) { case Before: mapToAddTo = currentTestCaseMap; break; case After: mapToAddTo = currentTestCaseMap; break; case BeforeStep: mapToAddTo = currentBeforeStepHookList; break; case AfterStep: mapToAddTo = currentStepsList.get(currentStepsList.size() - 1); break; default: mapToAddTo = currentTestCaseMap; } if (!mapToAddTo.containsKey(hookName)) { mapToAddTo.put(hookName, new ArrayList<Map<String, Object>>()); } ((List<Map<String, Object>>)mapToAddTo.get(hookName)).add(currentStepOrHookMap); }
Source:
private void validate() { if (!containsMacro("timeSuffix") && !Strings.isNullOrEmpty(timeSufix)) { new SimpleDateFormat(timeSufix); } }

Target:
private void validate() { if (!Strings.isNullOrEmpty(timeSufix)) { new SimpleDateFormat(timeSufix); } }
Source:
public synchronized void start() { if (!running) { LOG.info("Starting Replication Monitor Thread."); running = true; replicationMonitor = new Thread(this::run); replicationMonitor.setName("ReplicationMonitor"); replicationMonitor.setDaemon(true); replicationMonitor.start(); } else { LOG.info("Replication Monitor Thread is already running."); } }

Target:
public synchronized void start() { if (!isRunning()) { LOG.info("Starting Replication Monitor Thread."); running = true; replicationMonitor = new Thread(this::run); replicationMonitor.setName("ReplicationMonitor"); replicationMonitor.setDaemon(true); replicationMonitor.start(); } else { LOG.info("Replication Monitor Thread is already running."); } }
Source:
public Optional<PaxosValue> getGreatestLearnedValue() { if (!state.isEmpty()) { return Optional.ofNullable(state.get(state.lastKey())); } return Optional.empty(); }

Target:
public Optional<PaxosValue> getGreatestLearnedValue() { if (state.isEmpty()) { return Optional.empty(); } return Optional.ofNullable(state.get(state.lastKey())); }
Source:
default void waitForTransactionData(int expectedTopologyId, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException { try { CompletableFuture<Void> transactionDataFuture = transactionDataFuture(expectedTopologyId); if (transactionDataFuture != null) transactionDataFuture.get(timeout, unit); } catch (ExecutionException e) { throw new CacheException(e.getCause()); } }

Target:
default void waitForTransactionData(int expectedTopologyId, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException { try { CompletableFuture<Void> transactionDataFuture = transactionDataFuture(expectedTopologyId); transactionDataFuture.get(timeout, unit); } catch (ExecutionException e) { throw new CacheException(e.getCause()); } }
Source:
private String[] getDataTypes() { List<BaseType1> list = Arrays.asList(BaseType1.values()); Collections.sort(list); String[] types = new String[list.size()]; int i = 0; for (BaseType1 type : list) { types[i++] = type.getName(); } return types; }

Target:
private String[] getDataTypes() { List<BaseType1> list = Arrays.asList(BaseType1.values()); return list.stream().map(BaseType1::getName).collect(Collectors.toList()).toArray(new String[0]); }
Source:
public FileObject getDescription() { Resource sourceMd = this.getResource(); Statement s = sourceMd.getProperty(PcdmModels.hasRelatedObject); if (s != null) { PID fileObjPid = PIDs.get(s.getResource().getURI()); return repository.getFileObject(fileObjPid); } else { return null; } }

Target:
public FileObject getDescription() { Resource res = this.getResource(); Statement s = res.getProperty(PcdmModels.hasRelatedObject); if (s != null) { PID fileObjPid = PIDs.get(s.getResource().getURI()); return repository.getFileObject(fileObjPid); } else { return null; } }
Source:
public CommonXAxisModelBuilder addYSeries(IYSeries ySeries) { if (fXValues.length != ySeries.getDatapoints().length) { throw new IllegalStateException("All series in list must be of length : " + fXValues.length); } deleteSeries(ySeries.getLabel()); fYSeries.put(ySeries.getLabel(), ySeries); fModel = null; return this; }

Target:
public CommonXAxisModelBuilder addYSeries(IYSeries ySeries) { if (fXValues.length == 0) { throw new IllegalStateException("X values must be set before setting Y values"); } if (fXValues.length != ySeries.getDatapoints().length) { throw new IllegalStateException("All series in list must be of length : " + fXValues.length); } fYSeries.put(ySeries.getLabel(), ySeries); fModel = null; return this; }
Source:
protected void createEmptyRepository() throws Exception { File gitDir = new File(new File(getTestDirectory(), EMPTY_REPOSITORY), Constants.DOT_GIT); Repository myRepository = new RepositoryBuilder().setGitDir(gitDir) .build(); myRepository.create(); IProject firstProject = ResourcesPlugin.getWorkspace().getRoot() .getProject(EMPTY_PROJECT); if (firstProject.exists()) firstProject.delete(true, null); IProjectDescription desc = ResourcesPlugin.getWorkspace() .newProjectDescription(EMPTY_PROJECT); desc.setLocation(new Path(new File(myRepository.getWorkTree(), EMPTY_PROJECT).getPath())); firstProject.create(desc, null); firstProject.open(null); IFolder folder = firstProject.getFolder(FOLDER); folder.create(false, true, null); IFile textFile = folder.getFile(FILE1); textFile.create(new ByteArrayInputStream("Hello, world" .getBytes(firstProject.getDefaultCharset())), false, null); IFile textFile2 = folder.getFile(FILE2); textFile2.create(new ByteArrayInputStream("Some more content" .getBytes(firstProject.getDefaultCharset())), false, null); new ConnectProviderOperation(firstProject, gitDir).execute(null); }

Target:
protected void createEmptyRepository() throws Exception { File gitDir = new File(new File(getTestDirectory(), EMPTY_REPOSITORY), Constants.DOT_GIT); Repository myRepository = FileRepositoryBuilder.create(gitDir); myRepository.create(); IProject firstProject = ResourcesPlugin.getWorkspace().getRoot() .getProject(EMPTY_PROJECT); if (firstProject.exists()) firstProject.delete(true, null); IProjectDescription desc = ResourcesPlugin.getWorkspace() .newProjectDescription(EMPTY_PROJECT); desc.setLocation(new Path(new File(myRepository.getWorkTree(), EMPTY_PROJECT).getPath())); firstProject.create(desc, null); firstProject.open(null); IFolder folder = firstProject.getFolder(FOLDER); folder.create(false, true, null); IFile textFile = folder.getFile(FILE1); textFile.create(new ByteArrayInputStream("Hello, world" .getBytes(firstProject.getDefaultCharset())), false, null); IFile textFile2 = folder.getFile(FILE2); textFile2.create(new ByteArrayInputStream("Some more content" .getBytes(firstProject.getDefaultCharset())), false, null); new ConnectProviderOperation(firstProject, gitDir).execute(null); }
Source:
protected void loadFieldIntoDatatableFromBpm(String containerId, String processId) throws ApsSystemException { KieBpmConfig config = getFormManager().getKieServerConfigurations().get(this.getKnowledgeSourcePath()); List<KieProcess> processes = getFormManager().getProcessDefinitionsList(config); if (!processes.isEmpty()) { List<String> fields = new ArrayList<>(); logger.info("***************************** \n"+processes.get(0).toString()+"\n*****************************"); StringTokenizer tokenizer = new StringTokenizer(processes.get(0).toString(), ","); Byte position = 1; while (tokenizer.hasMoreTokens()) { final String name = tokenizer.nextToken().trim(); fields.add(name); } super.loadDataIntoFieldDatatable(fields); } Map<String, String> columns = new HashMap<>(); this.loadDataIntoFieldDatatable(columns); }

Target:
protected void loadFieldIntoDatatableFromBpm(String containerId, String processId) throws ApsSystemException { KieBpmConfig config = getFormManager().getKieServerConfigurations().get(this.getKnowledgeSourcePath()); List<KieProcess> processes = getFormManager().getProcessDefinitionsList(config); if (!processes.isEmpty()) { List<String> fields = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(processes.get(0).toString(), ","); Byte position = 1; while (tokenizer.hasMoreTokens()) { final String name = tokenizer.nextToken().trim(); fields.add(name); } super.loadDataIntoFieldDatatable(fields); } Map<String, String> columns = new HashMap<>(); this.loadDataIntoFieldDatatable(columns); }
Source:
protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws Exception { String sptoken = Strings.clean(request.getParameter("sptoken")); if (isJsonPreferred(request, response)) { Map<String, Object> model = new HashMap<String, Object>(1); if (sptoken == null) { model.put("status", "400"); model.put("message", i18n(request, "stormpath.web.changePassword.form.errors.no_token")); } else { try { Application application = (Application) request.getAttribute(Application.class.getName()); application.verifyPasswordResetToken(sptoken); model.put("status", "200"); model.put("message", "OK"); } catch (ResourceException re) { model = errorMap.toErrorMap(re.getStormpathError()); } } return new DefaultViewModel("stormpathJsonView", model); } if (sptoken == null) { return new DefaultViewModel(forgotPasswordUri).setRedirect(true); } else { try { Application application = (Application) request.getAttribute(Application.class.getName()); application.verifyPasswordResetToken(sptoken); } catch (ResourceException re) { return new DefaultViewModel(errorUri).setRedirect(true); } return super.doGet(request, response); } }

Target:
protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws Exception { String sptoken = Strings.clean(request.getParameter("sptoken")); if (isJsonPreferred(request, response)) { Map<String, Object> model = new HashMap<String, Object>(1); if (sptoken == null) { model.put("status", HttpServletResponse.SC_BAD_REQUEST); model.put("message", i18n(request, "stormpath.web.changePassword.form.errors.no_token")); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); } else { try { Application application = (Application) request.getAttribute(Application.class.getName()); application.verifyPasswordResetToken(sptoken); response.setContentType(MediaType.APPLICATION_JSON_VALUE); return null; } catch (Exception e) { model = errorModelFactory.toError(request, e).toMap(); response.setStatus(errorModelFactory.toError(request, e).getStatus()); } } return new DefaultViewModel("stormpathJsonView", model); } if (sptoken == null) { return new DefaultViewModel(forgotPasswordUri).setRedirect(true); } else { try { Application application = (Application) request.getAttribute(Application.class.getName()); application.verifyPasswordResetToken(sptoken); } catch (ResourceException re) { return new DefaultViewModel(errorUri).setRedirect(true); } return super.doGet(request, response); } }
Source:
private void setTargetToNearbyBoundaryBlock(Actor oreon, TaskComponent taskComponent) { MinionMoveComponent moveComponent = oreon.getComponent(MinionMoveComponent.class); LocationComponent locationComponent = oreon.getComponent(LocationComponent.class); Vector3f worldPosition = locationComponent.getWorldPosition(new Vector3f()); int maxX = taskComponent.taskRegion.maxX(); int maxZ = taskComponent.taskRegion.maxZ(); int minX = taskComponent.taskRegion.minX(); int minZ = taskComponent.taskRegion.minZ(); int y = taskComponent.taskRegion.minY(); if (Math.round(worldPosition.x) == maxX) { if (Math.round(worldPosition.z) != maxZ) { moveComponent.target = JomlUtil.from(new Vector3f(maxX + 1, y, maxZ + 1)); } else { moveComponent.target = JomlUtil.from(new Vector3f(minX - 1, y, maxZ + 1)); } } else if (Math.round(worldPosition.z) == maxZ) { if (Math.round(worldPosition.x) != minX) { moveComponent.target = JomlUtil.from(new Vector3f(minX - 1, y, maxZ + 1)); } else { moveComponent.target = JomlUtil.from(new Vector3f(minX - 1, y, minZ - 1)); } } else if (Math.round(worldPosition.x) == minX) { if (Math.round(worldPosition.z) != minZ) { moveComponent.target = JomlUtil.from(new Vector3f(minX - 1, y, minZ - 1)); } else { moveComponent.target = JomlUtil.from(new Vector3f(maxX + 1, y, minZ - 1)); } } else { moveComponent.target = JomlUtil.from(new Vector3f(maxX + 1, y, maxZ + 1)); } oreon.save(moveComponent); }

Target:
private void setTargetToNearbyBoundaryBlock(Actor oreon, TaskComponent taskComponent) { MinionMoveComponent moveComponent = oreon.getComponent(MinionMoveComponent.class); LocationComponent locationComponent = oreon.getComponent(LocationComponent.class); Vector3f worldPosition = locationComponent.getWorldPosition(new Vector3f()); int maxX = taskComponent.taskRegion.maxX(); int maxZ = taskComponent.taskRegion.maxZ(); int minX = taskComponent.taskRegion.minX(); int minZ = taskComponent.taskRegion.minZ(); int y = taskComponent.taskRegion.minY(); if (moveComponent.target == null) { moveComponent.target = JomlUtil.from(new Vector3f()); } if (Math.round(worldPosition.x) == maxX) { if (Math.round(worldPosition.z) != maxZ) { moveComponent.target.set(maxX + 1, y, maxZ + 1); } else { moveComponent.target.set(minX - 1, y, maxZ + 1); } } else if (Math.round(worldPosition.z) == maxZ) { if (Math.round(worldPosition.x) != minX) { moveComponent.target.set(minX - 1, y, maxZ + 1); } else { moveComponent.target.set(minX - 1, y, minZ - 1); } } else if (Math.round(worldPosition.x) == minX) { if (Math.round(worldPosition.z) != minZ) { moveComponent.target.set(minX - 1, y, minZ - 1); } else { moveComponent.target.set(maxX + 1, y, minZ - 1); } } else { moveComponent.target.set(maxX + 1, y, maxZ + 1); } oreon.save(moveComponent); }
Source:
public PulsarContainer(String pulsarVersion) { super(TestcontainersConfiguration.getInstance().getPulsarImage() + ":" + pulsarVersion); withNetwork(Network.newNetwork()); String networkAlias = "pulsar-" + Base58.randomString(6); withNetworkAliases(networkAlias); withExposedPorts(PULSAR_PORT); }

Target:
public PulsarContainer(String pulsarVersion) { super(TestcontainersConfiguration.getInstance().getPulsarImage() + ":" + pulsarVersion); withExposedPorts(PULSAR_PORT); withCommand("/bin/bash", "-c", "" + "servicePort=6850 webServicePort=8280 webServicePortTls=8643 bin/apply-config-from-env.py conf/proxy.conf && " + "bin/pulsar standalone & " + "bin/pulsar proxy --zookeeper-servers localhost:2181 --global-zookeeper-servers localhost:2181" ); waitingFor(Wait.forLogMessage(".*messaging service is ready.*\\s", 1)); }