auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public OidcUser loadUser(OidcUserRequest userRequest) throws OAuth2AuthenticationException { OidcUser oidcUser = oidcUserService.loadUser(userRequest); Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { DefaultOidcUser defaultOidcUser = (DefaultOidcUser) session.getAttribute("defaultOidcUser"); return defaultOidcUser; } Set<String> groups = Optional.of(userRequest) .map(OAuth2UserRequest::getAccessToken) .map(AbstractOAuth2Token::getTokenValue) .map(graphClient::getGroupsFromGraph) .orElseGet(Collections::emptySet); Set<String> groupRoles = groups.stream() .filter(properties::isAllowedGroup) .map(group -> ROLE_PREFIX + group) .collect(Collectors.toSet()); Set<SimpleGrantedAuthority> authorities = groupRoles.stream() .map(SimpleGrantedAuthority::new) .collect(Collectors.toSet()); if (authorities.isEmpty()) { authorities = DEFAULT_AUTHORITY_SET; } String nameAttributeKey = Optional.of(userRequest) .map(OAuth2UserRequest::getClientRegistration) .map(ClientRegistration::getProviderDetails) .map(ClientRegistration.ProviderDetails::getUserInfoEndpoint) .map(ClientRegistration.ProviderDetails.UserInfoEndpoint::getUserNameAttributeName) .filter(StringUtils::hasText) .orElse(AADTokenClaim.NAME); DefaultOidcUser defaultOidcUser = new DefaultOidcUser(authorities, oidcUser.getIdToken(), nameAttributeKey); session.setAttribute("defaultOidcUser", defaultOidcUser); return defaultOidcUser; }

Target:
public OidcUser loadUser(OidcUserRequest userRequest) throws OAuth2AuthenticationException { OidcUser oidcUser = oidcUserService.loadUser(userRequest); Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); HttpSession session = attr.getRequest().getSession(true); if (authentication != null) { return (DefaultOidcUser) session.getAttribute(DEFAULT_OIDC_USER); } Set<String> groups = Optional.of(userRequest) .map(OAuth2UserRequest::getAccessToken) .map(AbstractOAuth2Token::getTokenValue) .map(graphClient::getGroupsFromGraph) .orElseGet(Collections::emptySet); Set<String> groupRoles = groups.stream() .filter(properties::isAllowedGroup) .map(group -> ROLE_PREFIX + group) .collect(Collectors.toSet()); Set<SimpleGrantedAuthority> authorities = groupRoles.stream() .map(SimpleGrantedAuthority::new) .collect(Collectors.toSet()); if (authorities.isEmpty()) { authorities = DEFAULT_AUTHORITY_SET; } String nameAttributeKey = Optional.of(userRequest) .map(OAuth2UserRequest::getClientRegistration) .map(ClientRegistration::getProviderDetails) .map(ClientRegistration.ProviderDetails::getUserInfoEndpoint) .map(ClientRegistration.ProviderDetails.UserInfoEndpoint::getUserNameAttributeName) .filter(StringUtils::hasText) .orElse(AADTokenClaim.NAME); DefaultOidcUser defaultOidcUser = new DefaultOidcUser(authorities, oidcUser.getIdToken(), nameAttributeKey); session.setAttribute(DEFAULT_OIDC_USER, defaultOidcUser); return defaultOidcUser; }
Source:
private void putResize (K key, V value) { K[] keyTable = this.keyTable; V[] valueTable = this.valueTable; int b = place(key); for (int i = b; ; i = (i + 1) & mask) { if (keyTable[i] == null) { keyTable[i] = key; valueTable[i] = value; break; } } if (++size >= threshold) { resize(keyTable.length << 1); } }

Target:
private void putResize (K key, V value) { K[] keyTable = this.keyTable; V[] valueTable = this.valueTable; for (int i = place(key); ; i = (i + 1) & mask) { if (keyTable[i] == null) { keyTable[i] = key; valueTable[i] = value; break; } } ++size; }
Source:
public PcapTimestampScale getTimestampPrecision() { if (getTsResolNg(fInterfaceID - 1) == 6) { return PcapTimestampScale.MICROSECOND; } return PcapTimestampScale.NANOSECOND; }

Target:
public PcapTimestampScale getTimestampPrecision() { return PcapTimestampScale.MICROSECOND; }
Source:
public String getCassandraVersion() { ResultSet result = executeWithSession(session -> session.execute("select release_version from system.local where key = 'local'")); Row versionRow = result.one(); if (versionRow != null) { return versionRow.getString("release_version"); } return null; }

Target:
public VersionNumber getCassandraVersion() { ResultSet result = executeWithSession(session -> session.execute("select release_version from system.local")); Row versionRow = result.one(); if (versionRow == null) { throw new PrestoException(CASSANDRA_VERSION_ERROR, "The cluster version is not available. " + "Please make sure that the Cassandra cluster is up and running, " + "and that the contact points are specified correctly."); } return VersionNumber.parse(versionRow.getString("release_version")); }
Source:
@Test public void testMySqlCastToVarcharWithLessThanMaxPrecision() { final String query = "select cast(\"product_id\" as varchar(50)), \"product_id\" " + "from \"product\" "; final String expected = "SELECT CAST(`product_id` AS CHAR(50)), `product_id`\n" + "FROM `foodmart`.`product`"; sql(query).dialect(mySqlDialect(NullCollation.HIGH)).ok(expected); }

Target:
@Test public void testMySqlCastToVarcharWithLessThanMaxPrecision() { final String query = "select cast(\"product_id\" as varchar(50)), \"product_id\" " + "from \"product\" "; final String expected = "SELECT CAST(`product_id` AS CHAR(50)), `product_id`\n" + "FROM `foodmart`.`product`"; sql(query).withMysql().ok(expected); }
Source:
protected void openIntentChooser() throws ActivityNotFoundException { Intent chooser; IntentSender intentSender = null; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1) { intentSender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, intentSender); } else { chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); } chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); if (ShareIntent.hasValidKey("showAppsToView", options) && ShareIntent.hasValidKey("url", options)) { Intent viewIntent = new Intent(Intent.ACTION_VIEW); viewIntent.setType(this.fileShare.getType()); Intent[] viewIntents = this.getIntentsToViewFile(viewIntent, this.fileShare.getURI()); chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, viewIntents); } this.reactContext.getCurrentActivity().startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); if (intentSender == null) { TargetChosenReceiver.sendCallback(true, true, "OK"); } }

