auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void readBatchFiltersOutNulls() throws IOException { when(mockLog.readRound(anyLong())) .thenAnswer(invocation -> { long sequence = (long) invocation.getArguments()[0]; if (sequence % 2 == 0) { return null; } return valueForRound(sequence).persistToBytes(); }); try (PaxosStateLogBatchReader<PaxosValue> reader = createReader()) { assertThat(reader.readBatch(START_SEQUENCE, BATCH_SIZE)) .isEqualTo(EXPECTED_ROUNDS.stream() <START> .filter(round -> round.sequence() % 2 != 0) <END> .collect(Collectors.toList())); } }</code><technical_language>nit: worth extracting a local predicate</technical_language>

Target:
public void readBatchFiltersOutNulls() throws IOException { Predicate<Long> isOdd = num -> num % 2 != 0; when(mockLog.readRound(anyLong())) .thenAnswer(invocation -> { long sequence = (long) invocation.getArguments()[0]; if (!isOdd.test(sequence)) { return null; } return valueForRound(sequence).persistToBytes(); }); try (PaxosStateLogBatchReader<PaxosValue> reader = createReader()) { assertThat(reader.readBatch(START_SEQUENCE, BATCH_SIZE)) .isEqualTo(EXPECTED_ROUNDS.stream() .filter(round -> isOdd.test(round.sequence())) .collect(Collectors.toList())); } }
Source:
<code>protected void eventHandle(@NonNull ITmfEvent event) { String name = event.getName(); long inc; if (name.equals(fLayout.eventKmemPageAlloc())) { inc = PAGE_SIZE; } else if (name.equals(fLayout.eventKmemPageFree())) { inc = -PAGE_SIZE; } else { return; } try { ITmfStateSystemBuilder ss = checkNotNull(getStateSystemBuilder()); long ts = event.getTimestamp().getValue(); Integer tidField = KernelTidAspect.INSTANCE.resolve(event); String tid; if (tidField == null) { tid = "other"; } else { tid = tidField.toString(); } int tidQuark = ss.getQuarkAbsoluteAndAdd(tid); ITmfStateValue previousMemoryValue = ss.queryOngoingState(tidQuark); if (previousMemoryValue.isNull()) { previousMemoryValue = TmfStateValue.newValueLong(0); } long currentMemoryValue = previousMemoryValue.unboxLong() + inc; <START> ss.modifyAttribute(ts, TmfStateValue.newValueLong(currentMemoryValue), tidQuark); <END> int lowestMemoryQuark = ss.getQuarkRelativeAndAdd(tidQuark, KernelMemoryAnalysisModule.THREAD_LOWEST_MEMORY_VALUE); ITmfStateValue lowestMemoryValue = ss.queryOngoingState(lowestMemoryQuark); if (lowestMemoryValue.isNull()) { lowestMemoryValue = TmfStateValue.newValueLong(0); } if (lowestMemoryValue.unboxLong() > currentMemoryValue) { ss.modifyAttribute(ts, TmfStateValue.newValueLong(currentMemoryValue), lowestMemoryQuark); } } catch (AttributeNotFoundException e) { Activator.getDefault().logError(e.getMessage(), e); } }</code><technical_language>is a new method life easier. Replace previous lines this: StateSystemBuilderUtils.incrementAttributeLong(ss, ts, tidQuark, inc);</technical_language>

Target:
protected void eventHandle(@NonNull ITmfEvent event) { String name = event.getName(); long inc; if (name.equals(fLayout.eventKmemPageAlloc())) { inc = PAGE_SIZE; } else if (name.equals(fLayout.eventKmemPageFree())) { inc = -PAGE_SIZE; } else { return; } try { ITmfStateSystemBuilder ss = checkNotNull(getStateSystemBuilder()); long ts = event.getTimestamp().getValue(); Integer tidField = KernelTidAspect.INSTANCE.resolve(event); String tid; if (tidField == null) { tid = "other"; } else { tid = tidField.toString(); } int tidQuark = ss.getQuarkAbsoluteAndAdd(tid); StateSystemBuilderUtils.incrementAttributeLong(ss, ts, tidQuark, inc); long currentMemoryValue = ss.queryOngoingState(tidQuark).unboxLong(); int lowestMemoryQuark = ss.getQuarkRelativeAndAdd(tidQuark, KernelMemoryAnalysisModule.THREAD_LOWEST_MEMORY_VALUE); ITmfStateValue lowestMemoryValue = ss.queryOngoingState(lowestMemoryQuark); long previousLowest = lowestMemoryValue.isNull() ? 0 : lowestMemoryValue.unboxLong(); if (previousLowest > currentMemoryValue) { ss.modifyAttribute(ts, TmfStateValue.newValueLong(currentMemoryValue), lowestMemoryQuark); } } catch (AttributeNotFoundException e) { Activator.getDefault().logError(e.getMessage(), e); } }
Source:
<code>protected void executeQueryCommand() { if (connect(getParameters().getServerName())) { <START> validateFingerprint(); <END> String glusterServers = executeCommand(); if (StringUtils.isNotEmpty(glusterServers)) { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder; try { File returnXml = new File(System.getProperty("java.io.tmpdir") + "/peers.xml"); FileWriter xmlFileWriter = new FileWriter(returnXml); xmlFileWriter.write(glusterServers); xmlFileWriter.close(); docBuilder = docBuilderFactory.newDocumentBuilder(); Document doc = docBuilder.parse(returnXml); doc.getDocumentElement().normalize(); NodeList listOfPeers = doc.getElementsByTagName(PEER); extractServers(listOfPeers); } catch (ParserConfigurationException e1) { log.errorFormat("There is problem in parsing xml." + e1.getMessage()); throw new RuntimeException(e1); } catch (SAXException e2) { log.errorFormat("Error in parsing xml." + e2.getMessage()); throw new RuntimeException(e2); } catch (IOException e3) { log.errorFormat("There is problem in reading the file." + e3.getMessage()); throw new RuntimeException(e3); } getQueryReturnValue().setReturnValue(getServerFingerPrintMap()); } else { log.error("Could not get the peer list form the host: " + getParameters().getServerName()); } } else { log.error("Could not connect to host: " + getParameters().getServerName()); } }</code><technical_language>connect twice? If connect obtain fingerprint existing connection</technical_language>

