auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void handleCherryPick(Shell shell, GerritClient gerritClient, ChangeInfo changeInfo, RevisionInfo revision) { fGerritClient = gerritClient; fChangeInfo = changeInfo; BranchInfo[] listBranchesCmdResult = listBranches(); List<String> listBranchesRef = new ArrayList<String>(); Iterator<BranchInfo> it = Arrays.asList(listBranchesCmdResult).iterator(); while (it.hasNext()) { listBranchesRef.add(it.next().getRef()); } final CherryPickDialog cherryPickDialog = new CherryPickDialog(shell, listBranchesRef, revision.getCommit().getMessage()); Display.getDefault().syncExec(new Runnable() { public void run() { while (true) { String cherryPickCmdResult = ""; int ret = cherryPickDialog.open(); if (ret == IDialogConstants.OK_ID) { cherryPickCmdResult = cherryPickRevision(fChangeInfo.getId(), revision.getId(), cherryPickDialog.getBranch(), cherryPickDialog.getMessage()); if (!cherryPickCmdResult.isEmpty()) { MessageDialog.open(MessageDialog.ERROR, null, Messages.CherryPickRevision_9, cherryPickCmdResult, SWT.NONE); } else { break; } } else { break; } } } }); }

Target:
public void handleCherryPick(Shell shell, GerritClient gerritClient, ChangeInfo changeInfo, RevisionInfo revision) { fGerritClient = gerritClient; fChangeInfo = changeInfo; BranchInfo[] listBranchesCmdResult = listBranches(); List<String> listBranchesRef = new ArrayList<String>(); Iterator<BranchInfo> it = Arrays.asList(listBranchesCmdResult).iterator(); while (it.hasNext()) { listBranchesRef.add(it.next().getRef()); } final CherryPickDialog cherryPickDialog = new CherryPickDialog(shell, listBranchesRef, revision.getCommit().getMessage()); Display.getDefault().syncExec(new Runnable() { public void run() { boolean isDone = false; while (!isDone) { String cherryPickCmdResult = ""; int ret = cherryPickDialog.open(); if (ret == IDialogConstants.OK_ID) { cherryPickCmdResult = cherryPickRevision(fChangeInfo.getId(), revision.getId(), cherryPickDialog.getBranch(), cherryPickDialog.getMessage()); if (!cherryPickCmdResult.isEmpty()) { MessageDialog.open(MessageDialog.ERROR, null, Messages.CherryPickRevision_9, cherryPickCmdResult, SWT.NONE); } else { UIUtils.openAnotherEditor(fChangeInfo, fGerritClient); isDone = true; } } else { isDone = true; } } } }); }
Source:
public ImmutableSpongeSneakingData(boolean sneaking) { super(ImmutableSneakingData.class, sneaking, Keys.IS_SNEAKING, SneakingData.class); }

Target:
public ImmutableSpongeSneakingData(boolean sneaking) { super(ImmutableSneakingData.class, sneaking, Keys.IS_SNEAKING, SpongeSneakingData.class); }
Source:
private static final Object[][] getArticleName() { return new Object[][] { { "QAarticle" }, { "QAVeryLongArticleNameQAVeryLongArticleNameQAVeryLongArticleNameQAVeryLongArticleNameQAVeryLongArticleNameQAVeryLongArticleName" }, { "QA_article" }, { "123123123123" } }; }

Target:
private static final Object[][] getArticleName() { return new Object[][] { { "Gonzo" }, { "100" }, { "What's" }, { "Kermit_the_Frog" }, { "3, 2, 1" }, { "1-2-3-4-5!" }, { "(Sumpin' New)" }, { "109:" }, }; }
Source:
public static void updateWidget(Context context) { AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); int appWidgetIds[] = appWidgetManager.getAppWidgetIds(new ComponentName(context, BookmarksWidget.class)); appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.listViewWidget); }

Target:
public static void updateWidget(Context context) { AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); int appWidgetIds[] = appWidgetManager.getAppWidgetIds(new ComponentName(context, BookmarksWidget.class)); appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds, R.id.list_view_widget); }
Source:
public PropertyValidationResult validate(Entity entity, Serializable instance, Map<String, FieldMetadata> entityFieldMetadata, Map<String, String> validationConfiguration, BasicFieldMetadata propertyMetadata, String propertyName, String value) { String otherField = validationConfiguration.get("otherField"); FieldManager fm = PersistenceManagerFactory.getPersistenceManager().getDynamicEntityDao().getFieldManager(); boolean valid = true; String message = ""; Date startDate = null; Date endDate = null; if(value == null || value.equals("") || otherField == null || otherField.equals("")) return new PropertyValidationResult(true); try { startDate = (Date) fm.getFieldValue(instance, otherField); endDate = (Date) fm.getFieldValue(instance, propertyName); } catch (Exception e) { valid = false; message = e.getMessage(); } if(valid && endDate != null && startDate != null && endDate.before(startDate)) { valid = false; message = END_DATE_BEFORE_START; } if(valid) return new PropertyValidationResult(true); else return new PropertyValidationResult(false,message); }

Target:
public PropertyValidationResult validate(Entity entity, Serializable instance, Map<String, FieldMetadata> entityFieldMetadata, Map<String, String> validationConfiguration, BasicFieldMetadata propertyMetadata, String propertyName, String value) { String otherField = validationConfiguration.get("otherField"); FieldManager fm = PersistenceManagerFactory.getPersistenceManager().getDynamicEntityDao().getFieldManager(); boolean valid = true; String message = ""; Date startDate = null; Date endDate = null; if (StringUtils.isBlank(value) || StringUtils.isBlank(otherField)) { return new PropertyValidationResult(true); } try { startDate = (Date) fm.getFieldValue(instance, otherField); endDate = (Date) fm.getFieldValue(instance, propertyName); } catch (IllegalAccessException | FieldNotAvailableException e) { valid = false; message = e.getMessage(); } if (valid && endDate != null && startDate != null && endDate.before(startDate)) { valid = false; message = END_DATE_BEFORE_START; } return new PropertyValidationResult(valid, message); }
Source:
protected Serialization findSerialization(String resultType, ContentType contentType) { for (Serialization serialization : serializationsProvider.get()) { if (serialization.canDeserialize(resultType, contentType)) { return serialization; } } return null; }

