auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void removeUnusedMessagesBroadcastTest() { onBrickAtPosition(0).checkShowsText(R.string.brick_when_started); onBrickAtPosition(1).checkShowsText(R.string.brick_broadcast); onBrickAtPosition(2).checkShowsText(R.string.brick_broadcast_receive); onBrickAtPosition(3).checkShowsText(R.string.brick_broadcast_wait); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(defaultMessage); String newMessage = "newMessage"; onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(R.string.new_broadcast_message)) .perform(click()); onView(withId(R.id.edit_text)) .perform(clearText(), typeTextIntoFocusedView(newMessage)); onView(withText(R.string.ok)) .perform(click()); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(newMessage); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(defaultMessage)) .perform(click()); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(defaultMessage); onView(withId(R.id.button_play)) .perform(click()); pressBack(); pressBack(); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(newMessage)) .check(doesNotExist()); }

Target:
public void removeUnusedMessagesBroadcastTest() { onBrickAtPosition(whenBrickPosition).checkShowsText(R.string.brick_when_started); onBrickAtPosition(broadcastSendPosition).checkShowsText(R.string.brick_broadcast); onBrickAtPosition(broadcastReceivePosition).checkShowsText(R.string.brick_broadcast_receive); onBrickAtPosition(broadcastAndWaitPosition).checkShowsText(R.string.brick_broadcast_wait); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(defaultMessage); String newMessage = "newMessage"; onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(R.string.new_broadcast_message)) .perform(click()); onView(withId(R.id.edit_text)) .perform(clearText(), typeTextIntoFocusedView(newMessage)); onView(withText(R.string.ok)) .perform(click()); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(newMessage); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(defaultMessage)) .perform(click()); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(defaultMessage); onView(withId(R.id.button_play)) .perform(click()); pressBack(); pressBack(); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(newMessage)) .check(doesNotExist()); }
Source:
public CompletionStage<Void> rollbackAllTxStores(TxInvocationContext<AbstractCacheTransaction> txInvocationContext, Predicate<? super StoreConfiguration> predicate) { return Completable.using( this::acquireReadLock, ignore -> { checkStoreAvailability(); if (trace) { log.tracef("Rolling back transaction %s for stores", txInvocationContext); } return Flowable.fromIterable(stores) .filter(storeStatus -> shouldPerformTransactionOperation(storeStatus, predicate)) .flatMapCompletable(storeStatus -> Completable.fromCompletionStage(storeStatus.store.commit(txInvocationContext.getTransaction()))); }, this::releaseReadLock ).toCompletionStage(null); }

Target:
public CompletionStage<Void> rollbackAllTxStores(TxInvocationContext<AbstractCacheTransaction> txInvocationContext, Predicate<? super StoreConfiguration> predicate) { return Completable.using( this::acquireReadLock, ignore -> { checkStoreAvailability(); if (trace) { log.tracef("Rolling back transaction %s for stores", txInvocationContext); } return Flowable.fromIterable(stores) .filter(storeStatus -> shouldPerformTransactionOperation(storeStatus, predicate)) .flatMapCompletable(storeStatus -> Completable.fromCompletionStage(storeStatus.store.rollback(txInvocationContext.getTransaction()))); }, this::releaseReadLock ).toCompletionStage(null); }
Source:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); requiresCondition(() -> !renderingDebugConfig.isFirstPersonElementsHidden()); renderingDebugConfig.subscribe(RenderingDebugConfig.FIRST_PERSON_ELEMENTS_HIDDEN, this); addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); update(); addDesiredStateChange(new SetDepthFunction(GL_ALWAYS)); displayResolutionDependentFBOs.subscribe(this); }

Target:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); requiresCondition(() -> !renderingDebugConfig.isFirstPersonElementsHidden()); renderingDebugConfig.subscribe(RenderingDebugConfig.FIRST_PERSON_ELEMENTS_HIDDEN, this); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new SetDepthFunction(GL_ALWAYS)); }
Source:
private String[] toPathArray(String notePath, boolean includeLast) { if (null == notePath || notePath.length() == 0) { throw new NullPointerException("notePath is null"); } notePath = notePath.replaceAll("/+", "/"); if ("/".equals(notePath)) { return ArrayUtils.EMPTY_STRING_ARRAY; } String[] arr = notePath.substring(1).split("/"); return includeLast ? arr : Arrays.copyOfRange(arr, 0, arr.length - 1); }

Target:
String[] toPathArray(String notePath, boolean includeLast) { if (null == notePath || notePath.length() == 0) { throw new NullPointerException("notePath is null"); } notePath = notePath.replaceAll("/+", "/"); if ("/".equals(notePath)) { return ArrayUtils.EMPTY_STRING_ARRAY; } if (notePath.startsWith("/")) { notePath = notePath.substring(1); } String[] arr = notePath.split("/"); return includeLast ? arr : Arrays.copyOfRange(arr, 0, arr.length - 1); }
Source:
public Set<String> parse(Config cfg) { final Set<String> result = new HashSet<String>(); while (cfg != null) { for (final Entry e : cfg.state.get().entryList) { if (e.name != null && StringUtils.equalsIgnoreCase(e.section, section)) { if (subsection == null && e.subsection == null) result.add(e.name); else if (e.subsection != null && e.subsection.equals(subsection)) result.add(e.name); } } cfg = cfg.baseConfig; } return Collections.unmodifiableSet(result); }

Target:
public Set<String> parse(Config cfg) { final Set<String> result = new HashSet<String>(); while (cfg != null) { for (final Entry e : cfg.state.get().entryList) { if (e.name != null && StringUtils.equalsIgnoreCase(e.section, section)) { if (subsection == null && e.subsection == null) result.add(StringUtils.toLowerCase(e.name)); else if (e.subsection != null && e.subsection.equals(subsection)) result.add(StringUtils.toLowerCase(e.name)); } } cfg = cfg.baseConfig; } return Collections.unmodifiableSet(result); }
Source:
public Object convert(MBeanServerConnection connection, ObjectInstance instance) { Map<String, Object> attributeMap = new HashMap<String, Object>(); try { ObjectName objName = instance.getObjectName(); if (!connection.isRegistered(objName)) { return attributeMap; } MBeanInfo info = connection.getMBeanInfo(objName); MBeanAttributeInfo[] attributeInfos = info.getAttributes(); for (MBeanAttributeInfo attrInfo : attributeInfos) { if ("ObjectName".equals(attrInfo.getName())) continue; Object value; try { value = connection.getAttribute(objName, attrInfo.getName()); } catch (RuntimeMBeanException e) { Throwable t = e; while (t.getCause() != null) { t = t.getCause(); } value = String.format("%s[%s]", t.getClass().getName(), t.getMessage()); } attributeMap.put(attrInfo.getName(), checkAndConvert(value)); } } catch (Exception e) { throw new IllegalArgumentException(e); } return attributeMap; }

