auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static HashMap<Integer, Long> getIdToDateMap(Vector<Integer> ids, SqlStorage<FormRecord> storage) { HashMap<Integer, Long> idToDateIndex = new HashMap<>(); for (int id : ids) { String dateAsString = storage.getMetaDataFieldForRecord(id, FormRecord.META_LAST_MODIFIED); long dateAsSeconds; try { dateAsSeconds = Long.valueOf(dateAsString); } catch (NumberFormatException e) { <START> idToDateIndex.put(id, (long)id); <END> continue; } idToDateIndex.put(id, dateAsSeconds); } return idToDateIndex; }</code><technical_language>Hey , This stay a soft assert now, fixed problem know</technical_language>

Target:
private static HashMap<Integer, Long> getIdToDateMap(Vector<Integer> ids, SqlStorage<FormRecord> storage) { HashMap<Integer, Long> idToDateIndex = new HashMap<>(); for (int id : ids) { String dateAsString = storage.getMetaDataFieldForRecord(id, FormRecord.META_LAST_MODIFIED); long dateAsSeconds; try { dateAsSeconds = Long.valueOf(dateAsString); } catch (NumberFormatException e) { Logger.log(AndroidLogger.TYPE_ERROR_ASSERTION, "Invalid date in last modified value: " + dateAsString); idToDateIndex.put(id, (long)id); continue; } idToDateIndex.put(id, dateAsSeconds); } return idToDateIndex; }
Source:
<code>public void panelRenameButton_onClick_panelGetsSelected() { int count = panels.getPanelCount(); <START> while (count-- > 1) { <END> pushKeys(CLOSE_PANEL); } click("#dummy/dummy_col0_renameButton"); assertEquals(Optional.of(0), panels.getCurrentlySelectedPanel()); pushKeys(CREATE_RIGHT_PANEL); click("#dummy/dummy_col1_renameButton"); assertEquals(Optional.of(1), panels.getCurrentlySelectedPanel()); pushKeys(CLOSE_PANEL); pushKeys(KeyCode.ESCAPE); }</code><technical_language>this part in @Before</technical_language>

Target:
public void panelRenameButton_onClick_panelGetsSelected() { click(IdGenerator.getOcticonButtonIdReference(0, "renameButton")); assertEquals(Optional.of(0), panels.getCurrentlySelectedPanel()); pushKeys(CREATE_RIGHT_PANEL); click(IdGenerator.getOcticonButtonIdReference(1, "renameButton")); assertEquals(Optional.of(1), panels.getCurrentlySelectedPanel()); pushKeys(CLOSE_PANEL); pushKeys(KeyCode.ESCAPE); sleep(EVENT_DELAY); }
Source:
<code>private Map<String, Map<String, ConfigParameterInfo>> getPluginConfig( ProjectState project, DynamicMap<ProjectConfigEntry> pluginConfigEntries, PluginConfigFactory cfgFactory) { TreeMap<String, Map<String, ConfigParameterInfo>> pluginConfig = new TreeMap<>(); for (Entry<ProjectConfigEntry> e : pluginConfigEntries) { PluginConfig cfg = cfgFactory.getFromProjectConfig(project, e.getPluginName()); ProjectConfigEntry configEntry = e.getProvider().get(); ConfigParameterInfo p = new ConfigParameterInfo(); p.displayName = configEntry.getDisplayName(); p.type = configEntry.getType(); p.value = cfg.getString(e.getExportName(), configEntry.getDefaultValue()); Map<String, ConfigParameterInfo> pc = pluginConfig.get(e.getPluginName()); if (pc == null) { pc = new TreeMap<>(); pluginConfig.put(e.getPluginName(), pc); } pc.put(e.getExportName(), p); } <START> return pluginConfig; <END> }</code><technical_language>return !pluginConfig.isEmpty() ? pluginConfig : null;</technical_language>

Target:
private Map<String, Map<String, ConfigParameterInfo>> getPluginConfig( ProjectState project, DynamicMap<ProjectConfigEntry> pluginConfigEntries, PluginConfigFactory cfgFactory) { TreeMap<String, Map<String, ConfigParameterInfo>> pluginConfig = new TreeMap<>(); for (Entry<ProjectConfigEntry> e : pluginConfigEntries) { PluginConfig cfg = cfgFactory.getFromProjectConfig(project, e.getPluginName()); ProjectConfigEntry configEntry = e.getProvider().get(); ConfigParameterInfo p = new ConfigParameterInfo(); p.displayName = configEntry.getDisplayName(); p.type = configEntry.getType(); p.value = cfg.getString(e.getExportName(), configEntry.getDefaultValue()); Map<String, ConfigParameterInfo> pc = pluginConfig.get(e.getPluginName()); if (pc == null) { pc = new TreeMap<>(); pluginConfig.put(e.getPluginName(), pc); } pc.put(e.getExportName(), p); } return !pluginConfig.isEmpty() ? pluginConfig : null; }
Source:
<code>private EntityImportReport importVcf(Repository<Entity> inRepository, List<EntityType> addedEntities, Package importPackage) throws IOException { EntityImportReport report = new EntityImportReport(); String entityTypeId = inRepository.getName(); if (runAsSystem(() -> dataService.hasRepository(entityTypeId))) { throw new MolgenisDataException("Can't overwrite existing " + entityTypeId); } EntityType entityType = inRepository.getEntityType(); entityType.setBackend(metaDataService.getDefaultBackend().getName()); entityType.setPackage(importPackage); Repository<Entity> sampleRepository = createSampleRepository(addedEntities, entityType, importPackage); try (Repository<Entity> outRepository = dataService.getMeta().createRepository(entityType)) { permissionSystemService.giveUserWriteMetaPermissions(entityType); addedEntities.add(entityType); if (sampleRepository != null) { int sampleEntityCount = addSampleEntities(sampleRepository, inRepository); report.addNewEntity(sampleRepository.getName()); if (sampleEntityCount > 0) { report.addEntityCount(sampleRepository.getName(), sampleEntityCount); } } AtomicInteger vcfEntityCount = new AtomicInteger(); inRepository.forEachBatched(rowBatch -> { outRepository.add(rowBatch.stream()); vcfEntityCount.addAndGet(rowBatch.size()); <START> }, 1000); <END> if (vcfEntityCount.get() > 0) { report.addEntityCount(entityTypeId, vcfEntityCount.get()); } } report.addNewEntity(entityTypeId); return report; }</code><technical_language>Store magic number in private static final</technical_language>

