auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public <R> R execute(PartitionContext partitionContext, RetryPolicy retry, ServiceCallback<S, R> callback) { Stopwatch sw = new Stopwatch(_ticker).start(); int numAttempts = 0; Exception lastException; do { ServiceEndPoint endPoint = chooseEndPoint(getValidEndPoints(), partitionContext); try { R result = executeOnEndPoint(endPoint, callback); _numExecuteSuccesses.mark(); return result; } catch (Exception e) { _numExecuteAttemptFailures.mark(); if (!isRetriableException(e)) { throw Throwables.propagate(e); } LOG.info("Retriable exception from end point id: {}, Exception: {}", endPoint.getId(), e.getMessage()); <START> LOG.debug("Exception", e); <END> lastException = e; } } while (retry.allowRetry(++numAttempts, sw.elapsedMillis())); throw new MaxRetriesException(lastException); }</code><technical_language>messages logged? be: LOG.info("Retriable exception end point id: {}", endPoint.getId(), e);</technical_language>

Target:
public <R> R execute(PartitionContext partitionContext, RetryPolicy retry, ServiceCallback<S, R> callback) { Stopwatch sw = new Stopwatch(_ticker).start(); int numAttempts = 0; Exception lastException; do { ServiceEndPoint endPoint = chooseEndPoint(getValidEndPoints(), partitionContext); try { R result = executeOnEndPoint(endPoint, callback); _numExecuteSuccesses.mark(); return result; } catch (Exception e) { _numExecuteAttemptFailures.mark(); if (!isRetriableException(e)) { throw Throwables.propagate(e); } LOG.info("Retriable exception from end point id: {}, {}", endPoint.getId(), e.toString()); LOG.debug("Exception", e); lastException = e; } } while (retry.allowRetry(++numAttempts, sw.elapsedMillis())); throw new MaxRetriesException(lastException); }
Source:
<code>public Breakpoints(final Debugger debugger, final WebDebugger webDebugger) { this.truffleBreakpoints = new HashMap<>(); this.receiverBreakpoints = new HashMap<>(); this.promiseResolverBreakpoints = new HashMap<>(); this.promiseResolutionBreakpoints = new HashMap<>(); this.channelOppositeBreakpoint = new HashMap<>(); this.debuggerSession = debugger.startSession(webDebugger); <START> this.stepping = null; <END> }</code><technical_language>I is global stepping field. I meaningful</technical_language>

Target:
public Breakpoints(final Debugger debugger, final WebDebugger webDebugger) { this.truffleBreakpoints = new HashMap<>(); this.receiverBreakpoints = new HashMap<>(); this.promiseResolverBreakpoints = new HashMap<>(); this.promiseResolutionBreakpoints = new HashMap<>(); this.channelOppositeBreakpoints = new HashMap<>(); this.onExecutionBreakpoints = new HashMap<>(); this.beforeCommitBreakpoints = new HashMap<>(); this.debuggerSession = debugger.startSession(webDebugger); }
Source:
<code>public String toString() { <START> return "TestInputTopic{topic='" + topic + "'}"; <END> }</code><technical_language>handy print out other constructor argument fields here? (serializers in particular, if times interesting)</technical_language>

Target:
public String toString() { return new StringJoiner(", ", TestInputTopic.class.getSimpleName() + "[", "]") .add("topic='" + topic + "'") .add("keySerializer=" + keySerializer.getClass().getSimpleName()) .add("valueSerializer=" + valueSerializer.getClass().getSimpleName()) .toString(); }
Source:
<code>public List<String> getParameterNames() { <START> if ( executableParameters == null ) { <END> return null; } return validatorContextProperties.getParameterNameProvider().getParameterNames( executable ); }</code><technical_language>this change? suspicious</technical_language>

Target:
public List<String> getParameterNames() { if ( !ValidationOperation.PARAMETER_VALIDATION.equals( validationOperation ) ) { return null; } return validatorScopedContext.getParameterNameProvider().getParameterNames( executable ); }
Source:
<code>public Paragraph<PS, SEG, S> subSequence(int start) { if(start < 0) { throw new IllegalArgumentException("start must not be negative (was: " + start + ")"); } else if(start == 0) { return this; } else if(start <= length()) { Position pos = navigator.offsetToPosition(start, Forward); int segIdx = pos.getMajor(); List<SEG> segs = new ArrayList<>(segments.size() - segIdx); segmentOps.subSequence(segments.get(segIdx), pos.getMinor()) <START> .ifPresent(seg -> segs.add(seg)); <END> segs.addAll(segments.subList(segIdx + 1, segments.size())); return new Paragraph<>(paragraphStyle, segmentOps, segs); } else { throw new IndexOutOfBoundsException(start + " not in [0, " + length() + "]"); } }</code><technical_language>here, result in zero segments</technical_language>

Target:
public Paragraph<PS, SEG, S> subSequence(int start) { if(start < 0) { throw new IllegalArgumentException("start must not be negative (was: " + start + ")"); } else if(start == 0) { return this; } else if(start <= length()) { Position pos = navigator.offsetToPosition(start, Forward); int segIdx = pos.getMajor(); List<SEG> segs = new ArrayList<>(segments.size() - segIdx); segs.add(segmentOps.subSequence(segments.get(segIdx), pos.getMinor())); segs.addAll(segments.subList(segIdx + 1, segments.size())); if (segs.isEmpty()) { segs.add(segmentOps.createEmpty()); } return new Paragraph<>(paragraphStyle, segmentOps, segs); } else { throw new IndexOutOfBoundsException(start + " not in [0, " + length() + "]"); } }
Source:
<code>private void openGuide(Player p, PlayerRightClickEvent e, SlimefunGuideLayout layout) { <START> GuideOpenEvent event = new GuideOpenEvent(p, e.getItem(), layout) ; <END> Bukkit.getPluginManager().callEvent(event); if (!event.isCancelled()) { e.cancel(); SlimefunGuide.openGuide(p, layout); } }</code><technical_language>Haha, build is failing. suggestion SlimefunGuideOpenEvent event = new SlimefunGuideOpenEvent(p, e.getItem(), layout);</technical_language>