Target:
protected Serialization findSerialization(String resultType, ContentType contentType) { for (Serialization serialization : getSerializations()) { if (serialization.canDeserialize(resultType, contentType)) { return serialization; } } return null; }
Source:
public boolean moveCellsRight() { boolean dirty = false; if (moveCellsRightLoop()) dirty = true; for (int y = 0; y < GRID_WIDTH; y++) { for (int x = (GRID_WIDTH - 1); x > 0; x--) { int xx = x - 1; dirty = combineCells(xx, y, x, y, dirty); } } if (moveCellsRightLoop()) dirty = true; return dirty; }

Target:
public boolean moveCellsRight() { boolean dirty = false; if (moveCellsRightLoop()) dirty = true; for (int j = 0; j < GRID_WIDTH; j++) { for (int i = (GRID_WIDTH - 1); i > 0; i--) { int previousI = i - 1; dirty = combineCells(previousI, j, i, j, dirty); } } if (moveCellsRightLoop()) dirty = true; return dirty; }
Source:
public static String createAuthorization(final OAuthService service) throws IOException { List<String> scopes = Arrays.asList("repo", "user", "gist"); Authorization auth = new Authorization(); auth.setNote(APP_NOTE); auth.setNoteUrl(APP_NOTE_URL); auth.setScopes(scopes); auth = service.createAuthorization(auth); return auth != null ? auth.getToken() : null; }

Target:
public static String createAuthorization(final OAuthService service) throws IOException { Authorization auth = new Authorization(); auth.setNote(APP_NOTE); auth.setNoteUrl(APP_NOTE_URL); auth.setScopes(SCOPES); auth = service.createAuthorization(auth); return auth != null ? auth.getToken() : null; }
Source:
public void testMultipleReadsToSameColumnRangeAcrossRows() { byte[] row1 = PtBytes.toBytes("row1"); byte[] row2 = PtBytes.toBytes("row2"); Transaction transaction = startTransaction(); Map<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> columnRange = transaction.getRowsColumnRange(TEST_TABLE, ImmutableList.of(row1), BatchColumnRangeSelection.create(PtBytes.toBytes("col"), PtBytes.toBytes("col0"), 1)); columnRange.values().forEach(visitable -> visitable.batchAccept(10, t -> true)); Map<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> columnRangeDifferentRow = transaction.getRowsColumnRange(TEST_TABLE, ImmutableList.of(row2), BatchColumnRangeSelection.create(PtBytes.toBytes("col"), PtBytes.toBytes("col0"), 1)); columnRangeDifferentRow.values().forEach(visitable -> visitable.batchAccept(10, t -> true)); put(transaction, "mutation to ensure", "conflict", "handling"); transaction.commit(); }

Target:
public void testMultipleReadsToSameColumnRangeAcrossRows() { byte[] row = PtBytes.toBytes("row"); byte[] differentRow = PtBytes.toBytes("differentRow"); Transaction transaction = startTransaction(); BatchColumnRangeSelection sameColumnRangeSelection = BatchColumnRangeSelection.create(PtBytes.toBytes("col"), PtBytes.toBytes("col0"), 1); Map<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> columnRangeResultForRow = transaction.getRowsColumnRange(TEST_TABLE, ImmutableList.of(row), sameColumnRangeSelection); columnRangeResultForRow.values().forEach(visitable -> visitable.batchAccept(10, t -> true)); Map<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> columnRangeResultForDifferentRow = transaction.getRowsColumnRange(TEST_TABLE, ImmutableList.of(differentRow), sameColumnRangeSelection); columnRangeResultForDifferentRow.values().forEach(visitable -> visitable.batchAccept(10, t -> true)); put(transaction, "mutation to ensure", "conflict", "handling"); transaction.commit(); }
Source:
private Promise loadNodes(final Map<String, JSITDefinitions> existingDefinitions, final DMNIncludedModel model, final List<DMNIncludedNode> result) { String filePath = ""; for (final Map.Entry<String, JSITDefinitions> entry : existingDefinitions.entrySet()) { filePath = entry.getKey(); final JSITDefinitions definitions = Js.uncheckedCast(entry.getValue()); if (Objects.equals(model.getNamespace(), definitions.getNamespace())) { break; } } final String path = filePath; return contentService.loadFile(path) .then(content -> { return promises.create((success, fail) -> { diagramService.transform(content, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram item) { final List<DMNIncludedNode> nodes = diagramUtils .getDRGElements(item) .stream() .map(node -> includedModelFactory.makeDMNIncludeNode(path, model, node)) .collect(Collectors.toList()); result.addAll(nodes); success.onInvoke(nodes); } @Override public void onError(final ClientRuntimeError error) { LOGGER.log(Level.SEVERE, error.getMessage()); fail.onInvoke(error); } }); }); }); }

Target:
private Promise<List<DMNIncludedNode>> loadNodes(final Map<String, JSITDefinitions> existingDefinitions, final DMNIncludedModel model, final List<DMNIncludedNode> result) { String filePath = ""; for (final Map.Entry<String, JSITDefinitions> entry : existingDefinitions.entrySet()) { filePath = entry.getKey(); final JSITDefinitions definitions = Js.uncheckedCast(entry.getValue()); if (Objects.equals(model.getNamespace(), definitions.getNamespace())) { break; } } final String path = filePath; return contentService.loadFile(path) .then(content -> promises.create((success, fail) -> { diagramService.transform(content, new ServiceCallback<Diagram>() { @Override public void onSuccess(final Diagram item) { final List<DMNIncludedNode> nodes = diagramUtils .getDRGElements(item) .stream() .map(node -> includedModelFactory.makeDMNIncludeNode(path, model, node)) .collect(Collectors.toList()); result.addAll(nodes); success.onInvoke(nodes); } @Override public void onError(final ClientRuntimeError error) { LOGGER.log(Level.SEVERE, error.getMessage()); fail.onInvoke(error); } }); })); }
Source:
private static String thriftDDLToString(ThriftDDL thriftDDL) { if (thriftDDL == null) { return EMPTY_STRING; } List<ThriftField> fields = thriftDDL.getFields(); if (fields == null || fields.isEmpty()) { return EMPTY_STRING; } StringBuilder sb = new StringBuilder(); sb.append(THRIFT_STRUCT).append(SPACE).append(thriftDDL.getTableName()).append(SPACE).append(START_STRUCT); List<String> fieldNames = fields.stream() .map(field -> SPACE + field.getType() + SPACE + field.getName()) .collect(toList()); sb.append(Joiner.on(",").join(fieldNames)); sb.append(END_STRUCT); return sb.toString(); }