Target:
protected void openIntentChooser() throws ActivityNotFoundException { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } Intent chooser; IntentSender intentSender = null; if (TargetChosenReceiver.isSupported()) { intentSender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, intentSender); } else { chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); } chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); if (ShareIntent.hasValidKey("showAppsToView", options) && ShareIntent.hasValidKey("url", options)) { Intent viewIntent = new Intent(Intent.ACTION_VIEW); viewIntent.setType(this.fileShare.getType()); Intent[] viewIntents = this.getIntentsToViewFile(viewIntent, this.fileShare.getURI()); chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, viewIntents); } activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); if (intentSender == null) { TargetChosenReceiver.sendCallback(true, true, "OK"); } }
Source:
private Map<Guid, GlusterAsyncTask> updateTasksInCluster(final VDSGroup cluster) { if (!supportsGlusterAsyncTasksFeature(cluster)) { return null; } Map<Guid, GlusterAsyncTask> runningTasks = getProvider().getTaskListForCluster(cluster.getId()); if (runningTasks == null) { return null; } for (Entry<Guid, GlusterAsyncTask> entry : runningTasks.entrySet()) { Guid taskId = entry.getKey(); final GlusterAsyncTask task = entry.getValue(); List<Step> steps = getStepDao().getStepsByExternalId(taskId); GlusterVolumeEntity volume = getVolumeDao().getVolumeByGlusterTask(taskId); if (steps.isEmpty()) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { try { createJobToMonitor(cluster, task); } catch (VdcBLLException e) { log.error("Error creating job for task from CLI", e); } return null; } }); } for (Step step: steps) { if (step.getEndTime() != null) { continue; } JobExecutionStatus oldStatus = step.getStatus(); step.setDescription(getTaskMessage(cluster, step.getStepType(), task)); step.setStatus(task.getStatus()); if(JobExecutionStatus.FINISHED == task.getStatus()) { if(oldStatus != task.getStatus()) { logMessage(volume.getClusterId(), volume, taskTypeStrMap.get(task.getType()), task.getStatus().name().toLowerCase(), taskTypeAuditMsg.get(task.getType())); } } if (hasTaskCompleted(task)) { step.markStepEnded(task.getStatus()); endStepJob(step); releaseVolumeLock(task.getTaskId()); } else { getJobRepository().updateStep(step); } } } return runningTasks; }

Target:
private Map<Guid, GlusterAsyncTask> updateTasksInCluster(final VDSGroup cluster) { if (!supportsGlusterAsyncTasksFeature(cluster)) { return null; } Map<Guid, GlusterAsyncTask> runningTasks = getProvider().getTaskListForCluster(cluster.getId()); if (runningTasks == null) { return null; } for (Entry<Guid, GlusterAsyncTask> entry : runningTasks.entrySet()) { Guid taskId = entry.getKey(); final GlusterAsyncTask task = entry.getValue(); List<Step> steps = getStepDao().getStepsByExternalId(taskId); if (steps.isEmpty()) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { try { createJobToMonitor(cluster, task); } catch (VdcBLLException e) { log.error("Error creating job for task from CLI", e); } return null; } }); } for (Step step: steps) { if (step.getEndTime() != null) { continue; } JobExecutionStatus oldStatus = step.getStatus(); step.setDescription(getTaskMessage(cluster, step.getStepType(), task)); step.setStatus(task.getStatus()); eventMessageLogger(task, oldStatus, cluster); if (hasTaskCompleted(task)) { step.markStepEnded(task.getStatus()); endStepJob(step); releaseVolumeLock(task.getTaskId()); } else { getJobRepository().updateStep(step); } } } return runningTasks; }
Source:
synchronized void setPresenceStatus(String statusMsg) { if (statusMsg.equals(jvbParticipantStatus)) { return; } if (mucRoom != null) { OperationSetJitsiMeetTools jitsiMeetTools = xmppProvider.getOperationSet( OperationSetJitsiMeetTools.class); jitsiMeetTools.setPresenceStatus(mucRoom, statusMsg); jvbParticipantStatus = statusMsg; } }

Target:
void setPresenceStatus(String statusMsg) { synchronized(statusSync) { if (statusMsg.equals(jvbParticipantStatus)) { return; } jvbParticipantStatus = statusMsg; } if (mucRoom != null) { OperationSetJitsiMeetTools jitsiMeetTools = xmppProvider.getOperationSet( OperationSetJitsiMeetTools.class); jitsiMeetTools.setPresenceStatus(mucRoom, statusMsg); } }
Source:
public void onMessageReceived(String from, Bundle extras) { Log.d(LOG_TAG, "onMessage - from: " + from); if (extras != null) { Context applicationContext = getApplicationContext(); SharedPreferences prefs = applicationContext.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean forceShow = prefs.getBoolean(FORCE_SHOW, false); boolean clearBadge = prefs.getBoolean(CLEAR_BADGE, false); String messageKey = prefs.getString(MESSAGE_KEY, ""); String titleKey = prefs.getString(TITLE_KEY, ""); extras = normalizeExtras(applicationContext, extras, messageKey, titleKey); if (clearBadge) { PushPlugin.setApplicationIconBadgeNumber(getApplicationContext(), 0); } if (!forceShow && PushPlugin.isInForeground()) { Log.d(LOG_TAG, "foreground"); extras.putBoolean(FOREGROUND, true); extras.putBoolean(COLDSTART, false); PushPlugin.sendExtras(extras); } else if (forceShow && PushPlugin.isInForeground()) { Log.d(LOG_TAG, "foreground force"); extras.putBoolean(FOREGROUND, true); extras.putBoolean(COLDSTART, false); showNotificationIfPossible(applicationContext, extras); } else { Log.d(LOG_TAG, "background"); extras.putBoolean(FOREGROUND, false); extras.putBoolean(COLDSTART, PushPlugin.isActive()); showNotificationIfPossible(applicationContext, extras); } } }

