auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean validate() { NetworkValidator validator = new NetworkValidator(vmDao, <START> networkDao.get(getNetworkId())); <END> return validate(validator.networkIsSet(getNetworkId())) && validate(validator.notRemovingManagementNetwork()) && validate(validator.notIscsiBondNetwork()) && validate(validator.networkNotUsedByVms()) && validate(validator.networkNotUsedByTemplates()) && validate(getRemoveExternalNetworkValidationResult()); }</code><technical_language>getNetwork()</technical_language>

Target:
protected boolean validate() { NetworkValidator validator = new NetworkValidator(vmDao, getNetwork()); return validate(validator.networkIsSet(getNetworkId())) && validate(validator.notRemovingManagementNetwork()) && validate(validator.notIscsiBondNetwork()) && validate(validator.networkNotUsedByVms()) && validate(validator.networkNotUsedByTemplates()) && validate(getRemoveExternalNetworkValidationResult()); }
Source:
<code><START> public Object[][] getEmptyArrays(){ <END> final String BAM = BamFileIoUtils.BAM_FILE_EXTENSION; final String SAM = IOUtil.SAM_FILE_EXTENSION; final String CRAM = CramIO.CRAM_FILE_EXTENSION; return new Object[][]{ {new int[0], int[].class, BAM}, {new short[0], short[].class, BAM}, {new byte[0], byte[].class, BAM}, {new float[0], float[].class, BAM}, {new int[0], int[].class, SAM}, {new short[0], short[].class, SAM}, {new byte[0], byte[].class, SAM}, {new float[0], float[].class, SAM}, {new int[0], int[].class, CRAM}, {new short[0], short[].class, CRAM}, {new byte[0], byte[].class, CRAM}, {new float[0], float[].class, CRAM}, }; }</code><technical_language>missing space ){</technical_language>

Target:
private static Object[][] getEmptyArrays() { return new Object[][]{ {new int[0], int[].class}, {new short[0], short[].class}, {new byte[0], byte[].class}, {new float[0], float[].class}, }; }
Source:
<code>public static STGroup findStringTemplateGroup(ClassLoader classLoader, String path) { final STGroup cached = CACHE.get(path); if (cached != null) { return cached; } <START> synchronized (StringTemplateSqlLocator.class) { <END> return CACHE.computeIfAbsent(path, p -> readStringTemplateGroup(classLoader, path)); } }</code><technical_language>synchronize a private object class safe</technical_language>

Target:
public static STGroup findStringTemplateGroup(ClassLoader classLoader, String path) { return CACHE.computeIfAbsent(path, p -> ThreadLocal.withInitial(() -> readStringTemplateGroup(classLoader, path))).get(); }
Source:
<code>public SequencerServer(ServerContext serverContext, SequencerFactoryHelper sequencerFactoryHelper) { this.serverContext = serverContext; this.sequencerFactoryHelper = sequencerFactoryHelper; Config config = Config.parse(serverContext.getServerConfig()); this.executor = serverContext.getExecutorService(1, "sequencer-"); this.globalLogTail = sequencerFactoryHelper.getGlobalLogTail(); this.cache = sequencerFactoryHelper.getSequencerServerCache( config.getCacheSize(), globalLogTail - 1 ); this.streamsAddressMap = sequencerFactoryHelper.getStreamAddressSpaceMap(); this.streamTailToGlobalTailMap = sequencerFactoryHelper.getStreamTailToGlobalTailMap(); this.txResolutionTimer = MeterRegistryProvider.getInstance().map(registry -> registry.timer("sequencer.tx-resolution.timer")); this.streamsPerTx = MeterRegistryProvider.getInstance().map(registry -> DistributionSummary.builder("sequencer.tx-resolution.num_streams") .baseUnit("stream") <START> .publishPercentiles(0.50, 0.95, 0.99) <END> .register(registry)); }</code><technical_language>magic numbers? if replace local variable</technical_language>

Target:
public SequencerServer(ServerContext serverContext, SequencerFactoryHelper sequencerFactoryHelper) { this.serverContext = serverContext; this.sequencerFactoryHelper = sequencerFactoryHelper; Config config = Config.parse(serverContext.getServerConfig()); this.executor = serverContext.getExecutorService(1, "sequencer-"); this.globalLogTail = sequencerFactoryHelper.getGlobalLogTail(); this.cache = sequencerFactoryHelper.getSequencerServerCache( config.getCacheSize(), globalLogTail - 1 ); this.streamsAddressMap = sequencerFactoryHelper.getStreamAddressSpaceMap(); this.streamTailToGlobalTailMap = sequencerFactoryHelper.getStreamTailToGlobalTailMap(); this.txResolutionTimer = MeterRegistryProvider.getInstance().map(registry -> registry.timer("sequencer.tx-resolution.timer")); this.streamsPerTx = MeterRegistryProvider.getInstance().map(registry -> DistributionSummary.builder("sequencer.tx-resolution.num_streams") .baseUnit("stream") .publishPercentiles(percentiles) .register(registry)); }
Source:
<code>public void handleMessage(Message message) { Map<String, List<String>> headers = (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS); List<String> authorizationHeader = headers.get(OAUTH); if (authorizationHeader == null || authorizationHeader.isEmpty()) { return; } LOGGER.debug("Setting access token to the authorization header."); headers.remove(OAUTH); headers.put(AUTHORIZATION, authorizationHeader); <START> headers.remove(OAUTH); <END> }</code><technical_language>headers.remove(OAUTH) calls</technical_language>

Target:
public void handleMessage(Message message) { Map<String, List<String>> headers = (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS); List<String> authorizationHeader = headers.get(OAUTH); if (authorizationHeader == null || authorizationHeader.isEmpty()) { return; } LOGGER.debug("Setting access token to the authorization header."); headers.put(AUTHORIZATION, authorizationHeader); headers.remove(OAUTH); }
Source:
<code>public Template persist(Template template) { if(Strings.isNullOrEmpty(body)) { StringBuilder sb = new StringBuilder(); for (Container container : containers) { <START> sb.append("#parseContainer('").append(container.getIdentifier()).append("')") <END> .append(System.getProperty("line.separator")); } template.setBody(sb.toString()); } else { template.setBody(body); } try { return templateAPI.saveTemplate(template, host, user, false); } catch (DotDataException | DotSecurityException e) { throw new RuntimeException(e); } }</code><technical_language>pages containers multiple times a page. need test this: sb.append("#parseContainer('") .append(container.getIdentifier()) .append("',") .append("'uuid-1'") .append(")"); uuid-1 is a unique for container instance page</technical_language>

Target:
public Template persist(Template template) { final String uuid = UUIDGenerator.generateUuid(); if(Strings.isNullOrEmpty(body)) { StringBuilder sb = new StringBuilder(); for (Map<String, String> containerMap : containers) { sb.append("#parseContainer(") .append(StringPool.APOSTROPHE) .append(containerMap.get("containerId")) .append(StringPool.APOSTROPHE) .append(StringPool.COMMA) .append(StringPool.APOSTROPHE) .append(containerMap.get("uuid")) .append(StringPool.APOSTROPHE) .append(")") .append(System.getProperty("line.separator")); } template.setBody(sb.toString()); } else { template.setBody(body); } try { return templateAPI.saveTemplate(template, host, user, false); } catch (DotDataException | DotSecurityException e) { throw new RuntimeException(e); } }
Source:
<code>public void search_shouldReturnAllReportTemplatesByGivenPublisher() throws Exception { MockHttpServletRequest mrrtReportTemplateRequest = request(RequestMethod.GET, getURI()); mrrtReportTemplateRequest.setParameter(MrrtReportTemplateSearchHandler.REQUEST_PARAM_PUBLISHER, PUBLISHER_QUERY); <START> mrrtReportTemplateRequest.setParameter("v", Representation.FULL.getRepresentation()); <END> SimpleObject resultMrrtReportTemplate = deserialize(handle(mrrtReportTemplateRequest)); assertNotNull(resultMrrtReportTemplate); List<Object> hits = (List<Object>) resultMrrtReportTemplate.get("results"); MrrtReportTemplateSearchCriteria searchCriteria = new MrrtReportTemplateSearchCriteria.Builder().withPublisher(PUBLISHER_QUERY) .build(); assertThat(hits.size(), is(1)); assertThat(PropertyUtils.getProperty(hits.get(0), "uuid"), is(mrrtReportTemplateService.getMrrtReportTemplates(searchCriteria) .get(0) .getUuid())); assertNull(PropertyUtils.getProperty(resultMrrtReportTemplate, "totalCount")); }</code><technical_language>needed if assert uuid. remove this parameter (which defaults REF representation)</technical_language>

Target:
public void search_shouldReturnAllReportTemplatesByGivenPublisher() throws Exception { MockHttpServletRequest mrrtReportTemplateRequest = request(RequestMethod.GET, getURI()); mrrtReportTemplateRequest.setParameter(MrrtReportTemplateSearchHandler.REQUEST_PARAM_PUBLISHER, PUBLISHER_QUERY); SimpleObject resultMrrtReportTemplate = deserialize(handle(mrrtReportTemplateRequest)); assertNotNull(resultMrrtReportTemplate); List<Object> hits = (List<Object>) resultMrrtReportTemplate.get("results"); MrrtReportTemplateSearchCriteria searchCriteria = new MrrtReportTemplateSearchCriteria.Builder().withPublisher(PUBLISHER_QUERY) .build(); assertThat(hits.size(), is(1)); assertThat(PropertyUtils.getProperty(hits.get(0), "uuid"), is(mrrtReportTemplateService.getMrrtReportTemplates(searchCriteria) .get(0) .getUuid())); assertNull(PropertyUtils.getProperty(resultMrrtReportTemplate, "totalCount")); }
Source:
<code>private String getColSeparator(String format) { switch (format) { case "csv": return ","; case "tsv": return " "; case "psv": return "|"; default: throw new IllegalArgumentException( <START> String.format("Invalid format '%s'. Must be one of %s", format, Joiner.on(',').join(FORMATS))); <END> } }</code><technical_language>need Joiner here. rely toString of Set. Also, making formats Enum, EnumSet.allOf</technical_language>

Target:
private String getColSeparator(String format) { switch (SeparatorFormat.valueOf(format.toUpperCase())) { case CSV: return ","; case TSV: return " "; case PSV: return "|"; default: throw new IllegalArgumentException( String.format("Invalid format '%s'. Must be one of %s", format, EnumSet.allOf(SeparatorFormat.class))); } }
Source:
<code>public void openFolderInTerminalTest() { seleniumWebDriver.navigate().refresh(); projectExplorer.waitProjectExplorer(); projectExplorer.waitAndSelectItem(PROJECT_NAME); projectExplorer.expandPathInProjectExplorer(PROJECT_NAME + PATH_TO_EXPAND); projectExplorer.waitAndSelectItem(PROJECT_NAME + PATH_TO_EXPAND); projectExplorer.openContextMenuByPathSelectedItem(PROJECT_NAME + PATH_TO_EXPAND); projectExplorer.waitContextMenu(); projectExplorer.clickOnItemInContextMenu(OPEN_IN_TERMINAL); terminal.waitNumberTerminalTab(2); String terminalWorkDir = terminal.getVisibleTextFromTerminal(); <START> Assert.assertTrue(terminalWorkDir.trim().endsWith(PROJECT_NAME + PATH_TO_EXPAND + "$")); <END> projectExplorer.waitAndSelectItem(PROJECT_NAME + FILE); projectExplorer.openContextMenuByPathSelectedItem(PROJECT_NAME + FILE); projectExplorer.waitContextMenu(); projectExplorer.clickOnItemInContextMenu(OPEN_IN_TERMINAL); terminal.waitNumberTerminalTab(3); terminalWorkDir = terminal.getVisibleTextFromTerminal(); Assert.assertTrue(terminalWorkDir.trim().endsWith(PROJECT_NAME + "$")); }</code><technical_language>Similar <LINK_0></technical_language>

Target:
public void openFolderInTerminalTest() { seleniumWebDriver.navigate().refresh(); projectExplorer.waitProjectExplorer(); projectExplorer.waitAndSelectItem(PROJECT_NAME); projectExplorer.expandPathInProjectExplorer(PROJECT_NAME + PATH_TO_EXPAND); projectExplorer.waitAndSelectItem(PROJECT_NAME + PATH_TO_EXPAND); projectExplorer.openContextMenuByPathSelectedItem(PROJECT_NAME + PATH_TO_EXPAND); projectExplorer.waitContextMenu(); projectExplorer.clickOnItemInContextMenu(OPEN_IN_TERMINAL); terminal.waitNumberTerminalTab(2); terminal.waitExpectedTextIntoTerminal(PROJECT_NAME + PATH_TO_EXPAND + "$"); projectExplorer.waitAndSelectItem(PROJECT_NAME + FILE); projectExplorer.openContextMenuByPathSelectedItem(PROJECT_NAME + FILE); projectExplorer.waitContextMenu(); projectExplorer.clickOnItemInContextMenu(OPEN_IN_TERMINAL); terminal.waitNumberTerminalTab(3); terminal.waitExpectedTextIntoTerminal(PROJECT_NAME + "$"); }
Source:
<code>private StreamProperties unordered(boolean unordered) { if (unordered) { return new StreamProperties( distribution, exactColumnOrder, partitioningColumns, false, <START> otherActualProperties != null ? ActualProperties.builderFrom(otherActualProperties).unordered(true).build() : null); <END> } return this; }</code><technical_language>is a write this in a more readable style... assign a variable</technical_language>

Target:
private StreamProperties unordered(boolean unordered) { if (unordered) { ActualProperties updatedProperies = null; if (otherActualProperties != null) { updatedProperies = ActualProperties.builderFrom(otherActualProperties) .unordered(true) .build(); } return new StreamProperties( distribution, partitioningColumns, false, updatedProperies); } return this; }
Source:
<code>public Builder setBaseDataDir(Optional<Path> baseDataDir) { this.baseDataDir = baseDataDir; <START> return this; <END> }</code><technical_language>requireNonNull(baseDataDir, "baseDataDir is null");</technical_language>

Target:
public Builder setBaseDataDir(Optional<Path> baseDataDir) { this.baseDataDir = requireNonNull(baseDataDir, "baseDataDir is null"); return this; }
Source:
<code><START> public static Expr.NumericBinding withSuppliers(final Map<String, Supplier<Number>> bindings) <END> { return new Expr.NumericBinding() { @Override public Number get(String name) { Supplier<Number> supplier = bindings.get(name); return supplier == null ? null : supplier.get(); } }; }</code><technical_language>Suggest naming this supplierBindings</technical_language>

Target:
public static Expr.ObjectBinding withSuppliers(final Map<String, Supplier<Number>> bindings) { return new Expr.ObjectBinding() { @Override public Number get(String name) { Supplier<Number> supplier = bindings.get(name); return supplier == null ? null : supplier.get(); } }; }
Source:
<code>public void testQueryIsNullOperator() { List<QueryParam> variables = list(isNotNull("var_a")); List<ProcessInstanceWithVarsDesc> data = advanceVariableDataService.queryProcessByVariables(emptyList(), variables, queryContext); if (queryContext.getCount() > 0) { Assert.assertThat(data.size(), is(queryContext.getCount())); } for (ProcessInstanceWithVarsDesc p : data) { <START> Assert.assertNotNull(p.getVariables().get("var_a")); <END> } }</code><technical_language>Change test name is testing isNotNull operator suggestion public void testQueryIsNotNullOperator() {</technical_language>

Target:
public void testQueryIsNullOperator() { List<QueryParam> attributes = list(isNull(TASK_ATTR_OWNER)); List<UserTaskInstanceWithPotOwnerDesc> data = advanceVariableDataService.queryUserTasksByVariables(attributes, emptyList(), emptyList(), emptyList(), queryContext); if (queryContext.getCount() > 0) { Assert.assertThat(data.size(), is(queryContext.getCount())); } for (UserTaskInstanceWithPotOwnerDesc p : data) { Assert.assertNull(p.getActualOwner()); } }
Source:
<code>public void connect(int clientId, String clientName) throws RemoteException { logger.log(Level.INFO, "Client " + clientName + " connected"); <START> amountOfPingsReceived++; <END> try { ClientInterface ci = (ClientInterface) Naming.lookup(clientName); field.addPlayer(clientId); ci.initializeField(field); AddPlayerAction apa = new AddPlayerAction(clientId, field.getPlayer(clientId).getxPos(), field.getPlayer(clientId).getyPos()); broadcastActionToClients(apa); broadcastActionToServers(apa); connectedPlayers.put(clientId, ci); } catch (Exception e) { e.printStackTrace(); } if (!gameStarted) { logger.log(Level.INFO, "Game started on server " + ID); gameStarted = true; } checkAndUpdateGUI(); }</code><technical_language>Connecting is a ping message, a normal message (so increase amountOfMessageReceived instead</technical_language>

Target:
public void connect(int clientId, String clientName) throws RemoteException { logger.log(Level.INFO, "Client " + clientName + " connected"); clientAmountOfMessagesReceived++; try { ClientInterface ci = (ClientInterface) Naming.lookup(clientName); field.addPlayer(clientId); ci.initializeField(field); AddPlayerAction apa = new AddPlayerAction(clientId, field.getPlayer(clientId).getxPos(), field.getPlayer(clientId).getyPos()); broadcastActionToClients(apa); broadcastActionToServers(apa); connectedPlayers.put(clientId, ci); } catch (Exception e) { e.printStackTrace(); } if (!gameStarted) { logger.log(Level.INFO, "Game started on server " + ID); gameStarted = true; } checkAndUpdateGUI(); }
Source:
<code>private ProjectTrackerPreferenceSnapshot takeSnapshot() { String branch = getBranch(); if (StringUtils.isEmptyOrNull(branch)) return null; List<String> projectPaths = getAssociatedProjectsPaths(); <START> if (projectPaths == null) <END> return null; return new ProjectTrackerPreferenceSnapshot(repository, branch, projectPaths); }</code><technical_language>projectPaths.isEmpty()? @NonNull List<String> getAssociatedProjectsPaths() returning Collections.emptyList() instead of null test for projectPaths.isEmpty()</technical_language>

Target:
private ProjectTrackerPreferenceSnapshot takeSnapshot() { String branch = getBranch(); if (StringUtils.isEmptyOrNull(branch)) return null; List<String> projectPaths = getAssociatedProjectsPaths(); if (projectPaths.isEmpty()) { return null; } return new ProjectTrackerPreferenceSnapshot(repository, branch, projectPaths); }
Source:
<code>public void check(DecoratedKey key) { <START> if (!checkBoolean(key)) <END> throw new RuntimeException("Key " + key + " is not contained in the given ranges"); }</code><technical_language>Yep, this is I in mind, thanks. of names, though. prefer throwing check() renamed validate(), checkBoolean() check(). validate() is name give methods (that throw failure)</technical_language>

Target:
public boolean check(DecoratedKey key) { assert lastKey == null || key.compareTo(lastKey) > 0; lastKey = key; if (normalizedRanges.isEmpty()) return true; if (rangeIndex > normalizedRanges.size() - 1) throw new IllegalStateException("RangeOwnHelper can only be used to find the first out-of-range-token"); while (!normalizedRanges.get(rangeIndex).contains(key.getToken())) { rangeIndex++; if (rangeIndex > normalizedRanges.size() - 1) return false; } return true; }
Source:
<code>public void testValidate() { final VM vm = new VM(); vm.setStatus(VMStatus.Down); command.setVm(vm); command.setStoragePool(new StoragePool()); doReturn(true).when(command).checkRngDeviceClusterCompatibility(); doReturn(true).when(command).checkPayload(any(VmPayload.class)); <START> doReturn(true).when(command).checkDisksInBackupStorage(); <END> command.setCluster(new Cluster()); ValidateTestUtils.runAndAssertValidateSuccess(command); }</code><technical_language>This false, want allow a running VM disks backup storage domain</technical_language>

Target:
public void testValidate() { final VM vm = new VM(); vm.setStatus(VMStatus.Down); command.setVm(vm); command.setStoragePool(new StoragePool()); doReturn(true).when(command).checkRngDeviceClusterCompatibility(); doReturn(true).when(command).checkPayload(any(VmPayload.class)); doReturn(false).when(command).checkDisksInBackupStorage(); command.setCluster(new Cluster()); ValidateTestUtils.runAndAssertValidateSuccess(command); }
Source:
<code>private CoordinateReferenceSystem getGeometryCrs(Geometry geometry) { CoordinateReferenceSystem crs = (CoordinateReferenceSystem) geometry.getUserData(); if (crs == null) { crs = DefaultGeographicCRS.WGS84; <START> LOGGER.debug("CRS not found in geometry, defaulting to WGS84"); <END> } return crs; }</code><technical_language>this log statement trace instead</technical_language>

Target:
private CoordinateReferenceSystem getGeometryCrs(Geometry geometry) { if (geometry.getUserData() instanceof CoordinateReferenceSystem) { return (CoordinateReferenceSystem) geometry.getUserData(); } LOGGER.trace("CRS not found in geometry, defaulting to WGS84"); return DefaultGeographicCRS.WGS84; }
Source:
<code>public List<RGB> sample(List<Point> samplePoints) { for (Point p : samplePoints) { if (!getBounds().contains(p)) { throw new <START> IllegalArgumentException("Pixel outside <END> of the image"); } } List<RGB> retVal = new ArrayList<>(samplePoints.size()); for (Point p : samplePoints) { retVal.add(getPixel(p.x, p.y)); } return retVal; }</code><technical_language>Point I point coordinates, pixel a color value? In this class least</technical_language>

Target:
public List<RGB> sample(List<Point> samplePoints) { for (Point p : samplePoints) { if (!getBounds().contains(p)) { throw new IllegalArgumentException("Point outside of the image"); } } List<RGB> retVal = new ArrayList<>(samplePoints.size()); for (Point p : samplePoints) { retVal.add(getPixel(p.x, p.y)); } return retVal; }
Source:
<code><START> public int hashCode() { <END> int hash = 5; hash = 79 * hash + (this.pushedBy != null ? this.pushedBy.hashCode() : 0); return hash; }</code><technical_language>return Objects.hashCode(pushedBy)</technical_language>

Target:
public int hashCode() { return Objects.hashCode(this.pushedBy); }
Source:
<code>private void writeCsvRecordForProject(Map<String, CSVWriter> projectToFile, String outputFolderPath, ProjectModel projectModel, String[] line) { if (!projectToFile.containsKey(MERGED_CSV_FILENAME)) { String mergedFilename = PathUtil.cleanFileName(MERGED_CSV_FILENAME) + ".csv"; CSVWriter mergedFileWriter = initCSVWriter(outputFolderPath + mergedFilename, true); projectToFile.put(MERGED_CSV_FILENAME, mergedFileWriter); } if (!projectToFile.containsKey(projectModel.getName())) { String filename = PathUtil.cleanFileName(projectModel.getRootFileModel().getFileName()) + ".csv"; CSVWriter writer = initCSVWriter(outputFolderPath + filename, false); projectToFile.put(projectModel.getName(), writer); LOG.info("Setting csv filename to: " + filename + " for id: " + projectModel.getId()); projectModel.setCsvFilename(filename); } projectToFile.get(projectModel.getName()).writeNext(line); ArrayList<String> mergedList = new ArrayList<String>(Arrays.stream(line).collect(Collectors.toList())); <START> mergedList.add(projectModel.getName()); <END> String[] mergedLine = new String[ mergedList.size() ]; projectToFile.get(MERGED_CSV_FILENAME).writeNext(mergedList.toArray(mergedLine)); }</code><technical_language>I feel more useful for CSV/Spreadsheet usage name of parent application archive (ie application.ear, whatever.ear)</technical_language>

Target:
private void writeCsvRecordForProject(Map<String, CSVWriter> projectToFile, String outputFolderPath, ProjectModel projectModel, String[] line) { if (!projectToFile.containsKey(MERGED_CSV_FILENAME)) { String mergedFilename = PathUtil.cleanFileName(MERGED_CSV_FILENAME) + ".csv"; CSVWriter mergedFileWriter = initCSVWriter(outputFolderPath + mergedFilename, true); projectToFile.put(MERGED_CSV_FILENAME, mergedFileWriter); } if (!projectToFile.containsKey(projectModel.getName())) { String filename = PathUtil.cleanFileName(projectModel.getRootFileModel().getFileName()) + ".csv"; CSVWriter writer = initCSVWriter(outputFolderPath + filename, false); projectToFile.put(projectModel.getName(), writer); LOG.info("Setting csv filename to: " + filename + " for id: " + projectModel.getId()); projectModel.setCsvFilename(filename); } projectToFile.get(projectModel.getName()).writeNext(line); ArrayList<String> mergedList = new ArrayList<String>(Arrays.stream(line).collect(Collectors.toList())); mergedList.add(projectModel.getRootFileModel().asFile().getName()); String[] mergedLine = new String[ mergedList.size() ]; projectToFile.get(MERGED_CSV_FILENAME).writeNext(mergedList.toArray(mergedLine)); }
Source:
<code>private void decryptFile(String crypterClassName, File tempEncryptedFile, File tempDecryptedFile) { PinotCrypter pinotCrypter = PinotCrypterFactory.create(crypterClassName); <START> LOGGER.info("Using crypter class for decryption.", pinotCrypter.getClass().getName()); <END> pinotCrypter.decrypt(tempEncryptedFile, tempDecryptedFile); }</code><technical_language>please add file names this log, thanks</technical_language>

Target:
private void decryptFile(String crypterClassName, File tempEncryptedFile, File tempDecryptedFile) { PinotCrypter pinotCrypter = PinotCrypterFactory.create(crypterClassName); LOGGER.info("Using crypter class for decrypting to {}", pinotCrypter.getClass().getName(), tempEncryptedFile, tempDecryptedFile); pinotCrypter.decrypt(tempEncryptedFile, tempDecryptedFile); }
Source:
<code>public CommunicationClientCredential(String accessKey) { Objects.requireNonNull(accessKey, "'accessKey' cannot be null"); byte[] key = Base64.getDecoder().decode(accessKey); Mac sha256HMAC = null; try { sha256HMAC = Mac.getInstance("HmacSHA256"); sha256HMAC.init(new SecretKeySpec(key, "HmacSHA256")); } catch (NoSuchAlgorithmException e) { <START> e.printStackTrace(); <END> } catch (InvalidKeyException e) { e.printStackTrace(); } this.sha256HMAC = sha256HMAC; }</code><technical_language>talk this a bit more. I if sha256HMAC instantiation init moved a builder mechanism avoid throwing exceptions time call appendAuthorizationHeaders set up. @srnagar do think</technical_language>

Target:
public CommunicationClientCredential(String accessKey) { Objects.requireNonNull(accessKey, "'accessKey' cannot be null"); byte[] key = Base64.getDecoder().decode(accessKey); Mac sha256HMAC = null; try { sha256HMAC = Mac.getInstance("HmacSHA256"); sha256HMAC.init(new SecretKeySpec(key, "HmacSHA256")); } catch (NoSuchAlgorithmException e) { throw logger.logExceptionAsError(new RuntimeException(e)); } catch (InvalidKeyException e) { throw logger.logExceptionAsError(new RuntimeException(e)); } this.sha256HMAC = sha256HMAC; }
Source:
<code>void onSaveWorkspace() { view_.bringToFront(); server_.isFunctionMasked( "save.image", "base", new ErrorLoggingServerRequestCallback<Boolean>() { public void onResponseReceived(Boolean isMasked) { String code = isMasked ? "base::save.image" <START> : "save.image"; <END> consoleDispatcher_.saveFileAsThenExecuteCommand( "Save Workspace As", ".RData", true, code); }; }); }</code><technical_language>behavior error is save workspace all, wrong. previous behavior (save.image) if determine function is masked</technical_language>

Target:
void onSaveWorkspace() { view_.bringToFront(); server_.isFunctionMasked( "save.image", "base", new ServerRequestCallback<Boolean>() { public void onResponseReceived(Boolean isMasked) { String code = isMasked ? "base::save.image" : "save.image"; consoleDispatcher_.saveFileAsThenExecuteCommand( "Save Workspace As", ".RData", true, code); } @Override public void onError(ServerError error) { Debug.logError(error); consoleDispatcher_.saveFileAsThenExecuteCommand( "Save Workspace As", ".RData", true, "save.image"); }; }); }
Source:
<code>public ScheduledFuture<?> scheduleWithCronExpression(Runnable command, String cronExpression) { <START> return mock(ScheduledFuture.class); <END> }</code><technical_language>breaking assertions tasks completed properly disposed other shuutdown validations this? feat is reduce execution time expense of longer catching potential leaks other herbs</technical_language>

Target:
public ScheduledFuture<?> scheduleWithCronExpression(Runnable command, String cronExpression) { ScheduledFuture<?> recurrentTask = decorated.scheduleWithCronExpression(wrap(command), cronExpression); recurrentTasks.add(recurrentTask); return recurrentTask; }
Source:
<code>public void resolve() { if (entry == null) { return; } NetworkBootProtocol bootproto = NetworkBootProtocol.NONE; <START> String ipAddress = fetchIpAddress(); <END> if (bootProtocolDhcp()) { bootproto = NetworkBootProtocol.DHCP; } else if (StringUtils.isNotEmpty(ipAddress)) { bootproto = NetworkBootProtocol.STATIC_IP; } if (bootproto == NetworkBootProtocol.STATIC_IP) { String gateway = fetchGateway(); if (StringUtils.isNotEmpty(gateway)) { VdsBrokerObjectsBuilder.setGatewayIfNecessary(iface, host, gateway.toString()); } } iface.setBootProtocol(bootproto); }</code><technical_language>this is once, inline it, is relevant in case of bootProtocolDhcp() returns true</technical_language>

Target:
public void resolve() { if (entry == null) { return; } NetworkBootProtocol bootproto = NetworkBootProtocol.NONE; if (bootProtocolDhcp()) { bootproto = NetworkBootProtocol.DHCP; } else if (StringUtils.isNotEmpty(fetchIpAddress())) { bootproto = NetworkBootProtocol.STATIC_IP; } if (bootproto == NetworkBootProtocol.STATIC_IP) { String gateway = fetchGateway(); if (StringUtils.isNotEmpty(gateway)) { VdsBrokerObjectsBuilder.setGatewayIfNecessary(iface, host, gateway); } } iface.setBootProtocol(bootproto); }
Source:
<code>private void updateLabel(ConnectionState state, ErrorType error) { <START> if (ConnectionStateComposite.this.isDisposed()) return; <END> if (lastConnectionState == ConnectionState.ERROR && state == ConnectionState.NOT_CONNECTED) return; String labelDescription = null; if (accountStore.isEmpty()) { labelDescription = Messages.ConnectionStateComposite_info_add_jabber_account; } else if (state != null) { labelDescription = getDescription(state, error); } else if (lastConnectionState != null) { labelDescription = getDescription(lastConnectionState, lastError); } if (labelDescription == null) return; stateLabel.setText(labelDescription); stateLabel.setToolTipText( state == ConnectionState.CONNECTED ? String.format(CONNECTED_TOOLTIP, version) : null); layout(); if (state != null) { lastConnectionState = state; lastError = error; } }</code><technical_language>isDisposed() is questionable if do checks in code is executed widget is disposed. ChatRoomsComposite moved isDisposed check</technical_language>

Target:
private void updateLabel(ConnectionState state, ErrorType error) { if (isDisposed()) return; if (lastConnectionState == ConnectionState.ERROR && state == ConnectionState.NOT_CONNECTED) return; String labelDescription = null; if (accountStore.isEmpty()) { labelDescription = Messages.ConnectionStateComposite_info_add_jabber_account; } else if (state != null) { labelDescription = getDescription(state, error); } else if (lastConnectionState != null) { labelDescription = getDescription(lastConnectionState, lastError); } if (labelDescription == null) return; stateLabel.setText(labelDescription); stateLabel.setToolTipText( state == ConnectionState.CONNECTED ? String.format(CONNECTED_TOOLTIP, version) : null); layout(); if (state != null) { lastConnectionState = state; lastError = error; } }
Source:
<code><START> void applyTo(final HtsgetBAMFileReader underlyingReader, final SamReader reader) { <END> logDebugIgnoringOption(reader, this); }</code><technical_language>This design is crufty. started refactoring ReaderImplementation need custom handlers it. (Just venting... do here...)</technical_language>

Target:
void applyTo(final HtsgetBAMFileReader underlyingReader, final SamReader reader) { underlyingReader.enableFileSource(reader, true); }
Source:
<code><START> public static JPAAttachment from(Attachment attachment) { <END> return new JPAAttachment(attachment.getAttachmentId().getId(), attachment.getBytes(), attachment.getType(), new ArrayList<>(), new ArrayList<>(), "", false); }</code><technical_language>move static methods top of class? apply convention in James</technical_language>

Target:
public static JPAAttachment from(Attachment attachment) { return new JPAAttachment(attachment.getAttachmentId().getId(), attachment.getBytes(), attachment.getType(), ImmutableList.<String>builder().build(), ImmutableList.<String>builder().build(), "", false); }
Source:
<code>public static BasicAuthenticatorMetadataStorageUpdater createAuthenticatorStorageUpdater(final Injector injector) { if (isCoordinator(injector)) { return injector.getInstance(CoordinatorBasicAuthenticatorMetadataStorageUpdater.class); } else { <START> return injector.getInstance(NoopBasicAuthenticatorMetadataStorageUpdater.class); <END> } }</code><technical_language>Is this needed? I inject anything</technical_language>

Target:
public static BasicAuthenticatorMetadataStorageUpdater createAuthenticatorStorageUpdater(final Injector injector) { if (isCoordinator(injector)) { return injector.getInstance(CoordinatorBasicAuthenticatorMetadataStorageUpdater.class); } else { return null; } }
Source:
<code>public void peerStateChanged(final CallPeerChangeEvent evt) { CallPeerState callPeerState = (CallPeerState)evt.getNewValue(); String stateString = callPeerState.getStateString(); logger.info( (callContext == null ? "no-call-ctx" : callContext.getCallResource()) + " SIP peer state: " + stateString); if (jvbConference != null) jvbConference.setPresenceStatus(stateString); if (CallPeerState.BUSY.equals(callPeerState)) { new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(5000); } catch (InterruptedException e) { throw new RuntimeException(e); } CallManager.hangupCall( evt.getSourceCallPeer().getCall()); } }).start(); } if (CallPeerState.CONNECTED.equals(callPeerState)) { if (currentRecordingStatus.equals(JibriIq.Status.ON)) { <START> Util.injectSoundFile(call, "sounds/RecordingOn.opus"); <END> } } }</code><technical_language>constant</technical_language>

