auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static String generateKey(BibEntry entry, String pattern, BibDatabase database) { GlobalBibtexKeyPattern keyPattern = new GlobalBibtexKeyPattern(Collections.emptyList()); keyPattern.setDefaultValue("[" + pattern + "]"); String unwantedCharacters = "-`ʹ:!;?^+"; return new BibtexKeyGenerator(keyPattern, database, new BibtexKeyPatternPreferences("", "", false, true, keyPattern, ',', false, unwantedCharacters)) .generateKey(entry); }

Target:
static String generateKey(BibEntry entry, String pattern, BibDatabase database) { GlobalBibtexKeyPattern keyPattern = new GlobalBibtexKeyPattern(Collections.emptyList()); keyPattern.setDefaultValue("[" + pattern + "]"); return new BibtexKeyGenerator(keyPattern, database, new BibtexKeyPatternPreferences("", "", false, true, keyPattern, ',', false, DEFAULT_UNWANTED_CHARACTERS)) .generateKey(entry); }
Source:
public static PaymentRequestEntity from(ChargeEntity chargeEntity) { PaymentRequestEntity paymentEntity = new PaymentRequestEntity(); paymentEntity.setId(chargeEntity.getId()); paymentEntity.setAmount(chargeEntity.getAmount()); paymentEntity.setCreatedDate(chargeEntity.getCreatedDate()); paymentEntity.setDescription(chargeEntity.getDescription()); paymentEntity.setExternalId(chargeEntity.getExternalId()); paymentEntity.setGatewayAccount(chargeEntity.getGatewayAccount()); paymentEntity.setReference(chargeEntity.getReference()); paymentEntity.setReturnUrl(chargeEntity.getReturnUrl()); return paymentEntity; }

Target:
public static PaymentRequestEntity from(ChargeEntity chargeEntity) { PaymentRequestEntity paymentEntity = new PaymentRequestEntity(); paymentEntity.setAmount(chargeEntity.getAmount()); paymentEntity.setCreatedDate(chargeEntity.getCreatedDate()); paymentEntity.setDescription(chargeEntity.getDescription()); paymentEntity.setExternalId(chargeEntity.getExternalId()); paymentEntity.setGatewayAccount(chargeEntity.getGatewayAccount()); paymentEntity.setReference(chargeEntity.getReference()); paymentEntity.setReturnUrl(chargeEntity.getReturnUrl()); return paymentEntity; }
Source:
private boolean isExpressionPrefix(String entry) { char first = entry.length() == 0 ? ' ' : entry.charAt(0); return first == '=' || first == '+' || first == '-' || first == '@'; }

Target:
private boolean isExpressionPrefix(String entry) { if (entry.isEmpty()) { return false; } char first = entry.charAt(0); return first == '=' || first == '+' || first == '-' || first == '@'; }
Source:
public void importFileStorageAddDomain(ArrayList<StorageDomain> domains) { StorageDomain sdToAdd = Linq.firstOrDefault(domains); StorageDomainStatic sdsToAdd = sdToAdd.getStorageStaticData(); StorageDomainManagementParameter params = new StorageDomainManagementParameter(sdsToAdd); params.setVdsId(hostId); Frontend.getInstance().runAction(VdcActionType.AddExistingFileStorageDomain, params, new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { Object[] array = (Object[]) result.getState(); StorageListModel storageListModel = (StorageListModel) array[0]; StorageDomain sdToAdd1 = (StorageDomain) array[1]; VdcReturnValueBase returnVal = result.getReturnValue(); boolean success = returnVal != null && returnVal.getSucceeded(); if (success) { StorageModel model = (StorageModel) storageListModel.getWindow(); StoragePool dataCenter = model.getDataCenter().getSelectedItem(); if (!dataCenter.getId().equals(StorageModel.UnassignedDataCenterId)) { storageListModel.attachStorageToDataCenter(sdToAdd1.getId(), dataCenter.getId(), model.getActivateDomain().getEntity()); onFinish(storageListModel.context, true, storageListModel.storageModel, null); } else { postImportFileStorage(storageListModel.context, true, storageListModel.storageModel, null); } } else { postImportFileStorage(storageListModel.context, false, storageListModel.storageModel, ""); Frontend.getInstance().runAction(VdcActionType.RemoveStorageServerConnection, new StorageServerConnectionParametersBase(fileConnection, hostId), null, this); } } }, new Object[] {this, sdToAdd}); }

Target:
public void importFileStorageAddDomain(ArrayList<StorageDomain> domains) { StorageDomain sdToAdd = Linq.firstOrDefault(domains); StorageDomainStatic sdsToAdd = sdToAdd.getStorageStaticData(); StorageDomainManagementParameter params = new StorageDomainManagementParameter(sdsToAdd); params.setVdsId(hostId); Frontend.getInstance().runAction(VdcActionType.AddExistingFileStorageDomain, params, new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { Object[] array = (Object[]) result.getState(); StorageListModel storageListModel = (StorageListModel) array[0]; StorageDomain sdToAdd1 = (StorageDomain) array[1]; VdcReturnValueBase returnVal = result.getReturnValue(); boolean success = returnVal != null && returnVal.getSucceeded(); if (success) { StorageModel model = (StorageModel) storageListModel.getWindow(); StoragePool dataCenter = model.getDataCenter().getSelectedItem(); if (!dataCenter.getId().equals(StorageModel.UnassignedDataCenterId)) { storageListModel.attachStorageToDataCenter(sdToAdd1.getId(), dataCenter.getId(), model.getActivateDomain().getEntity()); onFinish(storageListModel.context, true, storageListModel.storageModel, null); } else { postImportFileStorage(storageListModel.context, true, storageListModel.storageModel, null); } } else { postImportFileStorage(storageListModel.context, false, storageListModel.storageModel, ""); storageListModel.cleanConnection(fileConnection, hostId); } } }, new Object[] {this, sdToAdd}); }
Source:
public void updateInPerspective(ActionEvent e) { final Resource[] resources = appContext.getResources(); if (resources != null && resources.length == 1) { final Resource selectedResource = resources[0]; if (Resource.FILE == selectedResource.getResourceType()) { final String fileExtension = ((File)selectedResource).getExtension(); if (pngFile.getExtension().equals(fileExtension) || bmpFile.getExtension().equals(fileExtension) || gifFile.getExtension().equals(fileExtension) || iconFile.getExtension().equals(fileExtension) || svgFile.getExtension().equals(fileExtension) || jpeFile.getExtension().equals(fileExtension) || jpegFile.getExtension().equals(fileExtension) || jpgFile.getExtension().equals(fileExtension)) { e.getPresentation().setEnabledAndVisible(true); return; } } } e.getPresentation().setEnabledAndVisible(false); }