Target:
public void onMessageReceived(String from, Bundle extras) { Log.d(LOG_TAG, "onMessage - from: " + from); if (extras != null) { Context applicationContext = getApplicationContext(); SharedPreferences prefs = applicationContext.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean forceShow = prefs.getBoolean(FORCE_SHOW, false); boolean clearBadge = prefs.getBoolean(CLEAR_BADGE, false); String messageKey = prefs.getString(MESSAGE_KEY, MESSAGE); String titleKey = prefs.getString(TITLE_KEY, TITLE); extras = normalizeExtras(applicationContext, extras, messageKey, titleKey); if (clearBadge) { PushPlugin.setApplicationIconBadgeNumber(getApplicationContext(), 0); } if (!forceShow && PushPlugin.isInForeground()) { Log.d(LOG_TAG, "foreground"); extras.putBoolean(FOREGROUND, true); extras.putBoolean(COLDSTART, false); PushPlugin.sendExtras(extras); } else if (forceShow && PushPlugin.isInForeground()) { Log.d(LOG_TAG, "foreground force"); extras.putBoolean(FOREGROUND, true); extras.putBoolean(COLDSTART, false); showNotificationIfPossible(applicationContext, extras); } else { Log.d(LOG_TAG, "background"); extras.putBoolean(FOREGROUND, false); extras.putBoolean(COLDSTART, PushPlugin.isActive()); showNotificationIfPossible(applicationContext, extras); } } }
Source:
public synchronized void unbuffer() { closeCurrentBlockReaders(); if (curStripeBuf != null) { curStripeBuf.clear(); BUFFER_POOL.putBuffer(curStripeBuf); curStripeBuf = null; } if (parityBuf != null) { parityBuf.clear(); BUFFER_POOL.putBuffer(parityBuf); parityBuf = null; } }

Target:
public synchronized void unbuffer() { super.unbuffer(); if (curStripeBuf != null) { BUFFER_POOL.putBuffer(curStripeBuf); curStripeBuf = null; } if (parityBuf != null) { BUFFER_POOL.putBuffer(parityBuf); parityBuf = null; } }
Source:
public Tuple transformPayload(Map<Object, Object> map) { List<String> newNames = new ArrayList<String>(); List<Object> newValues = new ArrayList<Object>(); for (Object name : map.keySet()) { newNames.add(name.toString()); } for (Object value : map.values()) { newValues.add(value); } return TupleBuilder.tuple().ofNamesAndValues(newNames, newValues); }

Target:
public Tuple transformPayload(Map<Object, Object> map) { List<String> newNames = new ArrayList<String>(); List<Object> newValues = new ArrayList<Object>(); for (Map.Entry<Object, Object> entry: map.entrySet()) { newNames.add(entry.getKey().toString()); newValues.add(entry.getValue()); } return TupleBuilder.tuple().ofNamesAndValues(newNames, newValues); }
Source:
public void setSeverity(String severity) { if(severity == null || (!severity.equals("fatal") && !severity.equals("error") && !severity.equals("warning") && !severity.equals("info"))) { this.severity = "error"; } else { this.severity = severity; } }

Target:
private void setSeverity(String severity) { if(severity == null || !ALLOWED_SEVERITIES.contains(severity)) { this.severity = "error"; } else { this.severity = severity; } }
Source:
private void plugDiskToVmIfNeeded() { if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm()) && getVm() != null && (getVm().getStatus() == VMStatus.Paused || getVm().getStatus() == VMStatus.Up)) { VmDiskOperationParameterBase params = new VmDiskOperationParameterBase(new DiskVmElement(getParameters().getDiskInfo().getId(), getVmId())); params.setShouldBeLogged(false); ActionReturnValue returnValue = runInternalAction(ActionType.HotPlugDiskToVm, params); if (!returnValue.getSucceeded()) { auditLogDirector.log(this, AuditLogType.USER_FAILED_HOTPLUG_DISK); } } }

Target:
private void plugDiskToVmIfNeeded() { if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm()) && getVm() != null && isVmUpOrPaused()) { VmDiskOperationParameterBase params = new VmDiskOperationParameterBase(new DiskVmElement(getParameters().getDiskInfo().getId(), getVmId())); params.setShouldBeLogged(false); ActionReturnValue returnValue = runInternalAction(ActionType.HotPlugDiskToVm, params); if (!returnValue.getSucceeded()) { auditLogDirector.log(this, AuditLogType.USER_FAILED_HOTPLUG_DISK); } } if (!isVmUpOrPaused()) { log.warn("Disk id- '{}' wasn't plug to VM- '{}' because the VM status is- '{}'", getParameters().getDiskInfo().getId(), getVmId(), getVm().getStatus()); } }
Source:
public static List<String> allKeyNames(Propagation<String> propagation) { if (propagation == null) throw new NullPointerException("propagation == null"); TraceContextOrSamplingFlags emptyExtraction = propagation.extractor((c, k) -> null).extract(Boolean.TRUE); List<String> baggageKeyNames = ExtraBaggageContext.getAllKeyNames(emptyExtraction); if (baggageKeyNames.isEmpty()) return propagation.keys(); List<String> result = new ArrayList<>(propagation.keys()); result.addAll(baggageKeyNames); return Collections.unmodifiableList(result); }

Target:
public static List<String> allKeyNames(Propagation<String> propagation) { if (propagation == null) throw new NullPointerException("propagation == null"); TraceContextOrSamplingFlags emptyExtraction = propagation.extractor((c, k) -> null).extract(Boolean.TRUE); List<String> baggageKeyNames = ExtraBaggageContext.getAllKeyNames(emptyExtraction); if (baggageKeyNames.isEmpty()) return propagation.keys(); List<String> result = new ArrayList<>(propagation.keys().size() + baggageKeyNames.size()); result.addAll(propagation.keys()); result.addAll(baggageKeyNames); return Collections.unmodifiableList(result); }
Source:
public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessingException { DeploymentUnit unit = context.getDeploymentUnit(); if (unit.getParent() == null) { SingletonPolicy policy = context.getAttachment(POLICY_KEY); if (policy != null) { CapabilityServiceSupport support = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); if (unit.putAttachment(Attachments.DEPLOYMENT_UNIT_PHASE_BUILDER, new SingletonDeploymentUnitPhaseBuilder(support, policy)) == null) { SingletonLogger.ROOT_LOGGER.singletonDeploymentDetected(policy); ServiceController<?> controller = context.getServiceRegistry().getRequiredService(unit.getServiceName()); controller.addListener(new LifecycleListener() { @Override public void handleEvent(ServiceController<?> controller, LifecycleEvent event) { if(event.equals(LifecycleEvent.DOWN)) { controller.setMode(Mode.ACTIVE); controller.removeListener(this); } } }); controller.setMode(Mode.NEVER); } } } }

