auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean onLongPressEvent(PointF point) { if ((Build.VERSION.SDK_INT < 14) && !view.getSettings().SCROLL_MAP_BY_GESTURES.get()) { if (!selectedObjects.isEmpty()) view.showMessage(activity.getMyApplication().getLocationProvider().getNavigationHint(latLon)); return true; } if(pressedInTextView(point.x, point.y) > 0){ setLocation(null, ""); view.refreshMap(); return true; } LatLon latLon = selectObjectsForContextMenu(point); for(OsmandMapLayer l : view.getLayers()){ if(l instanceof DistanceCalculatorLayer){ if(((DistanceCalculatorLayer) l).getDistanceMeasurementMode() > 0 && !selectedObjects.isEmpty()) return false; break; } } String description = getSelectedObjectDescription(); setLocation(latLon, description); view.refreshMap(); return true; }

Target:
public boolean onLongPressEvent(PointF point) { if ((Build.VERSION.SDK_INT < 14) && !view.getSettings().SCROLL_MAP_BY_GESTURES.get()) { if (!selectedObjects.isEmpty()) view.showMessage(activity.getMyApplication().getLocationProvider().getNavigationHint(latLon)); return true; } if(pressedInTextView(point.x, point.y) > 0){ setLocation(null, ""); view.refreshMap(); return true; } LatLon latLon = selectObjectsForContextMenu(point); String description = getSelectedObjectDescription(); setLocation(latLon, description); view.refreshMap(); return false; }
Source:
public static String fromUtf8Nullable(final ByteBuffer buffer, final int numBytes) { final byte[] bytes = new byte[numBytes]; buffer.get(bytes); return StringUtils.fromUtf8Nullable(bytes); }

Target:
public static String fromUtf8Nullable(final ByteBuffer buffer, final int numBytes) { if (numBytes < 0) { return null; } final byte[] bytes = new byte[numBytes]; buffer.get(bytes); return fromUtf8Nullable(bytes); }
Source:
private void vmUpdateStatus(final VM vm, final VM.VMStatus status, final long delay, final String msg, final boolean removeClient) throws InterruptedException { scheduledExecutorService.schedule(new Callable() { public Object call() throws Exception { try { vm.setStatus(status); sendNotification(msg, vm.getId(), removeClient); log.info("VM set to {}", vm.getId(), msg); if (isUpdateRequired(status)) { VdsmManager.getInstance().updateHost(vm.getHost()); } } catch (Exception e) { e.printStackTrace(); } return null; } }, delay, TimeUnit.MILLISECONDS); }

Target:
private void vmUpdateStatus(final VM vm, final VM.VMStatus status, final long delay, final String msg, final boolean removeClient) throws InterruptedException { scheduledExecutorService.schedule(() -> { try { vm.setStatus(status); sendNotification(msg, vm.getId(), removeClient); log.info("VM set to {}", vm.getId(), msg); if (isUpdateRequired(status)) { VdsmManager.getInstance().updateHost(vm.getHost()); } } catch (Exception e) { e.printStackTrace(); } return null; }, delay, TimeUnit.MILLISECONDS); }
Source:
public Scheduler makeDefaultScheduler() throws Exception { File configFile = new File(CONFIG_PATH); File dbFile = new File(DB_PATH); WorkflowConfiguration config = new WorkflowConfigurationParser().parseConfiguration(configFile); StateDatabase db = new FileSystemStateDatabase(dbFile); int slidingWindowHours = 24 * 7; return new Scheduler(config, db, slidingWindowHours); }

Target:
public Scheduler makeDefaultScheduler() throws Exception { File configDir = new File(WORKFLOW_CONFIGURATION_PATH); File dbDir = new File(STATE_DATABASE_PATH); WorkflowConfiguration config = new WorkflowConfigurationParser().parseConfiguration(configDir); StateDatabase db = new FileSystemStateDatabase(dbDir); int slidingWindowHours = 24 * 7; return new Scheduler(config, db, slidingWindowHours); }
Source:
protected void doExecute() { DiagramDescription diagramdesc = DescriptionFactory.eINSTANCE.createDiagramDescription(); diagramdesc.setName(BASE_ID + ".default.layer"); viewpoint.getOwnedRepresentations().add(diagramdesc); Layer layer = DescriptionFactory.eINSTANCE.createLayer(); diagramdesc.setDefaultLayer(layer); ToolSection toolSection = createToolSection(layer); ContainerMapping packageMapping = createPackageMapping(layer); NodeMapping attributes = createAttributes(toolSection); ContainerMapping classMapping = createClassListMapping(toolSection, layer, attributes); EdgeMapping edgeMappingInheritance = createEdgeMappingInheritance(toolSection, layer, classMapping); EdgeMapping edgeMappingReference = createEdgeMappingReference(toolSection, layer, classMapping); createContainerClassMapping(toolSection, classMapping); createContainerPackageMapping(toolSection, packageMapping); ArrayList<DiagramElementMapping> mappings = new ArrayList<DiagramElementMapping>(); mappings.add(classMapping); mappings.add(packageMapping); mappings.add(edgeMappingReference); mappings.add(edgeMappingInheritance); createDeleteTool(toolSection, mappings); createEditTool(toolSection, mappings); createNodeCreation(toolSection, classMapping); }

Target:
protected void doExecute() { DiagramDescription diagramdesc = DescriptionFactory.eINSTANCE.createDiagramDescription(); diagramdesc.setName(BASE_ID + ".default.layer"); viewpoint.getOwnedRepresentations().add(diagramdesc); Layer layer = DescriptionFactory.eINSTANCE.createLayer(); diagramdesc.setDefaultLayer(layer); ToolSection toolSection = createToolSection(layer); ContainerMapping packageMapping = createPackageMapping(layer, toolSection); ContainerMapping classMapping = createClassListMapping(layer, toolSection); createAttributes(classMapping, toolSection); EdgeMapping edgeMappingInheritance = createEdgeMappingInheritance(layer, toolSection, classMapping); EdgeMapping edgeMappingReference = createEdgeMappingReference(layer, toolSection, classMapping); DiagramElementMapping[] mappings = { classMapping, packageMapping, edgeMappingInheritance, edgeMappingReference }; createDeleteTool(toolSection, mappings); createEditTool(toolSection, mappings); }
Source:
private StorageType updateLUNConnectionsInfo(LUNs lun) { if (lun.getLunConnections() == null) { lun.setLunConnections(new ArrayList<storage_server_connections>(getDbFacade() .getStorageServerConnectionDao() .getAllForLun(lun.getLUN_id()))); } return lun.getLunConnections().isEmpty() ? StorageType.FCP : lun.getLunConnections().get(0).getstorage_type(); }