Target:
public Object convert(MBeanServerConnection connection, ObjectInstance instance) { Map<String, Object> attributeMap = new HashMap<String, Object>(); try { ObjectName objName = instance.getObjectName(); if (!connection.isRegistered(objName)) { return attributeMap; } MBeanInfo info = connection.getMBeanInfo(objName); MBeanAttributeInfo[] attributeInfos = info.getAttributes(); for (MBeanAttributeInfo attrInfo : attributeInfos) { if ("ObjectName".equals(attrInfo.getName()) || !filter.accept(objName, attrInfo.getName())) { continue; } Object value; try { value = connection.getAttribute(objName, attrInfo.getName()); } catch (RuntimeMBeanException e) { if (log.isTraceEnabled()) { log.trace("Error getting attribute '" + attrInfo.getName() + "' on '" + objName + "'", e); } Throwable t = e; while (t.getCause() != null) { t = t.getCause(); } value = String.format("%s[%s]", t.getClass().getName(), t.getMessage()); } attributeMap.put(attrInfo.getName(), checkAndConvert(value)); } } catch (Exception e) { throw new IllegalArgumentException(e); } return attributeMap; }
Source:
private void doDisplayRun() { try { showProgressHandler.sendEmptyMessage(SHOW_PROGRESS); final List<Geocache> cachesToDisplay = caches.getAsList(); final List<CachesOverlayItemImpl> itemsToDisplay = new ArrayList<>(); if (!cachesToDisplay.isEmpty()) { if (mapOptions.mapMode == MapMode.SINGLE || cachesCnt < Settings.getWayPointsThreshold()) { for (final Waypoint waypoint : waypoints) { if (waypoint != null && waypoint.getCoords() != null) { itemsToDisplay.add(getWaypointItem(waypoint)); } } } for (final Geocache cache : cachesToDisplay) { if (cache != null && cache.getCoords() != null) { itemsToDisplay.add(getCacheItem(cache)); } } } if (mapOptions.coords == null) { overlayCaches.updateItems(itemsToDisplay); } displayHandler.sendEmptyMessage(INVALIDATE_MAP); updateMapTitle(); } finally { showProgressHandler.sendEmptyMessage(HIDE_PROGRESS); } }

Target:
private void doDisplayRun() { try { showProgressHandler.sendEmptyMessage(SHOW_PROGRESS); final List<Geocache> cachesToDisplay = caches.getAsList(); final List<Waypoint> waypointsToDisplay = new ArrayList<>(waypoints); final List<CachesOverlayItemImpl> itemsToDisplay = new ArrayList<>(); if (!cachesToDisplay.isEmpty()) { if (mapOptions.mapMode == MapMode.SINGLE || cachesCnt < Settings.getWayPointsThreshold()) { for (final Waypoint waypoint : waypointsToDisplay) { if (waypoint != null && waypoint.getCoords() != null) { itemsToDisplay.add(getWaypointItem(waypoint)); } } } for (final Geocache cache : cachesToDisplay) { if (cache != null && cache.getCoords() != null) { itemsToDisplay.add(getCacheItem(cache)); } } } if (mapOptions.coords == null) { overlayCaches.updateItems(itemsToDisplay); } displayHandler.sendEmptyMessage(INVALIDATE_MAP); updateMapTitle(); } finally { showProgressHandler.sendEmptyMessage(HIDE_PROGRESS); } }
Source:
public boolean execute(BindContext context) { Consumer consumer = context.getLockedConsumer(); Map<String, Entitlement> entitlementMap = context.getEntitlementMap(); Map<String, PoolQuantity> lockedPools = context.getPoolQuantities(); List<Pool> poolsToSave = new LinkedList<Pool>(); for (Entry<String, PoolQuantity> entry: context.getPoolQuantities().entrySet()) { Entitlement ent = entitlementMap.get(entry.getKey()); Pool pool = lockedPools.get(entry.getKey()).getPool(); Integer quantity = ent.getQuantity(); pool.getEntitlements().add(ent); ent.setPool(pool); ent.setConsumer(consumer); ent.setOwner(consumer.getOwner()); pool.setConsumed(pool.getConsumed() + quantity); if (consumer.isManifestDistributor()) { pool.setExported(pool.getExported() + quantity); } else if (consumer.isShare()) { pool.setShared(pool.getShared() + quantity); } consumer.addEntitlement(ent); consumer.setEntitlementCount(consumer.getEntitlementCount() + quantity); poolsToSave.add(pool); } entitlementCurator.saveAll(entitlementMap.values(), false, false); poolCurator.updateAll(poolsToSave, false, false); return true; }

Target:
public boolean execute(BindContext context) { Consumer consumer = context.getLockedConsumer(); Map<String, Entitlement> entitlementMap = context.getEntitlementMap(); Map<String, PoolQuantity> lockedPools = context.getPoolQuantities(); List<Pool> poolsToSave = new LinkedList<Pool>(); for (Entry<String, PoolQuantity> entry: lockedPools.entrySet()) { Entitlement ent = entitlementMap.get(entry.getKey()); Pool pool = entry.getValue().getPool(); Integer quantity = ent.getQuantity(); pool.getEntitlements().add(ent); ent.setPool(pool); ent.setConsumer(consumer); ent.setOwner(consumer.getOwner()); pool.setConsumed(pool.getConsumed() + quantity); if (consumer.isManifestDistributor()) { pool.setExported(pool.getExported() + quantity); } else if (consumer.isShare()) { pool.setShared(pool.getShared() + quantity); } consumer.addEntitlement(ent); consumer.setEntitlementCount(consumer.getEntitlementCount() + quantity); poolsToSave.add(pool); } entitlementCurator.saveAll(entitlementMap.values(), false, false); poolCurator.updateAll(poolsToSave, false, false); return true; }
Source:
public Wizard<C, T> expectedValuesPerContainer(int count) { sanityCheck(count); if (count < ArrayContainer.DEFAULT_MAX_SIZE) { return optimiseForArrays(); } else if (count < 1 << 14) { return optimiseForBitmaps(); } else { return optimiseForRuns(); } }