Target:
protected void executeQueryCommand() { if (connect(getParameters().getServerName())) { validateFingerprint(); String glusterServers = executeCommand(); if (StringUtils.isNotEmpty(glusterServers)) { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder; try { docBuilder = docBuilderFactory.newDocumentBuilder(); InputSource is= new InputSource(new StringReader(glusterServers)); Document doc = docBuilder.parse(is); doc.getDocumentElement().normalize(); NodeList listOfPeers = doc.getElementsByTagName(PEER); extractServers(listOfPeers); } catch (ParserConfigurationException e1) { log.errorFormat("There is problem in parsing xml." + e1.getMessage()); throw new RuntimeException(e1); } catch (SAXException e2) { log.errorFormat("Error in parsing xml." + e2.getMessage()); throw new RuntimeException(e2); } catch (IOException e3) { log.errorFormat("There is problem in reading the file." + e3.getMessage()); throw new RuntimeException(e3); } getQueryReturnValue().setReturnValue(getServerFingerPrintMap()); } else { log.error("Could not get the peer list form the host: " + getParameters().getServerName()); } } else { log.error("Could not connect to host: " + getParameters().getServerName()); } }
Source:
<code>public void setInput(Object input) { if (input instanceof SMAEditor) { this.editor = (SMAEditor) input; if (getTreeViewer() != null) { <START> if (editor != null && getTreeViewer() != null && getTreeViewer().getTree() != null && Widgets.isAccessible(getTreeViewer().getTree())) { <END> getTreeViewer().setInput(editor); IAtsStateDefinition stateDef = WorkflowManager.getCurrentAtsWorkPage((editor).getAwa()).getStateDefinition(); StructuredSelection newSelection = new StructuredSelection(Arrays.asList(stateDef)); getTreeViewer().expandToLevel((editor).getAwa(), 2); getTreeViewer().expandToLevel(stateDef, 1); getTreeViewer().setSelection(newSelection); } } } }</code><technical_language>Remove getTreeViewer().getTree() != null check done internally in Widgets.isAccessible()</technical_language>

Target:
public void setInput(Object input) { if (input instanceof SMAEditor) { this.editor = (SMAEditor) input; if (getTreeViewer() != null) { if (editor != null && getTreeViewer().getTree() != null && Widgets.isAccessible(getTreeViewer().getTree())) { getTreeViewer().setInput(editor); IAtsStateDefinition stateDef = WorkflowManager.getCurrentAtsWorkPage((editor).getAwa()).getStateDefinition(); StructuredSelection newSelection = new StructuredSelection(Arrays.asList(stateDef)); getTreeViewer().expandToLevel((editor).getAwa(), 2); getTreeViewer().expandToLevel(stateDef, 1); getTreeViewer().setSelection(newSelection); } } } }
Source:
<code>private Map<String, String> getProcessVariables(JBPMProcessModel model) { <START> Map<String, String> variables = new HashMap<>(); <END> final List<ModelProperty> properties = model.getProcessFormModel().getProperties(); for (ModelProperty property : properties) { variables.put(property.getName(), property.getTypeInfo().getClassName()); } return variables; }</code><technical_language>This is opportunity for a nice stream pipeline. is absolutely necessary, in opinion, converting utility methods streams intention clearer see</technical_language>

Target:
private Map<String, String> getProcessVariables(JBPMProcessModel model) { return model.getProcessFormModel().getProperties().stream().collect(Collectors.toMap( ModelProperty::getName, p -> p.getTypeInfo().getClassName() )); }
Source:
<code>public void pageSelected(final int pageNumber) { if (pageNumber == 1 && !isSelected) { GAV gav = newContainerFormPresenter.getCurrentGAV(); JarListPageRequest request = new JarListPageRequest(0, Integer.MAX_VALUE, null, Arrays.asList("jar"), null, false); m2RepoService.call(response -> { List<JarListPageRow> jarListPageRowList = ((PageResponse<JarListPageRow>) response).getPageRowList(); Optional<JarListPageRow> optionalJarListPageRow = jarListPageRowList.stream().filter(jarListPageRow -> jarListPageRow.getGav().equals(gav)) .sorted(Comparator.comparing(JarListPageRow::getLastModified).reversed()).findFirst(); if (optionalJarListPageRow.isPresent()) { if (optionalJarListPageRow.get().getPath() != null && !optionalJarListPageRow.get().getPath().isEmpty()) { <START> dependencyPathSelectedEvent.fire(new DependencyPathSelectedEvent(this, optionalJarListPageRow.get().getPath(), false)); <END> } } else { notification.fire(new NotificationEvent(newContainerFormPresenter.getView().getNewContainerGAVNotExist(gav.toString()), NotificationEvent.NotificationType.ERROR)); } }).listArtifacts(request); } super.pageSelected(pageNumber); }</code><technical_language>@bxf12315 If launch DependencyPathSelectedEvent param isselected = true allows respect changes done Runtime Strategy configuration changed user throw wizard. I behaviour more consistent is performed a kjar is selected list. WDYT</technical_language>