Target:
public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessingException { DeploymentUnit unit = context.getDeploymentUnit(); if (unit.getParent() == null) { SingletonPolicy policy = context.getAttachment(POLICY_KEY); if (policy != null) { CapabilityServiceSupport support = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); if (unit.putAttachment(Attachments.DEPLOYMENT_UNIT_PHASE_BUILDER, new SingletonDeploymentUnitPhaseBuilder(support, policy)) == null) { SingletonLogger.ROOT_LOGGER.singletonDeploymentDetected(policy); ServiceController<?> controller = context.getServiceRegistry().getRequiredService(unit.getServiceName()); controller.addListener(this); controller.setMode(Mode.NEVER); } } } }
Source:
protected void updateActionBarTitleAndHomeButton(OCFile chosenFile) { if (chosenFile == null) { chosenFile = getFile(); } super.updateActionBarTitleAndHomeButton(chosenFile); if(chosenFile.getRemotePath().equals("/") && mOnlyAvailableOffline) { updateActionBarTitleAndHomeButtonByString( getResources().getString(R.string.drawer_item_only_available_offline)); } }

Target:
protected void updateActionBarTitleAndHomeButton(OCFile chosenFile) { if (chosenFile == null) { chosenFile = getFile(); } super.updateActionBarTitleAndHomeButton(chosenFile); if(chosenFile.getRemotePath().equals(OCFile.ROOT_PATH) && mOnlyAvailableOffline) { updateActionBarTitleAndHomeButtonByString( getResources().getString(R.string.drawer_item_only_available_offline)); } }
Source:
public void test285130_bulkThreadCreation() throws Exception { AtomicInteger threadCount = new AtomicInteger(); IDebugEventSetListener debugListener = events -> { for (DebugEvent event : events) { if (event.getKind() == DebugEvent.CREATE && event.getSource() instanceof JDIThread) { JDIThread thread = (JDIThread) event.getSource(); try { if (thread.getName().startsWith("bulk-")) { threadCount.incrementAndGet(); } } catch (DebugException e) { } } } }; Map<AbstractDispatchJob, Object> jobs = Collections.synchronizedMap(new IdentityHashMap<AbstractDispatchJob, Object>()); JobChangeAdapter jobListener = new JobChangeAdapter() { @Override public void aboutToRun(IJobChangeEvent event) { Job job = event.getJob(); if (job instanceof AbstractDispatchJob) { jobs.put((AbstractDispatchJob) job, Boolean.TRUE); } } }; DebugPlugin.getDefault().addDebugEventListener(debugListener); Job.getJobManager().addJobChangeListener(jobListener); try { createLineBreakpoint(24, "BulkThreadCreationTest"); launchToBreakpoint("BulkThreadCreationTest"); } finally { removeAllBreakpoints(); DebugPlugin.getDefault().removeDebugEventListener(debugListener); Job.getJobManager().removeJobChangeListener(jobListener); } assertEquals(1000, threadCount.get()); assertEquals(1, jobs.size()); }

Target:
public void test285130_bulkThreadCreation() throws Exception { AtomicInteger threadCount = new AtomicInteger(); IDebugEventSetListener debugListener = events -> { for (DebugEvent event : events) { if (event.getKind() == DebugEvent.CREATE && event.getSource() instanceof JDIThread) { JDIThread thread = (JDIThread) event.getSource(); try { if (thread.getName().startsWith("bulk-")) { threadCount.incrementAndGet(); } } catch (DebugException e) { } } } }; try { createLineBreakpoint(24, "BulkThreadCreationTest"); launchToBreakpoint("BulkThreadCreationTest"); } finally { removeAllBreakpoints(); DebugPlugin.getDefault().removeDebugEventListener(debugListener); } assertEquals(1000, threadCount.get()); assertEquals(1, jobs.size()); }
Source:
protected void doInit() { BeanFactory beanFactory = getBeanFactory(); if (this.gatherChannel == null) { this.gatherChannel = new FixedSubscriberChannel(this.gatherer); } else { if (this.gatherChannel instanceof SubscribableChannel) { this.gatherEndpoint = new EventDrivenConsumer((SubscribableChannel) this.gatherChannel, this.gatherer); } else if (this.gatherChannel instanceof PollableChannel) { this.gatherEndpoint = new PollingConsumer((PollableChannel) this.gatherChannel, this.gatherer); ((PollingConsumer) this.gatherEndpoint).setReceiveTimeout(this.gatherTimeout); } else if (this.gatherChannel instanceof ReactiveStreamsSubscribableChannel) { this.gatherEndpoint = new ReactiveStreamsConsumer(this.gatherChannel, this.gatherer); } else { throw new BeanInitializationException("Unsupported 'replyChannel' type '" + this.gatherChannel.getClass() + "'. " + "'SubscribableChannel', 'PollableChannel' or 'ReactiveStreamsSubscribableChannel' " + "types are supported."); } this.gatherEndpoint.setBeanFactory(beanFactory); this.gatherEndpoint.afterPropertiesSet(); } ((MessageProducer) this.gatherer) .setOutputChannel(new FixedSubscriberChannel(message -> { MessageHeaders headers = message.getHeaders(); MessageChannel gatherResultChannel = headers.get(GATHER_RESULT_CHANNEL, MessageChannel.class); if (gatherResultChannel != null) { this.messagingTemplate.send(gatherResultChannel, message); } else { throw new MessageDeliveryException(message, "The 'gatherResultChannel' header is required to delivery gather result."); } })); }

