auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void handleDuplicates(DuplicateSearchResult result) { if (result == null) { return; } BasePanel panel = frame.getCurrentBasePanel(); final NamedCompound compoundEdit = new NamedCompound(Localization.lang("duplicate removal")); if (!result.getToRemove().isEmpty()) { <START> compoundEdit.addEdit(new UndoableRemoveEntries(panel.getDatabase(), new ArrayList<>(result.getToRemove()))); <END> panel.getDatabase().removeEntries(new ArrayList<>(result.getToRemove())); panel.markBaseChanged(); } if (!result.getToAdd().isEmpty()) { for (BibEntry entry : result.getToAdd()) { panel.getDatabase().insertEntry(entry); compoundEdit.addEdit(new UndoableInsertEntry(panel.getDatabase(), entry)); } panel.markBaseChanged(); } dialogService.notify(Localization.lang("Duplicates found") + ": " + duplicateCount.get() + ' ' + Localization.lang("pairs processed") + ": " + result.getDuplicateCount()); compoundEdit.end(); panel.getUndoManager().addEdit(compoundEdit); }</code><technical_language>I constructor of UndoableRemoveEntries accepting a single BibEntry, similarly method BibDatabase#removeEntry. (Btw, is Colections.singletonList(element) is preferred new ArrayList<>(element))</technical_language>

Target:
private void handleDuplicates(DuplicateSearchResult result) { if (result == null) { return; } BasePanel panel = frame.getCurrentBasePanel(); final NamedCompound compoundEdit = new NamedCompound(Localization.lang("duplicate removal")); if (!result.getToRemove().isEmpty()) { compoundEdit.addEdit(new UndoableRemoveEntries(panel.getDatabase(), result.getToRemove())); panel.getDatabase().removeEntries(result.getToRemove()); panel.markBaseChanged(); } if (!result.getToAdd().isEmpty()) { for (BibEntry entry : result.getToAdd()) { panel.getDatabase().insertEntry(entry); compoundEdit.addEdit(new UndoableInsertEntry(panel.getDatabase(), entry)); } panel.markBaseChanged(); } dialogService.notify(Localization.lang("Duplicates found") + ": " + duplicateCount.get() + ' ' + Localization.lang("pairs processed") + ": " + result.getDuplicateCount()); compoundEdit.end(); panel.getUndoManager().addEdit(compoundEdit); }
Source:
<code><START> public void testGetAllelesUnitialized(){ <END> GenotypeLikelihoods.plIndexToAlleleIndices.clear(); final List<Integer> alleles = GenotypeLikelihoods.getAlleles(0, 3); }</code><technical_language>space</technical_language>

Target:
public void testGetAllelesUnitialized() { GenotypeLikelihoods.anyploidPloidyToPLIndexToAlleleIndices.clear(); final List<Integer> alleles = GenotypeLikelihoods.getAlleles(0, 3); }
Source:
<code>private void flushErrorReport(File errorFile) { try { Report report = new Report(config, errorFile); for (BeforeSend beforeSend : config.getBeforeSendTasks()) { try { if (!beforeSend.run(report)) { <START> deleteStoredFiles(Collections.singleton(errorFile)); <END> Logger.info("Deleting cancelled error file " + errorFile.getName()); return; } } catch (Throwable ex) { Logger.warn("BeforeSend threw an Exception", ex); } } config.getDelivery().deliver(report, config); deleteStoredFiles(Collections.singleton(errorFile)); Logger.info("Deleting sent error file " + errorFile.getName()); } catch (DeliveryFailureException exception) { cancelQueuedFiles(Collections.singleton(errorFile)); Logger.warn("Could not send previously saved error(s)" + " to Bugsnag, will try again later", exception); } catch (Exception exception) { deleteStoredFiles(Collections.singleton(errorFile)); Logger.warn("Problem sending unsent error from disk", exception); } }</code><technical_language>this errorFile delivery successful</technical_language>

Target:
private void flushErrorReport(File errorFile) { try { Report report = null; if (config.getBeforeSendTasks().size() > 0) { report = new Report(config.getApiKey(), ErrorReader.readError(config, errorFile)); for (BeforeSend beforeSend : config.getBeforeSendTasks()) { try { if (!beforeSend.run(report)) { deleteStoredFiles(Collections.singleton(errorFile)); Logger.info("Deleting cancelled error file " + errorFile.getName()); return; } } catch (Throwable ex) { Logger.warn("BeforeSend threw an Exception", ex); } } } else { report = new Report(config.getApiKey(), errorFile); } config.getDelivery().deliver(report, config); deleteStoredFiles(Collections.singleton(errorFile)); Logger.info("Deleting sent error file " + errorFile.getName()); } catch (DeliveryFailureException exception) { cancelQueuedFiles(Collections.singleton(errorFile)); Logger.warn("Could not send previously saved error(s)" + " to Bugsnag, will try again later", exception); } catch (Exception exception) { deleteStoredFiles(Collections.singleton(errorFile)); Logger.warn("Problem sending unsent error from disk", exception); } }
Source:
<code><START> public TableViewerColumn createTableViewerLabelColumn(Object object) { <END> String label = (String) object; int width = 28 + 5 * label.length(); final TableViewerColumn viewerColumn = new TableViewerColumn(fViewer, SWT.NONE); final TableColumn column = viewerColumn.getColumn(); column.setText(label); column.setWidth(width); column.setAlignment(SWT.LEFT); column.setResizable(false); column.setMoveable(false); return viewerColumn; }</code><technical_language>Parameter a string instead called label</technical_language>

Target:
public void createTableViewerLabelColumn(Object object) { String label = (String) object; int width = 28 + 5 * label.length(); final TableViewerColumn viewerColumn = new TableViewerColumn(fViewer, SWT.NONE); final TableColumn column = viewerColumn.getColumn(); column.setText(label); column.setWidth(width); column.setAlignment(SWT.LEFT); column.setResizable(false); column.setMoveable(false); }
Source:
<code>public GoalDTO updateGoal(UUID userID, UUID goalID, GoalDTO newGoalDTO, Optional<String> message) { User userEntity = userService.getUserEntityByID(userID); Goal existingGoal = getGoalEntity(userEntity, goalID); verifyGoalUpdate(existingGoal, newGoalDTO); <START> if (newGoalDTO.getCreationTime().isPresent() && !newGoalDTO.isGoalChanged(existingGoal)) <END> { updateGoalCreationTime(userEntity, existingGoal, newGoalDTO); } else if (newGoalDTO.isGoalChanged(existingGoal)) { updateGoal(userEntity, existingGoal, newGoalDTO, message); } return GoalDTO.createInstance(existingGoal); }</code><technical_language>I this is necessary for test, however, I is good do a check passed creation time is creation time of existing goal avoid strange errors Mobiquity..</technical_language>