Target:
private void openGuide(Player p, PlayerRightClickEvent e, SlimefunGuideLayout layout) { SlimefunGuideOpenEvent event = new SlimefunGuideOpenEvent(p, e.getItem(), layout); Bukkit.getPluginManager().callEvent(event); if (!event.isCancelled()) { e.cancel(); SlimefunGuide.openGuide(p, event.getGuideLayout()); } }
Source:
<code>protected void addDragAndDropSupport(final NatTable nattable) { final int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT; final DropTarget target = new DropTarget(nattable, operations); final LocalTransfer localTransfer = LocalTransfer.getInstance(); final LocalSelectionTransfer localSelectionTransfer = LocalSelectionTransfer.getTransfer(); final Transfer[] types = new Transfer[] { localSelectionTransfer, localTransfer }; target.setTransfer(types); final NatTableDropListener dropListener = createDropListener(); target.addDropListener(dropListener); <START> natTable.addDragSupport(operations, <END> types, new NatTableDragSourceListener(this, natTable, GridRegion.ROW_HEADER)); }</code><technical_language>1/ This feature is useless in PropertyView, please create a specific method a boolean (probably in case define this behavior tableconfiguration file later) register drag support 2/ remove this behavior table editor in property view</technical_language>

Target:
protected void addDragAndDropSupport(final NatTable nattable) { final int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT; final DropTarget target = new DropTarget(nattable, operations); final LocalTransfer localTransfer = LocalTransfer.getInstance(); final LocalSelectionTransfer localSelectionTransfer = LocalSelectionTransfer.getTransfer(); final Transfer[] types = new Transfer[] { localSelectionTransfer, localTransfer }; target.setTransfer(types); final NatTableDropListener dropListener = createDropListener(); target.addDropListener(dropListener); BooleanValueStyle values = (BooleanValueStyle) table.getTableConfiguration().getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.DRAG_ENABLED); if (null != values && values.isBooleanValue()) { natTable.addDragSupport(operations, types, new NatTableDragSourceListener(this, natTable, Collections.singletonList(GridRegion.ROW_HEADER))); } }
Source:
<code>public int size() { try { <START> RestResponse response = CompletableFutures.await(cacheClient.size().toCompletableFuture()); <END> String sizeContent = response.getBody(); try { return Integer.parseInt(sizeContent); } catch (NumberFormatException e) { throw log.errorGettingCacheSize(e); } } catch (Exception e) { throw log.errorLoadingRemoteEntries(e); } }</code><technical_language>suggestion RestResponse response = CompletionStages.join(cacheClient.size());</technical_language>

Target:
public int size() { try { RestResponse response = CompletionStages.join(cacheClient.size()); String sizeContent = response.getBody(); try { return Integer.parseInt(sizeContent); } catch (NumberFormatException e) { throw log.errorGettingCacheSize(e); } } catch (Exception e) { throw log.errorLoadingRemoteEntries(e); } }
Source:
<code>public ImmutableBoundedValue<Integer> durability() { <START> return new ImmutableSpongeBoundedValue<Integer>(Keys.ITEM_DURABILITY, this.durability, 60, intComparator(), 0, Integer.MAX_VALUE); <END> }</code><technical_language>a final class variable create this object time. Also, SpongeValueBuilder well</technical_language>

Target:
public ImmutableBoundedValue<Integer> durability() { return this.durability; }
Source:
<code>private BAMFileReader(final BlockCompressedInputStream compressedInputStream, final SeekableStream indexStream, final boolean eagerDecode, final boolean useAsynchronousIO, final String source, final ValidationStringency validationStringency, final SAMRecordFactory factory) throws IOException { mIndexStream = indexStream; <START> mIsSeekable = null != indexStream; <END> mCompressedInputStream = compressedInputStream; mStream = new BinaryCodec(new DataInputStream(mCompressedInputStream)); this.eagerDecode = eagerDecode; this.useAsynchronousIO = useAsynchronousIO; this.mValidationStringency = validationStringency; this.samRecordFactory = factory; this.mFileHeader = readHeader(this.mStream, this.mValidationStringency, source); mFirstRecordPointer = mCompressedInputStream.getFilePointer(); }</code><technical_language>concerned this change treatment of mIsSeekable is inconsistent constructors in this class. Eg., constructor takes a BlockCompressedInputStream a File for index sets mIsSeekable true unconditionally, of index file is null. attempt impose consistency constructors leave class in inconsistent state</technical_language>

