auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void refreshLiveInstances(final HelixDataAccessor accessor, Set<HelixConstants.ChangeType> refreshedType) { if (_propertyDataChangedMap.get(HelixConstants.ChangeType.LIVE_INSTANCE).getAndSet(false)) { Map<String, LiveInstance> oldLiveInstances = getLiveInstances(); _liveInstanceCache.refresh(accessor); _updateInstanceOfflineTime = true; refreshedType.add(HelixConstants.ChangeType.LIVE_INSTANCE); long timeOutWindow = _clusterConfig.getMaintenanceOfflineNodeTimeOut(); if (timeOutWindow >= 0 && isMaintenanceModeEnabled()) { for (String instance : _liveInstanceCache.getPropertyMap().keySet()) { if (!oldLiveInstances.containsKey(instance) && isInstanceTimedOutDuringMaintenance( accessor, instance, timeOutWindow)) { _timedOutInstanceDuringMaintenance.add(instance); } } for (String instance : _timedOutInstanceDuringMaintenance) { _liveInstanceCache.deletePropertyByName(instance); } } if (!isMaintenanceModeEnabled()) { _timedOutInstanceDuringMaintenance.clear(); } } else { LogUtil.logInfo(logger, getClusterEventId(), String .format("No live instance change for %s cluster, %s pipeline", _clusterName, getPipelineName())); } }

Target:
private void refreshLiveInstances(final HelixDataAccessor accessor, Set<HelixConstants.ChangeType> refreshedType) { if (_propertyDataChangedMap.get(HelixConstants.ChangeType.LIVE_INSTANCE).getAndSet(false)) { _liveInstanceCache.refresh(accessor); _updateInstanceOfflineTime = true; refreshedType.add(HelixConstants.ChangeType.LIVE_INSTANCE); } else { LogUtil.logInfo(logger, getClusterEventId(), String .format("No live instance change for %s cluster, %s pipeline", _clusterName, getPipelineName())); } }
Source:
public MulticurveProviderDiscount getMulticurveProvider() { IssuerProviderInterface issuerProvider = getIssuerProvider(); if (issuerProvider instanceof IssuerProviderDiscount) { return ((IssuerProviderDiscount) issuerProvider).getMulticurveProvider(); } else if (issuerProvider instanceof IssuerProviderIssuerDecoratedSpreadPeriodic) { return (MulticurveProviderDiscount) ((IssuerProviderIssuerDecoratedSpreadPeriodic) issuerProvider) .getMulticurveProvider(); } throw new IllegalArgumentException("unsupported type of issuer provider"); }

