auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testCreateAndDeleteKeyPairWithPublicKey() throws Exception { for (String zoneId : api.getConfiguredZones()) { KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get(); KeyPair keyPair = null; try { keyPair = keyPairApi.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY); assertNotNull(keyPair); } finally { if (keyPair != null) { <START> keyPairApi.delete(KEYPAIR_NAME); <END> } } } }</code><technical_language>Ah, interesting...delete fail if a key KEYPAIR_NAME exist</technical_language>

Target:
public void testCreateAndDeleteKeyPairWithPublicKey() throws Exception { for (String zoneId : api.getConfiguredZones()) { KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get(); KeyPair createdKeyPair = null; try { createdKeyPair = keyPairApi.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY); assertNotNull(createdKeyPair); KeyPair keyPair = keyPairApi.get(KEYPAIR_NAME); assertEquals(keyPair.getName(), createdKeyPair.getName()); assertEquals(keyPair.getFingerprint(), createdKeyPair.getFingerprint()); assertEquals(keyPair.getPublicKey(), createdKeyPair.getPublicKey()); } finally { if (createdKeyPair != null) { keyPairApi.delete(KEYPAIR_NAME); } } } }
Source:
<code>protected void executeCommand() { StoragePoolIsoMap map = loadStoragePoolIsoMap(); changeDomainStatusWithCompensation(map, StorageDomainStatus.Unknown, StorageDomainStatus.Locked, getCompensationContext()); if (shouldPerformOvfUpdate()) { ActionReturnValue returnValue = runInternalAction(ActionType.UpdateOvfStoreForStorageDomain, createUpdateOvfStoreParams(), cloneContext().withoutCompensationContext()); if (!returnValue.getSucceeded()) { <START> getReturnValue().getValidationMessages().addAll(returnValue.getValidationMessages()); getReturnValue().getExecuteFailedMessages().addAll(returnValue.getExecuteFailedMessages()); <END> return; } } if (noAsyncOperations()) { executeDeactivateCommand(); } setSucceeded(true); }</code><technical_language>Try call propagateFailure(returnValue) instead</technical_language>

Target:
protected void executeCommand() { StoragePoolIsoMap map = loadStoragePoolIsoMap(); changeDomainStatusWithCompensation(map, StorageDomainStatus.Unknown, StorageDomainStatus.Locked, getCompensationContext()); if (shouldPerformOvfUpdate()) { ActionReturnValue returnValue = runInternalAction(ActionType.UpdateOvfStoreForStorageDomain, createUpdateOvfStoreParams(), cloneContext().withoutCompensationContext()); if (!returnValue.getSucceeded()) { propagateFailure(returnValue); return; } } if (noAsyncOperations()) { executeDeactivateCommand(); } setSucceeded(true); }
Source:
<code>protected final boolean tryFailureInternal(Throwable cause) { boolean done = super.tryFailure(cause); <START> return clearTaskAfterCompletion(done, FAILED); <END> }</code><technical_language>nit: lines merged</technical_language>

Target:
protected final boolean tryFailureInternal(Throwable cause) { return clearTaskAfterCompletion(super.tryFailure(cause), FAILED); }
Source:
<code>public static Properties getDefaultConfigFromProps(String fileName) { Properties config = new Properties(); <START> InputStream in = null; <END> try { in = Config.class.getClassLoader().getResourceAsStream(fileName); } catch (Exception e) { logger.info(e.getMessage()); } finally { try { config.load(in); if(in != null){ in.close(); } } catch (IOException ioe) { logger.error(ioe.getMessage(), ioe); } } if(config.get(BOOTSTRAP_SERVERS_KEY)== null){ config.put(BOOTSTRAP_SERVERS_KEY, getBootStrapServers()); } return config; }</code><technical_language>try resources this: try (InputStream in = Config.class.getClassLoader().getResourceAsStream(fileName)) { config.load(in); }</technical_language>

Target:
public static Properties getDefaultConfigFromProps(String fileName) { Properties config = new Properties(); try (InputStream in = Config.class.getClassLoader().getResourceAsStream(fileName);) { config.load(in); } catch (Exception ex) { logger.error(ex.getMessage(), ex); } config.put(BOOTSTRAP_SERVERS_KEY, config.getOrDefault(BOOTSTRAP_SERVERS_KEY, getBootStrapServers())); return config; }
Source:
<code>public String generateFullPath(OperationModel operationModel) { String queryString = "?"; if (operationModel.getOperation().getParameters() != null) for (Parameter parameter : operationModel.getOperation().getParameters()) { if (parameter == null) { continue; } String parameterType = parameter.getIn(); <START> String value = dataGenerator.generate(parameter.getName(), parameter); <END> if ("query".equals(parameterType)) { queryString += parameter.getName() + "=" + value + "&"; } else if ("path".equals(parameterType)) { String newPath = operationModel .getPath() .replace("{" + parameter.getName() + "}", value); operationModel.setPath(newPath); } } return operationModel.getPath() + queryString.substring(0, queryString.length() - 1); }</code><technical_language>suggest reverting this, avoids generating a needed (header parameters)</technical_language>

Target:
public String generateFullPath(OperationModel operationModel) { String queryString = "?"; if (operationModel.getOperation().getParameters() != null) for (Parameter parameter : operationModel.getOperation().getParameters()) { if (parameter == null) { continue; } String parameterType = parameter.getIn(); if ("query".equals(parameterType)) { String value = dataGenerator.generate(parameter.getName(), parameter); queryString += parameter.getName() + "=" + value + "&"; } else if ("path".equals(parameterType)) { String value = dataGenerator.generate(parameter.getName(), parameter); String newPath = operationModel .getPath() .replace("{" + parameter.getName() + "}", value); operationModel.setPath(newPath); } } return operationModel.getPath() + queryString.substring(0, queryString.length() - 1); }
Source:
<code>private void loadPropertiesFile() { String filePath = System.getProperty(FILE_PROPERTY_PATH); if ( null == filePath || filePath.isEmpty()) { throw new ResolverException(FILE_PROPERTY_PATH + " is empty or null"); } if (("default").equals(filePath)) { filePath = System.getProperty(CONF_LOCATION) + File.separator + "file.properties"; } File file = new File(filePath); boolean isFileExists = file.exists(); if (isFileExists) { try (InputStream in = new FileInputStream(filePath)) { Properties rawProps = new Properties(); propertyMap = new HashMap(); rawProps.load(in); for (Map.Entry<Object, Object> propertyEntry : rawProps.entrySet()) { String strValue = (String) propertyEntry.getValue(); propertyMap.put(propertyEntry.getKey(), strValue); } if (LOG.isDebugEnabled()) { LOG.debug("Loaded factory properties from " + filePath + ": " + propertyMap); } } catch (IOException ex) { throw new ResolverException("Failed to read " + filePath, ex); } } else { <START> throw new ResolverException(filePath + " file cannot found in " + filePath); <END> } }</code><technical_language>redundant filePath beginning message</technical_language>