Target:
public void updateInPerspective(ActionEvent e) { final Resource[] resources = appContext.getResources(); if (resources != null && resources.length == 1) { final Resource selectedResource = resources[0]; if (Resource.FILE == selectedResource.getResourceType()) { final String fileExtension = ((File)selectedResource).getExtension(); e.getPresentation().setEnabledAndVisible(extensions.contains(fileExtension)); return; } } e.getPresentation().setEnabledAndVisible(false); }
Source:
public Component buildPageComponent() { final Action authAction = new AbstractAction() { { putValue(Action.NAME, GanttLanguage.getInstance().getText("googleAuth")); } @Override public void actionPerformed(ActionEvent ev) { try { googleAuth.someSampleWork(); } catch(IOException e) {getUiFacade().showErrorDialog(e);}; } }; JPanel result = new JPanel(new BorderLayout()); result.setBorder(new EmptyBorder(5, 5, 5, 5)); JButton testConnectionButton = new JButton(authAction); result.add(testConnectionButton,BorderLayout.NORTH); return result; }

Target:
public Component buildPageComponent() { JPanel result = new JPanel(new BorderLayout()); result.setBorder(new EmptyBorder(5, 5, 5, 5)); JButton testConnectionButton = new JButton(new GPAction("googleConnect") { @Override public void actionPerformed(ActionEvent e) { try { myAuth.someSampleWork(myAuth.getCalendarService(myAuth.authorize())); } catch (Exception e1) { GPLogger.getLogger(GoogleExportOptionPageProvider.class).log(Level.WARNING, "Something went wrong", e1); } } }); result.add(testConnectionButton, BorderLayout.SOUTH); return result; }
Source:
private Optional<Cache<Object, Person>> findCache(Ownership ownership, Object key) { List<Cache<Object, Person>> caches = caches(); ClusteringDependentLogic cdl = cache1.getAdvancedCache().getComponentRegistry().getComponent(ClusteringDependentLogic.class); DistributionInfo distribution = cdl.getCacheTopology().getDistribution(key); Predicate<Cache<?, ?>> predicate = null; switch (ownership) { case PRIMARY: predicate = c -> c.getAdvancedCache().getRpcManager().getAddress().equals(distribution.primary()); break; case BACKUP: predicate = c -> { Address address = c.getAdvancedCache().getRpcManager().getAddress(); return distribution.writeOwners().contains(address) && !distribution.primary().equals(address); }; break; case NON_OWNER: predicate = c -> { Address address = c.getAdvancedCache().getRpcManager().getAddress(); return !distribution.writeOwners().contains(address) && !distribution.primary().equals(address); }; } return caches.stream().filter(predicate).findFirst(); }

Target:
private Optional<Cache<Object, Person>> findCache(Ownership ownership, Object key) { List<Cache<Object, Person>> caches = caches(); ClusteringDependentLogic cdl = cache1.getAdvancedCache().getComponentRegistry().getComponent(ClusteringDependentLogic.class); DistributionInfo distribution = cdl.getCacheTopology().getDistribution(key); Predicate<Cache<?, ?>> predicate = null; switch (ownership) { case PRIMARY: predicate = c -> c.getAdvancedCache().getRpcManager().getAddress().equals(distribution.primary()); break; case BACKUP: predicate = c -> distribution.writeBackups().contains(c.getAdvancedCache().getRpcManager().getAddress()); break; case NON_OWNER: predicate = c -> !distribution.writeOwners().contains(c.getAdvancedCache().getRpcManager().getAddress()); } return caches.stream().filter(predicate).findFirst(); }
Source:
protected void updateVolumeType(StorageType storageType) { isInStorageDomainUpdate = true; if (!isUserSelectVolumeType) { getVolumeType().setSelectedItem(storageType.isBlockDomain() ? VolumeType.Preallocated : VolumeType.Sparse); } isInStorageDomainUpdate = false; }

Target:
protected void updateVolumeType(StorageType storageType) { if (!isUserSelectedVolumeType) { getVolumeType().setSelectedItem(storageType.isBlockDomain() ? VolumeType.Preallocated : VolumeType.Sparse); } }
Source:
public OptionSet(OptionSet origin) { if (origin == null) throw new NullPointerException(); if_match_list = copyList(origin.if_match_list); uri_host = origin.uri_host; etag_list = copyList(origin.etag_list); if_none_match = origin.if_none_match; uri_port = origin.uri_port; location_path_list = copyList(origin.location_path_list); uri_path_list = copyList(origin.uri_path_list); content_format = origin.content_format; max_age = origin.max_age; uri_query_list = copyList(origin.uri_query_list); accept = origin.accept; location_query_list = copyList(origin.location_query_list); proxy_uri = origin.proxy_uri; proxy_scheme = origin.proxy_scheme; if (origin.block1 != null) block1 = new BlockOption(origin.block1); if (origin.block2 != null) block2 = new BlockOption(origin.block2); observe = origin.observe; if(origin.oscore != null) oscore = origin.oscore.clone(); others = copyList(origin.others); }

