auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private SymbolStatsEstimate normalizeSymbolStats(Symbol symbol, SymbolStatsEstimate symbolStats, PlanNodeStatsEstimate stats, TypeProvider types) { if (symbolStats.isUnknown()) { return SymbolStatsEstimate.unknown(); } double outputRowCount = stats.getOutputRowCount(); double distinctValuesCount = symbolStats.getDistinctValuesCount(); double nullsFraction = symbolStats.getNullsFraction(); double averageRowSize = symbolStats.getAverageRowSize(); double lowValue = symbolStats.getLowValue(); double highValue = symbolStats.getHighValue(); if (!isNaN(distinctValuesCount)) { Type type = requireNonNull(types.get(symbol), () -> "No stats for symbol " + symbol); double maxDistinctValuesByLowHigh = maxDistinctValuesByLowHigh(symbolStats, type); if (distinctValuesCount > maxDistinctValuesByLowHigh) { distinctValuesCount = maxDistinctValuesByLowHigh; } if (distinctValuesCount > outputRowCount) { distinctValuesCount = outputRowCount; } double nonNullValues = outputRowCount * (1 - nullsFraction); if (distinctValuesCount > nonNullValues) { double difference = distinctValuesCount - nonNullValues; distinctValuesCount -= difference / 2; nonNullValues += difference / 2; nullsFraction = 1 - nonNullValues / outputRowCount; } } if (distinctValuesCount == 0.0) { <START> nullsFraction = 1.0; <END> averageRowSize = 0.0; lowValue = NaN; highValue = NaN; } return new SymbolStatsEstimate(lowValue, highValue, nullsFraction, averageRowSize, distinctValuesCount); }</code><technical_language>NaN if outputRowCount is 0</technical_language>

Target:
private SymbolStatsEstimate normalizeSymbolStats(Symbol symbol, SymbolStatsEstimate symbolStats, PlanNodeStatsEstimate stats, TypeProvider types) { if (symbolStats.isUnknown()) { return SymbolStatsEstimate.unknown(); } double outputRowCount = stats.getOutputRowCount(); double distinctValuesCount = symbolStats.getDistinctValuesCount(); double nullsFraction = symbolStats.getNullsFraction(); if (!isNaN(distinctValuesCount)) { Type type = requireNonNull(types.get(symbol), () -> "No stats for symbol " + symbol); double maxDistinctValuesByLowHigh = maxDistinctValuesByLowHigh(symbolStats, type); if (distinctValuesCount > maxDistinctValuesByLowHigh) { distinctValuesCount = maxDistinctValuesByLowHigh; } if (distinctValuesCount > outputRowCount) { distinctValuesCount = outputRowCount; } double nonNullValues = outputRowCount * (1 - nullsFraction); if (distinctValuesCount > nonNullValues) { double difference = distinctValuesCount - nonNullValues; distinctValuesCount -= difference / 2; nonNullValues += difference / 2; nullsFraction = 1 - nonNullValues / outputRowCount; } } if (distinctValuesCount == 0.0) { return SymbolStatsEstimate.zero(); } return SymbolStatsEstimate.buildFrom(symbolStats) .setDistinctValuesCount(distinctValuesCount) .setNullsFraction(nullsFraction) .build(); }
Source:
<code>public boolean handles(final Table table, final Object axisElement) { <START> final String id = AxisUtils.getPropertyId(axisElement); return (null != id && id.equals(SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID)); <END> }</code><technical_language>return SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID.equals(AxisUtils.getPropertyId(axisElement)) work</technical_language>

Target:
public boolean handles(final Table table, final Object axisElement) { return (SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID.equals(AxisUtils.getPropertyId(axisElement))); }
Source:
<code>protected void handleUpstream1(ChannelHandlerContext ctx, ChannelEvent evt) throws Exception { ChannelEventKind eventAsKind = asEventKind(evt); ChannelFuture handlerFuture = getHandlerFuture(); assert handlerFuture != null; if (handlerFuture.isDone() || !interestEvents.contains(eventAsKind)) { ctx.sendUpstream(evt); } else if (!expectedEvents.contains(eventAsKind)) { handleUnexpectedEvent(ctx, evt); } else { ChannelFuture pipelineFuture = getPipelineFuture(); <START> if (!pipelineFuture.isSuccess()) { <END> Exception exception = new ScriptProgressException(getRegionInfo(), format("%s", this)); handlerFuture.setFailure(exception.fillInStackTrace()); } else { super.handleUpstream1(ctx, evt); } } }</code><technical_language>Is this correct ? pipelineFuture is completed this point. pipelineFuture.isSuccess() is false a failure, right</technical_language>

Target:
protected void handleUpstream1(ChannelHandlerContext ctx, ChannelEvent evt) throws Exception { ChannelEventKind eventAsKind = asEventKind(evt); ChannelFuture handlerFuture = getHandlerFuture(); assert handlerFuture != null; if (handlerFuture.isDone() || !interestEvents.contains(eventAsKind)) { ctx.sendUpstream(evt); } else if (!expectedEvents.contains(eventAsKind)) { handleUnexpectedEvent(ctx, evt); } else { ChannelFuture pipelineFuture = getPipelineFuture(); if (!pipelineFuture.isSuccess()) { assert pipelineFuture.isDone(); Exception exception = new ScriptProgressException(getRegionInfo(), format("%s", this)); handlerFuture.setFailure(exception.fillInStackTrace()); } else { super.handleUpstream1(ctx, evt); } } }
Source:
<code>static void runScript(String filename, Connection cx) throws SQLException { try { SqlUtil.runScript(new GeoPackage().getClass().getResourceAsStream(filename), cx); } catch (IOException e) { <START> <END> } }</code><technical_language>Eeek, eatin exceptions</technical_language>