Target:
public Wizard<C, T> expectedValuesPerContainer(int count) { sanityCheck(count); this.expectedContainerSize = count; if (count < ArrayContainer.DEFAULT_MAX_SIZE) { return optimiseForArrays(); } else if (count < 1 << 14) { return optimiseForBitmaps(); } else { return optimiseForRuns(); } }
Source:
public boolean performOk() { ExclusionsAndInclusions config = rulesConfigurationPart.computeExclusionsAndInclusions(); PreferencesUtils.setExcludedRules(config.excluded()); PreferencesUtils.setIncludedRules(config.included()); JobUtils.scheduleAnalysisOfOpenFiles((ISonarLintProject) null, TriggerType.EXCLUSION_CHANGE); return true; }

Target:
public boolean performOk() { ExclusionsAndInclusions config = rulesConfigurationPart.computeExclusionsAndInclusions(); PreferencesUtils.setExcludedRules(config.excluded()); PreferencesUtils.setIncludedRules(config.included()); JobUtils.scheduleAnalysisOfOpenFiles((ISonarLintProject) null, TriggerType.STANDALONE_CONFIG_CHANGE); return true; }
Source:
public TabletFile(Path metaPath) { this(metaPath, Optional.empty()); }

Target:
public TabletFile(Path metaPath) { this.metaPath = Objects.requireNonNull(metaPath); String errorMsg = "Missing or invalid part of tablet file metadata entry: " + metaPath; this.fileName = metaPath.getName(); MetadataSchema.TabletsSection.ServerColumnFamily.validateDirCol(fileName); Path tabletDirPath = Objects.requireNonNull(metaPath.getParent(), errorMsg); this.tabletDir = tabletDirPath.getName(); MetadataSchema.TabletsSection.ServerColumnFamily.validateDirCol(tabletDir); Path tableIdPath = Objects.requireNonNull(tabletDirPath.getParent(), errorMsg); this.tableId = TableId.of(tableIdPath.getName()); MetadataSchema.TabletsSection.ServerColumnFamily.validateDirCol(tableId.canonical()); Path tablePath = Objects.requireNonNull(tableIdPath.getParent(), errorMsg); String tpString = "/" + tablePath.getName(); Preconditions.checkArgument(tpString.equals(Constants.HDFS_TABLES_DIR), errorMsg); Path volumePath = Objects.requireNonNull(tablePath.getParent(), errorMsg); Preconditions.checkArgument(volumePath.toUri().getScheme() != null, errorMsg); this.volume = volumePath.toString(); this.normalizedPath = volume + Constants.HDFS_TABLES_DIR + "/" + tableId.canonical() + "/" + tabletDir + "/" + fileName; }
Source:
protected void doLookUpdate() { updateLookFromFormula(); if (wait) { BackgroundWaitHandler.addObserver(look, this); } if (look != null && sprite != null && sprite.getLookDataList().contains(look)) { sprite.look.setLookData(look); setLookDone = true; } }

Target:
protected void doLookUpdate() { updateLookFromFormula(); if (look != null && sprite != null && sprite.getLookDataList().contains(look)) { if (wait) { BackgroundWaitHandler.addObserver(look, this); } sprite.look.setLookData(look); setLookDone = true; } }
Source:
public void updateErrataDetailFormPanel(Erratum erratum) { logger.info("updateErrataDetailFormPanel for " + erratum); errataTitle.setText(erratum.getTitle()); FormBuilder formBuilder = new FormBuilder(errataDetailFormPanel, 1, 10); formBuilder.setRelativeColumnWidth(0, 3); formBuilder.addFormItem(new FormItem(constants.errataId(), new Span(erratum.getId()), 0, 0)); formBuilder.addFormItem(new FormItem(constants.errataDateIssued(), new Span(erratum.getIssued().toString()), 1, 0)); formBuilder.addFormItem(new FormItem(constants.errataType(), new Span(erratum.getType().toString()), 2, 0)); formBuilder.addFormItem(new FormItem(constants.errataSeverity(), new Span(erratum.getSeverity() == null? "N/A" : erratum.getSeverity().toString()), 3, 0)); formBuilder.addFormItem(new FormItem(constants.description(), new Span(erratum.getDescription().toString()), 4, 0)); formBuilder.addFormItem(new FormItem(constants.solution(), new Span(erratum.getSolution()), 5, 0)); formBuilder.addFormItem(new FormItem(constants.summary(), new Span(erratum.getSummary()), 6, 0)); formBuilder.addFormItem(new FormItem(constants.errataPackages(), new Span(StringUtils.join(erratum.getPackages(), ", ")), 7, 0)); }

Target:
public void updateErrataDetailFormPanel(Erratum erratum) { errataTitle.setText(erratum.getTitle()); FormBuilder formBuilder = new FormBuilder(errataDetailFormPanel, 1, 10); formBuilder.setRelativeColumnWidth(0, 3); formBuilder.addFormItem(new FormItem(constants.errataId(), new Span(erratum.getId()), 0, 0)); formBuilder.addFormItem(new FormItem(constants.errataDateIssued(), new Span(erratum.getIssued().toString()), 1, 0)); formBuilder.addFormItem(new FormItem(constants.errataType(), new Span(erratum.getType().toString()), 2, 0)); formBuilder.addFormItem(new FormItem(constants.errataSeverity(), new Span(erratum.getSeverity() == null? "N/A" : erratum.getSeverity().toString()), 3, 0)); formBuilder.addFormItem(new FormItem(constants.description(), new Span(erratum.getDescription().toString()), 4, 0)); formBuilder.addFormItem(new FormItem(constants.solution(), new Span(erratum.getSolution()), 5, 0)); formBuilder.addFormItem(new FormItem(constants.summary(), new Span(erratum.getSummary()), 6, 0)); formBuilder.addFormItem(new FormItem(constants.errataPackages(), new Span(StringUtils.join(erratum.getPackages(), ", ")), 7, 0)); }
Source:
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) { log.info("onDisconnect closeConnectionReason={}, nodeAddressOpt={}", closeConnectionReason, connection.getPeersNodeAddressOptional()); closeHandler(connection); if (retryTimer == null) { retryTimer = UserThread.runAfter(() -> { log.trace("ConnectToMorePeersTimer called from onDisconnect code path"); stopRetryTimer(); requestWithAvailablePeers(); }, RETRY_DELAY_SEC); } if (peerManager.isPeerBanned(closeConnectionReason, connection) && connection.getPeersNodeAddressOptional().isPresent()) seedNodeAddresses.remove(connection.getPeersNodeAddressOptional().get()); }