Target:
protected void doInit() { BeanFactory beanFactory = getBeanFactory(); if (this.gatherChannel == null) { this.gatherChannel = new FixedSubscriberChannel(this.gatherer); } else { if (this.gatherChannel instanceof SubscribableChannel) { this.gatherEndpoint = new EventDrivenConsumer((SubscribableChannel) this.gatherChannel, this.gatherer); } else if (this.gatherChannel instanceof PollableChannel) { this.gatherEndpoint = new PollingConsumer((PollableChannel) this.gatherChannel, this.gatherer); ((PollingConsumer) this.gatherEndpoint).setReceiveTimeout(this.gatherTimeout); } else if (this.gatherChannel instanceof ReactiveStreamsSubscribableChannel) { this.gatherEndpoint = new ReactiveStreamsConsumer(this.gatherChannel, this.gatherer); } else { throw new BeanInitializationException("Unsupported 'replyChannel' type '" + this.gatherChannel.getClass() + "'. " + "'SubscribableChannel', 'PollableChannel' or 'ReactiveStreamsSubscribableChannel' " + "types are supported."); } this.gatherEndpoint.setBeanFactory(beanFactory); this.gatherEndpoint.afterPropertiesSet(); } ((MessageProducer) this.gatherer) .setOutputChannel(new FixedSubscriberChannel(message -> { MessageHeaders headers = message.getHeaders(); MessageChannel gatherResultChannel = headers.get(GATHER_RESULT_CHANNEL, MessageChannel.class); if (gatherResultChannel != null) { this.messagingTemplate.send(gatherResultChannel, message); } else { throw new MessageDeliveryException(message, "The 'gatherResultChannel' header is required to deliver the gather result."); } })); }
Source:
private Feed getExistingFeed(String provenanceName, String feedName) { if (!provenanceFeeds.containsKey(provenanceName)) { provenanceFeeds.put(provenanceName, new ArrayList<>(alertService.getFeedsByProvenanceName(provenanceName))); } return selectUnique(provenanceFeeds.get(provenanceName), having(on(Feed.class).getName(), equalTo(feedName))); }

Target:
private Feed getExistingFeed(String provenanceName, String feedName) { if (!provenanceFeedsMap.containsKey(provenanceName)) { provenanceFeedsMap.put(provenanceName, new ArrayList<>(alertService.getFeedsByProvenanceName(provenanceName))); } return selectUnique(provenanceFeedsMap.get(provenanceName), having(on(Feed.class).getName(), equalToIgnoringCase(feedName))); }
Source:
public boolean addConstituent( final StoreKey repository ) { if ( repository == null ) { return false; } if ( constituents == null ) { constituents = new LinkedList<>(); } synchronized ( monitor ) { if ( constituents.contains( repository ) ) { return false; } if ( repository.getType() == StoreType.hosted ) { ( (LinkedList<StoreKey>) constituents ).push( repository ); return true; } else { return constituents.add( repository ); } } }

Target:
public boolean addConstituent( final StoreKey repository ) { if ( repository == null ) { return false; } synchronized ( constituents ) { if ( constituents.contains( repository ) ) { return false; } if ( isPrependConstituent() ) { constituents.add( 0, repository ); return true; } else { return constituents.add( repository ); } } }
Source:
public SinkRuntimeProvider getSinkRuntimeProvider(Context context) { DataStructureConverter converter = context.createDataStructureConverter(schema.toPhysicalRowDataType()); if (isInsertOnly) { if (runtimeSink.equals("SinkFunction")) { return SinkFunctionProvider.of( new AppendingSinkFunction( tableName, converter)); } else if (runtimeSink.equals("OutputFormat")) { return OutputFormatProvider.of( new AppendingOutputFormat( tableName, converter)); } else { throw new IllegalArgumentException("Unsupported runtime sink class: " + runtimeSink); } } else { assert runtimeSink.equals("SinkFunction"); SinkFunction<RowData> sinkFunction; if (schema.getPrimaryKey().isPresent()) { List<String> fieldNames = Arrays.asList(schema.getFieldNames()); int[] keyIndices = schema.getPrimaryKey().get().getColumns().stream() .mapToInt(fieldNames::indexOf) .toArray(); sinkFunction = new KeyedUpsertingSinkFunction( tableName, converter, keyIndices); } else { sinkFunction = new RetractingSinkFunction( tableName, converter); } return SinkFunctionProvider.of(sinkFunction); } }

Target:
public SinkRuntimeProvider getSinkRuntimeProvider(Context context) { DataStructureConverter converter = context.createDataStructureConverter(schema.toPhysicalRowDataType()); if (isInsertOnly) { if (runtimeSink.equals("SinkFunction")) { return SinkFunctionProvider.of( new AppendingSinkFunction( tableName, converter)); } else if (runtimeSink.equals("OutputFormat")) { return OutputFormatProvider.of( new AppendingOutputFormat( tableName, converter)); } else { throw new IllegalArgumentException("Unsupported runtime sink class: " + runtimeSink); } } else { assert runtimeSink.equals("SinkFunction"); SinkFunction<RowData> sinkFunction; if (schema.getPrimaryKey().isPresent()) { int[] keyIndices = TableSchemaUtils.getPrimaryKeyIndices(schema); sinkFunction = new KeyedUpsertingSinkFunction( tableName, converter, keyIndices); } else { sinkFunction = new RetractingSinkFunction( tableName, converter); } return SinkFunctionProvider.of(sinkFunction); } }
Source:
public static boolean bindProperties(CamelContext camelContext, Object target, Map<String, Object> properties, String optionPrefix, boolean nesting, boolean deepNesting, boolean fluentBuilder, boolean reference, boolean placeholder) { org.apache.camel.util.ObjectHelper.notNull(camelContext, "camelContext"); org.apache.camel.util.ObjectHelper.notNull(target, "target"); org.apache.camel.util.ObjectHelper.notNull(properties, "properties"); boolean rc = false; setReferenceProperties(camelContext, target, properties); for (Iterator<Map.Entry<String, Object>> iter = properties.entrySet().iterator(); iter.hasNext();) { Map.Entry<String, Object> entry = iter.next(); String key = entry.getKey(); Object value = entry.getValue(); if (isNotEmpty(optionPrefix)) { if (!key.startsWith(optionPrefix)) { return false; } key = key.substring(optionPrefix.length()); } if (entry != null) { if (bindProperty(camelContext, target, key, value, nesting, deepNesting, fluentBuilder, reference, placeholder)) { iter.remove(); rc = true; } } } return rc; }