Target:
static void runScript(String filename, Connection cx) throws SQLException { try { SqlUtil.runScript(new GeoPackage().getClass().getResourceAsStream(filename), cx); } catch (IOException e) { throw new SQLException(e); } }
Source:
<code><START> public boolean equals(Object obj) { <END> if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } StorageWrapper other = (StorageWrapper)obj; if (fullPath == null) { if (other.fullPath != null) { return false; } } else if (!fullPath.equals(other.fullPath)) { return false; } if (storage == null) { if (other.storage != null) { return false; } } else if (!storage.equals(other.storage)) { return false; } return true; }</code><technical_language>1 - "if (something) return true;" is "return something;", "not". This more readable of some "else" simplification. if (this == obj) { return true; } if (obj instanceof StorageWrapper) { StorageWrapper other = (StorageWrapper)obj; return Objects.equals(fullPath, other.fullPath) && Objects.equals(storage, other.storage); } return false;</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StorageWrapper) { StorageWrapper other = (StorageWrapper)obj; return Objects.equal(fullPath, other.fullPath) && Objects.equal(storage, other.storage); } return false; }
Source:
<code>public void modifyJobPriority() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "test_modify_job_priority"; try { client.putBucket(new PutBucketRequest(bucketName)); final List<Ds3Object> objects = new ArrayList<>(); <START> final Ds3Object obj = new Ds3Object("test", 2); <END> objects.add(obj); final WriteJobOptions jobOptions = WriteJobOptions.create().withPriority(Priority.LOW); final Ds3ClientHelpers.Job job = wrap(client).startWriteJob(bucketName, objects, jobOptions); client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId()) .withPriority(Priority.HIGH)); final GetJobSpectraS3Response response = client .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId())); assertThat(response.getMasterObjectListResult().getPriority(), is(Priority.HIGH)); } finally { deleteAllContents(client, bucketName); } }</code><technical_language>This shortened final List<Ds3Object> objects = Lists.newArrayList(new Ds3Object("test", 2));</technical_language>

Target:
public void modifyJobPriority() throws IOException, SignatureException, XmlProcessingException { try { final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList( new Ds3Object("test", 2)), WriteJobOptions.create().withPriority(Priority.LOW)); client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId()) .withPriority(Priority.HIGH)); final GetJobSpectraS3Response response = client .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId())); assertThat(response.getMasterObjectListResult().getPriority(), is(Priority.HIGH)); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
<code>public DynamicJaxbContextManager() { if( ! instanceCreated.compareAndSet(0, 1) ) { <START> logger.debug("Instance of the created!", instanceCreated.incrementAndGet(), DynamicJaxbContext.class.getSimpleName() ); <END> } }</code><technical_language>this prevent of creating another class for debugging</technical_language>

Target:
public DynamicJaxbContextManager() { if( ! instanceCreated.compareAndSet(0, 1) ) { logger.error("Instance of the created!", instanceCreated.incrementAndGet(), DynamicJaxbContext.class.getSimpleName() ); } }
Source:
<code>public static void terminatePantsProcess(Project project) { Process process = runningPantsProcesses.get(project); if (process != null) { process.destroy(); } <START> runningPantsProcesses.remove(project); <END> }</code><technical_language>safer [remove(Object, Object)](<LINK_0>,%20java.lang.Object))</technical_language>

Target:
public static void terminatePantsProcess(Project project) { Process process = runningPantsProcesses.get(project); if (process != null) { process.destroy(); runningPantsProcesses.remove(project, process); } }
Source:
<code>public List<Entitlement> entitleByProducts(AutobindData data) throws EntitlementRefusedException { Consumer consumer = data.getConsumer(); String[] productIds = data.getProductIds(); Collection<String> fromPools = data.getPossiblePools(); Date entitleDate = data.getOnDate(); Owner owner = consumer.getOwner(); int retries = MAX_ENTITLE_RETRIES; while (true) { try { List<Entitlement> entitlements = new LinkedList<Entitlement>(); List<PoolQuantity> bestPools = getBestPools(consumer, productIds, entitleDate, owner, null, fromPools); if (bestPools == null) { List<String> fullList = new ArrayList<String>(); fullList.addAll(Arrays.asList(productIds)); for (ConsumerInstalledProduct cip : consumer.getInstalledProducts()) { fullList.add(cip.getId()); } log.info("No entitlements available for products: {}", fullList); return null; } for (PoolQuantity entry : bestPools) { entitlements.add(addOrUpdateEntitlement(consumer, entry.getPool(), null, entry.getQuantity(), false, CallerType.BIND)); } return entitlements; } catch (EntitlementRefusedException e) { String key = e.getResult().getErrors().get(0).getResourceKey(); if (key.equals("rulefailed.no.entitlements.available") && retries-- > 0) { <START> log.info("No entitlements available while attempting to entitle; retrying"); <END> continue; } throw e; } } }</code><technical_language>change this more specific: "Entitlements exhausted select pools bind operations, retrying" If hit this, I check quantity select pools</technical_language>