Target:
private void updateLUNConnectionsInfo(LUNs lun) { lun.setLunConnections(new ArrayList<storage_server_connections>(getDbFacade() .getStorageServerConnectionDao() .getAllForLun(lun.getLUN_id()))); }
Source:
public EventHubMessage(EventData eventdata, String partitionId) { this.partitionId = partitionId; if (eventdata.getBytes() != null) { content = eventdata.getBytes(); } else if (eventdata.getObject() != null) { try { content = SerializeDeserializeUtil.serialize(eventdata.getObject()); } catch (IOException e) { throw new RuntimeException(e); } } else { throw new RuntimeException("Failed to retrieve payload from EventData"); } applicationProperties = eventdata.getProperties(); EventData.SystemProperties props = eventdata.getSystemProperties(); systemProperties = props; if (systemProperties != null) { offset = props.getOffset(); partitionKey = props.getPartitionKey(); enqueuedTime = props.getEnqueuedTime(); sequenceNumber = props.getSequenceNumber(); publisher = props.getPublisher(); } else { this.offset = null; this.partitionKey = null; this.enqueuedTime = null; this.sequenceNumber = FieldConstants.DEFAULT_SEQUENCE_NUMBER; this.publisher = null; } messageId = new MessageId(partitionId, offset, sequenceNumber); }

Target:
public EventHubMessage(EventData eventdata, String partitionId) { this.partitionId = partitionId; if (eventdata.getBytes() != null) { content = eventdata.getBytes(); } else if (eventdata.getObject() != null) { try { content = SerializeDeserializeUtil.serialize(eventdata.getObject()); } catch (IOException e) { throw new RuntimeException(e); } } else { throw new RuntimeException("Failed to retrieve payload from EventData"); } applicationProperties = eventdata.getProperties(); systemProperties = eventdata.getSystemProperties(); if (eventdata.getSystemProperties() != null) { offset = eventdata.getSystemProperties().getOffset(); partitionKey = eventdata.getSystemProperties().getPartitionKey(); enqueuedTime = eventdata.getSystemProperties().getEnqueuedTime(); sequenceNumber = eventdata.getSystemProperties().getSequenceNumber(); publisher = eventdata.getSystemProperties().getPublisher(); } else { this.offset = null; this.partitionKey = null; this.enqueuedTime = null; this.sequenceNumber = FieldConstants.DEFAULT_SEQUENCE_NUMBER; this.publisher = null; } messageId = new MessageId(partitionId, offset, sequenceNumber); }
Source:
private void displayCurrent() { Element item = items.getItem(index); $(contents).children().remove(); $(contents).append(item); if (index == 0) { $(prev).addClass(sliderResources.style().disabled()); $(next).removeClass(sliderResources.style().disabled()); } else if (index == maxIndex) { $(prev).removeClass(sliderResources.style().disabled()); $(next).addClass(sliderResources.style().disabled()); } else { $(prev).removeClass(sliderResources.style().disabled()); $(next).removeClass(sliderResources.style().disabled()); } $("." + sliderResources.style().actif(), pager).removeClass(sliderResources.style().actif()); $(pager).children().eq(index).addClass(sliderResources.style().actif()); }

Target:
private void displayCurrent() { Element item = items.getItem(index); $(contents).children().remove(); $(contents).append(item); String disabled = sliderResources.style().disabled(); if (index == 0) { $(prev).addClass(disabled); $(next).removeClass(disabled); } else if (index == maxIndex) { $(prev).removeClass(disabled); $(next).addClass(disabled); } else { $(prev).removeClass(disabled); $(next).removeClass(disabled); } String active = sliderResources.style().active(); $("." + active, pager).removeClass(active); $(pager).children().eq(index).addClass(active); }
Source:
public boolean isBlacklisted(WebSocketMessageDTO message) { if (isShowJustInScope && !message.channel.isInScope()) { return true; } if (opcodeList != null) { if (!opcodeList.contains(message.opcode)) { return true; } } if (direction != null) { if (message.isOutgoing && !direction.equals(Direction.OUTGOING)) { return true; } else if (!message.isOutgoing && !direction.equals(Direction.INCOMING)) { return true; } } if(payloadFilter != null && payloadFilter.getPayloadPattern() != null){ if(message.payload instanceof String){ if(!payloadFilter.isMessageValidWithPattern(message)) { return true; } } else{ return true; } } logger.info("White Listed"); return false; }

Target:
public boolean isBlacklisted(WebSocketMessageDTO message) { if (isShowJustInScope && !message.channel.isInScope()) { return true; } if (opcodeList != null) { if (!opcodeList.contains(message.opcode)) { return true; } } if (direction != null) { if (message.isOutgoing && !direction.equals(Direction.OUTGOING)) { return true; } else if (!message.isOutgoing && !direction.equals(Direction.INCOMING)) { return true; } } if(payloadFilter != null && message.payload instanceof String && !payloadFilter.isMessageValidWithPattern(message)){ return true; } return false; }
Source:
private JComboBox createDatastoreCombobox() { final String[] comboBoxModel = CollectionUtils.array(new String[1], _datastoreCatalog.getDatastoreNames()); final JComboBox comboBox = new JComboBox<>(comboBoxModel); comboBox.setEditable(false); final JDialog parent = this; comboBox.addActionListener(e -> { try { ComboBoxUpdater comboBoxUpdater = new ComboBoxUpdater(parent); comboBoxUpdater.execute(); } catch (Exception exception) { logger.error(exception.getMessage()); } }); return comboBox; }

Target:
private JComboBox<String> createDatastoreCombobox() { final String[] comboBoxModel = CollectionUtils.array(new String[1], _datastoreCatalog.getDatastoreNames()); final JComboBox<String> comboBox = new JComboBox<>(comboBoxModel); comboBox.setEditable(false); final JDialog parent = this; comboBox.addActionListener(e -> { try { ComboBoxUpdater comboBoxUpdater = new ComboBoxUpdater(parent); comboBoxUpdater.execute(); } catch (Exception exception) { final String exceptionMessage = "An unexpected error occurred while updating combo boxes:\n" + exception.getMessage(); logger.error(exceptionMessage); WidgetUtils.showErrorMessage("Unexpected error", exceptionMessage); } }); return comboBox; }
Source:
protected void checkContainerIsRunning(String container) throws IOException, ServerException { ContainerInfo containerInfo = docker.inspectContainer(container); if ("exited".equals(containerInfo.getState().getStatus())) { throw new ServerException("We detected that machine container exited right after start. " + "It may happen in certain situations including container designed to be used " + "in interactive mode or container that require additional arguments. " + "We detect and fix some of these situations but can't cover all the cases."); } }