Target:
private BAMFileReader(final BlockCompressedInputStream compressedInputStream, final SeekableStream indexStream, final boolean eagerDecode, final boolean useAsynchronousIO, final String source, final ValidationStringency validationStringency, final SAMRecordFactory factory) throws IOException { mIndexStream = indexStream; mIsSeekable = true; mCompressedInputStream = compressedInputStream; mStream = new BinaryCodec(new DataInputStream(mCompressedInputStream)); this.eagerDecode = eagerDecode; this.useAsynchronousIO = useAsynchronousIO; this.mValidationStringency = validationStringency; this.samRecordFactory = factory; this.mFileHeader = readHeader(this.mStream, this.mValidationStringency, source); mFirstRecordPointer = mCompressedInputStream.getFilePointer(); }
Source:
<code>@Override public Fragment getItem(int pos) { Fragment fragment = <START> fm.findFragmentByTag(NavTab.of(pos).getTag()); <END> return fragment != null ? fragment : NavTab.of(pos).newInstance(); }</code><technical_language>I super do normal "is Fragment there" dance? I FragmentPagerAdapter source (docs good :/ ) I see: @Override public Object instantiateItem(ViewGroup container, int position) { if (mCurTransaction == null) { mCurTransaction = mFragmentManager.beginTransaction(); } final long itemId = getItemId(position); // Do this fragment? String name = makeFragmentName(container.getId(), itemId); Fragment fragment = mFragmentManager.findFragmentByTag(name); if (fragment != null) { if (DEBUG) Log.v(TAG, "Attaching item #" + itemId + ": f=" + fragment); mCurTransaction.attach(fragment); } else { fragment = getItem(position); if (DEBUG) Log.v(TAG, "Adding item #" + itemId + ": f=" + fragment); mCurTransaction.add(container.getId(), fragment, makeFragmentName(container.getId(), itemId)); } if (fragment != mCurrentPrimaryItem) { fragment.setMenuVisibility(false); fragment.setUserVisibleHint(false); } return fragment; } /** * Return a unique identifier for item position. * * <p>The default implementation returns position. * Subclasses override this method if positions of items change.</p> * * @param position Position this adapter * @return Unique identifier for item position */ public long getItemId(int position) { return position; }</technical_language>

Target:
@Override public Fragment getItem(int pos) { return NavTab.of(pos).newInstance(); }
Source:
<code>protected void triggerShutdown() { stopped = true; twitterStream.cleanUp(); <START> twitterStream.shutdown(); <END> }</code><technical_language>cleanup shutdown calll in shutDown() method, in triggerShutdown</technical_language>

Target:
protected void triggerShutdown() { stopped = true; super.triggerShutdown(); }
Source:
<code>private void init(boolean activateParsingErrorCheck) throws Exception { File moduleBaseDir = new File("src/test/resources"); context = SensorContextTester.create(moduleBaseDir); fs = new DefaultFileSystem(moduleBaseDir); fs.setWorkDir(temporaryFolder.newFolder("temp").toPath()); ActiveRulesBuilder activeRuleBuilder = new ActiveRulesBuilder() .create(NEW_LINE_RULE_KEY) .activate() .create(TAB_CHARACTER_RULE_KEY) .activate(); if (activateParsingErrorCheck) { activeRuleBuilder = activeRuleBuilder .create(PARSING_ERROR_RULE_KEY) <START> .setInternalKey(PARSING_ERROR_CHECK_KEY) <END> .activate(); } CheckFactory checkFactory = new CheckFactory(activeRuleBuilder.build()); FileLinesContextFactory fileLinesContextFactory = mock(FileLinesContextFactory.class); when(fileLinesContextFactory.createFor(any(InputFile.class))).thenReturn(mock(FileLinesContext.class)); sensor = new XmlSensor(fs, checkFactory, fileLinesContextFactory); }</code><technical_language>I need this line</technical_language>

Target:
private void init(boolean activateParsingErrorCheck) throws Exception { File moduleBaseDir = new File("src/test/resources"); context = SensorContextTester.create(moduleBaseDir); fs = new DefaultFileSystem(moduleBaseDir); fs.setWorkDir(temporaryFolder.newFolder("temp").toPath()); ActiveRulesBuilder activeRuleBuilder = new ActiveRulesBuilder() .create(NEW_LINE_RULE_KEY) .activate() .create(TAB_CHARACTER_RULE_KEY) .activate(); if (activateParsingErrorCheck) { activeRuleBuilder = activeRuleBuilder .create(PARSING_ERROR_RULE_KEY) .activate(); } CheckFactory checkFactory = new CheckFactory(activeRuleBuilder.build()); FileLinesContextFactory fileLinesContextFactory = mock(FileLinesContextFactory.class); when(fileLinesContextFactory.createFor(any(InputFile.class))).thenReturn(mock(FileLinesContext.class)); sensor = new XmlSensor(fs, checkFactory, fileLinesContextFactory); }
Source:
<code>public TransactionEdit next(TransactionEdit reuse) throws IOException { if (isClosed()) { return null; } <START> if (transactionEdits.size() != 0) { <END> return transactionEdits.remove(); } populateTransactionEdits(); return transactionEdits.poll(); }</code><technical_language>This check replaced !isEmpty()</technical_language>

Target:
public TransactionEdit next(TransactionEdit reuse) throws IOException { if (closed) { return null; } if (!transactionEdits.isEmpty()) { return transactionEdits.remove(); } populateTransactionEdits(); return transactionEdits.poll(); }
Source:
<code>public void onGenerateMap() { try { if (!previousMapName.getText().isEmpty()) { mapGeneratorService.generateMap(previousMapName.getText()).thenAccept(mapName -> Platform.runLater(() -> { createGameController.initMapSelection(); createGameController.mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny().ifPresent(mapBean -> { createGameController.mapListView.getSelectionModel().select(mapBean); createGameController.mapListView.scrollTo(mapBean); createGameController.setSelectedMap(mapBean); }); })); } else { <END> byte[] optionArray = getOptionArray(); mapGeneratorService.generateMap(optionArray).thenAccept(mapName -> Platform.runLater(() -> { createGameController.initMapSelection(); createGameController.mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny().ifPresent(mapBean -> { createGameController.mapListView.getSelectionModel().select(mapBean); createGameController.mapListView.scrollTo(mapBean); createGameController.setSelectedMap(mapBean); }); })); } <START> } catch (IllegalArgumentException e) { String msg = e.getMessage(); if (msg.startsWith("New Version")) { notificationService.addImmediateErrorNotification(e, "mapGenerator.tooNewVersion"); log.error("Map generation failed", e); } if (msg.startsWith("Old Version")) { notificationService.addImmediateErrorNotification(e, "mapGenerator.tooOldVersion"); log.error("Map generation failed", e); } } catch (Exception e) { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); log.error("Map generation failed", e); } onCloseButtonClickedListener.run(); }</code><technical_language>I doubt is is called. need do this in .excpetionally() Completable Future. <LINK_0></technical_language>

Target:
public void onGenerateMap() { CompletableFuture<String> generateFuture; if (!previousMapName.getText().isEmpty()) { if (!mapGeneratorService.isGeneratedMap(previousMapName.getText())) { notificationService.addImmediateErrorNotification(new IllegalArgumentException(), "mapGenerator.invalidName"); log.warn("Invalid Generated Map Name", new IllegalArgumentException()); return; } generateFuture = mapGeneratorService.generateMap(previousMapName.getText()); } else { byte[] optionArray = getOptionArray(); generateFuture = mapGeneratorService.generateMap(optionArray); } generateFuture.thenAccept(mapName -> Platform.runLater(() -> { createGameController.initMapSelection(); createGameController.mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny().ifPresent(mapBean -> { createGameController.mapListView.getSelectionModel().select(mapBean); createGameController.mapListView.scrollTo(mapBean); createGameController.setSelectedMap(mapBean); }); })) .exceptionally(throwable -> { handleGenerationException(throwable); return null; }); onCloseButtonClickedListener.run(); }
Source:
<code>public Map<String, Object> parse(String input) { try { <START> Pattern compiled = Pattern.compile(pattern); <END> Matcher matcher = compiled.matcher(input); if (!matcher.matches()) { throw new ParseException("Incorrect Regex: %s . No match found.", pattern); } List<String> values = Lists.newArrayList(); for (int i = 0; i < matcher.groupCount(); i++) { values.add(matcher.group(i + 1)); } if (fieldNames == null) { setFieldNames(ParserUtils.generateFieldNames(values.size())); } return Utils.zipMapPartial(fieldNames, Iterables.transform(values, valueFunction)); } catch (Exception e) { throw new ParseException(e, "Unable to parse row [%s]", input); } }</code><technical_language>compile pattern call parse do in constructor cache</technical_language>