Target:
public List<Entitlement> entitleByProducts(AutobindData data) throws EntitlementRefusedException { Consumer consumer = data.getConsumer(); String[] productIds = data.getProductIds(); Collection<String> fromPools = data.getPossiblePools(); Date entitleDate = data.getOnDate(); Owner owner = consumer.getOwner(); int retries = MAX_ENTITLE_RETRIES; while (true) { try { List<Entitlement> entitlements = new LinkedList<Entitlement>(); List<PoolQuantity> bestPools = getBestPools(consumer, productIds, entitleDate, owner, null, fromPools); if (bestPools == null) { List<String> fullList = new ArrayList<String>(); fullList.addAll(Arrays.asList(productIds)); for (ConsumerInstalledProduct cip : consumer.getInstalledProducts()) { fullList.add(cip.getId()); } log.info("No entitlements available for products: {}", fullList); return null; } for (PoolQuantity entry : bestPools) { entitlements.add(addOrUpdateEntitlement(consumer, entry.getPool(), null, entry.getQuantity(), false, CallerType.BIND)); } return entitlements; } catch (EntitlementRefusedException e) { String key = e.getResult().getErrors().get(0).getResourceKey(); if (key.equals("rulefailed.no.entitlements.available") && retries-- > 0) { log.info( "Entitlements exhausted between select best pools and bind operations; retrying" ); continue; } throw e; } } }
Source:
<code>private void refreshPreview() { <START> server_.previewDataImport(fileChooserTextBox_.getTextBoxText(), maxRows_, new ServerRequestCallback<JsObject>() <END> { @Override public void onResponseReceived(JsObject response) { gridViewer_.setOption("nullsAsNAs", "true"); gridViewer_.setOption("status", "Previewing first " + toLocaleString(maxRows_) + " entries"); gridViewer_.setData(response); } @Override public void onError(ServerError error) { } }); }</code><technical_language>Anytime RPC call a introduce dialog-local progress. Subclasses of ModalDialog call getProgressIndicator get a hold of this. pass ProgressIndicator DataImport widget create it</technical_language>

Target:
private void refreshPreview() { progressIndicator_.onProgress("Retrieving preview data"); server_.previewDataImport(fileOrUrlChooserTextBox_.getText(), maxRows_, new ServerRequestCallback<JsObject>() { @Override public void onResponseReceived(JsObject response) { JsObject error = response.getObject("error"); if (error != null) { progressIndicator_.onError(getErrorMessage(error)); return; } gridViewer_.setOption("nullsAsNAs", "true"); gridViewer_.setOption("status", "Previewing first " + toLocaleString(maxRows_) + " entries"); gridViewer_.setData(response); progressIndicator_.onCompleted(); } @Override public void onError(ServerError error) { progressIndicator_.onError(error.getMessage()); } }); }
Source:
<code>public Broadcast transform(org.atlasapi.media.entity.simple.Broadcast simple) { if (Strings.isNullOrEmpty(simple.getBroadcastOn()) && !hasChannelId(simple)) { throw new IllegalArgumentException( "Must specify a channel either through a channel object or broadcastOn channel URI"); } if (!Strings.isNullOrEmpty(simple.getBroadcastOn()) && hasChannelId(simple)) { throw new IllegalArgumentException( "Must not specify a channel ID and a channel URI. Supply only one."); } String broadcastOn = null; if (hasChannelId(simple)) { String channelId = simple.getChannel().getId(); Iterable<Channel> channels = channelResolver.forIds(ImmutableSet.of(codec.decode(channelId) .longValue())); if (Iterables.size(channels) != 1) { throw new IllegalArgumentException("Could not resolve channel ID " + channelId); } broadcastOn = Iterables.getOnlyElement(channels).getCanonicalUri(); } else { broadcastOn = simple.getBroadcastOn(); <START> } <END> Broadcast complex = new Broadcast(broadcastOn, new DateTime(simple.getTransmissionTime()), new DateTime(simple.getTransmissionEndTime())) .withId(simple.getId()); if (simple.getActualTransmissionTime() != null) { complex.setActualTransmissionTime(new DateTime(simple.getActualTransmissionTime())); } if (simple.getActualTransmissionEndTime() != null) { complex.setActualTransmissionEndTime(new DateTime(simple.getActualTransmissionEndTime())); } complex.setScheduleDate(simple.getScheduleDate()); complex.setRepeat(simple.getRepeat()); complex.setSubtitled(simple.getSubtitled()); complex.setSigned(simple.getSigned()); complex.setAudioDescribed(simple.getAudioDescribed()); complex.setHighDefinition(simple.getHighDefinition()); complex.setWidescreen(simple.getWidescreen()); complex.setSurround(simple.getSurround()); complex.setLive(simple.getLive()); complex.setAliasUrls(simple.getAliases()); return complex; }</code><technical_language>this channel uri extraction logic in a separate method, leaving this method for creation of complex broadcast</technical_language>

Target:
public Broadcast transform(org.atlasapi.media.entity.simple.Broadcast simple) { Broadcast complex = new Broadcast(resolveChannel(simple), new DateTime(simple.getTransmissionTime()), new DateTime(simple.getTransmissionEndTime())) .withId(simple.getId()); if (simple.getActualTransmissionTime() != null) { complex.setActualTransmissionTime(new DateTime(simple.getActualTransmissionTime())); } if (simple.getActualTransmissionEndTime() != null) { complex.setActualTransmissionEndTime(new DateTime(simple.getActualTransmissionEndTime())); } complex.setScheduleDate(simple.getScheduleDate()); complex.setRepeat(simple.getRepeat()); complex.setSubtitled(simple.getSubtitled()); complex.setSigned(simple.getSigned()); complex.setAudioDescribed(simple.getAudioDescribed()); complex.setHighDefinition(simple.getHighDefinition()); complex.setWidescreen(simple.getWidescreen()); complex.setSurround(simple.getSurround()); complex.setLive(simple.getLive()); complex.setAliasUrls(simple.getAliases()); return complex; }
Source:
<code>public boolean isSameTime(Date d1, Date d2) { <START> Calendar c1 = Calendar.getInstance(tz); <END> c1.setTime(d1); Calendar c2 = Calendar.getInstance(tz); c2.setTime(d2); return isSameTime(c1, c2); }</code><technical_language>avoid calendar object for this specific case d1.getTime() == d2.getTime() is fine deprecated</technical_language>

Target:
public boolean isSameTime(Date d1, Date d2) { return d1.getTime() == d2.getTime(); }
Source:
<code>public JcrPropertySampleModel(int i) { if( StringUtils.isBlank(name) ) <START> modName = surname + i; END> }</code><technical_language>if message is in previous issue omitted</technical_language>