Target:
public void pageSelected(final int pageNumber) { if (pageNumber == 1 && !isSelected) { GAV gav = newContainerFormPresenter.getCurrentGAV(); JarListPageRequest request = new JarListPageRequest(0, Integer.MAX_VALUE, null, Arrays.asList("jar"), null, false); m2RepoService.call(response -> { List<JarListPageRow> jarListPageRowList = ((PageResponse<JarListPageRow>) response).getPageRowList(); Optional<JarListPageRow> optionalJarListPageRow = jarListPageRowList.stream().filter(jarListPageRow -> jarListPageRow.getGav().equals(gav)) .sorted(Comparator.comparing(JarListPageRow::getLastModified).reversed()).findFirst(); if (optionalJarListPageRow.isPresent()) { if (optionalJarListPageRow.get().getPath() != null && !optionalJarListPageRow.get().getPath().isEmpty()) { dependencyPathSelectedEvent.fire(new DependencyPathSelectedEvent(this, optionalJarListPageRow.get().getPath())); } } else { notification.fire(new NotificationEvent(newContainerFormPresenter.getView().getNewContainerGAVNotExist(gav.toString()), NotificationEvent.NotificationType.ERROR)); } }).listArtifacts(request); } super.pageSelected(pageNumber); }
Source:
<code>public static void setUp() throws InterruptedException, TimeoutException, IOException { final String defaultWebModule = "default-web-module"; operations.add(HTTP_SERVER_ADDRESS).assertSuccess(); operations.add(HOST_ADDRESS, Values.of(defaultWebModule, "defaultWebModule-" + RandomStringUtils .randomAlphanumeric(6))).assertSuccess(); operations.add(HOST_TBR_ADDRESS, Values.of(defaultWebModule, "defaultWebModule-tbr-" + RandomStringUtils .randomAlphanumeric(6))).assertSuccess(); administration.reloadIfRequired(); operations.add(GZIP_PAGE_FILTER_ADDRESS).assertSuccess(); operations.add(ERROR_PAGE_FILTER_ADDRESS, Values.of("code", 404)).assertSuccess(); operations.add(HOST_ADDRESS.and("filter-ref", ERROR_PAGE_FILTER_NAME)).assertSuccess(); operations.add(REWRITE_FILTER_ADDRESS, Values.of("target", "foo")).assertSuccess(); operations.add(HOST_ADDRESS.and("filter-ref", REWRITE_FILTER_NAME)).assertSuccess(); operations.add(REQUEST_LIMIT_FILTER_ADDRESS, Values.of("max-concurrent-requests", 42)).assertSuccess(); <START> operations.add(HOST_ADDRESS.and("filter-ref", REQUEST_LIMIT_FILTER_NAME)).assertSuccess(); <END> administration.reloadIfRequired(); }</code><technical_language>I suggest making of batch operation here</technical_language>

Target:
public static void setUp() throws InterruptedException, TimeoutException, IOException { final String defaultWebModule = "default-web-module"; operations.add(HTTP_SERVER_ADDRESS).assertSuccess(); operations.add(HOST_ADDRESS, Values.of(defaultWebModule, "defaultWebModule-" + RandomStringUtils .randomAlphanumeric(6))).assertSuccess(); operations.add(HOST_TBR_ADDRESS, Values.of(defaultWebModule, "defaultWebModule-tbr-" + RandomStringUtils .randomAlphanumeric(6))).assertSuccess(); administration.reloadIfRequired(); operations.add(GZIP_PAGE_FILTER_ADDRESS).assertSuccess(); operations.batch(new Batch() .add(ERROR_PAGE_FILTER_ADDRESS, Values.of("code", 404)) .add(HOST_ADDRESS.and("filter-ref", ERROR_PAGE_FILTER_ADDRESS.getLastPairValue()))).assertSuccess(); operations.batch(new Batch() .add(REWRITE_FILTER_ADDRESS, Values.of("target", "foo")) .add(HOST_ADDRESS.and("filter-ref", REWRITE_FILTER_ADDRESS.getLastPairValue()))).assertSuccess(); operations.batch(new Batch() .add(REQUEST_LIMIT_FILTER_ADDRESS, Values.of("max-concurrent-requests", 42)) .add(HOST_ADDRESS.and("filter-ref", REQUEST_LIMIT_FILTER_ADDRESS.getLastPairValue()))).assertSuccess(); administration.reloadIfRequired(); }
Source:
<code>protected String getDescription() { <START> return null; <END> }</code><technical_language>suggestion return "FakeImageSubstitutor";</technical_language>

Target:
protected String getDescription() { return "test implementation"; }
Source:
<code>public void toMapFromMap() { Map<String, FormField<?>> inputMap = new HashMap<String, FormField<?>>() { { put("key", new FormField<>(null, null, null, null, 0)); } }; Map<String, FormField<?>> actualList = new FormField<>(null, null, null, new FieldValue(FieldValueType.MAP).setFormFieldMap(inputMap), 0).getValue().asMap(); <START> assertEquals(inputMap, actualList); <END> }</code><technical_language>assertTrue(inputMap.equals(actualList)); <LINK_0></technical_language>

Target:
public void toMapFromMap() { Map<String, FormField> inputMap = new HashMap<String, FormField>() { { put("key", new FormField(null, null, null, null, 0)); } }; Map<String, FormField> actualMap = new FormField(null, null, null, new FieldValue(inputMap, FieldValueType.MAP), 0).getValue().asMap(); assertEquals(inputMap, actualMap); }
Source:
<code>public Builder signedHeaders(List<String> signedHeaders) { <START> this.signedHeaders = new ArrayList<>(signedHeaders); <END> return this; }</code><technical_language>suggest protect null java this.signedHeaders = signedHeaders == null ? Collections.emptyList() : new ArrayList<>(signedHeaders);</technical_language>

Target:
public Builder signedHeaders(List<String> signedHeaders) { if (signedHeaders == null) { this.signedHeaders = Collections.emptyList(); } else { this.signedHeaders = new ArrayList<>(signedHeaders); } return this; }
Source:
<code>public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription delegatingResourceDescription = new DelegatingResourceDescription(); delegatingResourceDescription.addProperty("fulfillerStatus"); delegatingResourceDescription.addProperty("fulfillerComment"); <START> delegatingResourceDescription.addProperty("uuid"); <END> delegatingResourceDescription.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); delegatingResourceDescription.addSelfLink(); return delegatingResourceDescription; }</code><technical_language>need properties exist apply</technical_language>

Target:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription delegatingResourceDescription = new DelegatingResourceDescription(); delegatingResourceDescription.addProperty("fulfillerStatus"); delegatingResourceDescription.addProperty("fulfillerComment"); return delegatingResourceDescription; }
Source:
<code>protected static DataBundle loadDataBundle(String pathToJsonFileParam) { <START> String pathToJsonFile = (pathToJsonFileParam.startsWith("/") ? TestProperties.TEST_DATA_FOLDER : "") <END> + pathToJsonFileParam; try { String jsonString = FileHelper.readFile(pathToJsonFile); return Utils.getTeammatesGson().fromJson(jsonString, DataBundle.class); } catch (FileNotFoundException e) { throw new RuntimeException(e); } }</code><technical_language>This try block</technical_language>