Target:
private EntityImportReport importVcf(Repository<Entity> inRepository, List<EntityType> addedEntities, Package importPackage) throws IOException { EntityImportReport report = new EntityImportReport(); String entityTypeId = inRepository.getName(); if (runAsSystem(() -> dataService.hasRepository(entityTypeId))) { throw new MolgenisDataException("Can't overwrite existing " + entityTypeId); } EntityType entityType = inRepository.getEntityType(); entityType.setBackend(metaDataService.getDefaultBackend().getName()); entityType.setPackage(importPackage); Repository<Entity> sampleRepository = createSampleRepository(addedEntities, entityType, importPackage); try (Repository<Entity> outRepository = dataService.getMeta().createRepository(entityType)) { permissionSystemService.giveUserWriteMetaPermissions(entityType); addedEntities.add(entityType); if (sampleRepository != null) { int sampleEntityCount = addSampleEntities(sampleRepository, inRepository); report.addNewEntity(sampleRepository.getName()); if (sampleEntityCount > 0) { report.addEntityCount(sampleRepository.getName(), sampleEntityCount); } } AtomicInteger vcfEntityCount = new AtomicInteger(); inRepository.forEachBatched(rowBatch -> { outRepository.add(rowBatch.stream()); vcfEntityCount.addAndGet(rowBatch.size()); }, VcfRepository.BATCH_SIZE); if (vcfEntityCount.get() > 0) { report.addEntityCount(entityTypeId, vcfEntityCount.get()); } } report.addNewEntity(entityTypeId); return report; }
Source:
<code>public void run(Definition definition) throws IOException { LatexBackend latexBackend = new LatexBackend(sw, context); latexBackend.compile(definition); File latexFile = latexBackend.getLatexFile(); File pdfFile = generatePdf(latexFile); if (pdfFile.exists()) { <START> copyFile(pdfFile, options.output()); <END> } }</code><technical_language>I this is wrong. need replace output file extension file .pdf</technical_language>

Target:
public void run(Definition definition) throws IOException { LatexBackend latexBackend = new LatexBackend(sw, context); latexBackend.compile(definition); File latexFile = latexBackend.getLatexFile(); File pdfFile = generatePdf(latexFile); if (pdfFile.exists()) { copyFile(pdfFile, new File(options.directory, FilenameUtils.removeExtension(new File(definition.getMainFile()).getName()) + ".pdf")); } }
Source:
<code>private static Index genIndex(SqlKind type, Table t, String indexName, String constraintName, boolean hasGeog, List<Column> indexCols, List<AbstractExpression> exprs) { final Index index = t.getIndexes().add(indexName); if (hasGeog) { index.setCountable(false); index.setType(IndexType.COVERING_CELL_INDEX.getValue()); } else { index.setCountable(true); <START> index.setType(IndexType.BALANCED_TREE.getValue()); <END> } index.setUnique(true); index.setAssumeunique(type == SqlKind.ASSUME_UNIQUE); updateConstraint(t.getConstraints().add(constraintName), index, type, constraintName, t.getTypeName()); AtomicInteger i = new AtomicInteger(0); indexCols.forEach(column -> { final ColumnRef cref = index.getColumns().add(column.getName()); cref.setColumn(column); cref.setIndex(i.getAndIncrement()); }); if (! exprs.isEmpty()) { try { index.setExpressionsjson(DDLCompiler.convertToJSONArray(exprs)); } catch (JSONException e) { throw new PlanningErrorException(String.format( "Unexpected error serializing non-column expressions for index '%s' on type '%s': %s", indexName, t.getTypeName(), e.toString())); } } final AbstractExpression.UnsafeOperatorsForDDL unsafeOp = new AbstractExpression.UnsafeOperatorsForDDL(); exprs.forEach(expr -> expr.findUnsafeOperatorsForDDL(unsafeOp)); index.setIssafewithnonemptysources(! unsafeOp.isUnsafe()); return index; }</code><technical_language>I IndexType.HASH_TABLE in some places marked deprecated. <LINK_0> I if a hash_index option here</technical_language>

Target:
private static Index genIndex(SqlKind type, Table t, String indexName, String constraintName, boolean hasGeog, List<Column> indexCols, List<AbstractExpression> exprs) { final Index index = t.getIndexes().add(indexName); if (hasGeog) { index.setCountable(false); index.setType(IndexType.COVERING_CELL_INDEX.getValue()); } else { index.setCountable(true); index.setType(IndexType.BALANCED_TREE.getValue()); } index.setUnique(true); index.setAssumeunique(type == SqlKind.ASSUME_UNIQUE); setConstraintType(t.getConstraints().add(constraintName), index, type, constraintName, t.getTypeName()); AtomicInteger i = new AtomicInteger(0); indexCols.forEach(column -> { final ColumnRef cref = index.getColumns().add(column.getName()); cref.setColumn(column); cref.setIndex(i.getAndIncrement()); }); if (! exprs.isEmpty()) { try { index.setExpressionsjson(DDLCompiler.convertToJSONArray(exprs)); } catch (JSONException e) { except(String.format( "Unexpected error serializing non-column expressions for index '%s' on type '%s': %s", indexName, t.getTypeName(), e.toString())); } } final AbstractExpression.UnsafeOperatorsForDDL unsafeOp = new AbstractExpression.UnsafeOperatorsForDDL(); exprs.forEach(expr -> expr.findUnsafeOperatorsForDDL(unsafeOp)); index.setIssafewithnonemptysources(! unsafeOp.isUnsafe()); return index; }
Source:
<code>public QueryBuilder make(EsHint hint, String fieldName, Object value) { List<String> fields = hint.getIndex().stream().map(EsHint.FieldHint::getField).collect(Collectors.toList()); Object[] values = (Object[]) value; if (fields.size() != values.length) { throw new IllegalArgumentException("fields size and values length should be the same"); } Map<String, Object> mapValueByField = IntStream.range(0, fields.size()) .boxed() <START> .collect(Collectors.toMap(index -> fields.get(index), <END> index -> values[index])); BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); mapValueByField.entrySet() .forEach(entry -> boolQueryBuilder.must( QueryBuilders.termQuery(entry.getKey(), entry.getValue()))); return QueryBuilders.nestedQuery("files:files.file", boolQueryBuilder, ScoreMode.None); }</code><technical_language>more in favor of a solution a counter a basic loop. usage of map a bit overkill me</technical_language>