Target:
public MulticurveProviderDiscount getMulticurveProvider() { return getIssuerProvider().getMulticurveProvider(); }
Source:
private boolean onEnderPearlImpact(EntityPlayerMP player) { if (player.isPlayerSleeping()) { return true; } try(CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { frame.addContext(EventContextKeys.TELEPORT_TYPE, TeleportTypes.ENTITY_TELEPORT); MoveEntityEvent.Teleport event = EntityUtil.handleDisplaceEntityTeleportEvent(player, this.getLocation()); if (event.isCancelled()) { return true; } } return false; }

Target:
private boolean onEnderPearlImpact(EntityPlayerMP player) { if (player.isPlayerSleeping()) { return true; } try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { frame.addContext(EventContextKeys.TELEPORT_TYPE, TeleportTypes.ENTITY_TELEPORT); frame.addContext(EventContextKeys.THROWER, (Player) player).getCurrentCause(); MoveEntityEvent.Teleport event = EntityUtil.handleDisplaceEntityTeleportEvent(player, this.getLocation()); if (event.isCancelled()) { return true; } } return false; }
Source:
public <ARCHIVEVIEW extends Assignable> Collection<ARCHIVEVIEW> resolveArtifactsAs(Class<ARCHIVEVIEW> archiveView) throws ResolutionException { return new MavenBuilderImpl(system, session, settings, dependencies, versionManagement).resolveAs(archiveView); }

Target:
public <ARCHIVEVIEW extends Assignable> Collection<ARCHIVEVIEW> resolveArtifactsAs(Class<ARCHIVEVIEW> archiveView) throws ResolutionException { return new MavenBuilderImpl(system, session, settings, dependencies, versionManagement).resolveAs(archiveView, new StrictFilter()); }
Source:
public void tearDown() throws Exception { if (factoryWsName != null) { workspaceServiceClient.delete(factoryWsName, user.getName()); } else { workspaceServiceClient.delete(testWorkspace.getName() + "_1", user.getName()); } }

Target:
public void tearDown() throws Exception { workspaceServiceClient.deleteFactoryWorkspaces(testWorkspace.getName(), user.getName()); factoryServiceClient.deleteFactory(FACTORY_NAME); }
Source:
public static String getKeyString(final PublicKey key, String alias) { final byte[] keyBytes = getKeyBytes(key); if (keyBytes == null) { log.error("Can't get key bytes, will return null."); return null; } final Base64 encoder = new Base64(0); final String encoding = encoder.encodeToString(keyBytes); if (log.isDebugEnabled()) { log.debug("Key encoding is \"" + encoding + "\"."); } final StringBuilder buffer = new StringBuilder(SSH_RSA.length() + 1 + encoding.length() + (alias != null? 1 + alias.length(): 0)); buffer.append(SSH_RSA); buffer.append(" "); buffer.append(encoding); if (alias != null) { buffer.append(" "); buffer.append(alias); } buffer.append('\n'); final String keyString = buffer.toString(); if (log.isDebugEnabled()) { log.debug("Key string is \"" + keyString + "\"."); } return keyString; }

Target:
public static String getKeyString(final PublicKey key, String alias) { final byte[] keyBytes = getKeyBytes(key); if (keyBytes == null) { log.error("Can't get key bytes, will return null."); return null; } final Base64 encoder = new Base64(0); final String encoding = encoder.encodeToString(keyBytes); if (log.isDebugEnabled()) { log.debug("Key encoding is \"" + encoding + "\"."); } final StringBuilder buffer = new StringBuilder(SSH_RSA.length() + 1 + encoding.length() + (alias != null? 1 + alias.length(): 0) + 1); buffer.append(SSH_RSA); buffer.append(" "); buffer.append(encoding); if (alias != null) { buffer.append(" "); buffer.append(alias); } buffer.append('\n'); final String keyString = buffer.toString(); if (log.isDebugEnabled()) { log.debug("Key string is \"" + keyString + "\"."); } return keyString; }
Source:
protected com.liferay.portal.model.User findByPrimaryKey(String userId) throws NoSuchUserException, SystemException { com.liferay.portal.model.User user = UserPool.get(userId); try { if (user == null) { DotConnect dc = new DotConnect(); dc.setSQL(SEARCH_USER_BY_ID); dc.addParam(userId); List<Map<String, Object>> list = dc.loadObjectResults(); if(list.isEmpty()) { throw new NoSuchUserException(userId.toString()); }else{ user = userTransformer.fromMap(list.get(0)); } } return user; } catch(DotDataException e){ throw new NoSuchUserException(userId.toString()); } }

Target:
protected com.liferay.portal.model.User findByPrimaryKey(String userId) throws NoSuchUserException { com.liferay.portal.model.User user = UserPool.get(userId); try { if (user == null) { DotConnect dc = new DotConnect(); dc.setSQL(SEARCH_USER_BY_ID); dc.addParam(userId); List<Map<String, Object>> list = dc.loadObjectResults(); if(list.isEmpty()) { throw new NoSuchUserException(userId); }else{ user = userTransformer.fromMap(list.get(0)); UserPool.put(user.getPrimaryKey(), user); } } return user; } catch(DotDataException e){ throw new NoSuchUserException(userId); } }
Source:
public void add(long markerAddress, List<SMRRecordLocator> locators) { if (locators.isEmpty()) { return; } Map<Long, SMRGarbageEntry> garbageEntries = generateGarbageEntries(markerAddress, locators); while (true) { try { for (SMRGarbageEntry garbageEntry : garbageEntries.values()) { garbageReceivingQueue.offer(garbageEntry, BLOCKING_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS); } return; } catch (InterruptedException ex) { drainingExecutor.submit(this::gc); } } }

Target:
public void add(long markerAddress, List<SMRRecordLocator> locators) { if (locators.isEmpty()) { return; } List<SMRGarbageEntry> garbageEntries = generateGarbageEntries(markerAddress, locators); synchronized (this) { try { for (SMRGarbageEntry garbageEntry : garbageEntries) { boolean success = garbageReceivingQueue.offer(garbageEntry); if (!success) { drainExecutor.submit(this::gc); garbageReceivingQueue.put(garbageEntry); } } } catch (InterruptedException ie) { throw new UnrecoverableCorfuInterruptedError( "Interrupted during adding locators to GarbageInformer", ie); } } }
Source:
public void init() throws NotFoundException { MockitoAnnotations.initMocks(this); evaluator = new AclGroupPermissionEvaluator(aclManager, aclUtil, sidFactory, mutableAclService, userDao, pluginManager); objectIdentity = new ObjectIdentityImpl(targetType, targetId); Mockito.when(aclUtil.createIdentity(targetId, targetType)).thenReturn(objectIdentity); user = new JCUser("username", "email@jtalks.org", "password"); user.setId(1L); userSid = new UserSid(user.getId()); groupSid = new UserGroupSid(targetId); group = new Group(); group.setId(2L); group.setUsers(Collections.<User>singletonList(user)); user.setGroups(Collections.singletonList(group)); when(sidFactory.createPrincipal(authentication)).thenReturn(userSid); when(sidFactory.create(group)).thenReturn(groupSid); when(authentication.getPrincipal()).thenReturn(new UserInfo(user)); when(mutableAclService.readAclById(Mockito.any(ObjectIdentity.class))).thenReturn(acl); when(userDao.get(user.getId())).thenReturn(user); List<GroupAce> controlEntries = new ArrayList<>(); Mockito.when(aclManager.getGroupPermissionsFilteredByPermissionOn(Mockito.any(ObjectIdentity.class), Mockito.any(JtalksPermission.class))).thenReturn(controlEntries); }

Target:
public void init() throws NotFoundException { MockitoAnnotations.initMocks(this); evaluator = new AclGroupPermissionEvaluator(aclManager, aclUtil, sidFactory, mutableAclService, pluginManager, securityService); objectIdentity = new ObjectIdentityImpl(targetType, targetId); Mockito.when(aclUtil.createIdentity(targetId, targetType)).thenReturn(objectIdentity); user = new JCUser("username", "email@jtalks.org", "password"); user.setId(1); userSid = new UserSid(user.getId()); groupSid = new UserGroupSid(targetId); Group group = new Group(); group.setId(2); group.setUsers(Collections.<User>singletonList(user)); user.setGroups(Collections.singletonList(group)); when(sidFactory.createPrincipal(authentication)).thenReturn(userSid); when(sidFactory.create(group)).thenReturn(groupSid); when(authentication.getPrincipal()).thenReturn(new UserInfo(user)); when(mutableAclService.readAclById(Mockito.any(ObjectIdentity.class))).thenReturn(acl); when(securityService.getFullUserInfoFrom(any(Authentication.class))).thenReturn(user); List<GroupAce> controlEntries = new ArrayList<>(); Mockito.when(aclManager.getGroupPermissionsFilteredByPermissionOn(Mockito.any(ObjectIdentity.class), Mockito.any(JtalksPermission.class))).thenReturn(controlEntries); }
Source:
protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("undertow:http://localhost:{{port}}/headers??matchOnUriPrefix=false") .to("mock:input") .transform().constant("Bye World"); from("undertow:http://localhost:{{port}}/hello") .to("mock:input") .transform().constant("Hello World"); } }; }

Target:
protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("undertow:http://localhost:{{port}}/headers") .to("mock:input") .transform().constant("Bye World"); from("undertow:http://localhost:{{port}}/hello?matchOnUriPrefix=true") .to("mock:input") .transform().constant("Hello World"); } }; }
Source:
public SlimefunItem getItem() { return SlimefunItem.getById(this.id); }