Target:
public Map<String, Object> parse(String input) { try { final Matcher matcher = compiled.matcher(input); if (!matcher.matches()) { throw new ParseException("Incorrect Regex: %s . No match found.", pattern); } List<String> values = Lists.newArrayList(); for (int i = 1; i <= matcher.groupCount(); i++) { values.add(matcher.group(i)); } if (fieldNames == null) { setFieldNames(ParserUtils.generateFieldNames(values.size())); } return Utils.zipMapPartial(fieldNames, Iterables.transform(values, valueFunction)); } catch (Exception e) { throw new ParseException(e, "Unable to parse row [%s]", input); } }
Source:
<code><START> default boolean endsWith(Seq<? extends T> that) { <END> if(that instanceof IndexedSeq) { int i = length() - 1; int j = that.length() - 1; if(j > i) return false; else { while(j >= 0) { if(!Objects.equals(this.get(i), that.get(j))) return false; i--; j--; } return true; } } else { return Seq.super.endsWith(that); } }</code><technical_language>null-check</technical_language>

Target:
default boolean endsWith(Seq<? extends T> that) { Objects.requireNonNull(that, "that is null"); if(that instanceof IndexedSeq) { int i = length() - 1; int j = that.length() - 1; if(j > i) return false; else { while(j >= 0) { if(!Objects.equals(this.get(i), that.get(j))){ return false; } i--; j--; } return true; } } else { return Seq.super.endsWith(that); } }
Source:
<code>public OrderType retireOrderType(OrderType orderType, String reason) { orderType.setRetired(true); <START> orderType.setRetireReason(reason); <END> return dao.saveOrderType(orderType); }</code><technical_language>fields set AOP in RetireSaveHandler this needs delegate saveOrderType instead of calling DAO in case is extra logic in save method want pass</technical_language>

Target:
public OrderType retireOrderType(OrderType orderType, String reason) { orderType.setRetired(true); orderType.setRetireReason(reason); return saveOrderType(orderType); }
Source:
<code><START> public void dispose() { <END> mHandler.removeCallbacksAndMessages(null); mHandler = null; super.dispose(); }</code><technical_language>Promote code base class, in SimPhoneBookInterfaceManager</technical_language>

Target:
public void dispose() { super.dispose(); }
Source:
<code>private Set<Object> getInvocationResults(IClass testClass) { Class<?> cls = testClass.getRealClass(); Set<Object> set = null; <START> while (true) { <END> if (cls.equals(Object.class)) { break; } set = m_classInvocationResults.get(cls); if (set != null) { break; } cls = cls.getSuperclass(); } if (set == null) { throw new IllegalStateException("No failure logs for " + testClass.getRealClass()); } return set; }</code><technical_language>while(!cls.equals(Object.class))</technical_language>

Target:
private Set<Object> getInvocationResults(IClass testClass) { Class<?> cls = testClass.getRealClass(); Set<Object> set = null; while (!cls.equals(Object.class)) { set = m_classInvocationResults.get(cls); if (set != null) { break; } cls = cls.getSuperclass(); } if (set == null) { throw new IllegalStateException("No failure logs for " + testClass.getRealClass()); } return set; }
Source:
<code>public IndexSearchResult<T> fetch(Long limit, Long offset) { ElasticsearchWork<ElasticsearchLoadableSearchResult<T>> work = workFactory.search( payload, searchResultExtractor ) .indexes( indexNames ) .paging( limit, offset ) .routingKeys( routingKeys ).build(); ElasticsearchLoadableSearchResult<T> searchResult; try { searchResult = queryOrchestrator.submit( work ).join(); } catch (CompletionException ex) { Throwable cause = ex.getCause(); <START> throw ( cause instanceof SearchException ) ? (SearchException) cause : ex; <END> } return searchResult .loadBlocking( sessionContext ); }</code><technical_language>simply do this: ElasticsearchLoadableSearchResult<T> searchResult = Futures.unwrappedExceptionJoin( queryOrchestrator.submit( work ) ); correctly handle cases. org.hibernate.search.util.common.impl.Futures#unwrappedExceptionJoin</technical_language>

Target:
public IndexSearchResult<T> fetch(Long limit, Long offset) { ElasticsearchWork<ElasticsearchLoadableSearchResult<T>> work = workFactory.search( payload, searchResultExtractor ) .indexes( indexNames ) .paging( limit, offset ) .routingKeys( routingKeys ).build(); return Futures.unwrappedExceptionJoin( queryOrchestrator.submit( work ) ) .loadBlocking( sessionContext ); }
Source:
<code>public void testExpiredData() throws InterruptedException { dc.put("k", "v", new EmbeddedMetadata.Builder().maxIdle(100, TimeUnit.MINUTES).build()); Thread.sleep(100); InternalCacheEntry entry = dc.get("k"); assertNotNull(entry); assertEquals(transienttype(), entry.getClass()); assertTrue(entry.getLastUsed() <= timeService.wallClockTime()); long entryLastUsed = entry.getLastUsed(); timeService.advance(100); entry = dc.get("k"); assertTrue(entry.getLastUsed() > entryLastUsed); <START> dc.put("k", "v", new EmbeddedMetadata.Builder().maxIdle(0, TimeUnit.MINUTES).build()); <END> dc.put("k", "v", new EmbeddedMetadata.Builder().lifespan(100, TimeUnit.MINUTES).build()); timeService.advance(100); assertEquals(1, dc.size()); entry = dc.get("k"); assertNotNull(entry); assertEquals(mortaltype(), entry.getClass()); assertTrue(entry.getCreated() <= timeService.wallClockTime()); dc.put("k", "v", new EmbeddedMetadata.Builder().lifespan(0, TimeUnit.MINUTES).build()); timeService.advance(10); assertNull(dc.get("k")); assertEquals(0, dc.size()); dc.put("k", "v", new EmbeddedMetadata.Builder().lifespan(0, TimeUnit.MINUTES).build()); timeService.advance(100); assertEquals(0, dc.size()); }</code><technical_language>this put reason</technical_language>

