auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static KeyPair toJavaKeyPair(SignatureKeyPair keyPair) { try { final PrivateKey privateKey = KeyFactory.getInstance(keyPair.getPrivateKey().getAlgorithm()) .generatePrivate(getKeySpec(keyPair.getPrivateKey())); final PublicKey publicKey = KeyFactory.getInstance(keyPair.getPublicKey().getAlgorithm()) .generatePublic(getKeySpec(keyPair.getPublicKey())); return new KeyPair(publicKey, privateKey); } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) { LOG.error("Failed to convert signature key pair to Java keys cause: {}", ex.getMessage()); <START> return null; <END> } }</code><technical_language>return null here</technical_language>

Target:
public static KeyPair toJavaKeyPair(SignatureKeyPair keyPair) throws ServerException { try { final PrivateKey privateKey = KeyFactory.getInstance(keyPair.getPrivateKey().getAlgorithm()) .generatePrivate(getKeySpec(keyPair.getPrivateKey())); final PublicKey publicKey = KeyFactory.getInstance(keyPair.getPublicKey().getAlgorithm()) .generatePublic(getKeySpec(keyPair.getPublicKey())); return new KeyPair(publicKey, privateKey); } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) { LOG.error("Failed to convert signature key pair to Java keys. Cause: {}", ex.getMessage()); throw new ServerException("Failed to convert signature key pair to Java keys."); } }
Source:
<code>public SpanBatchDeleteInformation(Optional<String> nodeId, int batchSize, Column column, Span span) { super(batchSize, Task.Delete, column, span); <START> Preconditions.checkNotNull(nodeId); <END> this.nodeId = nodeId; }</code><technical_language>static import</technical_language>

Target:
public SpanBatchDeleteInformation(Optional<String> nodeId, int batchSize, Column column, Span span) { super(batchSize, Task.Delete, column, span); checkNotNull(nodeId); this.nodeId = nodeId; }
Source:
<code>private Map<String, String> getFullSinkOptions() { Map<String, String> tableOptions = new HashMap<>(); tableOptions.put("connector", factoryIdentifier()); tableOptions.put("topic", TOPIC); tableOptions.put("properties.group.id", "dummy"); tableOptions.put("properties.bootstrap.servers", "dummy"); tableOptions.put("sink.partitioner", KafkaOptions.SINK_PARTITIONER_VALUE_FIXED); <START> tableOptions.put("sink.semantic", KafkaOptions.SINK_SEMANTIC_VALUE_AT_LEAST_ONCE); <END> tableOptions.put("format", TestFormatFactory.IDENTIFIER); final String formatDelimiterKey = String.format("%s.%s", TestFormatFactory.IDENTIFIER, TestFormatFactory.DELIMITER.key()); tableOptions.put(formatDelimiterKey, ","); return tableOptions; }</code><technical_language>exactly-once verify configuration works, default is at-least-once</technical_language>

Target:
protected Map<String, String> getFullSinkOptions() { Map<String, String> tableOptions = new HashMap<>(); tableOptions.put("connector", factoryIdentifier()); tableOptions.put("topic", TOPIC); tableOptions.put("properties.group.id", "dummy"); tableOptions.put("properties.bootstrap.servers", "dummy"); tableOptions.put("sink.partitioner", KafkaOptions.SINK_PARTITIONER_VALUE_FIXED); tableOptions.put("sink.semantic", KafkaOptions.SINK_SEMANTIC_VALUE_EXACTLY_ONCE); tableOptions.put("format", TestFormatFactory.IDENTIFIER); final String formatDelimiterKey = String.format("%s.%s", TestFormatFactory.IDENTIFIER, TestFormatFactory.DELIMITER.key()); tableOptions.put(formatDelimiterKey, ","); return tableOptions; }
Source:
<code>private DocumentBuilder newDocumentBuilder(StringWriter writer, boolean xhtmlStrict) { HtmlLanguage language = builder.add(BlockType.PARAGRAPH) .setXhtmlStrict(xhtmlStrict) .document("", "") .name("Test") .create(); <START> return language.createDocumentBuilder(writer); <END> }</code><technical_language>inline return (no need for language variable here)</technical_language>

Target:
private DocumentBuilder newDocumentBuilder(StringWriter writer, boolean xhtmlStrict) { return builder.add(BlockType.PARAGRAPH) .setXhtmlStrict(xhtmlStrict) .document("", "") .name("Test") .create().createDocumentBuilder(writer); }
Source:
<code>private static Predicate<Expression> isStringSatisfying(Predicate<String> pred) { return expr -> { if (expr.is(Tree.Kind.STRING_LITERAL)) { return pred.test(((StringLiteral) expr).trimmedQuotesValue()); } else { <START> return false; <END> } }; }</code><technical_language>Minor nitpick I else is needed return if anyway</technical_language>

Target:
private static Predicate<Expression> isStringSatisfying(Predicate<String> pred) { return expr -> expr.is(Tree.Kind.STRING_LITERAL) && pred.test(((StringLiteral) expr).trimmedQuotesValue()); }
Source:
<code>private static GitSynchronizer getSynchronizer() { Display display = Display.getCurrent(); Assert.isNotNull(display); if (Activator.getDefault().getPreferenceStore() .getBoolean(UIPreferences.USE_LOGICAL_MODEL)) { return new ModelAwareGitSynchronizer(display); } <START> return new DefaultGitSynchronizer(display); <END> }</code><technical_language>I get display here. forces a ModelAwareGitSynchronizer(Display) constructor class need it. parameterless constructors, PlatformUI.getWorkbench().getDisplay() in DefaultGitSynchronizer.openGitTreeCompare() instead</technical_language>