Target:
public GoalDTO updateGoal(UUID userID, UUID goalID, GoalDTO newGoalDTO, Optional<String> message) { User userEntity = userService.getUserEntityByID(userID); Goal existingGoal = getGoalEntity(userEntity, goalID); verifyGoalUpdate(existingGoal, newGoalDTO); if (newGoalDTO.getCreationTime().isPresent() && !newGoalDTO.isGoalChanged(existingGoal)) { updateGoalCreationTime(userEntity, existingGoal, newGoalDTO); } else if (newGoalDTO.isGoalChanged(existingGoal)) { assertNoUpdateToThePast(newGoalDTO, existingGoal); updateGoal(userEntity, existingGoal, newGoalDTO, message); } return GoalDTO.createInstance(existingGoal); }
Source:
<code>private void handleSymbol(Symbol symbol) { List<Usage> usages = new ArrayList<>(symbol.usages()); usages.sort(Comparator.comparingInt(u -> u.tree().firstToken().line())); Usage firstUsage = usages.get(0); <START> NewSymbol newSymbol = newSymbolTable.newSymbol(firstUsage.tree().firstToken().line(), firstUsage.tree().firstToken().column(), <END> firstUsage.tree().lastToken().line(), firstUsage.tree().lastToken().column() + firstUsage.tree().lastToken().value().length()); for (int i = 1; i < usages.size(); i++) { Usage usage = usages.get(i); newSymbol.newReference(usage.tree().firstToken().line(), usage.tree().firstToken().column(), usage.tree().lastToken().line(), usage.tree().lastToken().column() + firstUsage.tree().lastToken().value().length()); } }</code><technical_language>store firstUsage.tree() in a dedicated var instead of calling 4 times</technical_language>

Target:
private void handleSymbol(Symbol symbol) { List<Usage> usages = new ArrayList<>(symbol.usages()); usages.sort(Comparator.comparingInt(u -> u.tree().firstToken().line())); Tree firstUsageTree = usages.get(0).tree(); NewSymbol newSymbol = newSymbolTable.newSymbol(firstUsageTree.firstToken().line(), firstUsageTree.firstToken().column(), firstUsageTree.lastToken().line(), firstUsageTree.lastToken().column() + firstUsageTree.lastToken().value().length()); for (int i = 1; i < usages.size(); i++) { Tree usageTree = usages.get(i).tree(); newSymbol.newReference(usageTree.firstToken().line(), usageTree.firstToken().column(), usageTree.lastToken().line(), usageTree.lastToken().column() + usageTree.lastToken().value().length()); } }
Source:
<code>private String computeUsername(MailAddress recipient) throws MessagingException { try { return usersRepository.getUser(recipient); } catch (UsersRepositoryException e) { if (LOGGER.isWarnEnabled()) { <START> LOGGER.warn("Unable to retrieve username for " + recipient.asPrettyString(), e); <END> } return recipient.toString(); } }</code><technical_language>placeholder here</technical_language>

Target:
private String computeUsername(MailAddress recipient) throws MessagingException { try { return usersRepository.getUser(recipient); } catch (UsersRepositoryException e) { LOGGER.warn("Unable to retrieve username for {}", recipient.asPrettyString(), e); return recipient.toString(); } }
Source:
<code>public void helloWorld() throws Exception { GlobalSecurityConfig sc = new GlobalSecurityConfig(jenkins); sc.open(); { MockSecurityRealm ms = sc.useRealm(MockSecurityRealm.class); ms.configure("alice","bob"); MatrixAuthorizationStrategy mas = sc.useAuthorizationStrategy(MatrixAuthorizationStrategy.class); MatrixRow a = mas.addUser("alice"); a.admin(); MatrixRow bob = mas.addUser("bob"); bob.on(OVERALL_READ); } sc.save(); jenkins.login().doLogin("alice"); FreeStyleJob j = jenkins.jobs.create(); j.save(); jenkins.login().doLogin("bob"); waitFor(by.id("main-panel")); assertNull(getElement(by.href("job/"+j.name+"/"))); jenkins.login().doLogin("alice"); <START> waitFor(by.id("main-panel")); <END> assertNotNull(getElement(by.href("job/"+j.name+"/"))); }</code><technical_language>waitFor(by.id("main-panel")); I this is stable. If layout changes.... Is other check if page loaded</technical_language>

Target:
public void helloWorld() throws Exception { GlobalSecurityConfig sc = new GlobalSecurityConfig(jenkins); sc.open(); { MockSecurityRealm ms = sc.useRealm(MockSecurityRealm.class); ms.configure("alice","bob"); MatrixAuthorizationStrategy mas = sc.useAuthorizationStrategy(MatrixAuthorizationStrategy.class); MatrixRow a = mas.addUser("alice"); a.admin(); MatrixRow bob = mas.addUser("bob"); bob.on(OVERALL_READ); } sc.save(); jenkins.login().doLogin("alice"); FreeStyleJob j = jenkins.jobs.create(); j.save(); jenkins.logout(); jenkins.login().doLogin("bob"); assertFalse(j.open().getTitle().contains(j.name)); jenkins.logout(); jenkins.login().doLogin("alice"); assertTrue(j.open().getTitle().contains(j.name)); }
Source:
<code>private User mapParticipationDto(ParticipationDto dto){ User user = new User(); user.setUsername(dto.getName()); <START> user.setPassword(dto.getPassword()); <END> user.setEmail(dto.getUuid() + "@cod.uno"); return user; }</code><technical_language>is</technical_language>

Target:
private User mapParticipationDto(ParticipationDto dto) { User user = new User(); user.setId(UUID.fromString(dto.getUuid())); user.setUsername(dto.getName()); user.setPassword(dto.getPassword()); user.setEmail(dto.getEmail()); return user; }
Source:
<code>public java.util.List<String> getTooltipStrings(int mouseX, int mouseY) { if (mouseX > 67 && mouseX < 107 && mouseY > 18 && mouseY < 38) { <START> return Collections.singletonList("Click in world, shift click for second output"); <END> } return Collections.emptyList(); }</code><technical_language>translate</technical_language>