Target:
protected void checkContainerIsRunning(String container) throws IOException, ServerException { ContainerInfo containerInfo = docker.inspectContainer(container); if ("exited".equals(containerInfo.getState().getStatus())) { throw new ServerException(CONTAINER_EXITED_ERROR); } }
Source:
private void verifyAbcdAdIsDisplayed(AdsBaseObject ads) { ads.scrollToSlot(AdsContent.TOP_LB); Assertion.assertTrue(ads.getGptParams(AdsContent.TOP_LB, "data-gpt-line-item-id").equals("4376117186"), "TOP_LEADERBOARD slot has ABCD ad line item id 4376117186, ABCD slot should not be displayed"); Assertion.assertTrue(ads.getGptParams(AdsContent.TOP_LB, "data-slot-result").equals("success"), "ABCD slot result: success is not present"); }

Target:
private void verifyAbcdAdIsDisplayed(AdsBaseObject ads) { ads.verifyLineItemId(AdsContent.TOP_LB, ABCD_LINE_ITEM_ID); ads.verifySlotAttribute(AdsContent.TOP_LB, "data-slot-result", "success"); }
Source:
public static PropertiesConfiguration getConfig() { if (config == null) { synchronized (Config.class) { PropertiesConfiguration initialized = config; if (initialized == null) { AbstractConfiguration.setDefaultListDelimiter('&'); try { initialized = new PropertiesConfiguration(CONFIG_FILE); } catch (ConfigurationException e) { logger.warn("Loading of " + CONFIG_FILE + " failed. Trying to start with empty configuration.", e); initialized = new PropertiesConfiguration(); } initialized.setListDelimiter('&'); initialized.setReloadingStrategy(new FileChangedReloadingStrategy()); initialized.setThrowExceptionOnMissing(true); config = initialized; } } } return config; }

Target:
public static PropertiesConfiguration getConfig() { if (config == null) { synchronized (Config.class) { PropertiesConfiguration initialized = config; if (initialized == null) { PropertiesConfiguration.setDefaultListDelimiter('&'); try { initialized = new PropertiesConfiguration(CONFIG_FILE); } catch (ConfigurationException e) { logger.warn("Loading of " + CONFIG_FILE + " failed. Trying to start with empty configuration.", e); initialized = new PropertiesConfiguration(); } initialized.setListDelimiter('&'); initialized.setReloadingStrategy(new FileChangedReloadingStrategy()); config = initialized; config.setThrowExceptionOnMissing(true); } } } return config; }
Source:
synchronized public void refreshSearcherManagerMap() { ArrayList<String> toRemove = new ArrayList<>(); for (Map.Entry<String, SearcherManager> entry : searcherManagerMap.entrySet()) { if (!getProjectDescriptions().contains(entry.getKey())) { try { LOGGER.log(Level.FINE, "closing SearcherManager for project" + entry.getKey()); entry.getValue().close(); } catch (IOException ex) { LOGGER.log(Level.SEVERE, "cannot close SearcherManager for project" + entry.getKey(), ex); } toRemove.add(entry.getKey()); } } for (String proj : toRemove) { searcherManagerMap.remove(proj); } }