Target:
private void loadPropertiesFile() { String filePath = System.getProperty(FILE_PROPERTY_PATH); if ( null == filePath || filePath.isEmpty()) { throw new ResolverException(FILE_PROPERTY_PATH + " is empty or null"); } if (("default").equals(filePath)) { filePath = System.getProperty(CONF_LOCATION) + File.separator + "file.properties"; } File file = new File(filePath); boolean isFileExists = file.exists(); if (isFileExists) { try (InputStream in = new FileInputStream(filePath)) { Properties rawProps = new Properties(); propertyMap = new HashMap(); rawProps.load(in); for (Map.Entry<Object, Object> propertyEntry : rawProps.entrySet()) { String strValue = (String) propertyEntry.getValue(); propertyMap.put(propertyEntry.getKey(), strValue); } if (LOG.isDebugEnabled()) { LOG.debug("Loaded factory properties from " + filePath + ": " + propertyMap); } } catch (IOException ex) { throw new ResolverException("Failed to read " + filePath, ex); } } else { throw new ResolverException("File cannot found in " + filePath); } }
Source:
<code>Stream<SequencedRecordedMessage<M, R>> getTrackedValues() { Stream<SequencedRecordedMessage<M, R>> base = Stream.empty(); <START> for (Entry<ClientSourceId, TrackerImpl<M, R>> t : objectTrackers.entrySet()) { <END> base = Stream.concat(base, t.getValue().getTrackedValues().stream().map(e->convert(t.getKey(), e))); } return base; }</code><technical_language>This changed to: java return objectTrackers.entrySet().stream().flatMap(t -> t.getValue().getTrackedValues().stream().map(e -> convert(t.getKey(), e)));</technical_language>

Target:
Stream<SequencedRecordedMessage<M, R>> getTrackedValues() { return objectTrackers.entrySet().stream().flatMap(t->t.getValue().getTrackedValues().stream().map(e->convert(t.getKey(), e))); }
Source:
<code>public void run() { Case currentCase; try { currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { <START> logger.log(Level.SEVERE, String.format("Failed to start AddImageTask, no current case"), ex); <END> return; } progressMonitor.setIndeterminate(true); progressMonitor.setProgress(0); String imageWriterPath = ""; if (imageDetails.imageWriterSettings != null) { imageWriterPath = imageDetails.imageWriterSettings.getPath(); } List<String> errorMessages = new ArrayList<>(); List<Content> newDataSources = new ArrayList<>(); try { synchronized (tskAddImageProcessLock) { if (!tskAddImageProcessStopped) { tskAddImageProcess = currentCase.getSleuthkitCase().makeAddImageProcess(imageDetails.timeZone, true, imageDetails.ignoreFatOrphanFiles, imageWriterPath); } else { return; } } Thread progressUpdateThread = new Thread(new ProgressUpdater(progressMonitor, tskAddImageProcess)); progressUpdateThread.start(); runAddImageProcess(errorMessages); progressUpdateThread.interrupt(); commitOrRevertAddImageProcess(currentCase, errorMessages, newDataSources); progressMonitor.setProgress(100); } finally { DataSourceProcessorCallback.DataSourceProcessorResult result; if (criticalErrorOccurred) { result = DataSourceProcessorResult.CRITICAL_ERRORS; } else if (!errorMessages.isEmpty()) { result = DataSourceProcessorResult.NONCRITICAL_ERRORS; } else { result = DataSourceProcessorResult.NO_ERRORS; } addImageTaskCallback.onCompleted(result, errorMessages, newDataSources); } }</code><technical_language>More info in message, please</technical_language>

Target:
public void run() { Case currentCase; try { currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, String.format("Failed to start AddImageTask for %s, no current case", imageDetails.getImagePath()), ex); return; } progressMonitor.setIndeterminate(true); progressMonitor.setProgress(0); String imageWriterPath = ""; if (imageDetails.imageWriterSettings != null) { imageWriterPath = imageDetails.imageWriterSettings.getPath(); } List<String> errorMessages = new ArrayList<>(); List<Content> newDataSources = new ArrayList<>(); try { synchronized (tskAddImageProcessLock) { if (!tskAddImageProcessStopped) { tskAddImageProcess = currentCase.getSleuthkitCase().makeAddImageProcess(imageDetails.timeZone, true, imageDetails.ignoreFatOrphanFiles, imageWriterPath); } else { return; } } Thread progressUpdateThread = new Thread(new ProgressUpdater(progressMonitor, tskAddImageProcess)); progressUpdateThread.start(); runAddImageProcess(errorMessages); progressUpdateThread.interrupt(); finishAddImageProcess(errorMessages, newDataSources); progressMonitor.setProgress(100); } finally { DataSourceProcessorCallback.DataSourceProcessorResult result; if (criticalErrorOccurred) { result = DataSourceProcessorResult.CRITICAL_ERRORS; } else if (!errorMessages.isEmpty()) { result = DataSourceProcessorResult.NONCRITICAL_ERRORS; } else { result = DataSourceProcessorResult.NO_ERRORS; } addImageTaskCallback.onCompleted(result, errorMessages, newDataSources); } }
Source:
<code>public JSONWebKeySet getKeysFromStorage() { ExpiredObject expiredObject = persistenceService.getExpiredObject(ExpiredObjectType.JWKS.getValue()); <START> if (expiredObject != null && !Strings.isNullOrEmpty(expiredObject.getValue())) { <END> JSONObject keys = new JSONObject(expiredObject.getValue()); return JSONWebKeySet.fromJSONObject(keys); } return null; }</code><technical_language>returning keys check expired. if expired remove storage</technical_language>