Target:
public SlimefunItem getItem() { return SlimefunItem.getByID(this.id); }
Source:
public void activate(OperatorContext ctx) { if (context.getValue(OperatorContext.ACTIVATION_WINDOW_ID) < windowDataManager.getLargestCompletedWindow()) { return; } consumer.start(); }

Target:
public void activate(OperatorContext ctx) { if (context.getValue(OperatorContext.ACTIVATION_WINDOW_ID) != Stateless.WINDOW_ID && context.getValue(OperatorContext.ACTIVATION_WINDOW_ID) < windowDataManager.getLargestCompletedWindow()) { return; } consumer.start(); }
Source:
public OverPeriodDateAttribute( @JsonProperty("attribute") final ObjQualifier attribute, @JsonProperty("periodsAgo") final Integer periodsAgo) { this.attribute = notNull(attribute, "'attribute' must not be null!"); this.periodsAgo = notNull(periodsAgo, "'periodsAgo' must not be null!"); }

Target:
public OverPeriodDateAttribute( @JsonProperty("attribute") final ObjQualifier attribute, @JsonProperty("periodsAgo") final Integer periodsAgo) { this.attribute = notNull(attribute, "attribute"); this.periodsAgo = notNull(periodsAgo, "periodsAgo"); }
Source:
private boolean unlockAssociatedEntries( final FileEntry entry, final String label ) { FileEntry alsoLocked = entry.alsoLocked; while ( alsoLocked != null ) { logger.trace( "ALSO Unlocking: {}", alsoLocked.name ); UnlockStatus unlockStatus = alsoLocked.lock.unlock( label ); try { filesystem.updateDominantLocks( entry.file.getPath(), unlockStatus ); } catch ( IOException e ) { LoggerFactory.getLogger( getClass().getName() ) .error( "Exception while updating dominant locks when unlocking entries associated with: " + entry.file.getPath(), e ); } if ( !alsoLocked.lock.isLocked() ) { entryMap.remove( alsoLocked.name ); } alsoLocked = alsoLocked.alsoLocked; } return true; }

Target:
private boolean unlockAssociatedEntries( final FileEntry entry, final String label ) throws IOException { FileEntry alsoLocked = entry.alsoLocked; while ( alsoLocked != null ) { logger.trace( "ALSO Unlocking: {}", alsoLocked.name ); UnlockStatus unlockStatus = alsoLocked.lock.unlock( label ); filesystem.updateDominantLocks( alsoLocked.file.getPath(), unlockStatus ); if ( !alsoLocked.lock.isLocked() ) { entryMap.remove( alsoLocked.name ); } alsoLocked = alsoLocked.alsoLocked; } return true; }
Source:
public BigtableDataGrpcClient( Channel channel, ExecutorService executorService, RetryOptions retryOptions, ClientCallService clientCallService) { this.channel = channel; this.executorService = executorService; this.retryOptions = retryOptions; this.clientCallService = clientCallService; this.sampleRowKeysAsync = BigtableAsyncUtilities.createSampleRowKeyAsyncReader(this.channel, clientCallService); this.readRowsAsync = BigtableAsyncUtilities.createRowKeyAysncReader(this.channel, clientCallService); }

Target:
BigtableDataGrpcClient( Channel channel, ExecutorService executorService, RetryOptions retryOptions, ClientCallService clientCallService) { this.channel = channel; this.executorService = executorService; this.retryOptions = retryOptions; this.clientCallService = clientCallService; this.sampleRowKeysAsync = BigtableAsyncUtilities.createSampleRowKeyAsyncReader(this.channel, clientCallService); this.readRowsAsync = BigtableAsyncUtilities.createRowKeyAysncReader(this.channel, clientCallService); }
Source:
public QueryInfo scheduleQuery(Session session, QueryContext queryContext, String sql, String jsonExpr, LogicalRootNode plan) throws Exception { QueryId queryId = QueryIdFactory.newQueryId(masterContext.getResourceManager().getSeedQueryId()); QueryInProgress queryInProgress = new QueryInProgress(masterContext, session, queryContext, queryId, sql, jsonExpr, plan); queryInProgress.getQueryInfo().setQueryMaster(""); submittedQueries.put(queryInProgress.getQueryId(), queryInProgress); QuerySchedulingInfo querySchedulingInfo = new QuerySchedulingInfo("default", queryContext.getUser(), queryInProgress.getQueryId(), 1, queryInProgress.getQueryInfo().getStartTime()); masterContext.getResourceManager().submitQuery(querySchedulingInfo); return queryInProgress.getQueryInfo(); }

Target:
public QueryInfo scheduleQuery(Session session, QueryContext queryContext, String sql, String jsonExpr, LogicalRootNode plan) throws Exception { QueryId queryId = QueryIdFactory.newQueryId(masterContext.getResourceManager().getSeedQueryId()); QueryInProgress queryInProgress = new QueryInProgress(masterContext, session, queryContext, queryId, sql, jsonExpr, plan); queryInProgress.getQueryInfo().setQueryMaster(EMPTY_QM_HOSTNAME); submittedQueries.put(queryInProgress.getQueryId(), queryInProgress); QuerySchedulingInfo querySchedulingInfo = new QuerySchedulingInfo("default", queryContext.getUser(), queryInProgress.getQueryId(), 1, queryInProgress.getQueryInfo().getStartTime()); masterContext.getResourceManager().submitQuery(querySchedulingInfo); return queryInProgress.getQueryInfo(); }
Source:
public void validate(Element element, ElementValidation validation) { super.validate(element, validation); validatorHelper.doesNotReturnPrimitive((ExecutableElement) element, validation); restSpringValidatorHelper.hasAnnotatedAllParameters((ExecutableElement) element, validation); restSpringValidatorHelper.hasValidBodyParameter((ExecutableElement) element, validation); restSpringValidatorHelper.doesNotMixRequestEntityAnnotations((ExecutableElement) element, validation); }