Target:
public QueryBuilder make(EsHint hint, String fieldName, Object value) { List<String> fields = hint.getIndex().stream().map(EsHint.FieldHint::getField).collect(Collectors.toList()); Object[] values = (Object[]) value; if (fields.size() != values.length) { throw new NuxeoException("Fields size and values length should be the same", SC_BAD_REQUEST); } BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); for (int index = 0; index < values.length; index++) { boolQueryBuilder.must(QueryBuilders.termQuery(fields.get(index), values[index])); } return QueryBuilders.nestedQuery("files:files.file", boolQueryBuilder, ScoreMode.None); }
Source:
<code>public int hashCode() { <START> return playerPrivateCertificate.hashCode() ^ playerPrivateCertificate.hashCode(); <END> }</code><technical_language>I this zero. 31 * playerPublicCertificate instead</technical_language>

Target:
public int hashCode() { return Objects.hash(playerPublicCertificate, playerPrivateCertificate); }
Source:
<code>public FilteredCheckboxTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) { <START> super(parent, treeStyle, filter, useNewLook); <END> }</code><technical_language>In this case, I deprecate this constructor add fastLookup boolean</technical_language>

Target:
public FilteredCheckboxTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) { this(parent, treeStyle, filter, useNewLook, false); }
Source:
<code><START> public static OAuth2Code deserializeCode(Map<String, String> data) { <END> return new OAuth2Code(data); }</code><technical_language>above. Final prevents overriding</technical_language>

Target:
public static final OAuth2Code deserializeCode(Map<String, String> data) { return new OAuth2Code(data); }
Source:
<code>public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(true); <START> addFastViews(layout); addViewShortcuts(layout); addPerspectiveShortcuts(layout); <END> IFolderLayout topLeftFolder = layout.createFolder( "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); topLeftFolder.addView(PROJECT_VIEW_ID); IFolderLayout topFolders[] = new IFolderLayout[3]; topFolders[0]= layout.createFolder( "topFolder1", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); topFolders[0].addView(CPU_VIEW_ID); topFolders[1] = layout.createFolder( "topFolder2", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); topFolders[1].addView(DISK_VIEW_ID); topFolders[2] = layout.createFolder( "topFolders3", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); topFolders[2].addView(MEMORY_VIEW_ID); IFolderLayout bottomRightFolder = layout.createFolder( "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); bottomRightFolder.addView(HISTOGRAM_VIEW_ID); bottomRightFolder.addView(BOOKMARKS_VIEW_ID); layout.addNewWizardShortcut(NewTmfProjectWizard.ID); }</code><technical_language>remove</technical_language>

Target:
public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(true); IFolderLayout topLeftFolder = layout.createFolder( "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); topLeftFolder.addView(PROJECT_VIEW_ID); IFolderLayout topFolders[] = new IFolderLayout[3]; topFolders[0] = layout.createFolder( "topFolder1", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); topFolders[0].addView(CPU_VIEW_ID); topFolders[1] = layout.createFolder( "topFolder2", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); topFolders[1].addView(DISK_VIEW_ID); topFolders[2] = layout.createFolder( "topFolders3", IPageLayout.TOP, 0.30f, IPageLayout.ID_EDITOR_AREA); topFolders[2].addView(MEMORY_VIEW_ID); IFolderLayout bottomRightFolder = layout.createFolder( "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); bottomRightFolder.addView(HISTOGRAM_VIEW_ID); bottomRightFolder.addView(BOOKMARKS_VIEW_ID); layout.addNewWizardShortcut(NewTmfProjectWizard.ID); }
Source:
<code>private LogoutRequest signLogoutRequest(LogoutRequest logoutRequest) throws SignatureException, WSSecurityException, XMLStreamException { new SimpleSign(systemCrypto).signSamlObject(logoutRequest); Element reqElem = logoutMessage.getElementFromSaml(logoutRequest); <START> String foo = DOM2Writer.nodeToString(reqElem); <END> final Document responseDoc = StaxUtils.read(new ByteArrayInputStream(foo.getBytes(StandardCharsets.UTF_8))); return (LogoutRequest) OpenSAMLUtil.fromDom(responseDoc.getDocumentElement()); }</code><technical_language>foo</technical_language>

Target:
private LogoutRequest signLogoutRequest(LogoutRequest logoutRequest) throws SignatureException, WSSecurityException, XMLStreamException { new SimpleSign(systemCrypto).signSamlObject(logoutRequest); Element reqElem = logoutMessage.getElementFromSaml(logoutRequest); String nodeString = DOM2Writer.nodeToString(reqElem); final Document responseDoc = StaxUtils.read(new ByteArrayInputStream(nodeString.getBytes(StandardCharsets.UTF_8))); return (LogoutRequest) OpenSAMLUtil.fromDom(responseDoc.getDocumentElement()); }
Source:
<code>public void testGETOperation() { <START> System.setProperty(RESTWorkItemHandler.USE_SYSTEM_PROPERTIES, "true"); <END> RESTWorkItemHandler handler = new RESTWorkItemHandler(USERNAME, PASSWORD); WorkItemImpl workItem = new WorkItemImpl(); workItem.setParameter("Url", SERVER_URL); workItem.setParameter("Method", "GET"); WorkItemManager manager = new TestWorkItemManager(workItem); handler.executeWorkItem(workItem, manager); String result = (String) workItem.getResult("Result"); assertNotNull("result cannot be null", result); assertEquals("Hello from REST", result); int responseCode = (Integer) workItem.getResult("Status"); assertNotNull(responseCode); assertEquals(200, responseCode); String responseMsg = (String) workItem.getResult("StatusMsg"); assertNotNull(responseMsg); assertEquals("request to endpoint " + workItem.getParameter("Url") + " successfully completed OK", responseMsg); }</code><technical_language>Hi, need try test this well. good</technical_language>