Target:
public void peerStateChanged(final CallPeerChangeEvent evt) { CallPeerState callPeerState = (CallPeerState)evt.getNewValue(); String stateString = callPeerState.getStateString(); logger.info( (callContext == null ? "no-call-ctx" : callContext.getCallResource()) + " SIP peer state: " + stateString); if (jvbConference != null) jvbConference.setPresenceStatus(stateString); if (CallPeerState.BUSY.equals(callPeerState)) { new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(5000); } catch (InterruptedException e) { throw new RuntimeException(e); } CallManager.hangupCall( evt.getSourceCallPeer().getCall()); } }).start(); } if (CallPeerState.CONNECTED.equals(callPeerState)) { if (currentRecordingStatus.equals(JibriIq.Status.ON)) { Util.injectSoundFile(call, REC_ON_SOUND); } } }
Source:
<code>private boolean isRegisterHealthIndicator(RateLimiter rateLimiter) { return rateLimiterProperties.findRateLimiterProperties(rateLimiter.getName()) .map(InstanceProperties::getRegisterHealthIndicator) <START> .orElse(true); <END> }</code><technical_language>disable HealthIndicator default. Please set false default value</technical_language>

Target:
private boolean isRegisterHealthIndicator(RateLimiter rateLimiter) { return rateLimiterProperties.findRateLimiterProperties(rateLimiter.getName()) .map(InstanceProperties::getRegisterHealthIndicator) .orElse(false); }
Source:
<code>private IType[] getTypes() throws JavaModelException { IEditorInput input= fEditor.getEditorInput(); if (input instanceof IClassFileEditorInput) { <START> ITypeRoot classFile= <END> ((IClassFileEditorInput)input).getClassFile(); if (classFile instanceof IOrdinaryClassFile) return new IType[] { ((IOrdinaryClassFile) classFile).getType() }; return new IType[0]; } else { return JavaPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(input).getAllTypes(); } }</code><technical_language>required</technical_language>

