auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean originalFileUsedInFurtherBatches(String originalFile, List<VersionOnePartialDownloadBatch> partialDownloadBatches, List<CompletedDownloadBatch> completeDownloadBatches) { for (VersionOnePartialDownloadBatch partialDownloadBatch : partialDownloadBatches) { <START> for (String originalFileLocation : partialDownloadBatch.originalFileLocations()) { <END> if (originalFileLocation.equals(originalFile)) { return true; } } } for (CompletedDownloadBatch completeDownloadBatch : completeDownloadBatches) { for (CompletedDownloadFile completedDownloadFile : completeDownloadBatch.completedDownloadFiles()) { if (completedDownloadFile.originalFileLocation().equals(originalFile)) { return true; } } } return false; }</code><technical_language>simply do if (partialDownloadBatch.originalFileLocations().contains(originalFile)) { return true; }</technical_language>

Target:
private boolean originalFileUsedInFurtherBatches(String originalFile, List<VersionOnePartialDownloadBatch> partialDownloadBatches, List<CompletedDownloadBatch> completeDownloadBatches) { for (VersionOnePartialDownloadBatch partialDownloadBatch : partialDownloadBatches) { if (partialDownloadBatch.originalFileLocations().contains(originalFile)) { return true; } } for (CompletedDownloadBatch completeDownloadBatch : completeDownloadBatches) { for (CompletedDownloadFile completedDownloadFile : completeDownloadBatch.completedDownloadFiles()) { if (completedDownloadFile.originalFileLocation().equals(originalFile)) { return true; } } } return false; }
Source:
<code>protected CorrelationData generateCorrelationData(Message<?> requestMessage) { CorrelationData correlationData = null; if (this.correlationDataGenerator != null) { UUID messageId = requestMessage.getHeaders().getId(); if (messageId == null) { messageId = NO_ID; } Object userData = this.correlationDataGenerator.processMessage(requestMessage); if (userData != null) { <START> correlationData = new CorrelationDataWrapper(messageId.toString(), userData, requestMessage); <END> } } return correlationData; }</code><technical_language>previously a CorrelationDataWrapper instance independently of userData, restrict if is null. I protected null in CorrelationDataWrapper way. So, is motivation do more</technical_language>