Target:
public java.util.List<String> getTooltipStrings(int mouseX, int mouseY) { if (mouseX > 67 && mouseX < 107 && mouseY > 18 && mouseY < 38) { return Collections.singletonList(I18n.format("pe.nei.worldtransmute.description")); } return Collections.emptyList(); }
Source:
<code>public String toString() { return getClass().getSimpleName()+"["+ (Strings.isNonBlank(publicKeyData) ? publicKeyData : "public-key")+";"+ <START> (Strings.isNonBlank(privateKeyData) ? "private-key" : "private-key")+","+ <END> (password!=null ? "password(len="+password.length()+")" : "no-password")+"]"; }</code><technical_language>toString wrong: "private-key" is privateKeyData, "public-key" if is publicKeyData</technical_language>

Target:
public String toString() { return getClass().getSimpleName()+"["+ (Strings.isNonBlank(publicKeyData) ? publicKeyData : "no-public-key")+";"+ (Strings.isNonBlank(privateKeyData) ? "private-key-present" : "no-private-key")+","+ (password!=null ? "password(len="+password.length()+")" : "no-password")+"]"; }
Source:
<code><START> protected StorageHelper getStorageHelper() { <END> synchronized (sLock) { if (sHelper == null) { Logger.v(TAG, "Started to initialize storage helper"); sHelper = new StorageHelper(mContext); Logger.v(TAG, "Finished to initialize storage helper"); } } return sHelper; }</code><technical_language>nit: syncronized</technical_language>

Target:
protected synchronized StorageHelper getStorageHelper() { if (sHelper == null) { Logger.v(TAG, "Started to initialize storage helper"); sHelper = new StorageHelper(mContext); Logger.v(TAG, "Finished to initialize storage helper"); } return sHelper; }
Source:
<code>private TargetedSweeper initializeAndGet(TargetedSweeper sweeper, TransactionManager txManager) { sweeper.initialize( new SpecialTimestampsSupplier(txManager::getImmutableTimestamp, txManager::getImmutableTimestamp), <START> txManager.getLockService(), <END> txManager.getKeyValueService(), new TargetedSweepFollower(ImmutableList.of(FOLLOWER), txManager)); return sweeper; }</code><technical_language>late party - this legacy lock service prefer if async lock. blocking (and want get this out soon)</technical_language>

Target:
private TargetedSweeper initializeAndGet(TargetedSweeper sweeper, TransactionManager txManager) { sweeper.initialize( new SpecialTimestampsSupplier(txManager::getImmutableTimestamp, txManager::getImmutableTimestamp), txManager.getTimelockService(), txManager.getKeyValueService(), new TargetedSweepFollower(ImmutableList.of(FOLLOWER), txManager)); return sweeper; }
Source:
<code>public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); extensionHook.addOptionsParamSet(getParam()); extensionHook.addSessionListener(this); extensionHook.addSiteMapListener(this); extensionHook.addHttpSenderListener(this); if (getView() != null) { extensionHook.getHookView().addStatusPanel(getHttpSessionsPanel()); extensionHook.getHookView().addOptionPanel(getOptionsHttpSessionsPanel()); <START> extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuSetActiveSession()); <END> extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuUnsetActiveSession()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuRemoveSession()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuAddUserFromSession()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuItemCopySessionToken()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuItemFindRelatedMessages()); } extensionHook.addApiImplementor(new HttpSessionsAPI(this)); }</code><technical_language>Consider adding if search extension is enabled</technical_language>

Target:
public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); extensionHook.addOptionsParamSet(getParam()); extensionHook.addSessionListener(this); extensionHook.addSiteMapListener(this); extensionHook.addHttpSenderListener(this); if (getView() != null) { extensionHook.getHookView().addStatusPanel(getHttpSessionsPanel()); extensionHook.getHookView().addOptionPanel(getOptionsHttpSessionsPanel()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuSetActiveSession()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuUnsetActiveSession()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuRemoveSession()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuAddUserFromSession()); extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuItemCopySessionToken()); if (Control.getSingleton().getExtensionLoader().getExtension(ExtensionSearch.class) != null) { extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuItemFindRelatedMessages()); } } extensionHook.addApiImplementor(new HttpSessionsAPI(this)); }
Source:
<code>public static boolean isMafFile(String file) { <START> return Pattern.matches("^[\\w\\-\\./]+.maf$", file); <END> }</code><technical_language>mafs extension txt tsv</technical_language>

Target:
public static boolean isMafFile(String file) { return Pattern.matches("^[\\w\\-\\./]+(\\.maf)|^[\\w\\-\\./]+(\\.tsv)|^[\\w\\-\\./]+(\\.txt)$$", file); }
Source:
<code>public void testAnnotationIsDefault() { loadTheDefaultCatalog(); int numInDefault = Iterables.size(defaultCatalog.getCatalogItems(Predicates.alwaysTrue())); loadAnnotationsOnlyCatalog(); int numFromAnnots = Iterables.size(annotsCatalog.getCatalogItems(Predicates.alwaysTrue())); <START> Assert.assertEquals(numInDefault, numFromAnnots); <END> }</code><technical_language>assert > 0; a bug a coincidence zero</technical_language>

Target:
public void testAnnotationIsDefault() { doTestAnnotationIsDefault(false); }
Source:
<code>protected void processEvent(EventObject event) { Assert.notNull(event, "event must not be null"); if (getCacheEventTypeSet().contains(((AbstractIMapEvent) event).getEventType().toString())) { sendMessage(event, ((AbstractIMapEvent) event).getMember().getSocketAddress(), getCacheListeningPolicy()); <START> } <END> }</code><technical_language>log in DEBUG</technical_language>

Target:
protected void processEvent(EventObject event) { Assert.notNull(event, "event must not be null"); if (getCacheEvents().contains(((AbstractIMapEvent) event).getEventType().toString())) { sendMessage(event, ((AbstractIMapEvent) event).getMember().getSocketAddress(), getCacheListeningPolicy()); } if (logger.isDebugEnabled()){ logger.debug("Received Event : " + event); } }
Source:
<code>public void testEventHandlerDependencies() throws InterruptedException { final Context context = new Context(ServiceNeedingAnEventService.class); final EventService eventService = context.getService(EventService.class); final ServiceNeedingAnEventService snaeService = context.getService(ServiceNeedingAnEventService.class); assertNotNull(eventService); <START> Thread.sleep(500); END> assertTrue(snaeService.isContextCreated()); }</code><technical_language>snaeService.wait(500); instead calling notify(); in event handler</technical_language>