Target:
public void testExpiredData() throws InterruptedException { dc.put("k", "v", new EmbeddedMetadata.Builder().maxIdle(100, TimeUnit.MINUTES).build()); timeService.advance(100); InternalCacheEntry entry = dc.get("k"); assertNotNull(entry); assertEquals(transienttype(), entry.getClass()); assertEquals(timeService.wallClockTime(), entry.getLastUsed()); long entryLastUsed = entry.getLastUsed(); timeService.advance(100); entry = dc.get("k"); assertEquals(entryLastUsed + 100, entry.getLastUsed()); dc.put("k", "v", new EmbeddedMetadata.Builder().maxIdle(1, TimeUnit.MILLISECONDS).build()); long oldTime = timeService.wallClockTime(); dc.put("k", "v", new EmbeddedMetadata.Builder().lifespan(100, TimeUnit.MINUTES).build()); timeService.advance(100); assertEquals(1, dc.size()); entry = dc.get("k"); assertNotNull(entry); assertEquals(mortaltype(), entry.getClass()); assertEquals(oldTime, entry.getCreated()); assertEquals(-1, entry.getMaxIdle()); dc.put("k", "v", new EmbeddedMetadata.Builder().lifespan(1, TimeUnit.MILLISECONDS).build()); timeService.advance(10); assertNull(dc.get("k")); assertEquals(0, dc.size()); dc.put("k", "v", new EmbeddedMetadata.Builder().lifespan(1, TimeUnit.MILLISECONDS).build()); timeService.advance(100); assertEquals(0, dc.size()); }
Source:
<code>private static boolean isSentinelCigar(final Cigar cigar, final int readLength) { return cigar.getCigarElement(0).getOperator() == CigarOperator.S && (cigar.getCigarElement(0).getLength() == readLength || readLength == 0) && <START> cigar.getCigarElement(1).getOperator() == CigarOperator.N; <END> }</code><technical_language>If concerned cost of this sentinel check, sense re-order it. I reads element S, element N. sense reorder check for element N get hit</technical_language>

Target:
static boolean isSentinelCigar(final Cigar cigar, final int readLength) { return cigar.numCigarElements() == 2 && cigar.getCigarElement(1).getOperator() == CigarOperator.N && cigar.getCigarElement(0).getOperator() == CigarOperator.S && (cigar.getCigarElement(0).getLength() == readLength || readLength == 0) ; }
Source:
<code>public boolean checkMeasurementPointSize(int radius){ <START> if(radius <= maxMeasurementPointRadius && radius >= minMeasurementPointRadius){ <END> return true; }else{ return false; } }</code><technical_language>return (radius <= maxMeasurementPointRadius && radius >= minMeasurementPointRadius);</technical_language>

Target:
public boolean checkMeasurementPointSize(int radius){ return radius <= maxMeasurementPointRadius && radius >= minMeasurementPointRadius; }
Source:
<code>private void addFieldValueToRow(List<String> row, Release._Fields field, Release release) throws SW360Exception { switch (field) { case COMPONENT_ID: row.add(fieldValueAsString( <START> release.getFieldValue(org.eclipse.sw360.datahandler.thrift.components.Release._Fields.ID))); <END> if (extendedByAdditionalData) { try { Component component = cClient.getComponentById(release.componentId, this.user); row.add(fieldValueAsString(component.getFieldValue( org.eclipse.sw360.datahandler.thrift.components.Component._Fields.COMPONENT_TYPE))); } catch (TException e) { throw new SW360Exception("Could not get Component for id [" + release.componentId + "] and user [" + this.user + "] because of:\n" + e.getMessage()); } String projectNames = releaseToShortenedStringsMap.get(release).projectNames; row.add(projectNames); } break; case VENDOR: addVendorToRow(release.getVendor(), row); break; case COTS_DETAILS: addCotsDetailsToRow(release.getCotsDetails(), row); break; case CLEARING_INFORMATION: addClearingInformationToRow(release.getClearingInformation(), row); break; case ECC_INFORMATION: addEccInformationToRow(release.getEccInformation(), row); break; case RELEASE_ID_TO_RELATIONSHIP: addReleaseIdToRelationShipToRow(release.getReleaseIdToRelationship(), row); break; case ATTACHMENTS: String size = "0"; if (release.isSetAttachments()) { size = release.attachments.size() + ""; } row.add(size); break; default: Object fieldValue = release.getFieldValue(field); row.add(fieldValueAsString(fieldValue)); } }</code><technical_language>case COMPONENT_ID, adding Release._Fields.ID value. Why</technical_language>

Target:
private void addFieldValueToRow(List<String> row, Release._Fields field, Release release) throws SW360Exception { switch (field) { case COMPONENT_ID: row.add(release.getComponentId()); if (addAdditionalData()) { Component component = this.preloadedComponents.get(release.componentId); if (component != null) { row.add(ThriftEnumUtils.enumToString(component.getComponentType())); } else { row.add(""); } if (releaseToShortenedStringsMap.containsKey(release)) { row.add(releaseToShortenedStringsMap.get(release).projectNames); } else { row.add(""); } } break; case VENDOR: addVendorToRow(release.getVendor(), row); break; case COTS_DETAILS: addCotsDetailsToRow(release.getCotsDetails(), row); break; case CLEARING_INFORMATION: addClearingInformationToRow(release.getClearingInformation(), row); break; case ECC_INFORMATION: addEccInformationToRow(release.getEccInformation(), row); break; case RELEASE_ID_TO_RELATIONSHIP: addReleaseIdToRelationShipToRow(release.getReleaseIdToRelationship(), row); break; case ATTACHMENTS: String size = Integer.toString(release.isSetAttachments() ? release.getAttachments().size() : 0); row.add(size); break; default: Object fieldValue = release.getFieldValue(field); row.add(fieldValueAsString(fieldValue)); } }
Source:
<code>private void internalFinishSpan(Span span, long duration) { synchronized (span) { span.setDuration(duration); <START> reporter().report(span.toZipkin()); <END> } spanAndEndpoint().state().setCurrentLocalSpan(null); }</code><technical_language>Is worth moving reporting out of synchronized block (though I expect convention span)</technical_language>