Target:
protected static DataBundle loadDataBundle(String pathToJsonFileParam) { try { String pathToJsonFile = (pathToJsonFileParam.startsWith("/") ? TestProperties.TEST_DATA_FOLDER : "") + pathToJsonFileParam; String jsonString = FileHelper.readFile(pathToJsonFile); return Utils.getTeammatesGson().fromJson(jsonString, DataBundle.class); } catch (FileNotFoundException e) { throw new RuntimeException(e); } }
Source:
<code>private Long createAttachedChain(ByteBuffer readKeyBuffer, int hash, Iterator<Element> iterator) { Long address = createAttachedChain(readKeyBuffer, hash, iterator.next().getPayload()); if (address == null) { return null; } if (iterator.hasNext()) { try (AttachedInternalChain chain = new AttachedInternalChain(address)) { <START> while (iterator.hasNext()) { <END> if (!chain.append(iterator.next().getPayload())) { chain.free(); return null; } } } } return address; }</code><technical_language>a do while hasNext is done</technical_language>

Target:
private Long createAttachedChain(ByteBuffer readKeyBuffer, int hash, Iterator<Element> iterator) { Long address = createAttachedChain(readKeyBuffer, hash, iterator.next().getPayload()); if (address == null) { return null; } if (iterator.hasNext()) { try (AttachedInternalChain chain = new AttachedInternalChain(address)) { do { if (!chain.append(iterator.next().getPayload())) { chain.free(); return null; } } while (iterator.hasNext()); } } return address; }
Source:
<code><START> public PP_ComponentGenerator getByProductId(@NonNull final ProductId productId) <END> { final I_PP_ComponentGenerator po = queryBL.createQueryBuilder(I_PP_ComponentGenerator.class) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_PP_ComponentGenerator.COLUMNNAME_M_Product_ID, productId) .create() .first(); if (po == null) { return null; } final List<I_PP_ComponentGenerator_Param> paramsPO = queryBL.createQueryBuilder(I_PP_ComponentGenerator_Param.class) .addOnlyActiveRecordsFilter() .addEqualsFilter(I_PP_ComponentGenerator_Param.COLUMNNAME_PP_ComponentGenerator_ID, po.getPP_ComponentGenerator_ID()) .create() .list(); final ImmutableMap<String, String> params = paramsPO.stream() .map(param -> GuavaCollectors.entry(param.getName(), param.getValue())) .collect(GuavaCollectors.toImmutableMap()); return PP_ComponentGenerator.builder() .javaClassId(JavaClassId.ofRepoId(po.getAD_JavaClass_ID())) .params(ComponentGeneratorParam.of(params)) .build(); }</code><technical_language>loading cache i suggest load records many</technical_language>

Target:
public Optional<ComponentGenerator> getByProductId(@NonNull final ProductId productId) { return Optional.ofNullable(cache.getOrLoad(0, this::loadAllGeneratorsAndParams).get(productId)); }
Source:
<code>public void multiRequestMixedReduced() throws IOException { init(); ViewMultipleRequest<String, Object> multi = db.getViewRequestBuilder("example", "by_tag") .newMultipleRequest(Key.Type.STRING, Object.class) .reduce(false).keys("java") .add() .reduce(true) .add() .build(); List<ViewResponse<String, Object>> responses = multi.getViewResponses(); <START> assertEquals(2, responses.size(), "There should be 2 respones for 2 requests"); <END> List<String> javaTagKeys = responses.get(0).getKeys(); assertEquals(1, javaTagKeys.size(), "There should be 1 java tag result"); assertEquals("java", javaTagKeys.get(0), "The key should be java"); List<Object> allTagsReduced = responses.get(1).getValues(); assertEquals(1, allTagsReduced.size(), "There should be 1 reduced result"); assertEquals(4, ((Number) allTagsReduced.get(0)).intValue(), "The result should be 4"); }</code><technical_language>respones -> responses</technical_language>

Target:
public void multiRequestMixedReduced() throws IOException { init(); ViewMultipleRequest<String, Object> multi = db.getViewRequestBuilder("example", "by_tag") .newMultipleRequest(Key.Type.STRING, Object.class) .reduce(false).keys("java") .add() .reduce(true) .add() .build(); List<ViewResponse<String, Object>> responses = multi.getViewResponses(); assertEquals(2, responses.size(), "There should be 2 responses for 2 requests"); List<String> javaTagKeys = responses.get(0).getKeys(); assertEquals(1, javaTagKeys.size(), "There should be 1 java tag result"); assertEquals("java", javaTagKeys.get(0), "The key should be java"); List<Object> allTagsReduced = responses.get(1).getValues(); assertEquals(1, allTagsReduced.size(), "There should be 1 reduced result"); assertEquals(4, ((Number) allTagsReduced.get(0)).intValue(), "The result should be 4"); }
Source:
<code>public void testSetupDiEnumDeviceInfo(){ HANDLE hDevInfoSet = setupApi.SetupDiGetClassDevs(GUID_DEVINTERFACE_COMPORT, null, null, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); assertTrue("For this test we need a valid HANDLE!",hDevInfoSet != INVALID_HANDLE_VALUE); SP_DEVINFO_DATA devInfo = new SP_DEVINFO_DATA(); boolean succeed = setupApi.SetupDiEnumDeviceInfo(hDevInfoSet, 0, devInfo); <START> if (!succeed) <END> assertTrue(getLastError()==ERROR_NO_MORE_ITEMS); else assertTrue(succeed); }</code><technical_language>above. This is a test. check return is correct examine some fields in devInfo</technical_language>

Target:
public void testSetupDiEnumDeviceInfo() { HANDLE hDevInfoSet = setupApi.SetupDiGetClassDevs(GUID_DEVINTERFACE_COMPORT, null, null, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); boolean succeed = setupApi.SetupDiEnumDeviceInfo(hDevInfoSet, FIRST_MEMBER, devInfo); if (!succeed) assertTrue(getLastError() == ERROR_NO_MORE_ITEMS); }
Source:
<code>private ReentrantLock getLockForKey(Object key) { <START> return locks.computeIfAbsent(key, (k) -> new ReentrantLock()); <END> }</code><technical_language>(k) -> suggestion return locks.computeIfAbsent(key, -> new ReentrantLock());</technical_language>