Target:
public void testEventHandlerDependencies() throws InterruptedException { final Context context = new Context(ServiceNeedingAnEventService.class); final EventService eventService = context.getService(EventService.class); final ServiceNeedingAnEventService snaeService = context.getService(ServiceNeedingAnEventService.class); assertNotNull(eventService); synchronized (snaeService) { snaeService.wait(500); } assertTrue(snaeService.isContextCreated()); }
Source:
<code>public void testKleinbergBurstDetection() { assertFunction( "KLEINBERG_BURST_DETECTION(ARRAY[1.1])", new ArrayType(IntegerType.INTEGER), null); assertFunction( "KLEINBERG_BURST_DETECTION(ARRAY[100, 100.1, 101, 110, 110.1, 110.2, 110.3, 110.35, 110.40, 150, 304.35])", new ArrayType(IntegerType.INTEGER), ImmutableList.of(0, 2, 2, 2, 6, 6, 6, 6, 6, 0, 0)); assertFunction( "KLEINBERG_BURST_DETECTION(ARRAY[100, 100.1, 101, 110, 110.1, 110.2, 110.3, 110.35, 110.40, 150, 304.35], 2.0, 1.0)", new ArrayType(IntegerType.INTEGER), ImmutableList.of(0, 2, 2, 2, 6, 6, 6, 6, 6, 0, 0)); assertFunction( "KLEINBERG_BURST_DETECTION(ARRAY[100, 101, 110, 111, 112, 113, 114, 115, 150, 304])", new ArrayType(IntegerType.INTEGER), ImmutableList.of(0, 2, 2, 3, 3, 3, 3, 3, 0, 0)); assertFunction( "KLEINBERG_BURST_DETECTION(ARRAY[110.40, 110.35])", new ArrayType(IntegerType.INTEGER), null); assertFunction( "KLEINBERG_BURST_DETECTION(" + <START> "ARRAY[CAST(100 as REAL), " + <END> "CAST(100.1 as REAL), " + "CAST(101 as REAL), " + "CAST(110 as REAL), " + "CAST(110.1 as REAL), " + "CAST(110.2 as REAL), " + "CAST(110.3 as REAL), " + "CAST(110.35 as REAL), " + "CAST(110.40 as REAL), " + "CAST(150 as REAL), " + "CAST(304.35 as REAL)])", new ArrayType(IntegerType.INTEGER), ImmutableList.of(0, 2, 2, 2, 6, 6, 6, 6, 6, 0, 0)); }</code><technical_language>write literal sql REAL '100'</technical_language>

Target:
public void testKleinbergBurstDetection() { assertInvalidFunction( "KLEINBERG_BURST_DETECTION(ARRAY[1.1])", INVALID_FUNCTION_ARGUMENT, "time series must have at least two values"); assertFunction( "KLEINBERG_BURST_DETECTION(ARRAY[100, 100.1, 101, 110, 110.1, 110.2, 110.3, 110.35, 110.40, 150, 304.35])", new ArrayType(IntegerType.INTEGER), ImmutableList.of(0, 2, 2, 2, 6, 6, 6, 6, 6, 0, 0)); assertFunction( "KLEINBERG_BURST_DETECTION(ARRAY[100, 100.1, 101, 110, 110.1, 110.2, 110.3, 110.35, 110.40, 150, 304.35], 2.0, 1.0)", new ArrayType(IntegerType.INTEGER), ImmutableList.of(0, 2, 2, 2, 6, 6, 6, 6, 6, 0, 0)); assertFunction( "KLEINBERG_BURST_DETECTION(ARRAY[100, 101, 110, 111, 112, 113, 114, 115, 150, 304])", new ArrayType(IntegerType.INTEGER), ImmutableList.of(0, 2, 2, 3, 3, 3, 3, 3, 0, 0)); assertInvalidFunction( "KLEINBERG_BURST_DETECTION(ARRAY[110.40, 110.35])", INVALID_FUNCTION_ARGUMENT, "time series must be sorted in ascending order"); assertFunction( "KLEINBERG_BURST_DETECTION(" + "ARRAY[REAL '100', " + "REAL '100.1', " + "REAL '101', " + "REAL '110', " + "REAL '110.1', " + "REAL '110.2', " + "REAL '110.3', " + "REAL '110.35', " + "REAL '110.40', " + "REAL '150', " + "REAL '304.35'])", new ArrayType(IntegerType.INTEGER), ImmutableList.of(0, 2, 2, 2, 6, 6, 6, 6, 6, 0, 0)); }
Source:
<code>private ArrayList<MediaOption> initOtherMediaAudioFileOptions() { ArrayList<MediaOption> otherMediaOptions = new ArrayList<>(); FragmentActivity activity = getActivity(); if (activity == null) { AppLog.e(T.EDITOR, "Failed to initialize other media options because the activity is null"); return otherMediaOptions; } String packageName = activity.getApplication().getPackageName(); int chooseAudioFileResourceId = getResources().getIdentifier("photo_picker_choose_file", "string", packageName); <START> otherMediaOptions.add(new MediaOption(MEDIA_SOURCE_AUDIO_FILE, getString(chooseAudioFileResourceId))); <END> return otherMediaOptions; }</code><technical_language>GB, GlueCode learning path , is worth constraint, wondering difference MEDIA_SOURCE_FILE MEDIA_SOURCE_AUDIO_FILE parameter, try extract common code initOtherMediaFileOptions? wdyt</technical_language>

Target:
private ArrayList<MediaOption> initOtherMediaAudioFileOptions() { return initOtherMediaFileOptions(MEDIA_SOURCE_AUDIO_FILE); }
Source:
<code>protected void onInitialize() { super.onInitialize(); <START> add(new AjaxEventBehavior("onclick") { <END> @Override protected void onEvent(AjaxRequestTarget target) { popoverPanel.getContentModel().setObject(getContentModel().getObject()); popoverPanel.getTitleModel().setObject(getTitleModel().getObject()); popoverPanel.setPosition(positionModel.getObject()); popoverPanel.setPlacement(getPlacementModel().getObject()); popoverPanel.setPositioning(DEFAULT_POSITIONING); popoverPanel.show(target); } }); }</code><technical_language>click onclick lead WARNs in Wicket 7.x - <LINK_0></technical_language>