Target:
public void refreshSearcherManagerMap() { ArrayList<String> toRemove = new ArrayList<>(); for (Map.Entry<String, SearcherManager> entry : searcherManagerMap.entrySet()) { if (!getProjectDescriptions().contains(entry.getKey())) { try { LOGGER.log(Level.FINE, "closing SearcherManager for project" + entry.getKey()); entry.getValue().close(); } catch (IOException ex) { LOGGER.log(Level.SEVERE, "cannot close SearcherManager for project" + entry.getKey(), ex); } toRemove.add(entry.getKey()); } } for (String proj : toRemove) { searcherManagerMap.remove(proj); } }
Source:
protected boolean processCurrentFileAndExtractPdpFeedFromSAEFile(String saeFileName) { boolean success = true; LOG.debug("processCurrentFileAndExtractPdpFeedFromSAEFile, current File: " + saeFileName); try { ConcurStandardAccountingExtractFile concurStandardAccoutingExtractFile = getConcurStandardAccountingExtractService() .parseStandardAccoutingExtractFileToStandardAccountingExtractFile(saeFileName); success = getConcurStandardAccountingExtractService() .extractPdpFeedFromStandardAccounitngExtract(concurStandardAccoutingExtractFile); } catch (ValidationException ve) { success = false; LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, There was a validation error processing " + saeFileName, ve); } return success; }

Target:
protected boolean processCurrentFileAndExtractPdpFeedFromSAEFile(String saeFileName) { boolean success = true; LOG.debug("processCurrentFileAndExtractPdpFeedFromSAEFile, current File: " + saeFileName); ConcurStandardAccountingExtractFile concurStandardAccoutingExtractFile = getConcurStandardAccountingExtractService() .parseStandardAccoutingExtractFile(saeFileName); if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountExtractFile(concurStandardAccoutingExtractFile)) { success = getConcurStandardAccountingExtractService().extractPdpFeedFromStandardAccounitngExtract(concurStandardAccoutingExtractFile); } else { success = false; LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, the SAE file failed high level validation."); } return success; }
Source:
private void resizeWindow(DroneEvent event) { DronePoint<?> dronePoint = event.getDronePoint(); if (!dronePoint.conformsTo(WebDriver.class)) { return; } DroneContext context = droneContext.get(); WebDriver driver = context.get(dronePoint).getInstanceAs(WebDriver.class); Validate.stateNotNull(context, "DroneContext must not be null"); WebDriverConfiguration configuration = context.get(dronePoint).getConfigurationAs(WebDriverConfiguration.class); Validate.stateNotNull(configuration, "WebDriver configuration must not be null"); String browser = configuration.getBrowser().toLowerCase(); if(!browser.equals("chromeheadless")) { if (configuration.getDimensions() != null) { String dimensions = configuration.getDimensions().toLowerCase().trim(); Matcher m = DIMENSIONS_PATTERN.matcher(dimensions); if (m.matches()) { int width = Integer.valueOf(m.group(1)); int height = Integer.valueOf(m.group(2)); safelyResizeWindow(driver, width, height, dronePoint); } else if (dimensions.equals("full") || dimensions.equals("fullscreen") || dimensions.equals("max")) { safelyMaximizeWindow(driver, dronePoint); } } } }

Target:
private void resizeWindow(DroneEvent event) { DronePoint<?> dronePoint = event.getDronePoint(); if (!dronePoint.conformsTo(WebDriver.class)) { return; } DroneContext context = droneContext.get(); WebDriver driver = context.get(dronePoint).getInstanceAs(WebDriver.class); Validate.stateNotNull(context, "DroneContext must not be null"); WebDriverConfiguration configuration = context.get(dronePoint).getConfigurationAs(WebDriverConfiguration.class); Validate.stateNotNull(configuration, "WebDriver configuration must not be null"); String browser = configuration.getBrowser().toLowerCase(); if (!browser.equals("chromeheadless")) { Dimensions dimensions = new Dimensions(configuration); if (dimensions.hasFullscreenEnabled()) { safelyMaximizeWindow(driver, dronePoint); } else { safelyResizeWindow(driver, dimensions.getWidth(), dimensions.getHeight(), dronePoint); } } }
Source:
protected Object decode(final ChannelHandlerContext ctx, final ByteBuf inputBuf) throws Exception { if (inputBuf.readableBytes() <= 0) { return null; } if (outputBuf == null) { outputBuf = Unpooled.buffer(INITIAL_BUF_LEN); } while (inputBuf.readableBytes() > 0) { if (literalCount <= 0) { final ByteBuf lineBuf = (ByteBuf) super.decode(ctx, inputBuf); if (lineBuf == null) { outputBuf.writeBytes(inputBuf); return null; } final int lineLen = lineBuf.readableBytes(); final boolean noLiterals = (lineLen < FIVE || lineBuf.getByte(lineLen - THREE) != '}'); outputBuf.writeBytes(lineBuf); if (noLiterals) { return getFinalResponse(); } int i; for (i = lineLen - FOUR; i >= 0; i--) { if (lineBuf.getByte(i) == '{') { break; } } if (i < 0) { return getFinalResponse(); } try { final int numDigits = lineLen - THREE - (i + 1); final byte[] digits = new byte[numDigits]; lineBuf.getBytes(i + 1, digits, 0, numDigits); this.literalCount = ASCIIUtility.parseInt(digits, 0, digits.length); } catch (final NumberFormatException e) { return getFinalResponse(); } } else { final int avail = inputBuf.readableBytes(); final int actual = (literalCount <= avail) ? literalCount : avail; outputBuf.writeBytes(inputBuf, actual); literalCount -= actual; } } return null; }

Target:
protected Object decode(final ChannelHandlerContext ctx, final ByteBuf inputBuf) throws Exception { while (inputBuf.readableBytes() > 0) { if (literalCount <= 0) { final ByteBuf lineBuf = (ByteBuf) super.decode(ctx, inputBuf); if (lineBuf == null) { return null; } final int lineLen = lineBuf.readableBytes(); final boolean noLiterals = (lineLen < FIVE || lineBuf.getByte(lineLen - THREE) != '}'); if (noLiterals) { return getFinalResponse(lineBuf); } this.literalCount = getLiteralCount(lineBuf, lineLen); if (this.literalCount < 0) { return getFinalResponse(lineBuf); } if (literalBuf == null) { literalBuf = Unpooled.buffer(lineLen + literalCount + EXTRA_PADDING_LEN); } literalBuf.writeBytes(lineBuf); } else { final int avail = inputBuf.readableBytes(); final int actual = (literalCount <= avail) ? literalCount : avail; literalBuf.writeBytes(inputBuf, actual); literalCount -= actual; } } return null; }
Source:
private void createAndInvoke(ChannelOperation callback) { try { newChannelInvoker.createChannel().whenComplete((channel, throwable) -> { if (throwable != null) { int currentActive = active.decrementAndGet(); assert currentActive >= 0; int currentCreated = created.decrementAndGet(); assert currentCreated >= 0; if (trace) log.tracef(throwable, "Channel could not be created, created = %d, active = %d", currentCreated, currentActive); callback.cancel(address, throwable); } else { callback.invoke(channel); } }); } catch (Throwable t) { int currentActive = active.decrementAndGet(); assert currentActive >= 0; int currentCreated = created.decrementAndGet(); assert currentCreated >= 0; if (trace) log.tracef(t, "Channel could not be created, created = %d, active = %d", currentCreated, currentActive); callback.cancel(address, t); } }

Target:
private void createAndInvoke(ChannelOperation callback) { try { newChannelInvoker.createChannel().whenComplete((channel, throwable) -> { if (throwable != null) { int currentActive = active.decrementAndGet(); assert currentActive >= 0; int currentCreated = created.decrementAndGet(); assert currentCreated >= 0; if (trace) log.tracef(throwable, "Channel could not be created, created = %d, active = %d", currentCreated, currentActive); callback.cancel(address, throwable); } else { callback.invoke(channel); } }); } catch (Throwable t) { int currentActive = active.decrementAndGet(); int currentCreated = created.decrementAndGet(); if (trace) log.tracef(t, "Channel could not be created, created = %d, active = %d", currentCreated, currentActive); if (currentCreated < 0) { HOTROD.warnf("Invalid created count after channel create failure"); } if (currentActive < 0) { HOTROD.warnf("Invalid active count after channel create failure"); } callback.cancel(address, t); } }
Source:
public void stopReadingEarlyWhenEncounteringEntryKnownToBeCommittedAfterSweepTs() { immutableTs = 100L; enqueueWriteCommitted(TABLE_CONS, 10); enqueueWriteCommitedAt(TABLE_CONS, 30, 150); putTimestampIntoTransactionTable(50, 200); Map<Integer, Integer> largeWriteDistribution = enqueueAtLeastThresholdWritesInDefaultShardWithStartTs(100, 50); int writesInDedicated = largeWriteDistribution.get(CONS_SHARD); enqueueWriteUncommitted(TABLE_CONS, 70); enqueueWriteCommitted(TABLE_CONS, 90); sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(metricsManager).hasEntriesReadConservativeEqualTo( 4 + writesInDedicated + (readBatchSize > 1 ? 1 : 0)); sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(metricsManager).hasEntriesReadConservativeEqualTo( 4 + writesInDedicated + 1 + (readBatchSize > 1 ? 1 : 0)); immutableTs = 170; sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(metricsManager).hasEntriesReadConservativeEqualTo( 4 + writesInDedicated + 3 + (readBatchSize > 1 ? 2 : 0)); immutableTs = 250; sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(metricsManager).hasEntriesReadConservativeEqualTo( 4 + writesInDedicated + 3 + writesInDedicated + 2 + + (readBatchSize > 1 ? 2 : 0)); }

Target:
public void stopReadingEarlyWhenEncounteringEntryKnownToBeCommittedAfterSweepTs() { immutableTs = 100L; enqueueWriteCommitted(TABLE_CONS, 10); enqueueWriteCommitedAt(TABLE_CONS, 30, 150); putTimestampIntoTransactionTable(50, 200); Map<Integer, Integer> largeWriteDistribution = enqueueAtLeastThresholdWritesInDefaultShardWithStartTs(100, 50); int writesInDedicated = largeWriteDistribution.get(CONS_SHARD); enqueueWriteUncommitted(TABLE_CONS, 70); enqueueWriteCommitted(TABLE_CONS, 90); sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(metricsManager).hasEntriesReadConservativeEqualTo( 4 + writesInDedicated + (readBatchSize > 1 ? 1 : 0)); sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(metricsManager).hasEntriesReadConservativeEqualTo( 4 + writesInDedicated + 1 + (readBatchSize > 1 ? 1 : 0)); immutableTs = 170; sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(metricsManager).hasEntriesReadConservativeEqualTo( 4 + writesInDedicated + 3 + (readBatchSize > 1 ? 2 : 0)); immutableTs = 250; sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertThat(metricsManager).hasEntriesReadConservativeEqualTo( 4 + writesInDedicated + 3 + writesInDedicated + 2 + (readBatchSize > 1 ? 2 : 0)); }
Source:
private void parseRewind(final ReceiveCommand cmd) { RevCommit newObject; try { newObject = rp.getRevWalk().parseCommit(cmd.getNewId()); } catch (IncorrectObjectTypeException notCommit) { newObject = null; } catch (IOException err) { log.error("Invalid object " + cmd.getNewId().name() + " for " + cmd.getRefName() + " forced update", err); reject(cmd, "invalid object"); return; } RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (newObject != null) { validateNewCommits(ctl, cmd); if (cmd.getResult() != ReceiveCommand.Result.NOT_ATTEMPTED) { return; } } if (ctl.canForceUpdate()) { } else { cmd.setResult(ReceiveCommand.Result.REJECTED_NONFASTFORWARD); reject(cmd, "For non-fast forward updates, 'Force Push' privilege is needed"); } }

Target:
private void parseRewind(final ReceiveCommand cmd) { RevCommit newObject; try { newObject = rp.getRevWalk().parseCommit(cmd.getNewId()); } catch (IncorrectObjectTypeException notCommit) { newObject = null; } catch (IOException err) { log.error("Invalid object " + cmd.getNewId().name() + " for " + cmd.getRefName() + " forced update", err); reject(cmd, "invalid object"); return; } RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (newObject != null) { validateNewCommits(ctl, cmd); if (cmd.getResult() != ReceiveCommand.Result.NOT_ATTEMPTED) { return; } } if (ctl.canForceUpdate()) { } else { cmd.setResult(ReceiveCommand.Result.REJECTED_NONFASTFORWARD); reject(cmd, "For non-fast forward updates, '" + PermissionRule.FORCE_PUSH + "' privilege is needed"); } }
Source:
public String reportProblemForSingle() { this.myDav.uploadFromHome(this.currentStep.getProcess()); this.problem.setId(getIdForCorrection(this.problemTask)); serviceManager.getWorkflowService().setProblem(getProblem()); try { this.currentStep = serviceManager.getWorkflowService().reportProblem(this.currentStep); saveStep(); } catch (DAOException | DataException e) { Helper.setFehlerMeldung("correctionReportProblem"); logger.error(e.getMessage(), e); } setProblem(serviceManager.getWorkflowService().getProblem()); this.problemTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); }

Target:
public String reportProblemForSingle() { this.myDav.uploadFromHome(this.currentStep.getProcess()); this.problem.setId(getIdForCorrection(this.problemTask)); serviceManager.getWorkflowControllerService().setProblem(getProblem()); try { this.currentStep = serviceManager.getWorkflowControllerService().reportProblem(this.currentStep); saveStep(); } catch (DAOException | DataException e) { Helper.setErrorMessage("correctionReportProblem", logger, e); } setProblem(serviceManager.getWorkflowControllerService().getProblem()); this.problemTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); }
Source:
public void operationComplete(ChannelFuture future) { long writeFinishTime = System.currentTimeMillis(); if (future.isSuccess()) { if (finalResponseMetadata instanceof LastHttpContent) { if (!writeFuture.isDone()) { writeFuture.setSuccess(); completeRequest(!HttpHeaders.isKeepAlive(finalResponseMetadata)); } } else { logger.trace("Starting ChunkedWriteHandler on channel {}", ctx.channel()); writeFuture.addListener(new CallbackInvoker()); ctx.writeAndFlush(new ChunkDispenser(), writeFuture); } } else { handleChannelWriteFailure(future.cause(), true); } long responseAfterWriteProcessingTime = System.currentTimeMillis() - writeFinishTime; long channelWriteTime = writeFinishTime - responseWriteStartTime; nettyMetrics.channelWriteTimeInMs.update(channelWriteTime); nettyMetrics.responseMetadataAfterWriteProcessingTimeInMs.update(responseAfterWriteProcessingTime); if (request != null) { request.getMetricsTracker().nioMetricsTracker.addToResponseProcessingTime(channelWriteTime); request.getMetricsTracker().nioMetricsTracker.addToResponseProcessingTime(responseAfterWriteProcessingTime); } }

Target:
public void operationComplete(ChannelFuture future) { long writeFinishTime = System.currentTimeMillis(); if (future.isSuccess()) { if (finalResponseMetadata instanceof LastHttpContent) { if (!writeFuture.isDone()) { writeFuture.setSuccess(); completeRequest(!HttpHeaders.isKeepAlive(finalResponseMetadata)); } } else { logger.trace("Starting ChunkedWriteHandler on channel {}", ctx.channel()); writeFuture.addListener(new CallbackInvoker()); ctx.writeAndFlush(new ChunkDispenser(), writeFuture); } } else { handleChannelWriteFailure(future.cause(), true); } long responseAfterWriteProcessingTime = System.currentTimeMillis() - writeFinishTime; long channelWriteTime = writeFinishTime - responseWriteStartTime; nettyMetrics.channelWriteTimeInMs.update(channelWriteTime); nettyMetrics.responseMetadataAfterWriteProcessingTimeInMs.update(responseAfterWriteProcessingTime); if (request != null) { request.getMetricsTracker().nioMetricsTracker .addToResponseProcessingTime(channelWriteTime + responseAfterWriteProcessingTime); } }
Source:
protected String internalTransform(Map<Range, String> data, String source) throws TransformationException { try { final BigDecimal value = new BigDecimal(source); Optional<Range> match = data.keySet().stream().filter(range -> range.contains(value)).findFirst(); if (match.isPresent()) { return data.get(match.get()); } throw new TransformationException("No matching range for '" + source + "'"); } catch (NumberFormatException e) { throw new TransformationException("Scale can only be used with numeric inputs"); } }

Target:
protected String internalTransform(Map<Range, String> data, String source) throws TransformationException { try { final BigDecimal value = new BigDecimal(source); return data.entrySet().stream().filter(e -> e.getKey().contains(value)).findFirst().map(Map.Entry::getValue) .orElseThrow(() -> new TransformationException("No matching range for '" + source + "'")); } catch (NumberFormatException e) { throw new TransformationException("Scale can only be used with numeric inputs"); } }
Source:
public void Set_By_Sorted_Reverse() { Map<Integer, Group> results = BASIC_RESULTS .transform(groupBy(postId).as(postName, sortedSet(commentId, Ordering.natural().reverse()))); Group group = results.get(1); Iterator<Integer> it = group.getSet(commentId).iterator(); assertEquals(3, it.next().intValue()); assertEquals(2, it.next().intValue()); assertEquals(1, it.next().intValue()); }

Target:
public void Set_By_Sorted_Reverse() { Map<Integer, Group> results = BASIC_RESULTS_UNORDERED .transform(groupBy(postId).as(postName, sortedSet(commentId, Ordering.natural().reverse()))); Group group = results.get(1); Iterator<Integer> it = group.getSet(commentId).iterator(); assertEquals(3, it.next().intValue()); assertEquals(2, it.next().intValue()); assertEquals(1, it.next().intValue()); }
Source:
public long getQuota(String projectname) throws IOException { String rootDir = settings.DIR_ROOT; String fullProjectPath = File.separator + rootDir + File.separator + projectname; String project = this.extractProjectName(fullProjectPath + File.separator); String projectPath = File.separator + rootDir + File.separator + project; return dfsSingleton.getDfsOps().getQuota(new Path(projectPath)); }

Target:
public long getQuota(String projectname) throws IOException { return dfsSingleton.getDfsOps().getQuota(new Path(settings.getProjectPath(projectname))); }
Source:
public void testDefaultPrintHelp() throws IOException, NoSuchMethodException { Iterator i = tajoCli.getContext().getCommands().keySet().iterator(); while (i.hasNext()) { String command = i.next().toString(); if (tajoCli.getContext().getCommands().get(command).getClass().getMethod("printHelp") .getDeclaringClass().toString().equals("class org.apache.tajo.cli.tsql.commands.TajoShellCommand")) { tajoCli.executeMetaCommand("\\help " + command.replace("\\", "")); String result = new String(out.toByteArray()); out.reset(); String expected = tajoCli.getContext().getCommands().get(command).getCommand() + " " + tajoCli.getContext().getCommands().get(command).getUsage() + " - " + tajoCli.getContext().getCommands().get(command).getDescription() + "\n"; assertEquals(result, expected); } } }

Target:
public void testDefaultPrintHelp() throws IOException, NoSuchMethodException { for (Map.Entry<String, TajoShellCommand> entry : tajoCli.getContext().getCommands().entrySet()) { TajoShellCommand shellCommand = entry.getValue(); if (!shellCommand.getClass().getMethod("printHelp").getDeclaringClass().equals(shellCommand.getClass())) { tajoCli.executeMetaCommand("\\help " + entry.getKey().replace("\\", "")); String result = new String(out.toByteArray()); out.reset(); String expected = shellCommand.getCommand() + " " + shellCommand.getUsage() + " - " + shellCommand.getDescription() + "\n"; assertEquals(result, expected); } } }
Source:
static Request toOkHttpRequest(feign.Request input) { Request.Builder requestBuilder = new Request.Builder(); requestBuilder.url(input.url()); MediaType mediaType = null; boolean hasAcceptHeader = false; for (String field : input.headers().keySet()) { if (field.equalsIgnoreCase("Accept")) { hasAcceptHeader = true; } for (String value : input.headers().get(field)) { requestBuilder.addHeader(field, value); if (field.equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(value); if (input.charset() != null) { mediaType.charset(input.charset()); } } } } if (!hasAcceptHeader) { requestBuilder.addHeader("Accept", "*/*"); } byte[] inputBody = input.body(); boolean isMethodWithBody = HttpMethod.POST == input.httpMethod() || HttpMethod.PUT == input.httpMethod() || HttpMethod.PATCH == input.httpMethod(); if (isMethodWithBody) { requestBuilder.removeHeader("Content-Type"); if (inputBody == null) { inputBody = new byte[0]; } } RequestBody body = inputBody != null ? RequestBody.create(inputBody, mediaType) : null; requestBuilder.method(input.httpMethod().name(), body); return requestBuilder.build(); }

Target:
static Request toOkHttpRequest(feign.Request input) { Request.Builder requestBuilder = new Request.Builder(); requestBuilder.url(input.url()); MediaType mediaType = null; boolean hasAcceptHeader = false; for (String field : input.headers().keySet()) { if (field.equalsIgnoreCase("Accept")) { hasAcceptHeader = true; } for (String value : input.headers().get(field)) { requestBuilder.addHeader(field, value); if (field.equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(value); if (input.charset() != null) { mediaType.charset(input.charset()); } } } } if (!hasAcceptHeader) { requestBuilder.addHeader("Accept", "*/*"); } byte[] inputBody = input.body(); boolean isMethodWithBody = HttpMethod.POST == input.httpMethod() || HttpMethod.PUT == input.httpMethod() || HttpMethod.PATCH == input.httpMethod(); if (isMethodWithBody) { requestBuilder.removeHeader("Content-Type"); if (inputBody == null) { inputBody = new byte[0]; } } RequestBody body = inputBody != null ? RequestBody.create(mediaType, inputBody) : null; requestBuilder.method(input.httpMethod().name(), body); return requestBuilder.build(); }
Source:
public Mono<OAuth2AccessTokenResponse> getTokenResponse(OAuth2ClientCredentialsGrantRequest authorizationGrantRequest) { return Mono.defer(() -> { ClientRegistration clientRegistration = authorizationGrantRequest.getClientRegistration(); String tokenUri = clientRegistration.getProviderDetails().getTokenUri(); BodyInserters.FormInserter<String> body = body(authorizationGrantRequest); org.springframework.web.reactive.function.client.WebClient.RequestBodyUriSpec spec = webClient.post(); return this.webClient.post() .uri(tokenUri) .accept(MediaType.APPLICATION_JSON) .headers(headers(clientRegistration)) .body(body) .exchange() .flatMap(response -> response.body(oauth2AccessTokenResponse())) .map(response -> { if (response.getAccessToken().getScopes().isEmpty()) { response = OAuth2AccessTokenResponse.withResponse(response) .scopes(authorizationGrantRequest.getClientRegistration().getScopes()) .build(); } return response; }); }); }

Target:
public Mono<OAuth2AccessTokenResponse> getTokenResponse(OAuth2ClientCredentialsGrantRequest authorizationGrantRequest) { return Mono.defer(() -> { ClientRegistration clientRegistration = authorizationGrantRequest.getClientRegistration(); String tokenUri = clientRegistration.getProviderDetails().getTokenUri(); BodyInserters.FormInserter<String> body = body(authorizationGrantRequest); RequestBodyUriSpec spec = webClient.post(); return this.webClient.post() .uri(tokenUri) .accept(MediaType.APPLICATION_JSON) .headers(headers(clientRegistration)) .body(body) .exchange() .flatMap(response ->{ if (!response.statusCode().is2xxSuccessful()){ throw WebClientResponseException.create(response.rawStatusCode(), "Cannot get token, expected 2xx HTTP Status code", null, null, null ); } return response.body(oauth2AccessTokenResponse()); }) .map(response -> { if (response.getAccessToken().getScopes().isEmpty()) { response = OAuth2AccessTokenResponse.withResponse(response) .scopes(authorizationGrantRequest.getClientRegistration().getScopes()) .build(); } return response; }); }); }
Source:
public void onMessage(HTTPCarbonMessage httpResponseMessage) { Util.setupTransferEncodingForResponse(httpResponseMessage, requestDataHolder); sourceContext.channel().eventLoop().execute(() -> { boolean connectionCloseAfterResponse = shouldConnectionClose(httpResponseMessage); if (handlerExecutor != null) { handlerExecutor.executeAtSourceResponseReceiving(httpResponseMessage); } final HttpResponse response = Util .createHttpResponse(httpResponseMessage, connectionCloseAfterResponse); sourceContext.write(response); httpResponseMessage.getHttpContentAsync().setMessageListener(httpContent -> this.sourceContext.channel().eventLoop().execute(() -> { if (Util.isLastHttpContent(httpContent)) { ChannelFuture future = sourceContext.writeAndFlush(httpContent); HttpResponseStatusFuture responseStatusFuture = requestMsg.getHttpResponseStatusFuture(); future.addListener(genericFutureListener -> { if (genericFutureListener.cause() != null) { responseStatusFuture.notifyHttpListener(genericFutureListener.cause()); } responseStatusFuture.notifyHttpListener(requestMsg); }); if (connectionCloseAfterResponse) { future.addListener(ChannelFutureListener.CLOSE); } if (handlerExecutor != null) { handlerExecutor.executeAtSourceResponseSending(httpResponseMessage); } } else { sourceContext.write(httpContent); } })); }); Util.prepareBuiltMessageForTransfer(httpResponseMessage); }

Target:
public void onMessage(HTTPCarbonMessage httpResponseMessage) { Util.setupTransferEncodingForResponse(httpResponseMessage, requestDataHolder); sourceContext.channel().eventLoop().execute(() -> { boolean connectionCloseAfterResponse = shouldConnectionClose(httpResponseMessage); if (handlerExecutor != null) { handlerExecutor.executeAtSourceResponseReceiving(httpResponseMessage); } final HttpResponse response = Util .createHttpResponse(httpResponseMessage, connectionCloseAfterResponse); sourceContext.write(response); httpResponseMessage.getHttpContentAsync().setMessageListener(httpContent -> this.sourceContext.channel().eventLoop().execute(() -> { if (Util.isLastHttpContent(httpContent)) { ChannelFuture outboundChannelFuture = sourceContext.writeAndFlush(httpContent); HttpResponseStatusFuture outboundRespStatusFuture = inboundRequestMsg.getHttpOutboundRespStatusFuture(); outboundChannelFuture.addListener(genericFutureListener -> { if (genericFutureListener.cause() != null) { outboundRespStatusFuture.notifyHttpListener(genericFutureListener.cause()); } else { outboundRespStatusFuture.notifyHttpListener(inboundRequestMsg); } }); if (connectionCloseAfterResponse) { outboundChannelFuture.addListener(ChannelFutureListener.CLOSE); } if (handlerExecutor != null) { handlerExecutor.executeAtSourceResponseSending(httpResponseMessage); } } else { sourceContext.write(httpContent); } })); }); Util.prepareBuiltMessageForTransfer(httpResponseMessage); }
Source:
public void testPackageWithMainlineNetworkStackPermission() { final PackageManager packageManager = mContext.getPackageManager(); final List<PackageInfo> packageList = packageManager.getPackagesHoldingPermissions( new String[]{PERMISSION_MAINLINE_NETWORK_STACK}, PackageManager.MATCH_SYSTEM_ONLY | PackageManager.GET_PERMISSIONS); int packageCount = 0; for (PackageInfo packageInfo : packageList) { if (packageInfo.permissions == null) { break; } for (PermissionInfo permission : packageInfo.permissions) { if (PERMISSION_MAINLINE_NETWORK_STACK.equals(permission.name)) { packageCount++; } } } assertTrue("Package count that declares " + PERMISSION_MAINLINE_NETWORK_STACK + " should be " + EXPECTED_DECLARATION_PERMISSION_COUNT + " but " + packageCount, (packageCount == EXPECTED_DECLARATION_PERMISSION_COUNT)); }

Target:
public void testPackageWithMainlineNetworkStackPermission() throws Exception { final PackageManager packageManager = mContext.getPackageManager(); assertNotNull(packageManager); int packageCount = 0; final PermissionInfo permissioninfo = packageManager.getPermissionInfo(PERMISSION_MAINLINE_NETWORK_STACK, 0); assertNotNull(permissioninfo); PackageInfo packageInfo = packageManager.getPackageInfo(permissioninfo.packageName, PackageManager.MATCH_SYSTEM_ONLY | PackageManager.GET_PERMISSIONS); assertNotNull(packageInfo.permissions); for (PermissionInfo permission : packageInfo.permissions) { if (PERMISSION_MAINLINE_NETWORK_STACK.equals(permission.name)) { packageCount++; } } assertTrue("Package count that declares " + PERMISSION_MAINLINE_NETWORK_STACK + " should be " + EXPECTED_DECLARATION_PERMISSION_COUNT + " but " + packageCount, (packageCount == EXPECTED_DECLARATION_PERMISSION_COUNT)); }
Source:
private Extractors getExtractorsForMapName(String mapNameOrNull) { if (mapNameOrNull == null) { return Extractors.newBuilder(((InternalSerializationService) serializationService)) .build(); } return mapServiceContext.getExtractors(mapNameOrNull); }

Target:
private Extractors getExtractorsForMapName(String mapNameOrNull) { if (mapNameOrNull == null) { return Extractors.newBuilder(serializationService) .build(); } return mapServiceContext.getExtractors(mapNameOrNull); }
Source:
public static EC2HardwareBuilder c5d_2xlarge() { return new EC2HardwareBuilder(InstanceType.C5D_2XLARGE).c5() .ram(16384) .processors(ImmutableList.of(new Processor(8.0, 3.0))) .volumes(ImmutableList.<Volume>of( new VolumeBuilder().type(LOCAL).size(10.0f).device("/dev/sda1").bootDevice(true).durable(false).build(), new VolumeBuilder().type(LOCAL).size(200.0f).device("/dev/sdb").bootDevice(false).durable(false).build())) .is64Bit(true); }

Target:
public static EC2HardwareBuilder c5d_2xlarge() { return new EC2HardwareBuilder(InstanceType.C5D_2XLARGE).c5() .ram(16384) .processors(ImmutableList.of(new Processor(8.0, 3.0))) .volumes(ImmutableList.<Volume>of( new VolumeBuilder().type(LOCAL).size(10.0f).device("/dev/sda1").bootDevice(true).durable(false).build(), new VolumeBuilder().type(LOCAL).size(225.0f).device("/dev/sdb").bootDevice(false).durable(false).build())) .is64Bit(true); }
Source:
private K parseConfigVars(KRunOptions options, CompiledDefinition compiledDef) { HashMap<KToken, K> output = new HashMap<>(); for (Map.Entry<String, Pair<String, String>> entry : options.configurationCreation.configVars(compiledDef.languageParsingModule().name()).entrySet()) { String name = entry.getKey(); String value = entry.getValue().getLeft(); String parser = entry.getValue().getRight(); Sort sort = Sorts.K(); K configVar = externalParse(parser, value, sort, Source.apply("<command line: -c" + name + ">"), compiledDef); output.put(KToken("$" + name, Sorts.KConfigVar()), configVar); } if (options.io()) { output.put(KToken("$STDIN", Sorts.KConfigVar()), KToken("\"\"", Sorts.String())); output.put(KToken("$IO", Sorts.KConfigVar()), KToken("\"on\"", Sorts.String())); } else { String stdin = InitialConfigurationProvider.getStdinBuffer(true); output.put(KToken("$STDIN", Sorts.KConfigVar()), KToken("\"" + stdin + "\"", Sorts.String())); output.put(KToken("$IO", Sorts.KConfigVar()), KToken("\"off\"", Sorts.String())); } return plugConfigVars(compiledDef, output); }

Target:
private K parseConfigVars(KRunOptions options, CompiledDefinition compiledDef) { HashMap<KToken, K> output = new HashMap<>(); for (Map.Entry<String, Pair<String, String>> entry : options.configurationCreation.configVars(compiledDef.languageParsingModule().name()).entrySet()) { String name = entry.getKey(); String value = entry.getValue().getLeft(); String parser = entry.getValue().getRight(); Sort sort = Sorts.K(); K configVar = externalParse(parser, value, sort, Source.apply("<command line: -c" + name + ">"), compiledDef); output.put(KToken("$" + name, Sorts.KConfigVar()), configVar); } if (options.io()) { output.put(KToken("$STDIN", Sorts.KConfigVar()), KToken("\"\"", Sorts.String())); output.put(KToken("$IO", Sorts.KConfigVar()), KToken("\"on\"", Sorts.String())); } else { String stdin = InitialConfigurationProvider.getStdinBuffer(ttyStdin); output.put(KToken("$STDIN", Sorts.KConfigVar()), KToken("\"" + stdin + "\"", Sorts.String())); output.put(KToken("$IO", Sorts.KConfigVar()), KToken("\"off\"", Sorts.String())); } return plugConfigVars(compiledDef, output); }
Source:
private void initTimeBoxes() { hoursBox = initIntegerValueBox(formStepValues(hourSteps, 1, 12)); addHourSelectionListener(); minutesBox = initIntegerValueBox(formStepValues(minuteSteps, 0, 59)); addMinuteSelectionListener(); amPmBox = initStringValueBox(new ArrayList<String>(Arrays.asList(MORNING, EVENING))); addAmPmSelectionListener(); }

Target:
private void initTimeBoxes() { hoursBox = initIntegerValueBox(formStepValues(hourSteps, 1, HOUR_CONSTANT)); addHourSelectionListener(); minutesBox = initIntegerValueBox(formStepValues(minuteSteps, 0, MINUTE_MAX)); addMinuteSelectionListener(); amPmBox = initStringValueBox(new ArrayList<String>(Arrays.asList(MORNING, EVENING))); addAmPmSelectionListener(); }
Source:
public void disconnect(boolean criticalError) { amqpConnection.runLater(() -> { ErrorCondition errorCondition = new ErrorCondition(); errorCondition.setCondition(AmqpSupport.CONNECTION_FORCED); amqpConnection.close(errorCondition); amqpConnection.flush(); }); amqpConnection.runLater(() -> { getTransportConnection().close(); }); }

Target:
public void disconnect(boolean criticalError) { ErrorCondition errorCondition = new ErrorCondition(); errorCondition.setCondition(AmqpSupport.CONNECTION_FORCED); amqpConnection.close(errorCondition); }