Target:
private static GitSynchronizer getSynchronizer() { if (Activator.getDefault().getPreferenceStore() .getBoolean(UIPreferences.USE_LOGICAL_MODEL)) { return new ModelAwareGitSynchronizer(); } return new DefaultGitSynchronizer(); }
Source:
<code>public void setup() { MockitoAnnotations.initMocks(this); initializeBridge(); thingConfiguration.put(CONFIG_ID, TEST_ID); thingProperties.put(PROPERTY_SENSORCOUNT, "1"); thingProperties.put(PROPERTY_THING_TYPE_VERSION, "1"); <START> thingProperties.put(PROPERTY_MODELID, "AMS"); <END> channels.add(ChannelBuilder.create(CHANNEL_UID_PRESENT, "Switch").build()); channels.add(ChannelBuilder.create(CHANNEL_UID_TEMPERATURE, "Number").build()); channels.add(ChannelBuilder.create(CHANNEL_UID_HUMIDITY, "Number").build()); channels.add(ChannelBuilder.create(CHANNEL_UID_ABSOLUTE_HUMIDITY, "Number").build()); channels.add(ChannelBuilder.create(CHANNEL_UID_DEWPOINT, "Number").build()); thing = ThingBuilder.create(THING_TYPE_MS_TH, "testthing").withLabel("Test thing").withChannels(channels) .withConfiguration(new Configuration(thingConfiguration)).withProperties(thingProperties) .withBridge(bridge.getUID()).build(); thingHandler = new MultisensorThingHandler(thing, stateProvider) { @Override protected Bridge getBridge() { return bridge; } }; initializeHandlerMocks(); }</code><technical_language>This fix test, NPE occur in normal operation (see below)</technical_language>

Target:
public void setup() { MockitoAnnotations.initMocks(this); initializeBridge(); thingConfiguration.put(CONFIG_ID, TEST_ID); thingProperties.put(PROPERTY_SENSORCOUNT, "1"); thingProperties.put(PROPERTY_THING_TYPE_VERSION, "1"); channels.add(ChannelBuilder.create(CHANNEL_UID_PRESENT, "Switch").build()); channels.add(ChannelBuilder.create(CHANNEL_UID_TEMPERATURE, "Number").build()); channels.add(ChannelBuilder.create(CHANNEL_UID_HUMIDITY, "Number").build()); channels.add(ChannelBuilder.create(CHANNEL_UID_ABSOLUTE_HUMIDITY, "Number").build()); channels.add(ChannelBuilder.create(CHANNEL_UID_DEWPOINT, "Number").build()); thing = ThingBuilder.create(THING_TYPE_MS_TH, "testthing").withLabel("Test thing").withChannels(channels) .withConfiguration(new Configuration(thingConfiguration)).withProperties(thingProperties) .withBridge(bridge.getUID()).build(); thingHandler = new MultisensorThingHandler(thing, stateProvider) { @Override protected Bridge getBridge() { return bridge; } }; initializeHandlerMocks(); }
Source:
<code>protected void autoSelectGraphicsDevice() { <START> if (getParameters().getGraphicsDevices().size() == 0) { <END> DisplayType defaultDisplayType = getParameters().getVmStaticData().getDefaultDisplayType(); int osId = getParameters().getVmStaticData().getOsId(); Version clusterVersion = getVdsGroup().getCompatibilityVersion(); List<GraphicsType> templateGraphics = VmDeviceUtils.getGraphicsTypesOfEntity(getVmTemplateId()); if (!VmValidationUtils.isGraphicsAndDisplaySupported(osId, clusterVersion, templateGraphics, defaultDisplayType)) { GraphicsType defaultGraphicsType = null; List<Pair<GraphicsType, DisplayType>> pairs = osRepository.getGraphicsAndDisplays().get(osId).get(clusterVersion); for (Pair<GraphicsType, DisplayType> pair : pairs) { if (pair.getSecond().equals(defaultDisplayType)) { defaultGraphicsType = pair.getFirst(); break; } } if (defaultGraphicsType != null) { VmDeviceType vmDisplayType = defaultDisplayType.getDefaultVmDeviceType(); GraphicsDevice defaultGraphicsDevice = new GraphicsDevice(vmDisplayType); getParameters().getGraphicsDevices().put(defaultGraphicsType, defaultGraphicsDevice); } } } }</code><technical_language>do action, check getVdsGroup() is null</technical_language>

Target:
protected void autoSelectGraphicsDevice() { if (getParameters().getGraphicsDevices().size() == 0 && getVdsGroup() != null) { OsRepository osRepository = SimpleDependecyInjector.getInstance().get(OsRepository.class); DisplayType defaultDisplayType = getParameters().getVmStaticData().getDefaultDisplayType(); int osId = getParameters().getVmStaticData().getOsId(); Version clusterVersion = getVdsGroup().getCompatibilityVersion(); List<GraphicsType> templateGraphics = VmDeviceUtils.getGraphicsTypesOfEntity(getVmTemplateId()); if (!VmValidationUtils.isGraphicsAndDisplaySupported(osId, clusterVersion, templateGraphics, defaultDisplayType)) { GraphicsType defaultGraphicsType = null; List<Pair<GraphicsType, DisplayType>> pairs = osRepository.getGraphicsAndDisplays(osId, clusterVersion); for (Pair<GraphicsType, DisplayType> pair : pairs) { if (pair.getSecond().equals(defaultDisplayType)) { defaultGraphicsType = pair.getFirst(); break; } } if (defaultGraphicsType != null) { VmDeviceType vmDisplayType = defaultDisplayType.getDefaultVmDeviceType(); GraphicsDevice defaultGraphicsDevice = new GraphicsDevice(vmDisplayType); getParameters().getGraphicsDevices().put(defaultGraphicsType, defaultGraphicsDevice); } } } }
Source:
<code><START> public AbstractCursorWrappingIndexHits( int size, float score ) <END> { this.size = size; this.score = score; }</code><technical_language>public</technical_language>

Target:
AbstractCursorWrappingIndexHits( int size, float score ) { this.size = size; this.score = score; }
Source:
<code>public Optional<RevCommit> areAllReachable(Collection<RevCommit> targets, Collection<RevCommit> starters) throws MissingObjectException, IncorrectObjectTypeException, IOException { walk.reset(); <START> walk.setRetainBody(false); <END> if (topoSort) { walk.sort(RevSort.TOPO); } for (RevCommit target: targets) { walk.markStart(target); } for (RevCommit starter : starters) { walk.markUninteresting(starter); } return Optional.ofNullable(walk.next()); }</code><technical_language>reason ReachabilityChecker supports reusing existing RevWalk (instead of maintaining own), presumably, is save object parsing. I flexible if set this - caller setting if want it</technical_language>