Target:
public JSONWebKeySet getKeysFromStorage() { ExpiredObject expiredObject = persistenceService.getExpiredObject(ExpiredObjectType.JWKS.getValue()); if (expiredObject == null || Strings.isNullOrEmpty(expiredObject.getValue())) { return null; } JSONObject keysInJson = new JSONObject(expiredObject.getValue()); JSONWebKeySet keys = JSONWebKeySet.fromJSONObject(keysInJson); try { if (hasKeysExpired(expiredObject)) { LOG.trace("The keys in storage got expired. Deleting the expired keys from storage."); deleteKeysFromStorage(); return null; } } catch (Exception e) { LOG.error("Error in reading expiry date or deleting expired keys from storage. Trying to delete the keys from storage.", e); deleteKeysFromStorage(); return null; } return keys; }
Source:
<code>public LogicalPlanner(Functions functions, TableStats tableStats, Supplier<Version> minNodeVersionInCluster) { this.optimizer = new Optimizer( List.of( new RemoveRedundantFetchOrEval(), new MergeAggregateAndCollectToCount(), new MergeFilters(), new MoveFilterBeneathBoundary(), new MoveFilterBeneathFetchOrEval(), new MoveFilterBeneathOrder(), new MoveFilterBeneathProjectSet(), new MoveFilterBeneathHashJoin(), new MoveFilterBeneathNestedLoop(), new MoveFilterBeneathUnion(), new MoveFilterBeneathGroupBy(), new MoveFilterBeneathWindowAgg(), new MergeFilterAndCollect(), new RewriteFilterOnOuterJoinToInnerJoin(functions), new MoveOrderBeneathUnion(), new MoveOrderBeneathNestedLoop(), new MoveOrderBeneathBoundary(), new MoveOrderBeneathFetchOrEval(), new DeduplicateOrder(), new RewriteCollectToGet(functions), new RewriteGroupByKeysLimitToTopNDistinct() ), minNodeVersionInCluster ); this.writeOptimizer = new Optimizer( <START> List.of(new RewriteInsertToInsertFromValues()), <END> minNodeVersionInCluster ); this.tableStats = tableStats; this.functions = functions; this.relationNormalizer = new RelationNormalizer(functions); }</code><technical_language>this renaming</technical_language>

Target:
public LogicalPlanner(Functions functions, TableStats tableStats, Supplier<Version> minNodeVersionInCluster) { this.optimizer = new Optimizer( List.of( new RemoveRedundantFetchOrEval(), new MergeAggregateAndCollectToCount(), new MergeFilters(), new MoveFilterBeneathBoundary(), new MoveFilterBeneathFetchOrEval(), new MoveFilterBeneathOrder(), new MoveFilterBeneathProjectSet(), new MoveFilterBeneathHashJoin(), new MoveFilterBeneathNestedLoop(), new MoveFilterBeneathUnion(), new MoveFilterBeneathGroupBy(), new MoveFilterBeneathWindowAgg(), new MergeFilterAndCollect(), new RewriteFilterOnOuterJoinToInnerJoin(functions), new MoveOrderBeneathUnion(), new MoveOrderBeneathNestedLoop(), new MoveOrderBeneathBoundary(), new MoveOrderBeneathFetchOrEval(), new DeduplicateOrder(), new RewriteCollectToGet(functions), new RewriteGroupByKeysLimitToTopNDistinct() ), minNodeVersionInCluster ); this.writeOptimizer = new Optimizer( List.of(new RewriteInsertFromSubQueryToInsertFromValues()), minNodeVersionInCluster ); this.tableStats = tableStats; this.functions = functions; this.relationNormalizer = new RelationNormalizer(functions); }
Source:
<code>private static void setDropdown(Combo comboBox, INamedElement el, List<String> names) { comboBox.removeAll(); <START> for (String name : names) { comboBox.add(name); } <END> comboBox.select((null == el) ? names.size() - 1 : comboBox.indexOf(el.getName())); }</code><technical_language>names.forEach( name -> comboBox.add(name)); more concise</technical_language>

Target:
private static void setDropdown(Combo comboBox, INamedElement el, List<String> names) { comboBox.removeAll(); names.forEach(comboBox::add); comboBox.select((null == el) ? names.size() - 1 : comboBox.indexOf(el.getName())); }
Source:
<code>@Override public void add(T entry) throws IOException { converter.toStream(entry, buffer); long size = buffer.size(); <START> queueFile.add(buffer.readByteArray(), 0, (int) size); <END> }</code><technical_language>call readByteArray() array length for size</technical_language>

Target:
@Override public void add(T entry) throws IOException { Buffer buffer = new Buffer(); converter.toStream(entry, buffer); byte[] data = buffer.readByteArray(); queueFile.add(data, 0, data.length); }
Source:
<code>void check(Data p) { <START> Data y = p; END> }</code><technical_language>Is type of left-hand side important? add another method Object check2(Data p) { return p; } I guess give a unique.leaked error</technical_language>

Target:
void check(Data p) { Data y = p; Object z = p; }
Source:
<code>public void deleteProjectData(@PathParam("project") String projectName) throws HistoryException { Project project = env.getProjects().get(projectName); if (project == null) { throw new IllegalStateException("cannot get project \"" + projectName + "\""); } project.setIndexed(false); List<RepositoryInfo> repos = env.getProjectRepositoriesMap().get(project); logger.log(Level.INFO, "deleting data for project {0}", projectName); for (String dirName: new String[]{IndexDatabase.INDEX_DIR, IndexDatabase.XREF_DIR}) { java.nio.file.Path path = Paths.get(env.getDataRootPath(), dirName, projectName); try { IOUtils.removeRecursive(path); } catch (IOException e) { logger.log(Level.WARNING, "Could not delete {0}", path.toString()); } } HistoryGuru guru = HistoryGuru.getInstance(); guru.removeCache(repos.stream(). map(x -> { try { return env.getPathRelativeToSourceRoot(new File((x).getDirectoryName())); } catch (ForbiddenSymlinkException e) { logger.log(Level.FINER, e.getMessage()); return ""; } catch (IOException e) { logger.log(Level.INFO, "cannot remove files for repository {0}", x.getDirectoryName()); return ""; } <START> }).collect(Collectors.toSet())); <END> suggester.delete(projectName); }</code><technical_language>filter ensure "" wont further? asking for troubles in future</technical_language>