Target:
public void testGETOperation() { RESTWorkItemHandler handler = new RESTWorkItemHandler(USERNAME, PASSWORD); WorkItemImpl workItem = new WorkItemImpl(); workItem.setParameter("Url", SERVER_URL); workItem.setParameter("Method", "GET"); WorkItemManager manager = new TestWorkItemManager(workItem); handler.executeWorkItem(workItem, manager); String result = (String) workItem.getResult("Result"); assertNotNull("result cannot be null", result); assertEquals("Hello from REST", result); int responseCode = (Integer) workItem.getResult("Status"); assertNotNull(responseCode); assertEquals(200, responseCode); String responseMsg = (String) workItem.getResult("StatusMsg"); assertNotNull(responseMsg); assertEquals("request to endpoint " + workItem.getParameter("Url") + " successfully completed OK", responseMsg); }
Source:
<code><START> public Set<EventClass> registeredEventClasses() { <END> return registry().registeredMessageClasses(); }</code><technical_language>Is this a part of internal public API? internal me, similar hasDispatchers(..) above</technical_language>

Target:
public final Set<EventClass> registeredEventClasses() { return registry().registeredMessageClasses(); }
Source:
<code>public String getInstructorCourseInstructorDeleteLink(String courseId, String instructorEmail) { String link = Const.ActionURIs.INSTRUCTOR_COURSE_INSTRUCTOR_DELETE; <START> link = Url.addParamToUrl(link,Const.ParamsNames.COURSE_ID, courseId); <END> link = Url.addParamToUrl(link,Const.ParamsNames.INSTRUCTOR_EMAIL, instructorEmail); link = addUserIdToUrl(link); return link; }</code><technical_language>methods public</technical_language>

Target:
private String getInstructorCourseInstructorDeleteLink(String courseId, String instructorEmail) { String link = Const.ActionURIs.INSTRUCTOR_COURSE_INSTRUCTOR_DELETE; link = Url.addParamToUrl(link,Const.ParamsNames.COURSE_ID, courseId); link = Url.addParamToUrl(link,Const.ParamsNames.INSTRUCTOR_EMAIL, instructorEmail); link = addUserIdToUrl(link); return link; }
Source:
<code>private void saveTagToDataBase() { final List <TagDto> list = new ArrayList<TagDto>(); list.addAll(gridStorageR.getStore().getAll()); SessionDataService.Async.getInstance().saveTags(currentSession.getId(), list, new AsyncCallback<Void>() { @Override public void onFailure(Throwable caught) { <START> new ExceptionPanel("Fail to save data : " + caught.getMessage()); <END> } @Override public void onSuccess(Void result) { currentSession.getTags().clear(); currentSession.setTags(list); String tags = ""; for (int i = 0; i < currentSession.getTags().size(); i++) { tags += currentSession.getTags().get(i).getName() + " "; } currentTreeItem.put(getText(), tags); treeGrid.getTreeView().refresh(false); } }); }</code><technical_language>please, add, more meaningful error message data? save</technical_language>

Target:
private void saveTagToDataBase() { final List <TagDto> list = new ArrayList<TagDto>(); list.addAll(gridStorageR.getStore().getAll()); SessionDataService.Async.getInstance().saveTags(currentSession.getId(), list, new AsyncCallback<Void>() { @Override public void onFailure(Throwable caught) { atClose(); new ExceptionPanel("Fail to save into DB session's tags : " + caught.getMessage()); } @Override public void onSuccess(Void result) { currentSession.getTags().clear(); currentSession.setTags(list); String tags = ""; for (TagDto tagDto: currentSession.getTags()) { tags += tagDto.getName() + " "; } currentTreeItem.put(getText(), tags); treeGrid.getTreeView().refresh(false); atClose(); } }); }
Source:
<code>public void upgradeContainer(final ContainerSpecKey containerSpecKey, ReleaseId releaseId) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new RuntimeException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } org.kie.server.controller.api.model.spec.ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); if (releaseId.getGroupId() == null) { releaseId.setGroupId(containerSpec.getReleasedId().getGroupId()); } if (releaseId.getArtifactId()== null) { releaseId.setArtifactId(containerSpec.getReleasedId().getArtifactId()); } <START> ((ContainerSpec)containerSpec).setReleasedId(releaseId); <END> templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.upgradeContainer(serverTemplate, containerSpec); notificationService.notify(serverTemplate, containerSpec, containers); }</code><technical_language>is safe</technical_language>

Target:
public void upgradeContainer(final ContainerSpecKey containerSpecKey, ReleaseId releaseId) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new RuntimeException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); if (releaseId.getGroupId() == null) { releaseId.setGroupId(containerSpec.getReleasedId().getGroupId()); } if (releaseId.getArtifactId()== null) { releaseId.setArtifactId(containerSpec.getReleasedId().getArtifactId()); } containerSpec.setReleasedId(releaseId); templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.upgradeContainer(serverTemplate, containerSpec); notificationService.notify(serverTemplate, containerSpec, containers); }
Source:
<code>public void runInternal() throws ExecutionException, InterruptedException, TimeoutException, JsonProcessingException { possiblyRegisterListener(); <START> stateManager.setStateIfNoSuccessfulRunYet(SeekableStreamSupervisorStateManager.State.CONNECTING_TO_STREAM); <END> updatePartitionDataFromStream(); stateManager.setStateIfNoSuccessfulRunYet(SeekableStreamSupervisorStateManager.State.DISCOVERING_INITIAL_TASKS); discoverTasks(); updateTaskStatus(); checkTaskDuration(); checkPendingCompletionTasks(); checkCurrentTaskState(); if (!spec.isSuspended()) { log.info("[%s] supervisor is running.", dataSource); stateManager.setStateIfNoSuccessfulRunYet(SeekableStreamSupervisorStateManager.State.CREATING_TASKS); createNewTasks(); stateManager.setStateIfNoSuccessfulRunYet(SeekableStreamSupervisorStateManager.State.RUNNING); } else { log.info("[%s] supervisor is suspended.", dataSource); gracefulShutdownInternal(); stateManager.setState(SeekableStreamSupervisorStateManager.State.SUSPENDED); } if (log.isDebugEnabled()) { log.debug(generateReport(true).toString()); } else { log.info(generateReport(false).toString()); } stateManager.markRunFinishedAndEvaluateHealth(); }</code><technical_language>Hm, I feel cleaner if state manager handled decision of transition a state based a successful run occurred (I caller needs call setStateIfNoSuccessfulRunYet setState depending state)</technical_language>