Target:
private void internalFinishSpan(Span span, long duration) { synchronized (span) { span.setDuration(duration); } reporter().report(span.toZipkin()); spanAndEndpoint().state().setCurrentLocalSpan(null); }
Source:
<code>public GrpcBlockingStream(Function<StreamObserver<ResT>, StreamObserver<ReqT>> rpcFunc, int bufferSize, String description) { LOG.debug("Opening stream ({})", description); <START> mResponses = new LinkedBlockingQueue<>(); <END> mResponseObserver = new ResponseStreamObserver(); mRequestObserver = (ClientCallStreamObserver) rpcFunc.apply(mResponseObserver); mDescription = description; }</code><technical_language>Is default buffer size (16) large enough? 2MB message size 32MB buffer reader, this grow quickly if multi-thread reading is used</technical_language>

Target:
public GrpcBlockingStream(Function<StreamObserver<ResT>, StreamObserver<ReqT>> rpcFunc, int bufferSize, String description) { LOG.debug("Opening stream ({})", description); mResponses = new ArrayBlockingQueue<>(bufferSize); mResponseObserver = new ResponseStreamObserver(); mRequestObserver = (ClientCallStreamObserver) rpcFunc.apply(mResponseObserver); mDescription = description; }
Source:
<code>public void waitsForServiceToExist_whenGettingAllBatchStatuses() throws InterruptedException { final ArgumentCaptor<Runnable> argumentCaptor = ArgumentCaptor.forClass(Runnable.class); willAnswer(new Answer<Void>() { @Override public Void answer(InvocationOnMock invocation) throws Throwable { argumentCaptor.getValue().run(); return null; } <START> }).given(executorService).submit(argumentCaptor.capture()); <END> notifyLockOnAnotherThread(); downloadManager.getAllDownloadBatchStatuses(allBatchStatusesCallback); }</code><technical_language>do need a captor? parameter is passed answer</technical_language>

Target:
public void waitsForServiceToExist_whenGettingAllBatchStatuses() throws InterruptedException { willAnswer(new Answer<Void>() { @Override public Void answer(InvocationOnMock invocation) throws Throwable { ((Runnable) invocation.getArgument(0)).run(); return null; } }).given(executorService).submit(any(Runnable.class)); notifyLockOnAnotherThread(); downloadManager.getAllDownloadBatchStatuses(allBatchStatusesCallback); }
Source:
<code>public Stream<Room> getAll() throws Exception { try { var connection = getConnection(); var statement = connection.prepareStatement("SELECT * FROM ROOMS"); var resultSet = statement.executeQuery(); return StreamSupport.stream(new Spliterators.AbstractSpliterator<Room>(Long.MAX_VALUE, Spliterator.ORDERED) { @Override public boolean tryAdvance(Consumer<? super Room> action) { try { if (!resultSet.next()) { return false; } action.accept(createRoom(resultSet)); return true; } catch (Exception e) { throw new RuntimeException(e); } } }, false).onClose(() -> { try { mutedClose(connection, statement, resultSet); } catch (Exception e) { <START> e.printStackTrace(); <END> } }); } catch (Exception e) { throw new SqlException(e.getMessage(), e); } }</code><technical_language>logger</technical_language>

Target:
public Stream<Room> getAll() throws Exception { try { var connection = getConnection(); var statement = connection.prepareStatement("SELECT * FROM ROOMS"); var resultSet = statement.executeQuery(); return StreamSupport.stream(new Spliterators.AbstractSpliterator<Room>(Long.MAX_VALUE, Spliterator.ORDERED) { @Override public boolean tryAdvance(Consumer<? super Room> action) { try { if (!resultSet.next()) { return false; } action.accept(createRoom(resultSet)); return true; } catch (Exception e) { throw new RuntimeException(e); } } }, false).onClose(() -> { try { mutedClose(connection, statement, resultSet); } catch (Exception e) { LOGGER.error(e.getMessage()); } }); } catch (Exception e) { throw new Exception(e.getMessage(), e); } }
Source:
<code>public TaskOnList(RowSnapshot<TaskContract.TaskLists> taskListRow, Predicate predicate) { super(new AllOf(predicate, <START> new EqArg(TaskContract.Tasks.LIST_ID, taskListRow.values().charData(BaseColumns._ID).value("-1")))); <END> }</code><technical_language>wait for <LINK_2> implement this. current approach is reliable enough</technical_language>

Target:
public TaskOnList(RowSnapshot<TaskContract.TaskLists> taskListRow, Predicate predicate) { super(new AllOf(predicate, new ReferringTo<>(TaskContract.Tasks.LIST_ID, taskListRow))); }
Source:
<code>private void updateConnectionsTypeMap() { connectionsTypeMap = new HashMap<>(); for (StorageServerConnections conn : _connections) { StorageType connType = conn.getstorage_type(); <START> if (!connectionsTypeMap.containsKey(conn.getstorage_type())) { <END> connectionsTypeMap.put(connType, new ArrayList<StorageServerConnections>()); } connectionsTypeMap.get(connType).add(conn); } }</code><technical_language>s/conn.getstorage_type()/connType/</technical_language>

Target:
private void updateConnectionsTypeMap() { connectionsTypeMap = new HashMap<>(); for (StorageServerConnections conn : _connections) { StorageType connType = conn.getstorage_type(); MultiValueMapUtils.addToMap(connType, conn, connectionsTypeMap); } }
Source:
<code>public static byte[] getSha1(InputStream shaFis) { MessageDigest sha1; try { sha1 = MessageDigest.getInstance("SHA-1"); int bufSiz = 1024; byte buf[] = new byte[bufSiz]; int bytesRead; while ((bytesRead = shaFis.read(buf)) != -1) { sha1.update(buf, 0, bytesRead); } } catch (Exception e) { <START> return null; <END> } return sha1.digest(); }</code><technical_language>log generation fails. input stream is a bit dubious? be: - position zero start reading - another thread reading concurrently - caller realise reading Is a a new stream this method is using</technical_language>