Target:
public void deleteProjectData(@PathParam("project") String projectName) throws HistoryException { Project project = disableProject(projectName); logger.log(Level.INFO, "deleting data for project {0}", projectName); List<RepositoryInfo> repos = env.getProjectRepositoriesMap().get(project); for (String dirName: new String[]{IndexDatabase.INDEX_DIR, IndexDatabase.XREF_DIR}) { java.nio.file.Path path = Paths.get(env.getDataRootPath(), dirName, projectName); try { IOUtils.removeRecursive(path); } catch (IOException e) { logger.log(Level.WARNING, "Could not delete {0}", path.toString()); } } deleteHistoryCache(projectName); suggester.delete(projectName); }
Source:
<code>private void isAreaLoadedInject(int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, boolean allowEmpty, @Nonnull CallbackInfoReturnable<Boolean> cbi) { if (!this.isCubicWorld()) { return; } boolean ret = (this.isRemote() && allowEmpty) || this.testForCubes( xStart, yStart, zStart, xEnd, yEnd, zEnd, <START> this::testNotNull); <END> cbi.cancel(); cbi.setReturnValue(ret); }</code><technical_language>why</technical_language>

Target:
private void isAreaLoadedInject(int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, boolean allowEmpty, @Nonnull CallbackInfoReturnable<Boolean> cbi) { if (!this.isCubicWorld()) { return; } boolean ret = (this.isRemote() && allowEmpty) || this.testForCubes( xStart, yStart, zStart, xEnd, yEnd, zEnd, Objects::nonNull); cbi.cancel(); cbi.setReturnValue(ret); }
Source:
<code>public QuectelBG96(ModemDevice device, String platform, ConnectionFactory connectionFactory) { super(device, platform, connectionFactory); try { String atPort = getAtPort(); String gpsPort = getGpsPort(); if (atPort != null) { <START> if (atPort.equals(getDataPort()) || atPort.equals(gpsPort)) { <END> this.serialNumber = getSerialNumber(); this.imsi = getMobileSubscriberIdentity(); this.iccid = getIntegratedCirquitCardId(); this.model = getModel(); this.manufacturer = getManufacturer(); this.revisionId = getRevisionID(); this.gpsSupported = isGpsSupported(); this.rssi = getSignalStrength(); s_logger.trace("{} :: Serial Number={}", getClass().getName(), this.serialNumber); s_logger.trace("{} :: IMSI={}", getClass().getName(), this.imsi); s_logger.trace("{} :: ICCID={}", getClass().getName(), this.iccid); s_logger.trace("{} :: Model={}", getClass().getName(), this.model); s_logger.trace("{} :: Manufacturer={}", getClass().getName(), this.manufacturer); s_logger.trace("{} :: Revision ID={}", getClass().getName(), this.revisionId); s_logger.trace("{} :: GPS Supported={}", getClass().getName(), this.gpsSupported); s_logger.trace("{} :: RSSI={}", getClass().getName(), this.rssi); } } } catch (KuraException e) { e.printStackTrace(); } }</code><technical_language>this if merged previous other branches</technical_language>

Target:
public QuectelBG96(ModemDevice device, String platform, ConnectionFactory connectionFactory) { super(device, platform, connectionFactory); try { String atPort = getAtPort(); String gpsPort = getGpsPort(); if (atPort != null) { if (atPort.equals(getDataPort()) || atPort.equals(gpsPort)) { this.serialNumber = getSerialNumber(); this.imsi = getMobileSubscriberIdentity(); this.iccid = getIntegratedCirquitCardId(); this.model = getModel(); this.manufacturer = getManufacturer(); this.revisionId = getRevisionID(); this.gpsSupported = isGpsSupported(); this.rssi = getSignalStrength(); logger.trace("{} :: Serial Number={}", getClass().getName(), this.serialNumber); logger.trace("{} :: IMSI={}", getClass().getName(), this.imsi); logger.trace("{} :: ICCID={}", getClass().getName(), this.iccid); logger.trace("{} :: Model={}", getClass().getName(), this.model); logger.trace("{} :: Manufacturer={}", getClass().getName(), this.manufacturer); logger.trace("{} :: Revision ID={}", getClass().getName(), this.revisionId); logger.trace("{} :: GPS Supported={}", getClass().getName(), this.gpsSupported); logger.trace("{} :: RSSI={}", getClass().getName(), this.rssi); } } } catch (KuraException e) { e.printStackTrace(); } }
Source:
<code>public void earlyStartup() { try { <START> new UsageReport().report(); <END> } catch (Exception e) { new UsagePluginLogger(JBossToolsUsageActivator.getDefault()).error("could not start usage reporting"); } }</code><technical_language>this in a Display.getDefault().syncExec avoid blocking rest of UI</technical_language>

Target:
public void earlyStartup() { Display.getDefault().asyncExec(new Runnable() { public void run() { new UsageReport().report(); } }); }
Source:
<code><START> public void safeExecute(Shell shell) { <END> MultipleConfigsSelectionDialog dialog = new MultipleConfigsSelectionDialog(shell, "Delete Configurations", SERVER.configsInfo().getValue(), false, false); if (dialog.open() == Window.OK) { Map<String, Boolean> configNamesWithFlags = SERVER.configNamesWithFlags(); configService.uncheckedWrite((dialog.selectedConfigs())); boolean noError = true; try { if (!ManagerModeModel.getInstance().isInManagerMode()) { for (String item: dialog.selectedConfigs()) { if (configNamesWithFlags.get(item)) { noError = false; displayErrorDialog(shell); break; } } } if (noError) { for (String item : dialog.selectedConfigs()) { Configurations.getInstance().removeNameFromRecentlyLoadedConfigList(item); } } } catch (ManagerModePvNotConnectedException e) { MessageDialog error = new MessageDialog(shell, "Error", null, e.getMessage(), MessageDialog.ERROR, new String[] {"OK"},0); error.open(); } } }</code><technical_language>I misunderstanding this function. meant deleting configs simply removing loaded list</technical_language>