Target:
public OptionSet(OptionSet origin) { if (origin == null) { throw new NullPointerException("option set must not be null!"); } if_match_list = copyList(origin.if_match_list); uri_host = origin.uri_host; etag_list = copyList(origin.etag_list); if_none_match = origin.if_none_match; uri_port = origin.uri_port; location_path_list = copyList(origin.location_path_list); uri_path_list = copyList(origin.uri_path_list); content_format = origin.content_format; max_age = origin.max_age; uri_query_list = copyList(origin.uri_query_list); accept = origin.accept; location_query_list = copyList(origin.location_query_list); proxy_uri = origin.proxy_uri; proxy_scheme = origin.proxy_scheme; if (origin.block1 != null) block1 = new BlockOption(origin.block1); if (origin.block2 != null) block2 = new BlockOption(origin.block2); observe = origin.observe; if(origin.oscore != null) oscore = origin.oscore.clone(); others = copyList(origin.others); }
Source:
public MethodOutcome updatePatient(@ResourceParam Patient patient, @IdParam IdType theId) { MethodOutcome retVal = new MethodOutcome(); OperationOutcome outcome = new OperationOutcome(); patientResource.updatePatient(patient, theId.getIdPart()); CodeableConcept concept = new CodeableConcept(); Coding coding = concept.addCoding(); coding.setDisplay("Patient is successfully updated"); outcome.addIssue().setDetails(concept); retVal.setOperationOutcome(outcome); return retVal; }

Target:
public MethodOutcome updatePatient(@ResourceParam Patient patient, @IdParam IdType theId) { MethodOutcome retVal = new MethodOutcome(); OperationOutcome outcome = new OperationOutcome(); patientResource.updatePatient(patient, theId.getIdPart()); CodeableConcept concept = new CodeableConcept(); Coding coding = concept.addCoding(); coding.setDisplay("Patient is successfully updated with id " + patient.getId()); outcome.addIssue().setDetails(concept); retVal.setOperationOutcome(outcome); return retVal; }
Source:
protected void cleanup(Context context) throws IOException { checkState(mProducerContext != null); mProducer.cleanup(mProducerContext); mProducerContext = null; super.cleanup(context); }

Target:
protected void cleanup(Context context) throws IOException { Preconditions.checkState(mProducerContext != null); mProducer.cleanup(mProducerContext); mProducerContext = null; super.cleanup(context); }
Source:
public void handleProfileGenericDataResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final ProfileGenericDataResponseDto profileGenericDataResponseDto) { LOGGER.info("handleProfileGenericDataResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } final ProfileGenericDataResponse profileGenericDataResponse = this.monitoringMapper .map(profileGenericDataResponseDto, ProfileGenericDataResponse.class); this.webServiceResponseMessageSender.send( ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(profileGenericDataResponse) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleProfileGenericDataResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final ProfileGenericDataResponseDto profileGenericDataResponseDto) { LOGGER.info("handleProfileGenericDataResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } final ProfileGenericDataResponse profileGenericDataResponse = this.monitoringMapper .map(profileGenericDataResponseDto, ProfileGenericDataResponse.class); final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(profileGenericDataResponse) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
private void checkTableName(TableReference tableRef) { SweepStrategy sweepStrategy = sweepStrategies.get(tableRef); if (sweepStrategy.mustCheckImmutableLockAfterReads()) { throw new SafeIllegalStateException( "Cannot read from a table with a thorough sweep strategy in a read only transaction."); } }

Target:
private void checkTableName(TableReference tableRef) { SweepStrategy sweepStrategy = sweepStrategies.get(tableRef); Preconditions.checkState(!sweepStrategy.mustCheckImmutableLockAfterReads(), "This table cannot be read from a read-only transaction, because its " + "sweep strategy is neither NOTHING nor CONSERVATIVE", LoggingArgs.tableRef(tableRef)); }
Source:
public void waitUntilLeaderIsElected() { waitUntilLeaderIsElected(defaultClient); }

Target:
public void waitUntilLeaderIsElected() { waitUntilLeaderIsElected(ImmutableList.of()); }
Source:
public Class<?> getTraceClass() { return fTraceClass; }

Target:
public Class<? extends ITmfTrace> getTraceClass() { return fTraceClass; }
Source:
private ImmutableSet<String> topLevelContainerIds(ImmutableSet<ModelWithPayload<Item>> items) { return items.stream() .map(item -> { if (item.getModel().getContainer() != null) { return item.getModel().getContainer().getUri(); } return null; } ) .filter(java.util.Objects::nonNull) .collect(MoreCollectors.toImmutableSet()); }

Target:
private ImmutableSet<String> topLevelContainerIds(ImmutableSet<ModelWithPayload<Item>> items) { return items.stream().map(ModelWithPayload::getModel) .map(Item::getContainer) .filter(java.util.Objects::nonNull) .map(ParentRef::getUri) .filter(java.util.Objects::nonNull) .collect(MoreCollectors.toImmutableSet()); }
Source:
public void refreshPaginator() { FacesContext facesContext = FacesContext.getCurrentInstance(); org.primefaces.component.datatable.DataTable dt = (org.primefaces.component.datatable.DataTable) facesContext.getViewRoot().findComponent("datasetForm:tabView:filesTable"); int rows = dt.getRowsToRender(); setRowsPerPage(rows); }

Target:
public void refreshPaginator() { FacesContext facesContext = FacesContext.getCurrentInstance(); org.primefaces.component.datatable.DataTable dt = (org.primefaces.component.datatable.DataTable) facesContext.getViewRoot().findComponent("datasetForm:tabView:filesTable"); setFilePaginatorPage(dt.getPage()); setRowsPerPage(dt.getRowsToRender()); }
Source:
public int checkMaxWriteSize(int limit) { if (serializedCache == null) { throw new IllegalStateException("checkMaxWriteSize requires serialized form"); } int payloadSize = getSizeEstimate(); if (limit != 0 && payloadSize > limit) { throw new WriteSizeException(payloadSize, limit); } return payloadSize; }

Target:
public int checkMaxWriteSize(int limit) { Preconditions.checkState(serializedCache != null, "checkMaxWriteSize requires serialized form"); int payloadSize = getSizeEstimate(); if (log.isTraceEnabled()) { log.trace("checkMaxWriteSize: payload size is bytes.", payloadSize); } if (payloadSize > limit) { throw new WriteSizeException(payloadSize, limit); } return payloadSize; }
Source:
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { return context.getClassLoader().getResource("org/springframework/web/servlet") != null; }

Target:
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { return context.getClassLoader() != null && context.getClassLoader().getResource("org/springframework/web/servlet") != null; }
Source:
public void retrievesFileCreationTime() throws IOException { final File file = new File(this.folder.newFolder(), "time"); final String content = "some content"; final Date before = new Date(); final Doc doc = new MkDoc(file, "", ""); doc.write( new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)) ); final Date after = new Date(); MatcherAssert.assertThat( TimeUnit.MILLISECONDS.toSeconds(doc.created().getTime()), Matchers.allOf( Matchers.greaterThanOrEqualTo( TimeUnit.MILLISECONDS.toSeconds(before.getTime()) ), Matchers.lessThanOrEqualTo( TimeUnit.MILLISECONDS.toSeconds(after.getTime()) ) ) ); }