Target:
protected CorrelationData generateCorrelationData(Message<?> requestMessage) { CorrelationData correlationData = null; if (this.correlationDataGenerator != null) { UUID messageId = requestMessage.getHeaders().getId(); if (messageId == null) { messageId = NO_ID; } Object userData = this.correlationDataGenerator.processMessage(requestMessage); if (userData != null) { correlationData = new CorrelationDataWrapper(messageId.toString(), userData, requestMessage); } else { this.logger.debug("'confirmCorrelationExpression' resolved to 'null'; " + "no publisher confirm will be sent to the ack or nack channel"); } } return correlationData; }
Source:
<code>public void shutdown(ShutdownInput shutDownInput) { <START> if (shutDownInput.getShutdownReason().equals(ShutdownReason.TERMINATE)) { <END> commitCheckPoint(shutDownInput.getCheckpointer()); } }</code><technical_language>java if (ShutdownReason.TERMINATE.equals(shutDownInput.getShutdownReason()) {</technical_language>

Target:
public void shutdown(ShutdownInput shutDownInput) { if (ShutdownReason.TERMINATE.equals(shutDownInput.getShutdownReason())) { commitCheckPoint(shutDownInput.getCheckpointer()); } }
Source:
<code>public void createWithHistory(DocumentRevision revision, int revisionsStart, List<String> revisionsIDs) throws DocumentException { Map<String, Attachment> attachments = revision.getAttachments(); Collections.list(Collections.enumeration(revision.getAttachments().values())); InternalDocumentRevision internalRev = new DocumentRevisionBuilder() .setDocId(revision.getId()) .setRevId(revision.getRevision()) .setBody(revision.getBody()) .setAttachments(attachments) .setDeleted(revision.isDeleted()) .build(); Map<String[], Map<String, PreparedAttachment>> preparedAttachments = Collections .singletonMap (new String[]{revision.getId(), revision.getRevision()}, AttachmentManager .prepareAttachments(attachmentsDir, attachmentStreamFactory, attachments)); <START> Map<String, Object> attachmentsMetadata = new HashMap<String, Object>(); <END> attachmentsMetadata.putAll(revision.getAttachments()); Map<String, Object> revisions = new HashMap<String, Object>(2); revisions.put("start", revisionsStart); revisions.put("ids", Collections.list(Collections.enumeration(revisionsIDs))); List<String> revIDs = CouchUtils.parseCouchDBRevisionHistory(Collections.<String, Object> singletonMap(CouchConstants._revisions, revisions)); Collections.reverse(revIDs); forceInsert(Collections.singletonList(new ForceInsertItem(internalRev, revIDs, attachmentsMetadata, preparedAttachments, false))); }</code><technical_language>I this does. revision.getAttachments() return a Map<String, Attachment> need is metadata in format returned raw json, "_attachments":{ "attachmenta305ba51-4a93-4ef7-8b99-b64b3e633243" { "follows":true,"length":86,"content_type":"image/jpeg"}..</technical_language>

Target:
public void createWithHistory(DocumentRevision revision, int revisionsStart, List<String> revisionsIDs) throws DocumentException { Misc.checkNotNull(revision, "DocumentRevision"); Misc.checkArgument(revisionsStart > 0, "revisionsStart must be greater than zero, but was" + " " + revisionsStart + "."); Misc.checkArgument(revisionsIDs != null && revisionsIDs.size() > 0, "revisionsIDs history" + " list must not be null or empty."); Map<String, Attachment> attachments = revision.getAttachments(); Collections.list(Collections.enumeration(revision.getAttachments().values())); InternalDocumentRevision internalRev = new DocumentRevisionBuilder() .setDocId(revision.getId()) .setRevId(revision.getRevision()) .setBody(revision.getBody()) .setAttachments(attachments) .setDeleted(revision.isDeleted()) .build(); Map<String[], Map<String, PreparedAttachment>> preparedAttachments = Collections .singletonMap (new String[]{revision.getId(), revision.getRevision()}, AttachmentManager .prepareAttachments(attachmentsDir, attachmentStreamFactory, attachments)); List<String> revIDs = CouchUtils.couchStyleRevisionHistoryToFullRevisionIDs (revisionsStart, revisionsIDs); forceInsert(Collections.singletonList(new ForceInsertItem(internalRev, revIDs, null, preparedAttachments, false))); }
Source:
<code>private DispatcherJob( CompletableFuture<JobManagerRunner> jobManagerRunnerFuture, JobID jobId, String jobName) { this.jobManagerRunnerFuture = jobManagerRunnerFuture; this.jobId = jobId; this.jobName = jobName; this.initializationTimestamp = System.currentTimeMillis(); this.jobResultFuture = new CompletableFuture<>(); FutureUtils.assertNoException(this.jobManagerRunnerFuture.handle((jobManagerRunner, throwable) -> { synchronized (lock) { if (jobStatus != DispatcherJobStatus.CANCELLING) { jobStatus = DispatcherJobStatus.JOB_MANAGER_RUNNER_INITIALIZED; } if (throwable == null) { <START> jobManagerRunner.getResultFuture().whenComplete((archivedExecutionGraph, resultThrowable) -> { if (archivedExecutionGraph != null) { jobResultFuture.complete(DispatcherJobResult.forSuccess(archivedExecutionGraph)); <END> } else { jobResultFuture.completeExceptionally(ExceptionUtils.stripCompletionException(resultThrowable)); } }); } else { final Throwable strippedThrowable = ExceptionUtils.stripCompletionException(throwable); ArchivedExecutionGraph archivedExecutionGraph = ArchivedExecutionGraph.createFromInitializingJob( jobId, jobName, JobStatus.FAILED, strippedThrowable, initializationTimestamp); jobResultFuture.complete(DispatcherJobResult.forInitializationFailure(archivedExecutionGraph, strippedThrowable)); } } return null; })); }</code><technical_language>express this block a bit more succinctly: FutureUtils.forward( jobManagerRunner.getResultFuture().thenApply(DispatcherJobResult::forSuccess), jobResultFuture);</technical_language>

Target:
private DispatcherJob( CompletableFuture<JobManagerRunner> jobManagerRunnerFuture, JobID jobId, String jobName) { this.jobManagerRunnerFuture = jobManagerRunnerFuture; this.jobId = jobId; this.jobName = jobName; this.initializationTimestamp = System.currentTimeMillis(); this.jobResultFuture = new CompletableFuture<>(); FutureUtils.assertNoException(this.jobManagerRunnerFuture.handle((jobManagerRunner, throwable) -> { synchronized (lock) { jobStatus = DispatcherJobStatus.JOB_MANAGER_RUNNER_INITIALIZED; if (throwable == null) { jobManagerRunner.getResultFuture().whenComplete((archivedExecutionGraph, resultThrowable) -> { if (archivedExecutionGraph != null) { jobResultFuture.complete(DispatcherJobResult.forSuccess(archivedExecutionGraph)); } else { jobResultFuture.completeExceptionally(ExceptionUtils.stripCompletionException(resultThrowable)); } }); } else { final Throwable strippedThrowable = ExceptionUtils.stripCompletionException(throwable); ArchivedExecutionGraph archivedExecutionGraph = ArchivedExecutionGraph.createFromInitializingJob( jobId, jobName, JobStatus.FAILED, strippedThrowable, initializationTimestamp); jobResultFuture.complete(DispatcherJobResult.forInitializationFailure(archivedExecutionGraph, strippedThrowable)); } } return null; })); }
Source:
<code>public CustomEntryTypeViewModel(BibEntryType entryType) { this.entryType.set(entryType); List<FieldViewModel> allFieldsForType = entryType.getAllFields().stream().map(bibField -> new FieldViewModel(bibField.getField(), entryType.isRequired(bibField.getField()), bibField.getPriority(), entryType)).collect(Collectors.toList()); fields = new SimpleListProperty<>(FXCollections.observableArrayList(allFieldsForType)); <START> fields.addListener((ListChangeListener<? super FieldViewModel>) change -> { <END> while (change.next()) { if (change.wasRemoved()) { fieldsToRemove.addAll(change.getAddedSubList()); } } }); }</code><technical_language>This a bit complicated. simply compare/overwrite on-save list of fields new one</technical_language>

Target:
public CustomEntryTypeViewModel(BibEntryType entryType) { this.entryType.set(entryType); List<FieldViewModel> allFieldsForType = entryType.getAllBibFields().stream().map(bibField -> new FieldViewModel(bibField.getField(), entryType.isRequired(bibField.getField()), bibField.getPriority())).collect(Collectors.toList()); fields = FXCollections.observableArrayList((allFieldsForType)); }
Source:
<code>public void addAllReviewers(ChangeAttribute a, Change change) throws OrmException { ResultSet<PatchSetApproval> approvals = db.get().patchSetApprovals().byChange(change.getId()); <START> if (approvals.iterator().hasNext()) { <END> a.allReviewers = Lists.newArrayList(); ArrayList<Object> accountIdlist = Lists.newArrayList(); for (PatchSetApproval psa : approvals) { Account.Id accountId = psa.getAccountId(); if (!accountIdlist.contains(accountId)) { accountIdlist.add(accountId); a.allReviewers.add(asAccountAttribute(psa.getAccountId())); } } } }</code><technical_language>run iterator twice. Drop if this block delay assigning a.allReviewers if list is built test isEmpty()</technical_language>

Target:
public void addAllReviewers(ChangeAttribute a, Change change) throws OrmException { ResultSet<PatchSetApproval> approvals = db.get().patchSetApprovals().byChange(change.getId()); a.allReviewers = Lists.newArrayList(); Set<Account.Id> accountIdlist = new HashSet<Account.Id>(); for (PatchSetApproval psa : approvals) { Account.Id accountId = psa.getAccountId(); if (!accountIdlist.contains(accountId)) { accountIdlist.add(accountId); a.allReviewers.add(asAccountAttribute(psa.getAccountId())); } } if (a.allReviewers.isEmpty()) { a.allReviewers = null; } }
Source:
<code>public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(37, 7) .append(super.hashCode()) .append(this.getId()) .append(this.getName()) .append(this.getDescription()) .append(this.getOwner() != null ? this.getOwner().getId() : null) .append(this.getReleaseVer()) .append(this.getServiceLevel()) .append(this.isAutoAttach()) .append(this.getPools()) <START> .append(this.getProducts()); <END> return builder.toHashCode(); }</code><technical_language>deal here. Hibernate's containers tend adhere contract .equals .hashCode, risk of running issues violations present. Product.hashCode another example for this scenario</technical_language>

Target:
public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(7, 17) .append(this.id); return builder.toHashCode(); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { <START> <END> final RepositoryTreeNode node = getSelectedNodes(event).get(0); final Ref baseBranch; if (node.getObject() instanceof Ref) { baseBranch = (Ref) node.getObject(); } else { baseBranch = null; } Wizard wiz = new Wizard() { @Override public void addPages() { addPage(new CreateBranchPage(node.getRepository(), baseBranch)); setWindowTitle(UIText.RepositoriesView_NewBranchTitle); } @Override public boolean performFinish() { try { getContainer().run(false, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { CreateBranchPage cp = (CreateBranchPage) getPages()[0]; try { cp.createBranch(monitor); } catch (CoreException ce) { throw new InvocationTargetException(ce); } catch (IOException ioe) { throw new InvocationTargetException(ioe); } } }); } catch (InvocationTargetException ite) { Activator .handleError( UIText.RepositoriesView_BranchCreationFailureMessage, ite.getCause(), true); return false; } catch (InterruptedException ie) { } return true; } }; new WizardDialog(getView(event).getSite().getShell(), wiz).open(); return null; }</code><technical_language>unnecessary blank line</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { final RepositoryTreeNode node = getSelectedNodes(event).get(0); final Ref baseBranch; if (node.getObject() instanceof Ref) baseBranch = (Ref) node.getObject(); else baseBranch = null; Wizard wiz = new Wizard() { @Override public void addPages() { addPage(new CreateBranchPage(node.getRepository(), baseBranch)); setWindowTitle(UIText.RepositoriesView_NewBranchTitle); } @Override public boolean performFinish() { try { getContainer().run(false, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { CreateBranchPage cp = (CreateBranchPage) getPages()[0]; try { cp.createBranch(monitor); } catch (CoreException ce) { throw new InvocationTargetException(ce); } catch (IOException ioe) { throw new InvocationTargetException(ioe); } } }); } catch (InvocationTargetException ite) { Activator .handleError( UIText.RepositoriesView_BranchCreationFailureMessage, ite.getCause(), true); return false; } catch (InterruptedException ie) { } return true; } }; new WizardDialog(getView(event).getSite().getShell(), wiz).open(); return null; }
Source:
<code>public void load(String mountTableConfigPath, Configuration conf) throws IOException { this.mountTablePath = new Path(mountTableConfigPath); String scheme = mountTablePath.toUri().getScheme(); ViewFileSystem.FsGetter fsGetter = new ViewFileSystemOverloadScheme.ChildFsGetter(scheme); FileSystem fs = fsGetter.getNewInstance(mountTablePath.toUri(), conf); RemoteIterator<LocatedFileStatus> listFiles = fs.listFiles(mountTablePath, false); LocatedFileStatus lfs = null; <START> int higheirVersion = -1; <END> while (listFiles.hasNext()) { LocatedFileStatus curLfs = listFiles.next(); String cur = curLfs.getPath().getName(); String[] nameParts = cur.split(REGEX_DOT); if (nameParts.length < 2) { logInvalidFileNameFormat(cur); continue; } int curVersion = higheirVersion; try { curVersion = Integer.parseInt(nameParts[nameParts.length - 2]); } catch (NumberFormatException nfe) { logInvalidFileNameFormat(cur); continue; } if (curVersion > higheirVersion) { higheirVersion = curVersion; lfs = curLfs; } } if (lfs == null) { LOGGER.warn("No valid mount-table file exist at: " + mountTableConfigPath + ". At least one mount-table file should present with the name " + "format: mount-table.<versionNumber>.xml"); return; } Path letestVersionMountTable = lfs.getPath(); conf.addResource(fs.open(letestVersionMountTable)); }</code><technical_language>typo? higheirVersion --> higherVersion</technical_language>