Target:
public void safeExecute(Shell shell) { Map<String, Boolean> configNamesWithFlags = SERVER.configNamesWithFlags(); MultipleConfigsSelectionDialog dialog = new MultipleConfigsSelectionDialog(shell, "Delete Configurations", SERVER.configsInfo().getValue(), configNamesWithFlags, false, false); if (dialog.open() == Window.OK) { try { configService.write(dialog.selectedConfigs()); boolean noError = true; if (!ManagerModeModel.getInstance().isInManagerMode()) { for (String item: dialog.selectedConfigs()) { if (configNamesWithFlags.get(item)) { noError = false; displayErrorDialog(shell); break; } } } if (noError) { for (String item : dialog.selectedConfigs()) { Configurations.getInstance().removeNameFromRecentlyLoadedConfigList(item); } } } catch (ManagerModePvNotConnectedException|IOException e) { MessageDialog error = new MessageDialog(shell, "Error", null, e.getMessage(), MessageDialog.ERROR, new String[] {"OK"}, 0); error.open(); } } }
Source:
<code>protected void actionPerformed(GuiButton button) { switch (button.id) { case 1: try { <START> Desktop.getDesktop().browse(new java.net.URI("<LINK_0>")); <END> } catch (Exception e) { System.err.print(e); } break; case 2: try { Desktop.getDesktop().browse(new java.net.URI("<LINK_1>")); } catch (Exception e) { System.err.print(e); } break; } }</code><technical_language>This needs GuiConfirmOpenLink, asks user if want url. java this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, "url", buttonID, false));</technical_language>

Target:
protected void actionPerformed(GuiButton button) { switch (button.id) { case 1: this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, "<LINK_0>", 1, false)); break; case 2: this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, "<LINK_1>", 2, false)); break; } }
Source:
<code>public PageHeaderWithOffset(PageHeader pageHeader, long offset) { this.pageHeader = pageHeader; this.offset = offset; this.headerByteSize = -1; <START> } <END></code><technical_language>this is used. headerByteSize</technical_language>

Target:
public PageHeaderWithOffset(PageHeader pageHeader, long offset) { this.pageHeader = pageHeader; this.offset = offset; }
Source:
<code>public SearchStudentsTable(String courseId, List<StudentListSectionData> sections) { this.courseId = courseId; this.sections = sections; if (sections.size() == 1) { StudentListSectionData section = sections.get(0); if (section.getSectionName().equals("None")) { this.hasSection = false; } else { this.hasSection = true; <START> } <END> } else { this.hasSection = true; } }</code><technical_language>For if else statement above, collapse if (!section.getSectionName().equals("None")) { this.hasSection = true; }</technical_language>

Target:
public SearchStudentsTable(String courseId, List<StudentListSectionData> sections) { this.courseId = courseId; this.sections = sections; if (sections.size() == 1) { StudentListSectionData section = sections.get(0); this.hasSection = !section.getSectionName().equals("None"); } else { this.hasSection = true; } }
Source:
<code>private LoadHolder isCurrentServerMostLoaded(ServerLocation currentServer, <START> Map<ServerLocationAndMemberId, LoadHolder> groupServers) { <END> LoadHolder currentLH = null; for (ServerLocationAndMemberId locationAndMemberId : groupServers.keySet()) { if (currentServer.equals(locationAndMemberId.getServerLocation())) { currentLH = groupServers.get(locationAndMemberId); break; } } if (currentLH == null) return null; final float currentLoad = currentLH.getLoad(); for (Map.Entry<ServerLocationAndMemberId, LoadHolder> loadEntry : groupServers.entrySet()) { ServerLocation location = loadEntry.getKey().getServerLocation(); if (location.equals(currentServer)) { continue; } LoadHolder nextLoadReference = loadEntry.getValue(); float nextLoad = nextLoadReference.getLoad(); if (nextLoad > currentLoad) { return null; } } return currentLH; }</code><technical_language>a new method significantly changed, be, leat, unit tested. package private, annotate @VisibleForTesting access LocatorLoadSnapshotJUnitTest and/or LocatorLoadSnapshotIntegrationTest</technical_language>

Target:
LoadHolder isCurrentServerMostLoaded(ServerLocation currentServer, Map<ServerLocationAndMemberId, LoadHolder> groupServers) { LoadHolder currentLH = null; for (ServerLocationAndMemberId locationAndMemberId : groupServers.keySet()) { if (currentServer.equals(locationAndMemberId.getServerLocation())) { currentLH = groupServers.get(locationAndMemberId); break; } } if (currentLH == null) return null; final float currentLoad = currentLH.getLoad(); for (Map.Entry<ServerLocationAndMemberId, LoadHolder> loadEntry : groupServers.entrySet()) { ServerLocation location = loadEntry.getKey().getServerLocation(); if (location.equals(currentServer)) { continue; } LoadHolder nextLoadReference = loadEntry.getValue(); float nextLoad = nextLoadReference.getLoad(); if (nextLoad > currentLoad) { return null; } } return currentLH; }
Source:
<code>public void start(String serverRepositoryDir, String runtimeRepositoryDir) throws DeploymentEngineException { serverRepositoryDirectory = new File(serverRepositoryDir); runtimeRepositoryDirectory = new File(runtimeRepositoryDir); if (!serverRepositoryDirectory.exists()) { throw new DeploymentEngineException("Cannot find repository : " + serverRepositoryDirectory); } if (!runtimeRepositoryDirectory.exists()) { throw new DeploymentEngineException("Cannot find repository : " + runtimeRepositoryDirectory); } <START> logger.debug("Starting carbon deployment engine for repository : " + serverRepositoryDir); <END> repositoryScanner.scan(); startScheduler(); }</code><technical_language>check if debug enabled, bypass redundant string concat if debug is enabled</technical_language>

Target:
public void start(String serverRepositoryDir, String runtimeRepositoryDir) throws DeploymentEngineException { serverRepositoryDirectory = new File(serverRepositoryDir); runtimeRepositoryDirectory = new File(runtimeRepositoryDir); if (!serverRepositoryDirectory.exists()) { throw new DeploymentEngineException("Cannot find repository : " + serverRepositoryDirectory); } if (!runtimeRepositoryDirectory.exists()) { throw new DeploymentEngineException("Cannot find repository : " + runtimeRepositoryDirectory); } if (logger.isDebugEnabled()) { logger.debug("Starting carbon deployment engine for repository : " + serverRepositoryDir); } repositoryScanner.scan(); startScheduler(); }
Source:
<code>public static <A> Equal<A> anyEqual() { <START> return new Equal<A>(a1 -> a2 -> a1.equals(a2)); <END> }</code><technical_language>try this myself, I Equal.equal(a1 -> a2 -> a1.equals(a2)); advantage of type inference. This applies in lots of case type parameter more complex</technical_language>