Target:
private ReentrantLock getLockForKey(Object key) { return locks.computeIfAbsent(key, k -> new ReentrantLock()); }
Source:
<code>public String getIPAddress() { if (json.has(NETWORK_SETTINGS) && !json.isNull(NETWORK_SETTINGS)) { JSONObject networkSettings = json.getJSONObject(NETWORK_SETTINGS); <START> if (!networkSettings.isNull(PORTS)) { <END> return networkSettings.getString(IP); } } return null; }</code><technical_language>check for IP ? Returning a null IP address ports configured intuitive</technical_language>

Target:
public String getIPAddress() { if (json.has(NETWORK_SETTINGS) && !json.isNull(NETWORK_SETTINGS)) { JSONObject networkSettings = json.getJSONObject(NETWORK_SETTINGS); if (!networkSettings.isNull(IP)) { return networkSettings.getString(IP); } } return null; }
Source:
<code><START> public static <T> Hits<T> create(List<Hit<T>> hits) <END> { return new AutoValue_Hits<>(hits); }</code><technical_language>Add create(Hit<T> ...hits) method clean a couple of calls of form Hits.create(Arrays.asList(a, b)), Hits.create(singletonList(ontologyTermHit)) Hits.create(emptyList()) Hits.create(a, b), Hits.create(ontologyTermHit) Hits.create()</technical_language>

Target:
public static <T> Hits<T> create(List<Hit<T>> hits) { return new AutoValue_Hits<>(ImmutableList.copyOf(hits)); }
Source:
<code>private SearchResultGroup[] getGroupedMatches() { final Map<IResource, List<SearchMatch>> grouped= new HashMap<>(); List<SearchMatch> matches= null; IResource resource= null; SearchMatch match= null; for (final Iterator<?> iterator= getSearchMatches().iterator(); iterator.hasNext();) { match= (SearchMatch) iterator.next(); resource= match.getResource(); if (!grouped.containsKey(resource)) grouped.put(resource, new ArrayList<SearchMatch>(4)); matches= grouped.get(resource); matches.add(match); } if (fBinary) { final Collection<IResource> collection= getCollector().getBinaryResources(); <START> grouped.keySet().removeAll(collection); <END> } final SearchResultGroup[] result= new SearchResultGroup[grouped.size()]; int index= 0; for (final List<SearchMatch> searchMatches : grouped.values()) { result[index++]= new SearchResultGroup(resource, searchMatches.toArray(new SearchMatch[searchMatches.size()])); } return result; }</code><technical_language>build is failed. I try revert this. this behavior I think</technical_language>

Target:
private SearchResultGroup[] getGroupedMatches() { final Map<IResource, List<SearchMatch>> grouped= new HashMap<>(); List<SearchMatch> matches= null; IResource resource= null; SearchMatch match= null; for (final Iterator<?> iterator= getSearchMatches().iterator(); iterator.hasNext();) { match= (SearchMatch) iterator.next(); resource= match.getResource(); if (!grouped.containsKey(resource)) grouped.put(resource, new ArrayList<SearchMatch>(4)); matches= grouped.get(resource); matches.add(match); } if (fBinary) { final Collection<IResource> collection= getCollector().getBinaryResources(); for (final Iterator<IResource> iterator= grouped.keySet().iterator(); iterator.hasNext();) { resource= iterator.next(); if (collection.contains(resource)) iterator.remove(); } } final SearchResultGroup[] result= new SearchResultGroup[grouped.size()]; int index= 0; for (final Iterator<IResource> iterator= grouped.keySet().iterator(); iterator.hasNext();) { resource= iterator.next(); matches= grouped.get(resource); result[index++]= new SearchResultGroup(resource, matches.toArray(new SearchMatch[matches.size()])); } return result; }
Source:
<code>public static MetricName parse(String regName) { <START> int firstDot = regName.indexOf(SEPARATOR); <END> if (firstDot == -1) return new MetricName(null, regName); String grp = regName.substring(0, firstDot); String beanName = regName.substring(firstDot + 1); return new MetricName(grp, beanName); }</code><technical_language>I is some difference indexOf(int) indexOf(String). parse methods hot path, performance critical here. Please methods for cases</technical_language>

Target:
public static MetricName parse(String regName) { int firstDot = regName.indexOf('.'); if (firstDot == -1) return new MetricName(null, regName); String grp = regName.substring(0, firstDot); String beanName = regName.substring(firstDot + 1); return new MetricName(grp, beanName); }
Source:
<code>public List<String> getLines(Channel channel) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(getInputStream(channel))); List<String> lines = new ArrayList<String>(); <START> String line; <END> while ((line = reader.readLine()) != null) { lines.add(line); } return lines; }</code><technical_language>I doesnt matter, nitpicking: local vars non-initialized. Good practice is initialize a defined value. sure, doesnt matter code right do it</technical_language>

Target:
public List<String> getLines(Channel channel) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(getInputStream(channel))); List<String> lines = new ArrayList<String>(); String line = null; while ((line = reader.readLine()) != null) { lines.add(line); } return lines; }
Source:
<code>public synchronized @Nonnull SingleTokenStats updateUsageForId(@Nonnull String tokenUuid) { if(areStatsDisabled()){ return new SingleTokenStats(tokenUuid); } SingleTokenStats stats = tokenStats.stream() .filter(s -> s.tokenUuid.equals(tokenUuid)) .findFirst() .orElse(null); <START> if (stats == null) { <END> stats = new SingleTokenStats(tokenUuid); tokenStats.add(stats); } stats.notifyUse(); save(); return stats; }</code><technical_language>I feel Optional null time is a bit of anti-pattern</technical_language>

Target:
public synchronized @Nonnull SingleTokenStats updateUsageForId(@Nonnull String tokenUuid) { if(areStatsDisabled()){ return new SingleTokenStats(tokenUuid); } SingleTokenStats stats = findById(tokenUuid) .orElseGet(() -> { SingleTokenStats result = new SingleTokenStats(tokenUuid); tokenStats.add(result); return result; }); stats.notifyUse(); save(); return stats; }
Source:
<code>public ServiceMetricEvent.Builder makeMetricBuilder(SegmentMetadataQuery query) { int numMinutes = 0; for (Interval interval : query.getIntervals()) { numMinutes += Minutes.minutesIn(interval).getMinutes(); } return new ServiceMetricEvent.Builder() <START> .setUser2(query.getDataSource().getMetricName()) <END> .setUser4(query.getType()) .setUser5(Joiner.on(",").join(query.getIntervals())) .setUser6(String.valueOf(query.hasFilters())) .setUser9(Minutes.minutes(numMinutes).toString()); }</code><technical_language>this name of datasource</technical_language>