Target:
public void validate(Element element, ElementValidation validation) { super.validate(element, validation); validatorHelper.doesNotReturnPrimitive((ExecutableElement) element, validation); restSpringValidatorHelper.doesNotHaveDuplicateFieldAndPartName((ExecutableElement) element, validation); restSpringValidatorHelper.hasOneOrZeroBodyParameter((ExecutableElement) element, validation); restSpringValidatorHelper.doesNotMixRequestEntityAnnotations((ExecutableElement) element, validation); }
Source:
public boolean shouldAssignWork(ElasticAgentMetadata metadata, String environment, ElasticProfile elasticProfile, ClusterProfile clusterProfile, JobIdentifier identifier) { if (clusterProfile == null || !StringUtils.equals(clusterProfile.getPluginId(), metadata.elasticPluginId())) { return false; } boolean secretsResolved = resolveSecrets(identifier, clusterProfile, elasticProfile); if (!secretsResolved) { return false; } Map<String, String> clusterProfileProperties = clusterProfile.getConfigurationAsMap(true, true); GoPluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptorFor(metadata.elasticPluginId()); Map<String, String> configuration = elasticProfile.getConfigurationAsMap(true, true); return elasticAgentPluginRegistry.shouldAssignWork(pluginDescriptor, toAgentMetadata(metadata), environment, configuration, clusterProfileProperties, identifier); }

Target:
public boolean shouldAssignWork(ElasticAgentMetadata metadata, String environment, ElasticProfile elasticProfile, ClusterProfile clusterProfile, JobIdentifier identifier) { if (clusterProfile == null || !StringUtils.equals(clusterProfile.getPluginId(), metadata.elasticPluginId())) { return false; } resolveSecrets(clusterProfile, elasticProfile); Map<String, String> clusterProfileProperties = clusterProfile.getConfigurationAsMap(true, true); GoPluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptorFor(metadata.elasticPluginId()); Map<String, String> configuration = elasticProfile.getConfigurationAsMap(true, true); return elasticAgentPluginRegistry.shouldAssignWork(pluginDescriptor, toAgentMetadata(metadata), environment, configuration, clusterProfileProperties, identifier); }
Source:
private FutureResult<Void> pullLoad(Project project, final Path dirPath, final String dataset) { List<String> datasets = new ArrayList<>(); datasets.add(dataset); return pullLoad(project, dirPath, datasets); }

Target:
private FutureResult<Void> pullLoad(Project project, final Path dirPath, final String dataset) { return pullLoad(project, dirPath, asList(dataset)); }
Source:
private int getImageType(IJavaAnnotation annotation) { int imageType= NO_IMAGE; if (annotation.hasOverlay()) imageType= OVERLAY_IMAGE; else if (!annotation.isMarkedDeleted()) { if (showQuickFix(annotation)) { if (null == annotation.getType()) { imageType= QUICKFIX_INFO_IMAGE; } else switch (annotation.getType()) { case JavaMarkerAnnotation.ERROR_ANNOTATION_TYPE: imageType= QUICKFIX_ERROR_IMAGE; break; case JavaMarkerAnnotation.WARNING_ANNOTATION_TYPE: imageType= QUICKFIX_WARNING_IMAGE; break; default: imageType= QUICKFIX_INFO_IMAGE; break; } } } else { imageType= GRAY_IMAGE; } return imageType; }

Target:
private int getImageType(IJavaAnnotation annotation) { int imageType= NO_IMAGE; if (annotation.hasOverlay()) imageType= OVERLAY_IMAGE; else if (!annotation.isMarkedDeleted()) { if (showQuickFix(annotation)) { boolean nomatch= false; if (annotation.getType() != null) switch (annotation.getType()) { case JavaMarkerAnnotation.ERROR_ANNOTATION_TYPE: imageType= QUICKFIX_ERROR_IMAGE; break; case JavaMarkerAnnotation.WARNING_ANNOTATION_TYPE: imageType= QUICKFIX_WARNING_IMAGE; break; default: nomatch= true; break; } if (nomatch) { imageType= QUICKFIX_INFO_IMAGE; } } } else { imageType= GRAY_IMAGE; } return imageType; }
Source:
public BucketNodeMap getBucketNodeMap(Session session, PartitioningHandle partitioningHandle, boolean preferDynamic) { ConnectorId connectorId = partitioningHandle.getConnectorId() .orElseThrow(() -> new IllegalArgumentException("No connector ID for partitioning handle: " + partitioningHandle)); List<Node> sortedNodes = sortedNodes(connectorId); ConnectorBucketNodeMap connectorBucketNodeMap = getConnectorBucketNodeMap(session, partitioningHandle, sortedNodes); NodeSelectionStrategy nodeSelectionStrategy = connectorBucketNodeMap.getNodeSelectionStrategy(); switch (nodeSelectionStrategy) { case HARD_AFFINITY: case SOFT_AFFINITY: return new FixedBucketNodeMap(getSplitToBucket(session, partitioningHandle), getFixedMapping(connectorBucketNodeMap)); case NO_PREFERENCE: if (preferDynamic) { return new DynamicBucketNodeMap(getSplitToBucket(session, partitioningHandle), connectorBucketNodeMap.getBucketCount()); } return new FixedBucketNodeMap( getSplitToBucket(session, partitioningHandle), createArbitraryBucketToNode( nodeScheduler.createNodeSelector(partitioningHandle.getConnectorId().get()).selectRandomNodes(getMaxTasksPerStage(session)), connectorBucketNodeMap.getBucketCount())); default: throw new PrestoException(NODE_SELECTION_NOT_SUPPORTED, format("Unsupported node selection strategy %s", nodeSelectionStrategy)); } }