Target:
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) { log.info("onDisconnect closeConnectionReason={}, nodeAddressOpt={}", closeConnectionReason, connection.getPeersNodeAddressOptional()); closeHandler(connection); if (retryTimer == null) { retryTimer = UserThread.runAfter(() -> { log.trace("ConnectToMorePeersTimer called from onDisconnect code path"); stopRetryTimer(); requestWithAvailablePeers(); }, RETRY_DELAY_SEC); } if (peerManager.isPeerBanned(closeConnectionReason, connection)) { connection.getPeersNodeAddressOptional().ifPresent(seedNodeAddresses::remove); } }
Source:
public BigDecimal convert(String value, Class<? extends BigDecimal> type) { if (isNullOrEmpty(value)) { return null; } try { return new BigDecimal(value); } catch (NumberFormatException e) { throw new ConversionException(new I18nMessage("", "is_not_a_valid_number", value)); } }

Target:
public BigDecimal convert(String value, Class<? extends BigDecimal> type) { if (isNullOrEmpty(value)) { return null; } try { return new BigDecimal(value); } catch (NumberFormatException e) { throw new ConversionException(new ConversionMessage("is_not_a_valid_number", value)); } }
Source:
private void checkIconNodeInvalidate(final SWTBotVSMEditor odesignEditor, SWTBotTree tree) { final SWTBotTreeItem treeItem = tree.getTreeItem(ODESIGN).getNode("Group").getNode("emptyName").getNode("diagTest").getNode("Default").getNode("Node").select(); RunnableWithResult<Boolean> runnable = new RunnableWithResult.Impl<Boolean>() { public void run() { treeItem.widget.getDisplay().syncExec(new Runnable() { public void run() { Image treeItemImageDisplay = treeItem.widget.getImage(); CustomSiriusEditor treeEditor = (CustomSiriusEditor) odesignEditor.getReference().getEditor(false); Image treeItemImageExpected = imageComposer.getImageOfEditPlugin(treeEditor.getAdapterFactory(), (EObject) treeItem.widget.getData()); setResult(ImageEquality.areEqualImages(treeItemImageExpected, treeItemImageDisplay)); } }); } }; treeItem.widget.getDisplay().syncExec(runnable); assertTrue("A red cross must appear on the image of the node mapping.", ((Boolean) runnable.getResult()).booleanValue()); }

Target:
private void checkIconNodeInvalidate(final SWTBotVSMEditor odesignEditor, SWTBotTree tree) { final SWTBotTreeItem treeItem = tree.getTreeItem(ODESIGN).getNode("Group").getNode("emptyName").getNode("diagTest").getNode("Default").getNode("Node").select(); RunnableWithResult<Boolean> runnable = new RunnableWithResult.Impl<Boolean>() { public void run() { treeItem.widget.getDisplay().syncExec(new Runnable() { public void run() { Image treeItemImageDisplay = treeItem.widget.getImage(); SiriusEditor treeEditor = (CustomSiriusEditor) odesignEditor.getReference().getEditor(false); ImageComposer imageComposer = new ImageComposer(); Image treeItemImageExpected = imageComposer.getImageOfEditPlugin(treeEditor.getAdapterFactory(), (EObject) treeItem.widget.getData()); setResult(ImageEquality.areEqualImages(treeItemImageExpected, treeItemImageDisplay)); } }); } }; treeItem.widget.getDisplay().syncExec(runnable); assertTrue("A red cross must appear on the image of the node mapping.", runnable.getResult().booleanValue()); }
Source:
void reset() { LOG.info("Reset HelixTaskExecutor"); if (_messageQueueMonitor != null) { _messageQueueMonitor.reset(); } for (String msgType : _hdlrFtyRegistry.keySet()) { ExecutorService pool = _executorMap.remove(msgType); _monitor.removeExecutorMonitor(msgType); if (pool != null) { LOG.info("Reset exectuor for msgType: " + msgType + ", pool: " + pool); shutdownAndAwaitTermination(pool); } MsgHandlerFactoryRegistryItem item = _hdlrFtyRegistry.get(msgType); if (item.factory() != null) { item.factory().reset(); } } for (String msgType : _executorMap.keySet()) { ExecutorService pool = _executorMap.remove(msgType); LOG.info("Reset exectuor for msgType: " + msgType + ", pool: " + pool); shutdownAndAwaitTermination(pool); } StringBuilder sb = new StringBuilder(); for (String taskId : _taskMap.keySet()) { MessageTaskInfo info = _taskMap.get(taskId); sb.append("Task: " + taskId + " fails to terminate. Message: " + info._task.getMessage() + "\n"); } LOG.info(sb.toString()); _taskMap.clear(); _messageTaskMap.clear(); _knownMessageIds.clear(); _lastSessionSyncTime = null; }

Target:
void reset() { LOG.info("Reset HelixTaskExecutor"); if (_messageQueueMonitor != null) { _messageQueueMonitor.reset(); } for (String msgType : _hdlrFtyRegistry.keySet()) { ExecutorService pool = _executorMap.remove(msgType); _monitor.removeExecutorMonitor(msgType); if (pool != null) { LOG.info("Reset exectuor for msgType: " + msgType + ", pool: " + pool); shutdownAndAwaitTermination(pool); } MsgHandlerFactoryRegistryItem item = _hdlrFtyRegistry.get(msgType); if (item.factory() != null) { try { item.factory().reset(); } catch (Exception ex) { LOG.error("Failed to reset the factory of message type {}.", item.factory().toString(), msgType, ex); } } } StringBuilder sb = new StringBuilder(); for (String taskId : _taskMap.keySet()) { MessageTaskInfo info = _taskMap.get(taskId); sb.append( "Task: " + taskId + " fails to terminate. Message: " + info._task.getMessage() + "\n"); } LOG.info(sb.toString()); _taskMap.clear(); _messageTaskMap.clear(); _knownMessageIds.clear(); _lastSessionSyncTime = null; }
Source:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> { FileVisitor visitor = new FileVisitor(); ctx.syntaxNode().accept(visitor); if (visitor.numberOfLines > maximum) { String message = "File \"{0}\" has {1} lines, which is greater than {2} authorized. Split it into smaller files."; ctx.addFileIssue(MessageFormat.format(message, ctx.pythonFile().fileName(), visitor.numberOfLines, maximum)); } }); }

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> { FileVisitor visitor = new FileVisitor(); ctx.syntaxNode().accept(visitor); if (visitor.numberOfLines > maximum) { ctx.addFileIssue(MessageFormat.format(MESSAGE, ctx.pythonFile().fileName(), visitor.numberOfLines, maximum)); } }); }
Source:
private void addFilterCriteriaToQuery(Query query, List<VariantEntityRepositoryFilter> filters) { if ((filters != null) && (filters.size() > 0)){ List<Criteria> criteriaList = getFiltersCriteria(filters); for (Criteria criteria : criteriaList) { query.addCriteria(criteria); } } }