Target:
public ServiceMetricEvent.Builder makeMetricBuilder(SegmentMetadataQuery query) { int numMinutes = 0; for (Interval interval : query.getIntervals()) { numMinutes += Minutes.minutesIn(interval).getMinutes(); } return new ServiceMetricEvent.Builder() .setUser2(DataSourceUtil.getMetricName(query.getDataSource())) .setUser4(query.getType()) .setUser5(Joiner.on(",").join(query.getIntervals())) .setUser6(String.valueOf(query.hasFilters())) .setUser9(Minutes.minutes(numMinutes).toString()); }
Source:
<code>public CreateXmlResourcePanel(@NotNull Module module, @NotNull ResourceType resourceType, @Nullable String predefinedName, @Nullable String predefinedValue, boolean chooseName, @Nullable VirtualFile defaultFile) { this(module, resourceType, defaultFile); if (chooseName) { predefinedName = ResourceHelper.prependResourcePrefix(module, predefinedName); } <START> if (predefinedName != null && predefinedName.length() > 0) { <END> if (chooseName) { myNameLabel.setVisible(true); myNameField.setVisible(true); } myNameField.setText(predefinedName); } else { myNameLabel.setVisible(true); myNameField.setVisible(true); } if (predefinedValue != null && predefinedValue.length() > 0) { myValueField.setText(predefinedValue); } else { myValueLabel.setVisible(true); myValueField.setVisible(true); } }</code><technical_language>StringUtil.isEmpty</technical_language>

Target:
public CreateXmlResourcePanel(@NotNull Module module, @NotNull ResourceType resourceType, @Nullable String predefinedName, @Nullable String predefinedValue, boolean chooseName, @Nullable VirtualFile defaultFile) { this(module, resourceType, defaultFile); if (chooseName) { predefinedName = ResourceHelper.prependResourcePrefix(module, predefinedName); } if (!StringUtil.isEmpty(predefinedName)) { if (chooseName) { myNameLabel.setVisible(true); myNameField.setVisible(true); } myNameField.setText(predefinedName); } else { myNameLabel.setVisible(true); myNameField.setVisible(true); } if (!StringUtil.isEmpty(predefinedValue)) { myValueField.setText(predefinedValue); } else { myValueLabel.setVisible(true); myValueField.setVisible(true); } }
Source:
<code>public Retention getObjectRetention(String bucketName, String objectName, String versionId) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map<String, String> queryParamMap = new HashMap<>(); queryParamMap.put("retention", ""); if (versionId != null && !versionId.isEmpty()) { queryParamMap.put("versionId", versionId); } Response response = null; Retention retention = new Retention(); <START> try { <END> response = executeGet(bucketName, objectName, null, queryParamMap); ResponseBody body = response.body(); retention = Xml.unmarshal(Retention.class, body.charStream()); } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() == ErrorCode.NO_SUCH_OBJECT_LOCK_CONFIGURATION) { throw e; } } finally { if (response != null) { response.body().close(); } } return retention; }</code><technical_language>try-with-resource. java try (Response response = executeGet(bucketName, objectName, null, queryParamMap) { ... ... } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.NO_SUCH_OBJECT_LOCK_CONFIGURATION) { throw e; } } return null;</technical_language>

Target:
public Retention getObjectRetention(String bucketName, String objectName, String versionId) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map<String, String> queryParamMap = new HashMap<>(); queryParamMap.put("retention", ""); if (versionId != null && !versionId.isEmpty()) { queryParamMap.put("versionId", versionId); } try (Response response = executeGet(bucketName, objectName, null, queryParamMap)) { Retention retention = Xml.unmarshal(Retention.class, response.body().charStream()); return retention; } catch (ErrorResponseException e) { if (e.errorResponse().errorCode() != ErrorCode.NO_SUCH_OBJECT_LOCK_CONFIGURATION) { throw e; } } return null; }
Source:
<code>public Fragment generateFragment() { final Fragment fragment; try { fragment = fragmentClass.newInstance(); } catch (InstantiationException e) { throw new Fragment.InstantiationException( String.format(ERROR_MSG_INSTANTIATION, fragmentClass), e); <START> } catch (IllegalAccessException e) { <END> throw new Fragment.InstantiationException( String.format(ERROR_MSG_INSTANTIATION, fragmentClass), e); } fragment.setArguments(args); return fragment; }</code><technical_language>2 catch blocks reduced 1 like: java catch (InstantiationException | IllegalAccessException e) { throw new Fragment.InstantiationException( String.format(ERROR_MSG_INSTANTIATION, fragmentClass), e); }</technical_language>

Target:
public Fragment generateFragment() { final Fragment fragment; try { fragment = fragmentClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new Fragment.InstantiationException( String.format(ERROR_MSG_INSTANTIATION, fragmentClass), e); } fragment.setArguments(args); return fragment; }
Source:
<code>public Optional<Startpoint> readStartpoint(SystemStreamPartition ssp) { <START> return readStartpointMap(Collections.singletonMap(null, Collections.singleton(ssp)), false).get(null) <END> .get(ssp); }</code><technical_language>null a key .get(null) atypical readable go. require some context for get background this</technical_language>

Target:
public Optional<Startpoint> readStartpoint(SystemStreamPartition ssp) { Map<String, byte[]> startpointBytes = readWriteStore.all(); return readStartpoint(startpointBytes, ssp, null); }
Source:
<code><START> private static <I> void checkSupported(Class<I> idClass) { <END> checkNotNull(idClass); Identifier.Type.getType(idClass); }</code><technical_language>do methods now</technical_language>