Target:
private IType[] getTypes() throws JavaModelException { IEditorInput input= fEditor.getEditorInput(); if (input instanceof IClassFileEditorInput) { IClassFile classFile= ((IClassFileEditorInput)input).getClassFile(); if (classFile instanceof IOrdinaryClassFile) return new IType[] { ((IOrdinaryClassFile) classFile).getType() }; return new IType[0]; } else { return JavaPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(input).getAllTypes(); } }
Source:
<code>private void onDistanceEvent(DistanceEvent event) { assert adminExecutor.inEventLoop(); this.lastDistanceEvents.put(event.node, event); if (event.distance == NodeDistance.IGNORED && channel != null && !channel.closeFuture().isDone() && event.node.getConnectAddress().equals(channel.remoteAddress())) { <START> LOG.debug("[{}] Control node became IGNORED, reconnecting", logPrefix, event.node); <END> reconnectNow(); } }</code><technical_language>nice this more explicit "reconnecting a node"</technical_language>

Target:
private void onDistanceEvent(DistanceEvent event) { assert adminExecutor.inEventLoop(); this.lastDistanceEvents.put(event.node, event); if (event.distance == NodeDistance.IGNORED && channel != null && !channel.closeFuture().isDone() && event.node.getConnectAddress().equals(channel.remoteAddress())) { LOG.debug( "[{}] Control node became IGNORED, reconnecting to a different node", logPrefix, event.node); reconnectNow(); } }
Source:
<code>public static void main(String[] args) throws InterruptedException { Microservices seed = Microservices.builder() .discovery(ScalecubeServiceDiscovery::new) .transport(ServiceTransports::rsocketServiceTransport) .startAwait(); Microservices.builder() .discovery( serviceEndpoint -> new ScalecubeServiceDiscovery(serviceEndpoint) .options(opts -> opts.seedMembers(toAddress(seed.discovery().address())))) .transport(ServiceTransports::rsocketServiceTransport) .services(new GreetingServiceImpl()) .startAwait(); GreetingsService service = seed.call().api(GreetingsService.class); service .sayHello("joe") .subscribe( consumer -> { System.out.println(consumer.message()); }); <START> Thread.currentThread().join(); <END> }</code><technical_language>Get a reference Microservices call .onShutdown().block()</technical_language>