Target:
public void runInternal() { try { possiblyRegisterListener(); stateManager.maybeSetState(SeekableStreamSupervisorStateManager.SeekableStreamState.CONNECTING_TO_STREAM); if (!updatePartitionDataFromStream() && !stateManager.isAtLeastOneSuccessfulRun()) { return; } stateManager.maybeSetState(SeekableStreamSupervisorStateManager.SeekableStreamState.DISCOVERING_INITIAL_TASKS); discoverTasks(); updateTaskStatus(); checkTaskDuration(); checkPendingCompletionTasks(); checkCurrentTaskState(); if (!spec.isSuspended()) { log.info("[%s] supervisor is running.", dataSource); stateManager.maybeSetState(SeekableStreamSupervisorStateManager.SeekableStreamState.CREATING_TASKS); createNewTasks(); } else { log.info("[%s] supervisor is suspended.", dataSource); gracefulShutdownInternal(); } if (log.isDebugEnabled()) { log.debug(generateReport(true).toString()); } else { log.info(generateReport(false).toString()); } } catch (Exception e) { stateManager.recordThrowableEvent(e); log.warn(e, "Exception in supervisor run loop for dataSource [%s]", dataSource); } finally { stateManager.markRunFinished(); } }
Source:
<code>public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) { if ( !OWNER_EXTENSION.equals( extension )) { return Collections.emptyList(); } BeanConfig beanConfig = new BeanConfig(); String contextRoot = KieServerEnvironment.getContextRoot(); <START> if (contextRoot != null && !("".equals(contextRoot))) { <END> beanConfig.setBasePath(contextRoot + "/services/rest"); } beanConfig.setResourcePackage(RESOURCE_PACKAGES); beanConfig.setScan(true); beanConfig.setPrettyPrint(true); List<Object> components = new ArrayList<Object>( 2 ); components.add(new KieApiListingResource()); components.add(new SwaggerSerializers()); return components; }</code><technical_language>easier !contextRoot.isEmpty()</technical_language>

Target:
public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) { if (!OWNER_EXTENSION.equals(extension)) { return Collections.emptyList(); } List<Object> components = new ArrayList<Object>(2); components.add(new KieApiListingResource()); components.add(new SwaggerSerializers()); return components; }
Source:
<code>private void pasteLiteral(Display display) { Clipboard clipboard = new Clipboard(display); TextTransfer textTransfer = TextTransfer.getInstance(); String clipboardText = (String) clipboard.getContents(textTransfer); clipboard.dispose(); if (clipboardText != null) { StringBuffer out = new StringBuffer(); char[] chars = clipboardText.toCharArray(); boolean lastWasBackslash = false; <START> for (char c : chars) { <END> if (c == '\\') { if (lastWasBackslash) { out.append(c); lastWasBackslash = false; } else { lastWasBackslash = true; } } else { out.append(c); } } txt_RegExp.insert(out.toString()); } }</code><technical_language>Rename char character</technical_language>