Target:
public static byte[] getSha1(InputStream shaFis) { MessageDigest sha1; try { sha1 = MessageDigest.getInstance("SHA-1"); int bufSiz = 1024; byte buf[] = new byte[bufSiz]; int bytesRead; while ((bytesRead = shaFis.read(buf)) != -1) { sha1.update(buf, 0, bytesRead); } } catch (Exception e) { Log.w("getSha1", "Problem calculating SHA1 for stream: "+e); return null; } return sha1.digest(); }
Source:
<code>public void prints_values() throws Exception { assertEquals("null", print(null)); assertEquals("\"str\"", print("str")); assertEquals("\"x\ny\"", print("x\ny")); assertEquals("3", print(3)); assertEquals("3L", print(3L)); assertEquals("[1, 2]", print(new int[]{1, 2})); assertEquals("{\"hoge\"=2L}", print(new HashMap<String, Object>() { { put("hoge", 2L); } <START> })); <END> assertTrue(print(new UnsafeToString()).contains("UnsafeToString")); assertEquals("ToString", print(new ToString())); assertEquals("formatted", print(new FormattedText("formatted"))); }</code><technical_language>add assert for multiple values in a hashmap</technical_language>

Target:
public void prints_values() throws Exception { assertEquals("null", print(null)); assertEquals("\"str\"", print("str")); assertEquals("\"x\ny\"", print("x\ny")); assertEquals("3", print(3)); assertEquals("3L", print(3L)); assertEquals("3.14d", print(3.14d)); assertEquals("3.14f", print(3.14f)); assertEquals("[1, 2]", print(new int[]{1, 2})); assertEquals("{\"foo\" = 2L}", print(new LinkedHashMap<String, Object>() { { put("foo", 2L); } })); assertEquals("{\"byte\" = 0x01, \"short\" = 2, \"int\" = 3, \"long\" = 4L, \"float\" = 2.71f, \"double\" = 3.14d}", print(new LinkedHashMap<String, Object>() { { put("byte", (byte)1); put("short", (short)2); put("int", 3); put("long", 4L); put("float", 2.71f); put("double", 3.14d); } })); assertTrue(print(new UnsafeToString()).contains("UnsafeToString")); assertEquals("ToString", print(new ToString())); assertEquals("formatted", print(new FormattedText("formatted"))); }
Source:
<code>protected ToStringHelper string() { ToStringHelper toString = Objects.toStringHelper("").omitNullValues(); toString.add("keyName", keyName); if (securityGroupNames.size() > 0) toString.add("securityGroupNames", securityGroupNames); if (metadata.size() > 0) toString.add("metadata", metadata); if (personality.size() > 0) toString.add("personality", personality); if (adminPass != null) toString.add("adminPassPresent", true); toString.add("userData", userData == null ? null : new String(userData)); <START> if (networks.size() > 0) <END> toString.add("networks", networks); return toString; }</code><technical_language>!networks.isEmpty()</technical_language>

Target:
protected ToStringHelper string() { ToStringHelper toString = Objects.toStringHelper("").omitNullValues(); toString.add("keyName", keyName); if (securityGroupNames.size() > 0) toString.add("securityGroupNames", securityGroupNames); if (metadata.size() > 0) toString.add("metadata", metadata); if (personality.size() > 0) toString.add("personality", personality); if (adminPass != null) toString.add("adminPassPresent", true); if (diskConfig != null) toString.add("diskConfig", diskConfig); toString.add("userData", userData == null ? null : new String(userData)); if (!networks.isEmpty()) toString.add("networks", networks); return toString; }
Source:
<code>public WebSocketMessageV13(WebSocketProxy proxy, InputStream in, byte frameHeader) throws IOException { super(proxy, getIncrementedMessageCount()); opcode = (frameHeader & 0x0F); Calendar calendar = Calendar.getInstance(); timestamp = new Timestamp(calendar.getTimeInMillis()); readFrame(in, frameHeader); direction = receivedFrames.get(0).isMasked() ? Direction.OUTGOING : Direction.INCOMING; <START> hasChanged = true; <END> }</code><technical_language>change WebSocketMessageDTO instead allow if message sent, set if changed not. wdyt</technical_language>

Target:
public WebSocketMessageV13(WebSocketProxy proxy, InputStream in, byte frameHeader) throws IOException { super(proxy, getIncrementedMessageCount()); opcode = (frameHeader & 0x0F); Calendar calendar = Calendar.getInstance(); timestamp = new Timestamp(calendar.getTimeInMillis()); readFrame(in, frameHeader); direction = receivedFrames.get(0).isMasked() ? Direction.OUTGOING : Direction.INCOMING; }
Source:
<code>public void required_spec109_subscribeThrowNPEOnNullSubscriber() throws Throwable { <START> optionalActivePublisherTest(1, true, new PublisherTestRun<T>() { <END> @Override public void run(Publisher<T> pub) throws Throwable { try { pub.subscribe(null); env.flop(String.format("Publisher (%s) did not throw a NullPointerException when given a null Subscribe in subscribe", pub)); } catch (NullPointerException npe) { } env.verifyNoAsyncErrors(); } }); }</code><technical_language>activePublisherTest instead (otherwise skipped if fails)</technical_language>

Target:
public void required_spec109_subscribeThrowNPEOnNullSubscriber() throws Throwable { activePublisherTest(0, false, new PublisherTestRun<T>() { @Override public void run(Publisher<T> pub) throws Throwable { try { pub.subscribe(null); env.flop(String.format("Publisher (%s) did not throw a NullPointerException when given a null Subscribe in subscribe", pub)); } catch (NullPointerException npe) { } env.verifyNoAsyncErrors(); } }); }
Source:
<code>public void testIf() { IfLogicBeginBrick ifBrick = new IfLogicBeginBrick(); ifBrick.addBrickToIfBranch(brick); script.addBrick(ifBrick); Sprite cloneSprite = new SpriteController().copyForCloneBrick(sprite); Brick cloneIfLogicBrick = cloneSprite.getScript(0).getBrick(0); <START> checkInNestedBrick((CompositeBrick) cloneIfLogicBrick); <END> }</code><technical_language>function name more expressive. clear, check. checkCloneForNestedBrick better</technical_language>