Target:
public static <A> Equal<A> anyEqual() { return equal(a1 -> a2 -> a1.equals(a2)); }
Source:
<code>public ArticleComment waitForVideo() { <START> driver.switchTo().frame(1); <END> wait.forElementVisible(By.cssSelector("img")); return this; }</code><technical_language>frame "1" a WebElement variable in method? more clear frame test is switching</technical_language>

Target:
public ArticleComment waitForVideo() { driver.switchTo().frame(commentIFrame); wait.forElementVisible(By.cssSelector("img")); return this; }
Source:
<code>public void setClientPortListenBacklog(int backlog) { <START> LOG.info("clientPortListenBacklog set to " + backlog); <END> this.listenBacklog = backlog; }</code><technical_language>nit: I do action first, log fact happened</technical_language>

Target:
public void setClientPortListenBacklog(int backlog) { this.listenBacklog = backlog; LOG.info("clientPortListenBacklog set to " + backlog); }
Source:
<code>public static boolean matchesPartially(final MbusChannelElementsDto mbusChannelElements, final ChannelElementValuesDto channelElementValues) { <START> final boolean validateMbusDeviceInfoMatch = !(failPartialMatchOnMbusIdentificationNumber(mbusChannelElements, <END> channelElementValues) || failPartialMatchOnMbusManufacturerIdentification(mbusChannelElements, channelElementValues) || failPartialMatchOnMbusVersion(mbusChannelElements, channelElementValues) || failPartialMatchOnMbusDeviceTypeIdentification(mbusChannelElements, channelElementValues)); return channelElementValues.isMbusSlaveDeviceConfigured() && validateMbusDeviceInfoMatch; }</code><technical_language>Again, extract assigning of this boolean method. if reusable methods, reduce a bit of code duplication in file well. (there's another boolean called validateMbusDeviceInfoMatch, method?)</technical_language>

Target:
public static boolean matchesPartially(final MbusChannelElementsDto mbusChannelElements, final ChannelElementValuesDto channelElementValues) { return channelElementValues.isMbusSlaveDeviceConfigured() && validateMbusDeviceInfoPartialMatch(mbusChannelElements, channelElementValues); }
Source:
<code>public static void afterClass() throws CommandFailedException, IOException, TimeoutException, InterruptedException { try { administration.reloadIfRequired(); <START> administration.restartIfRequired(); <END> } finally { client.close(); } }</code><technical_language>Is restart necessary here? Try run tests fresh instance of server check if restart-required state is set</technical_language>

Target:
public static void afterClass() throws CommandFailedException, IOException, TimeoutException, InterruptedException { try { administration.reloadIfRequired(); } finally { client.close(); } }
Source:
<code>public String getId() { <START> return email + "::" + course; <END> }</code><technical_language>change this, is compatible</technical_language>

Target:
public String getId() { return email + "%" + course; }
Source:
<code>private static void executeDiffTask(DiffStrategy strategy, TableReference plusTable, TableReference minusTable, DiffStats stats, DiffTask task, MutableRange range) throws InterruptedException { final RangeRequest request = range.getRangeRequest(); long startTime = System.currentTimeMillis(); PartialDiffStats partialStats = task.call(request, range, strategy); stats.rowsOnlyInSource.addAndGet(partialStats.rowsOnlyInSource); stats.rowsPartiallyInCommon.addAndGet(partialStats.rowsPartiallyInCommon); stats.rowsCompletelyInCommon.addAndGet(partialStats.rowsCompletelyInCommon); stats.rowsVisited.addAndGet(partialStats.rowsVisited); stats.cellsOnlyInSource.addAndGet(partialStats.cellsOnlyInSource); stats.cellsInCommon.addAndGet(partialStats.cellsInCommon); if (log.isInfoEnabled()) { log.info("Processed diff of " + "{} rows " + "{} rows only in source " + "{} rows partially in common " + "{} rows completely in common " + "{} cells only in source " + "{} cells in common " + "between and in ms.", partialStats.rowsVisited, partialStats.rowsOnlyInSource, partialStats.rowsPartiallyInCommon, partialStats.rowsCompletelyInCommon, partialStats.cellsOnlyInSource, partialStats.cellsInCommon, plusTable, minusTable, <START> System.currentTimeMillis() - startTime); <END> } }</code><technical_language>mark safe & unsafe</technical_language>

Target:
private static void executeDiffTask(DiffStrategy strategy, TableReference plusTable, TableReference minusTable, DiffStats stats, DiffTask task, MutableRange range) throws InterruptedException { final RangeRequest request = range.getRangeRequest(); long startTime = System.currentTimeMillis(); PartialDiffStats partialStats = task.call(request, range, strategy); stats.rowsOnlyInSource.addAndGet(partialStats.rowsOnlyInSource); stats.rowsPartiallyInCommon.addAndGet(partialStats.rowsPartiallyInCommon); stats.rowsCompletelyInCommon.addAndGet(partialStats.rowsCompletelyInCommon); stats.rowsVisited.addAndGet(partialStats.rowsVisited); stats.cellsOnlyInSource.addAndGet(partialStats.cellsOnlyInSource); stats.cellsInCommon.addAndGet(partialStats.cellsInCommon); if (log.isInfoEnabled()) { log.info("Processed diff of " + "{} rows " + "{} rows only in source " + "{} rows partially in common " + "{} rows completely in common " + "{} cells only in source " + "{} cells in common " + "between and in ms.", SafeArg.of("rowsVisited", partialStats.rowsVisited), SafeArg.of("rowsOnlyInSource", partialStats.rowsOnlyInSource), SafeArg.of("rowsPartiallyInCommon", partialStats.rowsPartiallyInCommon), SafeArg.of("rowsCompletelyInCommon", partialStats.rowsCompletelyInCommon), SafeArg.of("cellsOnlyInSource", partialStats.cellsOnlyInSource), SafeArg.of("cellsInCommon", partialStats.cellsInCommon), LoggingArgs.tableRef("plusTable", plusTable), LoggingArgs.tableRef("minusTable", minusTable), SafeArg.of("timeTaken", System.currentTimeMillis() - startTime)); } }
Source:
<code>protected boolean isRegisteredStudent(){ return (account.googleId != null) && (!account.googleId.isEmpty()); <START> } <END></code><technical_language>this method in account object instead? isRegistered():boolean</technical_language>

Target:
protected boolean isRegisteredStudent(){ return account.isUserRegistered(); }
Source:
<code>private String displayAllTasks() { String nl = System.lineSeparator(); <START> StringBuilder answer = new StringBuilder("Tasks = {" + nl); <END> for (String tid : tasks.keySet()) { answer.append(LogFormatter.addIndent(tasks.get(tid).display())).append(nl).append(nl); } answer.append("}"); return answer.toString(); }</code><technical_language>change + append here</technical_language>

Target:
private String displayAllTasks() { String nl = System.lineSeparator(); StringBuilder answer = new StringBuilder("Tasks = {"); answer.append(nl); for (String tid : tasks.keySet()) { answer.append(LogFormatter.addIndent(tasks.get(tid).display())).append(nl).append(nl); } answer.append("}"); return answer.toString(); }
Source:
<code>private String composeExistingVmsWarningMessage(List<T> existingVms) { <START> final StringBuffer s = new StringBuffer(); <END> for (T t : existingVms) { if(s.length() > 0) { s.append(", "); } s.append(extractNameFromEntity(t)); } return s.toString(); }</code><technical_language>Please engine code format (missing whitespace if/for/etc...)</technical_language>

Target:
private String composeExistingVmsWarningMessage(List<T> existingVms) { final List<String> list = new ArrayList<String>(); for (T t : existingVms) { list.add(extractNameFromEntity(t)); } return StringUtils.join(list, ", "); }
Source:
<code><START> public MatrixLib sample_value() { <END> checkHasParams(); int[] result = new int[k]; for (int i = 0; i < k; i++) { result[i] = 0; } for (int trial = 0; trial < n; trial++) { double val = Util.random(); int bucket; for (bucket = 0; bucket < k; bucket++) { if (val <= pCDF[bucket]) { break; } } result[bucket] += 1; } double[][] doubleResult = new double[1][n]; for (int i = 0; i < n; i++) { doubleResult[0][i] = result[i]; } return MatrixFactory.fromArray(doubleResult); }</code><technical_language>is sample_value for human calling method</technical_language>

Target:
public MatrixLib sample_value() { checkHasParams(); double[] result = new double[k]; for (int i = 0; i < k; i++) { result[i] = 0; } for (int trial = 0; trial < n; trial++) { double val = Util.random(); int bucket; for (bucket = 0; bucket < k; bucket++) { if (val <= pCDF[bucket]) { break; } } result[bucket] += 1; } return MatrixFactory.createRowVector(result); }
Source:
<code>static void startLocalBookiesInternal(ServerConfiguration conf, String zkHost, int zkPort, int numBookies, boolean shouldStartZK, int initialBookiePort, boolean stopOnExit, String dirSuffix, String zkDataDir) throws Exception { LocalBookKeeper lb = new LocalBookKeeper(numBookies, initialBookiePort); ZooKeeperServerShim zks = null; File zkTmpDir = null; List<File> bkTmpDirs = null; try { if (shouldStartZK) { if (null == zkDataDir) { <START> zkTmpDir = IOUtils.createTempDir("zookeeper", dirSuffix); <END> } else { zkTmpDir = Files.createTempDirectory( Paths.get(zkDataDir), "zookeeper_localbookkeeper", new FileAttribute[0]).toFile(); } zkTmpDir.deleteOnExit(); zks = LocalBookKeeper.runZookeeper(1000, zkPort, zkTmpDir); } lb.initializeZookeeper(conf, zkHost, zkPort); conf.setZkServers(zkHost + ":" + zkPort); bkTmpDirs = lb.runBookies(conf, dirSuffix); try { while (true) { Thread.sleep(5000); } } catch (InterruptedException ie) { if (stopOnExit) { lb.shutdownBookies(); if (null != zks) { zks.stop(); } } throw ie; } } catch (Exception e) { LOG.error("Failed to run bookies : zk ensemble = '{}:{}'", numBookies, zkHost, zkPort, e); throw e; } finally { if (stopOnExit) { cleanupDirectories(bkTmpDirs); if (null != zkTmpDir) { FileUtils.deleteDirectory(zkTmpDir); } } } }</code><technical_language>reason createTempDir method here? is IOUtils.createTempDir enough</technical_language>

Target:
static void startLocalBookiesInternal(ServerConfiguration conf, String zkHost, int zkPort, int numBookies, boolean shouldStartZK, int initialBookiePort, boolean stopOnExit, String dirSuffix, String zkDataDir) throws Exception { LocalBookKeeper lb = new LocalBookKeeper(numBookies, initialBookiePort); ZooKeeperServerShim zks = null; File zkTmpDir = null; List<File> bkTmpDirs = null; try { if (shouldStartZK) { File zkDataDirFile = null; if (zkDataDir != null) { zkDataDirFile = new File(zkDataDir); } zkTmpDir = IOUtils.createTempDir("zookeeper", dirSuffix, zkDataDirFile); zkTmpDir.deleteOnExit(); zks = LocalBookKeeper.runZookeeper(1000, zkPort, zkTmpDir); } lb.initializeZookeeper(conf, zkHost, zkPort); conf.setZkServers(zkHost + ":" + zkPort); bkTmpDirs = lb.runBookies(conf, dirSuffix); try { while (true) { Thread.sleep(5000); } } catch (InterruptedException ie) { if (stopOnExit) { lb.shutdownBookies(); if (null != zks) { zks.stop(); } } throw ie; } } catch (Exception e) { LOG.error("Failed to run bookies : zk ensemble = '{}:{}'", numBookies, zkHost, zkPort, e); throw e; } finally { if (stopOnExit) { cleanupDirectories(bkTmpDirs); if (null != zkTmpDir) { FileUtils.deleteDirectory(zkTmpDir); } } } }
Source:
<code>private Mono<Void> sendInternalTracingEnabled(Flux<EventData> events, String partitionKey) { return sendLinkMono.flatMap(link -> { final AtomicReference<Context> sendSpanContext = new AtomicReference<>(Context.NONE); return link.getLinkSize() .flatMap(size -> { final int batchSize = size > 0 ? size : MAX_MESSAGE_LENGTH_BYTES; final BatchOptions batchOptions = new BatchOptions() .setPartitionKey(partitionKey) .setMaximumSizeInBytes(batchSize); <START> final AtomicReference<Boolean> isFirst = new AtomicReference<>(true); <END> return events.map(eventData -> { Context parentContext = eventData.getContext(); if (isFirst.get()) { Context entityContext = parentContext.addData(ENTITY_PATH, link.getEntityPath()); sendSpanContext.set(tracerProvider .startSpan(entityContext.addData(HOST_NAME, link.getHostname()), ProcessKind.SEND)); } isFirst.set(false); return setSpanContext(eventData, parentContext); }).collect(new EventDataCollector(batchOptions, 1, link::getErrorContext)); }) .flatMap(list -> sendInternal(Flux.fromIterable(list))) .doOnEach(signal -> { tracerProvider.endSpan(sendSpanContext.get(), signal); }); }); }</code><technical_language>AtomicBoolean is sufficient. do: java if (!isFirst.getAndSet(true)) { // update sendSpanContext Context entityContext = parentContext.addData(ENTITY_PATH, link.getEntityPath()); sendSpanContext.set(tracerProvider.startSpan( entityContext.addData(HOST_NAME, link.getHostname()), ProcessKind.SEND)); } // add span context event data return setSpanContext(eventData, parentContext);</technical_language>

Target:
private Mono<Void> sendInternalTracingEnabled(Flux<EventData> events, String partitionKey) { return sendLinkMono.flatMap(link -> { final AtomicReference<Context> sendSpanContext = new AtomicReference<>(Context.NONE); return link.getLinkSize() .flatMap(size -> { final int batchSize = size > 0 ? size : MAX_MESSAGE_LENGTH_BYTES; final BatchOptions batchOptions = new BatchOptions() .setPartitionKey(partitionKey) .setMaximumSizeInBytes(batchSize); final AtomicReference<Boolean> isFirst = new AtomicReference<>(true); return events.map(eventData -> { Context parentContext = eventData.getContext(); if (isFirst.getAndSet(false)) { Context entityContext = parentContext.addData(ENTITY_PATH, link.getEntityPath()); sendSpanContext.set(tracerProvider.startSpan( entityContext.addData(HOST_NAME, link.getHostname()), ProcessKind.SEND)); } return setSpanContext(eventData, parentContext); }).collect(new EventDataCollector(batchOptions, 1, link::getErrorContext)); }) .flatMap(list -> sendInternal(Flux.fromIterable(list))) .doOnEach(signal -> { tracerProvider.endSpan(sendSpanContext.get(), signal); }); }); }
Source:
<code>public static String commaSeparateStrings( final ImmutableList<String> strings, final int indent) { if (isEmpty(strings)) { return ""; } return strings .stream() .map(i -> i) <START> .collect(Collectors.joining(",\n" + indent(indent))); <END> }</code><technical_language>this skip indenting element</technical_language>

Target:
public static String commaSeparateStrings( final ImmutableList<String> strings, final int indent) { if (isEmpty(strings)) { return ""; } return strings .stream() .collect(Collectors.joining(",\n" + indent(indent))); }
Source:
<code>protected void modified(ComponentContext context) { if (context != null) { Object value = context.getProperties().get("autoLinks"); <START> if (value != null && value.toString().equals("false")) { <END> autoLinks = false; } } }</code><technical_language>If configuration set false this configuration is removed again, default used. current implementation default / true restart if modified. If I correct use: <code>autoLinks = == null || !value.toString().equals("false");</code></technical_language>

Target:
protected void modified(ComponentContext context) { if (context != null) { Object value = context.getProperties().get("autoLinks"); autoLinks = value == null || !value.toString().equals("false"); } }
Source:
<code>private FileInfo getOrCreateFlagImageFileInfo(final Map<URI, FileInfo> fileInfos, final URI file, final URI relpath) { assert file.getFragment() == null; final URI f = file.normalize(); <START> FileInfo.Builder b; <END> if (fileInfos.containsKey(f)) { b = new FileInfo.Builder(fileInfos.get(f)); } else { b = new FileInfo.Builder().src(file); } b = b.uri(tempFileNameScheme.generateTempFileName(baseInputDir.resolve(relpath))); final FileInfo i = b.build(); fileInfos.put(i.src, i); return i; }</code><technical_language>b final</technical_language>

Target:
private FileInfo getOrCreateFlagImageFileInfo(final Map<URI, FileInfo> fileInfos, final URI file, final URI relpath) { assert file.getFragment() == null; final URI f = file.normalize(); FileInfo.Builder b; if (fileInfos.containsKey(f)) { b = new FileInfo.Builder(fileInfos.get(f)); } else { b = new FileInfo.Builder().src(file); } b = b.uri(tempFileNameScheme.generateTempFileName(rootFile.resolve(relpath))); final FileInfo i = b.build(); fileInfos.put(i.src, i); return i; }
Source:
<code>protected Scope visitCreateSchema(CreateSchema node, Optional<Scope> scope) <START> { <END> process(node.getProperties(), scope); return createAndAssignScope(node, scope); }</code><technical_language>moved changed methods in commit, please separate changes separate commits. is easier follow way</technical_language>

Target:
protected Scope visitCreateSchema(CreateSchema node, Optional<Scope> scope) { validateProperties(node.getProperties(), scope); return createAndAssignScope(node, scope); }
Source:
<code>public CacheQuery<E> sort(Sort sort) { <START> this.sort = sort; <END> this.queryDefinition.setSort(sort); return super.sort(sort); }</code><technical_language>Is sort field all? I set anywhere</technical_language>

Target:
public CacheQuery<E> sort(Sort sort) { this.queryDefinition.setSort(sort); return super.sort(sort); }
Source:
<code>private static int getMaskSizeInBytes(int baseSeqNum, List<Integer> sortedProtectedSeqNums) { int largestSeqNum = sortedProtectedSeqNums.get(sortedProtectedSeqNums.size() - 1); <START> int largestDelta = largestSeqNum - baseSeqNum; <END> if (largestDelta <= 14) { return MASK_SIZE_SMALL; } else if (largestDelta <= 45) { return MASK_SIZE_MED; } return MASK_SIZE_LARGE; }</code><technical_language>wrapping</technical_language>

Target:
private static int getMaskSizeInBytes(int baseSeqNum, List<Integer> sortedProtectedSeqNums) throws MalformedMaskException { int largestDelta = -1; for (Integer protectedSeqNum : sortedProtectedSeqNums) { int delta = RTPUtils.getSequenceNumberDelta(protectedSeqNum, baseSeqNum); if (delta > largestDelta) { largestDelta = delta; } } if (largestDelta > 108) { throw new MalformedMaskException(); } if (largestDelta <= 14) { return MASK_SIZE_SMALL; } else if (largestDelta <= 45) { return MASK_SIZE_MED; } return MASK_SIZE_LARGE; }