Target:
public void retrievesFileCreationTime() throws IOException { final File file = new File(this.folder.newFolder(), "time"); final String content = "some content"; final long before = System.currentTimeMillis(); final Doc doc = new MkDoc(file, "", ""); doc.write( new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)) ); final long after = System.currentTimeMillis(); MatcherAssert.assertThat( TimeUnit.MILLISECONDS.toSeconds(doc.created().getTime()), Matchers.allOf( Matchers.greaterThanOrEqualTo( TimeUnit.MILLISECONDS.toSeconds(before) ), Matchers.lessThanOrEqualTo( TimeUnit.MILLISECONDS.toSeconds(after) ) ) ); }
Source:
private boolean slingQueryWasNotUsed() { return slingQueries.getOrDefault(slingQueryName, slingQueryStates.NOTUSED).equals(slingQueryStates.NOTUSED); }

Target:
private boolean slingQueryWasNotUsed() { return slingQueries.getOrDefault(currentSlingQueryVariableName, SlingQueryStates.NOT_USED) == SlingQueryStates.NOT_USED; }
Source:
public Object applyValueToMap(Object value, Map target) { if (value instanceof Collection) { for (Object v: (Collection)value) applyValueToMap(v, target); } else { target.put(subKey(), value); } return null; }

Target:
public Object applyValueToMap(Object value, Map target) { if (value instanceof StructuredModification) { return ((StructuredModification)value).applyToKeyInMap(this, target); } else if (value instanceof Collection) { String warning = "Discouraged undecorated setting of a collection to ListConfigKey "+this+": use ListModification.{set,add}. " + "Defaulting to 'add'. Look at debug logging for call stack."; log.warn(warning); if (log.isDebugEnabled()) log.debug("Trace for: "+warning, new Throwable("Trace for: "+warning)); for (Object v: (Collection)value) applyValueToMap(v, target); return null; } else { target.put(subKey(), value); return null; } }
Source:
public void addChangeListener_throwInsiderTransaction() { Realm realm = looperThread.realm; realm.beginTransaction(); Dog dog =realm.createObject(Dog.class); try { dog.addChangeListener(new RealmChangeListener<Dog>() { @Override public void onChange(Dog element) { } }); } catch (IllegalStateException ignored) { } try { dog.addChangeListener(new RealmObjectChangeListener<Dog>() { @Override public void onChange(Dog object, ObjectChangeSet changeSet) { } }); } catch (IllegalStateException ignored) { } realm.cancelTransaction(); looperThread.testComplete(); }

Target:
public void addChangeListener_throwInsiderTransaction() { Realm realm = looperThread.realm; realm.beginTransaction(); Dog dog = realm.createObject(Dog.class); try { dog.addChangeListener(new RealmChangeListener<Dog>() { @Override public void onChange(Dog element) { fail(); } }); } catch (IllegalStateException ignored) { } try { dog.addChangeListener(new RealmObjectChangeListener<Dog>() { @Override public void onChange(Dog object, ObjectChangeSet changeSet) { fail(); } }); } catch (IllegalStateException ignored) { } realm.cancelTransaction(); looperThread.testComplete(); }
Source:
public void testLocalTimestampFuncWithCurrentTime() { testLocalTimestampFunc(currentTimeString(LOCAL_TZ)); }

Target:
@Test public void testLocalTimestampFuncWithCurrentTime() { testLocalTimestampFunc(currentTimeString(LOCAL_TZ)); }
Source:
public boolean isValid(final CurrentUser user, final ApprovalType at, final FunctionState state) { return isProjectStateValid(user, at, state) && isRefStateValid(user, at, state); }

Target:
public boolean isValid(final CurrentUser user, final ApprovalType at, final FunctionState state) { if (state.getRefRights(at).isEmpty()) { return isProjectStateValid(user, at, state); } else { return isRefStateValid(user, at, state); } }
Source:
public Serializable checkIn(Node node, String label, String checkinComment) { Boolean checkedIn = (Boolean) node.hierFragment.get(Model.MAIN_CHECKED_IN_KEY); if (Boolean.TRUE.equals(checkedIn)) { throw new NuxeoException("Already checked in"); } if (label == null) { Serializable major = node.getSimpleProperty(Model.MAIN_MAJOR_VERSION_PROP).getValue(); Serializable minor = node.getSimpleProperty(Model.MAIN_MINOR_VERSION_PROP).getValue(); if (major == null) { major = "0"; } if (minor == null) { minor = "0"; } label = major + "." + minor; } Serializable id = node.getId(); boolean excludeSpecialChildren = false; CopyResult res = mapper.copy(new IdWithTypes(node), null, null, null, excludeSpecialChildren); Serializable newId = res.copyId; markInvalidated(res.invalidations); SimpleFragment verHier = getHier(newId, excludeSpecialChildren); verHier.put(Model.MAIN_IS_VERSION_KEY, Boolean.TRUE); boolean isMajor = Long.valueOf(0).equals(verHier.get(Model.MAIN_MINOR_VERSION_KEY)); Row row = new Row(Model.VERSION_TABLE_NAME, newId); row.putNew(Model.VERSION_VERSIONABLE_KEY, id); row.putNew(Model.VERSION_CREATED_KEY, new GregorianCalendar()); row.putNew(Model.VERSION_LABEL_KEY, label); row.putNew(Model.VERSION_DESCRIPTION_KEY, checkinComment); row.putNew(Model.VERSION_IS_LATEST_KEY, Boolean.TRUE); row.putNew(Model.VERSION_IS_LATEST_MAJOR_KEY, Boolean.valueOf(isMajor)); createVersionFragment(row); node.hierFragment.put(Model.MAIN_CHECKED_IN_KEY, Boolean.TRUE); node.hierFragment.put(Model.MAIN_BASE_VERSION_KEY, newId); recomputeVersionSeries(id); return newId; }

