auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void stepSetEnvironmentDirectory(final RequestMonitor requestMonitor) { IPath dir = null; try { dir = fGDBBackend.getGDBWorkingDirectory(); } catch (CoreException e) { requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot get working directory", e)); requestMonitor.done(); return; } if (dir != null) { fCommandControl.queueCommand( fCommandFactory.createMIEnvironmentCD(fCommandControl.getContext(), <START> dir.toOSString()), <END> new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor)); } else { requestMonitor.done(); } }</code><technical_language>this work correctly for case host is Windows debugging a Linux target. toOSString replace slashes slashes. double check this code path is remote debugging</technical_language>

Target:
public void stepSetEnvironmentDirectory(final RequestMonitor requestMonitor) { IPath dir = null; try { dir = fGDBBackend.getGDBWorkingDirectory(); } catch (CoreException e) { requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot get working directory", e)); requestMonitor.done(); return; } if (dir != null) { fCommandControl.queueCommand( fCommandFactory.createMIEnvironmentCD(fCommandControl.getContext(), dir.toString()), new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor)); } else { requestMonitor.done(); } }
Source:
<code>protected ZooKeeperTestManager zooKeeperTestManager() { <START> System.err.println("XXXXX CALLED!!!"); <END> final ZooKeeperTestManager testManager = mock(ZooKeeperTestManager.class); final MockCuratorClientFactory mockCuratorClientFactory = new MockCuratorClientFactory(); final CuratorFramework curator = mockCuratorClientFactory.newClient(null, 0, 0, null, null); when(testManager.curator()).thenReturn(curator); when(testManager.connectString()).thenReturn("127.0.0.1"); return testManager; }</code><technical_language>this removed</technical_language>

Target:
protected ZooKeeperTestManager zooKeeperTestManager() { final ZooKeeperTestManager testManager = mock(ZooKeeperTestManager.class); final MockCuratorClientFactory mockCuratorClientFactory = new MockCuratorClientFactory(); final CuratorFramework curator = mockCuratorClientFactory.newClient(null, 0, 0, null, null); when(testManager.curator()).thenReturn(curator); when(testManager.connectString()).thenReturn("127.0.0.1"); return testManager; }
Source:
<code>protected void beforeTest() { beforeTestSetup(); if (interceptorManager.isPlaybackMode()) { client = clientSetup(credentials -> new ConfigurationClientBuilder() <START> .credential(credentials) <END> .httpClient(interceptorManager.getPlaybackClient()) .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .buildAsyncClient()); } else { client = clientSetup(credentials -> new ConfigurationClientBuilder() .credential(credentials) .httpClient(new NettyAsyncHttpClientBuilder().wiretap(true).build()) .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .addPolicy(interceptorManager.getRecordPolicy()) .addPolicy(new RetryPolicy()) .buildAsyncClient()); } }</code><technical_language>need suppress this storage tests, data grids I handle new lines</technical_language>

Target:
protected void beforeTest() { beforeTestSetup(); if (interceptorManager.isPlaybackMode()) { client = clientSetup(credentials -> new ConfigurationClientBuilder() .credential(credentials) .httpClient(interceptorManager.getPlaybackClient()) .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .buildAsyncClient()); } else { client = clientSetup(credentials -> new ConfigurationClientBuilder() .credential(credentials) .httpClient(new NettyAsyncHttpClientBuilder().setWiretap(true).build()) .httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .addPolicy(interceptorManager.getRecordPolicy()) .addPolicy(new RetryPolicy()) .buildAsyncClient()); } }
Source:
<code>private boolean isInitializable(Thing thing) { <START> logger.debug("Determine if thing '{}' is initializable.", thing.getUID()); <END> ThingType thingType = TypeResolver.resolve(thing.getThingTypeUID()); if (thingType != null) { ConfigDescription description = TypeResolver.resolve(thingType.getConfigDescriptionURI()); if (description == null) { return true; } List<String> requiredParameters = getRequiredParameters(description); Map<String, Object> properties = thing.getConfiguration().getProperties(); return properties.keySet().containsAll(requiredParameters); } else { logger.debug("Thing type '{}' of thing '{}' not found.", thing.getThingTypeUID(), thing.getUID()); } return false; }</code><technical_language>this is more a trace output - logging result of this check. remove this, set trace add another trace message result returning</technical_language>

Target:
private boolean isInitializable(Thing thing) { ThingType thingType = TypeResolver.resolve(thing.getThingTypeUID()); if (thingType == null) { return true; } ConfigDescription description = resolve(thingType.getConfigDescriptionURI(), null); if (description == null) { return true; } List<String> requiredParameters = getRequiredParameters(description); Map<String, Object> properties = thing.getConfiguration().getProperties(); return properties.keySet().containsAll(requiredParameters); }
Source:
<code><START> public void linkNewChild(@NonNull IHTNode<E> childNode) { <END> takeWriteLock(); try { super.linkNewChild(childNode); final int childIndex = getNbChildren() - 1; if (childNode instanceof OverlappingNode<?>) { ((OverlappingNode<E>) childNode).addListener(new NodeUpdateListener() { @Override public void nodeClosed(@NonNull OverlappingNode<E> node, long endtime) { takeWriteLock(); try { fChildEnd[childIndex] = endtime; } finally { releaseWriteLock(); } } }); } fChildStart[childIndex] = childNode.getNodeStart(); fChildEnd[childIndex] = childNode.getNodeEnd(); } finally { releaseWriteLock(); } }</code><technical_language>do instanceof check right here, a throw IllegalArgumentException if is a OverlappingNode</technical_language>

Target:
public void linkNewChild(@NonNull IHTNode<E> childNode) { if (!(childNode instanceof OverlappingNode<?>)) { throw new IllegalArgumentException("Adding a node that is not an overlapping node to an overlapping tree!"); } takeWriteLock(); try { super.linkNewChild(childNode); final int childIndex = getNbChildren() - 1; ((OverlappingNode<E>) childNode).addListener((node, endtime) -> { takeWriteLock(); try { fChildEnd[childIndex] = endtime; } finally { releaseWriteLock(); } }); fChildStart[childIndex] = childNode.getNodeStart(); if (childNode.isOnDisk()) { fChildEnd[childIndex] = childNode.getNodeEnd(); } } finally { releaseWriteLock(); } }
Source:
<code>protected void onLoad() throws IOException, ConfigInvalidException { ObjectId rev = getRevision(); if (rev == null) { loadDefaults(); return; } RevWalk walk = new RevWalk(reader); try (ChangeNotesParser parser = new ChangeNotesParser(change, rev, walk, repoManager)) { parser.parseAll(); if (parser.status != null) { change.setStatus(parser.status); } if <START> (parser.changeKey != null && !parser.changeKey.equals(change.getKey())) { <END> throw parseException(change.getId(), String.format( "change key in notedb does does not match change entity: %s != %s", parser.changeKey.get(), change.getKey().get())); } approvals = parser.buildApprovals(); changeMessages = parser.buildMessages(); commentsForBase = ImmutableListMultimap.copyOf(parser.commentsForBase); commentsForPS = ImmutableListMultimap.copyOf(parser.commentsForPs); noteMap = parser.commentNoteMap; ImmutableSetMultimap.Builder<ReviewerState, Account.Id> reviewers = ImmutableSetMultimap.builder(); for (Map.Entry<Account.Id, ReviewerState> e : parser.reviewers.entrySet()) { reviewers.put(e.getValue(), e.getKey()); } this.reviewers = reviewers.build(); this.allPastReviewers = ImmutableList.copyOf(parser.allPastReviewers); submitRecords = ImmutableList.copyOf(parser.submitRecords); } catch (ParseException e) { throw new IOException(e); } finally { walk.release(); } }</code><technical_language>Running test coverage tool JaCoCo ChangeNotesTest reveals fail conditions in generall this branch in is test covered. fabricate a wrong change this test fail check error message returned</technical_language>

Target:
protected void onLoad() throws IOException, ConfigInvalidException { ObjectId rev = getRevision(); if (rev == null) { loadDefaults(); return; } RevWalk walk = new RevWalk(reader); try (ChangeNotesParser parser = new ChangeNotesParser(change, rev, walk, repoManager)) { parser.parseAll(); if (parser.status != null) { change.setStatus(parser.status); } approvals = parser.buildApprovals(); changeMessages = parser.buildMessages(); commentsForBase = ImmutableListMultimap.copyOf(parser.commentsForBase); commentsForPS = ImmutableListMultimap.copyOf(parser.commentsForPs); noteMap = parser.commentNoteMap; ImmutableSetMultimap.Builder<ReviewerState, Account.Id> reviewers = ImmutableSetMultimap.builder(); for (Map.Entry<Account.Id, ReviewerState> e : parser.reviewers.entrySet()) { reviewers.put(e.getValue(), e.getKey()); } this.reviewers = reviewers.build(); this.allPastReviewers = ImmutableList.copyOf(parser.allPastReviewers); submitRecords = ImmutableList.copyOf(parser.submitRecords); } catch (ParseException e) { throw new IOException(e); } finally { walk.release(); } }
Source:
<code>protected Result check() throws Exception { return timeBoundHealthCheck.check(() -> <START> jdbi.withHandle((handle) -> { <END> handle.execute(validationQuery); return Result.healthy(); }) ); }</code><technical_language>thought, I try (Handle handle = jdbi.open()) instead of withHandle. biggest advantages of lambda-expressions is a short-form for one-line calls reference a method. commands, basically expressions require amount of code. time version is easier test</technical_language>

Target:
protected Result check() throws Exception { return timeBoundHealthCheck.check(() -> { try (Handle handle = jdbi.open()) { handle.execute(validationQuery); return Result.healthy(); } } ); }
Source:
<code>private void applyUrl(boolean include) throws CoreException { String value = include ? recomputeUrl() : null; <START> getCurrentItem().setURL(value); <END> }</code><technical_language>check for null here</technical_language>

Target:
private void applyUrl(boolean include) throws CoreException { ISiteFeature feature = getCurrentItem(); if (feature != null) { String value = include ? recomputeUrl() : null; feature.setURL(value); } }
Source:
<code>void testActivationOrder() throws IOException { sut = new ConsumerHolder(eventConsumerMock, "queue", false, PREFETCH_COUNT, consumerChannelFactoryMock, declarationsListMock, declarerRepositoryMock); <START> Assertions.assertEquals("queue", sut.getQueueName()); <END> when(consumerChannelFactoryMock.createChannel()).thenReturn(channelMock); sut.activate(); InOrder inOrder = inOrder(channelMock, declarerRepositoryMock); inOrder.verify(channelMock).addRecoveryListener(sut); inOrder.verify(channelMock).basicQos(PREFETCH_COUNT); inOrder.verify(declarerRepositoryMock).declare(channelMock, declarationsListMock); inOrder.verify(channelMock).basicConsume(eq("queue"), eq(false), isA(DeliverCallback.class), isA(ConsumerShutdownSignalCallback.class)); }</code><technical_language>Change static imports</technical_language>

Target:
void testActivationOrder() throws IOException { sut = new ConsumerHolder(eventConsumerMock, "queue", false, PREFETCH_COUNT, consumerChannelFactoryMock, declarationsListMock, declarerRepositoryMock); assertEquals("queue", sut.getQueueName()); when(consumerChannelFactoryMock.createChannel()).thenReturn(channelMock); sut.activate(); assertDoesNotThrow(sut::activate); InOrder inOrder = inOrder(channelMock, declarerRepositoryMock); inOrder.verify(channelMock).addRecoveryListener(sut); inOrder.verify(channelMock).basicQos(PREFETCH_COUNT); inOrder.verify(declarerRepositoryMock).declare(channelMock, declarationsListMock); inOrder.verify(channelMock).basicConsume(eq("queue"), eq(false), isA(DeliverCallback.class), isA(ConsumerShutdownSignalCallback.class)); }
Source:
<code>public static ListMultipartUploadResponse create(int partNumber, Date lastModified, String eTag, long size) { checkArgument(partNumber > 0, "partNumber must be greater than zero, was: " + partNumber); checkNotNull(eTag, "eTag"); lastModified = (Date) checkNotNull(lastModified, "lastModified").clone(); <START> checkArgument(size >= 0, "size must be positive, was: " + size); <END> return new AutoValue_ListMultipartUploadResponse(partNumber, lastModified, eTag, size); }</code><technical_language>[minor] checkArgument(size >= 0, "size positive, was: %s", size);, avoid implicit stringbuilder if precondition is met</technical_language>

Target:
public static ListMultipartUploadResponse create(int partNumber, Date lastModified, String eTag, long size) { checkArgument(partNumber > 0, "partNumber must be greater than zero, was: %s", partNumber); checkNotNull(eTag, "eTag"); lastModified = (Date) checkNotNull(lastModified, "lastModified").clone(); checkArgument(size >= 0, "size must be positive, was: %s", size); return new AutoValue_ListMultipartUploadResponse(partNumber, lastModified, eTag, size); }
Source:
<code>public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { ProjectNode parent = (ProjectNode) node; PlanNode source = lookup.resolve(parent.getSource()); if (!(source instanceof IndexSourceNode)) { return Optional.empty(); } IndexSourceNode indexSourceNode = (IndexSourceNode) source; <START> Optional<Set<Symbol>> prunedOutputs = pruneInputs(indexSourceNode.getOutputSymbols(), parent.getAssignments().getExpressions()); <END> if (!prunedOutputs.isPresent()) { return Optional.empty(); } Set<Symbol> newLookupSymbols = indexSourceNode.getLookupSymbols().stream() .filter(prunedOutputs.get()::contains) .collect(toImmutableSet()); Map<Symbol, ColumnHandle> newAssignments = Maps.filterEntries( indexSourceNode.getAssignments(), entry -> prunedOutputs.get().contains(entry.getKey()) || indexSourceNode.getEffectiveTupleDomain().getDomains() .map(domains -> domains.containsKey(entry.getValue())) .orElse(false)); return Optional.of( parent.replaceChildren(ImmutableList.of( new IndexSourceNode( indexSourceNode.getId(), indexSourceNode.getIndexHandle(), indexSourceNode.getTableHandle(), indexSourceNode.getLayout(), newLookupSymbols, indexSourceNode.getOutputSymbols().stream() .filter(prunedOutputs.get()::contains) .collect(toImmutableList()), newAssignments, indexSourceNode.getEffectiveTupleDomain())))); }</code><technical_language>name this indexSourcePrunedOutputs</technical_language>

Target:
public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { ProjectNode parent = (ProjectNode) node; PlanNode source = lookup.resolve(parent.getSource()); if (!(source instanceof IndexSourceNode)) { return Optional.empty(); } IndexSourceNode indexSourceNode = (IndexSourceNode) source; Optional<Set<Symbol>> prunedIndexSourceOutputs = pruneInputs(indexSourceNode.getOutputSymbols(), parent.getAssignments().getExpressions()); if (!prunedIndexSourceOutputs.isPresent()) { return Optional.empty(); } Set<Symbol> newLookupSymbols = indexSourceNode.getLookupSymbols().stream() .filter(prunedIndexSourceOutputs.get()::contains) .collect(toImmutableSet()); Map<Symbol, ColumnHandle> newAssignments = Maps.filterEntries( indexSourceNode.getAssignments(), entry -> prunedIndexSourceOutputs.get().contains(entry.getKey()) || tupleDomainReferencesColumnHandle(indexSourceNode.getEffectiveTupleDomain(), entry.getValue())); List<Symbol> prunedIndexSourceOutputList = indexSourceNode.getOutputSymbols().stream() .filter(prunedIndexSourceOutputs.get()::contains) .collect(toImmutableList()); return Optional.of( parent.replaceChildren(ImmutableList.of( new IndexSourceNode( indexSourceNode.getId(), indexSourceNode.getIndexHandle(), indexSourceNode.getTableHandle(), indexSourceNode.getLayout(), newLookupSymbols, prunedIndexSourceOutputList, newAssignments, indexSourceNode.getEffectiveTupleDomain())))); }
Source:
<code>public void test() throws Exception { sink.input().send(MessageBuilder.withPayload("this is a test").build()); <START> File file = new File("/tmp/dataflow-tests/test.txt"); <END> file.deleteOnExit(); assertTrue("file does not exist", file.exists()); assertEquals("this is a test\n", FileCopyUtils.copyToString(new FileReader(file))); }</code><technical_language>work windows</technical_language>

Target:
public void test() throws Exception { sink.input().send(MessageBuilder.withPayload("this is a test").build()); File file = new File(ROOT_DIR, "test.txt"); file.deleteOnExit(); assertTrue("file does not exist", file.exists()); assertEquals("this is a test\n", FileCopyUtils.copyToString(new FileReader(file))); }
Source:
<code>public void onEvent(ActivitiEvent event) { <START> if (event.getType().equals(ActivitiEventType.TIMER_SCHEDULED)) { <END> if (event instanceof ActivitiEntityEvent && TimerJobEntity.class.isAssignableFrom(((ActivitiEntityEvent) event).getEntity().getClass())) { converter.from((ActivitiEntityEvent) event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); } } }</code><technical_language>necessary</technical_language>

Target:
public void onEvent(ActivitiEvent event) { converter.from(event) .ifPresent(convertedEvent -> { for (BPMNElementEventListener<BPMNTimerScheduledEvent> listener : processRuntimeEventListeners) { listener.onEvent(convertedEvent); } }); }
Source:
<code>public void testLiteralFor() throws Exception { final DefaultConfiguration configurationTestLiteralFor = createCheckConfig(WhitespaceAfterCheck.class); configurationTestLiteralFor.addAttribute("tokens", "LITERAL_FOR"); final String[] expected = { "51:12: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), }; <START> verify(configurationTestLiteralFor, getPath("InputWhitespaceAfterConditions.java"), <END> expected); }</code><technical_language>Please separate input file for test</technical_language>

Target:
public void testLiteralFor() throws Exception { final DefaultConfiguration configurationTestLiteralFor = createCheckConfig(WhitespaceAfterCheck.class); configurationTestLiteralFor.addAttribute("tokens", "LITERAL_FOR"); final String[] expected = { "51:12: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), }; verify(configurationTestLiteralFor, getPath("InputWhitespaceAfterLiteralFor.java"), expected); }
Source:
<code>private void copyOuterJoinInfo( MultiJoin multiJoin, List<Pair<JoinRelType, RexNode>> destJoinSpecs, int adjustmentAmount, List<RelDataTypeField> srcFields, List<RelDataTypeField> destFields) { final List<Pair<JoinRelType, RexNode>> srcJoinSpecs = Pair.zip( multiJoin.getJoinTypes(), multiJoin.getOuterJoinConditions()); if (adjustmentAmount == 0) { destJoinSpecs.addAll(srcJoinSpecs); } else { <START> int nFields = srcFields == null ? 0 : srcFields.size(); <END> int[] adjustments = new int[nFields]; for (int idx = 0; idx < nFields; idx++) { adjustments[idx] = adjustmentAmount; } for (Pair<JoinRelType, RexNode> src : srcJoinSpecs) { destJoinSpecs.add( Pair.of( src.left, src.right == null ? null : src.right.accept( new RelOptUtil.RexInputConverter( multiJoin.getCluster().getRexBuilder(), srcFields, destFields, adjustments)))); } } }</code><technical_language>a defensive. assert srcFields != null better, is implicit contract. assert destFields != null</technical_language>

Target:
private void copyOuterJoinInfo( MultiJoin multiJoin, List<Pair<JoinRelType, RexNode>> destJoinSpecs, int adjustmentAmount, List<RelDataTypeField> srcFields, List<RelDataTypeField> destFields) { final List<Pair<JoinRelType, RexNode>> srcJoinSpecs = Pair.zip( multiJoin.getJoinTypes(), multiJoin.getOuterJoinConditions()); if (adjustmentAmount == 0) { destJoinSpecs.addAll(srcJoinSpecs); } else { assert srcFields != null; assert destFields != null; int nFields = srcFields.size(); int[] adjustments = new int[nFields]; for (int idx = 0; idx < nFields; idx++) { adjustments[idx] = adjustmentAmount; } for (Pair<JoinRelType, RexNode> src : srcJoinSpecs) { destJoinSpecs.add( Pair.of( src.left, src.right == null ? null : src.right.accept( new RelOptUtil.RexInputConverter( multiJoin.getCluster().getRexBuilder(), srcFields, destFields, adjustments)))); } } }
Source:
<code>public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { title = null; if (view instanceof WebView) { WebView.HitTestResult result = ((WebView) view).getHitTestResult(); if (result.getType() == WebView.HitTestResult.SRC_ANCHOR_TYPE) { Uri uri = Uri.parse(result.getExtra()); if (isValidPageLink(uri)) { WikiSite wikiSite = new WikiSite(uri); <START> if (wikiSite.dbName().equals(((WebViewContextMenuListener) contextMenuListener).getWikiSite().dbName()) <END> && !wikiSite.languageCode().equals(((WebViewContextMenuListener) contextMenuListener).getWikiSite().languageCode())) { wikiSite = ((WebViewContextMenuListener) contextMenuListener).getWikiSite(); } title = wikiSite.titleForInternalLink(uri.getPath()); } } } else if (view instanceof ListView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; title = ((ListViewContextMenuListener) contextMenuListener) .getTitleForListPosition(info.position); } if (title != null && !title.isSpecial()) { hideSoftKeyboard(view); entry = new HistoryEntry(title, historySource); entry.setReferrer(referrer); new MenuInflater(view.getContext()).inflate(R.menu.menu_page_long_press, menu); menu.setHeaderTitle(title.getDisplayText()); for (int i = 0; i < menu.size(); i++) { menu.getItem(i).setOnMenuItemClickListener(this); } L.d("LongPressHandler final " + title.getCanonicalUri()); } L.d("LongPressHandler title " + title.getCanonicalUri()); }</code><technical_language>WikiSite this logic (in constructor)? clear necessary here</technical_language>

Target:
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { title = null; if (view instanceof WebView) { WebView.HitTestResult result = ((WebView) view).getHitTestResult(); if (result.getType() == WebView.HitTestResult.SRC_ANCHOR_TYPE) { Uri uri = Uri.parse(result.getExtra()); if (isValidPageLink(uri)) { WikiSite wikiSite = new WikiSite(uri); if (wikiSite.dbName().equals(((WebViewContextMenuListener) contextMenuListener).getWikiSite().dbName()) && !wikiSite.languageCode().equals(((WebViewContextMenuListener) contextMenuListener).getWikiSite().languageCode())) { wikiSite = ((WebViewContextMenuListener) contextMenuListener).getWikiSite(); } title = wikiSite.titleForInternalLink(uri.getPath()); } } } else if (view instanceof ListView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; title = ((ListViewContextMenuListener) contextMenuListener) .getTitleForListPosition(info.position); } if (title != null && !title.isSpecial()) { hideSoftKeyboard(view); entry = new HistoryEntry(title, historySource); entry.setReferrer(referrer); new MenuInflater(view.getContext()).inflate(R.menu.menu_page_long_press, menu); menu.setHeaderTitle(title.getDisplayText()); for (int i = 0; i < menu.size(); i++) { menu.getItem(i).setOnMenuItemClickListener(this); } } }
Source:
<code>public int hashCode() { <START> return Objects.hashCode(indexer, listener); <END> }</code><technical_language>Instead of Guava Objects.hashCode, Objects.hash instead. is Java 7, reduces dependencies Guava (furthermore, this method is in Guava 21 :) )</technical_language>

Target:
public int hashCode() { return Objects.hash(indexer, listener); }
Source:
<code>private List<String> categoriesForPipeline(Task task) { if (task instanceof PlaceholderTask) { PlaceholderTask placeholderTask = (PlaceholderTask)task; try { FlowNode firstThrottle = firstThrottleStartNode(placeholderTask.getNode()); Run<?,?> r = placeholderTask.run(); if (firstThrottle != null && r != null) { return ThrottleJobProperty.getCategoriesForRunAndFlowNode(r.getExternalizableId(), firstThrottle.getId()); } } catch (IOException | InterruptedException e) { <START> return new ArrayList<>(); <END> } } return new ArrayList<>(); }</code><technical_language>logging</technical_language>

Target:
private List<String> categoriesForPipeline(Task task) { if (task instanceof PlaceholderTask) { PlaceholderTask placeholderTask = (PlaceholderTask)task; try { FlowNode firstThrottle = firstThrottleStartNode(placeholderTask.getNode()); Run<?,?> r = placeholderTask.run(); if (firstThrottle != null && r != null) { return ThrottleJobProperty.getCategoriesForRunAndFlowNode(r.getExternalizableId(), firstThrottle.getId()); } } catch (IOException | InterruptedException e) { LOGGER.log(Level.WARNING, "Error getting categories for pipeline {0}: {1}", new Object[] {task.getDisplayName(), e}); return new ArrayList<>(); } } return new ArrayList<>(); }
Source:
<code>public void testBulkSlotAllocationFulfilledWithAvailableSlots() throws InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException { PhysicalSlotRequest request = createPhysicalSlotRequest(); addSlotToSlotPool(); CompletableFuture<PhysicalSlotRequest.Result> slotFuture = allocateSlot(request); <START> PhysicalSlotRequest.Result result = slotFuture.get(TIMEOUT.getSize(), TIMEOUT.getUnit()); <END> assertThat(result.getSlotRequestId(), is(request.getSlotRequestId())); }</code><technical_language>check result immediately delay in this case</technical_language>

Target:
public void testBulkSlotAllocationFulfilledWithAvailableSlots() throws InterruptedException, ExecutionException { PhysicalSlotRequest request = createPhysicalSlotRequest(); addSlotToSlotPool(); CompletableFuture<PhysicalSlotRequest.Result> slotFuture = allocateSlot(request); PhysicalSlotRequest.Result result = slotFuture.get(); assertThat(result.getSlotRequestId(), is(request.getSlotRequestId())); }
Source:
<code>private static void addViewerService(FileViewerService service) { int index = 0; int orderPriority = service.getOrderPriority(); while (index < SERVICES.size() && orderPriority < SERVICES.get(index).getOrderPriority()) { index++; <START> } <END> SERVICES.add(index, service); }</code><technical_language>sorting list in getViewerServices instead</technical_language>

Target:
private static void addViewerService(FileViewerService service) { SERVICES.add(service); SERVICES.sort(FileViewerServiceTracker::compareServices); }
Source:
<code>private void importProject(Intent data) { if (data == null) { setShowProgressBar(false); return; } if (!data.getData().getScheme().equals("file")) { <START> throw new RuntimeException("importProject has to be called with a file uri. (not a content uri"); <END> } try { File cacheFile = new File(CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); if (cacheFile.exists()) { if (cacheFile.isDirectory()) { StorageOperations.deleteDir(cacheFile); } else { cacheFile.delete(); } } File src = new File(data.getData().getPath()); if (src.isDirectory()) { new ProjectImportTask(projectImportListener) .execute(src); } else { File projectFile = StorageOperations .copyUriToDir(getContext().getContentResolver(), data.getData(), CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); new ProjectUnzipAndImportTask(projectUnzipAndImportListener) .execute(projectFile); } setShowProgressBar(true); } catch (IOException e) { Log.e(TAG, "Cannot resolve project to import.", e); } }</code><technical_language>IllegalArgumentException instead? > "Thrown a method passed illegal inappropriate argument." [Oracle doc](<LINK_0></technical_language>

Target:
private void importProject(Intent data) { if (data == null) { setShowProgressBar(false); return; } if (!data.getData().getScheme().equals("file")) { throw new IllegalArgumentException("importProject has to be called with a file uri. (not a content uri"); } try { File cacheFile = new File(CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); if (cacheFile.exists()) { cacheFile.delete(); } File src = new File(data.getData().getPath()); if (src.isDirectory()) { new ProjectImportTask(projectImportListener) .execute(src); } else { File projectFile = StorageOperations .copyUriToDir(getContext().getContentResolver(), data.getData(), CACHE_DIR, CACHED_PROJECT_ZIP_FILE_NAME); new ProjectUnzipAndImportTask(projectUnzipAndImportListener) .execute(projectFile); } setShowProgressBar(true); } catch (IOException e) { Log.e(TAG, "Cannot resolve project to import.", e); } }
Source:
<code>public List<ExchangeType> getExchanges() { exchanges = exchangeService.getAllExchanges(); <START> return exchanges; <END> }</code><technical_language>return exchangeService.getAllExchanges(); instead of assigned return</technical_language>

Target:
public List<ExchangeType> getExchanges() { return exchangeService.getAllExchanges(); }
Source:
<code>synchronized static boolean sslVerifyCallback(String serverAddress, String pemData, int depth) { try { if (ROS_CERTIFICATES_CHAIN == null) { ROS_CERTIFICATES_CHAIN = new HashMap<>(); TRUST_MANAGER = systemDefaultTrustManager(); CERTIFICATE_FACTORY = CertificateFactory.getInstance("X.509"); } if (!ROS_CERTIFICATES_CHAIN.containsKey(serverAddress)) { ROS_CERTIFICATES_CHAIN.put(serverAddress, new LinkedList<String>()); } ROS_CERTIFICATES_CHAIN.get(serverAddress).add(pemData); if (depth == 0) { <START> int n = ROS_CERTIFICATES_CHAIN.get(serverAddress).size(); <END> X509Certificate[] chain = new X509Certificate[n]; for (String pem : ROS_CERTIFICATES_CHAIN.get(serverAddress)) { chain[--n] = buildCertificateFromPEM(pem); } try { TRUST_MANAGER.checkServerTrusted(chain, "RSA"); boolean isValid = OkHostnameVerifier.INSTANCE.verify(serverAddress, chain[0]); if (isValid) { return true; } else { RealmLog.error("Can not verify the hostname for the host: " + serverAddress); return false; } } catch (CertificateException e) { RealmLog.error(e, "Can not validate SSL chain certificate for the host: " + serverAddress); return false; } finally { ROS_CERTIFICATES_CHAIN.remove(serverAddress); } } else { return true; } } catch (CertificateException | IOException e) { RealmLog.error(e, "Error during certificate validation for host: " + serverAddress); return false; } }</code><technical_language>Move ROS_CERTIFICATES_CHAIN.get(serverAddress) seperate var is called twice</technical_language>

Target:
synchronized static boolean sslVerifyCallback(String serverAddress, String pemData, int depth) { try { if (ROS_CERTIFICATES_CHAIN == null) { ROS_CERTIFICATES_CHAIN = new HashMap<>(); TRUST_MANAGER = systemDefaultTrustManager(); CERTIFICATE_FACTORY = CertificateFactory.getInstance("X.509"); } if (!ROS_CERTIFICATES_CHAIN.containsKey(serverAddress)) { ROS_CERTIFICATES_CHAIN.put(serverAddress, new ArrayList<String>()); } ROS_CERTIFICATES_CHAIN.get(serverAddress).add(pemData); if (depth == 0) { List<String> pemChain = ROS_CERTIFICATES_CHAIN.get(serverAddress); int n = pemChain.size(); X509Certificate[] chain = new X509Certificate[n]; for (String pem : pemChain) { chain[--n] = buildCertificateFromPEM(pem); } try { TRUST_MANAGER.checkServerTrusted(chain, "RSA"); boolean isValid = OkHostnameVerifier.INSTANCE.verify(serverAddress, chain[0]); if (isValid) { return true; } else { RealmLog.error("Can not verify the hostname for the host: " + serverAddress); return false; } } catch (CertificateException e) { RealmLog.error(e, "Can not validate SSL chain certificate for the host: " + serverAddress); return false; } finally { ROS_CERTIFICATES_CHAIN.remove(serverAddress); } } else { return true; } } catch (Exception e) { RealmLog.error(e, "Error during certificate validation for host: " + serverAddress); return false; } }
Source:
<code>public void convertsEntitiesToListOfResources() { Person first = new Person(); first.id = 1L; Person second = new Person(); second.id = 2L; List<PersonResource> result = assembler.toList(Arrays.asList(first, second)); LinkBuilder builder = linkTo(PersonController.class); PersonResource firstResource = new PersonResource(); firstResource.add(builder.slash(1L).withSelfRel()); PersonResource secondResource = new PersonResource(); <START> secondResource.add(builder.slash(1L).withSelfRel()); <END> assertThat(result).hasSize(2); assertThat(result).contains(firstResource, secondResource); }</code><technical_language>problem exists in convertsEntitiesToResources</technical_language>

Target:
public void convertsEntitiesToListOfResources() { Person first = new Person(); first.id = 1L; Person second = new Person(); second.id = 2L; List<PersonResource> result = assembler.build(Arrays.asList(first, second)).toListOfResources(); LinkBuilder builder = linkTo(PersonController.class); PersonResource firstResource = new PersonResource(); firstResource.add(builder.slash(1L).withSelfRel()); PersonResource secondResource = new PersonResource(); secondResource.add(builder.slash(1L).withSelfRel()); assertThat(result).hasSize(2); assertThat(result).contains(firstResource, secondResource); }
Source:
<code>public void testParcelUnparcel() { assertParcelingIsLossless(new IpSecConfig()); IpSecConfig c = getSampleConfig(); <START> assertParcelingIsLossless(c); <END> }</code><technical_language>assertParcelSane</technical_language>

Target:
public void testParcelUnparcel() { assertParcelingIsLossless(new IpSecConfig()); IpSecConfig c = getSampleConfig(); assertParcelSane(c, 15); }
Source:
<code>protected AdapterFactory getLoadedFactoryForTypes(Collection<?> types) { AdapterFactory result = null; FactoryLoop: for (AdapterFactory factory : adapterFactories) { if (factory instanceof ComposedAdapterFactory) { AdapterFactory candidate = ((ComposedAdapterFactory)factory).getFactoryForTypes(types); if (candidate != null) { if (!candidate.isFactoryForType(ANY_EOBJECT) && !candidate.isFactoryForType(ANY_OBJECT)) { <START> return candidate; <END> } else if (result == null) { result = candidate; } } } else { for (Object type : types) { if (!factory.isFactoryForType(type)) { continue FactoryLoop; } } if (!factory.isFactoryForType(ANY_EOBJECT) && !factory.isFactoryForType(ANY_OBJECT)) { return factory; } else if (result == null) { result = factory; } } } return result; }</code><technical_language>return a candidate if is a factory for object eObject</technical_language>

Target:
protected AdapterFactory getLoadedFactoryForTypes(Collection<?> types) { FactoryLoop: for (AdapterFactory factory : adapterFactories) { if (factory instanceof ComposedAdapterFactory) { AdapterFactory candidate = ((ComposedAdapterFactory)factory).getFactoryForTypes(types); if (candidate != null) { return candidate; } } else { for (Object type : types) { if (!factory.isFactoryForType(type)) { continue FactoryLoop; } } return factory; } } return null; }
Source:
<code>public JSONObject fetchDiff() throws ArcanistUsageException, IOException, InterruptedException { Map params = new HashMap<String, String>(); params.put("ids", new String[]{this.diffID}); JSONObject query = this.callConduit("differential.querydiffs", params); JSONObject response; try { response = query.getJSONObject("response"); } catch (JSONException e) { <START> e.printStackTrace(); <END> throw new ArcanistUsageException( String.format("No 'response' object found in conduit call: (%s) %s", e.getMessage(), query.toString(2))); } try { return response.getJSONObject(diffID); } catch (JSONException e) { e.printStackTrace(); throw new ArcanistUsageException( String.format("Unable to find '%s' key in response: (%s) %s", diffID, e.getMessage(), response.toString(2))); } }</code><technical_language>Hmm... this jenkins process' stdout/stderr? useful</technical_language>

Target:
public JSONObject fetchDiff() throws ArcanistUsageException, IOException, InterruptedException { Map params = new HashMap<String, String>(); params.put("ids", new String[]{this.diffID}); JSONObject query = this.callConduit("differential.querydiffs", params); JSONObject response; try { response = query.getJSONObject("response"); } catch (JSONException e) { throw new ArcanistUsageException( String.format("No 'response' object found in conduit call: (%s) %s", e.getMessage(), query.toString(2))); } try { return response.getJSONObject(diffID); } catch (JSONException e) { throw new ArcanistUsageException( String.format("Unable to find '%s' key in response: (%s) %s", diffID, e.getMessage(), response.toString(2))); } }
Source:
<code>return (Response) reply; } }; private final Function<Object, Response> _replyHandler; private final Map<String, BlockingCell<Object>> _continuationMap = new HashMap<String, BlockingCell<Object>>(); private int _correlationId; private DefaultConsumer _consumer; public RpcClient(RpcClientParams params) throws IOException { _channel = params.getChannel(); _exchange = params.getExchange(); _routingKey = params.getRoutingKey(); _replyTo = params.getReplyTo(); if (params.getTimeout() < NO_TIMEOUT) { throw new IllegalArgumentException("Timeout argument must be NO_TIMEOUT(-1) or non-negative."); } _timeout = params.getTimeout(); <START> _useMandatory = params.isUseMandatory(); <END> _replyHandler = params.getReplyHandler(); _correlationId = 0; _consumer = setupConsumer(); if (_useMandatory) { this._channel.addReturnListener(returnMessage -> { synchronized (_continuationMap) { String replyId = returnMessage.getProperties().getCorrelationId(); BlockingCell<Object> blocker = _continuationMap.remove(replyId); if (blocker == null) { LOGGER.warn("No outstanding request for correlation ID {}", replyId); } else { blocker.set(new UnroutableRpcRequestException(returnMessage)); } } }); } }</code><technical_language>this shouldUseMandatory</technical_language>

Target:
return (Response) reply; } }; private final Function<Object, Response> _replyHandler; private final Map<String, BlockingCell<Object>> _continuationMap = new HashMap<String, BlockingCell<Object>>(); private int _correlationId; private DefaultConsumer _consumer; public RpcClient(RpcClientParams params) throws IOException { _channel = params.getChannel(); _exchange = params.getExchange(); _routingKey = params.getRoutingKey(); _replyTo = params.getReplyTo(); if (params.getTimeout() < NO_TIMEOUT) { throw new IllegalArgumentException("Timeout argument must be NO_TIMEOUT(-1) or non-negative."); } _timeout = params.getTimeout(); _useMandatory = params.shouldUseMandatory(); _replyHandler = params.getReplyHandler(); _correlationId = 0; _consumer = setupConsumer(); if (_useMandatory) { this._channel.addReturnListener(returnMessage -> { synchronized (_continuationMap) { String replyId = returnMessage.getProperties().getCorrelationId(); BlockingCell<Object> blocker = _continuationMap.remove(replyId); if (blocker == null) { LOGGER.warn("No outstanding request for correlation ID {}", replyId); } else { blocker.set(new UnroutableRpcRequestException(returnMessage)); } } }); } }
Source:
<code>protected Control createPageControls(Composite parent) { setTitle(Messages.RemoveReviewerDialog_Remove_Reviewer); <START> setMessage( <END> NLS.bind(Messages.RemoveReviewerDialog_Are_You_Sure_You_Want_To_Remove, userToRemove.getDisplayName())); return parent; }</code><technical_language>instead of calling setMessage, I create a label this text content in dialog itself</technical_language>

Target:
protected Control createPageControls(Composite parent) { setTitle(Messages.RemoveReviewerDialog_Remove_Reviewer); Label label = new Label(parent, SWT.CENTER); label.setText( NLS.bind(Messages.RemoveReviewerDialog_Are_You_Sure_You_Want_To_Remove, userToRemove.getDisplayName())); return parent; }
Source:
<code>public void closeThread(String reason) { <START> waitForElementByCss("div.msg-toolbar"); <END> executeScript("document.getElementsByClassName(\"buttons\")[1].style.display = \"block\""); waitForElementByElement(moreButton); mouseOver(moreButtonCss); executeScript("document.querySelectorAll(\"div.msg-toolbar nav.wikia-menu-button.secondary.combined\")[0].click()"); mouseOver(".WikiaMenuElement .close-thread"); jQueryNthElemClick(".WikiaMenuElement .close-thread", 0); waitForElementByElement(removeCloseMessageOverLay); waitForElementByElement(removeCloseMessageConfirmButton); removeCloseMessageReason.sendKeys(reason); clickAndWait(removeCloseMessageConfirmButton); driver.navigate().refresh(); PageObjectLogging.log("closeThread", "Thread is closed" + reason, true, driver); }</code><technical_language>UI mapping</technical_language>

Target:
public void closeThread(String reason) { waitForElementByElement(msgToolbar); setStyle(".buttons", "1", "block"); secondaryCombinedMoreButton.click(); mouseOver(closeThreadCSS); click(closeThread); waitForElementByElement(removeCloseOverLay); waitForElementByElement(removeCloseConfirmButton); removeCloseReason.sendKeys(reason); click(removeCloseConfirmButton); refreshPage(); PageObjectLogging.log("closeThread", "Thread is closed" + reason, true); }
Source:
<code><START> public final void removesKey() throws Exception { <END> final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_NO_CONTENT, "" ) ).start(); final PublicKeys keys = this.getKeys(); try { keys.remove(1); final MkQuery query = container.take(); MatcherAssert.assertThat( query.uri().toString(), Matchers.endsWith("/user/keys/1") ); MatcherAssert.assertThat( query.method(), Matchers.equalTo(Request.DELETE) ); } finally { container.stop(); } }</code><technical_language>This is integration test, working a mock version of Github. This test method belongs another class (and another ticket)</technical_language>

Target:
public final void removesKey() throws Exception { final PublicKeys keys = this.keys(); final PublicKey key = keys.create("rsa", "rsa sh"); MatcherAssert.assertThat( keys.iterate() , Matchers.hasItem(key) ); keys.remove(key.number()); MatcherAssert.assertThat( keys.iterate(), Matchers.not(Matchers.hasItem(key)) ); }
Source:
<code>public String waitForNewLeader(long timeout) throws Exception { long start = System.currentTimeMillis(); long curTimeout; <START> synchronized (lock) { while ( exception == null && (address == null || address.equals(oldAddress)) && (curTimeout = timeout - System.currentTimeMillis() + start) > 0) { try { lock.wait(curTimeout); } catch (InterruptedException e) { } } } <END> if (exception != null) { throw exception; } else if (address == null || address.equals(oldAddress)) { throw new TimeoutException("Listener was not notified about a leader within " + timeout + "ms"); } oldAddress = address; return address; }</code><technical_language>I wondering solve this problem a bit more elegantly a blocking array queue</technical_language>

Target:
public String waitForNewLeader(long timeout) throws Exception { throwExceptionIfNotNull(); final String errorMsg = "Listener was not notified about a new leader within " + timeout + "ms"; CommonTestUtils.waitUntilCondition( () -> { leader = leaderEventQueue.poll(timeout, TimeUnit.MILLISECONDS); return leader != null && !leader.isEmpty() && !leader.getLeaderAddress().equals(oldAddress); }, Deadline.fromNow(Duration.ofMillis(timeout)), errorMsg); oldAddress = leader.getLeaderAddress(); return leader.getLeaderAddress(); }
Source:
<code>public EmailProducerBuilder setBccRecipient(String recipient) { List<String> recipients = new ArrayList<String>(); recipients.add(recipient); <START> return this.setBccRecipients(recipients); <END> }</code><technical_language>return this.setBccRecipients(Arrays.asList(recipient))</technical_language>

Target:
public EmailProducerBuilder setBccRecipient(String recipient) { return this.setBccRecipients(Arrays.asList(recipient)); }
Source:
<code>private Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { <START> OsFamily osFamily = OsFamily.UNRECOGNIZED; <END> @Override public OsFamily apply(final String description) { if (description != null) { if (description.contains(CENTOS)) osFamily = OsFamily.CENTOS; else if (description.contains(UBUNTU)) osFamily = OsFamily.UBUNTU; } logger.debug("os family for item: %s is %s", description, osFamily); return osFamily; } }; }</code><technical_language>is need for this local variable. return detected os family</technical_language>

Target:
private Function<String, OsFamily> osFamily() { return new Function<String, OsFamily>() { @Override public OsFamily apply(final String description) { if (description != null) { if (description.contains(CENTOS)) return OsFamily.CENTOS; else if (description.contains(UBUNTU)) return OsFamily.UBUNTU; } return OsFamily.UNRECOGNIZED; } }; }
Source:
<code>public Assignment apply(Task task, TaskContext context, String excludedUser) { if (!active) { logger.debug("{} strategy is not active", this); return null; } logger.debug("Using rules to assign actual owner to task {}", task); KieSession kieSession = this.kieContainer.newKieSession(); try { context.loadTaskVariables(task); kieSession.insert(task); kieSession.fireAllRules(); Set<Assignment> assignments = new TreeSet<>(); String queryName = System.getProperty("org.jbpm.task.assignment.rules.query"); if (queryName != null) { logger.debug("Query is going to be used to retrieve results from working memory", queryName); QueryResults results = kieSession.getQueryResults(queryName); results.forEach(row -> assignments.add((Assignment)row.get("assignment"))); } else { logger.debug("No query defined, retrieving all facts of type Assignment"); Collection<Assignment> results = (Collection<Assignment>) kieSession.getObjects(new ClassObjectFilter(Assignment.class)); assignments.addAll(results); } <START> logger.debug("Rule evaluation completed with selected assignemtns of {}", assignments); <END> if (assignments.isEmpty()) { logger.debug("No assignments found by BusinessRule strategy"); return null; } Assignment selected = assignments.iterator().next(); logger.debug("Selected assignment is for task {}", selected, task); return selected; } finally { kieSession.dispose(); logger.debug("KieSession in BusinessRule disposed"); } }</code><technical_language>Typo</technical_language>

Target:
public Assignment apply(Task task, TaskContext context, String excludedUser) { if (!active) { logger.debug("{} strategy is not active", this); return null; } logger.debug("Using rules to assign actual owner to task {}", task); KieSession kieSession = this.kieContainer.newKieSession(); try { context.loadTaskVariables(task); kieSession.insert(task); kieSession.fireAllRules(); Set<Assignment> assignments = new TreeSet<>(); String queryName = System.getProperty("org.jbpm.task.assignment.rules.query"); if (queryName != null) { logger.debug("Query is going to be used to retrieve results from working memory", queryName); QueryResults results = kieSession.getQueryResults(queryName); results.forEach(row -> assignments.add((Assignment)row.get("assignment"))); } else { logger.debug("No query defined, retrieving all facts of type Assignment"); Collection<Assignment> results = (Collection<Assignment>) kieSession.getObjects(new ClassObjectFilter(Assignment.class)); assignments.addAll(results); } logger.debug("Rule evaluation completed with selected assignments of {}", assignments); if (assignments.isEmpty()) { logger.debug("No assignments found by BusinessRule strategy"); return null; } Assignment selected = assignments.iterator().next(); logger.debug("Selected assignment is for task {}", selected, task); return selected; } finally { kieSession.dispose(); logger.debug("KieSession in BusinessRule disposed"); } }
Source:
<code>public VoldemortService getService(ServiceType type) { <START> for(VoldemortService service: services) <END> if(service.getType().equals(type)) return service; throw new IllegalStateException(type.getDisplayName() + " has not been initialized."); }</code><technical_language>Please add { } if a single line statement</technical_language>

Target:
public VoldemortService getService(ServiceType type) { for(VoldemortService service: services) { if(service.getType().equals(type)) { return service; } } throw new IllegalStateException(type.getDisplayName() + " has not been initialized."); }
Source:
<code>protected void checkIfComplete() { <START> if (observer == null) <END> return; if (bytesCompleted >= bytesTotal) super.checkIfComplete(); }</code><technical_language>braces</technical_language>

Target:
protected void checkIfComplete() { if (observer == null) { return; } if (bytesCompleted >= bytesTotal) { super.checkIfComplete(); } }
Source:
<code>public long getLong() { <START> long retVal = buf.getLong((int) (pos / 8L)); <END> pos += 64L; return retVal; }</code><technical_language>This is valid aligned</technical_language>

Target:
public long getLong() { long a = getInt(); long b = getInt(); a &= 0xFFFFFFFFL; b &= 0xFFFFFFFFL; if (this.byteOrder == ByteOrder.BIG_ENDIAN) { return (a << 32) | b; } return (b << 32) | a; }