Target:
private void addFilterCriteriaToQuery(Query query, List<VariantEntityRepositoryFilter> filters) { if (filters != null && filters.size() > 0){ List<Criteria> criteriaList = getFiltersCriteria(filters); for (Criteria criteria : criteriaList) { query.addCriteria(criteria); } } }
Source:
default String getLabel() { return getElement().getProperty(ElementConstants.LABEL_PROPERTY_NAME, ""); }

Target:
default String getLabel() { return getElement().getProperty(ElementConstants.LABEL_PROPERTY_NAME, null); }
Source:
public QueryRunner<Result<SelectResultValue>> preMergeQueryDecoration(QueryRunner<Result<SelectResultValue>> runner) { return new UnionQueryRunner<Result<SelectResultValue>>( new IntervalChunkingQueryRunner<Result<SelectResultValue>>( runner, config.getChunkPeriod() ) ); }

Target:
public QueryRunner<Result<SelectResultValue>> preMergeQueryDecoration(QueryRunner<Result<SelectResultValue>> runner) { return new IntervalChunkingQueryRunner<Result<SelectResultValue>>( runner, config.getChunkPeriod() ); }
Source:
public void rpmVersionTest() { assertEquals("2.3.235.0", new RpmVersion("rhev-agent-2.3.235-1.el6").getValue()); assertEquals("2.3.17.0", new RpmVersion("rhev-agent-2.3.17-1.el6").getValue()); assertEquals("2.133.4.5", new RpmVersion("glibc-devel-2.133.4.5-1.x86_64").getValue()); assertEquals("10.6.2.0", new RpmVersion("test-javadb-common-10.6.2-1.1.i386").getValue()); assertEquals("10.6.2.3", new RpmVersion("test-javadb-common-10.6.2.3.3-1.1.i386").getValue()); assertEquals(0, new RpmVersion("").getValue().length()); assertEquals(0, new RpmVersion(null).getValue().length()); }

Target:
public void rpmVersionTest() { assertEquals("2.3.235.0", new RpmVersion("rhev-agent-2.3.235-1.el6").getValue()); assertEquals("2.3.17.0", new RpmVersion("rhev-agent-2.3.17-1.el6").getValue()); assertEquals("2.133.4.5", new RpmVersion("glibc-devel-2.133.4.5-1.x86_64").getValue()); assertEquals("10.6.2.0", new RpmVersion("test-javadb-common-10.6.2-1.1.i386").getValue()); assertEquals("10.6.2.3", new RpmVersion("test-javadb-common-10.6.2.3.3-1.1.i386").getValue()); assertTrue(new RpmVersion("").getValue().isEmpty()); assertTrue(new RpmVersion(null).getValue().isEmpty()); }
Source:
ILocalTopology submitTopology(String topologyName, Map<String, Object> conf, StormTopology topology) throws TException; ILocalTopology submitTopologyWithOpts(String topologyName, Map<String, Object> conf, StormTopology topology, SubmitOptions submitOpts) throws TException; void uploadNewCredentials(String topologyName, Credentials creds) throws TException; void killTopology(String topologyName) throws TException; void killTopologyWithOpts(String name, KillOptions options) throws TException; void activate(String topologyName) throws TException; void deactivate(String topologyName) throws TException; void rebalance(String name, RebalanceOptions options) throws TException; @Deprecated void shutdown(); String getTopologyConf(String id) throws TException; StormTopology getTopology(String id) throws TException; ClusterSummary getClusterInfo() throws TException; java.util.List<TopologySummary> getTopologySummaryInfo() throws AuthorizationException, TException; TopologySummary getTopologySummaryByName(java.lang.String name) throws AuthorizationException, TException; TopologySummary getTopologySummaryById(java.lang.String id) throws AuthorizationException, TException; TopologyInfo getTopologyInfo(String id) throws TException; IStormClusterState getClusterState(); void advanceClusterTime(int secs) throws InterruptedException; void advanceClusterTime(int secs, int step) throws InterruptedException; String getTrackedId(); interface ILocalTopology extends AutoCloseable { }

Target:
ILocalTopology submitTopology(String topologyName, Map<String, Object> conf, StormTopology topology) throws TException; ILocalTopology submitTopologyWithOpts(String topologyName, Map<String, Object> conf, StormTopology topology, SubmitOptions submitOpts) throws TException; void uploadNewCredentials(String topologyName, Credentials creds) throws TException; void killTopology(String topologyName) throws TException; void killTopologyWithOpts(String name, KillOptions options) throws TException; void activate(String topologyName) throws TException; void deactivate(String topologyName) throws TException; void rebalance(String name, RebalanceOptions options) throws TException; @Deprecated void shutdown(); String getTopologyConf(String id) throws TException; StormTopology getTopology(String id) throws TException; ClusterSummary getClusterInfo() throws TException; List<TopologySummary> getTopologySummaries() throws TException; TopologySummary getTopologySummaryByName(String name) throws TException; TopologySummary getTopologySummary(String id) throws TException; TopologyInfo getTopologyInfo(String id) throws TException; TopologyInfo getTopologyInfoByName(String name) throws TException; TopologyInfo getTopologyInfoWithOpts(String id, GetInfoOptions options) throws TException; TopologyInfo getTopologyInfoByNameWithOpts(String name, GetInfoOptions options) throws TException; IStormClusterState getClusterState(); void advanceClusterTime(int secs) throws InterruptedException; void advanceClusterTime(int secs, int step) throws InterruptedException; String getTrackedId(); interface ILocalTopology extends AutoCloseable { }
Source:
private Object decodeSrt(Channel channel, SocketAddress remoteAddress, String sentence) { Parser parser = new Parser(PATTERN_SRT, sentence); if (!parser.matches()) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } position.setDeviceId(deviceSession.getDeviceId()); position.setLatitude(parser.nextDouble()); position.setLongitude(parser.nextDouble()); DateBuilder dateBuilder = new DateBuilder(TimeZone.getTimeZone("Asia/Calcutta")) .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); position.set(Position.KEY_VERSION, parser.next()); parser.next(); return position; }