Target:
public BucketNodeMap getBucketNodeMap(Session session, PartitioningHandle partitioningHandle, boolean preferDynamic) { ConnectorBucketNodeMap connectorBucketNodeMap = getConnectorBucketNodeMap(session, partitioningHandle); NodeSelectionStrategy nodeSelectionStrategy = connectorBucketNodeMap.getNodeSelectionStrategy(); switch (nodeSelectionStrategy) { case HARD_AFFINITY: return new FixedBucketNodeMap(getSplitToBucket(session, partitioningHandle), getFixedMapping(connectorBucketNodeMap)); case SOFT_AFFINITY: if (preferDynamic) { return new DynamicBucketNodeMap(getSplitToBucket(session, partitioningHandle), connectorBucketNodeMap.getBucketCount(), getFixedMapping(connectorBucketNodeMap)); } return new FixedBucketNodeMap(getSplitToBucket(session, partitioningHandle), getFixedMapping(connectorBucketNodeMap)); case NO_PREFERENCE: if (preferDynamic) { return new DynamicBucketNodeMap(getSplitToBucket(session, partitioningHandle), connectorBucketNodeMap.getBucketCount()); } return new FixedBucketNodeMap( getSplitToBucket(session, partitioningHandle), createArbitraryBucketToNode( nodeScheduler.createNodeSelector(partitioningHandle.getConnectorId().get()).selectRandomNodes(getMaxTasksPerStage(session)), connectorBucketNodeMap.getBucketCount())); default: throw new PrestoException(NODE_SELECTION_NOT_SUPPORTED, format("Unsupported node selection strategy %s", nodeSelectionStrategy)); } }
Source:
public void run() { setContinueRunning(true); while (isContinueRunning()) { try { LocalDocument doc = fetch(); if (doc == null) { Thread.sleep(holdInterval); } else { try { logger.debug("Got new doc " + doc.getID() + " to process."); ProcessThread processThread = new ProcessThread(); processThread.setDocument(doc); long startTime = System.currentTimeMillis(); processThread.setDaemon(true); processThread.start(); while (!processThread.isCompleted()) { Thread.yield(); if (timeout > 0 && System.currentTimeMillis() - startTime > timeout) { throw new ProcessException( "Processing was not done within configured timout"); } else if (logger.isTraceEnabled()) { logger.trace("Waiting for processing. Waited " + (System.currentTimeMillis() - startTime) + "ms so far..."); } } if (processThread.getException() != null) { throw processThread.getException(); } if(!persist()) { LocalDocument ld = new LocalDocument(doc.toJson()); IOException e = new IOException("Unable to save changes to core"); if(!getRemotePipeline().markFailed(ld, e)) { logger.error("Unable to persist an error to the database", e); } } } catch (ProcessException e) { if(failDocumentOnProcessException) { getRemotePipeline().markFailed(doc, e); } else { persistError(doc, e); } } } } catch (Exception e) { logger.error("Caught exception while running", e); Runtime.getRuntime().removeShutdownHook(getShutDownHook()); System.exit(1); } } }

Target:
public void run() { setContinueRunning(true); while (isContinueRunning()) { try { LocalDocument doc = fetch(); if (doc == null) { Thread.sleep(holdInterval); } else { try { logger.debug("Got new doc " + doc.getID() + " to process."); ProcessThread processThread = new ProcessThread(getStageName()); processThread.setDocument(doc); long startTime = timeProvider.getCurrentTime(); processThread.setDaemon(true); processThread.start(); while (processThread.isRunning()) { Thread.yield(); if (timeout > 0 && timeProvider.getCurrentTime() - startTime > timeout) { String docId = null; if (doc.getID() != null) { docId = doc.getID().toString(); } throw new ProcessException( "Processing of " + docId + " by " + getStageName() + " was not done within configured timout"); } else if (logger.isTraceEnabled()) { logger.trace("Waiting for processing. Waited " + (timeProvider.getCurrentTime() - startTime) + "ms so far..."); } } if (processThread.getException() != null) { throw processThread.getException(); } if(!persist()) { LocalDocument ld = new LocalDocument(doc.toJson()); IOException e = new IOException("Unable to save changes to core"); if(!getRemotePipeline().markFailed(ld, e)) { logger.error("Unable to persist an error to the database", e); } } } catch (ProcessException e) { if(failDocumentOnProcessException) { getRemotePipeline().markFailed(doc, e); } else { persistError(doc, e); } } } } catch (Exception e) { logger.error("Caught exception while running", e); Runtime.getRuntime().removeShutdownHook(getShutDownHook()); System.exit(1); } } }
Source:
public void initialize() { Configuration configuration = getConfig(); Map<String, String> properties = editProperties(); if (!super.configure()) { return; } if (getThing().getStatus() == ThingStatus.OFFLINE) { return; } if (configuration.get(CONFIG_DIGITALREFRESH) != null) { digitalRefreshInterval = ((BigDecimal) configuration.get(CONFIG_DIGITALREFRESH)).intValue() * 1000; } else { digitalRefreshInterval = 10 * 1000; } digitalLastRefresh = 0; if (sensorIds.get(0).startsWith("41") || properties.get(PROPERTY_MODELID).equals(OwSensorType.DS1923.name())) { sensors.add(new DS1923(sensorIds.get(0), this)); } else { sensors.add(new DS2438(sensorIds.get(0), this)); } if (THING_TYPE_BMS.equals(thingType)) { sensors.add(new DS18x20(sensorIds.get(1), this)); } else if (THING_TYPE_AMS.equals(thingType)) { sensors.add(new DS18x20(sensorIds.get(1), this)); sensors.add(new DS2438(sensorIds.get(2), this)); sensors.add(new DS2406_DS2413(sensorIds.get(3), this)); } if (thingType == THING_TYPE_BMS || thingType == THING_TYPE_AMS) { if ((properties.get(PROPERTY_PROD_DATE) == null) || (properties.get(PROPERTY_HW_REVISION) == null)) { scheduler.execute(() -> { updateSensorProperties(); }); return; } else { hwRevision = Integer.valueOf(properties.get(PROPERTY_HW_REVISION)); } } scheduler.execute(() -> { configureThingChannels(); }); }