Target:
protected void onInitialize() { super.onInitialize(); add(new AjaxEventBehavior("click") { @Override protected void onEvent(AjaxRequestTarget target) { popoverPanel.getContentModel().setObject(getContentModel().getObject()); popoverPanel.getTitleModel().setObject(getTitleModel().getObject()); popoverPanel.setPosition(positionModel.getObject()); popoverPanel.setPlacement(getPlacementModel().getObject()); popoverPanel.setPositioning(DEFAULT_POSITIONING); popoverPanel.show(target); } }); }
Source:
<code>public void writeFrom(ReadableByteChannel channel, long offset, long size) throws IOException { int sizeRead = 0; <START> ByteBuffer buffer = buflist.get(index); <END> while (sizeRead < size) { sizeRead += channel.read(buffer); } index++; }</code><technical_language>this is right? try find bytebuffer list offset lies read data channel write bytebuffer of "size" bytes</technical_language>

Target:
public void writeFrom(ReadableByteChannel channel, long offset, long size) throws IOException { throw new IllegalArgumentException("Not implemented"); }
Source:
<code>public SELF isEqualTo(Object... values) { if(!recursiveComparisonConfiguration.getAllowArrayTypeForExpected()) <START> throw new AssertionError("Type array is not acceptable when comparing iterables, try calling #allowingArrayTypeForExpected configuration."); <END> return isEqualTo(Arrays.asList(values)); }</code><technical_language>Reword suggestion: default array compared Iterable, call allowingArrayTypeForExpected allow it</technical_language>

Target:
public SELF isEqualTo(Object... values) { if(!recursiveComparisonConfiguration.getAllowComparingIterableWithArray()) throw new AssertionError("By default Iterable can't be compared to array, call allowingComparingIterableWithArray to allow it."); return isEqualTo(list(values)); }
Source:
<code>public static String getMetadataForDeactivateIdentifier(String identifier, Map<String, String> metadata, DvObject dvObject) { <START> System.out.print("Start of getMetadataForDeactivateIdentifier: "); <END> DataCiteMetadataTemplate metadataTemplate = new DataCiteMetadataTemplate(); metadataTemplate.setIdentifier(identifier.substring(identifier.indexOf(':') + 1)); metadataTemplate.setCreators(Util.getListFromStr(metadata.get("datacite.creator"))); metadataTemplate.setDescription(":unav"); String title =metadata.get("datacite.title"); System.out.print("Map metadata title: "+ metadata.get("datacite.title")); metadataTemplate.setAuthors(null); metadataTemplate.setTitle(title); String producerString = ":unav"; metadataTemplate.setPublisher(producerString); metadataTemplate.setPublisherYear(metadata.get("datacite.publicationyear")); String xmlMetadata = metadataTemplate.generateXML(dvObject); logger.log(Level.FINE, "XML to send to DataCite: {0}", xmlMetadata); return xmlMetadata; }</code><technical_language>logging</technical_language>

Target:
public static String getMetadataForDeactivateIdentifier(String identifier, Map<String, String> metadata, DvObject dvObject) { DataCiteMetadataTemplate metadataTemplate = new DataCiteMetadataTemplate(); metadataTemplate.setIdentifier(identifier.substring(identifier.indexOf(':') + 1)); metadataTemplate.setCreators(Util.getListFromStr(metadata.get("datacite.creator"))); metadataTemplate.setDescription(AbstractGlobalIdServiceBean.UNAVAILABLE); String title =metadata.get("datacite.title"); System.out.print("Map metadata title: "+ metadata.get("datacite.title")); metadataTemplate.setAuthors(null); metadataTemplate.setTitle(title); String producerString = AbstractGlobalIdServiceBean.UNAVAILABLE; metadataTemplate.setPublisher(producerString); metadataTemplate.setPublisherYear(metadata.get("datacite.publicationyear")); String xmlMetadata = metadataTemplate.generateXML(dvObject); logger.log(Level.FINE, "XML to send to DataCite: {0}", xmlMetadata); return xmlMetadata; }
Source:
<code><START> synchronized void prepareDataForEpoch() { <END> trainingDataKeySet.addAll(memoryStore.getAll().keySet()); LOG.log(Level.INFO, "training data key set size = " + trainingDataKeySet.size()); }</code><technical_language>This method access modifier. Is public? is supposed visible dolphin.async? align this getNextTrainingData()</technical_language>

Target:
public synchronized void prepareDataForEpoch() { trainingDataKeySet.addAll(memoryStore.getAll().keySet()); LOG.log(Level.INFO, "training data key set size = {0}", trainingDataKeySet.size()); }
Source:
<code>public void onDraw(Canvas canvas) { if (super.text.get() == null) { super.text.set(""); } super.lastFont = canvas.getCurrentStyle().getFont(); super.lastWidth = (int) (canvas.size().x * 0.8f); if (isEnabled()) { canvas.addInteractionRegion(super.interactionListener, Rect2i.createFromMinAndMax(0, 0, (int) (canvas.size().x * 0.8f), canvas.size().y)); <START> clearButton.subscribe(new ActivateEventListener() { <END> @Override public void onActivated(UIWidget widget) { setText(""); } }); } clearButton.setEnabled(isEnabled()); correctCursor(); int widthForDraw = (super.multiline) ? (int) (canvas.size().x * 0.8f) : super.lastFont.getWidth(getText()); try (SubRegion ignored = canvas.subRegion(canvas.getRegion(), true); SubRegion ignored2 = canvas.subRegion(Rect2i.createFromMinAndSize(-super.offset, 0, widthForDraw + 1, Integer.MAX_VALUE), false)) { canvas.drawText(super.text.get(), canvas.getRegion()); if (isFocused()) { if (hasSelection()) { drawSelection(canvas); } else { drawCursor(canvas); } } } Rect2i buttonRegion = Rect2i.createFromMinAndMax((int) (canvas.size().x * 0.8f), 0, canvas.size().x, canvas.size().y); canvas.drawWidget(clearButton, buttonRegion); }</code><technical_language>This lambdified: java clearButton.subscribe(button -> setText("")); IDEA prompt convert anonymous classes lambdas - do this</technical_language>