Target:
public JcrPropertySampleModel(int i) { if (StringUtils.isBlank(name)) { modName = surname + i; } }
Source:
<code>private ZooKeeper getExpectedZookeeper(final String expectedSessionId) { ZooKeeper zk = ((ZkConnection) getConnection()).getZookeeper(); if (expectedSessionId == null || expectedSessionId.isEmpty()) { return zk; } acquireEventLock(); try { final String actualSessionId = Long.toHexString(zk.getSessionId()); if (!actualSessionId.equals(expectedSessionId)) { throw new ZkSessionMismatchedException( "Failed to get expected zookeeper instance! There is a session id mismatch. Expected: " + expectedSessionId + ". Actual: " + actualSessionId); } <START> return ((ZkConnection) getConnection()).getZookeeper(); <END> } finally { getEventLock().unlock(); } }</code><technical_language>return zk</technical_language>

Target:
private ZooKeeper getExpectedZookeeper(final String expectedSessionId) { ZooKeeper zk = ((ZkConnection) getConnection()).getZookeeper(); if (expectedSessionId == null || expectedSessionId.isEmpty()) { return zk; } final String actualSessionId = Long.toHexString(zk.getSessionId()); if (!actualSessionId.equals(expectedSessionId)) { throw new ZkSessionMismatchedException( "Failed to get expected zookeeper instance! There is a session id mismatch. Expected: " + expectedSessionId + ". Actual: " + actualSessionId); } return zk; }
Source:
<code>public Response<Void> downloadWithResponse(OutputStream stream, FileRange range, Boolean rangeGetContentMD5, Duration timeout, Context context) { Objects.requireNonNull(stream, "'stream' cannot be null."); Mono<Response<Void>> download = fileAsyncClient.downloadWithResponse(range, rangeGetContentMD5, context) .flatMapMany(response -> response.getValue().doOnNext(buffer -> { try { stream.write(FluxUtil.byteBufferToArray(buffer)); } catch (IOException ex) { throw logger.logExceptionAsError(new UncheckedIOException(ex)); } }).map(buffer -> response)) <START> .last() <END> .map(response -> new SimpleResponse<>(response, null)); return Utility.blockWithOptionalTimeout(download, timeout); }</code><technical_language>If response.getValue() emits Flux.empty() last() operator throw NoSuchElementException Ref: <LINK_0></technical_language>

Target:
public Response<Void> downloadWithResponse(OutputStream stream, FileRange range, Boolean rangeGetContentMD5, Duration timeout, Context context) { Objects.requireNonNull(stream, "'stream' cannot be null."); Mono<Response<Void>> download = fileAsyncClient.downloadWithResponse(range, rangeGetContentMD5, context) .flatMap(response -> response.getValue().reduce(stream, (outputStream, buffer) -> { try { outputStream.write(FluxUtil.byteBufferToArray(buffer)); return outputStream; } catch (IOException ex) { throw logger.logExceptionAsError(Exceptions.propagate(new UncheckedIOException(ex))); } }).thenReturn(new SimpleResponse<>(response, null))); return Utility.blockWithOptionalTimeout(download, timeout); }
Source:
<code>public static String convertNewlines(String input){ <START> return input.replace("%n", System.getProperty("line.separator")); <END> }</code><technical_language>hey, super comfortable "%n" "%p" delimeters (It's totally reasonable imagine people "%n" in text). in markdown? If not, talk do this differently</technical_language>

Target:
public static String convertNewlines(String input){ return input.replace("\\n", System.getProperty("line.separator")); }
Source:
<code>public void showBadImagePopup(Integer errorCode) { String errorMessageForResult = getErrorMessageForResult(getContext(), errorCode); if (!StringUtils.isBlank(errorMessageForResult)) { DialogUtil.showAlertDialog(getActivity(), <START> getString(R.string.duplicate_image_found), <END> errorMessageForResult, getString(R.string.cancel), getString(R.string.upload_proceed), () -> deleteThisPicture(), () -> { uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP); onNextButtonClicked(); }); } }</code><technical_language>I "Duplicate Image Found" is title for this dialog. This dialog is shown for other cases (take a ImageUtils#getErrorMessageForResult method get idea). "Problems in image" title</technical_language>

Target:
public void showBadImagePopup(Integer errorCode) { String errorMessageForResult = getErrorMessageForResult(getContext(), errorCode); if (!StringUtils.isBlank(errorMessageForResult)) { DialogUtil.showAlertDialog(getActivity(), getString(R.string.upload_problem_image), errorMessageForResult, getString(R.string.upload), getString(R.string.cancel), () -> { uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP); onNextButtonClicked(); }, () -> deleteThisPicture() ); } }
Source:
<code>void testWithNullRegex() { <START> final String regex = null; <END> final String type = "String"; final GelfDynamicMdcFieldType fieldType = GelfDynamicMdcFieldType.createField(null, regex, type); assertThat(fieldType).isNull(); }</code><technical_language>Nit: need for final</technical_language>

Target:
public void testWithNullRegex() { String regex = null; String type = "String"; expectedException.expect(IllegalArgumentException.class); GelfDynamicMdcFieldType.createField(null, regex, type); }
Source:
<code>private void log(String accessLog, AccessLogData accessLogData) { Set<AccessLogData> logSet = LOG_ENTRIES.computeIfAbsent(accessLog, k -> new ConcurrentHashSet<>()); <START> if (logSet.size() >= LOG_MAX_BUFFER) { <END> logSet.add(accessLogData); } else { logger.warn("AccessLog buffer is full. Do a force writing to file to clear buffer."); writeLogSetToFile(accessLog, logSet); logSet.add(accessLogData); } }</code><technical_language>this comparator "<", means add new item logSet size exceed LOG_MAX_BUFFER</technical_language>