Target:
public Serializable checkIn(Node node, String label, String checkinComment) { Boolean checkedIn = (Boolean) node.hierFragment.get(Model.MAIN_CHECKED_IN_KEY); if (Boolean.TRUE.equals(checkedIn)) { throw new NuxeoException("Already checked in"); } if (label == null) { Serializable major = node.getSimpleProperty(Model.MAIN_MAJOR_VERSION_PROP).getValue(); Serializable minor = node.getSimpleProperty(Model.MAIN_MINOR_VERSION_PROP).getValue(); if (major == null) { major = "0"; } if (minor == null) { minor = "0"; } label = major + "." + minor; } Serializable id = node.getId(); boolean excludeSpecialChildren = false; CopyResult res = mapper.copy(new IdWithTypes(node), null, null, null, excludeSpecialChildren); Serializable newId = res.copyId; markInvalidated(res.invalidations); SimpleFragment verHier = getHier(newId, false); verHier.put(Model.MAIN_IS_VERSION_KEY, Boolean.TRUE); boolean isMajor = Long.valueOf(0).equals(verHier.get(Model.MAIN_MINOR_VERSION_KEY)); Row row = new Row(Model.VERSION_TABLE_NAME, newId); row.putNew(Model.VERSION_VERSIONABLE_KEY, id); row.putNew(Model.VERSION_CREATED_KEY, new GregorianCalendar()); row.putNew(Model.VERSION_LABEL_KEY, label); row.putNew(Model.VERSION_DESCRIPTION_KEY, checkinComment); row.putNew(Model.VERSION_IS_LATEST_KEY, Boolean.TRUE); row.putNew(Model.VERSION_IS_LATEST_MAJOR_KEY, Boolean.valueOf(isMajor)); createVersionFragment(row); node.hierFragment.put(Model.MAIN_CHECKED_IN_KEY, Boolean.TRUE); node.hierFragment.put(Model.MAIN_BASE_VERSION_KEY, newId); recomputeVersionSeries(id); return newId; }
Source:
private void checkEndOfRowGroup() throws IOException { if (rowsReturned != totalCountLoadedSoFar) { return; } PageReadStore pages = reader.readNextRowGroup(); if (pages == null) { throw new IOException("expecting more rows but reached last block. Read " + rowsReturned + " out of " + totalRowCount); } List<ColumnDescriptor> columns = requestedSchema.getColumns(); List<Type> types = requestedSchema.getFields(); columnReaders = new VectorizedColumnReader[columns.size()]; for (int i = 0; i < types.size(); ++i) { columnReaders[i] = buildVectorizedParquetReader(columnTypesList.get(indexColumnsWanted.get(i)), types.get(i), pages, requestedSchema, skipTimestampConversion); } totalCountLoadedSoFar += pages.getRowCount(); }

Target:
private void checkEndOfRowGroup() throws IOException { if (rowsReturned != totalCountLoadedSoFar) { return; } PageReadStore pages = reader.readNextRowGroup(); if (pages == null) { throw new IOException("expecting more rows but reached last block. Read " + rowsReturned + " out of " + totalRowCount); } List<ColumnDescriptor> columns = requestedSchema.getColumns(); List<Type> types = requestedSchema.getFields(); columnReaders = new VectorizedColumnReader[columns.size()]; if (!ColumnProjectionUtils.isReadAllColumns(jobConf) && !indexColumnsWanted.isEmpty()) { for (int i = 0; i < types.size(); ++i) { columnReaders[i] = buildVectorizedParquetReader(columnTypesList.get(indexColumnsWanted.get(i)), types.get(i), pages, requestedSchema.getColumns(), skipTimestampConversion, 0); } } else { for (int i = 0; i < types.size(); ++i) { columnReaders[i] = buildVectorizedParquetReader(columnTypesList.get(i), types.get(i), pages, requestedSchema.getColumns(), skipTimestampConversion, 0); } } totalCountLoadedSoFar += pages.getRowCount(); }
Source:
public ResourceID(String resourceId, String metadata) { Preconditions.checkNotNull(resourceId, "ResourceID must not be null"); Preconditions.checkNotNull(metadata, "ResourceID must not be null"); this.resourceId = resourceId; this.metadata = metadata; }

Target:
public ResourceID(String resourceId, String metadata) { Preconditions.checkNotNull(resourceId, "The identifier must not be null"); Preconditions.checkNotNull(metadata, "The metadata must not be null"); this.resourceId = resourceId; this.metadata = metadata; }
Source:
public AmazonS3Target(S3TargetConfigBean s3TargetConfigBean) { this.s3TargetConfigBean = s3TargetConfigBean; this.partitionTemplate = s3TargetConfigBean.partitionTemplate == null ? "" : s3TargetConfigBean.partitionTemplate; this.fileNameSuffix = s3TargetConfigBean.fileNameSuffix == null ? "" : s3TargetConfigBean.fileNameSuffix; }

Target:
public AmazonS3Target(S3TargetConfigBean s3TargetConfigBean) { this.s3TargetConfigBean = s3TargetConfigBean; this.partitionTemplate = s3TargetConfigBean.partitionTemplate == null ? "" : s3TargetConfigBean.partitionTemplate; }
Source:
private void prefixNumaPinningIfApplicable(String numaId, List<String> commandList) { if (numaId != null) { if (isOnLinux()) { commandList.add("numactl"); commandList.add("--i=" + numaId); return; } else { throw new RuntimeException("numactl pinning currently not supported on non-Linux hosts"); } } }

Target:
private void prefixNumaPinningIfApplicable(String numaId, List<String> commandList) { if (numaId != null) { if (isOnLinux()) { commandList.add(0, "numactl"); commandList.add(1, "--cpunodebind=" + numaId); commandList.add(2, "--membind=" + numaId); return; } else { throw new RuntimeException("numactl pinning currently not supported on non-Linux hosts"); } } }
Source:
public long getNumPendingCompletionRequests() { long numPending = 0; for (PerChannelBookieClient pcbc : clients) { numPending += pcbc.getNumPendingCompletionRequests(); } if (null != clientsV3) { for (PerChannelBookieClient pcbc : clientsV3) { numPending += pcbc.getNumPendingCompletionRequests(); } } return numPending; }