Target:
public void onDraw(Canvas canvas) { Rect2i clearButtonRegion = Rect2i.createFromMinAndSize(0, 0, 30, canvas.size().y); if (text.get() == null) { text.set(""); } lastFont = canvas.getCurrentStyle().getFont(); lastWidth = canvas.size().x - clearButtonRegion.size().x; if (isEnabled()) { canvas.addInteractionRegion(interactionListener, Rect2i.createFromMinAndMax(0, 0, canvas.size().x, canvas.size().y)); canvas.addInteractionRegion(clearInteractionListener, Rect2i.createFromMinAndMax(canvas.size().x, 0, canvas.size().x + clearButtonRegion.size().x, canvas.size().y)); } correctCursor(); int widthForDraw = (multiline) ? canvas.size().x - clearButtonRegion.size().x : lastFont.getWidth(getText()); try (SubRegion ignored = canvas.subRegion(canvas.getRegion(), true); SubRegion ignored2 = canvas.subRegion(Rect2i.createFromMinAndSize(-offset, 0, widthForDraw + 1, Integer.MAX_VALUE), false)) { canvas.drawText(text.get(), canvas.getRegion()); if (isFocused()) { if (hasSelection()) { drawSelection(canvas); } else { drawCursor(canvas); } } } }
Source:
<code>private SingleFieldConstraint getLHSBoundField(IPattern pat, String var) { if (pat instanceof FromCompositeFactPattern) { pat = ((FromCompositeFactPattern) pat).getFactPattern(); } if (pat instanceof CompositeFactPattern) { IFactPattern[] patterns = ((CompositeFactPattern) pat).getPatterns(); <START> if (patterns != null) { <END> for (IPattern iPattern : patterns) { SingleFieldConstraint fieldConstraint = getLHSBoundField(iPattern, var); if (fieldConstraint != null) { return fieldConstraint; } } } } if (pat instanceof FactPattern) { final FactPattern p = (FactPattern) pat; for (int j = 0; j < p.getFieldConstraints().length; j++) { if (p.getFieldConstraints()[j] instanceof SingleFieldConstraint) { SingleFieldConstraint fc = (SingleFieldConstraint) p.getFieldConstraints()[j]; List<String> fieldBindings = getFieldBinding(fc); if (fieldBindings.contains(var)) { return fc; } } } } return null; }</code><technical_language>add this null check more occurrences? - getLHSBindingType - findBoundVariableNames</technical_language>

Target:
private SingleFieldConstraint getLHSBoundField(IPattern pat, String var) { if (pat instanceof FromCompositeFactPattern) { pat = ((FromCompositeFactPattern) pat).getFactPattern(); } if (pat instanceof CompositeFactPattern) { final IFactPattern[] patterns = ((CompositeFactPattern) pat).getPatterns(); if (patterns != null) { for (IPattern iPattern : patterns) { SingleFieldConstraint fieldConstraint = getLHSBoundField(iPattern, var); if (fieldConstraint != null) { return fieldConstraint; } } } } if (pat instanceof FactPattern) { final FactPattern p = (FactPattern) pat; for (int j = 0; j < p.getFieldConstraints().length; j++) { if (p.getFieldConstraints()[j] instanceof SingleFieldConstraint) { SingleFieldConstraint fc = (SingleFieldConstraint) p.getFieldConstraints()[j]; List<String> fieldBindings = getFieldBinding(fc); if (fieldBindings.contains(var)) { return fc; } } } } return null; }
Source:
<code>public int size() { <START> return size; <END> }</code><technical_language>I recommend dropping size var calling timeStamps.size() ... this do this correct... for example set this zero calling clear</technical_language>

Target:
public int size() { return timeStamps.size(); }
Source:
<code>private void sendSuccessfullyUpdatedAccountsNotification(List<Account> updatedAccounts) { Map<String, Object> model = new HashMap<>(); model.put("accounts", updatedAccounts); model.put("today", LocalDate.now(UTC)); final String subjectMessageKey = "subject.account.updatedRemainingDays"; final String templateName = "updated_accounts"; final Mail toOffice= Mail.builder() .withRecipient(NOTIFICATION_OFFICE) .withSubject(subjectMessageKey) .withTemplate(templateName, model) .build(); mailService.send(toOffice); <START> final Mail toTechnical = Mail.builder() <END> .withRecipient(true) .withSubject(subjectMessageKey) .withTemplate(templateName, model) .build(); mailService.send(toTechnical); }</code><technical_language>Rename this mailToTechnical</technical_language>

Target:
private void sendSuccessfullyUpdatedAccountsNotification(List<Account> updatedAccounts) { Map<String, Object> model = new HashMap<>(); model.put("accounts", updatedAccounts); model.put("today", LocalDate.now(UTC)); final String subjectMessageKey = "subject.account.updatedRemainingDays"; final String templateName = "updated_accounts"; final Mail mailToOffice= Mail.builder() .withRecipient(NOTIFICATION_OFFICE) .withSubject(subjectMessageKey) .withTemplate(templateName, model) .build(); mailService.send(mailToOffice); final Mail mailToTechnical = Mail.builder() .withTechnicalRecipient(true) .withSubject(subjectMessageKey) .withTemplate(templateName, model) .build(); mailService.send(mailToTechnical); }
Source:
<code>private static Response buildServerError(Exception exception) { log.warn("", exception); String message = exception.getMessage(); if (message == null) { message = exception.toString(); } String stack = ""; for (StackTraceElement s : exception.getStackTrace()) { stack += s + "\n"; } <START> <END> JSONObject body = new JSONObject(); String response; try { body.put("error", "A java exception was thrown."); body.put("message", message); body.put("stack", stack); response = body.toString(); } catch(JSONException ex) { log.error("[buildServerError]", "failed to construct a json response"); response = "{\"error\": \"Failed to serialize java exception. Please see spawn logs for more details.\"}"; } return Response.serverError().entity(response).build(); }</code><technical_language>guava Throwables: String stack = Throwables.getStackTraceAsString(exception);</technical_language>

Target:
private static Response buildServerError(Exception exception) { log.warn("", exception); String message = exception.getMessage(); if (message == null) { message = exception.toString(); } String stack = Throwables.getStackTraceAsString(exception); final String response = "{" + "\"error\": \"A java exception was thrown." + "\"message\": \"" + StringEscapeUtils.escapeEcmaScript(message) + "\"" + "\"stack\": \"" + StringEscapeUtils.escapeEcmaScript(stack) + "\"" + "\"}"; return Response.serverError().entity(response).build(); }
Source:
<code>public ICompletionProposal[] getCompletionProposals() { List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); String[] strings = completionMap.get(acKey); <START> for (int i = 0; i < strings.length; i++) { <END> if (!strings[i].startsWith(prefix)) continue; String proposal = strings[i] + "=\"\""; proposals.add(new CompletionProposal(proposal, offset - prefix.length(), prefix.length(), proposal.length() - 1, null, strings[i], null, null)); } return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]); }</code><technical_language>Foreach</technical_language>