Target:
public static void main(String[] args) { Microservices seed = Microservices.builder() .discovery(ScalecubeServiceDiscovery::new) .transport(ServiceTransports::rsocketServiceTransport) .startAwait(); Microservices ms = Microservices.builder() .discovery( serviceEndpoint -> new ScalecubeServiceDiscovery(serviceEndpoint) .options(opts -> opts.seedMembers(toAddress(seed.discovery().address())))) .transport(ServiceTransports::rsocketServiceTransport) .services(new GreetingServiceImpl()) .startAwait(); GreetingsService service = seed.call().api(GreetingsService.class); service .sayHello("joe") .subscribe( consumer -> { System.out.println(consumer.message()); }); seed.onShutdown().block(); ms.onShutdown().block(); }
Source:
<code>private void saveContributors(HashMap<?, ?> contributors) throws IOException { FileOutputStream fosContributors = new FileOutputStream(contributorsFile); DataOutputStream outputContributors = new DataOutputStream(new BufferedOutputStream(fosContributors)); Collection<?> entries = contributors.values(); outputContributors.writeInt(entries.size()); for (Object <START> name : <END> entries) { RegistryContributor contributor = (RegistryContributor) name; writeStringOrNull(contributor.getActualId(), outputContributors); writeStringOrNull(contributor.getActualName(), outputContributors); writeStringOrNull(contributor.getId(), outputContributors); writeStringOrNull(contributor.getName(), outputContributors); } outputContributors.flush(); fosContributors.getFD().sync(); outputContributors.close(); }</code><technical_language>rename entry</technical_language>