Target:
public long getNumPendingCompletionRequests() { long numPending = 0; for (PerChannelBookieClient pcbc : clients) { numPending += pcbc.getNumPendingCompletionRequests(); } if (clients != clientsV3Enforced) { for (PerChannelBookieClient pcbc : clientsV3Enforced) { numPending += pcbc.getNumPendingCompletionRequests(); } } return numPending; }
Source:
public File getAliasKeyStore(String alias) { File storePath = null; for (int i = 0; i < 3; i++) { switch (i) { case 0: storePath = TRUSTED; case 1: storePath = EXCEPTIONS; case 2: storePath = BLACKLIST; } try (FileInputStream input = new FileInputStream(storePath)) { trustStore = KeyStore.getInstance("JKS"); trustStore.load(input, passwd); Enumeration store = trustStore.aliases(); while (store.hasMoreElements()) { String searchAlias = (String) store.nextElement(); X509Certificate certificate = (X509Certificate) trustStore.getCertificate(alias); if (alias.equals(alias)) { return storePath; } } } catch (IOException | KeyStoreException | NoSuchAlgorithmException | CertificateException e) { Log.error("Cannot access Keystore", e); } } return storePath; }

Target:
private File getAliasKeyStore(String alias) { for (CertificateModel model : exemptedCertificates) { if (model.getAlias().equals(alias)) { return EXCEPTIONS; } } for (CertificateModel model : blackListedCertificates) { if (model.getAlias().equals(alias)) { return BLACKLIST; } } for (CertificateModel model : certificates) { if (model.getAlias().equals(alias)) { return TRUSTED; } } return null; }
Source:
protected IMIBackend createBackendGDBService(DsfSession session, ILaunchConfiguration lc) { if (compareVersionWith(GDB_7_12_VERSION) >= 0) { return new GDBBackend_7_12(session, lc); } return new GDBBackend(session, lc); }

Target:
protected IMIBackend createBackendGDBService(DsfSession session, ILaunchConfiguration lc) { if (compareVersionWith(GDB_7_12_VERSION) >= 0 || compareVersionWith("7.11.50") >= 0 ) { return new GDBBackend_7_12(session, lc); } return new GDBBackend(session, lc); }
Source:
private void printShape(String fullName) { String shape = fullName.contains("bond") ? "invtrapezium" : fullName.contains("net") ? "circle" : fullName.contains("mgmt") ? "circle" : fullName.contains("eth") ? "component" : fullName.contains("vlan") ? "diamond" : "missing shape. you have an error"; String color = fullName.contains("bond") ? "cyan" : fullName.contains("net") ? "pink" : fullName.contains("mgmt") ? "red" : fullName.contains("eth") ? "grey" : fullName.contains("vlan") ? "sienna" : "missing color. you have an error"; System.out.println(" " + prefix() + fullName + "[shape=" + "\"" + shape + "\",color=\"" + color + "\"]"); }

Target:
private void printShape(String fullName) { String shape = fullName.contains("bond") ? "invtrapezium" : fullName.contains("net") ? "circle" : fullName.contains("mgmt") ? "circle" : fullName.contains("eth") ? "component" : fullName.contains("vlan") ? "diamond" : "missing shape. you have an error"; String color = fullName.contains("bond") ? "cyan" : fullName.contains("net") ? "pink" : fullName.contains("mgmt") ? "red" : fullName.contains("eth") ? "grey" : fullName.contains("vlan") ? "sienna" : "missing color. you have an error"; printout.append(" " + prefix() + fullName + "[shape=" + "\"" + shape + "\",color=\"" + color + "\"]"); }
Source:
protected void execute()

Target:
protected void execute() { Exception potentialSensorException = motor.checkSensorException(); if (potentialSensorException != null) { cancel(); if (fallbackCommand != null && !fallbackCommand.isRunning()) { fallbackCommand.start(); } } }
Source:
private void savePreferences() { try { List<String> groupUUIDS = new ArrayList<>(); for (RepositoryGroup group : groupMap.values()) { UUID uuid = group.getUuid(); String uuidString = uuid.toString(); groupUUIDS.add(uuidString); String name = group.getName(); preferences.put(PREFS_GROUP_NAME_PREFIX + uuidString, name); List<String> repos = group.getRepositories(); preferences.put(PREFS_GROUP_PREFIX + uuidString, StringUtils.join(repos, SEPARATOR)); } preferences.put(PREFS_GROUPS, StringUtils.join(groupUUIDS, SEPARATOR)); preferences.flush(); } catch (BackingStoreException e) { Activator.error("error saving repository group state", e); } }

Target:
private void savePreferences() { try { List<String> groupIds = new ArrayList<>(); for (RepositoryGroup group : groupMap.values()) { String groupId = group.getGroupId().toString(); groupIds.add(groupId); String name = group.getName(); preferences.put(PREFS_GROUP_NAME_PREFIX + groupId, name); List<String> repos = group.getRepositoryDirectories(); preferences.put(PREFS_GROUP_PREFIX + groupId, StringUtils.join(repos, SEPARATOR)); } preferences.put(PREFS_GROUPS, StringUtils.join(groupIds, SEPARATOR)); preferences.flush(); } catch (BackingStoreException e) { Activator.logError( UIText.RepositoriesView_RepoGroup_ErrorSavePreferences, e); } }
Source:
private boolean configureConfigDriveData(final VirtualMachineProfile profile, final NicProfile nic) { final UserVmVO vm = _userVmDao.findById(profile.getId()); if (vm.getType() != VirtualMachine.Type.User) { return false; } final Nic defaultNic = _networkModel.getDefaultNic(vm.getId()); if (defaultNic != null) { final String sshPublicKey = getSshKey(profile); final String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()).getDisplayText(); boolean isWindows = _guestOSCategoryDao.findById(_guestOSDao.findById(vm.getGuestOSId()).getCategoryId()).getName().equalsIgnoreCase("Windows"); String hostname = _hostDao.findById(vm.getHostId()).getName(); final Account caller = CallContext.current().getCallingAccount(); String destHostname = (VirtualMachineManager.AllowExposeHypervisorHostname.value() && VirtualMachineManager.AllowExposeHypervisorHostnameAccountLevel.valueIn(caller.getId())) ? hostname : null; final List<String[]> vmData = _networkModel.generateVmData(vm.getUserData(), serviceOffering, vm.getDataCenterId(), vm.getInstanceName(), vm.getHostName(), vm.getId(), vm.getUuid(), nic.getIPv4Address(), sshPublicKey, (String) profile.getParameter(VirtualMachineProfile.Param.VmPassword), isWindows, destHostname); profile.setVmData(vmData); profile.setConfigDriveLabel(VirtualMachineManager.VmConfigDriveLabel.value()); } return true; }