Target:
private void log(String accessLog, AccessLogData accessLogData) { Set<AccessLogData> logSet = LOG_ENTRIES.computeIfAbsent(accessLog, k -> new ConcurrentHashSet<>()); if (logSet.size() < LOG_MAX_BUFFER) { logSet.add(accessLogData); } else { logger.warn("AccessLog buffer is full. Do a force writing to file to clear buffer."); writeLogSetToFile(accessLog, logSet); logSet.add(accessLogData); } }
Source:
<code>public DataFetchingEnvironmentImpl(Object source, Map<String, Object> arguments, Object context, Object root, GraphQLFieldDefinition fieldDefinition, List<Field> fields, GraphQLOutputType fieldType, GraphQLType parentType, GraphQLSchema graphQLSchema, Map<String, FragmentDefinition> fragmentsByName, ExecutionId executionId, DataFetchingFieldSelectionSet selectionSet, ExecutionTypeInfo fieldTypeInfo, ExecutionContext executionContext) { this.source = source; <START> this.arguments = arguments == null ? Collections.emptyMap() : unmodifiableMap(arguments); <END> this.fragmentsByName = fragmentsByName == null ? Collections.emptyMap() : unmodifiableMap(fragmentsByName); this.context = context; this.root = root; this.fieldDefinition = fieldDefinition; this.fields = fields; this.fieldType = fieldType; this.parentType = parentType; this.graphQLSchema = graphQLSchema; this.executionId = executionId; this.selectionSet = selectionSet; this.fieldTypeInfo = fieldTypeInfo; this.executionContext = assertNotNull(executionContext); }</code><technical_language>instead of a unmodifiable map, return a copy in getArguments? I prefer is surprising for client imho</technical_language>

Target:
public DataFetchingEnvironmentImpl(Object source, Map<String, Object> arguments, Object context, Object root, GraphQLFieldDefinition fieldDefinition, List<Field> fields, GraphQLOutputType fieldType, GraphQLType parentType, GraphQLSchema graphQLSchema, Map<String, FragmentDefinition> fragmentsByName, ExecutionId executionId, DataFetchingFieldSelectionSet selectionSet, ExecutionTypeInfo fieldTypeInfo, ExecutionContext executionContext) { this.source = source; this.arguments = arguments == null ? Collections.emptyMap() : arguments; this.fragmentsByName = fragmentsByName == null ? Collections.emptyMap() : fragmentsByName; this.context = context; this.root = root; this.fieldDefinition = fieldDefinition; this.fields = fields; this.fieldType = fieldType; this.parentType = parentType; this.graphQLSchema = graphQLSchema; this.executionId = executionId; this.selectionSet = selectionSet; this.fieldTypeInfo = fieldTypeInfo; this.executionContext = assertNotNull(executionContext); }
Source:
<code>protected void init(ExplorerManager tableExplorerManager) { this.accountsTableEM = tableExplorerManager; tableExplorerManager.addPropertyChangeListener(evt -> { if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } else if (ExplorerManager.PROP_EXPLORED_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } }); jSplitPane1.setRightComponent(new MessageBrowser(tableExplorerManager, messageBrowserEM)); proxyLookup = new ProxyLookup( ExplorerUtils.createLookup(messageBrowserEM, getActionMap()), <START> ExplorerUtils.createLookup(accountsTableEM, getActionMap())); <END> }</code><technical_language>interesting</technical_language>

Target:
void init(ExplorerManager tableExplorerManager) { this.accountsTableEM = tableExplorerManager; tableExplorerManager.addPropertyChangeListener(evt -> { if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } else if (ExplorerManager.PROP_EXPLORED_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } }); jSplitPane1.setRightComponent(new MessageBrowser(tableExplorerManager, messageBrowserEM)); proxyLookup = new ProxyLookup( ExplorerUtils.createLookup(messageBrowserEM, getActionMap()), ExplorerUtils.createLookup(accountsTableEM, getActionMap())); }
Source:
<code>public List<IndexEntry> getValidEntry(IndexSegment indexSegment, FileSpan duplicateSearchSpan, boolean checkAlreadyCopied) throws StoreException { List<IndexEntry> allIndexEntries = new ArrayList<>(); indexSegment.getIndexEntriesSince(null, new FindEntriesCondition(Long.MAX_VALUE), allIndexEntries, new AtomicLong(0), true); StoreFindToken safeToken = new StoreFindToken(allIndexEntries.get(0).getKey(), indexSegment.getStartOffset(), sessionId, incarnationId); compactionLog.setSafeToken(safeToken); logger.debug("Set safe token for compaction in to {}", storeId, safeToken); List<IndexEntry> copyCandidates = getValidIndexEntries(indexSegment, allIndexEntries); int validEntriesSize = copyCandidates.size(); copyCandidates.removeIf( copyCandidate -> isDuplicate(copyCandidate, duplicateSearchSpan, indexSegment.getStartOffset(), checkAlreadyCopied)); copyCandidates.removeIf( <START> copyCandidate -> isDeleteRequested(copyCandidate, selectedContainers)); <END> copyCandidates.sort(PersistentIndex.INDEX_ENTRIES_OFFSET_COMPARATOR); logger.debug("Out of entries, are valid and will be copied in this round", allIndexEntries.size(), validEntriesSize, copyCandidates.size()); logger.trace("For index segment with start offset in - Total index entries: {}. Entries to copy: {}", indexSegment.getStartOffset(), storeId, allIndexEntries, copyCandidates); return copyCandidates; }</code><technical_language>combine this line 1052-1053</technical_language>