Target:
private Object decodeSrt(Channel channel, SocketAddress remoteAddress, String sentence) { Parser parser = new Parser(PATTERN_SRT, sentence); if (!parser.matches()) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } position.setDeviceId(deviceSession.getDeviceId()); position.setLatitude(parser.nextDouble()); position.setLongitude(parser.nextDouble()); DateBuilder dateBuilder = new DateBuilder(timeZone) .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); position.set(Position.KEY_VERSION, parser.next()); parser.next(); return position; }
Source:
public void handle(MethodInvocationTree tree, AnnotatedExecutableType method) { if (TreeUtils.isMethodInvocation(tree, collectionToArrayE, processingEnv)) { assert !tree.getArguments().isEmpty() : tree; ExpressionTree argument = tree.getArguments().get(0); boolean argIsArrayCreation = isHandledArrayCreation(argument, receiverName(tree.getMethodSelect())); boolean receiverIsNonNull = isNonNullReceiver(tree); boolean argIsHandled = argIsArrayCreation || isArrayLenZeroFieldAccess(argument); setComponentNullness(receiverIsNonNull && argIsHandled, method.getReturnType()); if (!receiverIsNonNull) { setComponentNullness(false, method.getParameterTypes().get(0)); } } }

Target:
public void handle(MethodInvocationTree tree, AnnotatedExecutableType method) { if (TreeUtils.isMethodInvocation(tree, collectionToArrayE, processingEnv)) { assert !tree.getArguments().isEmpty() : tree; ExpressionTree argument = tree.getArguments().get(0); boolean receiverIsNonNull = receiverIsCollectionOfNonNullElements(tree); boolean argIsHandled = isHandledArrayCreation(argument, receiverName(tree.getMethodSelect())) || (trustArrayLenZero && isArrayLenZeroFieldAccess(argument)); setComponentNullness(receiverIsNonNull && argIsHandled, method.getReturnType()); if (!receiverIsNonNull) { setComponentNullness(false, method.getParameterTypes().get(0)); } if (receiverIsNonNull && !argIsHandled) { if (argument.getKind() != Tree.Kind.NEW_ARRAY) { checker.reportWarning(tree, "toArray.nullable.elements.not.newarray"); } else { checker.reportWarning(tree, "toArray.nullable.elements.mismatched.size"); } } } }
Source:
private boolean createCertificateRequest(final ClientHello clientHello, final DTLSFlight flight) throws HandshakeException { if ((clientAuthenticationWanted || clientAuthenticationRequired) && negotiatedSignatureAndHashAlgorithms != null && !negotiatedSignatureAndHashAlgorithms.isEmpty()) { CertificateRequest certificateRequest = new CertificateRequest(session.getPeer()); certificateRequest.addCertificateType(ClientCertificateType.ECDSA_SIGN); List<SignatureAndHashAlgorithm> serverOrdered = SignatureAndHashAlgorithm.getCommonSignatureAlgorithms( supportedSignatureAndHashAlgorithms, negotiatedSignatureAndHashAlgorithms); certificateRequest.addSignatureAlgorithms(serverOrdered); if (certificateVerifier != null) { List<X500Principal> subjects = CertPathUtil.toSubjects(Arrays.asList(certificateVerifier.getAcceptedIssuers())); certificateRequest.addCerticiateAuthorities(subjects); } wrapMessage(flight, certificateRequest); return true; } return false; }

Target:
private boolean createCertificateRequest(final ClientHello clientHello, final DTLSFlight flight) throws HandshakeException { if ((clientAuthenticationWanted || clientAuthenticationRequired) && negotiatedSignatureAndHashAlgorithms != null) { CertificateRequest certificateRequest = new CertificateRequest(session.getPeer()); certificateRequest.addCertificateType(ClientCertificateType.ECDSA_SIGN); List<SignatureAndHashAlgorithm> serverOrdered = SignatureAndHashAlgorithm.getCommonSignatureAlgorithms( supportedSignatureAndHashAlgorithms, negotiatedSignatureAndHashAlgorithms); certificateRequest.addSignatureAlgorithms(serverOrdered); if (certificateVerifier != null) { List<X500Principal> subjects = CertPathUtil.toSubjects(Arrays.asList(certificateVerifier.getAcceptedIssuers())); certificateRequest.addCerticiateAuthorities(subjects); } wrapMessage(flight, certificateRequest); return true; } return false; }
Source:
private void validate() { if (useJdbcStore != null && useJdbcStore && storeDatasource != null && storeDatasource.equals("")) { throw new IllegalArgumentException("" + "Jdbc store datasource must be presented along with enabled using Jdbc store"); } }

Target:
private void validate() { if (useJdbcStore != null && useJdbcStore && storeDatasource != null && storeDatasource.equals("")) { throw new IllegalArgumentException("" + "JDBC store datasource must be presented along with enabled using JDBC store"); } }
Source:
public static String updateStatusVar(LcnDefs.Var var, int value) throws IllegalArgumentException { int id = LcnDefs.Var.toVarId(var); if (id != -1) { int x2cmd = id |= 0x40; int b1 = (value >> 8) & 0xff; int b2 = value & 0xff; return String.format("X2%03d%03d%03d", x2cmd, b1, b2); } throw new IllegalArgumentException(); }