Target:
public static boolean bindProperties(CamelContext camelContext, Object target, Map<String, Object> properties, String optionPrefix, boolean nesting, boolean deepNesting, boolean fluentBuilder, boolean reference, boolean placeholder) { org.apache.camel.util.ObjectHelper.notNull(camelContext, "camelContext"); org.apache.camel.util.ObjectHelper.notNull(target, "target"); org.apache.camel.util.ObjectHelper.notNull(properties, "properties"); boolean rc = false; setReferenceProperties(camelContext, target, properties); for (Iterator<Map.Entry<String, Object>> iter = properties.entrySet().iterator(); iter.hasNext();) { Map.Entry<String, Object> entry = iter.next(); String key = entry.getKey(); Object value = entry.getValue(); if (isNotEmpty(optionPrefix)) { if (!key.startsWith(optionPrefix)) { continue; } key = key.substring(optionPrefix.length()); } if (entry != null) { if (bindProperty(camelContext, target, key, value, nesting, deepNesting, fluentBuilder, reference, placeholder)) { iter.remove(); rc = true; } } } return rc; }
Source:
private PasswordAuthentication createPasswordAuthentication() { if (! (Strings.isNullOrEmpty(getProxyUserSystemProperty()) || Strings.isNullOrEmpty(getProxyPasswordSystemProperty()))) { return new PasswordAuthentication(getProxyUserSystemProperty(), getProxyPasswordSystemProperty().toCharArray()); } else { return null; } }

Target:
private PasswordAuthentication createPasswordAuthentication() { if (! (isNullOrEmpty(getProxyUserSystemProperty()) || isNullOrEmpty(getProxyPasswordSystemProperty()))) { return new PasswordAuthentication(getProxyUserSystemProperty(), getProxyPasswordSystemProperty().toCharArray()); } else { return null; } }
Source:
public ObjectName createName(String type, String domain, String name) { try { MetaData metaData; metaData = metaDataMap.get(name); Map<String, String> tags = metaData.getTags(); Hashtable<String, String> table = new Hashtable<>(); table.putAll(tags); ObjectName objectName = new ObjectName(domain, table); return objectName; } catch (MalformedObjectNameException e) { try { return new ObjectName(domain, "name", ObjectName.quote(name)); } catch (MalformedObjectNameException e1) { LOGGER.warn("Unable to register {}", type, name, e1); throw new RuntimeException(e1); } } }

Target:
public ObjectName createName(String type, String domain, String name) { try { Hashtable<String, String> table = new Hashtable<>(); table.putAll(metaDataMap.get(name).getTags()); table.replaceAll((k,v) -> needsQuote(v) ? ObjectName.quote(v): v ); return new ObjectName(domain, table); } catch (MalformedObjectNameException e) { LOGGER.warn("Unable to register {" + type + "} {" + name + "}", e); throw new RuntimeException(e); } }
Source:
protected OperationTracker getOperationTracker(PartitionId partitionId) { OperationTracker operationTracker; String trackerType = routerConfig.routerGetOperationTrackerType; if (trackerType.equals(SimpleOperationTracker.class.getCanonicalName())) { operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, routerConfig.routerGetCrossDcEnabled, routerConfig.routerGetSuccessTarget, routerConfig.routerGetRequestParallelism); } else if (trackerType.equals(AdaptiveOperationTracker.class.getCanonicalName())) { operationTracker = new AdaptiveOperationTracker(routerConfig.routerDatacenterName, partitionId, routerConfig.routerGetCrossDcEnabled, routerConfig.routerGetSuccessTarget, routerConfig.routerGetRequestParallelism, time, localColoTracker, crossColoTracker, pastDueCounter, routerConfig.routerLatencyToleranceQuantile); } else { throw new IllegalArgumentException("Unrecognized tracker type: " + trackerType); } return operationTracker; }

Target:
protected OperationTracker getOperationTracker(PartitionId partitionId) { OperationTracker operationTracker; String trackerType = routerConfig.routerGetOperationTrackerType; if (trackerType.equals(SimpleOperationTracker.class.getSimpleName())) { operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, routerConfig.routerGetCrossDcEnabled, routerConfig.routerGetSuccessTarget, routerConfig.routerGetRequestParallelism); } else if (trackerType.equals(AdaptiveOperationTracker.class.getSimpleName())) { operationTracker = new AdaptiveOperationTracker(routerConfig.routerDatacenterName, partitionId, routerConfig.routerGetCrossDcEnabled, routerConfig.routerGetSuccessTarget, routerConfig.routerGetRequestParallelism, time, localColoTracker, crossColoTracker, pastDueCounter, routerConfig.routerLatencyToleranceQuantile); } else { throw new IllegalArgumentException("Unrecognized tracker type: " + trackerType); } return operationTracker; }
Source:
public void getAllSimilarAttributeNames() throws Exception { System.out.println(CLASS_NAME + "getAllSimilarAttributeNames"); String name = "urn:perun:user:attribute-def:def:login-namespace"; List<String> similarAttrNames = perun.getAttributesManagerBl().getAllSimilarAttributeNames(sess, name); assertTrue("returned less than 0 names",similarAttrNames.size() > 0); }

Target:
public void getAllSimilarAttributeNames() throws Exception { System.out.println(CLASS_NAME + "getAllSimilarAttributeNames"); String name = "urn:perun:user:attribute-def:def:login-namespace"; List<String> similarAttrNames = perun.getAttributesManagerBl().getAllSimilarAttributeNames(sess, name); assertFalse("returned no names", similarAttrNames.isEmpty()); }
Source:
public void testModeShapeInMemory() throws Exception { Map<String, URL> parameters = new HashMap<String, URL>(); parameters.put(JcrRepositoryFactory.URL, getClass().getClassLoader().getResource("configRepository.json")); RunnerConfiguration runnerConfig = new RunnerConfiguration().addTestsToExclude( TwoWayJoinTestSuite.class.getSimpleName(), ThreeWayJoinTestSuite.class.getSimpleName(), BigFileReadTestSuite.class.getSimpleName(), SmallFileReadTestSuite.class.getSimpleName()); new PerformanceTestSuiteRunner(runnerConfig).runPerformanceTests(parameters, null); }

Target:
public void testModeShapeInMemory() throws Exception { Map<String, URL> parameters = new HashMap<String, URL>(); parameters.put(JcrRepositoryFactory.URL, getClass().getClassLoader().getResource("configRepository.json")); performanceTestSuiteRunner.runPerformanceTests(parameters, null); }
Source:
public void onResume() { super.onResume(); launchPull( Session.getCredentials() == null || Session.getCredentials().isDemoCredentials()); }