Target:
private void pasteLiteral(Display display) { Clipboard clipboard = new Clipboard(display); TextTransfer textTransfer = TextTransfer.getInstance(); String clipboardText = (String) clipboard.getContents(textTransfer); clipboard.dispose(); if (clipboardText != null) { StringBuffer out = new StringBuffer(); char[] chars = clipboardText.toCharArray(); boolean lastWasBackslash = false; for (char character : chars) { if (character == '\\') { if (lastWasBackslash) { out.append(character); lastWasBackslash = false; } else { lastWasBackslash = true; } } else { out.append(character); } } txt_RegExp.insert(out.toString()); } }
Source:
<code>public List<Project> getUserProjectsByRegex(User user, String regexPattern) { List<Project> array = new ArrayList<Project>(); Pattern pattern; try { pattern = Pattern.compile(regexPattern, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { logger.error("Bad regex pattern " + regexPattern); return array; } List<Project> projects = getProjects(); <START> for (Project project : projects) { <END> Permission perm = project.getUserPermission(user); if (perm != null && (perm.isPermissionSet(Type.ADMIN) || perm .isPermissionSet(Type.READ))) { if (pattern.matcher(project.getName()).find()) { array.add(project); } } } return array; }</code><technical_language>for (Project project : getProjects()), need introduce another variable</technical_language>

Target:
public List<Project> getUserProjectsByRegex(User user, String regexPattern) { List<Project> userProjects = new ArrayList<>(); Pattern pattern; try { pattern = Pattern.compile(regexPattern, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { logger.error("Bad regex pattern " + regexPattern); return userProjects; } for (Project project : getProjects()) { Permission perm = project.getUserPermission(user); if (perm != null && (perm.isPermissionSet(Type.ADMIN) || perm .isPermissionSet(Type.READ))) { if (pattern.matcher(project.getName()).find()) { userProjects.add(project); } } } return userProjects; }
Source:
<code>protected IMIBackend createBackendGDBService(DsfSession session, ILaunchConfiguration lc) { if (compareVersionWith(GDB_7_12_VERSION) >= 0 || compareVersionWith("7.11.50") >= 0 <START> ) { <END> return new GDBBackend_7_12(session, lc); } return new GDBBackend(session, lc); }</code><technical_language>Remove 7.11.50 condition GDB 7.12 is</technical_language>

Target:
protected IMIBackend createBackendGDBService(DsfSession session, ILaunchConfiguration lc) { if (compareVersionWith(GDB_7_12_VERSION) >= 0) { return new GDBBackend_7_12(session, lc); } return new GDBBackend(session, lc); }
Source:
<code>public int add(InputRow row) throws IndexSizeExceededException { if (currHydrant == null) { throw new IAE("No currHydrant but given row[%s]", row); } synchronized (hydrantLock) { if (!writable) { <START> return -1; <END> } IncrementalIndex index = currHydrant.getIndex(); if (index == null) { return -1; } return index.add(row); } }</code><technical_language>this a constant</technical_language>

Target:
public int add(InputRow row) throws IndexSizeExceededException { if (currHydrant == null) { throw new IAE("No currHydrant but given row[%s]", row); } synchronized (hydrantLock) { if (!writable) { return ADD_FAILED; } IncrementalIndex index = currHydrant.getIndex(); if (index == null) { return ADD_FAILED; } return index.add(row); } }
Source:
<code>public List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws InternalErrorException, PrivilegeException, AttributeNotExistsException, WrongAttributeAssignmentException { Utils.checkPerunSession(sess); <START> if(!AuthzResolver.isAuthorized(sess, Role.SERVICEUSER)) { <END> throw new PrivilegeException(sess, "getFacilitiesByAttribute"); } getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, attributeName); return getFacilitiesManagerBl().getFacilitiesByAttribute(sess, attributeName, attributeValue); }</code><technical_language>I Role.SERVICEUSER allow service user call this. rest of API, check for FACILITYADMIN role filter resulting list of facilities return those, user is facility manager. more correct check, if user READ right attribute search facility. If not, do return facility</technical_language>

Target:
public List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws InternalErrorException, PrivilegeException, AttributeNotExistsException, WrongAttributeAssignmentException { Utils.checkPerunSession(sess); if(!AuthzResolver.isAuthorized(sess, Role.FACILITYADMIN)) { throw new PrivilegeException(sess, "getFacilitiesByAttribute"); } AttributeDefinition attributeDef = getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, attributeName); List<Facility> facilities = getFacilitiesManagerBl().getFacilitiesByAttribute(sess, attributeName, attributeValue); Iterator<Facility> it = facilities.iterator(); while (it.hasNext()) { Facility facility = it.next(); if (!AuthzResolver.isAuthorizedForAttribute(sess, ActionType.READ, attributeDef, facility, null)) { it.remove(); } } return facilities; }
Source:
<code>public void testBuildImageIdWithBuildargs() throws Exception { <START> assumeTrue("Docker API should be at least v1.21 to support buildargs while building, got " <END> + sut.version().apiVersion(), compareVersion(sut.version().apiVersion(), "1.21") >= 0); final String dockerDirectory = Resources.getResource("dockerDirectoryWithBuildargs").getPath(); final String buildargs = "{\"testargument\":\"22-12-2015\"}"; final DockerClient.BuildParam buildParam = DockerClient.BuildParam.create("buildargs", URLEncoder.encode(buildargs, "UTF-8")); sut.build( Paths.get(dockerDirectory), "test-buildargs", buildParam ); }</code><technical_language>I need this assumeTrue. Docker API build params 1.18 <LINK_0></technical_language>

Target:
public void testBuildImageIdWithBuildargs() throws Exception { assumeTrue("We need Docker API >= v1.21 to run this test." + "This Docker API is " + sut.version().apiVersion(), compareVersion(sut.version().apiVersion(), "1.21") >= 0); final String dockerDirectory = Resources.getResource("dockerDirectoryWithBuildargs").getPath(); final String buildargs = "{\"testargument\":\"22-12-2015\"}"; final DockerClient.BuildParam buildParam = DockerClient.BuildParam.create("buildargs", URLEncoder.encode(buildargs, "UTF-8")); sut.build( Paths.get(dockerDirectory), "test-buildargs", buildParam ); }
Source:
<code>public int read(byte[] b, int off, int len) throws IOException { int cnt = 0; while (0 < len) { if (!buf.hasRemaining()) { buf.rewind(); int nr = os.read(position, buf); if (nr < 0) { <START> buf.position(buf.remaining()); <END> break; } position += nr; buf.flip(); } int n = Math.min(len, buf.remaining()); buf.get(b, off, n); off += n; len -= n; cnt += n; } if (cnt == 0 && len > 0) return -1; return cnt; }</code><technical_language>buf.capacity() work. symmetry do in constructor buf.hasRemaining() false</technical_language>

Target:
public int read(byte[] b, int off, int len) throws IOException { int cnt = 0; while (0 < len) { if (!buf.hasRemaining()) { buf.rewind(); int nr = DfsOutputStream.this.read(position, buf); if (nr < 0) { buf.position(buf.limit()); break; } position += nr; buf.flip(); } int n = Math.min(len, buf.remaining()); buf.get(b, off, n); off += n; len -= n; cnt += n; } if (cnt == 0 && len > 0) return -1; return cnt; }
Source:
<code>public void writeInterval(ByteBuffer buffer) { final byte byteFromType = getByteFromType(sv.getType()); buffer.putLong(start); <START> buffer.putLong(end - start); <END> buffer.putInt(attribute); buffer.put(byteFromType); switch (byteFromType) { case TYPE_NULL: break; case TYPE_INTEGER: try { buffer.putInt(sv.unboxInt()); } catch (StateValueTypeException e) { throw new RuntimeException(e); } break; case TYPE_STRING: String string; try { string = sv.unboxStr(); } catch (StateValueTypeException e) { throw new RuntimeException(e); } buffer.put((byte) string.length()); buffer.put(string.getBytes()); buffer.put((byte) 0); break; case TYPE_LONG: try { buffer.putLong(sv.unboxLong()); } catch (StateValueTypeException e) { throw new RuntimeException(e); } break; case TYPE_DOUBLE: try { buffer.putDouble(sv.unboxDouble()); } catch (StateValueTypeException e) { throw new RuntimeException(e); } break; default: break; } }</code><technical_language>a separate behavioural change, done in a separate patch, if ("just wait for varints bro")</technical_language>

Target:
public void writeInterval(ByteBuffer buffer) { final byte byteFromType = getByteFromType(sv.getType()); buffer.putLong(start); buffer.putLong(end); buffer.putInt(attribute); buffer.put(byteFromType); switch (byteFromType) { case TYPE_NULL: break; case TYPE_INTEGER: buffer.putInt(sv.unboxInt()); break; case TYPE_STRING: String string = sv.unboxStr(); buffer.put((byte) string.length()); buffer.put(string.getBytes()); buffer.put((byte) 0); break; case TYPE_LONG: buffer.putLong(sv.unboxLong()); break; case TYPE_DOUBLE: buffer.putDouble(sv.unboxDouble()); break; default: break; } }
Source:
<code>@Override public void initializeFromHandshake(GridNioSession ses, ClientListenerProtocolVersion ver, BinaryReaderExImpl reader) throws IgniteCheckedException { EnumSet<ClientFeature> features = null; if (ClientProtocolContext.isFeaturesSupported(ver)) { byte cliFeatures = reader.readByteArray(); features = ClientFeature.enumSet(cliFeatures); <START> features.retainAll(ClientFeature.allFeaturesAsEnumSet()); <END> } currentProtocolContext = new ClientProtocolContext(ver, features); String user = null; String pwd = null; if (currentProtocolContext.isUserAttributesSupported()) userAttrs = reader.readMap(); if (currentProtocolContext.isAuthorizationSupported()) { boolean hasMore; try { hasMore = reader.available() > 0; } catch (IOException e) { throw new IgniteCheckedException("Handshake error: " + e.getMessage(), e); } if (hasMore) { user = reader.readString(); pwd = reader.readString(); } } AuthorizationContext authCtx = authenticate(ses.certificates(), user, pwd); handler = new ClientRequestHandler(this, authCtx, currentProtocolContext); parser = new ClientMessageParser(this, currentProtocolContext); }</code><technical_language>redundant server get 'enumSet' features know</technical_language>

Target:
@Override public void initializeFromHandshake(GridNioSession ses, ClientListenerProtocolVersion ver, BinaryReaderExImpl reader) throws IgniteCheckedException { EnumSet<ClientBitmaskFeature> features = null; if (ClientProtocolContext.isFeatureSupported(ver, BITMAP_FEATURES)) { byte cliFeatures = reader.readByteArray(); features = ClientBitmaskFeature.enumSet(cliFeatures); } currentProtocolContext = new ClientProtocolContext(ver, features); String user = null; String pwd = null; if (currentProtocolContext.isFeatureSupported(USER_ATTRIBUTES)) userAttrs = reader.readMap(); if (currentProtocolContext.isFeatureSupported(AUTHORIZATION)) { boolean hasMore; try { hasMore = reader.available() > 0; } catch (IOException e) { throw new IgniteCheckedException("Handshake error: " + e.getMessage(), e); } if (hasMore) { user = reader.readString(); pwd = reader.readString(); } } AuthorizationContext authCtx = authenticate(ses.certificates(), user, pwd); handler = new ClientRequestHandler(this, authCtx, currentProtocolContext); parser = new ClientMessageParser(this, currentProtocolContext); }
Source:
<code>public OptionSet(OptionSet origin) { if (origin == null) throw new NullPointerException(); if_match_list = copyList(origin.if_match_list); uri_host = origin.uri_host; etag_list = copyList(origin.etag_list); if_none_match = origin.if_none_match; uri_port = origin.uri_port; location_path_list = copyList(origin.location_path_list); uri_path_list = copyList(origin.uri_path_list); content_format = origin.content_format; max_age = origin.max_age; uri_query_list = copyList(origin.uri_query_list); accept = origin.accept; location_query_list = copyList(origin.location_query_list); proxy_uri = origin.proxy_uri; proxy_scheme = origin.proxy_scheme; if (origin.block1 != null) block1 = new BlockOption(origin.block1); if (origin.block2 != null) block2 = new BlockOption(origin.block2); observe = origin.observe; <START> oscore = origin.oscore.clone(); <END> others = copyList(origin.others); }</code><technical_language>check for "oscore != null" call clone()</technical_language>

Target:
public OptionSet(OptionSet origin) { if (origin == null) throw new NullPointerException(); if_match_list = copyList(origin.if_match_list); uri_host = origin.uri_host; etag_list = copyList(origin.etag_list); if_none_match = origin.if_none_match; uri_port = origin.uri_port; location_path_list = copyList(origin.location_path_list); uri_path_list = copyList(origin.uri_path_list); content_format = origin.content_format; max_age = origin.max_age; uri_query_list = copyList(origin.uri_query_list); accept = origin.accept; location_query_list = copyList(origin.location_query_list); proxy_uri = origin.proxy_uri; proxy_scheme = origin.proxy_scheme; if (origin.block1 != null) block1 = new BlockOption(origin.block1); if (origin.block2 != null) block2 = new BlockOption(origin.block2); observe = origin.observe; if(origin.oscore != null) oscore = origin.oscore.clone(); others = copyList(origin.others); }
Source:
<code>public void passesCorrectBeanNameToTheImplementationDetector() { CustomRepositoryImplementationDetector detector = mock(CustomRepositoryImplementationDetector.class); <START> CdiRepositoryBean<SampleRepository> bean = new CdiRepositoryBean<SampleRepository>( <END> SINGLE_ANNOTATION, SampleRepository.class, beanManager, detector) { @Override protected SampleRepository create( CreationalContext<SampleRepository> creationalContext, Class<SampleRepository> repositoryType, Object customImplementation) { return null; } }; bean.create(mock(CreationalContext.class), SampleRepository.class); verify(detector).detectCustomImplementation( eq("CdiRepositoryBeanUnitTests.SampleRepositoryImpl"), eq("namedRepositoryImpl"), anySetOf(String.class), anySetOf(TypeFilter.class), Mockito.any(RepositoryBeanNameGenerator.class)); }</code><technical_language>// needed</technical_language>

Target:
public void passesCorrectBeanNameToTheImplementationDetector() { CustomRepositoryImplementationDetector detector = mock(CustomRepositoryImplementationDetector.class); CdiRepositoryBean<SampleRepository> bean = new CdiRepositoryBean<SampleRepository>( SINGLE_ANNOTATION, SampleRepository.class, beanManager, Optional.of(detector) ) { @Override protected SampleRepository create( CreationalContext<SampleRepository> creationalContext, Class<SampleRepository> repositoryType, Optional<Object> customImplementation ) { return null; } }; bean.create(mock(CreationalContext.class), SampleRepository.class); verify(detector).detectCustomImplementation( eq("CdiRepositoryBeanUnitTests.SampleRepositoryImpl"), eq("namedRepositoryImpl"), anySet(), anySet(), Mockito.any(Function.class) ); }
Source:
<code>public void onlyXrefsShouldBeConverted() { VariantAnnotation annotation = new VariantAnnotation("1", 1, 2, "A", "T"); annotation.setXrefs(Collections.singletonList(new Xref("OS01G0112100", "ensemblGene"))); DBObject dbObject = converter.convert(annotation); assertNull(dbObject.get(AnnotationFieldNames.CONSEQUENCE_TYPE_FIELD)); HashSet<BasicDBObject> xrefs = (HashSet) dbObject.get(AnnotationFieldNames.XREFS_FIELD); <START> assertTrue(xrefs.size() == 1); <END> assertTrue(isXrefPresent(xrefs, "OS01G0112100", "ensemblGene")); }</code><technical_language>assertEquals(1, xrefs.size())</technical_language>

Target:
public void onlyXrefsShouldBeConverted() { VariantAnnotation annotation = new VariantAnnotation("1", 1, 2, "A", "T"); annotation.setXrefs(Collections.singletonList(new Xref("OS01G0112100", "ensemblGene"))); DBObject dbObject = converter.convert(annotation); assertNull(dbObject.get(AnnotationFieldNames.CONSEQUENCE_TYPE_FIELD)); HashSet<BasicDBObject> xrefs = (HashSet) dbObject.get(AnnotationFieldNames.XREFS_FIELD); assertEquals(1, xrefs.size()); assertTrue(isXrefPresent(xrefs, "OS01G0112100", "ensemblGene")); }
Source:
<code>public CompletionStage<Void> removeRecoveryInformation(Collection<Address> lockOwners, Xid xid, GlobalTransaction gtx, boolean fromCluster) { log.tracef("Forgetting tx information for %s", gtx); if (rpcManager != null && !fromCluster) { TxCompletionNotificationCommand ftc = commandFactory.buildTxCompletionNotificationCommand(xid, gtx); return sendTxCompletionNotification(lockOwners, ftc) <START> .thenRun(() -> removeRecoveryInformation(xid)); <END> } else { removeRecoveryInformation(xid); return CompletableFutures.completedNull(); } }</code><technical_language>I safe remove local recovery info in caller thread return stage. Slightly off-topic, RecoveryAwareTransactionTable.removeRemoteTransaction horribly inefficient. iterate transactions GlobalTransaction is available</technical_language>

Target:
public CompletionStage<Void> removeRecoveryInformation(Collection<Address> lockOwners, Xid xid, GlobalTransaction gtx, boolean fromCluster) { log.tracef("Forgetting tx information for %s", gtx); if (rpcManager != null && !fromCluster) { TxCompletionNotificationCommand ftc = commandFactory.buildTxCompletionNotificationCommand(xid, gtx); CompletionStage<Void> stage = sendTxCompletionNotification(lockOwners, ftc); removeRecoveryInformation(xid); return stage; } else { removeRecoveryInformation(xid); return CompletableFutures.completedNull(); } }
Source:
<code>public void start(Map<String, Object> topoConf, int port) { try { hostName = dotToUnderScore(Utils.localHostname()); } catch (UnknownHostException e) { LOG.warn("Unable to determine hostname while starting the metrics system. Hostname will be reported" + " as 'localhost'."); } <START> this.topologyName = (String) topoConf.get(Config.TOPOLOGY_NAME); <END> this.port = port; LOG.info("Starting metrics reporters..."); List<Map<String, Object>> reporterList = (List<Map<String, Object>>) topoConf.get(Config.TOPOLOGY_METRICS_REPORTERS); if (reporterList != null && reporterList.size() > 0) { for (Map<String, Object> reporterConfig : reporterList) { startReporter(topoConf, reporterConfig); } } }</code><technical_language>topologyId topologyId in long name</technical_language>

Target:
public void start(Map<String, Object> topoConf, int port) { try { hostName = dotToUnderScore(Utils.localHostname()); } catch (UnknownHostException e) { LOG.warn("Unable to determine hostname while starting the metrics system. Hostname will be reported" + " as 'localhost'."); } this.topologyId = (String) topoConf.get(Config.STORM_ID); this.port = port; LOG.info("Starting metrics reporters..."); List<Map<String, Object>> reporterList = (List<Map<String, Object>>) topoConf.get(Config.TOPOLOGY_METRICS_REPORTERS); if (reporterList != null && reporterList.size() > 0) { for (Map<String, Object> reporterConfig : reporterList) { startReporter(topoConf, reporterConfig); } } }
Source:
<code>private boolean isDebug() { <START> return getInitParameter("debug", false); <END> }</code><technical_language>That, is API change. break peoples ReplaceContent debug configuration 1 (which I agree is explicit all) broken</technical_language>

Target:
private boolean isDebug() { return Integer.valueOf(getInitParameter("debug", "0")) == 1; }
Source:
<code>private void subscribeLaunch() { if(checkCanSubscribe()) { <START> getSubscriptionTracker().subscribe(entity, Attributes.SERVICE_STATE_ACTUAL, new EntityLaunchListener(this)); <END> } }</code><technical_language>subscribe(...) getSubscriptionTracker().subscribe(...)</technical_language>

Target:
private void subscribeLaunch() { subscribe(entity, Attributes.SERVICE_STATE_ACTUAL, new EntityLaunchListener(this)); }