Target:
private void saveContributors(HashMap<?, ?> contributors) throws IOException { FileOutputStream fosContributors = new FileOutputStream(contributorsFile); DataOutputStream outputContributors = new DataOutputStream(new BufferedOutputStream(fosContributors)); Collection<?> entries = contributors.values(); outputContributors.writeInt(entries.size()); for (Object entry : entries) { RegistryContributor contributor = (RegistryContributor) entry; writeStringOrNull(contributor.getActualId(), outputContributors); writeStringOrNull(contributor.getActualName(), outputContributors); writeStringOrNull(contributor.getId(), outputContributors); writeStringOrNull(contributor.getName(), outputContributors); } outputContributors.flush(); fosContributors.getFD().sync(); outputContributors.close(); }
Source:
<code>public TerminalSession createTerminalSession(TtyConnector ttyConnector) { setTtyConnector(ttyConnector); new TtyConnectorWaitFor(ttyConnector, Executors.newSingleThreadExecutor()).setTerminationCallback(x -> { for (TerminalWidgetListener listener : myListeners) { <START> listener.allSessionsClosed(this); <END> } return true; }); return this; }</code><technical_language>invoke allSessionClosed is session is closed</technical_language>

Target:
public TerminalSession createTerminalSession(TtyConnector ttyConnector) { setTtyConnector(ttyConnector); return this; }
Source:
<code>public void testAddAlreadyExistingKey() throws Exception { new Context() {{ runTest( () -> { leaderCallbackGrantLeadership(); final KubernetesStateHandleStore<Long> store = new KubernetesStateHandleStore<>( flinkKubeClient, LEADER_CONFIGMAP_NAME, longStateStorage, filter, LOCK_IDENTITY); store.add(key, state); try { store.add(key, state); fail("Exception should be thrown."); } catch (StateHandleStore.AlreadyExistException ex) { final String msg = String.format( "%s already exists in ConfigMap %s", key, LEADER_CONFIGMAP_NAME); <START> assertThat(ex.getMessage(), containsString(msg)); <END> } assertThat(longStateStorage.getStateHandles().size(), is(2)); assertThat(longStateStorage.getStateHandles().get(1).getNumberOfDiscardCalls(), is(1)); }); }}; }</code><technical_language>FlinkMatchers.containsMessage</technical_language>