Target:
private static String thriftDDLToString(ThriftDDL thriftDDL) { if (thriftDDL == null) { return EMPTY_STRING; } List<ThriftField> fields = thriftDDL.getFields(); if (fields == null || fields.isEmpty()) { return EMPTY_STRING; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(THRIFT_STRUCT) .append(SPACE) .append(thriftDDL.getTableName()) .append(SPACE) .append(START_STRUCT); stringBuilder.append(fields.stream() .map(field -> SPACE + field.getType() + SPACE + field.getName()) .collect(Collectors.joining(","))); stringBuilder.append(END_STRUCT); return stringBuilder.toString(); }
Source:
public List<VdsNetworkInterface> getAllInterfacesByDataCenterId(Guid dataCenterId) { return getCallsHandler().executeReadList("GetInterfacesByDataCenterId", new VdsNetworkInterfaceRowMapper(qosDaoRetriever), getCustomMapSqlParameterSource().addValue("data_center_id", dataCenterId)); }

Target:
public List<VdsNetworkInterface> getAllInterfacesByDataCenterId(Guid dataCenterId) { return getCallsHandler().executeReadList("GetInterfacesByDataCenterId", qosDaoInterfaceMapper, getCustomMapSqlParameterSource().addValue("data_center_id", dataCenterId)); }
Source:
public CustomIndexArray(Map<Integer, T> src) { Integer lowerIndex = Integer.MAX_VALUE; Integer upperIndex = Integer.MIN_VALUE; for (Map.Entry<Integer, T> entry : src.entrySet()) { Integer key = entry.getKey(); if (key < lowerIndex) { lowerIndex = key; } if (key > upperIndex) { upperIndex = key; } } this.baseIndex = lowerIndex; this.elemCount = upperIndex - lowerIndex + 1; this.elements = makeNullInitializedArray(elemCount); for (Map.Entry<Integer, T> entry : src.entrySet()) { elements.set(entry.getKey() - baseIndex, entry.getValue()); } }

Target:
public CustomIndexArray(Map<Integer, T> src) { Integer lowerIndex = Integer.MAX_VALUE; Integer upperIndex = Integer.MIN_VALUE; for (Integer key : src.keySet()) { if (key < lowerIndex) { lowerIndex = key; } if (key > upperIndex) { upperIndex = key; } } this.baseIndex = lowerIndex; this.elemCount = upperIndex - lowerIndex + 1; this.elements = makeNullInitializedArray(elemCount); for (Map.Entry<Integer, T> entry : src.entrySet()) { elements.set(entry.getKey() - baseIndex, entry.getValue()); } }
Source:
public @ResponseBody List<Game> getGamesByTeam( HttpSession session, @PathVariable int id) { if(session.getAttribute("member") == null) { return null; } TeamDao teamDao = new TeamDao(); Team team = teamDao.getTeamById(id, true, false, false); return (List<Game>) (team == null ? null : team.getGames()); }

Target:
public @ResponseBody Set<Game> getGamesByTeam( HttpSession session, @PathVariable int id) { if (session.getAttribute("member") == null) { return null; } TeamDao teamDao = new TeamDao(); Team team = teamDao.getTeamById(id, true, false, false); return (team == null ? null : team.getGames()); }
Source:
private String getElasticsearchMajorVersion(URL elasticsearchUrl) { return httpClient.send(HttpRequestBuilder.<String>forUrl(elasticsearchUrl.toString()) .method("GET") .successHandler(new HttpClient.ResponseHandler<String>() { @Override public String handleResponse(HttpRequest<?> httpRequest, InputStream inputStream, Integer statusCode, IOException e) throws IOException { JsonNode clusterResponse = JsonUtils.getMapper().readTree(inputStream); String version = clusterResponse.has("version") ? clusterResponse.get("version").get("number").asText() : "0.0.0"; logger.info(String.format("Elasticsearch Version: %s", version)); StringTokenizer stringTokenizer = new StringTokenizer(version, "."); return stringTokenizer.nextToken(); } }) .build()); }

Target:
private Integer getElasticsearchMajorVersion(URL elasticsearchUrl) { return httpClient.send(HttpRequestBuilder.<Integer>forUrl(elasticsearchUrl.toString()) .method("GET") .successHandler(new HttpClient.ResponseHandler<Integer>() { @Override public Integer handleResponse(HttpRequest<?> httpRequest, InputStream inputStream, Integer statusCode, IOException e) throws IOException { JsonNode clusterResponse = JsonUtils.getMapper().readTree(inputStream); String version = clusterResponse.has("version") ? clusterResponse.get("version").get("number").asText() : "0.0.0"; logger.info(String.format("Elasticsearch Version: %s", version)); StringTokenizer stringTokenizer = new StringTokenizer(version, "."); try { return Integer.valueOf(stringTokenizer.nextToken()); } catch (NumberFormatException nfe) { return null; } } }).build()); }
Source:
private Optional<File[]> retrieveFiles() throws IOException { Optional<File[]> connectorFiles = Optional.empty(); Resource connectorRootPath = new ClassPathResource(connectorRoot); if (connectorRootPath.exists()) { connectorFiles = Optional.ofNullable(connectorRootPath.getFile().listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { if (name.toLowerCase().endsWith(".json")) { return true; } else { return false; } } }) ); } return connectorFiles; }