Target:
public static String updateStatusVar(LcnDefs.Var var, int value) throws IllegalArgumentException { int id = LcnDefs.Var.toVarId(var); if (id != -1) { int x2cmd = id | 0x40; int b1 = (value >> 8) & 0xff; int b2 = value & 0xff; return String.format("X2%03d%03d%03d", x2cmd, b1, b2); } throw new IllegalArgumentException(); }
Source:
private void rewriteProcessMetadata(List<Prozess> processes) { String currentProcessTitele = null; for (Prozess process : processes) { try { currentProcessTitele = process.getTitel(); Fileformat gdzfile = process.readMetadataFile(); process.writeMetadataFile(gdzfile); Helper.setMeldung("rewriteOk", currentProcessTitele); } catch (Exception e) { StringBuilder message = new StringBuilder(127); if (currentProcessTitele != null) { message.append(currentProcessTitele); message.append(": "); } message.append(e.getClass().getSimpleName()); if (e.getMessage() != null) { message.append(": "); message.append(e.getMessage()); } Helper.setFehlerMeldung("rewriteError", message.toString()); } } }

Target:
private void rewriteProcessMetadata(List<Prozess> processes) { for (Prozess process : processes) { String currentProcessTitle = null; try { currentProcessTitle = process.getTitel(); Fileformat gdzfile = process.readMetadataFile(); process.writeMetadataFile(gdzfile); Helper.setMeldung("rewriteOk", currentProcessTitle); } catch (Exception e) { StringBuilder message = new StringBuilder(127); if (currentProcessTitle != null) { message.append(currentProcessTitle); message.append(": "); } message.append(e.getClass().getSimpleName()); if (e.getMessage() != null) { message.append(": "); message.append(e.getMessage()); } Helper.setFehlerMeldung("rewriteError", message.toString()); } } }
Source:
public void run() { while (inScanner.hasNextLine() && !isCanceled()) { String line = inScanner.nextLine(); lines.add(line); } }

Target:
public void run() { while (inScanner.hasNextLine() && !isCanceled()) { synchronized(this) { if( !isCanceled()) { lines.add(inScanner.nextLine()); } } } }
Source:
private long profile( PagedFile file, Profile[] existingProfiles ) throws IOException { long pagesInMemory = 0; Profile nextProfile = filterRelevant( existingProfiles, file ) .max( naturalOrder() ) .map( Profile::next ) .orElse( Profile.first( file.file() ) ); try ( OutputStream output = nextProfile.write( fs ); PageCursor cursor = file.io( 0, PF_SHARED_READ_LOCK | PF_NO_FAULT ) ) { int stepper = 0; int b = 0; for ( ; ; ) { if ( !cursor.next() ) { break; } if ( cursor.getCurrentPageId() != PageCursor.UNBOUND_PAGE_ID ) { pagesInMemory++; b |= 1 << stepper; } stepper++; if ( stepper == 8 ) { output.write( b ); b = 0; stepper = 0; } } output.write( b ); output.flush(); } filterRelevant( existingProfiles, file ) .filter( profile -> !refCounts.contains( profile ) ) .forEach( profile -> profile.delete( fs ) ); return pagesInMemory; }

Target:
private long profile( PagedFile file, Profile[] existingProfiles ) throws IOException { long pagesInMemory = 0; Profile nextProfile = filterRelevant( existingProfiles, file ) .max( naturalOrder() ) .map( Profile::next ) .orElse( Profile.first( file.file() ) ); try ( OutputStream output = nextProfile.write( fs ); PageCursor cursor = file.io( 0, PF_SHARED_READ_LOCK | PF_NO_FAULT ) ) { int stepper = 0; int b = 0; while ( cursor.next() ) { if ( cursor.getCurrentPageId() != PageCursor.UNBOUND_PAGE_ID ) { pagesInMemory++; b |= 1 << stepper; } stepper++; if ( stepper == 8 ) { output.write( b ); b = 0; stepper = 0; } } output.write( b ); output.flush(); } filterRelevant( existingProfiles, file ) .filter( profile -> !refCounts.contains( profile ) ) .forEach( profile -> profile.delete( fs ) ); return pagesInMemory; }
Source:
public <V> V apply(InputStream stream, Type type) throws IOException { String data = Strings2.toStringAndClose(stream); Gson gson = new Gson(); Type mapType = new TypeToken<Map<String, Object>>(){}.getType(); Map<String, String> jsonMap = gson.fromJson(data, mapType); Pattern p = Pattern.compile(".*/datacenters/(.*)/servers.*"); Matcher m = p.matcher(jsonMap.get("href")); if (m.matches()) { String dataCenterId = m.group(1); jsonMap.put("dataCenterId", dataCenterId); data = (new Gson()).toJson(jsonMap); } try { return (V) json.fromJson(data, type); } finally { if (stream != null) stream.close(); } }

Target:
public <V> V apply(InputStream stream, Type type) throws IOException { try { return (V) json.fromJson(this.parseService.parseId(Strings2.toStringAndClose(stream), "datacenters", "dataCenterId"), type ); } finally { if (stream != null) stream.close(); } }
Source:
AuthenticationResult acquireTokenWithAssertion() throws AuthenticationException { final String methodName = ":acquireTokenWithAssertion"; Logger.v(TAG + methodName, "Try to get new access token with the provided assertion.", mAuthRequest.getLogInfo(), null); HttpUtil.throwIfNetworkNotAvailable(mContext); final AuthenticationResult result; final String samlAssertion = mAuthRequest.getSamlAssertion(); final String assertionType = mAuthRequest.getAssertionType(); try { final JWSBuilder jwsBuilder = new JWSBuilder(); final Oauth2 oauthRequest = new Oauth2(mAuthRequest, mWebRequestHandler, jwsBuilder); result = oauthRequest.refreshTokenUsingAssertion(samlAssertion, assertionType); if (result != null && StringExtensions.isNullOrBlank(result.getRefreshToken())) { Logger.i(TAG + methodName, "Refresh token is not returned or empty", ""); } } catch (final ServerRespondingWithRetryableException exc) { Logger.e(TAG + methodName, "Error in assertion for request. ", "Request: " + mAuthRequest.getLogInfo() + " " + ExceptionExtensions.getExceptionMessage(exc) + " " + Log.getStackTraceString(exc), ADALError.AUTH_FAILED_NO_TOKEN, null); throw new AuthenticationException( ADALError.AUTH_FAILED_NO_TOKEN, ExceptionExtensions.getExceptionMessage(exc), new AuthenticationException(ADALError.SERVER_ERROR, exc.getMessage(), exc)); } catch (final IOException | AuthenticationException exc) { Logger.e(TAG + methodName, "Error in assertion for request.", "Request: " + mAuthRequest.getLogInfo() + " " + ExceptionExtensions.getExceptionMessage(exc) + " " + Log.getStackTraceString(exc), ADALError.AUTH_FAILED_NO_TOKEN, null); throw new AuthenticationException( ADALError.AUTH_FAILED_NO_TOKEN, ExceptionExtensions.getExceptionMessage(exc), new AuthenticationException(ADALError.SERVER_ERROR, exc.getMessage(), exc)); } return result; }