Target:
public void testAddAlreadyExistingKey() throws Exception { new Context() {{ runTest( () -> { leaderCallbackGrantLeadership(); getLeaderConfigMap().getData().put(key, "existing data"); final KubernetesStateHandleStore<Long> store = new KubernetesStateHandleStore<>( flinkKubeClient, LEADER_CONFIGMAP_NAME, longStateStorage, filter, LOCK_IDENTITY); try { store.addAndLock(key, state); fail("Exception should be thrown."); } catch (StateHandleStore.AlreadyExistException ex) { final String msg = String.format( "%s already exists in ConfigMap %s", key, LEADER_CONFIGMAP_NAME); assertThat(ex, FlinkMatchers.containsMessage(msg)); } assertThat(longStateStorage.getStateHandles().size(), is(1)); assertThat(longStateStorage.getStateHandles().get(0).getNumberOfDiscardCalls(), is(1)); }); }}; }
Source:
<code>public void processPlotLevelData(final AdvancingSource source, final MeasurementRow row) { if (source.getStudyType().equals(StudyType.T) && StringUtils.isBlank(source.getSeason()) && source.getTrailInstanceObservation() != null && source.getTrailInstanceObservation().getDataList() != null) { final Map<Integer, String> measurementVariablesValues = new HashMap<Integer, String>(); for (final MeasurementData measurementData : source.getTrailInstanceObservation().getDataList()) { if (StringUtils.isNotBlank(measurementData.getValue())) { final int termId = measurementData.getMeasurementVariable().getTermId(); final List<ValueReference> possibleValues = measurementData.getMeasurementVariable().getPossibleValues(); <START> if(termId == TermId.SEASON_VAR.getId() && StringUtils.isNumeric(measurementData.getValue()) && !possibleValues.isEmpty()){ <END> String seasonVarValue = this.getSeasonVarValue(measurementData.getValue(), possibleValues); measurementVariablesValues.put(termId, seasonVarValue); } else { measurementVariablesValues.put(termId, measurementData.getValue()); } } } source.setSeason(this.getValueOfPrioritySeasonVariable(measurementVariablesValues)); } }</code><technical_language>Is chances possibleValues null ? need safeguard avoid NPE</technical_language>