Target:
public void load(String mountTableConfigPath, Configuration conf) throws IOException { this.mountTable = new Path(mountTableConfigPath); String scheme = mountTable.toUri().getScheme(); ViewFileSystem.FsGetter fsGetter = new ViewFileSystemOverloadScheme.ChildFsGetter(scheme); try (FileSystem fs = fsGetter.getNewInstance(mountTable.toUri(), conf)) { RemoteIterator<LocatedFileStatus> listFiles = fs.listFiles(mountTable, false); LocatedFileStatus lfs = null; int higherVersion = -1; while (listFiles.hasNext()) { LocatedFileStatus curLfs = listFiles.next(); String cur = curLfs.getPath().getName(); String[] nameParts = cur.split(REGEX_DOT); if (nameParts.length < 2) { logInvalidFileNameFormat(cur); continue; } int curVersion = higherVersion; try { curVersion = Integer.parseInt(nameParts[nameParts.length - 2]); } catch (NumberFormatException nfe) { logInvalidFileNameFormat(cur); continue; } if (curVersion > higherVersion) { higherVersion = curVersion; lfs = curLfs; } } if (lfs == null) { LOGGER.warn("No valid mount-table file exist at: {}. At least one " + "mount-table file should present with the name format: " + "mount-table.<versionNumber>.xml", mountTableConfigPath); return; } Path latestVersionMountTable = lfs.getPath(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Loading the mount-table into configuration.", latestVersionMountTable); } try (FSDataInputStream open = fs.open(latestVersionMountTable)) { Configuration newConf = new Configuration(false); newConf.addResource(open); conf.addResource(newConf); } } }
Source:
<code>public void put(String key, String value) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(value, "'value' must not be null."); <START> Map<String,String> fileInfo = new HashMap(); <END> fileInfo.put(ID_FIELD, key); fileInfo.put(VALUE, value); template.save(fileInfo, collectionName); }</code><technical_language>Nit-pick for variable name. is file, entry good. new HashMap() is bad code too. generics</technical_language>

Target:
public void put(String key, String value) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(value, "'value' must not be null."); final Map<String, String> entry = new HashMap<String, String>(); entry.put(ID_FIELD, key); entry.put(VALUE, value); template.execute(collectionName, (CollectionCallback<Object>) collection -> collection .save(new BasicDBObject(entry))); }
Source:
<code><START> public Duration getElapsedAttemptTime() { <END> return Optional.ofNullable(attemptStartTime).map(x -> new Duration(System.nanoTime() - x.toNanos(), TimeUnit.NANOSECONDS)).orElse(null); }</code><technical_language>Optional Failsafe is Java 6 compatible... this throw a ClassNotFoundException (or similar) for pre-Java 8 users</technical_language>

Target:
public Duration getElapsedAttemptTime() { if (attemptStartTime == null) { return null; } return new Duration(System.nanoTime() - attemptStartTime.toNanos(), TimeUnit.NANOSECONDS); }
Source:
<code><START> public void testDecodeManagedBlob() throws Exception { <END> String emptyKeyJson = "{\"providerId\":\"testBlobProvider\"}"; ObjectMapper om = new ObjectMapper(); Blob blob = ComplexTypeJSONDecoder.getBlobFromJSON((ObjectNode) om.readTree(emptyKeyJson)); assertNull(blob); String unknownProviderJson = "{\"providerId\":\"fakeBlobProvider\", \"key\":\"testKey\"}"; blob = ComplexTypeJSONDecoder.getBlobFromJSON((ObjectNode) om.readTree(unknownProviderJson)); assertNull(blob); String json = "{\"providerId\":\"testBlobProvider\", \"key\":\"testKey\"}"; blob = ComplexTypeJSONDecoder.getBlobFromJSON((ObjectNode) om.readTree(json)); assertTrue(blob instanceof ManagedBlob); ManagedBlob managedBlob = (ManagedBlob) blob; assertEquals("testBlobProvider", managedBlob.getProviderId()); assertEquals("testBlobProvider:testKey", managedBlob.getKey()); }</code><technical_language>For clarity split this in 3 methods? 3 categories of tests here..</technical_language>

Target:
public void testDecodeManagedBlob() throws Exception { String json = "{\"providerId\":\"testBlobProvider\", \"key\":\"testKey\"}"; Blob blob = ComplexTypeJSONDecoder.getBlobFromJSON((ObjectNode) OBJECT_MAPPER.readTree(json)); assertTrue(blob instanceof ManagedBlob); ManagedBlob managedBlob = (ManagedBlob) blob; assertEquals("testBlobProvider", managedBlob.getProviderId()); assertEquals("testBlobProvider:testKey", managedBlob.getKey()); }
Source:
<code>public SameSiteCookieHandler(final HttpHandler next, final String mode) { <START> this(next, mode, null, false); <END> }</code><technical_language>do want a disable client checker a default set false, do want a enable-client-checker a default set true? I this work in long term pov, do expect a long list of incompatible user agents in future</technical_language>

Target:
public SameSiteCookieHandler(final HttpHandler next, final String mode) { this(next, mode, null, true, true, true); }
Source:
<code>void renameTo(final String src, final String dst, boolean logRetryCache, Options.Rename... options) throws IOException { final String operationName = "rename (options="+ Arrays.toString(options) + ")"; FSDirRenameOp.RenameResult res = null; checkOperation(OperationCategory.WRITE); final FSPermissionChecker pc = getPermissionChecker(); FSPermissionChecker.setOperationType(operationName); try { writeLock(); try { checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot rename " + src); res = FSDirRenameOp.renameToInt(dir, pc, src, dst, logRetryCache, options); } finally { FileStatus status = res != null ? res.auditStat : null; writeUnlock(operationName, getLockReportInfoSupplier(src, dst, status)); } } catch (AccessControlException e) { <START> logAuditEvent(false, operationName, src, dst, null); <END> throw e; } getEditLog().logSync(); BlocksMapUpdateInfo collectedBlocks = res.collectedBlocks; if (!collectedBlocks.getToDeleteList().isEmpty()) { removeBlocks(collectedBlocks); collectedBlocks.clear(); } logAuditEvent(true, operationName, src, dst, res.auditStat); }</code><technical_language>I need rebase, right</technical_language>

Target:
void renameTo(final String src, final String dst, boolean logRetryCache, Options.Rename... options) throws IOException { final String operationName = "rename"; FSDirRenameOp.RenameResult res = null; checkOperation(OperationCategory.WRITE); final FSPermissionChecker pc = getPermissionChecker(); FSPermissionChecker.setOperationType(operationName); try { writeLock(); try { checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot rename " + src); res = FSDirRenameOp.renameToInt(dir, pc, src, dst, logRetryCache, options); } finally { FileStatus status = res != null ? res.auditStat : null; writeUnlock(operationName, getLockReportInfoSupplier(src, dst, status)); } } catch (AccessControlException e) { logAuditEvent(false, operationName + " (options=" + Arrays.toString(options) + ")", src, dst, null); throw e; } getEditLog().logSync(); BlocksMapUpdateInfo collectedBlocks = res.collectedBlocks; if (!collectedBlocks.getToDeleteList().isEmpty()) { removeBlocks(collectedBlocks); collectedBlocks.clear(); } logAuditEvent(true, operationName + " (options=" + Arrays.toString(options) + ")", src, dst, res.auditStat); }
Source:
<code>public WatchPageObject unfollowVideo(String wikiURL, String videoName) { getUrl( wikiURL + URLsContent.wikiDir + URLsContent.fileNS + videoName+ "?action=unwatch" <START> ); <END> return new WatchPageObject(driver); }</code><technical_language>backspace (bracket tab back)</technical_language>

Target:
public WatchPageObject unfollowVideo(String wikiURL, String videoName) { getUrl( wikiURL + URLsContent.wikiDir + URLsContent.fileNameSpace + videoName + "?action=unwatch" ); return new WatchPageObject(driver); }
Source:
<code>public boolean perform(final AbstractBuild<?, ?> build, final Launcher launcher, final BuildListener listener) throws InterruptedException, IOException { logger.entering("ReleaseWebhookAction", "Perform"); JSONObject json = new JSONObject(); final String payload = JenkinsEventNotifier.getApiJson(build.getUrl()); if (payload != null) { json = JSONObject.fromObject(payload); } json.put("name", build.getProject().getName()); json.put("id", build.getNumber()); json.put("startedBy", getStartedBy(build)); HashMap<String, ReleaseWebHook> nameToWebHookMap = new HashMap<String, ReleaseWebHook>(); for (ReleaseWebHook webHook : ReleaseWebHookHelper.getReleaseWebHookConfigurations()) { nameToWebHookMap.put(webHook.getWebHookName(), webHook); } List<ReleaseWebHookStatus> webHookStatus = new ArrayList<ReleaseWebHookStatus>(); ReleaseWebHook webHook = null; for (ReleaseWebHookName webHookName : webHookNames) { if (nameToWebHookMap.containsKey(webHookName.getWebHookName())) { try { webHook = nameToWebHookMap.get(webHookName.getWebHookName()); logger.fine(String.format("Sending payload event to %s", webHook.getPayloadUrl())); ReleaseWebHookStatus status = sendJobCompletedEvent(json, webHook); webHookStatus.add(status); } catch (Exception ex) { logger.log(Level.SEVERE, null, ex); <START> webHookStatus.add(new ReleaseWebHookStatus(webHook.getPayloadUrl(), HttpURLConnection.HTTP_NOT_FOUND, ex.toString())); <END> } } } build.addAction(new ReleaseWebHookSummaryAction((webHookStatus))); return true; }</code><technical_language>is this hardcoded HTTP_NOT_FOUND</technical_language>

Target:
public boolean perform(final AbstractBuild<?, ?> build, final Launcher launcher, final BuildListener listener) throws InterruptedException, IOException { logger.entering("ReleaseWebhookAction", "Perform"); JSONObject json = new JSONObject(); final String payload = JenkinsEventNotifier.getApiJson(build.getUrl()); if (payload != null) { json = JSONObject.fromObject(payload); } json.put("name", build.getProject().getName()); json.put("id", build.getNumber()); json.put("startedBy", getStartedBy(build)); HashMap<String, ReleaseWebHook> nameToWebHookMap = new HashMap<String, ReleaseWebHook>(); for (ReleaseWebHook webHook : ReleaseWebHookHelper.getReleaseWebHookConfigurations()) { nameToWebHookMap.put(webHook.getWebHookName(), webHook); } List<ReleaseWebHookStatus> webHookStatus = new ArrayList<ReleaseWebHookStatus>(); ReleaseWebHook webHook = null; for (ReleaseWebHookReference webHookName : webHookReferences) { if (nameToWebHookMap.containsKey(webHookName.getWebHookName())) { try { webHook = nameToWebHookMap.get(webHookName.getWebHookName()); logger.fine(String.format("Sending payload event to %s", webHook.getPayloadUrl())); ReleaseWebHookStatus status = sendJobCompletedEvent(json, webHook); webHookStatus.add(status); } catch (Exception ex) { logger.log(Level.SEVERE, StringUtils.EMPTY, ex); webHookStatus.add(new ReleaseWebHookStatus(webHook.getPayloadUrl(), HttpURLConnection.HTTP_INTERNAL_ERROR, ex.toString())); } } } build.addAction(new ReleaseWebHookSummaryAction((webHookStatus))); return true; }
Source:
<code>public void updateSessionAttributes(String id, SessionData updatedSessionData) { synchronized (sessionDataMap) { SessionData sessionData = sessionDataMap.get(id); <START> if (sessionData != null && !sessionData.getAllAttributes().equals(sessionData)) { <END> LOGGER.trace( "Storing new attributes for session at context {}", id, _context.getCanonicalContextPath()); sessionData.clearAllAttributes(); sessionData.putAllAttributes(updatedSessionData.getAllAttributes()); sessionData.setExpiry(updatedSessionData.getExpiry()); } } }</code><technical_language>I noticed this updatedSessionData.getAllAttributes(), sessionData. a big deal, a minor performance tweak, I address this in a follow-on PR</technical_language>

Target:
public void updateSessionAttributes(String id, SessionData updatedSessionData) { synchronized (sessionDataMap) { SessionData sessionData = sessionDataMap.get(id); if (sessionData == null) { return; } if (!sessionData.getAllAttributes().equals(updatedSessionData.getAllAttributes())) { LOGGER.trace( "Storing new attributes for session at context {}", id, _context.getCanonicalContextPath()); sessionData.clearAllAttributes(); sessionData.putAllAttributes(updatedSessionData.getAllAttributes()); } LOGGER.trace( "Updating expiry for session at context to {}", id, _context.getCanonicalContextPath(), updatedSessionData.getExpiry()); sessionData.setExpiry(updatedSessionData.getExpiry()); } }
Source:
<code>static void sleep(long ms) throws IOException { if (ms < 0) { return; } try { Thread.sleep(ms); } catch (InterruptedException e) { <START> throw new IOException(e); <END> } }</code><technical_language>Thread.currentThread().interrupt() catching InterruptedException rethrowing (see item 69, p275-276 in Effective Java edition</technical_language>

Target:
static void sleep(long ms) throws IOException { if (ms < 0) { return; } try { Thread.sleep(ms); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException(e); } }
Source:
<code>private void createNewDiskId() { <START> Guid diskId = !getParameters().isUsePassedDiskId() ? Guid.newGuid() : getParameters().getDiskInfo().getId(); <END> getParameters().getDiskInfo().setId(diskId); if (!isFloatingDisk()) { getDiskVmElement().getId().setDeviceId(diskId); } }</code><technical_language>please switch positive if</technical_language>

Target:
private void createNewDiskId() { Guid diskId = getParameters().isUsePassedDiskId() ? getParameters().getDiskInfo().getId() : Guid.newGuid(); getParameters().getDiskInfo().setId(diskId); if (!isFloatingDisk()) { getDiskVmElement().getId().setDeviceId(diskId); } }
Source:
<code>public int hashCode() { if (hashCode == 0) { <START> hashCode = Objects.hash(values, constraints, peekValue(), lastAssociatedSymbol); <END> } return hashCode; }</code><technical_language>remarks for equals. I doubt interest of symbols account here. LastEvaluated symbol part of it</technical_language>

Target:
public int hashCode() { if (hashCode == 0) { hashCode = Objects.hash(values, constraints, peekValue()); } return hashCode; }
Source:
<code>public synchronized void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { final Map<String, HostConfig> hostConfigs = new HashMap<String, HostConfig>(); for (String key : list(config.keys())) { String value = (String) config.get(key); Matcher m = CONFIG_PATTERN.matcher(key); if (!m.matches()) { continue; } String qualifier = checkQualifier(m.group(2)); String configKey = m.group(3); HostConfig hostConfig = hostConfigs.get(qualifier); if (hostConfig == null) { hostConfig = new HostConfig(); hostConfigs.put(qualifier, hostConfig); } if (configKey.equals("host")) { hostConfig.setHost(value); } else if (configKey.equals("username")) { hostConfig.setUsername(value); } else { hostConfig.setPassword(value); } } setProperlyConfigured(false); removeAllClients(); new Thread(new Runnable() { @Override public void run() { for (Entry<String, HostConfig> entry : hostConfigs.entrySet()) { final String qualifier = entry.getKey(); HostConfig hostConfig = entry.getValue(); if (!hostConfig.isValid()) { continue; } try { HarmonyClient harmonyClient = HarmonyClient.getInstance(); logger.debug("Connecting to with user {}", qualifier, hostConfig.getHost(), hostConfig.getUsername() ); harmonyClient.connect(hostConfig.getHost(), hostConfig.getUsername(), hostConfig.getPassword()); hubs.put(qualifier, new HarmonyHubInstance(harmonyClient)); logger.debug("Devices for qualifier {}\n{}",qualifier,harmonyClient.getDeviceLabels().toString()); logger.debug("Activity for qualifier {}\n{}",qualifier,harmonyClient.getConfig().getActivities()); logger.debug("Config for qualifier {}\n{}", qualifier,harmonyClient.getConfig().toJson()); } catch (Exception e) { logger.error(format( "Failed creating harmony hub connection to %s", hostConfig.getHost()), e); } } setProperlyConfigured(true); } <START> }).start(); <END> } }</code><technical_language>please extract a separate method</technical_language>

Target:
public synchronized void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { final Map<String, HostConfig> hostConfigs = new HashMap<String, HostConfig>(); for (String key : list(config.keys())) { String value = (String) config.get(key); Matcher m = CONFIG_PATTERN.matcher(key); if (!m.matches()) { continue; } String qualifier = checkQualifier(m.group(2)); String configKey = m.group(3); HostConfig hostConfig = hostConfigs.get(qualifier); if (hostConfig == null) { hostConfig = new HostConfig(); hostConfigs.put(qualifier, hostConfig); } if (configKey.equals("host")) { hostConfig.setHost(value); } else if (configKey.equals("username")) { hostConfig.setUsername(value); } else { hostConfig.setPassword(value); } } setProperlyConfigured(false); removeAllClients(); new Thread(new Runnable() { @Override public void run() { for (Entry<String, HostConfig> entry : hostConfigs.entrySet()) { final String qualifier = entry.getKey(); HostConfig hostConfig = entry.getValue(); if (!hostConfig.isValid()) { continue; } connectClient(qualifier, hostConfig); } setProperlyConfigured(true); } }).start(); } }
Source:
<code>private void removeDetachedServers(List<VDS> existingServers, List<GlusterServerInfo> fetchedServers) { log.debugFormat("Existing servers list returned {0} comparing with fetched servers {1)", existingServers, fetchedServers); boolean serverRemoved = false; for (VDS server : existingServers) { if (isRemovableStatus(server.getStatus()) && serverDetached(server, fetchedServers)) { log.infoFormat("Server {0} has been removed directly using the gluster CLI. Removing it from engine as well.", server.getName()); logUtil.logServerMessage(server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI); try { <START> removeServerFromDb(server); <END> try (EngineLock lock = getGlusterUtil().acquireGlusterLockWait(server.getVdsGroupId())) { runVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(server.getId())); } serverRemoved = true; } catch (Exception e) { log.errorFormat("Error while removing server {0} from database!", server.getName(), e); } } } if (serverRemoved) { log.infoFormat("Servers detached using gluster CLI is removed from engine after inspecting the Gluster servers list returned {0} " + "- comparing with db servers {1}", fetchedServers, existingServers); } }</code><technical_language>this lock</technical_language>

Target:
private void removeDetachedServers(List<VDS> existingServers, List<GlusterServerInfo> fetchedServers) { log.debugFormat("Existing servers list returned {0} comparing with fetched servers {1)", existingServers, fetchedServers); boolean serverRemoved = false; for (VDS server : existingServers) { if (isRemovableStatus(server.getStatus()) && serverDetached(server, fetchedServers)) { log.infoFormat("Server {0} has been removed directly using the gluster CLI. Removing it from engine as well.", server.getName()); logUtil.logServerMessage(server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI); try (EngineLock lock = getGlusterUtil().acquireGlusterLockWait(server.getId())) { removeServerFromDb(server); runVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(server.getId())); serverRemoved = true; } catch (Exception e) { log.errorFormat("Error while removing server {0} from database!", server.getName(), e); } } } if (serverRemoved) { log.infoFormat("Servers detached using gluster CLI is removed from engine after inspecting the Gluster servers list returned {0} " + "- comparing with db servers {1}", fetchedServers, existingServers); } }
Source:
<code>void requestReturnsDbAndSolrStatus() throws Exception { mockMvc.perform(get("/json/health")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$.Solr", is(oneOf("UP", "DOWN")))) <START> .andExpect(jsonPath("$.DB", is(oneOf("UP", "DOWN")))); <END> }</code><technical_language>time change a JSON test JSONPath a cute kitten is born</technical_language>

Target:
void requestReturnsDbAndSolrStatus() throws Exception { mockMvc.perform(get("/json/dbsolr/status")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$.Solr", is(oneOf("UP", "DOWN")))) .andExpect(jsonPath("$.DB", is(oneOf("UP", "DOWN")))); }
Source:
<code>private static Set<UnitType> getTargets(final GameData data) { Set<UnitType> types = null; for (final UnitSupportAttachment rule : get(data)) { <START> if (rule.getBonusType().getSecond().equals(Constants.OLD_ART_RULE_NAME)) { <END> types = rule.getUnitType(); if (rule.getName().startsWith(Constants.SUPPORT_RULE_NAME_OLD_TEMP_FIRST)) { final UnitType attachedTo = (UnitType) rule.getAttachedTo(); attachedTo.removeAttachment(rule.getName()); rule.setAttachedTo(null); } } } return types; }</code><technical_language>note potential benefit of a object, a object for bonus type encapsulate this logic remove redundancy, eg: if(rule.getBonusType().isOldArtilleryRule())</technical_language>

Target:
private static Set<UnitType> getTargets(final GameData data) { Set<UnitType> types = null; for (final UnitSupportAttachment rule : get(data)) { if (rule.getBonusType().isOldArtilleryRule()) { types = rule.getUnitType(); if (rule.getName().startsWith(Constants.SUPPORT_RULE_NAME_OLD_TEMP_FIRST)) { final UnitType attachedTo = (UnitType) rule.getAttachedTo(); attachedTo.removeAttachment(rule.getName()); rule.setAttachedTo(null); } } } return types; }
Source:
<code>public HealthCheckResult getOrRunHealthCheck(String name) { <START> int refreshSeconds = Integer.parseInt(Framework.getProperty(DEFAULT_HEALTH_CHECK_INTERVAL_SECONDS_PROPERTY, <END> DEFAULT_HEALTH_CHECK_INTERVAL_SECONDS)); if (!probesForHealthCheck.containsKey(name)) { log.warn("Probe:" + name + " does not exist, or not registed for the healthCheck"); return new HealthCheckResult(Collections.emptyList()); } ProbeInfo probe = probesForHealthCheck.get(name); getStatusOrRunProbe(probe, refreshSeconds); return new HealthCheckResult(Collections.singletonList(probe)); }</code><technical_language>Extract in method initialize component's start</technical_language>

Target:
public HealthCheckResult getOrRunHealthCheck(String name) throws IllegalArgumentException { if (!probesForHealthCheck.containsKey(name)) { throw new IllegalArgumentException("Probe:" + name + " does not exist, or not registed for the healthCheck"); } ProbeInfo probe = probesForHealthCheck.get(name); getStatusOrRunProbe(probe, getDefaultCheckInterval()); return new HealthCheckResult(Collections.singletonList(probe)); }
Source:
<code>public void cancel() { Map.Entry<Address, IntSet> target = currentTarget.getAndSet(null); if (target != null && alreadyCreated) { Address targetNode = target.getKey(); CompletionStage<Response> rpc = <START> ClusterStreamManagerImpl.this.rpc.invokeCommand(targetNode, <END> factory.buildStreamIteratorCloseCommand(id), SingleResponseCollector.INSTANCE, rpcOptions); if (trace) { rpc.exceptionally(t -> { log.tracef(t, "Unable to close iterator on %s for requestId %s", targetNode, requestId); return null; }); } } iteratorsRunning.remove(s); }</code><technical_language>line of code is long enough. need ClusterStreamManagerImpl.this</technical_language>

Target:
public void cancel() { Map.Entry<Address, IntSet> target = currentTarget.getAndSet(null); if (target != null && alreadyCreated) { Address targetNode = target.getKey(); CompletionStage<ValidResponse> rpcStage = rpc.invokeCommand(targetNode, factory.buildStreamIteratorCloseCommand(id), SingleResponseCollector.validOnly(), rpcOptions); if (trace) { rpcStage.exceptionally(t -> { log.tracef(t, "Unable to close iterator on %s for requestId %s", targetNode, requestId); return null; }); } } iteratorsRunning.remove(s); }
Source:
<code>public void startTracingSpan() { Context traceContext = new Context(OPENCENSUS_SPAN_KEY, "<user-current-span>"); Context updatedContext = tracer.start("azure.keyvault.secrets/setsecret", traceContext); System.out.printf("Span returned in the context object: %s%n", <START> updatedContext.getData(OPENCENSUS_SPAN_KEY).get().getClass()); <END> END: com.azure.core.util.tracing.start#string-context END Context sendContext = new Context(OPENCENSUS_SPAN_KEY, "<user-current-span>") .addData(ENTITY_PATH, "entity-path").addData(HOST_NAME, "hostname"); END Context updatedSendContext = tracer.start("azure.eventhubs.send", sendContext, ProcessKind.SEND); System.out.printf("Span returned in the context object: %s%n", updatedSendContext.getData(OPENCENSUS_SPAN_KEY).get()); END: com.azure.core.util.tracing.start#string-context-processKind-SEND Context updatedReceiveContext = tracer.start("azure.eventhubs.receive", traceContext, ProcessKind.RECEIVE); System.out.printf("Diagnostic Id: %s%n", (String) updatedReceiveContext.getData(DIAGNOSTIC_ID_KEY).get()); END: com.azure.core.util.tracing.start#string-context-processKind-RECEIVE Context processContext = new Context(OPENCENSUS_SPAN_KEY, "<user-current-span>") .addData(SPAN_CONTEXT, "<user-current-span-context>"); Context updatedProcessContext = tracer.start("azure.eventhubs.process", processContext, ProcessKind.PROCESS); System.out.printf("Scope: %s%n", updatedProcessContext.getData("scope").get().getClass()); END: com.azure.core.util.tracing.start#string-context-processKind-PROCESS }</code><technical_language>getClass() printing object</technical_language>

Target:
public void startTracingSpan() { Context traceContext = new Context(OPENCENSUS_SPAN_KEY, "<user-current-span>"); Context updatedContext = tracer.start("azure.keyvault.secrets/setsecret", traceContext); System.out.printf("Span returned in the context object: %s%n", updatedContext.getData(OPENCENSUS_SPAN_KEY).get()); END: com.azure.core.util.tracing.start#string-context END Context sendContext = new Context(OPENCENSUS_SPAN_KEY, "<user-current-span>") .addData(ENTITY_PATH, "entity-path").addData(HOST_NAME, "hostname"); END Context updatedSendContext = tracer.start("azure.eventhubs.send", sendContext, ProcessKind.SEND); System.out.printf("Span returned in the context object: %s%n", updatedSendContext.getData(OPENCENSUS_SPAN_KEY).get()); END: com.azure.core.util.tracing.start#string-context-processKind-SEND Context updatedReceiveContext = tracer.start("azure.eventhubs.receive", traceContext, ProcessKind.RECEIVE); System.out.printf("Diagnostic Id: %s%n", updatedReceiveContext.getData(DIAGNOSTIC_ID_KEY).get().toString()); END: com.azure.core.util.tracing.start#string-context-processKind-RECEIVE Context processContext = new Context(OPENCENSUS_SPAN_KEY, "<user-current-span>") .addData(SPAN_CONTEXT, "<user-current-span-context>"); Context updatedProcessContext = tracer.start("azure.eventhubs.process", processContext, ProcessKind.PROCESS); System.out.printf("Scope: %s%n", updatedProcessContext.getData("scope").get()); END: com.azure.core.util.tracing.start#string-context-processKind-PROCESS }
Source:
<code>public GoConfigHolder execute(FullConfigUpdateCommand updatingCommand, List<PartialConfig> partials, String currentUser) throws Exception { LOGGER.debug("[Config Save] Starting Config Save using FullConfigSaveNormalFlow"); CruiseConfig configForEdit = configForEditWithPartials(updatingCommand, partials); CruiseConfig preProcessedConfig = preprocessAndValidate(configForEdit); String configForEditXmlString = toXmlString(configForEdit); <START> postValidationUpdates(preProcessedConfig, configForEdit, configForEditXmlString, partials); <END> checkinToConfigRepo(currentUser, configForEdit, configForEditXmlString); writeToConfigXml(configForEditXmlString); GoConfigHolder goConfigHolder = new GoConfigHolder(preProcessedConfig, configForEdit); setMergedConfigForEditOn(goConfigHolder, partials); LOGGER.debug("[Config Save] Done Config Save using FullConfigSaveNormalFlow"); return goConfigHolder; }</code><technical_language>marking partials valid checkin. In case checkin fails for reason, caches updated partials marked valid</technical_language>

Target:
public GoConfigHolder execute(FullConfigUpdateCommand updatingCommand, List<PartialConfig> partials, String currentUser) throws Exception { LOGGER.debug("[Config Save] Starting Config Save using FullConfigSaveNormalFlow"); CruiseConfig configForEdit = configForEditWithPartials(updatingCommand, partials); String configForEditXmlString = toXmlString(configForEdit); postValidationUpdates(configForEdit, configForEditXmlString); CruiseConfig preProcessedConfig = preprocessAndValidate(configForEdit); checkinToConfigRepo(currentUser, configForEdit, configForEditXmlString); writeToConfigXml(configForEditXmlString); GoConfigHolder goConfigHolder = new GoConfigHolder(preProcessedConfig, configForEdit); setMergedConfigForEditOn(goConfigHolder, partials); cachedGoPartials.markAsValid(partials); LOGGER.debug("[Config Save] Done Config Save using FullConfigSaveNormalFlow"); return goConfigHolder; }
Source:
<code>public static void setUp() throws IOException, SolrServerException { solrContainer.start(); <START> solrClient = new Http2SolrClient.Builder("http://localhost:" + solrContainer.getSolrPort() + "/solr").build(); <END> solrClient.add(COLLECTION_NAME, Collections.singletonList( new SolrInputDocument(createMap( "id", createInputField("id", "1"), "title", createInputField("title", "old skool - trainers - shoes") )) )); solrClient.add(COLLECTION_NAME, Collections.singletonList( new SolrInputDocument(createMap( "id", createInputField("id", "2"), "title", createInputField("title", "print t-shirt") )) )); solrClient.commit(COLLECTION_NAME); }</code><technical_language>Similar above: suggestion solrClient = new Http2SolrClient.Builder("http://" + solrContainer.getContainerIpAddress() + ":" + solrContainer.getSolrPort() + "/solr").build();</technical_language>

Target:
public static void setUp() throws IOException, SolrServerException { solrContainer.start(); solrClient = new Http2SolrClient.Builder("http://" + solrContainer.getContainerIpAddress() + ":" + solrContainer.getSolrPort() + "/solr").build(); solrClient.add(COLLECTION_NAME, Collections.singletonList( new SolrInputDocument(createMap( "id", createInputField("id", "1"), "title", createInputField("title", "old skool - trainers - shoes") )) )); solrClient.add(COLLECTION_NAME, Collections.singletonList( new SolrInputDocument(createMap( "id", createInputField("id", "2"), "title", createInputField("title", "print t-shirt") )) )); solrClient.commit(COLLECTION_NAME); }
Source:
<code>public <T> Model<T> get(Class<T> type) throws NotExportableException { if (type.getAnnotation(ExportedBean.class) == null) { <START> throw new NotExportableException(type); <END> } return get(type, null, null); }</code><technical_language>Is this redundant? AFAICT method delegates thing</technical_language>

Target:
public <T> Model<T> get(Class<T> type) throws NotExportableException { return get(type, null, null); }
Source:
<code>public void destroyInternals() { clearIndexes(); clearMapStore(); clearStorage(false); storage.destroy(false); <START> mutationObserver.onClear(); <END> }</code><technical_language>This is a tricky case. In this method supposed free resources related map service this method is called split brain healing process heals services separately. If observer information in a service (e.g. event journal, locks), observer do anything. worth noting this a separate method observer interface</technical_language>

Target:
public void destroyInternals() { clearMapStore(); clearStorage(false); storage.destroy(false); mutationObserver.onDestroy(true); }
Source:
<code>public static UUID idOf(org.midonet.midolman.layer3.Route route) { long msb = (((long)route.dstNetworkAddr) << 32) | route.srcNetworkAddr; long lsb = (((long)route.nextHopGateway) << 32) | ((route.dstNetworkLength & 0xFF) << 24) | ((route.srcNetworkLength & 0xFF) << 16) | <START> route.weight; <END> msb = msb ^ route.nextHopPort.getMostSignificantBits() ^ route.routerId.getMostSignificantBits(); lsb = lsb ^ route.nextHopPort.getLeastSignificantBits() ^ route.routerId.getLeastSignificantBits(); return new UUID(msb, lsb); }</code><technical_language>route.weight & 0xFFFF? int, I if constraints 65536</technical_language>

Target:
public static UUID idOf(org.midonet.midolman.layer3.Route route) { long msb = (((long)route.dstNetworkAddr) << 32) | route.srcNetworkAddr; long lsb = (((long)route.nextHopGateway) << 32) | ((route.dstNetworkLength & 0xFF) << 24) | ((route.srcNetworkLength & 0xFF) << 16) ^ route.weight; msb = msb ^ route.nextHopPort.getMostSignificantBits() ^ route.routerId.getMostSignificantBits(); lsb = lsb ^ route.nextHopPort.getLeastSignificantBits() ^ route.routerId.getLeastSignificantBits(); return new UUID(msb, lsb); }