Target:
private Optional<File[]> retrieveFiles() throws IOException { Optional<File[]> connectorFiles = Optional.empty(); Resource connectorRootPath = new ClassPathResource(connectorRoot); if (connectorRootPath.exists()) { connectorFiles = Optional.ofNullable(connectorRootPath.getFile().listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return (name.toLowerCase().endsWith(".json")); } }) ); } return connectorFiles; }
Source:
private void writeJobStatusToConfigMap(JobID jobID, JobSchedulingStatus status) throws IOException { LOG.debug("Setting scheduling state for job to {}.", jobID, status); final String key = getKeyForJobId(jobID); try { kubeClient.checkAndUpdateConfigMap( configMapName, configMap -> { if (KubernetesLeaderElector.hasLeadership(configMap, lockIdentity)) { configMap.getData().put(key, status.name()); return Optional.of(configMap); } return Optional.empty(); } ).get(); } catch (Exception e) { throw new IOException("Failed to set " + status.name() + " state in ConfigMap " + configMapName + " for job " + jobID, e); } }

Target:
private void writeJobStatusToConfigMap(JobID jobID, JobSchedulingStatus status) throws IOException { LOG.debug("Setting scheduling state for job to {}.", jobID, status); final String key = getKeyForJobId(jobID); try { kubeClient.checkAndUpdateConfigMap( configMapName, configMap -> { if (KubernetesLeaderElector.hasLeadership(configMap, lockIdentity)) { final Optional<JobSchedulingStatus> optional = getJobStatus(configMap, jobID); if (!optional.isPresent() || optional.get() != status) { configMap.getData().put(key, status.name()); return Optional.of(configMap); } } return Optional.empty(); } ).get(); } catch (Exception e) { throw new IOException("Failed to set " + status.name() + " state in ConfigMap " + configMapName + " for job " + jobID, e); } }
Source:
private List<MemoryAllocation> mergeQueryAllocations(List<MemoryAllocation> left, List<MemoryAllocation> right) { verify(left != null, "left is null"); verify(right != null, "right is null"); Map<String, MemoryAllocation> mergedAllocations = new HashMap<>(); for (MemoryAllocation allocation : left) { mergedAllocations.put(allocation.getTag(), allocation); } for (MemoryAllocation allocation : right) { mergedAllocations.merge( allocation.getTag(), allocation, (a, b) -> new MemoryAllocation(a.getTag(), a.getAllocation() + b.getAllocation())); } return new ArrayList<>(mergedAllocations.values()); }