Target:
public void initialize() { Configuration configuration = getConfig(); Map<String, String> properties = editProperties(); if (!super.configure()) { return; } if (getThing().getStatus() == ThingStatus.OFFLINE) { return; } if (configuration.containsKey(CONFIG_DIGITALREFRESH)) { digitalRefreshInterval = ((BigDecimal) configuration.get(CONFIG_DIGITALREFRESH)).intValue() * 1000; } else { digitalRefreshInterval = 10 * 1000; } digitalLastRefresh = 0; if (sensorIds.get(0).startsWith("41") || (properties.get(PROPERTY_MODELID) != null && properties.get(PROPERTY_MODELID).equals(OwSensorType.DS1923.name()))) { sensors.add(new DS1923(sensorIds.get(0), this)); } else { sensors.add(new DS2438(sensorIds.get(0), this)); } if (THING_TYPE_BMS.equals(thingType)) { sensors.add(new DS18x20(sensorIds.get(1), this)); } else if (THING_TYPE_AMS.equals(thingType)) { sensors.add(new DS18x20(sensorIds.get(1), this)); sensors.add(new DS2438(sensorIds.get(2), this)); sensors.add(new DS2406_DS2413(sensorIds.get(3), this)); } if (THING_TYPE_BMS.equals(thingType) || THING_TYPE_AMS.equals(thingType)) { if (properties.containsKey(PROPERTY_PROD_DATE) && properties.containsKey(PROPERTY_HW_REVISION)) { hwRevision = Integer.valueOf(properties.get(PROPERTY_HW_REVISION)); } else { scheduler.execute(() -> { updateSensorProperties(); }); return; } } scheduler.execute(() -> { configureThingChannels(); }); }
Source:
public void testGetCACertificate() { try { CertificateManagementServiceImpl instance = CertificateManagementServiceImpl.getInstance(); Certificate caCertificate = instance.getCACertificate(); Assert.assertNotNull(caCertificate); Assert.assertEquals(caCertificate.getType(), CertificateManagementConstants.X_509); log.info("GetCACertificate Test Successful"); } catch (KeystoreException e) { String msg = "Error while getting the CA Certificate"; log.error(msg, e); Assert.fail(msg, e); } }

Target:
public void testGetCACertificate() throws KeystoreException { CertificateManagementServiceImpl instance = CertificateManagementServiceImpl.getInstance(); Certificate caCertificate = instance.getCACertificate(); Assert.assertNotNull(caCertificate); Assert.assertEquals(caCertificate.getType(), CertificateManagementConstants.X_509); log.info("GetCACertificate Test Successful"); }
Source:
public void onCreateGame(@Nullable String mapFolderName) { if (preferencesService.getPreferences().getForgedAlliance().getPath() == null) { CompletableFuture<Path> gameDirectoryFuture = new CompletableFuture<>(); eventBus.post(new GameDirectoryChooseEvent(gameDirectoryFuture)); gameDirectoryFuture.thenAccept(path -> Optional.ofNullable(path).ifPresent(path1 -> onCreateGame(null))); return; } CreateGameController createGameController = uiService.loadFxml("theme/play/create_game.fxml"); if (mapFolderName != null && createGameController.selectMap(mapFolderName)) { log.info("Map with folder name: '{}' could not be found in map list", mapFolderName); } Pane createGameRoot = createGameController.getRoot(); gamesRoot.getChildren().add(createGameRoot); AnchorPane.setTopAnchor(createGameRoot, 0d); AnchorPane.setRightAnchor(createGameRoot, 0d); AnchorPane.setBottomAnchor(createGameRoot, 0d); AnchorPane.setLeftAnchor(createGameRoot, 0d); createGameRoot.requestFocus(); }

Target:
private void onCreateGame(@Nullable String mapFolderName) { if (preferencesService.getPreferences().getForgedAlliance().getPath() == null) { CompletableFuture<Path> gameDirectoryFuture = new CompletableFuture<>(); eventBus.post(new GameDirectoryChooseEvent(gameDirectoryFuture)); gameDirectoryFuture.thenAccept(path -> Optional.ofNullable(path).ifPresent(path1 -> onCreateGame(null))); return; } CreateGameController createGameController = uiService.loadFxml("theme/play/create_game.fxml"); if (mapFolderName != null && !createGameController.selectMap(mapFolderName)) { log.warn("Map with folder name: '{}' could not be found in map list", mapFolderName); } Pane createGameRoot = createGameController.getRoot(); gamesRoot.getChildren().add(createGameRoot); AnchorPane.setTopAnchor(createGameRoot, 0d); AnchorPane.setRightAnchor(createGameRoot, 0d); AnchorPane.setBottomAnchor(createGameRoot, 0d); AnchorPane.setLeftAnchor(createGameRoot, 0d); createGameRoot.requestFocus(); }
Source:
private boolean areSameArtifact(Dependency dependency, Artifact artifact) { return dependency.getArtifactId().equals(artifact.getArtifactCoordinates().getArtifactId()) && dependency.getGroupId().equals(artifact.getArtifactCoordinates().getGroupId()) && dependency.getVersion().equals(artifact.getArtifactCoordinates().getVersion()); }

Target:
private boolean areSameArtifact(Dependency dependency, Artifact artifact) { return StringUtils.equals(dependency.getArtifactId(), artifact.getArtifactCoordinates().getArtifactId()) && StringUtils.equals(dependency.getGroupId(), artifact.getArtifactCoordinates().getGroupId()) && StringUtils.equals(dependency.getVersion(), artifact.getArtifactCoordinates().getVersion()); }
Source:
public <T> List<T> getValues(MarketDataId<T> id) { if (id instanceof NoMatchingRuleId) { MarketDataKey<?> key = ((NoMatchingRuleId) id).getKey(); throw new IllegalArgumentException("No market data rules were available to build the market data for " + key); } if (id instanceof MissingMappingId) { MarketDataKey<?> key = ((MissingMappingId) id).getKey(); throw new IllegalArgumentException("No market data mapping found for " + key); } List<?> values = this.values.get(id); if (!values.isEmpty()) { return (List<T>) values; } T baseValue = baseData.getValue(id); if (baseValue != null) { return Collections.nCopies(scenarioCount, baseValue); } throw new IllegalArgumentException("No market data available for " + id); }