Target:
public Optional<RevCommit> areAllReachable(Collection<RevCommit> targets, Collection<RevCommit> starters) throws MissingObjectException, IncorrectObjectTypeException, IOException { walk.reset(); if (topoSort) { walk.sort(RevSort.TOPO); } for (RevCommit target: targets) { walk.markStart(target); } for (RevCommit starter : starters) { walk.markUninteresting(starter); } return Optional.ofNullable(walk.next()); }
Source:
<code>public void onInstanceConfigChange(List<InstanceConfig> configs, NotificationContext changeContext) { logger.trace("InstanceConfig change triggered in with: {}", dcName, configs); synchronized (notificationLock) { if (!instanceConfigInitialized.get()) { logger.info("Received initial notification for instance config change from {}", dcName); try { initializeInstances(configs); } catch (Exception e) { initializationException.compareAndSet(null, e); } instanceConfigInitialized.set(true); } else if (!clusterMapConfig.clusterMapEnablePartitionOverride) { <START> updateSealedStateOfReplicas(configs); <END> } sealedStateChangeCounter.incrementAndGet(); helixClusterManagerMetrics.instanceConfigChangeTriggerCount.inc(); } }</code><technical_language>other PR a change this function (to account for stopped replicas too) - this change in if hold? (I should)</technical_language>

Target:
public void onInstanceConfigChange(List<InstanceConfig> configs, NotificationContext changeContext) { logger.trace("InstanceConfig change triggered in with: {}", dcName, configs); synchronized (notificationLock) { if (!instanceConfigInitialized.get()) { logger.info("Received initial notification for instance config change from {}", dcName); try { initializeInstances(configs); } catch (Exception e) { initializationException.compareAndSet(null, e); } instanceConfigInitialized.set(true); } else { updateStateOfReplicas(configs); } sealedStateChangeCounter.incrementAndGet(); helixClusterManagerMetrics.instanceConfigChangeTriggerCount.inc(); } }
Source:
<code>private String confirmTarget(IProgressMonitor monitor) { <START> if (target == null) <END> return null; Optional<Repository> invalidRepo = Stream.of(repositories) .filter(r -> !r.getRepositoryState().canCheckout()) .findFirst(); if (invalidRepo.isPresent()) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { showRepositoryInInvalidStateForCheckout(invalidRepo.get()); } }); return null; } Collection<Repository> repos = Arrays.asList(repositories); if (LaunchFinder.shouldCancelBecauseOfRunningLaunches(repos, monitor)) { return null; } askForTargetIfNecessary(); return target; }</code><technical_language>Missing {}</technical_language>

Target:
private String confirmTarget(IProgressMonitor monitor) { if (target == null) { return null; } Optional<Repository> invalidRepo = Stream.of(repositories) .filter(r -> !r.getRepositoryState().canCheckout()) .findFirst(); if (invalidRepo.isPresent()) { PlatformUI.getWorkbench().getDisplay() .asyncExec(() -> showRepositoryInInvalidStateForCheckout( invalidRepo.get())); return null; } Collection<Repository> repos = Arrays.asList(repositories); if (LaunchFinder.shouldCancelBecauseOfRunningLaunches(repos, monitor)) { return null; } askForTargetIfNecessary(); return target; }
Source:
<code>public void consumeWork() { long workConsumed = m_workConsumed.incrementAndGet(); <START> if (m_doneProducing && m_workProduced == workConsumed) { <END> synchronized (this) { notify(); } } }</code><technical_language>if (m_doneProducing && m_workConsumed.incrementAndGet() == workConsumer) need for local variable</technical_language>

Target:
public void consumeWork() { m_workConsumed.increment(); }
Source:
<code>protected void doExecute(Task task, BulkRequest bulkRequest, ActionListener<BulkResponse> listener) { long indexingBytes = DocWriteRequest.writeSizeInBytes(bulkRequest.requests.stream()); final Releasable releasable = writeMemoryLimits.markCoordinatingOperationStarted(indexingBytes); final ActionListener<BulkResponse> releasingListener = ActionListener.runAfter(listener, releasable::close); <START> threadPool.executor(ThreadPool.Names.WRITE).execute(new ActionRunnable<>(releasingListener) { <END> @Override protected void doRun() { doDispatchedExecute(task, bulkRequest, releasingListener); } }); }</code><technical_language>worth noting for users of REST API (including client beats, logstash, etc.) a chance get a ESRejectedExecution full bulk level, bulk shard item level. need double-check this is properly handled. wondering if want fork write thread pool this point, want executing http thread (as to) transport thread (as to). Finally, threadpool change in IngestService.executeBulkRequest is longer necessary if this change here, write thread pool</technical_language>

Target:
protected void doExecute(Task task, BulkRequest bulkRequest, ActionListener<BulkResponse> listener) { long indexingBytes = DocWriteRequest.writeSizeInBytes(bulkRequest.requests.stream()); final Releasable releasable = writeMemoryLimits.markCoordinatingOperationStarted(indexingBytes); final ActionListener<BulkResponse> releasingListener = ActionListener.runBefore(listener, releasable::close); try { doInternalExecute(task, bulkRequest, releasingListener); } catch (Exception e) { releasingListener.onFailure(e); } }
Source:
<code>public void verify() { for (int k = 0; k < maxAccounts; k++) { ILock lock = targetInstance.getLock(basename + k); assertFalse(basename + ": Lock should be unlocked", lock.isLocked()); } long totalValue = 0; IList<Long> accounts = targetInstance.getList(basename); for (long value : accounts) { totalValue += value; } log.info(basename + ": totalValue=" + totalValue); assertEquals(basename+" totalInitalValue != totalValue ", totalInitalValue, totalValue); long totalExceptions=0; IList<Long> exceptionCount = targetInstance.getList(basename+"exceptions"); for (long count : exceptionCount) { totalExceptions += count; } <START> log.info(basename + ": total exceptions " + totalExceptions); <END> }</code><technical_language>this assert a log message? do expect InterruptedException thrown a normal run</technical_language>