Target:
public void onResume() { super.onResume(); if (Session.getCredentials() != null) { launchPull(Session.getCredentials().isDemoCredentials()); } }
Source:
public Object readSqlResultRecord(ResultSet result) { CitationCollectionOrder citationCollectionOrder = null; String collectionId = null; String citationId = null; int location = 0; CitationCollectionOrder.SectionType sectionType = null; String value = null; try { collectionId = result.getString(1); citationId = result.getString(2); location = result.getInt(3); sectionType = CitationCollectionOrder.SectionType.valueOf(result.getString(4)); value = result.getString(5); citationCollectionOrder = new CitationCollectionOrder(collectionId, citationId, location, sectionType, value); } catch (SQLException e) { M_log.debug("TripleReader: problem reading CitationCollectionOrder from result: collectionId(" + collectionId + ") location(" + location + ") sectionType(" + sectionType + ") value(" + value + ")"); return null; } return citationCollectionOrder; }

Target:
public Object readSqlResultRecord(ResultSet result) { CitationCollectionOrder citationCollectionOrder = null; String collectionId = null; String citationId = null; int location = 0; CitationCollectionOrder.SectionType sectionType = null; String value = null; try { collectionId = result.getString(1); citationId = result.getString(2); location = result.getInt(3); sectionType = CitationCollectionOrder.SectionType.valueOf(result.getString(4)); value = result.getString(5); citationCollectionOrder = new CitationCollectionOrder(collectionId, citationId, location, sectionType, value); } catch (SQLException e) { M_log.warn("TripleReader: problem reading CitationCollectionOrder from result: collectionId(" + collectionId + ") location(" + location + ") sectionType(" + sectionType + ") value(" + value + ")"); return null; } return citationCollectionOrder; }
Source:
private static TextAttributesKey getColor(GoNamedSignatureOwner o) { if (GoPsiImplUtil.isBuiltinFile(o.getContainingFile())) return BUILTIN_FUNCTION; return o.isPublic() ? EXPORTED_FUNCTION : LOCAL_FUNCTION; }

Target:
private static TextAttributesKey getColor(GoNamedSignatureOwner o) { if (GoPsiImplUtil.builtin(o)) return BUILTIN_FUNCTION; return o.isPublic() ? EXPORTED_FUNCTION : LOCAL_FUNCTION; }
Source:
public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (isVisibleToUser) { if (getActivity() != null && getActivity() instanceof SnackbarStatusListener) { if (!NetworkUtil.isConnected(getActivity())) { ((SnackbarStatusListener) getActivity()).resetSnackbarVisibility(authWebView.isShowingError()); } } } }

Target:
public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); CourseTabsUtils.setUserVisibleHint(getActivity(), isVisibleToUser, authWebView != null && authWebView.isShowingError()); }
Source:
public void testExactExpirationOnRead() throws Exception { initTest(StateTtlConfig.UpdateType.OnReadAndWrite, StateTtlConfig.StateVisibility.NeverReturnExpired); timeProvider.time = 0; ctx().update(ctx().updateEmpty); takeAndRestoreSnapshot(); timeProvider.time = 50; assertEquals(UNEXPIRED_AVAIL, ctx().getUpdateEmpty, ctx().get()); takeAndRestoreSnapshot(); timeProvider.time = 120; assertEquals("Unexpired state should be available after read", ctx().getUpdateEmpty, ctx().get()); takeAndRestoreSnapshot(); timeProvider.time = 250; assertEquals(EXPIRED_UNAVAIL, ctx().emptyValue, ctx().get()); assertTrue(ctx().isOriginalEmptyValue()); }

Target:
public void testExactExpirationOnRead() throws Exception { initTest(StateTtlConfig.UpdateType.OnReadAndWrite, StateTtlConfig.StateVisibility.NeverReturnExpired); timeProvider.time = 0; ctx().update(ctx().updateEmpty); takeAndRestoreSnapshot(); timeProvider.time = 50; assertEquals(UNEXPIRED_AVAIL, ctx().getUpdateEmpty, ctx().get()); takeAndRestoreSnapshot(); timeProvider.time = 120; assertEquals("Unexpired state should be available after read", ctx().getUpdateEmpty, ctx().get()); takeAndRestoreSnapshot(); timeProvider.time = 250; assertEquals(EXPIRED_UNAVAIL, ctx().emptyValue, ctx().get()); assertTrue("Original state should be cleared on access", ctx().isOriginalEmptyValue()); }
Source:
public void testCreateBaseEntitlementWithInvalidAddOn() throws AccountApiException, EntitlementApiException { final LocalDate initialDate = new LocalDate(2013, 8, 7); clock.setDay(initialDate); final Account account = accountApi.createAccount(getAccountData(7), callContext); final PlanPhaseSpecifier baseSpec = new PlanPhaseSpecifier("Pistol", ProductCategory.BASE, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null); final PlanPhaseSpecifier addOnSpec = new PlanPhaseSpecifier("Invalid", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null); EntitlementSpecifier baseEntitlementSpecifier = new DefaultEntitlementSpecifier("baseExternalKey", baseSpec, null); EntitlementSpecifier addOnEntitlementSpecifier = new DefaultEntitlementSpecifier("addOnExternalKey", addOnSpec, null); final List<EntitlementSpecifier> specifierList = new ArrayList<EntitlementSpecifier>(); specifierList.add(baseEntitlementSpecifier); specifierList.add(addOnEntitlementSpecifier); testListener.pushExpectedEvents(); try { entitlementApi.createBaseEntitlementWithAddOns(account.getId(), specifierList, initialDate, ImmutableList.<PluginProperty>of(), callContext); fail(); } catch (EntitlementApiException e) { assertEquals(e.getMessage(), "Could not find any product named 'Invalid'"); } assertListenerStatus(); final List<Entitlement> allEntitlementsForAccount = entitlementApi.getAllEntitlementsForAccountId(account.getId(), callContext); assertTrue(allEntitlementsForAccount.size() == 0); }