Target:
private List<MemoryAllocation> mergeQueryAllocations(List<MemoryAllocation> left, List<MemoryAllocation> right) { requireNonNull(left, "left is null"); requireNonNull(right, "right is null"); Map<String, MemoryAllocation> mergedAllocations = new HashMap<>(); for (MemoryAllocation allocation : left) { mergedAllocations.put(allocation.getTag(), allocation); } for (MemoryAllocation allocation : right) { mergedAllocations.merge( allocation.getTag(), allocation, (a, b) -> new MemoryAllocation(a.getTag(), a.getAllocation() + b.getAllocation())); } return new ArrayList<>(mergedAllocations.values()); }
Source:
public void testIncludedCipher() throws Exception { HttpServerConfig config = new HttpServerConfig() .setHttpsEnabled(true) .setHttpsPort(0) .setKeystorePath(KEY_STORE_PATH) .setKeystorePassword(KEY_STORE_PASSWORD) .setHttpsIncludedCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); NodeInfo nodeInfo = new NodeInfo("test"); HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); HttpServer server = createServer(nodeInfo, httpServerInfo, config); try { server.start(); URI httpsUri = httpServerInfo.getHttpsUri(); HttpClient httpClient = createClientIncludeCiphers("TLS_RSA_WITH_AES_128_CBC_SHA"); httpClient.GET(httpsUri); httpClient = createClientIncludeCiphers("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); httpClient.GET(httpsUri); httpClient = createClientIncludeCiphers("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"); try { httpClient.GET(httpsUri); Assert.fail("SSL handshake should fail because client only accept a cipher the server doesn't include"); } catch (ExecutionException e) { } } finally { server.stop(); } }

Target:
public void testIncludedCipher() throws Exception { HttpServerConfig config = new HttpServerConfig() .setHttpsEnabled(true) .setHttpsPort(0) .setKeystorePath(KEY_STORE_PATH) .setKeystorePassword(KEY_STORE_PASSWORD) .setHttpsIncludedCipherSuites(CIPHER_1 + "," + CIPHER_2); NodeInfo nodeInfo = new NodeInfo("test"); HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); HttpServer server = createServer(nodeInfo, httpServerInfo, config); try { server.start(); URI httpsUri = httpServerInfo.getHttpsUri(); HttpClient httpClient = createClientIncludeCiphers(CIPHER_1); httpClient.GET(httpsUri); httpClient = createClientIncludeCiphers(CIPHER_2); httpClient.GET(httpsUri); httpClient = createClientIncludeCiphers(CIPHER_3); try { httpClient.GET(httpsUri); Assert.fail("SSL handshake should fail because client included only ciphers the server didn't include"); } catch (ExecutionException e) { } } finally { server.stop(); } }
Source:
public KeyAwareLockPromise lockAll(Collection<?> keys, Object lockOwner, long time, TimeUnit unit) { Objects.requireNonNull(keys, "Keys must be non null"); Objects.requireNonNull(lockOwner, "Lock owner must be non null"); Objects.requireNonNull(unit, "Time unit must be non null"); if (keys.isEmpty()) { if (trace) { log.tracef("Lock all: no keys found for owner=%s", lockOwner); } return KeyAwareLockPromise.NO_OP; } else if (keys.size() == 1) { return lock(keys.iterator().next(), lockOwner, time, unit); } final Set<Object> uniqueKeys = filterDistinctKeys(keys); if (uniqueKeys.size() == 1) { return lock(uniqueKeys.iterator().next(), lockOwner, time, unit); } if (trace) { log.tracef("Lock all keys=%s for owner=%s. timeout=%s (%s)", toStr(uniqueKeys), lockOwner, time, unit); } final CompositeLockPromise compositeLockPromise = new CompositeLockPromise(uniqueKeys.size(), blockingExecutor); synchronized (this) { for (Object key : uniqueKeys) { compositeLockPromise.addLock(new KeyAwareExtendedLockPromise(lockContainer.acquire(key, lockOwner, time, unit), key, unit.toMillis(time))); } } compositeLockPromise.scheduleLockTimeoutTask(scheduler, time, unit); compositeLockPromise.markListAsFinal(); return compositeLockPromise; }

Target:
public KeyAwareLockPromise lockAll(Collection<?> keys, Object lockOwner, long time, TimeUnit unit) { Objects.requireNonNull(keys, "Keys must be non null"); Objects.requireNonNull(lockOwner, "Lock owner must be non null"); Objects.requireNonNull(unit, "Time unit must be non null"); if (keys.isEmpty()) { if (trace) { log.tracef("Lock all: no keys found for owner=%s", lockOwner); } return KeyAwareLockPromise.NO_OP; } else if (keys.size() == 1) { return lock(keys.iterator().next(), lockOwner, time, unit); } final Set<Object> uniqueKeys = filterDistinctKeys(keys); if (uniqueKeys.size() == 1) { return lock(uniqueKeys.iterator().next(), lockOwner, time, unit); } if (trace) { log.tracef("Lock all keys=%s for owner=%s. timeout=%s (%s)", toStr(uniqueKeys), lockOwner, time, unit); } final CompositeLockPromise compositeLockPromise = new CompositeLockPromise(uniqueKeys.size(), nonBlockingExecutor); synchronized (this) { for (Object key : uniqueKeys) { compositeLockPromise.addLock(new KeyAwareExtendedLockPromise(lockContainer.acquire(key, lockOwner, time, unit), key, unit.toMillis(time))); } } compositeLockPromise.scheduleLockTimeoutTask(scheduler, time, unit); compositeLockPromise.markListAsFinal(); return compositeLockPromise; }
Source:
IoFuture<Connection> getConnection(final EndpointImpl endpoint, final ConnectionKey key, final AuthenticationConfiguration authenticationConfiguration, boolean doConnect) { try { pendingAttemptsLock.readLock().lock(); if (authenticationConfiguration.equals(this.authenticationConfiguration)) { return attempt; } else { FutureResult<Connection> futureResult = pendingAttempts.get(authenticationConfiguration); if (futureResult != null) { return futureResult.getIoFuture(); } else { if (! doConnect) { return null; } futureResult = new FutureResult<>(endpoint.getExecutor()); final FutureResult<Connection> appearing = pendingAttempts.putIfAbsent(authenticationConfiguration, futureResult); if (appearing != null) { return appearing.getIoFuture(); } } assert doConnect; final IoFuture<Connection> ioFuture = futureResult.getIoFuture(); final AtomicBoolean cancelFlag = new AtomicBoolean(); final FutureResult<Connection> finalFutureResult = futureResult; futureResult.addCancelHandler(new Cancellable() { public Cancellable cancel() { cancelFlag.set(true); finalFutureResult.setCancelled(); return this; } }); return ioFuture; } } finally { pendingAttemptsLock.readLock().unlock(); } }

Target:
IoFuture<Connection> getConnection(final EndpointImpl endpoint, final ConnectionKey key, final AuthenticationConfiguration authenticationConfiguration, boolean doConnect) { synchronized (pendingAttempts) { if (authenticationConfiguration.equals(this.authenticationConfiguration)) { return attempt; } else { FutureResult<Connection> futureResult = pendingAttempts.get(authenticationConfiguration); if (futureResult != null) { return futureResult.getIoFuture(); } else { if (! doConnect) { return null; } futureResult = new FutureResult<>(endpoint.getExecutor()); pendingAttempts.put(authenticationConfiguration, futureResult); } assert doConnect; final IoFuture<Connection> ioFuture = futureResult.getIoFuture(); final AtomicBoolean cancelFlag = new AtomicBoolean(); final FutureResult<Connection> finalFutureResult = futureResult; futureResult.addCancelHandler(new Cancellable() { public Cancellable cancel() { cancelFlag.set(true); finalFutureResult.setCancelled(); return this; } }); return ioFuture; } } }
Source:
public Value<Entity> vehicle() { return new SpongeValue<Entity>(Keys.VEHICLE, vehicle); }

Target:
public Value<Entity> vehicle() { return new SpongeEntityValue(Keys.VEHICLE, vehicle.get()); }
Source:
public PngChunkText(final int length, final int chunkType, final int crc, final byte[] bytes) throws ImageReadException, IOException { super(length, chunkType, crc, bytes); final int index = findNull(bytes); if (index < 0) { throw new ImageReadException( "PNG tEXt chunk keyword is not terminated."); } keyword = new String(bytes, 0, index, StandardCharsets.ISO_8859_1); final int textLength = bytes.length - (index + 1); text = new String(bytes, index + 1, textLength, StandardCharsets.ISO_8859_1); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Keyword: " + keyword); LOGGER.fine("Text: " + text); } }

Target:
public PngChunkText(final int length, final int chunkType, final int crc, final byte[] bytes) throws ImageReadException, IOException { super(length, chunkType, crc, bytes); final int index = findNull(bytes); if (index < 0) { throw new ImageReadException( "PNG tEXt chunk keyword is not terminated."); } keyword = new String(bytes, 0, index, StandardCharsets.ISO_8859_1); final int textLength = bytes.length - (index + 1); text = new String(bytes, index + 1, textLength, StandardCharsets.ISO_8859_1); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("Keyword: " + keyword); LOGGER.finest("Text: " + text); } }
Source:
public static int findOpenPort(int basePort) { final int startPort = basePort == -1 ? -1 : rnd.nextInt(0x7fff) + basePort; return findOpenPortFrom(startPort); }

Target:
public static int findOpenPort(int basePort) { final int startPort = basePort < 0 ? -1 : rnd.nextInt(0x7fff) + basePort; return findOpenPortFrom(startPort); }
Source:
public Guid getHostForExecution(Guid poolId, Collection<Guid> hostsToFilter) { return getHostForExecution(poolId, vds -> !hostsToFilter.contains(vds)); }

Target:
public Guid getHostForExecution(Guid poolId, Collection<Guid> hostsToFilter) { return getHostForExecution(poolId, vds -> !hostsToFilter.contains(vds.getId())); }
Source:
public void testWarningsAreAvailableAsap() throws SQLException, InterruptedException, ExecutionException { con.createStatement() .execute("CREATE OR REPLACE FUNCTION notify_then_sleep() RETURNS VOID AS " + "$BODY$ " + "BEGIN " + "RAISE NOTICE 'Test 1'; " + "RAISE NOTICE 'Test 2'; " + "EXECUTE pg_sleep(2); " + "END " + "$BODY$ " + "LANGUAGE plpgsql;"); con.createStatement().execute("SET SESSION client_min_messages = 'NOTICE'"); final PreparedStatement preparedStatement = con.prepareStatement("SELECT notify_then_sleep()"); final AtomicReference<SQLWarning> warning = new AtomicReference<SQLWarning>(); ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1); ScheduledFuture<?> future = executorService.schedule(new Runnable() { @Override public void run() { try { warning.set(preparedStatement.getWarnings()); } catch (SQLException e) { fail("Exception thrown: " + e.getMessage()); } } }, 1000, TimeUnit.MILLISECONDS); preparedStatement.execute(); future.get(); executorService.shutdown(); assertNotNull(warning.get()); assertEquals(warning.get().getMessage(), "Test 1"); assertEquals(warning.get().getNextWarning().getMessage(), "Test 2"); }