Target:
public void verify() { for (int k = 0; k < maxAccounts; k++) { ILock lock = targetInstance.getLock(basename + k); assertFalse(id + " Lock should be unlocked", lock.isLocked()); } long totalValue = 0; IList<Long> accounts = targetInstance.getList(basename); for (long value : accounts) { totalValue += value; } log.info(": totalValue=" + totalValue); assertEquals(id + " totalInitalValue != totalValue ", totalInitalValue, totalValue); Counter total = new Counter(); IList<Counter> totals = targetInstance.getList(basename+"count"); for (Counter count : totals) { total.add(count); } log.info(" total count " + total); }
Source:
<code>private void getBuilderFromJsonAttribute( String nodeName, JsonNode node, JsonBuilder currentBuilder) { String strNode = node.asText(); String filter = null; if (strNode.contains(FILTERKEY)) { <START> String[] arrNode = strNode.split(","); <END> strNode = arrNode[1]; filter = arrNode[0]; filter = filter.replace("$filter{", "").replace("}", ""); } if (node.toString().contains(EXPRSTART) && !node.asText().equals("FeatureCollection")) { DynamicValueBuilder dynamicBuilder = new DynamicValueBuilder(nodeName, strNode, namespaces); if (filter != null) { setFilterToBuilder(dynamicBuilder, filter); } currentBuilder.addChild(dynamicBuilder); } else { StaticBuilder staticBuilder; if (filter != null) { staticBuilder = new StaticBuilder(nodeName, strNode, namespaces); setFilterToBuilder(staticBuilder, filter); } else { staticBuilder = new StaticBuilder(nodeName, node, namespaces); } currentBuilder.addChild(staticBuilder); } }</code><technical_language>if filter contains a comma? (a CQL filter a "in" operator it, a string literal it)</technical_language>

Target:
private void getBuilderFromJsonAttribute( String nodeName, JsonNode node, JsonBuilder currentBuilder) { String strNode = node.asText(); String filter = null; if (strNode.contains(FILTERKEY)) { strNode = strNode.replace(FILTERKEY + "{", ""); int sepIndex = strNode.indexOf('}') + 1; String sep = String.valueOf(strNode.charAt(sepIndex)); String[] arrNode = strNode.split(sep); strNode = arrNode[1]; filter = arrNode[0]; filter = filter.substring(0, filter.length() - 1); } if (node.toString().contains(EXPRSTART) && !node.asText().equals("FeatureCollection")) { DynamicValueBuilder dynamicBuilder = new DynamicValueBuilder(nodeName, strNode, namespaces); if (filter != null) { setFilterToBuilder(dynamicBuilder, filter); } currentBuilder.addChild(dynamicBuilder); } else { StaticBuilder staticBuilder; if (filter != null) { staticBuilder = new StaticBuilder(nodeName, strNode, namespaces); setFilterToBuilder(staticBuilder, filter); } else { staticBuilder = new StaticBuilder(nodeName, node, namespaces); } currentBuilder.addChild(staticBuilder); } }
Source:
<code>public boolean evaluate( String ip, String xForwardedFor, String uriHost, String uriPath, String httpStatus ) { LegacyPageview legacy_pageview_inst = LegacyPageview.getInstance(); <START> return legacy_pageview_inst.isLegacyPageview( <END> ip, xForwardedFor, uriHost, uriPath, httpStatus ); }</code><technical_language>mmm...legacyPageviewDefinition</technical_language>

Target:
public boolean evaluate( String ip, String xForwardedFor, String uriHost, String uriPath, String httpStatus ) { LegacyPageviewDefinition legacyPageviewDefinitionInstance = LegacyPageviewDefinition.getInstance(); return legacyPageviewDefinitionInstance.isLegacyPageview( ip, xForwardedFor, uriHost, uriPath, httpStatus ); }
Source:
<code>public static boolean isSupported(AST ast, int nodeType) { switch (nodeType) { case ASTNode.SWITCH_EXPRESSION: case ASTNode.YIELD_STATEMENT: <START> if (ast.apiLevel() < AST.JLS14_INTERNAL) { <END> return false; } break; case ASTNode.TEXT_BLOCK: return ast.isPreviewEnabled(); } return true; }</code><technical_language>Another nitpick :) this replaced return ast.apiLevel() >= AST.JLS14_INTERNAL</technical_language>

Target:
public static boolean isSupported(AST ast, int nodeType) { switch (nodeType) { case ASTNode.SWITCH_EXPRESSION: case ASTNode.YIELD_STATEMENT: return ast.apiLevel() >= AST.JLS14_INTERNAL; case ASTNode.TEXT_BLOCK: return ast.isPreviewEnabled(); } return true; }
Source:
<code>private void populate(List<EngineSetting> engineSettings) { final VBox displayPane = new VBox(); final Text title = new TextWithStyle(tr("Display settings"), TITLE_CSS_CLASS); displayPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS); displayPane.getChildren().add(title); final GridPane displayContentPane = new GridPane(); displayContentPane.getStyleClass().add("grid"); int row = 0; for (EngineSetting setting : engineSettings) { final ComboBox<String> comboBox = new ComboBox<>(); comboBox.setMaxWidth(Double.MAX_VALUE); <START> comboBox.setValue(setting.getCurrentOption()); <END> comboBox.valueProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> { setting.setOption(this.container.getName(), newValue); this.unlockAll(); })); ObservableList<String> items = FXCollections.observableArrayList(setting.getOptions()); comboBox.setItems(items); displayContentPane.add(new TextWithStyle(setting.getText(), CAPTION_TITLE_CSS_CLASS), 0, 0); displayContentPane.add(comboBox, 1, row); lockableElements.add(comboBox); ++row; } Region spacer = new Region(); GridPane.setHgrow(spacer, Priority.ALWAYS); displayContentPane.add(spacer, 2, 0); displayPane.getChildren().addAll(displayContentPane); this.setContent(displayPane); }</code><technical_language>If want tr() here. question is do collect options translation related files</technical_language>