Target:
public List<IndexEntry> getValidEntry(IndexSegment indexSegment, FileSpan duplicateSearchSpan, boolean checkAlreadyCopied) throws StoreException { List<IndexEntry> allIndexEntries = new ArrayList<>(); indexSegment.getIndexEntriesSince(null, new FindEntriesCondition(Long.MAX_VALUE), allIndexEntries, new AtomicLong(0), true); StoreFindToken safeToken = new StoreFindToken(allIndexEntries.get(0).getKey(), indexSegment.getStartOffset(), sessionId, incarnationId); compactionLog.setSafeToken(safeToken); logger.debug("Set safe token for compaction in to {}", storeId, safeToken); List<IndexEntry> copyCandidates = getValidIndexEntries(indexSegment, allIndexEntries); int validEntriesSize = copyCandidates.size(); copyCandidates.removeIf( copyCandidate -> isDuplicate(copyCandidate, duplicateSearchSpan, indexSegment.getStartOffset(), checkAlreadyCopied) || (config.storeContainerDeletionEnabled && isFromDeprecatedContainer(copyCandidate))); copyCandidates.sort(PersistentIndex.INDEX_ENTRIES_OFFSET_COMPARATOR); logger.debug("Out of entries, are valid and will be copied in this round", allIndexEntries.size(), validEntriesSize, copyCandidates.size()); logger.trace("For index segment with start offset in - Total index entries: {}. Entries to copy: {}", indexSegment.getStartOffset(), storeId, allIndexEntries, copyCandidates); return copyCandidates; }
Source:
<code>private boolean isTree(World world, BlockPos initialPos) { int logs = 0; boolean leafTop = false; BlockPos pos = initialPos; int y = 0; <START> while(y++ < 32) <END> { pos = pos.up(); BlockState state = world.getBlockState(pos); if(state.isIn(BlockTags.LOGS)) logs++; else { if(state.isIn(BlockTags.LEAVES)) leafTop = true; boolean foundLog = false; if(!leafTop) { for(int z = -1; z <= 1; z++) for(int x = -1; x <= 1; x++) { state = world.getBlockState(pos.add(x, 0, z)); if(state.isIn(BlockTags.LOGS)) { pos = pos.add(x, 0, z); foundLog = true; logs++; break; } } } if(!foundLog) break; } } return logs >= 3&&leafTop; }</code><technical_language>for-loop get rid of ++ in expression</technical_language>

Target:
private boolean isTree(World world, BlockPos initialPos) { int logs = 0; boolean leafTop = false; BlockPos pos = initialPos; for(int y = 0; y < 32; y++) { pos = pos.up(); BlockState state = world.getBlockState(pos); if(state.isIn(BlockTags.LOGS)) logs++; else { if(state.isIn(BlockTags.LEAVES)) leafTop = true; boolean foundLog = false; if(!leafTop) { boolean loop = true; for(int z = -1; z <= 1&&loop; z++) for(int x = -1; x <= 1&&loop; x++) { state = world.getBlockState(pos.add(x, 0, z)); if(state.isIn(BlockTags.LOGS)) { pos = pos.add(x, 0, z); foundLog = true; logs++; loop = false; } } } if(!foundLog) break; } } return logs >= 3&&leafTop; }
Source:
<code>public void setElytraFlying(boolean value) { <START> setFlag(7, value); <END> }</code><technical_language>-1: for magic number</technical_language>

Target:
public void setElytraFlying(boolean value) { setFlag(DataConstants.ELYTRA_FLYING_FLAG, value); }
Source:
<code>public String execute(String container, Blob blob) { String key = blob.getMetadata().getName(); Payload payload = blob.getPayload(); <START> algorithm <END> .calculateChunkSize(checkNotNull( payload.getContentMetadata().getContentLength(), "contentLength required on all uploads to swift; please invoke payload.getContentMetadata().setContentLength(length) first")); int parts = algorithm.getParts(); long chunkSize = algorithm.getChunkSize(); if (parts > 0) { int part; while ((part = algorithm.getNextPart()) <= parts) { Payload chunkedPart = slicer.slice(payload, algorithm.getNextChunkOffset(), chunkSize); Blob blobPart = blobBuilders.get() .name(key + PART_SEPARATOR + part) .payload(chunkedPart) .contentDisposition(key + PART_SEPARATOR + part).build(); client.putObject(container, blob2Object.apply(blobPart)); } long remaining = algorithm.getRemaining(); if (remaining > 0) { Payload chunkedPart = slicer.slice(payload, algorithm.getNextChunkOffset(), remaining); Blob blobPart = blobBuilders.get() .name(key + PART_SEPARATOR + part) .payload(chunkedPart) .contentDisposition(key + PART_SEPARATOR + part).build(); client.putObject(container, blob2Object.apply(blobPart)); } return client.putObjectManifest(container, key); } else { return client.putObject(container, blob2Object.apply(blob)); } }</code><technical_language>Formatting</technical_language>