Target:
public <T> List<T> getValues(MarketDataId<T> id) { if (id instanceof NoMatchingRuleId) { MarketDataKey<?> key = ((NoMatchingRuleId) id).getKey(); throw new IllegalArgumentException("No market data rules were available to build the market data for " + key); } if (id instanceof MissingMappingId) { MarketDataKey<?> key = ((MissingMappingId) id).getKey(); throw new IllegalArgumentException("No market data mapping found for " + key); } List<?> values = this.values.get(id); if (!values.isEmpty()) { return (List<T>) values; } return Collections.nCopies(scenarioCount, sharedData.getValue(id)); }
Source:
public String isValid(String call){ JSONObject jCall = new JSONObject(call); JSONObject params = jCall.getJSONObject("params"); String methodName = jCall.getString("method"); if(!jCall.has("method") || !params.has("sourceO") || !params.has("sourceIP") || !params.has("sourcePort") || !params.has("destinationO") || !params.has("extensions")){ return "invalid"; } if(methodName.equalsIgnoreCase("PUT") && !params.has("value")){ return "params"; } if(methodName.equalsIgnoreCase("GET") && !params.has("index")){ return "params"; } if(methodName.equalsIgnoreCase("SHUTDOWN") && !params.has("port")){ return "params"; } if(!methodName.equalsIgnoreCase("PING") && !methodName.equalsIgnoreCase("PONG") && !methodName.equalsIgnoreCase("LOOKUP") && !methodName.equalsIgnoreCase("PUT") && !methodName.equalsIgnoreCase("GET") && !methodName.equalsIgnoreCase("SHUTDOWN")){ return "method"; } String ip = params.getString("sourceIP"); int port = params.getInt("sourcePort"); final String PATTERN = "^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"; Pattern pattern = Pattern.compile(PATTERN); Matcher matcher = pattern.matcher(ip); if(!matcher.matches()){ return "params"; } if(port < 0 || port > 61001){ return "params"; } return "valid"; }

Target:
public String isValid(String call) { JSONObject jCall; try { jCall = new JSONObject(call); } catch (JSONException e) { DBP.printException(e); return "parse"; } JSONObject params = new JSONObject(); String methodName = ""; if (!jCall.has("method") || !jCall.has("params") || !jCall.has("jsonrpc")) { return "invalid"; } else { methodName = jCall.getString("method"); params = jCall.getJSONObject("params"); } if (!jCall.getString("jsonrpc").equals("2.0")) return "invalid"; if (!params.has("sourceO") || !params.has("sourceIP") || !params.has("sourcePort") || !params.has("destinationO") || !params.has("extensions")) { return "params"; } if (methodName.equalsIgnoreCase("PUT") && !params.has("value")) { return "params"; } if (methodName.equalsIgnoreCase("GET") && !params.has("index")) { return "params"; } if (methodName.equalsIgnoreCase("SHUTDOWN") && !params.has("sourcePort")) { return "params"; } if (!methodName.equalsIgnoreCase("PING") && !methodName.equalsIgnoreCase("PONG") && !methodName.equalsIgnoreCase("LOOKUP") && !methodName.equalsIgnoreCase("PUT") && !methodName.equalsIgnoreCase("GET") && !methodName.equalsIgnoreCase("SHUTDOWN")) { return "method"; } String ip = params.getString("sourceIP"); int port = params.getInt("sourcePort"); final String PATTERN = "^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"; Pattern pattern = Pattern.compile(PATTERN); Matcher matcher = pattern.matcher(ip); if (!matcher.matches()) { return "params"; } if (port < 0 || port > 61001) { return "params"; } return "valid"; }
Source:
static boolean castToBoolean(final Object in) throws PSQLException { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Cast to boolean: \"{0}\"", String.valueOf(in)); } if (in instanceof Boolean) { return (Boolean) in; } if (in instanceof String) { return fromString((String) in); } if (in instanceof Character) { return fromString(in.toString()); } if (in instanceof Number) { return fromNumber((Number) in); } throw new PSQLException("Cannot cast to boolean", PSQLState.CANNOT_COERCE); }

Target:
static boolean castToBoolean(final Object in) throws PSQLException { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Cast to boolean: \"{0}\"", String.valueOf(in)); } if (in instanceof Boolean) { return (Boolean) in; } if (in instanceof String) { return fromString((String) in); } if (in instanceof Character) { return fromCharacter((Character) in); } if (in instanceof Number) { return fromNumber((Number) in); } throw new PSQLException("Cannot cast to boolean", PSQLState.CANNOT_COERCE); }
Source:
public void handleGetFirmwareVersionResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final List<FirmwareVersionDto> firmwareVersionList) { LOGGER.info("handleGetFirmwareVersionResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Get firmware version response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } final List<FirmwareVersion> firmwareVersions = this.configurationMapper.mapAsList(firmwareVersionList, FirmwareVersion.class); final FirmwareVersionResponse firmwareVersionResponse = new FirmwareVersionResponse(firmwareVersions); this.webServiceResponseMessageSender.send( ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(firmwareVersionResponse) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleGetFirmwareVersionResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final List<FirmwareVersionDto> firmwareVersionList) { LOGGER.info("handleGetFirmwareVersionResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Get firmware version response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } final List<FirmwareVersion> firmwareVersions = this.configurationMapper.mapAsList(firmwareVersionList, FirmwareVersion.class); final FirmwareVersionResponse firmwareVersionResponse = new FirmwareVersionResponse(firmwareVersions); ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(firmwareVersionResponse) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send( responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
protected IStatus run(IProgressMonitor monitor) { ISourceModule module = null; while ((module = modules.poll()) != null) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } processModule(module, buildType, state); } return Status.OK_STATUS; }

Target:
protected IStatus run(IProgressMonitor monitor) { for (ISourceModule module; (module = modules.poll()) != null;) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } processModule(module, buildType, state); } return Status.OK_STATUS; }
Source:
public void onClick(ClickEvent event) { ExpandableListViewItem eventItem = null; if (event.getSource() instanceof ExpandableListViewItem) { eventItem = (ExpandableListViewItem)event.getSource(); } if (eventItem != null) { boolean active = eventItem.isActive(); hideAllDetails(); eventItem.toggleExpanded(!active); toggleExpanded(); } else { hideAllDetails(); } event.preventDefault(); event.stopPropagation(); }