Target:
private void populate(List<EngineSetting> engineSettings) { final VBox displayPane = new VBox(); displayPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS); final GridPane displayContentPane = new GridPane(); displayContentPane.getStyleClass().add("grid"); int row = 0; for (EngineSetting setting : engineSettings) { final ComboBox<String> comboBox = new ComboBox<>(); comboBox.setMaxWidth(Double.MAX_VALUE); ObservableList<String> items = FXCollections.observableArrayList(setting.getOptions()); comboBox.setItems(items); comboBox.setValue(setting.getCurrentOption(this.container.getName())); comboBox.valueProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> { this.lockAll(); setting.setOption(this.container.getName(), items.indexOf(newValue)); this.unlockAll(); })); displayContentPane.add(new TextWithStyle(setting.getText(), CAPTION_TITLE_CSS_CLASS), 0, row); displayContentPane.add(comboBox, 1, row); lockableElements.add(comboBox); ++row; } Region spacer = new Region(); GridPane.setHgrow(spacer, Priority.ALWAYS); displayContentPane.add(spacer, 2, 0); displayPane.getChildren().addAll(displayContentPane); this.setContent(displayPane); }
Source:
<code>public GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId) throws IOException { GoogleCloudStorageItemInfo item = cache.getItem(resourceId); if (item == null && resourceId.isStorageObject() && !resourceId.isDirectory() && cache.getItem(resourceId.toDirectoryId()) != null) { return GoogleCloudStorageItemInfo.createNotFound(resourceId); } if (item == null && resourceId.isStorageObject()) { String bucketName = resourceId.getBucketName(); String objectName = resourceId.getObjectName(); int lastDelimiterIndex = objectName.lastIndexOf(PATH_DELIMITER); String directoryName = lastDelimiterIndex >= 0 ? objectName.substring(0, lastDelimiterIndex + 1) : null; if (!cache.isPrefixCached( directoryName == null ? new StorageResourceId(bucketName) : new StorageResourceId(bucketName, directoryName))) { listObjectInfoPage( bucketName, directoryName, ListObjectOptions.DEFAULT, null); item = cache.getItem(resourceId); <START> if (item == null <END> && !resourceId.isDirectory() && cache.getItem(resourceId.toDirectoryId()) != null) { return GoogleCloudStorageItemInfo.createNotFound(resourceId); } } } if (item == null) { item = super.getItemInfo(resourceId); cache.putItem(item); } return item; }</code><technical_language>Is put this check in null check underneath? a clear picture of cases covered checks in place</technical_language>

Target:
public GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId) throws IOException { GoogleCloudStorageItemInfo item = cache.getItem(resourceId); if (item == null && resourceId.isStorageObject() && !resourceId.isDirectory() && cache.getItem(resourceId.toDirectoryId()) != null) { return GoogleCloudStorageItemInfo.createNotFound(resourceId); } if (item == null && resourceId.isStorageObject()) { String bucketName = resourceId.getBucketName(); String objectName = resourceId.getObjectName(); int lastDelimiterIndex = objectName.lastIndexOf(PATH_DELIMITER); String directoryName = lastDelimiterIndex >= 0 ? objectName.substring(0, lastDelimiterIndex + 1) : null; if (!cache.isPrefixCached( directoryName == null ? new StorageResourceId(bucketName) : new StorageResourceId(bucketName, directoryName))) { listObjectInfoPage( bucketName, directoryName, ListObjectOptions.DEFAULT, null); item = cache.getItem(resourceId); } } if (item == null && !resourceId.isDirectory() && cache.getItem(resourceId.toDirectoryId()) != null) { return GoogleCloudStorageItemInfo.createNotFound(resourceId); } if (item == null) { item = super.getItemInfo(resourceId); cache.putItem(item); } return item; }
Source:
<code>public InputStream lookupFileStrict(URI uri, ClassLoader cl) throws FileNotFoundException { String scheme = uri.getScheme(); switch (scheme) { case "jar": case "file": String uriAsString = uri.toString(); String fileName = uriAsString.substring(uriAsString.lastIndexOf(":") + 1); <START> return new FileInputStream(new File(fileName)); <END> default: InputStream streamToBeReturned = getAsInputStreamFromClassLoader(uri.toString(), cl); if(streamToBeReturned == null) { throw log.unableToLoadFileUsingScheme(scheme); } return streamToBeReturned; } }</code><technical_language>prefer treat differently: 'jar' scheme special syntax, avoid attempting collapse parsing logic. case "file": return new FileInputStream(new File(uri.getPath())); case "jar": String path = uri.getPath(); return new FileInputStream(new File(path.substring(path.indexOf(':')+1)));</technical_language>

Target:
public InputStream lookupFileStrict(URI uri, ClassLoader cl) throws FileNotFoundException { String scheme = uri.getScheme(); switch (scheme) { case "file": return new FileInputStream(new File(uri.getPath())); case "jar": String uriAsString = uri.toString(); String fileName = uriAsString.substring(uriAsString.lastIndexOf(":") + 1); return new FileInputStream(new File(fileName)); default: InputStream streamToBeReturned = getAsInputStreamFromClassLoader(uri.toString(), cl); if(streamToBeReturned == null) { throw log.unableToLoadFileUsingScheme(scheme); } return streamToBeReturned; } }
Source:
<code>public boolean isPublisherTraceEnabled(String eventPublisherName) { EventPublisherService eventPublisherService = EventPublisherAdminServiceValueHolder.getEventPublisherService(); List<EventPublisherConfiguration> eventPublisherConfigurationList = null; <START> boolean isTraceEnabled = true; <END> try { eventPublisherConfigurationList = eventPublisherService.getAllActiveEventPublisherConfigurations(); Iterator eventReceiverConfigurationIterator = eventPublisherConfigurationList.iterator(); while (eventReceiverConfigurationIterator.hasNext()) { EventPublisherConfiguration eventPublisherConfiguration = (EventPublisherConfiguration) eventReceiverConfigurationIterator.next(); if (eventPublisherConfiguration.getEventPublisherName().equalsIgnoreCase(eventPublisherName)) { isTraceEnabled = eventPublisherConfiguration.isTracingEnabled(); } } } catch (EventPublisherConfigurationException e) { log.error(e.getMessage(), e); } return isTraceEnabled; }</code><technical_language>Fix this</technical_language>

Target:
public boolean isPublisherTraceEnabled(String eventPublisherName) { EventPublisherService eventPublisherService = EventPublisherAdminServiceValueHolder.getEventPublisherService(); List<EventPublisherConfiguration> eventPublisherConfigurationList = null; boolean isTraceEnabled = false; try { eventPublisherConfigurationList = eventPublisherService.getAllActiveEventPublisherConfigurations(); Iterator eventReceiverConfigurationIterator = eventPublisherConfigurationList.iterator(); while (eventReceiverConfigurationIterator.hasNext()) { EventPublisherConfiguration eventPublisherConfiguration = (EventPublisherConfiguration) eventReceiverConfigurationIterator.next(); if (eventPublisherConfiguration.getEventPublisherName().equalsIgnoreCase(eventPublisherName)) { isTraceEnabled = eventPublisherConfiguration.isTracingEnabled(); } } } catch (EventPublisherConfigurationException e) { log.error(e.getMessage(), e); } return isTraceEnabled; }
Source:
<code>public @NonNull String getName() { <START> return "Event Context"; <END> }</code><technical_language>externalized</technical_language>