Target:
public void testCreateBaseEntitlementWithInvalidAddOn() throws AccountApiException, EntitlementApiException { final LocalDate initialDate = new LocalDate(2013, 8, 7); clock.setDay(initialDate); final Account account = accountApi.createAccount(getAccountData(7), callContext); final PlanPhaseSpecifier baseSpec = new PlanPhaseSpecifier("Pistol", ProductCategory.BASE, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null); final PlanPhaseSpecifier addOnSpec = new PlanPhaseSpecifier("Invalid", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null); final String externalKey = "baseExternalKey"; EntitlementSpecifier baseEntitlementSpecifier = new DefaultEntitlementSpecifier(baseSpec, null); EntitlementSpecifier addOnEntitlementSpecifier = new DefaultEntitlementSpecifier(addOnSpec, null); final List<EntitlementSpecifier> specifierList = new ArrayList<EntitlementSpecifier>(); specifierList.add(baseEntitlementSpecifier); specifierList.add(addOnEntitlementSpecifier); try { entitlementApi.createBaseEntitlementWithAddOns(account.getId(), externalKey, specifierList, initialDate, ImmutableList.<PluginProperty>of(), callContext); fail(); } catch (EntitlementApiException e) { assertEquals(e.getMessage(), "Could not find any product named 'Invalid'"); } final List<Entitlement> allEntitlementsForAccount = entitlementApi.getAllEntitlementsForAccountId(account.getId(), callContext); assertTrue(allEntitlementsForAccount.size() == 0); }
Source:
public SearchRefundsResponseFromConnector searchRefunds(Account account, Map<String, String> queryParams) { Response connectorResponse = client .target(connectorUriGenerator.refundsURIWithParams(account, queryParams)) .request() .accept(MediaType.APPLICATION_JSON) .get(); if (connectorResponse.getStatus() == SC_OK) { return connectorResponse.readEntity(SearchRefundsResponseFromConnector.class); } throw new SearchRefundsException(connectorResponse); }

Target:
public SearchRefundsResponseFromConnector searchRefunds(Account account, Map<String, String> queryParams) { Response connectorResponse = client .target(connectorUriGenerator.refundsURIWithParams(account, queryParams)) .request() .accept(MediaType.APPLICATION_JSON) .get(); if (connectorResponse.getStatus() == SC_OK) { try { return connectorResponse.readEntity(SearchRefundsResponseFromConnector.class); } catch (ProcessingException exception) { throw new SearchRefundsException(exception); } } throw new SearchRefundsException(connectorResponse); }
Source:
public URL getQueueUrl() { try { return new URL(String.format("%s/%s", client.getUrl(), queueName)); } catch (MalformedURLException ex) { logger.error("Queue URL is malformed"); throw logger.logExceptionAsError(new RuntimeException("Queue URL is malformed")); } }

Target:
public URL getQueueUrl() { try { return new URL(String.format("%s/%s", client.getUrl(), queueName)); } catch (MalformedURLException ex) { throw logger.logExceptionAsError(new RuntimeException("Queue URL is malformed")); } }
Source:
protected void expand() { int newcapacity = (this.buffer.capacity() + 1) << 1; if (newcapacity < 0) { final int vmBytes = Long.SIZE >> 3; final int javaBytes = 8; @SuppressWarnings("unused") final int headRoom = (vmBytes >= javaBytes) ? vmBytes : javaBytes; newcapacity = Integer.MAX_VALUE - headRoom; if (newcapacity == this.buffer.capacity()) { throw new MessageConstraintException("Maximum buffer size (" + newcapacity + ") exceeded"); } } expandCapacity(newcapacity); }

Target:
protected void expand() throws BufferOverflowException { int newcapacity = (this.buffer.capacity() + 1) << 1; if (newcapacity < 0) { final int vmBytes = Long.SIZE >> 3; final int javaBytes = 8; @SuppressWarnings("unused") final int headRoom = (vmBytes >= javaBytes) ? vmBytes : javaBytes; newcapacity = Integer.MAX_VALUE - headRoom; if (newcapacity <= this.buffer.capacity()) { throw new BufferOverflowException(); } } expandCapacity(newcapacity); }
Source:
public void type() { Expression left = mock(Expression.class); when(left.type()).thenReturn(INT); Expression right = mock(Expression.class); when(right.type()).thenReturn(STR); Token and = mock(Token.class); when(and.value()).thenReturn("and"); assertThat(new BinaryExpressionImpl(left, and, right).type()).isEqualTo(or(INT, STR)); Token or = mock(Token.class); when(or.value()).thenReturn("or"); assertThat(new BinaryExpressionImpl(left, or, right).type()).isEqualTo(or(INT, STR)); Token plus = mock(Token.class); when(plus.value()).thenReturn("+"); assertThat(new BinaryExpressionImpl(left, plus, right).type()).isEqualTo(InferredTypes.anyType()); }

Target:
public void type() { assertThat(lastExpression("42 + 43").type()).isEqualTo(INT); assertThat(lastExpression("'foo' + 'bar'").type()).isEqualTo(STR); assertThat(lastExpression("True + False").type()).isEqualTo(InferredTypes.anyType()); assertThat(lastExpression("42 + ''").type()).isEqualTo(InferredTypes.anyType()); assertThat(lastExpression("'' + 42").type()).isEqualTo(InferredTypes.anyType()); assertThat(lastExpression("'' }
Source:
protected boolean runSyncLunsInfoForBlockStorageDomain(Guid storageDomainId, List<LUNs> storageDomainLuns) { return runInternalAction(VdcActionType.SyncLunsInfoForBlockStorageDomain, new SyncLunsInfoForBlockStorageDomainParameters( storageDomainId, VdsCommandsHelper.getHostForExecution(getParameters().getStoragePoolId()), storageDomainLuns)) .getSucceeded(); }

Target:
protected boolean runSyncLunsInfoForBlockStorageDomain(Guid storageDomainId, List<LUNs> storageDomainLuns) { return runInternalAction(ActionType.SyncLunsInfoForBlockStorageDomain, new SyncLunsInfoForBlockStorageDomainParameters( storageDomainId, VdsCommandsHelper.getHostForExecution(getParameters().getStoragePoolId()), storageDomainLuns)) .getSucceeded(); }
Source:
public void testSqlConsistencyOnEviction() throws Exception { ignitionStart(0); IgniteEx ig = ignitionStart(1); loadData(ig, 0, NUM_ENTITIES); ignitionStart(2); awaitPartitionMapExchange(); for (Ignite g: G.allGrids()) assertEquals(NUM_ENTITIES, query(g, "SELECT * FROM " + POI_TABLE_NAME).size()); }

Target:
public void testSqlConsistencyOnEviction() throws Exception { IgniteEx ig = null; int idx = 0; while (idx <= backupsCount) ig = ignitionStart(idx++); loadData(ig, 0, NUM_ENTITIES); ignitionStart(idx); awaitPartitionMapExchange(); U.await(LATCH, 10, SECONDS); for (Ignite g: G.allGrids()) assertEquals(NUM_ENTITIES, query(g, "SELECT * FROM " + POI_TABLE_NAME).size()); }