Target:
public static <I> void checkSupported(Class<I> idClass) { checkNotNull(idClass); Identifier.Type.getType(idClass); }
Source:
<code>private Object readResolve() { if (StringUtils.isNotBlank(collectionUrl) <START> && StringUtils.isNotBlank(username) <END> && password != null && StringUtils.isNotBlank(password.getPlainText())) { try { final URI uri = new URI(collectionUrl); String hostName = uri.getHost(); List<StandardUsernamePasswordCredentials> credentials = TeamCollectionConfiguration.findCredentials(hostName); for (StandardUsernamePasswordCredentials credential : credentials) { if (credential.getUsername().equals(username) && credential.getPassword().getPlainText().equals(password.getPlainText())) { this.credentialsId = credential.getId(); return this; } } this.credentialsId = TeamCollectionConfiguration.setCredentials(hostName, username, password.getPlainText()); } catch (Exception ignore) { } } return this; }</code><technical_language>if VSTS PAT, username empty</technical_language>

Target:
protected Object readResolve() { if (StringUtils.isNotBlank(collectionUrl) && password != null && StringUtils.isNotBlank(password.getPlainText())) { try { final URI uri = new URI(collectionUrl); String hostName = uri.getHost(); List<StandardUsernamePasswordCredentials> credentials = TeamCollectionConfiguration.findCredentials(hostName); for (StandardUsernamePasswordCredentials credential : credentials) { if ((StringUtils.isBlank(username) || credential.getUsername().equals(username)) && credential.getPassword().getPlainText().equals(password.getPlainText())) { this.credentialsId = credential.getId(); return this; } } this.credentialsId = TeamCollectionConfiguration.setCredentials(hostName, username, password.getPlainText()); } catch (Exception ex) { logger.log(Level.WARNING, String.format("Get or generate credentials for collection url: %s and username: %s failed.", collectionUrl, username), ex); } } return this; }
Source:
<code>public void launchTask(ExecutorDriver driver, TaskInfo taskInfo) { <START> currentTaskId = taskInfo.getTaskId(); <END> TaskInfo crateTask = null; try { crateTask = TaskInfo.parseFrom(taskInfo.getData()); } catch (InvalidProtocolBufferException e) { LOGGER.debug("Could not de-serialize TaskInfo", e); e.printStackTrace(); } if (crateTask != null) { LOGGER.debug("Prepare crateTask: {}", crateTask); boolean prepared = prepare(crateTask); if (prepared) { LOGGER.debug("Launch task: {}", crateTask.getCommand().getValue()); task = new Task(crateTask); startProcess(driver, task); driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(taskInfo.getTaskId()) .setState(TaskState.TASK_RUNNING) .build()); return; } } fail(driver); }</code><technical_language>send a statusUpdate task is starting</technical_language>

Target:
public void launchTask(ExecutorDriver driver, TaskInfo taskInfo) { currentTaskId = taskInfo.getTaskId(); driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_STARTING) .build()); TaskInfo crateTask = null; try { crateTask = TaskInfo.parseFrom(taskInfo.getData()); } catch (InvalidProtocolBufferException e) { LOGGER.debug("Could not de-serialize TaskInfo", e); e.printStackTrace(); } if (crateTask != null) { LOGGER.debug("Prepare crateTask: {}", crateTask); boolean prepared = prepare(crateTask); if (prepared) { LOGGER.debug("Launch task: {}", crateTask.getCommand().getValue()); task = new Task(crateTask); startProcess(driver, task); driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_RUNNING) .build()); return; } } fail(driver); }
Source:
<code>public Hardware apply(final VirtualGuest from) { HardwareBuilder builder = new HardwareBuilder().ids(from.getId() + "") .name(from.getHostname()) .hypervisor("XenServer") .processors(ImmutableList.of(new Processor(from.getStartCpus(), 0))) .ram(from.getMaxMemory()); if(from.getVirtualGuestBlockDevices() != null) { builder.volumes( FluentIterable.from(from.getVirtualGuestBlockDevices()).filter(new Predicate<VirtualGuestBlockDevice>() { @Override public boolean apply(VirtualGuestBlockDevice input) { return input.getMountType().equals("Disk"); } }) .transform(new Function<VirtualGuestBlockDevice, Volume>() { @Override public Volume apply(VirtualGuestBlockDevice item) { float volumeSize = item.getVirtualDiskImage().getCapacity(); return new VolumeImpl( item.getId() + "", from.isLocalDiskFlag() ? Volume.Type.LOCAL : Volume.Type.SAN, volumeSize, null, item.getBootableFlag() == 1, false); } }).toSet()); } return builder.build(); <START> } <END></code><technical_language>Reformat this class 3 space indentation 120 line length</technical_language>

Target:
public Hardware apply(final VirtualGuest from) { HardwareBuilder builder = new HardwareBuilder().ids(from.getId() + "") .name(from.getHostname()) .hypervisor("XenServer") .processors(ImmutableList.of(new Processor(from.getStartCpus(), 2))) .ram(from.getMaxMemory()); if (from.getVirtualGuestBlockDevices() != null) { builder.volumes( FluentIterable.from(from.getVirtualGuestBlockDevices()).filter(new Predicate<VirtualGuestBlockDevice>() { @Override public boolean apply(VirtualGuestBlockDevice input) { return input.getMountType().equals("Disk"); } }) .transform(new Function<VirtualGuestBlockDevice, Volume>() { @Override public Volume apply(VirtualGuestBlockDevice item) { float volumeSize = item.getVirtualDiskImage().getCapacity(); return new VolumeImpl( item.getId() + "", from.isLocalDiskFlag() ? Volume.Type.LOCAL : Volume.Type.SAN, volumeSize, null, item.getBootableFlag() == 1, false); } }).toSet()); } return builder.build(); }
Source:
<code>public static void hideKeyboard(Activity activity) { if (activity == null) return; <START> final View focusView = activity.getCurrentFocus(); <END> if (focusView == null) return; final InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); if (inputMethodManager == null) return; inputMethodManager.hideSoftInputFromWindow(focusView.getWindowToken(), 0); }</code><technical_language>I guess adding lines top of method solve issue. other additions logically identical previous version</technical_language>