Target:
public void processPlotLevelData(final AdvancingSource source, final MeasurementRow row) { if (source.getStudyType().equals(StudyType.T) && StringUtils.isBlank(source.getSeason()) && source.getTrailInstanceObservation() != null && source.getTrailInstanceObservation().getDataList() != null) { final Map<Integer, String> measurementVariablesValues = new HashMap<Integer, String>(); for (final MeasurementData measurementData : source.getTrailInstanceObservation().getDataList()) { final int termId = measurementData.getMeasurementVariable().getTermId(); final List<ValueReference> possibleValues = measurementData.getMeasurementVariable().getPossibleValues(); this.addValueToMeasurementVariablesValues(measurementData.getValue(), possibleValues, termId, measurementVariablesValues); } source.setSeason(this.getValueOfPrioritySeasonVariable(measurementVariablesValues)); } }
Source:
<code>private static boolean isBinaryFile(String fullPath) { byte[] firstBytes = new byte[8]; try (FileInputStream input = new FileInputStream(fullPath)) { input.read(firstBytes); } catch (IOException e) { Activator.getDefault().logError("Cannot read the file <START> "+fullPath+" ", e); <END> } for (byte[] header : BINARY_HEADERS) { if (firstBytes.length >= header.length && startsWith(header, firstBytes)) { return true; } } return false; }</code><technical_language>remove space end of string</technical_language>