Target:
public String execute(String container, Blob blob) { String key = blob.getMetadata().getName(); Payload payload = blob.getPayload(); Long length = payload.getContentMetadata().getContentLength(); checkNotNull(length, "please invoke payload.getContentMetadata().setContentLength(length) prior to multipart upload"); long chunkSize = algorithm.calculateChunkSize(length); int partCount = algorithm.getParts(); if (partCount > 0) { int part; while ((part = algorithm.getNextPart()) <= partCount) { Payload chunkedPart = slicer.slice(payload, algorithm.getNextChunkOffset(), chunkSize); Blob blobPart = blobBuilders.get() .name(key + PART_SEPARATOR + part) .payload(chunkedPart) .contentDisposition(key + PART_SEPARATOR + part).build(); client.putObject(container, blob2Object.apply(blobPart)); } long remaining = algorithm.getRemaining(); if (remaining > 0) { Payload chunkedPart = slicer.slice(payload, algorithm.getNextChunkOffset(), remaining); Blob blobPart = blobBuilders.get() .name(key + PART_SEPARATOR + part) .payload(chunkedPart) .contentDisposition(key + PART_SEPARATOR + part).build(); client.putObject(container, blob2Object.apply(blobPart)); } return client.putObjectManifest(container, key); } else { return client.putObject(container, blob2Object.apply(blob)); } }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append(fBinaryFilePath); if (!fSymbolName.equals("")) { sb.append(", symbol = " + fSymbolName); } sb.append(", <START> offset = <END> " + fOffset); return sb.toString(); }</code><technical_language>A bit a matter of taste remove spaces =, more consistent "Contents" column, i.e. field=123, foo=345</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(fBinaryFilePath); if (!fSymbolName.equals("")) { sb.append(", "); sb.append(Messages.UstDebugInfoAnalysis_Symbol); sb.append('='); sb.append(fSymbolName); } sb.append(", "); sb.append(Messages.UstDebugInfoAnalysis_Offset); sb.append('='); sb.append(fOffset); return sb.toString(); }
Source:
<code>protected void setUp() throws Exception { super.setUp(); git = new Git(db); <START> git.commit().setMessage("initial commit").call(); <END> writeTrashFile("Test.txt", "Hello world"); git.add().addFilepattern("Test.txt").call(); initialCommit = git.commit().setMessage("Initial commit").call(); git.branchCreate().setForce(true).setName("master").call(); RefUpdate rup = db.updateRef("refs/heads/master"); rup.setNewObjectId(initialCommit.getId()); rup.setForceUpdate(true); rup.update(); writeTrashFile("Test.txt", "Some change"); git.add().addFilepattern("Test.txt").call(); secondCommit = git.commit().setMessage("Second commit").call(); git.branchCreate().setForce(true).setName("test").call(); }</code><technical_language>I imagine reason for this commit? is content available. Is create a master branch. real commit create this branch sideeffects anymore this commit. I remove this line</technical_language>

Target:
protected void setUp() throws Exception { super.setUp(); git = new Git(db); writeTrashFile("Test.txt", "Hello world"); git.add().addFilepattern("Test.txt").call(); initialCommit = git.commit().setMessage("Initial commit").call(); git.branchCreate().setName("test").call(); RefUpdate rup = db.updateRef(Constants.HEAD); rup.link("refs/heads/test"); writeTrashFile("Test.txt", "Some change"); git.add().addFilepattern("Test.txt").call(); secondCommit = git.commit().setMessage("Second commit").call(); }
Source:
<code>public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters()); Guid currentChildId = getCurrentChildId(getParameters()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } <START> log.info("Executing Command with id '{}', step '{}'", getCommandId(), getParameters().getCommandStep()); <END> Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; } persistCommandIfNeeded(); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }</code><technical_language>id is of this command, of executed command. log.info("Command id: '{}': executing step.. {}",</technical_language>

Target:
public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters()); Guid currentChildId = getCurrentChildId(getParameters()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } log.info("Command id: '{}' is executing step: '{}'", getCommandId(), getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; } persistCommandIfNeeded(); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }
Source:
<code>public Beacon createNewBlock(Input in, byte[] pubKey) { Beacon block = new Beacon(in.parent.getHash(), randaoReveal(in.state, pubKey), in.mainChainRef, HashUtil.EMPTY_DATA_HASH, in.slotNumber, new AttestationRecord[0]); BeaconState newState = stateTransition.applyBlock(block, in.state); block.setStateHash(newState.getHash()); <START> AttestationRecord[] attestationRecords = new AttestationRecord[1]; <END> byte[] emptyBitfield = Bitfield.createEmpty(in.index.getCommitteeSize()); long lastJustified = in.state.getCrystallizedState().getFinality().getLastJustifiedSlot(); attestationRecords[0] = new AttestationRecord( in.slotNumber, in.index.getShardId(), new byte[0][0], new byte[32], Bitfield.markVote(emptyBitfield, in.index.getValidatorIdx()), lastJustified, store.getCanonicalByNumber(lastJustified) == null ? new byte[32] : store.getCanonicalByNumber(lastJustified).getHash(), Sign.aggSigns(new byte[][] {Sign.sign(block.getEncoded(), pubKey)}) ); block.setAttestations(attestationRecords); logger.info("New block created {}", block); return block; }</code><technical_language>Verify attestation this validator is part of (ie. item 0 in array) AttestationRecord object; this attester considered proposer of parent block. In general, a block is produced, is broadcasted network layer attestation proposer. I totally wrong proposer _include_ this attestation block proposes. spec broadcast block zero attestation network. ancestor include this attestation position in array of attestations. This totally sense, including zero attestation block inevitably change hash attestation pass verification part</technical_language>

Target:
public Beacon createNewBlock(Input in, byte[] pubKey) { Beacon block = new Beacon(in.parent.getHash(), randaoReveal(in.state, pubKey), in.mainChainRef, HashUtil.EMPTY_DATA_HASH, in.slotNumber, Collections.emptyList()); BeaconState newState = stateTransition.applyBlock(block, in.state); block.setStateHash(newState.getHash()); logger.info("New block created {}", block); return block; }
Source:
<code>private void printCollectedOutput() { if (outputCollector == null) { return; } try { String line = outputCollector.toString(); if (line.isEmpty()) { return; <START> } <END> String[] lines = line.split("\\R", 0); int max = connection.size().getHeight(); int currentLines = 0; int allLines = 0; while (allLines < lines.length) { if (currentLines > max - 2) { try { connection.write(ANSI.CURSOR_SAVE); int percentage = (allLines * 100) / lines.length; connection.write("--More(" + percentage + "%)--"); Key k = readKey(); connection.write(ANSI.CURSOR_RESTORE); connection.stdoutHandler().accept(ANSI.ERASE_LINE_FROM_CURSOR); if (k == null) { allLines = lines.length; } else { switch (k) { case SPACE: { currentLines = 0; break; } case DOWN: case ENTER: case CTRL_M: { currentLines -= 1; break; } case Q: case q: { allLines = lines.length; resetPrompt(); break; } } } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new RuntimeException(ex); } catch (IOException ex) { throw new RuntimeException(ex); } } else { String l = lines[allLines]; currentLines += 1; allLines += 1; if (allLines == lines.length) { if (l.isEmpty()) { continue; } } connection.write(l + Config.getLineSeparator()); } } } finally { outputCollector = null; } }</code><technical_language>do need this change</technical_language>