Target:
public @NonNull String getName() { return Messages.getMessage(Messages.CtfEventContextAspect_name); }
Source:
<code>private void updateAssignment() { this.acknowlegmentHandler.addPartitions(kafkaConsumer.assignment()); for (TopicPartition partition : kafkaConsumer.assignment()) { this.flowControl.merge(partition, new AtomicInteger(), <START> (oldValue, newValue) -> oldValue == null ? newValue : oldValue); <END> } }</code><technical_language>oldValue null; merge function called. So, a putIfAbsent</technical_language>

Target:
private void updateAssignment() { acknowledgmentHandler.addPartitions(kafkaConsumer.assignment()); for (TopicPartition partition : kafkaConsumer.assignment()) { this.flowControl.merge(partition, new AtomicInteger(), (oldValue, newValue) -> oldValue == null ? newValue : oldValue); } }
Source:
<code>public Media getItemAtPosition(int i) { <START> if (i == -1 || contributionList == null || contributionList.size() < i+1) { <END> return null; } return contributionList.get(i); }</code><technical_language>contributionList null</technical_language>

Target:
public Media getItemAtPosition(int i) { if (i == -1 || contributionList.size() < i+1) { return null; } return contributionList.get(i); }
Source:
<code>public Stream<Arguments> provideArguments(ExtensionContext context) { Class<?> testClass = context.getRequiredTestClass(); Object testInstance = context.getTestInstance().orElse(null); return Arrays.stream(methodNames) .filter(Objects::nonNull) <START> .map(methodName -> methodName.isEmpty() && context.getTestMethod().isPresent() ? context.getRequiredTestMethod().getName() : methodName) <END> .map(methodName -> ReflectionUtils.findMethod(testClass, methodName) .orElseThrow(() -> new JUnitException("Could not find method on " + testClass + ": " + methodName))) .map(method -> ReflectionUtils.invokeMethod(method, testInstance)) .flatMap(CollectionUtils::toStream) .map(MethodArgumentsProvider::toArguments); }</code><technical_language>circumstances test method _present_</technical_language>

Target:
public Stream<Arguments> provideArguments(ExtensionContext context) { Class<?> testClass = context.getRequiredTestClass(); Object testInstance = context.getTestInstance().orElse(null); return Arrays.stream(methodNames) .map(methodName -> methodName.isEmpty() && context.getTestMethod().isPresent() ? context.getRequiredTestMethod().getName() : methodName) .map(methodName -> ReflectionUtils.findMethod(testClass, methodName) .orElseThrow(() -> new JUnitException("Could not find method on " + testClass + ": " + methodName))) .map(method -> ReflectionUtils.invokeMethod(method, testInstance)) .flatMap(CollectionUtils::toStream) .map(MethodArgumentsProvider::toArguments); }
Source:
<code>protected ReplayFile call() throws Exception { LOG.info("Uploading replay " + take); providers.forEach(provider -> { final StormParser parser = new StormParser(take.getFile()); Replay replay = null; Status preStatus; try { replay = parser.parseReplay(); preStatus = provider.getPreStatus(replay); } catch (MpqException e) { LOG.warn("Could not parse replay, deferring to upload." + take, e); preStatus = Status.EXCEPTION; } if (preStatus == Status.UPLOADED || preStatus == Status.UNSUPPORTED_GAME_MODE || <START> preStatus == Status.EXCEPTION) { <END> LOG.info("Parsed preStatus reported no need to upload " + take.getFile() + " for provider " + provider.getName()); applyStatus(provider, preStatus); } else { final Status upload = provider.upload(take); if (upload == null) { throw new RuntimeException("Failed"); } applyStatus(provider, upload); } succeeded(); }); return take; }</code><technical_language>upload games, if failed parse well</technical_language>

Target:
protected ReplayFile call() throws Exception { LOG.info("Uploading replay " + take); providers.forEach(provider -> { final StormParser parser = new StormParser(take.getFile()); Replay replay = null; Status preStatus; try { replay = parser.parseReplay(); preStatus = provider.getPreStatus(replay); } catch (MpqException e) { LOG.warn("Could not parse replay, deferring to upload." + take, e); preStatus = Status.EXCEPTION; } if (preStatus == Status.UPLOADED || preStatus == Status.UNSUPPORTED_GAME_MODE) { LOG.info("Parsed preStatus reported no need to upload " + take.getFile() + " for provider " + provider.getName()); applyStatus(provider, preStatus); } else { final Status upload = provider.upload(take); if (upload == null) { throw new RuntimeException("Failed"); } applyStatus(provider, upload); } succeeded(); }); return take; }
Source:
<code>public ResultScanner getScanner(final Scan scan) throws IOException { if (scan.getStartRow() != null && scan.getStartRow().length > 0 && scan.getStopRow() != null && scan.getStopRow().length > 0 && Bytes.compareTo(scan.getStartRow(), scan.getStopRow()) > 0) { throw new IOException("StopRow needs to be greater than StartRow"); } final SettableFuture<Long> future = SettableFuture.create(); final RegionSpecifier regionSpecifier = new RegionSpecifier(RegionSpecifier.RegionSpecifierType.REGION_NAME, getRegion(scan.getStartRow())); final ScanRequest scanRequest = new ScanRequest(regionSpecifier, ProtobufUtil.toScan(scan), 0L, C5Constants.DEFAULT_INIT_SCAN, false, 0L); try { handler.call(ProtobufUtil.getScanCall(commandId.incrementAndGet(), scanRequest), future, channel); <START> final Long scannerId = future.get(C5Constants.TIMEOUT, TimeUnit.MILLISECONDS); <END> return clientScannerManager.get(scannerId); } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new IOException(e); } }</code><technical_language>In context affect anything, this a primitive long</technical_language>