Target:
private static boolean isBinaryFile(String fullPath) { byte[] firstBytes = new byte[8]; try (FileInputStream input = new FileInputStream(fullPath)) { input.read(firstBytes); } catch (IOException e) { Activator.getDefault().logError("Cannot read the file"+fullPath, e); } for (byte[] header : BINARY_HEADERS) { if (firstBytes.length >= header.length && startsWith(header, firstBytes)) { return true; } } return false; }
Source:
<code>long getDifference(Offset o1, Offset o2) { if (!segmentsByName.containsKey(o1.getName()) || !segmentsByName.containsKey(o2.getName())) { throw new IllegalArgumentException("One of the log segments provided [" + o1.getName() + ", " + o2.getName() + "] does not belong to this log"); } <START> LogSegment firstSegment = segmentsByName.get(o1.getName()); <END> LogSegment secondSegment = segmentsByName.get(o2.getName()); if (o1.getOffset() > firstSegment.getEndOffset() || o2.getOffset() > secondSegment.getEndOffset()) { throw new IllegalArgumentException("One of the offsets provided [" + o1.getOffset() + ", " + o2.getOffset() + "] is out of range of the segment it refers to [" + firstSegment.getEndOffset() + ", " + secondSegment.getEndOffset() + "]"); } if (o1.getName().equals(o2.getName())) { return o1.getOffset() - o2.getOffset(); } Offset higher = o1.compareTo(o2) > 0 ? o1 : o2; Offset lower = higher == o1 ? o2 : o1; LogSegment segment = segmentsByName.higherEntry(lower.getName()).getValue(); long difference = segment.getCapacityInBytes() - lower.getOffset(); while (!segment.getName().equals(higher.getName())) { difference += segment.getCapacityInBytes(); segment = segmentsByName.higherEntry(segment.getName()).getValue(); } difference += higher.getOffset(); return o1.compareTo(o2) * difference; }</code><technical_language>minor suggestion. simplify lines 205 210. java LogSegment firstSegment = segmentsByName.get(o1.getName()); LogSegment secondSegment = segmentsByName.get(o2.getName()); if (firstSegment != null || secondSegment != null) { throw new IllegalArgumentException("One of log segments provided [" + o1.getName() + ", " + o2.getName() + "] belong this log"); }</technical_language>

Target:
long getDifference(Offset o1, Offset o2) { LogSegment firstSegment = segmentsByName.get(o1.getName()); LogSegment secondSegment = segmentsByName.get(o2.getName()); if (firstSegment == null || secondSegment == null) { throw new IllegalArgumentException( "One of the log segments provided [" + o1.getName() + ", " + o2.getName() + "] does not belong to this log"); } if (o1.getOffset() > firstSegment.getCapacityInBytes() || o2.getOffset() > secondSegment.getCapacityInBytes()) { throw new IllegalArgumentException("One of the offsets provided [" + o1.getOffset() + ", " + o2.getOffset() + "] is out of range of the segment it refers to [" + firstSegment.getCapacityInBytes() + ", " + secondSegment .getCapacityInBytes() + "]"); } if (o1.getName().equals(o2.getName())) { return o1.getOffset() - o2.getOffset(); } Offset higher = o1.compareTo(o2) > 0 ? o1 : o2; Offset lower = higher == o1 ? o2 : o1; int interveningSegmentsCount = segmentsByName.subMap(lower.getName(), false, higher.getName(), false).size(); long segmentCapacity = firstSegment.getCapacityInBytes(); long difference = segmentCapacity - lower.getOffset() + segmentCapacity * interveningSegmentsCount + higher.getOffset(); return o1.compareTo(o2) * difference; }
Source:
<code>public boolean StorageDomainRemoved(storage_domain_static storageDomain) { storage_server_connections connection = DbFacade.getInstance().getStorageServerConnectionDAO().get(storageDomain.getstorage()); <START> <END> if (connection != null) DbFacade.getInstance().getStorageServerConnectionDAO().remove(connection.getid()); return true; }</code><technical_language>Please add {}</technical_language>

Target:
public boolean StorageDomainRemoved(storage_domain_static storageDomain) { storage_server_connections connection = DbFacade.getInstance().getStorageServerConnectionDAO().get(storageDomain.getstorage()); if (connection != null) { DbFacade.getInstance().getStorageServerConnectionDAO().remove(connection.getid()); } return true; }