Target:
private boolean configureConfigDriveData(final VirtualMachineProfile profile, final NicProfile nic) { final UserVmVO vm = _userVmDao.findById(profile.getId()); if (vm.getType() != VirtualMachine.Type.User) { return false; } final Nic defaultNic = _networkModel.getDefaultNic(vm.getId()); if (defaultNic != null) { final String sshPublicKey = getSshKey(profile); final String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()).getDisplayText(); boolean isWindows = _guestOSCategoryDao.findById(_guestOSDao.findById(vm.getGuestOSId()).getCategoryId()).getName().equalsIgnoreCase("Windows"); String hostname = _hostDao.findById(vm.getHostId()).getName(); String destHostname = VirtualMachineManager.getHypervisorHostname(hostname); final List<String[]> vmData = _networkModel.generateVmData(vm.getUserData(), serviceOffering, vm.getDataCenterId(), vm.getInstanceName(), vm.getHostName(), vm.getId(), vm.getUuid(), nic.getIPv4Address(), sshPublicKey, (String) profile.getParameter(VirtualMachineProfile.Param.VmPassword), isWindows, destHostname); profile.setVmData(vmData); profile.setConfigDriveLabel(VirtualMachineManager.VmConfigDriveLabel.value()); } return true; }
Source:
public boolean equals(final Object o) { System.out.println("here"); if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) { System.out.println("super"); return false; } final HAClusterConfig haconfig = (HAClusterConfig) o; final boolean result = Objects.equal(merge_aggregator, haconfig.getMergeAggregator()) && Objects.equal(original_secondary_timeout, haconfig.getOriginalsecondarytimeout()) && Objects.equal(original_primary_timeout, haconfig.getOriginalprimarytimeout()); if (!result) { System.out.println("result"); return false; } if (!Comparators.ListComparison.equalLists(data_sources, haconfig.getDataSources())) { System.out.println("datasources"); return false; } if (!Comparators.ListComparison.equalLists(data_source_configs, haconfig.getDataSourceConfigs())) { System.out.println("configs"); return false; } return true; }

Target:
public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) { return false; } final HAClusterConfig haconfig = (HAClusterConfig) o; final boolean result = Objects.equal(merge_aggregator, haconfig.getMergeAggregator()) && Objects.equal(primary_timeout, haconfig.getPrimaryTimeout()) && Objects.equal(secondary_timeout, haconfig.getSecondaryTimeout()); if (!result) { return false; } if (!Comparators.ListComparison.equalLists(data_sources, haconfig.getDataSources())) { return false; } if (!Comparators.ListComparison.equalLists(data_source_configs, haconfig.getDataSourceConfigs())) { return false; } return true; }
Source:
public static XmlForm parse(String xml, boolean strict) throws IOException { ObjectMapper objectMapper = new XmlMapper(); if (!strict) { objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); } XmlForm form = objectMapper.readValue(xml, XmlForm.class); System.out.println(form); return form; }

Target:
public static XmlForm parse(String xml, boolean strict) throws IOException { ObjectMapper objectMapper = new XmlMapper(); if (!strict) { objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); } XmlForm form = objectMapper.readValue(xml, XmlForm.class); return form; }
Source:
public <T> void setSilently(DataParameter<T> key, T value) { EntityDataManager.DataEntry<T> dataentry = this.getEntry(key); if (ObjectUtils.notEqual(value, dataentry.getValue())) { dataentry.setValue(value); this.entity.notifyDataManagerChange(key); dataentry.setDirty(true); this.dirty = true; } }

Target:
public <T> void bridge$setSilently(DataParameter<T> key, T value) { final EntityDataManager.DataEntry<T> dataentry = this.getEntry(key); if (ObjectUtils.notEqual(value, dataentry.getValue())) { dataentry.setValue(value); this.entity.notifyDataManagerChange(key); dataentry.setDirty(true); this.dirty = true; } }
Source:
private Optional<String> getTabbarPath(String documentationOptions) { try { Properties docProps = new Properties(); docProps.load(new StringReader(documentationOptions)); String path = docProps.getProperty(TABBAR_PATH_PREFIX); if (path != null) { return Optional.of(path); } } catch (IOException e) { } return Optional.empty(); }

Target:
private Optional<String> getTabbarPath(String documentationOptions) { try { Properties docProps = new Properties(); StringReader docReader = new StringReader(documentationOptions); try { docProps.load(docReader); } finally { docReader.close(); } String path = docProps.getProperty(TABBAR_PATH_PREFIX); if (path != null) { return Optional.of(path); } } catch (IOException e) { } return Optional.empty(); }
Source:
public IOpResponse execute(GetTokensByCodeParams params) throws Exception { validate(params); final Rp site = getRp(); OpenIdConfigurationResponse discoveryResponse = getDiscoveryService().getConnectDiscoveryResponse(site); final TokenRequest tokenRequest = new TokenRequest(GrantType.AUTHORIZATION_CODE); tokenRequest.setCode(params.getCode()); tokenRequest.setRedirectUri(site.getAuthorizationRedirectUri()); tokenRequest.setAuthUsername(site.getClientId()); tokenRequest.setAuthPassword(site.getClientSecret()); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC); final TokenClient tokenClient = new TokenClient(discoveryResponse.getTokenEndpoint()); tokenClient.setExecutor(getHttpService().getClientExecutor()); tokenClient.setRequest(tokenRequest); final TokenResponse response = tokenClient.exec(); ClientUtils.showClient(tokenClient); if (response.getStatus() == 200 || response.getStatus() == 302) { return handleSuccess(params, site, discoveryResponse, response); } else if (response.getStatus() == 400 ){ return handleBadRequest(response); } else { LOG.error("Failed to get tokens because response code is: " + response.getScope()); } return null; }