Target:
public void testWarningsAreAvailableAsap() throws Exception { final Connection outerLockCon = TestUtil.openDB(); outerLockCon.setAutoCommit(false); outerLockCon.createStatement().execute("LOCK TABLE test_lock IN ACCESS EXCLUSIVE MODE;"); con.createStatement() .execute("CREATE OR REPLACE FUNCTION notify_then_sleep() RETURNS VOID AS " + "$BODY$ " + "BEGIN " + "RAISE NOTICE 'Test 1'; " + "RAISE NOTICE 'Test 2'; " + "LOCK TABLE test_lock IN ACCESS EXCLUSIVE MODE; " + "END " + "$BODY$ " + "LANGUAGE plpgsql;"); con.createStatement().execute("SET SESSION client_min_messages = 'NOTICE'"); con.createStatement().execute("SET SESSION statement_timeout = 1000"); final PreparedStatement preparedStatement = con.prepareStatement("SELECT notify_then_sleep()"); final Callable<Void> warningReader = new Callable<Void>() { @Override public Void call() throws SQLException, InterruptedException { while (true) { SQLWarning warning = preparedStatement.getWarnings(); if (warning != null) { assertEquals("First warning received not first notice raised", "Test 1", warning.getMessage()); SQLWarning next = warning.getNextWarning(); if (next != null) { assertEquals("Second warning received not second notice raised", "Test 2", next.getMessage()); outerLockCon.commit(); return null; } } Thread.sleep(0); } } }; ExecutorService executorService = Executors.newSingleThreadExecutor(); try { Future<Void> future = executorService.submit(warningReader); preparedStatement.execute(); future.get(2, TimeUnit.SECONDS); } finally { executorService.shutdownNow(); } }
Source:
public Response getHistogram(@QueryParam("queryId") final Long queryId, @QueryParam("fragmentId") final Long fragmentId, @QueryParam("start") final Long start, @QueryParam("end") final Long end, @QueryParam("step") final Long step, @DefaultValue("true") @QueryParam("onlyRootOp") final boolean onlyRootOp, @Context final UriInfo uriInfo) throws DbException { Preconditions.checkArgument(queryId != null, "Missing required field queryId."); Preconditions.checkArgument(fragmentId != null, "Missing required field fragmentId."); Preconditions.checkArgument(start != null, "Missing required field start."); Preconditions.checkArgument(end != null, "Missing required field end."); Preconditions.checkArgument(step != null, "Missing required field step."); ResponseBuilder response = Response.ok(); response.type(MediaType.TEXT_PLAIN); PipedOutputStream writerOutput = new PipedOutputStream(); PipedInputStream input; try { input = new PipedInputStream(writerOutput, MyriaConstants.DEFAULT_PIPED_INPUT_STREAM_SIZE); } catch (IOException e) { throw new DbException(e); } PipedStreamingOutput entity = new PipedStreamingOutput(input); response.entity(entity); TupleWriter writer = new CsvTupleWriter(writerOutput); try { server.startHistogramDataStream(queryId, fragmentId, start, end, step, onlyRootOp, writer); } catch (IllegalArgumentException e) { throw new MyriaApiException(Status.BAD_REQUEST, e); } return response.build(); }

Target:
public Response getHistogram(@QueryParam("queryId") final Long queryId, @QueryParam("fragmentId") final Long fragmentId, @QueryParam("start") final Long start, @QueryParam("end") final Long end, @QueryParam("step") final Long step, @DefaultValue("true") @QueryParam("onlyRootOp") final boolean onlyRootOp, @Context final UriInfo uriInfo) throws DbException { Preconditions.checkArgument(queryId != null, "Missing required field queryId."); Preconditions.checkArgument(fragmentId != null, "Missing required field fragmentId."); Preconditions.checkArgument(start != null, "Missing required field start."); Preconditions.checkArgument(end != null, "Missing required field end."); Preconditions.checkArgument(step != null, "Missing required field step."); ResponseBuilder response = Response.ok(); response.type(MediaType.TEXT_PLAIN); PipedOutputStream writerOutput = new PipedOutputStream(); PipedInputStream input; try { input = new PipedInputStream(writerOutput, MyriaConstants.DEFAULT_PIPED_INPUT_STREAM_SIZE); } catch (IOException e) { throw new DbException(e); } PipedStreamingOutput entity = new PipedStreamingOutput(input); response.entity(entity); TupleWriter writer = new CsvTupleWriter(writerOutput); server.startHistogramDataStream(queryId, fragmentId, start, end, step, onlyRootOp, writer); return response.build(); }
Source:
public IApsEntity getEntityPrototype() { Content content = (Content) super.getEntityPrototype(); content.setStatus(STATUS_DRAFT); content.setVersion(INIT_VERSION); content.setViewPage(viewPage); content.setListModel(listModel); content.setDefaultModel(defaultModel); return content; }

Target:
public IApsEntity getEntityPrototype() { Content content = (Content) super.getEntityPrototype(); content.setStatus(STATUS_NEW); content.setVersion(INIT_VERSION); content.setViewPage(viewPage); content.setListModel(listModel); content.setDefaultModel(defaultModel); return content; }
Source:
public void convert() { String value = "2010-12-07T00:00:00Z"; assertEquals(new LocalDate(2010, 12, 07), converter.convert(value)); }