Target:
AuthenticationResult acquireTokenWithAssertion() throws AuthenticationException { final String methodName = ":acquireTokenWithAssertion"; Logger.v(TAG + methodName, "Try to get new access token with the provided assertion.", mAuthRequest.getLogInfo(), null); HttpUtil.throwIfNetworkNotAvailable(mContext); final AuthenticationResult result; final String samlAssertion = mAuthRequest.getSamlAssertion(); final String assertionType = mAuthRequest.getAssertionType(); try { final JWSBuilder jwsBuilder = new JWSBuilder(); final Oauth2 oauthRequest = new Oauth2(mAuthRequest, mWebRequestHandler, jwsBuilder); result = oauthRequest.refreshTokenUsingAssertion(samlAssertion, assertionType); if (result != null && StringExtensions.isNullOrBlank(result.getRefreshToken())) { Logger.w(TAG + methodName, "Refresh token is not returned or empty"); } } catch (final IOException | AuthenticationException exc) { Logger.e(TAG + methodName, "Error in assertion for request.", "Request: " + mAuthRequest.getLogInfo() + " " + ExceptionExtensions.getExceptionMessage(exc) + " " + Log.getStackTraceString(exc), ADALError.AUTH_FAILED_NO_TOKEN, null); throw new AuthenticationException( ADALError.AUTH_FAILED_NO_TOKEN, ExceptionExtensions.getExceptionMessage(exc), new AuthenticationException(ADALError.SERVER_ERROR, exc.getMessage(), exc)); } return result; }
Source:
private void createCoordinatorStream() { SystemAdmin coordinatorSystemAdmin = null; try { SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config); coordinatorSystemAdmin = systemAdmins.getSystemAdmin(coordinatorSystemStream.getSystem()); LOG.info("Starting the coordinator system admin."); coordinatorSystemAdmin.start(); String streamName = coordinatorSystemStream.getStream(); StreamSpec coordinatorSpec = StreamSpec.createCoordinatorStreamSpec(streamName, coordinatorSystemStream.getSystem()); if (coordinatorSystemAdmin.createStream(coordinatorSpec)) { LOG.info("Created coordinator stream: {}.", streamName); } else { LOG.info("Coordinator stream: already exists.", streamName); } } finally { if (coordinatorSystemAdmin != null) { LOG.info("Stopping the coordinator system admin."); coordinatorSystemAdmin.stop(); } } }

Target:
private void createCoordinatorStream() { SystemAdmin coordinatorSystemAdmin = null; SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config); coordinatorSystemAdmin = systemAdmins.getSystemAdmin(coordinatorSystemStream.getSystem()); String streamName = coordinatorSystemStream.getStream(); StreamSpec coordinatorSpec = StreamSpec.createCoordinatorStreamSpec(streamName, coordinatorSystemStream.getSystem()); if (coordinatorSystemAdmin.createStream(coordinatorSpec)) { LOG.info("Created coordinator stream: {}.", streamName); } else { LOG.info("Coordinator stream: already exists.", streamName); } }
Source:
public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException { super.loadFromJSONObject(jobj, db); m_lookupType = IndexLookupType.get( jobj.getString( Members.LOOKUP_TYPE.name() ) ); m_sortDirection = SortDirectionType.get( jobj.getString( Members.SORT_DIRECTION.name() ) ); m_purpose = jobj.has(Members.PURPOSE.name()) ? jobj.getInt(Members.PURPOSE.name()) : FOR_SCANNING_PERFORMANCE_OR_ORDERING; m_targetIndexName = jobj.getString(Members.TARGET_INDEX_NAME.name()); m_catalogIndex = db.getTables().get(super.m_targetTableName).getIndexes().get(m_targetIndexName); m_endExpression = AbstractExpression.fromJSONChild(jobj, Members.END_EXPRESSION.name(), m_tableScan); m_initialExpression = AbstractExpression.fromJSONChild(jobj, Members.INITIAL_EXPRESSION.name(), m_tableScan); AbstractExpression.loadFromJSONArrayChild(m_searchkeyExpressions, jobj, Members.SEARCHKEY_EXPRESSIONS.name(), m_tableScan); if ( ! jobj.isNull(Members.COMPARE_NOTDISTINCT.name())) { JSONArray jarray = jobj.getJSONArray(Members.COMPARE_NOTDISTINCT.name()); int numCols = jarray.length(); for (int ii = 0; ii < numCols; ++ii) { m_compareNotDistinct.add(jarray.getBoolean(ii)); } } m_skip_null_predicate = AbstractExpression.fromJSONChild(jobj, Members.SKIP_NULL_PREDICATE.name(), m_tableScan); }

Target:
public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException { super.loadFromJSONObject(jobj, db); m_lookupType = IndexLookupType.get( jobj.getString( Members.LOOKUP_TYPE.name() ) ); m_sortDirection = SortDirectionType.get( jobj.getString( Members.SORT_DIRECTION.name() ) ); m_purpose = jobj.has(Members.PURPOSE.name()) ? jobj.getInt(Members.PURPOSE.name()) : FOR_SCANNING_PERFORMANCE_OR_ORDERING; m_targetIndexName = jobj.getString(Members.TARGET_INDEX_NAME.name()); m_catalogIndex = db.getTables().get(super.m_targetTableName).getIndexes().get(m_targetIndexName); m_endExpression = AbstractExpression.fromJSONChild(jobj, Members.END_EXPRESSION.name(), m_tableScan); m_initialExpression = AbstractExpression.fromJSONChild(jobj, Members.INITIAL_EXPRESSION.name(), m_tableScan); AbstractExpression.loadFromJSONArrayChild(m_searchkeyExpressions, jobj, Members.SEARCHKEY_EXPRESSIONS.name(), m_tableScan); loadBooleanArrayFromJSONObject(jobj, Members.COMPARE_NOTDISTINCT.name(), m_compareNotDistinct); m_skip_null_predicate = AbstractExpression.fromJSONChild(jobj, Members.SKIP_NULL_PREDICATE.name(), m_tableScan); }