Target:
private void printCollectedOutput() { if (outputCollector == null) { return; } try { String line = outputCollector.toString(); if (line.isEmpty()) { return; } String[] lines = line.split("\\R", -1); int max = connection.size().getHeight(); int currentLines = 0; int allLines = 0; while (allLines < lines.length) { if (currentLines > max - 2) { try { connection.write(ANSI.CURSOR_SAVE); int percentage = (allLines * 100) / lines.length; connection.write("--More(" + percentage + "%)--"); Key k = readKey(); connection.write(ANSI.CURSOR_RESTORE); connection.stdoutHandler().accept(ANSI.ERASE_LINE_FROM_CURSOR); if (k == null) { allLines = lines.length; } else { switch (k) { case SPACE: { currentLines = 0; break; } case DOWN: case ENTER: case CTRL_M: { currentLines -= 1; break; } case Q: case q: { allLines = lines.length; break; } } } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new RuntimeException(ex); } catch (IOException ex) { throw new RuntimeException(ex); } } else { String l = lines[allLines]; currentLines += 1; allLines += 1; if (allLines == lines.length) { if (l.isEmpty()) { continue; } } connection.write(l + Config.getLineSeparator()); } } } finally { outputCollector = null; } }
Source:
<code>public String getEmbedMapID(){ String mapID = mapFrame.getAttribute("data-mapid"); <START> return mapID; <END> }</code><technical_language>combine lines return String</technical_language>

Target:
public String getEmbedMapID() { return mapFrame.getAttribute("data-mapid"); }
Source:
<code><START> public static void updateDatabase() <END> throws SQLException { DataSource dataSource = getDataSource(); try(Connection connection = dataSource.getConnection()) { updateDatabase(dataSource, connection); } }</code><technical_language>Note: *two* updateDatabase() methods (with params) in this class, removed synchronized of them. Is purpose</technical_language>

Target:
public static synchronized void updateDatabase() throws SQLException { DataSource dataSource = getDataSource(); try(Connection connection = dataSource.getConnection()) { updateDatabase(dataSource, connection); } }
Source:
<code>private Query readTextQuery(BinaryRawReader reader) { boolean loc = reader.readBoolean(); String txt = reader.readString(); String typ = reader.readString(); final int limit = reader.readInt(); final int pageSize = reader.readInt(); <START> return new TextQuery(typ, txt, limit).setPageSize(pageSize).setLocal(loc); <END> }</code><technical_language>Platforms do support 'limit' param yet. So, attempt read lead error. set a default create a separate ticket for issue</technical_language>

Target:
private Query readTextQuery(BinaryRawReader reader) { boolean loc = reader.readBoolean(); String txt = reader.readString(); String typ = reader.readString(); final int pageSize = reader.readInt(); return new TextQuery(typ, txt).setPageSize(pageSize).setLocal(loc); }
Source:
<code>protected VarDeclaration parseVarDeclaration() throws TypeImportException, XMLStreamException { VarDeclaration v = LibraryElementFactory.eINSTANCE.createVarDeclaration(); readNameCommentAttributes(v); String typeName = getAttributeValue(LibraryElementTags.TYPE_ATTRIBUTE); if <START> (typeName != null) { <END> DataType dataType = DataTypeLibrary.getInstance().getType(typeName); v.setTypeName(typeName); if (dataType != null) { v.setType(dataType); } } else { throw new TypeImportException(Messages.Import_ERROR_InputVariableTypeNotDefined); } String arraySize = getAttributeValue(LibraryElementTags.ARRAYSIZE_ATTRIBUTE); if (arraySize != null) { try { v.setArraySize(Integer.parseInt(arraySize)); } catch (NumberFormatException nfe) { throw new TypeImportException(Messages.Import_ERROR_Arraysize_NumberFormat); } } else { v.setArraySize(-1); } String initialValue = getAttributeValue(LibraryElementTags.INITIALVALUE_ATTRIBUTE); if (initialValue != null) { Value varInitialization = LibraryElementFactory.eINSTANCE.createValue(); varInitialization.setValue(initialValue); v.setValue(varInitialization); } proceedToEndElementNamed(LibraryElementTags.VAR_DECLARATION_ELEMENT); return v; }</code><technical_language>order of operands</technical_language>

Target:
protected VarDeclaration parseVarDeclaration() throws TypeImportException, XMLStreamException { VarDeclaration v = LibraryElementFactory.eINSTANCE.createVarDeclaration(); readNameCommentAttributes(v); String typeName = getAttributeValue(LibraryElementTags.TYPE_ATTRIBUTE); if (null != typeName) { DataType dataType = DataTypeLibrary.getInstance().getType(typeName); v.setTypeName(typeName); if (dataType != null) { v.setType(dataType); } } else { throw new TypeImportException(Messages.Import_ERROR_InputVariableTypeNotDefined); } String arraySize = getAttributeValue(LibraryElementTags.ARRAYSIZE_ATTRIBUTE); if (null != arraySize) { try { v.setArraySize(Integer.parseInt(arraySize)); } catch (NumberFormatException nfe) { throw new TypeImportException(Messages.Import_ERROR_ArraySize_NumberFormat); } } else { v.setArraySize(-1); } String initialValue = getAttributeValue(LibraryElementTags.INITIALVALUE_ATTRIBUTE); if (null != initialValue) { Value varInitialization = LibraryElementFactory.eINSTANCE.createValue(); varInitialization.setValue(initialValue); v.setValue(varInitialization); } proceedToEndElementNamed(LibraryElementTags.VAR_DECLARATION_ELEMENT); return v; }