Target:
public IOpResponse execute(GetTokensByCodeParams params) throws Exception { validate(params); final Rp site = getRp(); OpenIdConfigurationResponse discoveryResponse = getDiscoveryService().getConnectDiscoveryResponse(site); final TokenRequest tokenRequest = new TokenRequest(GrantType.AUTHORIZATION_CODE); tokenRequest.setCode(params.getCode()); tokenRequest.setRedirectUri(site.getAuthorizationRedirectUri()); tokenRequest.setAuthUsername(site.getClientId()); tokenRequest.setAuthPassword(site.getClientSecret()); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC); final TokenClient tokenClient = new TokenClient(discoveryResponse.getTokenEndpoint()); tokenClient.setExecutor(getHttpService().getClientExecutor()); tokenClient.setRequest(tokenRequest); final TokenResponse response = tokenClient.exec(); ClientUtils.showClient(tokenClient); return validateResponse(params, site, discoveryResponse, response); }
Source:
private List<VDS> runFilters(List<Guid> filters, List<VDS> hostList, VM vm, Map<String, String> parameters, Map<Guid, Integer> filterPositionMap, List<String> messages, VdsFreeMemoryChecker memoryChecker, boolean shouldRunExternalFilters, String correlationId) { SchedulingResult result = new SchedulingResult(); ArrayList<PolicyUnitImpl> internalFilters = new ArrayList<>(); ArrayList<PolicyUnitImpl> externalFilters = new ArrayList<>(); filters = new ArrayList<>(filters); sortFilters(filters, filterPositionMap); for (Guid filter : filters) { PolicyUnitImpl filterPolicyUnit = policyUnits.get(filter); if (filterPolicyUnit.getPolicyUnit().isInternal()) { internalFilters.add(filterPolicyUnit); } else { if (filterPolicyUnit.getPolicyUnit().isEnabled()) { externalFilters.add(filterPolicyUnit); } } } if (hostList == null || hostList.isEmpty()) { messages.add(EngineMessage.SCHEDULING_NO_HOSTS.name()); messages.addAll(result.getReasonMessages()); return hostList; } hostList = runInternalFilters(internalFilters, hostList, vm, parameters, filterPositionMap, memoryChecker, correlationId, result); if (shouldRunExternalFilters && Config.<Boolean>getValue(ConfigValues.ExternalSchedulerEnabled) && !externalFilters.isEmpty() && hostList != null && !hostList.isEmpty()) { hostList = runExternalFilters(externalFilters, hostList, vm, parameters, messages, correlationId, result); } if (hostList == null || hostList.isEmpty()) { messages.add(EngineMessage.SCHEDULING_ALL_HOSTS_FILTERED_OUT.name()); messages.addAll(result.getReasonMessages()); } return hostList; }

Target:
private List<VDS> runFilters(List<Guid> filters, List<VDS> hostList, VM vm, Map<String, String> parameters, Map<Guid, Integer> filterPositionMap, List<String> messages, VdsFreeMemoryChecker memoryChecker, boolean shouldRunExternalFilters, String correlationId) { SchedulingResult result = new SchedulingResult(); List<PolicyUnitImpl> internalFilters = new ArrayList<>(); List<PolicyUnitImpl> externalFilters = new ArrayList<>(); filters = new ArrayList<>(filters); sortFilters(filters, filterPositionMap); for (Guid filter : filters) { PolicyUnitImpl filterPolicyUnit = policyUnits.get(filter); if (filterPolicyUnit.getPolicyUnit().isInternal()) { internalFilters.add(filterPolicyUnit); } else { if (filterPolicyUnit.getPolicyUnit().isEnabled()) { externalFilters.add(filterPolicyUnit); } } } if (hostList == null || hostList.isEmpty()) { messages.add(EngineMessage.SCHEDULING_NO_HOSTS.name()); messages.addAll(result.getReasonMessages()); return hostList; } hostList = runInternalFilters(internalFilters, hostList, vm, parameters, filterPositionMap, memoryChecker, correlationId, result); if (shouldRunExternalFilters && Config.<Boolean>getValue(ConfigValues.ExternalSchedulerEnabled) && !externalFilters.isEmpty() && hostList != null && !hostList.isEmpty()) { hostList = runExternalFilters(externalFilters, hostList, vm, parameters, messages, correlationId, result); } if (hostList == null || hostList.isEmpty()) { messages.add(EngineMessage.SCHEDULING_ALL_HOSTS_FILTERED_OUT.name()); messages.addAll(result.getReasonMessages()); } return hostList; }
Source:
private void initBiosType() { ListModel<BiosType> biosType = getBiosType(); biosType.setItems(AsyncDataProvider.getInstance().getBiosTypeList()); biosType.setIsChangeable(true); biosType.setSelectedItem(BiosType.I440FX_SEA_BIOS); }

Target:
private void initBiosType() { ListModel<BiosType> biosType = getBiosType(); List<BiosType> biosTypeList = AsyncDataProvider.getInstance() .getBiosTypeList() .stream() .filter(bt -> bt != BiosType.CLUSTER_DEFAULT) .collect(Collectors.toList()); biosType.setItems(biosTypeList); biosType.setIsChangeable(true); biosType.setSelectedItem(BiosType.I440FX_SEA_BIOS); }
Source:
private QueryTemplate toQueryTemplate(Pagination pagination) { QueryTemplate queryTemplate = new QueryTemplate(); queryTemplate.setPageNumber(new PageNumberTemplate(pagination.getPageNumber())); queryTemplate.setPageSize(new PageSizeTemplate(pagination.getPageSize(), parametersExtractor.getMinPageSize(), parametersExtractor.getMaxPageSize())); return queryTemplate; }

Target:
private QueryTemplate toQueryTemplate(Pagination pagination) { QueryTemplate queryTemplate = new QueryTemplate(); queryTemplate.setPageNumber(paginationTemplateFactory.createPageNumberTemplate(pagination)); queryTemplate.setPageSize(paginationTemplateFactory.createPageSizeTemplate(pagination)); return queryTemplate; }