Target:
public ICompletionProposal[] getCompletionProposals() { List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); String[] strings = completionMap.get(acKey); for (String string: strings){ if (!string.startsWith(prefix)){ continue; } String proposal = string + "=\"\""; proposals.add(new CompletionProposal(proposal, offset - prefix.length(), prefix.length(), proposal.length() - 1, null, string, null, null)); } return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]); }
Source:
<code>public void addCustomHeader(final String key, final String value) { this.customHeaders.add(new Map.Entry<String, String>() { <START> public String getKey() { <END> return key; } public String getValue() { return value; } public String setValue(String value) { return null; } }); }</code><technical_language>Suggest instances of java.util.AbstractMap.SimpleEntry instead of making a bunch of anonymous classes</technical_language>

Target:
public void addCustomHeader(final String key, final String value) { this.customHeaders.add(new AbstractMap.SimpleEntry<>(key, value)); }
Source:
<code>public int read() throws IOException { final int b = is.read(); <START> if (b != '\r') { <END> return b; } final int future = is.read(); if (future == '\n') { return '\n'; } is.unread(future); return b; }</code><technical_language>Style-nit: avoid { if/for/while/etc. is statement in body</technical_language>

Target:
public int read() throws IOException { final int read = read(single, 0, 1); return read == 1 ? single[0] : -1; }
Source:
<code>public void testEqualsAndHashCodeOfTagClass() { <START> final Object tag = getTagsAfterExecution(" END> final EqualsVerifierReport ev = EqualsVerifier.forClass(tag.getClass()) .usingGetClass().report(); assertEquals("Error: " + ev.getMessage(), EqualsVerifierReport.SUCCESS, ev); }</code><technical_language>Please name getTagsAfterExecutionOnDefaulFilter</technical_language>

Target:
public void testEqualsAndHashCodeOfTagClass() { final Object tag = getTagsAfterExecutionOnDefaultFilter(" final EqualsVerifierReport ev = EqualsVerifier.forClass(tag.getClass()) .usingGetClass().report(); assertEquals("Error: " + ev.getMessage(), EqualsVerifierReport.SUCCESS, ev); }
Source:
<code>public Object invoke(Object proxy, final Method method, Object[] args) { try { final SwaggerMethodParser methodParser; final HttpRequest request; if (method.isAnnotationPresent(ResumeOperation.class)) { OperationDescription opDesc = ImplUtils.findFirstOfType(args, OperationDescription.class); Method resumeMethod = determineResumeMethod(method, opDesc.getMethodName()); methodParser = getMethodParser(resumeMethod); request = createHttpRequest(opDesc, methodParser, args); final Type returnType = methodParser.getReturnType(); return handleResumeOperation( request, opDesc, methodParser, returnType, startTracingSpan(resumeMethod, Context.NONE)); } else { methodParser = getMethodParser(method); request = createHttpRequest(methodParser, args); Context context = methodParser.setContext(args).addData("caller-method", methodParser.getFullyQualifiedMethodName()); context = startTracingSpan(method, context); if (request.getBody() != null) { request.setBody(validateLength(request)); } final Mono<HttpResponse> asyncResponse = send(request, context); Mono<HttpDecodedResponse> asyncDecodedResponse = this.decoder.decode(asyncResponse, methodParser); return handleHttpResponse(request, asyncDecodedResponse, methodParser, methodParser.getReturnType(), context); } } catch (Exception e) { throw logger.logExceptionAsError(new RuntimeException( <START> "Error occurs during sending request and deserializing response. Error Details: "+ e.getMessage(), e)); <END> } }</code><technical_language>tense for occurs, do want log another generic log message a specific log message. times want ignore logging rules</technical_language>

Target:
public Object invoke(Object proxy, final Method method, Object[] args) { try { final SwaggerMethodParser methodParser; final HttpRequest request; if (method.isAnnotationPresent(ResumeOperation.class)) { OperationDescription opDesc = ImplUtils.findFirstOfType(args, OperationDescription.class); Method resumeMethod = determineResumeMethod(method, opDesc.getMethodName()); methodParser = getMethodParser(resumeMethod); request = createHttpRequest(opDesc, methodParser, args); final Type returnType = methodParser.getReturnType(); return handleResumeOperation( request, opDesc, methodParser, returnType, startTracingSpan(resumeMethod, Context.NONE)); } else { methodParser = getMethodParser(method); request = createHttpRequest(methodParser, args); Context context = methodParser.setContext(args).addData("caller-method", methodParser.getFullyQualifiedMethodName()); context = startTracingSpan(method, context); if (request.getBody() != null) { request.setBody(validateLength(request)); } final Mono<HttpResponse> asyncResponse = send(request, context); Mono<HttpDecodedResponse> asyncDecodedResponse = this.decoder.decode(asyncResponse, methodParser); return handleHttpResponse(request, asyncDecodedResponse, methodParser, methodParser.getReturnType(), context); } } catch (IOException e) { throw logger.logExceptionAsError(Exceptions.propagate(e)); } }
Source:
<code>public Integer getPermissions() { <START> return Utils.asInteger(this.get("permissions")); <END> }</code><technical_language>this is a string, right</technical_language>

Target:
public String getPermissions() { return (String) this.get("permissions"); }
Source:
<code>private String getTaskUrl(String reviewUrlToFind) { <START> for (Map.Entry<String, List<String>> mapping : taskReviewsMap.entrySet()) { <END> for (String reviewUrl : mapping.getValue()) { if (reviewUrlToFind.equals(reviewUrl)) { return mapping.getKey(); } } } return null; }</code><technical_language>a good candidate for Guava's find reduce loops increase readability</technical_language>

Target:
private String getTaskUrl(String reviewUrlToFind) { for (Map.Entry<String, List<String>> mapping : taskReviewsMap.entrySet()) { int index = mapping.getValue().indexOf(reviewUrlToFind); if (index != -1) { return mapping.getKey(); } } return null; }
Source:
<code>public void emit(Event event) { if (event instanceof ServiceMetricEvent) { ServiceMetricEvent metricEvent = (ServiceMetricEvent) event; try { <START> ganglia.announce( <END> sanitize(metricEvent.getService() + "_" + metricEvent.getMetric()), metricEvent.getValue().doubleValue(), metricEvent.getService() ); } catch (GangliaException e) { log.error(e, "Dropping event [%s]. Unable to send to Ganglia.", event); } } }</code><technical_language>is this call blocking ? fear is .</technical_language>

Target:
public void emit(Event event) { if (event instanceof ServiceMetricEvent) { ServiceMetricEvent metricEvent = (ServiceMetricEvent) event; String name = sanitize(metricEvent.getService() + "_" + metricEvent.getMetric()); Histogram histogram = registry.histogram(name); histogram.update(metricEvent.getValue().longValue()); try { ganglia.announce( name, histogram.getSnapshot().get95thPercentile(), metricEvent.getService() ); } catch (GangliaException e) { log.error(e, "Dropping event [%s]. Unable to send to Ganglia.", event); } } }
Source:
<code>private void acceptConnections() throws IOException { Socket socket = null; boolean error = false; try { socket = serverSocket.accept(); socket.setSoTimeout(self.tickTime * self.initLimit); socket.setTcpNoDelay(nodelay); BufferedInputStream is = new BufferedInputStream(socket.getInputStream()); LearnerHandler fh = new LearnerHandler(socket, is, Leader.this); fh.start(); } catch (SocketException e) { error = true; if (stop.get()) { LOG.info("Exception while shutting down acceptor", e); } else { throw e; } } catch (SaslException e) { LOG.error("Exception while connecting to quorum learner", e); error = true; } catch (Exception e) { error = true; throw e; } finally { if (error && socket != null && !socket.isClosed()) { try { socket.close(); } catch (IOException e) { <START> LOG.warn("Error closing socket", e); <END> } } } }</code><technical_language>a change print socket#toString result</technical_language>

Target:
private void acceptConnections() throws IOException { Socket socket = null; boolean error = false; try { socket = serverSocket.accept(); socket.setSoTimeout(self.tickTime * self.initLimit); socket.setTcpNoDelay(nodelay); BufferedInputStream is = new BufferedInputStream(socket.getInputStream()); LearnerHandler fh = new LearnerHandler(socket, is, Leader.this); fh.start(); } catch (SocketException e) { error = true; if (stop.get()) { LOG.warn("Exception while shutting down acceptor.", e); } else { throw e; } } catch (SaslException e) { LOG.error("Exception while connecting to quorum learner", e); error = true; } catch (Exception e) { error = true; throw e; } finally { if (error && socket != null && !socket.isClosed()) { try { socket.close(); } catch (IOException e) { LOG.warn("Error closing socket: " + socket, e); } } } }
Source:
<code>public void visitToken(DetailAST ast) { final DetailAST startToken; DetailAST brace; switch (ast.getType()) { case TokenTypes.CTOR_DEF: case TokenTypes.METHOD_DEF: startToken = skipAnnotationOnlyLines(ast); brace = ast.findFirstToken(TokenTypes.SLIST); break; case TokenTypes.INTERFACE_DEF: case TokenTypes.CLASS_DEF: case TokenTypes.ANNOTATION_DEF: case TokenTypes.ENUM_DEF: case TokenTypes.ENUM_CONSTANT_DEF: startToken = skipAnnotationOnlyLines(ast); final DetailAST objBlock = ast.findFirstToken(TokenTypes.OBJBLOCK); brace = objBlock; if (objBlock != null) { brace = objBlock.getFirstChild(); } break; case TokenTypes.LITERAL_CASE: case TokenTypes.LITERAL_DEFAULT: startToken = ast; brace = null; if (ast.getNextSibling() != null) { brace = ast.getNextSibling().findFirstToken(TokenTypes.SLIST); <START> } <END> break; case TokenTypes.LITERAL_ELSE: startToken = ast; final DetailAST candidate = ast.getFirstChild(); brace = null; if (candidate.getType() == TokenTypes.SLIST) { brace = candidate; } break; case TokenTypes.LITERAL_SWITCH: startToken = ast; brace = ast.findFirstToken(TokenTypes.LCURLY); break; default: startToken = ast; brace = ast.findFirstToken(TokenTypes.SLIST); break; } if (brace != null) { verifyBrace(brace, startToken); } }</code><technical_language>I do expect removal of supported tokens, please explain this update. present in getAcceptableTokens this is weird. Regression testing required</technical_language>

Target:
public void visitToken(DetailAST ast) { final DetailAST startToken; final DetailAST brace; switch (ast.getType()) { case TokenTypes.CTOR_DEF: case TokenTypes.METHOD_DEF: startToken = skipAnnotationOnlyLines(ast); brace = ast.findFirstToken(TokenTypes.SLIST); break; case TokenTypes.INTERFACE_DEF: case TokenTypes.CLASS_DEF: case TokenTypes.ANNOTATION_DEF: case TokenTypes.ENUM_DEF: case TokenTypes.ENUM_CONSTANT_DEF: startToken = skipAnnotationOnlyLines(ast); brace = findBraceForTypeDefinition(ast); break; case TokenTypes.LITERAL_CASE: case TokenTypes.LITERAL_DEFAULT: startToken = ast; brace = findBraceForCaseGroup(ast); break; case TokenTypes.LITERAL_WHILE: case TokenTypes.LITERAL_CATCH: case TokenTypes.LITERAL_SYNCHRONIZED: case TokenTypes.LITERAL_FOR: case TokenTypes.LITERAL_TRY: case TokenTypes.LITERAL_FINALLY: case TokenTypes.LITERAL_DO: case TokenTypes.LITERAL_IF: case TokenTypes.STATIC_INIT: case TokenTypes.LAMBDA: startToken = ast; brace = ast.findFirstToken(TokenTypes.SLIST); break; case TokenTypes.LITERAL_ELSE: startToken = ast; brace = findBraceForElse(ast); break; default: startToken = ast; brace = ast.findFirstToken(TokenTypes.LCURLY); break; } if (brace != null) { verifyBrace(brace, startToken); } }
Source:
<code>T bufferedIndexedGet(ByteBuffer copyValueBuffer, int startOffset, int endOffset) { final int size = endOffset > startOffset ? endOffset - startOffset <START> : copyValueBuffer.get(startOffset - Ints.BYTES); <END> lastReadSize = size; copyValueBuffer.clear(); copyValueBuffer.position(startOffset); return strategy.fromByteBuffer(copyValueBuffer, size); }</code><technical_language>Integer.BYTES</technical_language>

Target:
T bufferedIndexedGet(ByteBuffer copyValueBuffer, int startOffset, int endOffset) { int size = endOffset - startOffset; if (size == 0 && (NullHandling.replaceWithDefault() || copyValueBuffer.get(startOffset - Integer.BYTES) == NULL_VALUE_SIZE_MARKER)) { return null; } lastReadSize = size; copyValueBuffer.clear(); copyValueBuffer.position(startOffset); return strategy.fromByteBuffer(copyValueBuffer, size); }