Target:
public static void hideKeyboard(Activity activity) { if(activity == null) return; View view = activity.getCurrentFocus(); if (view != null) { InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); if (imm != null) { imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } } }
Source:
<code>public DirCache call() throws IOException { final File file = new File(repo.getWorkDir(), filepath); if (!file.exists()) { <START> DirCache dc = DirCache.lock(repo); <END> try { if (dc.findEntry(filepath) < 0) { throw new IllegalStateException(MessageFormat.format( "File {0} does not exist", filepath)); } else { return dc; } } finally { dc.unlock(); } } if (file.isDirectory()) throw new IllegalStateException(MessageFormat.format( "Adding directory {0} not yet supported", filepath)); ObjectWriter ow = new ObjectWriter(repo); final ObjectId id = ow.writeBlob(file); DirCache dc = DirCache.lock(repo); try { DirCacheBuilder builder = dc.builder(); final TreeWalk tw = new TreeWalk(repo); tw.reset(); tw.addTree(new DirCacheBuildIterator(builder)); FileTreeIterator fileTreeIterator = new FileTreeIterator( repo.getWorkDir(), repo.getFS()); tw.addTree(fileTreeIterator); tw.setRecursive(true); String lastAddedFile = null; while (tw.next()) { if (tw.getPathString().equals(filepath)) { if (!(filepath.equals(lastAddedFile))) { DirCacheEntry entry = new DirCacheEntry(filepath); entry.setObjectId(id); entry.setFileMode(repo.getFS().canExecute(file) ? FileMode.EXECUTABLE_FILE : FileMode.REGULAR_FILE); entry.setLastModified(file.lastModified()); entry.setLength((int) file.length()); builder.add(entry); lastAddedFile = filepath; } } else { final DirCacheIterator c = tw.getTree(0, DirCacheIterator.class); builder.add(c.getDirCacheEntry()); } } builder.commit(); } finally { dc.unlock(); } return dc; }</code><technical_language>lock DirCache if simply reading unlocking, sort of a waste of time. read() if need is it. But, I question, is this block here? If file exist in working tree, told add it, do, we? is rm foo; git add foo stage deletion. want do either</technical_language>

Target:
public DirCache call() throws IOException { DirCache dc = DirCache.lock(repo); try { ObjectWriter ow = new ObjectWriter(repo); ObjectId id; DirCacheIterator c; DirCacheBuilder builder = dc.builder(); final TreeWalk tw = new TreeWalk(repo); tw.reset(); tw.addTree(new DirCacheBuildIterator(builder)); FileTreeIterator fileTreeIterator = new FileTreeIterator( repo.getWorkDir(), repo.getFS()); tw.addTree(fileTreeIterator); tw.setRecursive(true); tw.setFilter(PathFilterGroup.createFromStrings(filepatterns)); String lastAddedFile = null; while (tw.next()) { String path = tw.getPathString(); final File file = new File(repo.getWorkDir(), path); if (!(path.equals(lastAddedFile))) { if (file.exists()) { id = ow.writeBlob(file); DirCacheEntry entry = new DirCacheEntry(path); entry.setObjectId(id); entry.setFileMode(repo.getFS().canExecute(file) ? FileMode.EXECUTABLE_FILE : FileMode.REGULAR_FILE); entry.setLastModified(file.lastModified()); entry.setLength((int) file.length()); builder.add(entry); lastAddedFile = path; } else { c = tw.getTree(0, DirCacheIterator.class); builder.add(c.getDirCacheEntry()); } } } builder.commit(); } finally { dc.unlock(); } return dc; }
Source:
<code>public FileConfigurationSource() { this.ymlFileName = "config.yml"; this.yamlFileName = "config.yaml"; this.propertiesFileName = "config.properties"; String configurationFileName = System.getProperty("com.kumuluz.ee.configuration.file"); if (configurationFileName != null && !configurationFileName.isEmpty()) { if (".yml".equals(configurationFileName.substring(configurationFileName.length() - 4))) { this.ymlFileName = configurationFileName; } else if (".yaml".equals(configurationFileName.substring(configurationFileName.length() - 5))) { this.yamlFileName = configurationFileName; } else if (".properties".equals(configurationFileName.substring(configurationFileName.length() - 11))) { this.propertiesFileName = configurationFileName; <START> } <END> } }</code><technical_language>if file type inferred extension name, try read a property file default (or .yml?) fail if in correct format, simply ignored</technical_language>

Target:
public FileConfigurationSource() { this.ymlFileName = "config.yml"; this.yamlFileName = "config.yaml"; this.propertiesFileName = "config.properties"; String configurationFileName = System.getProperty("com.kumuluz.ee.configuration.file"); if (configurationFileName != null && !configurationFileName.isEmpty()) { this.ymlFileName = configurationFileName; this.yamlFileName = configurationFileName; this.propertiesFileName = configurationFileName; } this.logDeferrer = new LogDeferrer<>(); this.logDeferrer.init(() -> Logger.getLogger(FileConfigurationSource.class.getName())); }
Source:
<code>private static synchronized ITerminalConnector getConnector(IRemoteConnection irc) throws RemoteConnectionException { ITerminalConnector con = cons.get(irc.getAddress()); if(con == null) { con = TerminalConnectorExtension.makeTerminalConnector( "org.eclipse.ptp.remote.internal.terminal.RemoteToolsConnector"); cons.put(irc.getAddress(),con); <START> } else if(irc.isOpen()) { <END> return null; } else { irc.open(new NullProgressMonitor()); return null; } return con; }</code><technical_language>irc is open if con is null initially. logic is a bit muddled</technical_language>

Target:
private static synchronized ITerminalConnector getConnector(IRemoteConnection irc) throws RemoteConnectionException { ITerminalConnector con = cons.get(irc.getAddress()); if(con == null) { con = TerminalConnectorExtension.makeTerminalConnector( "org.eclipse.ptp.remote.internal.terminal.RemoteToolsConnector"); cons.put(irc.getAddress(),con); } return con; }
Source:
<code>public void stop() { <START> LOGGER.info("stop called for cluster tiers on {}", this.clusterUri); <END> entityFactory = null; inMaintenance = false; clusterTierEntities.clear(); entity = null; closeConnection(); }</code><technical_language>I completely rephrase this: > Closing connection cluster {}</technical_language>

Target:
public void stop() { LOGGER.info("Closing connection to cluster {}", this.clusterUri); entityFactory = null; inMaintenance = false; clusterTierEntities.clear(); entity = null; closeConnection(); }