Target:
public ResultScanner getScanner(final Scan scan) throws IOException { if (scan.getStartRow() != null && scan.getStartRow().length > 0 && scan.getStopRow() != null && scan.getStopRow().length > 0 && Bytes.compareTo(scan.getStartRow(), scan.getStopRow()) > 0) { throw new IOException("StopRow needs to be greater than StartRow"); } final SettableFuture<Long> future = SettableFuture.create(); final RegionSpecifier regionSpecifier = new RegionSpecifier(RegionSpecifier.RegionSpecifierType.REGION_NAME, getRegion(scan.getStartRow())); final ScanRequest scanRequest = new ScanRequest(regionSpecifier, ProtobufUtil.toScan(scan), 0L, C5Constants.DEFAULT_INIT_SCAN, false, 0L); try { handler.callScan(ProtobufUtil.getScanCall(commandId.incrementAndGet(), scanRequest), future, channel); final long scannerId = future.get(C5Constants.TIMEOUT, TimeUnit.MILLISECONDS); return clientScannerManager.get(scannerId); } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new IOException(e); } }
Source:
<code>private void atomicWriteToFile(String content, File file) throws IOException { File directory = file.getParentFile(); File tempFile = File.createTempFile(file.getName(), null, directory); FileOutputStream out = new FileOutputStream(tempFile); try { IOUtils.write(content, out); } catch (IOException iox) { <START> if (out != null) out.close(); <END> tempFile.delete(); throw iox; } out.close(); FileSystem defaultFileSystem = FileSystems.getDefault(); Path tempFilePath = defaultFileSystem.getPath(tempFile.getCanonicalPath()); Path destinationFilePath = defaultFileSystem.getPath(file.getCanonicalPath()); try { Files.move(tempFilePath, destinationFilePath, StandardCopyOption.ATOMIC_MOVE); } catch (IOException iox) { tempFile.delete(); throw iox; } }</code><technical_language>out null is created out of try catch block</technical_language>

Target:
private void atomicWriteToFile(String content, File file) throws IOException { File directory = file.getParentFile(); File tempFile = File.createTempFile(file.getName(), null, directory); FileOutputStream out = new FileOutputStream(tempFile); try { IOUtils.write(content, out); } catch (IOException iox) { if (!tempFile.delete()) { tempFile.deleteOnExit(); } throw iox; } out.close(); FileSystem defaultFileSystem = FileSystems.getDefault(); Path tempFilePath = defaultFileSystem.getPath(tempFile.getCanonicalPath()); Path destinationFilePath = defaultFileSystem.getPath(file.getCanonicalPath()); try { Files.move(tempFilePath, destinationFilePath, StandardCopyOption.ATOMIC_MOVE); } catch (IOException iox) { if (!tempFile.delete()) { tempFile.deleteOnExit(); } throw iox; } }
Source:
<code><START> public BlockFormEvent callEvent(@Nonnull Block block) { BlockState state = PaperLib.getBlockState(block, false).getState(); BlockFormEvent event = new BlockFormEvent(block, state); Bukkit.getPluginManager().callEvent(event); return event; } <END></code><technical_language>Public method Validate#notNull here? I this wrong xD</technical_language>

Target:
public BlockFormEvent callEvent(@Nonnull Block block) { Validate.notNull(block, "The Block cannot be null!"); BlockState state = PaperLib.getBlockState(block, false).getState(); BlockFormEvent event = new BlockFormEvent(block, state); Bukkit.getPluginManager().callEvent(event); return event; }
Source:
<code>public static void testAvgDur1(APMLog apmLog, APMLogUnitTest parent) throws UnsupportedEncodingException { APMLogFilter apmLogFilter = new APMLogFilter(apmLog); PLog pLog = apmLogFilter.getPLog(); pLog.updateStats(); DurSubGraph subGraph = pLog.getAttributeGraph().getNextValueDurations("concept:name", "A"); DoubleArrayList durList = subGraph.getValDurListMap().get("A"); double avg = getAverage(durList); <START> double twoHours = 1000 * 60 * 60 * 2d; if (avg != twoHours) { throw new AssertionError("TEST FAILED. RESULT MISMATCH.\n expected value=" + twoHours + "; output value=" + avg); } else { parent.printString("'Attribute arc duration (4) - Average duration' test PASS.\n"); } <END> }</code><technical_language>JUnit assertion methods simplify test code this, like: import static org.junit.Assert.assertEquals; assertEquals(1000 * 60 * 60 * 2d, getAverage(durList));</technical_language>

Target:
public static void testAvgDur1(APMLog apmLog, APMLogUnitTest parent) throws UnsupportedEncodingException { APMLogFilter apmLogFilter = new APMLogFilter(apmLog); PLog pLog = apmLogFilter.getPLog(); pLog.updateStats(); DurSubGraph subGraph = pLog.getAttributeGraph().getNextValueDurations("concept:name", "A"); DoubleArrayList durList = subGraph.getValDurListMap().get("A"); assertEquals(1000 * 60 * 60 * 2d, durList.average(), 0 ); }
Source:
<code>public ValueType typeCheck(TypeContext ctx) { <START> if (settingDynamicObject(ctx)) return Util.dynType(); <END> StructuralType varTypeStructural = objectExpr.typeCheck(ctx).getStructuralType(ctx); ValueType varTypeExpr = exprToAssign.typeCheck(ctx); DeclType declTypeField = varTypeStructural.findDecl(fieldName, ctx); if (declTypeField == null) ToolError.reportError(ErrorMessage.NO_SUCH_FIELD, this, fieldName); if (!(declTypeField instanceof VarDeclType)) ToolError.reportError(ErrorMessage.CANNOT_BE_ASSIGNED, this, declTypeField.getName()); ValueType valTypeField = ((VarDeclType) declTypeField).getResultType(View.from(objectExpr, ctx)); if (!varTypeExpr.isSubtypeOf(valTypeField, ctx)) ToolError.reportError(ErrorMessage.ASSIGNMENT_SUBTYPING, this); return Util.unitType(); }</code><technical_language>right-hand side a type (it time, a type error)</technical_language>