Target:
public void convert() { String value = "2010-12-07T00:00:00Z"; assertEquals(new LocalDate(2010, 12, 7), converter.convert(value)); }
Source:
protected void doDelete(){ final String name = group.getName(); AuthorizationPolicy authzPolicy = permissionManager.getAuthorizationPolicy(); authorizationService.call(r -> { deleteGroupEvent.fire(new DeleteGroupEvent(name)); workbenchNotification.fire(new NotificationEvent(UsersManagementWidgetsConstants.INSTANCE.groupRemoved(name), INFO)); }, errorCallback).deletePolicyByGroup(group, authzPolicy); }

Target:
protected void doDelete(){ final String name = group.getName(); AuthorizationPolicy authzPolicy = permissionManager.getAuthorizationPolicy(); showLoadingBox(); authorizationService.call(r -> { hideLoadingBox(); deleteGroupEvent.fire(new DeleteGroupEvent(name)); workbenchNotification.fire(new NotificationEvent(UsersManagementWidgetsConstants.INSTANCE.groupRemoved(name), INFO)); }, errorCallback).deletePolicyByGroup(group, authzPolicy); }
Source:
public FileChannel newChannel(ChannelPipeline pipeline) { return new FileChannel(this, pipeline, new FileChannelSink()); }

Target:
public FileChannel newChannel(ChannelPipeline pipeline) { return new FileChannel(this, pipeline, fileChannelSink); }
Source:
public void ArticleCRUDUser_001_addBySpecialPage() { WikiBasePageObject base = new WikiBasePageObject(driver); String articleContent = PageContent.articleText; String articleTitle = PageContent.articleNamePrefix + base.getTimeStamp(); SpecialCreatePagePageObject specialCreatePage = base.openSpecialCreatePage(wikiURL); VisualEditModePageObject visualEditMode = specialCreatePage.populateTitleField(articleTitle); visualEditMode.addContent(articleContent); ArticlePageObject article = (ArticlePageObject) visualEditMode.submit(PageType.Article); article.verifyContent(articleContent); article.verifyArticleTitle(articleTitle); }

Target:
public void ArticleCRUDUser_001_addBySpecialPage() { WikiBasePageObject base = new WikiBasePageObject(driver); String articleContent = PageContent.articleText; String articleTitle = PageContent.articleNamePrefix + base.getTimeStamp(); SpecialCreatePagePageObject specialCreatePage = base.openSpecialCreatePage(wikiURL); VisualEditModePageObject visualEditMode = specialCreatePage.populateTitleField(articleTitle); visualEditMode.addContent(articleContent); ArticlePageObject article = visualEditMode.submitArticle(); article.verifyContent(articleContent); article.verifyArticleTitle(articleTitle); }
Source:
private void changeSchedulerVer(Integer ver) throws ConfirmModSchemaException { if (ver == schedVer()) { return; } if (!fSupportedSchedulerVersions.contains(ver)) { throw new RuntimeException("Unsupported scheduler version"); } modSchema(true); SchedV2 v2Sched = new SchedV2(this); if (ver == 1) { v2Sched.moveToV1() } else { v2Sched.moveToV2(); } try { mConf.put("schedVer", ver); } catch (JSONException e) { throw new RuntimeException(e); } setMod(); _loadScheduler(); }

Target:
private void changeSchedulerVer(Integer ver) throws ConfirmModSchemaException { if (ver == schedVer()) { return; } if (!fSupportedSchedulerVersions.contains(ver)) { throw new RuntimeException("Unsupported scheduler version"); } modSchema(true); SchedV2 v2Sched = new SchedV2(this); if (ver == 1) { v2Sched.moveToV1(); } else { v2Sched.moveToV2(); } try { mConf.put("schedVer", ver); } catch (JSONException e) { throw new RuntimeException(e); } setMod(); _loadScheduler(); }
Source:
public Promise getContent() { flush(); displayNotifications(false); AbstractCanvasHandler canvasHandler = (AbstractCanvasHandler) getCanvasHandler(); validator.validate(canvasHandler, violations -> { if (!violations.isEmpty()) { List<String> violationMessages = new ArrayList<>(); for (DiagramElementViolation<RuleViolation> next : violations) { final Collection<DomainViolation> domainViolations = next.getDomainViolations(); domainViolations.forEach(item -> violationMessages.add("Error: " + item.getUUID() + " - " + item.getMessage() + " - " + item.getViolationType())); } getEditor().getSessionPresenter().getView().showWarning("Errors: " + violationMessages); } }); displayNotifications(true); return diagramServices.transform(getEditor().getEditorProxy().getContentSupplier().get()); }

Target:
public Promise getContent() { flush(); getSessionPresenter().displayNotifications(t -> false); AbstractCanvasHandler canvasHandler = (AbstractCanvasHandler) getCanvasHandler(); validator.validate(canvasHandler, violations -> { String errorMessage = getTranslationService().getValue(StunnerWidgetsConstants.MarshallingResponsePopup_ErrorMessageLabel); if (!violations.isEmpty()) { List<String> violationMessages = new ArrayList<>(); for (DiagramElementViolation<RuleViolation> next : violations) { final Collection<DomainViolation> domainViolations = next.getDomainViolations(); domainViolations.forEach(item -> violationMessages.add(errorMessage + ": " + item.getUUID() + " - " + item.getMessage() + " - " + item.getViolationType())); } getEditor().getSessionPresenter().getView().showWarning(errorMessage + "(s): " + violationMessages); } }); getSessionPresenter().displayNotifications(t -> true); return diagramServices.transform(getEditor().getEditorProxy().getContentSupplier().get()); }
Source:
public synchronized static <T> EventType<T> addCustomEventType(String name, Class<T> listenerClass) { if ( name == null || listenerClass == null ) { throw new HibernateException( "Custom EventType name and associated class must be non-null." ); } final EventType existingEventType = EVENT_TYPE_BY_NAME_MAP.get( name ); if ( existingEventType != null ) { if ( listenerClass.equals( existingEventType.baseListenerInterface ) ) { LOG.warn( "EventType [" + name + "] with listener Class [" + listenerClass + "] was added more than once." ); return existingEventType; } else { throw new HibernateException( "Could not add EventType [" + name + "] with listener Class [" + "]. An EventType with that name already exists with listener [" + listenerClass.getName() + "]." ); } } else { final EventType<T> eventType = create( name, listenerClass ); EVENT_TYPE_BY_NAME_MAP.put( name, eventType ); LOG.info( "Added custom EventType: [" + name + "], ordinal=[" +eventType.ordinal + "], listener=[" + listenerClass + "]." ); return eventType; } }