Target:
public void testIf() { IfLogicBeginBrick ifBrick = new IfLogicBeginBrick(); ifBrick.addBrickToIfBranch(brick); script.addBrick(ifBrick); Sprite cloneSprite = new SpriteController().copyForCloneBrick(sprite); Brick cloneIfLogicBrick = cloneSprite.getScript(0).getBrick(0); checkClonedBrickInNestedBrick((CompositeBrick) cloneIfLogicBrick); }
Source:
<code>public void onResume() { super.onResume(); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeAsUpIndicator(R.drawable.ic_clear_24dp); actionBar.setTitle((getEditableItem() == null) ? getFlexString(R.string.DIALOG_TRIPMENU_TITLE_NEW) : getFlexString(R.string.DIALOG_TRIPMENU_TITLE_EDIT)); actionBar.setSubtitle(""); } if (focusedView != null) { focusedView.requestFocus(); } compositeDisposable = new CompositeDisposable(); <START> compositeDisposable.add(getHideAutoCompleteVisibilityClick() <END> .flatMap(tripTripPair -> presenter.updateTrip(tripTripPair.getFirst(), tripTripPair.getSecond())) .subscribe(tripOptional -> hideAutoCompleteValue(tripOptional.isPresent()) )); compositeDisposable.add(getUnHideAutoCompleteVisibilityClick() .flatMap(tripTripPair -> presenter.updateTrip(tripTripPair.getFirst(), tripTripPair.getSecond())) .subscribe(tripOptional -> unHideAutoCompleteValue(tripOptional.isPresent()) )); }</code><technical_language>This good! move a Presenter class AutoCompeltePresenter TripAutoCompeltePresenter, isolate logic in class (instead of spreading fragment)</technical_language>

Target:
public void onResume() { super.onResume(); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeAsUpIndicator(R.drawable.ic_clear_24dp); actionBar.setTitle((getEditableItem() == null) ? getFlexString(R.string.DIALOG_TRIPMENU_TITLE_NEW) : getFlexString(R.string.DIALOG_TRIPMENU_TITLE_EDIT)); actionBar.setSubtitle(""); } if (focusedView != null) { focusedView.requestFocus(); } }
Source:
<code>public void deleteByUnknownId() throws Exception { <START> Venue venue = new Venue(new VenueGroup("group"), new VenueType("type"), Lists.newArrayList(new VenueName("Info", new Language("en")))); <END> repository.create(new NewAccessPoint("ip", new MacAddress("aa:bb"), "sn", "model", venue)); repository.delete("id"); List<AccessPoint> found = repository.findAll(); assertThat(found.size(), is(1)); }</code><technical_language>Please create builder for Venue object... tests ugly</technical_language>

Target:
public void deleteByUnknownId() throws Exception { Venue venue = newVenueBuilder().build(); repository.create(new NewAccessPoint("ip", new MacAddress("aa:bb"), "sn", "model", venue)); repository.delete("id"); List<AccessPoint> found = repository.findAll(); assertThat(found.size(), is(1)); }
Source:
<code>public FileChannel getFileChannel() <START> { END> return (FileChannel) fFileChannel; }</code><technical_language>remove</technical_language>

Target:
public FileChannel getFileChannel() throws IOException, BadPcapFileException { FileChannel f = (FileChannel) fFileChannel; if (f.size() == 0) { throw new BadPcapFileException("It is not a FileChannel type."); } return f; }
Source:
<code>private void downloadInParallel(int partCount) throws Exception { if (lastFullyMergedPartNumber == null) { lastFullyMergedPartNumber = 0; } <START> ServiceUtils.createParentDirectoryIfNecessary(dstfile); <END> for (int i = lastFullyMergedPartNumber + 1; i <= partCount; i++) { GetObjectRequest getPartRequest = new GetObjectRequest(req.getBucketName(), req.getKey(), req.getVersionId()).withUnmodifiedSinceConstraint(req.getUnmodifiedSinceConstraint()) .withModifiedSinceConstraint(req.getModifiedSinceConstraint()) .withResponseHeaders(req.getResponseHeaders()).withSSECustomerKey(req.getSSECustomerKey()) .withGeneralProgressListener(req.getGeneralProgressListener()); getPartRequest.setMatchingETagConstraints(req.getMatchingETagConstraints()); getPartRequest.setNonmatchingETagConstraints(req.getNonmatchingETagConstraints()); getPartRequest.setRequesterPays(req.isRequesterPays()); futureFiles.add( executor.submit(new DownloadPartCallable(s3, getPartRequest.withPartNumber(i), dstfile))); } combineFiles(); }</code><technical_language>move line 128? want run inconsistencies ;-)</technical_language>

Target:
private void downloadInParallel(int partCount) throws Exception { if (lastFullyMergedPartNumber == null) { lastFullyMergedPartNumber = 0; } for (int i = lastFullyMergedPartNumber + 1; i <= partCount; i++) { GetObjectRequest getPartRequest = new GetObjectRequest(req.getBucketName(), req.getKey(), req.getVersionId()).withUnmodifiedSinceConstraint(req.getUnmodifiedSinceConstraint()) .withModifiedSinceConstraint(req.getModifiedSinceConstraint()) .withResponseHeaders(req.getResponseHeaders()).withSSECustomerKey(req.getSSECustomerKey()) .withGeneralProgressListener(req.getGeneralProgressListener()); getPartRequest.setMatchingETagConstraints(req.getMatchingETagConstraints()); getPartRequest.setNonmatchingETagConstraints(req.getNonmatchingETagConstraints()); getPartRequest.setRequesterPays(req.isRequesterPays()); futureFiles.add( executor.submit(new DownloadPartCallable(s3, getPartRequest.withPartNumber(i), dstfile))); } combineFiles(); }
Source:
<code>PageData split(int splitPoint) { int newPageId = index.getPageStore().allocatePage(); PageDataLeaf p2 = PageDataLeaf.create(index, newPageId, parentPageId); <START> for (; splitPoint < entryCount; ) { <END> int split = p2.addRowTry(getRowAt(splitPoint)); if (split != -1) { DbException.throwInternalError("split " + split); } removeRow(splitPoint); } return p2; }</code><technical_language>while</technical_language>

Target:
PageData split(int splitPoint) { int newPageId = index.getPageStore().allocatePage(); PageDataLeaf p2 = PageDataLeaf.create(index, newPageId, parentPageId); while (splitPoint < entryCount) { int split = p2.addRowTry(getRowAt(splitPoint)); if (split != -1) { DbException.throwInternalError("split " + split); } removeRow(splitPoint); } return p2; }