Target:
public void onClick(ClickEvent event) { event.preventDefault(); event.stopPropagation(); ExpandableListViewItem eventItem = null; if (event.getSource() instanceof ExpandableListViewItem) { eventItem = (ExpandableListViewItem)event.getSource(); } if (eventItem != null) { boolean active = eventItem.isActive(); hideAllDetails(); eventItem.toggleExpanded(!active); toggleExpanded(); } else { hideAllDetails(); } }
Source:
public List<SlotExecutionVertexAssignment> allocateSlotsFor( List<ExecutionVertexSchedulingRequirements> executionVertexSchedulingRequirements) { validateSchedulingRequirements(executionVertexSchedulingRequirements); List<SlotExecutionVertexAssignment> slotExecutionVertexAssignments = new ArrayList<>(executionVertexSchedulingRequirements.size()); Set<AllocationID> allPreviousAllocationIds = computeAllPriorAllocationIds(executionVertexSchedulingRequirements); for (ExecutionVertexSchedulingRequirements schedulingRequirements : executionVertexSchedulingRequirements) { final ExecutionVertexID executionVertexId = schedulingRequirements.getExecutionVertexId(); final SlotRequestId slotRequestId = new SlotRequestId(); final SlotSharingGroupId slotSharingGroupId = schedulingRequirements.getSlotSharingGroupId(); LOG.debug("Allocate slot with id for execution {}", slotRequestId, executionVertexId); final CompletableFuture<SlotProfile> slotProfileFuture = getSlotProfileFuture( schedulingRequirements, schedulingRequirements.getPhysicalSlotResourceProfile(), Collections.emptySet(), allPreviousAllocationIds); final CompletableFuture<LogicalSlot> slotFuture = slotProfileFuture.thenCompose( slotProfile -> slotProviderStrategy.allocateSlot( slotRequestId, new ScheduledUnit( executionVertexId, slotSharingGroupId, schedulingRequirements.getCoLocationConstraint()), slotProfile)); final SlotExecutionVertexAssignment slotExecutionVertexAssignment = createAndRegisterSlotExecutionVertexAssignment( executionVertexId, slotFuture, (requestId, throwable) -> slotProviderStrategy.cancelSlotRequest(requestId, slotSharingGroupId, throwable)); slotExecutionVertexAssignments.add(slotExecutionVertexAssignment); } return slotExecutionVertexAssignments; }

Target:
public List<SlotExecutionVertexAssignment> allocateSlotsFor( List<ExecutionVertexSchedulingRequirements> executionVertexSchedulingRequirements) { validateSchedulingRequirements(executionVertexSchedulingRequirements); List<SlotExecutionVertexAssignment> slotExecutionVertexAssignments = new ArrayList<>(executionVertexSchedulingRequirements.size()); Set<AllocationID> allPreviousAllocationIds = computeAllPriorAllocationIds(executionVertexSchedulingRequirements); for (ExecutionVertexSchedulingRequirements schedulingRequirements : executionVertexSchedulingRequirements) { final ExecutionVertexID executionVertexId = schedulingRequirements.getExecutionVertexId(); final SlotSharingGroupId slotSharingGroupId = schedulingRequirements.getSlotSharingGroupId(); final SlotRequestId slotRequestId = new SlotRequestId(); final CompletableFuture<LogicalSlot> slotFuture = allocateSlot( schedulingRequirements, slotRequestId, allPreviousAllocationIds); final SlotExecutionVertexAssignment slotExecutionVertexAssignment = createAndRegisterSlotExecutionVertexAssignment( executionVertexId, slotFuture, throwable -> slotProviderStrategy.cancelSlotRequest(slotRequestId, slotSharingGroupId, throwable)); slotExecutionVertexAssignments.add(slotExecutionVertexAssignment); } return slotExecutionVertexAssignments; }
Source:
private Guid getClusterId() { Guid vdsGroupId = getParameters().getVdsGroupId(); if (Guid.Empty.equals(getParameters().getVdsGroupId())) { vdsGroupId = Guid.createGuidFromStringDefaultEmpty( Config.<String> getValue(ConfigValues.AutoRegistrationDefaultVdsGroupID)); log.debug( "RegisterVdsQuery::ExecuteCommand - VdsGroupId received as -1, using AutoRegistrationDefaultVdsGroupID: '{}'", vdsGroupId); } if (vdsGroupId == null || Guid.Empty.equals(vdsGroupId)) { VdsGroupDAO dao = DbFacade.getInstance().getVdsGroupDao(); VDSGroup cluster = dao.getByName("Default"); if (cluster != null) { vdsGroupId = cluster.getId(); } else { List<VDSGroup> clusters = dao.getAll(); if (clusters.size() > 0) { vdsGroupId = clusters.get(0).getId(); } } } return vdsGroupId; }

Target:
private Guid getClusterId() { Guid clusterId = getParameters().getVdsGroupId(); if (Guid.Empty.equals(getParameters().getVdsGroupId())) { clusterId = Guid.createGuidFromStringDefaultEmpty( Config.<String> getValue(ConfigValues.AutoRegistrationDefaultVdsGroupID)); log.debug( "Cluster id was not provided for registering the host {}, the cluster id is taken from the config value {}", getParameters().getVdsName(), clusterId, ConfigValues.AutoRegistrationDefaultVdsGroupID.name()); } if (Guid.isNullOrEmpty(clusterId)) { VdsGroupDAO clusterDao = getDbFacade().getVdsGroupDao(); VDSGroup cluster = clusterDao.getByName("Default"); if (cluster != null) { clusterId = cluster.getId(); } else { List<VDSGroup> clusters = clusterDao.getAll(); if (clusters.isEmpty()) { clusterId = clusters.get(0).getId(); } } } return clusterId; }
Source:
public void increaseStart(long value) { start += value; if (start == currentBlock().getEnd()) { currentBlockIndex++; if (isDone()) { return; } checkArgument(start == currentBlock().getStart()); } }

Target:
public void increaseStart(long value) { start += value; if (start == currentBlock().getEnd()) { currentBlockIndex++; if (isDone()) { return; } verify(start == currentBlock().getStart()); } }
Source:
protected void addFileSetProperties(FileSetProperties.Builder properties) { try { FileSetUtil.configureORCFileSet(config.schema, properties); } catch (IOException e) { LOG.debug(""); } catch (UnsupportedTypeException e) { e.printStackTrace(); } }

Target:
protected void addFileSetProperties(FileSetProperties.Builder properties) { FileSetUtil.configureORCFileSet(config.schema, properties); }
Source:
public CertificationStatus(String name){ this.id = id; this.name = name; }

Target:
public CertificationStatus(String name){ this.name = name; }