Target:
public static synchronized <T> EventType<T> addCustomEventType(String name, Class<T> listenerClass) { if ( name == null || listenerClass == null ) { throw new HibernateException( "Custom EventType name and associated class must be non-null." ); } final EventType eventType = EVENT_TYPE_BY_NAME_MAP.computeIfAbsent( name, ( e -> { final EventType eventTypeNew = EventType.create( name, listenerClass ); LOG.debugf( "Added custom EventType: [%s], ordinal=[%d], listener=[%s].", name, eventTypeNew.ordinal, listenerClass.toString() ); return eventTypeNew; } ) ); if ( !listenerClass.equals( eventType.baseListenerInterface ) ) { throw new HibernateException( "Could not add EventType [" + name + "] with listener Class [" + "]. An EventType with that name already exists with listener [" + listenerClass.getName() + "]." ); } return eventType; }
Source:
public static Media from(MwQueryPage page) { ImageInfo imageInfo = page.imageInfo(); if (imageInfo == null) { return null; } String imagedescription; try { imagedescription = imageInfo.getMetadata().imageDescription().value(); } catch (NullPointerException e) { imagedescription = "null"; } Date dateCreated; try { dateCreated = DateUtils.getDateFromString(imageInfo.getMetadata().getDateTimeOriginal().value()); } catch (NullPointerException e) { dateCreated = new Date(); } Date dateUploaded; try { dateUploaded = DateUtils.getDateFromString(imageInfo.getMetadata().getDateTime().value()); } catch (NullPointerException e) { dateUploaded = new Date(); } String creator; try { creator = StringUtils.getParsedStringFromHtml(imageInfo.getMetadata().getArtist().value()); } catch (NullPointerException e) { creator = "null"; } Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), imagedescription, 0, dateCreated, dateUploaded, creator ); String license; try { license = imageInfo.getMetadata().getLicenseShortName().value(); } catch (NullPointerException e) { license = "null"; } media.setLicense(license); return media; }

Target:
public static Media from(MwQueryPage page) { ImageInfo imageInfo = page.imageInfo(); if (imageInfo == null) { return null; } String imagedescription; try { imagedescription = imageInfo.getMetadata().imageDescription().value(); } catch (NullPointerException e) { imagedescription = ""; } Date dateCreated; try { dateCreated = DateUtils.getDateFromString(imageInfo.getMetadata().getDateTimeOriginal().value()); } catch (NullPointerException e) { dateCreated = new Date(); } Date dateUploaded; try { dateUploaded = DateUtils.getDateFromString(imageInfo.getMetadata().getDateTime().value()); } catch (NullPointerException e) { dateUploaded = new Date(); } String creator; try { creator = StringUtils.getParsedStringFromHtml(imageInfo.getMetadata().getArtist().value()); } catch (NullPointerException e) { creator = ""; } Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), imagedescription, 0, dateCreated, dateUploaded, creator ); String license; try { license = imageInfo.getMetadata().getLicenseShortName().value(); } catch (NullPointerException e) { license = ""; } media.setLicense(license); return media; }
Source:
private void handleAllocation(CorfuPayloadMsg<TokenRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { final TokenRequest req = msg.getPayload(); long newTail = globalLogTail + req.getNumTokens(); ImmutableMap.Builder<UUID, Long> backPointerMap = ImmutableMap.builder(); for (UUID id : req.getStreams()) { streamTailToGlobalTailMap.compute(id, (k, v) -> { if (v == null) { backPointerMap.put(k, Address.NON_EXIST); return newTail - 1; } else { backPointerMap.put(k, v); return newTail - 1; } }); streamsAddressSpaceMap.compute(id, (k, v) -> { if (v == null) { final Roaring64NavigableMap addressMap = new Roaring64NavigableMap(); for (long i=globalLogTail; i < newTail; i++) { addressMap.addLong(i); } return new StreamAddressSpace(Address.NON_EXIST, addressMap); } else { for (long i=globalLogTail; i < newTail; i++) { v.addAddress(i); } return v; } }); } if (req.getTxnResolution() != null) { req.getTxnResolution() .getWriteConflictParams() .forEach((key, value) -> { value.forEach(conflictParam -> cache.put(new ConflictTxStream(key, conflictParam), newTail - 1)); }); } log.trace("token backpointers {}", globalLogTail, backPointerMap.build()); Token token = new Token(sequencerEpoch, globalLogTail); globalLogTail = newTail; r.sendResponse(ctx, msg, CorfuMsgType.TOKEN_RES.payloadMsg( new TokenResponse(token, backPointerMap.build()))); }

Target:
private void handleAllocation(CorfuPayloadMsg<TokenRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { final TokenRequest req = msg.getPayload(); long newTail = globalLogTail + req.getNumTokens(); ImmutableMap.Builder<UUID, Long> backPointerMap = ImmutableMap.builder(); for (UUID id : req.getStreams()) { streamTailToGlobalTailMap.compute(id, (k, v) -> { if (v == null) { backPointerMap.put(k, Address.NON_EXIST); return newTail - 1; } else { backPointerMap.put(k, v); return newTail - 1; } }); streamsAddressMap.compute(id, (streamId, addressMap) -> { if (addressMap == null) { addressMap = new StreamAddressSpace(Address.NON_ADDRESS, new Roaring64NavigableMap()); } for (long i = globalLogTail; i < newTail; i++) { addressMap.addAddress(i); } return addressMap; }); } if (req.getTxnResolution() != null) { req.getTxnResolution() .getWriteConflictParams() .forEach((key, value) -> { value.forEach(conflictParam -> cache.put(new ConflictTxStream(key, conflictParam), newTail - 1)); }); } log.trace("token backpointers {}", globalLogTail, backPointerMap.build()); Token token = new Token(sequencerEpoch, globalLogTail); globalLogTail = newTail; r.sendResponse(ctx, msg, CorfuMsgType.TOKEN_RES.payloadMsg( new TokenResponse(token, backPointerMap.build()))); }