Target:
public ValueType typeCheck(TypeContext ctx) { if (settingDynamicObject(ctx)) { exprToAssign.typeCheck(ctx); return Util.dynType(); } StructuralType varTypeStructural = objectExpr.typeCheck(ctx).getStructuralType(ctx); ValueType varTypeExpr = exprToAssign.typeCheck(ctx); DeclType declTypeField = varTypeStructural.findDecl(fieldName, ctx); if (declTypeField == null) ToolError.reportError(ErrorMessage.NO_SUCH_FIELD, this, fieldName); if (!(declTypeField instanceof VarDeclType)) ToolError.reportError(ErrorMessage.CANNOT_BE_ASSIGNED, this, declTypeField.getName()); ValueType valTypeField = ((VarDeclType) declTypeField).getResultType(View.from(objectExpr, ctx)); if (!varTypeExpr.isSubtypeOf(valTypeField, ctx)) ToolError.reportError(ErrorMessage.ASSIGNMENT_SUBTYPING, this); return Util.unitType(); }
Source:
<code>public String getUserIDFromUserName(String userName) throws UserStoreException { String userID; UserStore userStore = getUserStore(userName); if (userStore.isRecurssive()) { return ((AbstractUserStoreManager) userStore.getUserStoreManager()) .getUserIDFromUserName(userStore.getDomainFreeName()); } if (isUniqueUserIdEnabledInUserStore(userStore)) { userID = AbstractUserStoreManagerCache.getInstance().getValueFromCache(userName, RESOLVE_USER_ID_FROM_USER_NAME_CACHE_NAME); if (StringUtils.isEmpty(userID)){ return doGetUserIDFromUserNameWithID(userStore.getDomainFreeName()); } else { <START> AbstractUserStoreManagerCache.getInstance().addToCache(userName, userID, <END> RESOLVE_USER_ID_FROM_USER_NAME_CACHE_NAME); } } Map<String, String> claims = doGetUserClaimValues(userName, new String[]{UserCoreClaimConstants.USER_ID_CLAIM_URI}, userStore.getDomainName(), null); if (claims != null && claims.size() == 1) { userID = AbstractUserStoreManagerCache.getInstance().getValueFromCache(userName, RESOLVE_USER_NAME_FROM_USER_ID_CACHE_NAME); if (StringUtils.isEmpty(userID)) { return claims.get(UserCoreClaimConstants.USER_ID_CLAIM_URI); } else { AbstractUserStoreManagerCache.getInstance().addToCache(userName, userID, RESOLVE_USER_ID_FROM_USER_NAME_CACHE_NAME); } } return null; }</code><technical_language>this is in else statement? add cache DB</technical_language>

Target:
public String getUserIDFromUserName(String userName) throws UserStoreException { UserStore userStore = getUserStore(userName); if (userStore.isRecurssive()) { return ((AbstractUserStoreManager) userStore.getUserStoreManager()) .getUserIDFromUserName(userStore.getDomainFreeName()); } String userID = getFromUserIDCache(userName, userStore); if (StringUtils.isEmpty(userID)) { if (isUniqueUserIdEnabledInUserStore(userStore)) { userID = doGetUserIDFromUserNameWithID(userName); addToUserIDCache(userID, userName, userStore); addToUserNameCache(userID, userName, userStore); return userID; } Map<String, String> claims = doGetUserClaimValues(userName, new String[]{UserCoreClaimConstants.USER_ID_CLAIM_URI}, userStore.getDomainName(), null); if (claims != null && claims.size() == 1) { userID = claims.get(UserCoreClaimConstants.USER_ID_CLAIM_URI); addToUserIDCache(userID, userName, userStore); addToUserNameCache(userID, userName, userStore); return userID; } } return userID; }
Source:
<code>public Translation getTranslation() { <START> return null; END> }</code><technical_language>Yeah I noticed is translation for this, removed in bleeding branch in SpongeAPI (<LINK_0> this throw UnsupportedOperationException for</technical_language>

Target:
public Translation getTranslation() { throw new UnsupportedOperationException("No translation is present for this catalog type (this method will be removed in a later release of SpongeAPI)"); }
Source:
<code>private static boolean shouldServiceVersionBeTested(CryptographyServiceVersion serviceVersion) { if (Configuration.getGlobalConfiguration().get(AZURE_TEST_SERVICE_VERSIONS) == null) { return CryptographyServiceVersion.getLatest().equals(serviceVersion); } <START> return true; <END> }</code><technical_language>Check env variable returning true</technical_language>

Target:
private static boolean shouldServiceVersionBeTested(CryptographyServiceVersion serviceVersion) { if (CoreUtils.isNullOrEmpty(SERVICE_VERSION_FROM_ENV)) { return CryptographyServiceVersion.getLatest().equals(serviceVersion); } if (AZURE_TEST_SERVICE_VERSIONS_VALUE_ALL.equalsIgnoreCase(SERVICE_VERSION_FROM_ENV)) { return true; } String[] configuredServiceVersionList = SERVICE_VERSION_FROM_ENV.split(","); return Arrays.stream(configuredServiceVersionList).anyMatch(configuredServiceVersion -> serviceVersion.toString().equals(configuredServiceVersion.trim())); }
Source:
<code>public int fileOrderCompare(final SAMRecord samRecord1, final SAMRecord samRecord2) { if (null == samRecord1.getHeader() || null == samRecord2.getHeader()) { <START> throw new IllegalArgumentException("Record must have non-null SAMFileHeaders to be comapred"); <END> } final int refIndex1 = samRecord1.getReferenceIndex(); final int refIndex2 = samRecord2.getReferenceIndex(); if (refIndex1 == -1) { return (refIndex2 == -1? 0: 1); } else if (refIndex2 == -1) { return -1; } final int cmp = refIndex1 - refIndex2; if (cmp != 0) { return cmp; } return samRecord1.getAlignmentStart() - samRecord2.getAlignmentStart(); }</code><technical_language>Record -> Records comapred -> compared</technical_language>

Target:
public int fileOrderCompare(final SAMRecord samRecord1, final SAMRecord samRecord2) { if (null == samRecord1.getHeader() || null == samRecord2.getHeader()) { throw new IllegalArgumentException("Records must have non-null SAMFileHeaders to be compared"); } final int refIndex1 = samRecord1.getReferenceIndex(); final int refIndex2 = samRecord2.getReferenceIndex(); if (refIndex1 == -1) { return (refIndex2 == -1? 0: 1); } else if (refIndex2 == -1) { return -1; } final int cmp = refIndex1 - refIndex2; if (cmp != 0) { return cmp; } return samRecord1.getAlignmentStart() - samRecord2.getAlignmentStart(); }