private void deleteAllLegacyTokens() { // normally there is only one, but just in case tokenList.removeIf(HashedToken::isLegacy); }
private void removeNullsThatFailedToLoad() { properties.removeIf(Objects::isNull); }
public void removeKernelExtensions( Predicate<KernelExtensionFactory<?>> toRemove ) { kernelExtensions.removeIf( toRemove ); }
@Override public boolean removeIf(Predicate<? super T> filter) { checkNotNull(filter); return fromList.removeIf(element -> filter.test(function.apply(element))); }
@Override public boolean removeIf(Predicate<? super T> filter) { checkNotNull(filter); return fromList.removeIf(element -> filter.test(function.apply(element))); }
/** * Extract a filtered set of PropertyDescriptors from the given BeanWrapper, * excluding ignored dependency types or properties defined on ignored dependency interfaces. * @param bw the BeanWrapper the bean was created with * @return the filtered PropertyDescriptors * @see #isExcludedFromDependencyCheck */ protected PropertyDescriptor[] filterPropertyDescriptorsForDependencyCheck(BeanWrapper bw) { List<PropertyDescriptor> pds = new ArrayList<>(Arrays.asList(bw.getPropertyDescriptors())); pds.removeIf(this::isExcludedFromDependencyCheck); return pds.toArray(new PropertyDescriptor[0]); }
@Override public void removeFilter( Filter filter, String pathSpec ) { filters.removeIf( current -> current.matches( filter, pathSpec ) ); }
/** * Will trigger the save if there is some modification */ public synchronized void removeId(@Nonnull String tokenUuid) { if(areStatsDisabled()){ return; } boolean tokenRemoved = tokenStats.removeIf(s -> s.tokenUuid.equals(tokenUuid)); if (tokenRemoved) { save(); } }
@Override public boolean enterRegion(MethodNode mth, IRegion region) { if (region instanceof Region) { region.getSubBlocks().removeIf(container -> { if (container instanceof BlockNode) { BlockNode block = (BlockNode) container; return block.getInstructions().isEmpty(); } return false; }); } return true; } };
private void compact(List<InstanceEvent> events) { BinaryOperator<InstanceEvent> latestEvent = (e1, e2) -> e1.getVersion() > e2.getVersion() ? e1 : e2; Map<Class<?>, Optional<InstanceEvent>> latestPerType = events.stream() .collect(groupingBy(InstanceEvent::getClass, reducing(latestEvent))); events.removeIf((e) -> !Objects.equals(e, latestPerType.get(e.getClass()).orElse(null))); }
@Override public boolean removeIf(Predicate<? super T> filter) { checkNotNull(filter); return fromList.removeIf(element -> filter.test(function.apply(element))); }
@Override public boolean removeIf(Predicate<? super T> filter) { checkNotNull(filter); return fromList.removeIf(element -> filter.test(function.apply(element))); }
@Override public void setBeanFactory(BeanFactory beanFactory) { if (!(beanFactory instanceof ConfigurableBeanFactory)) { throw new IllegalStateException("ScriptFactoryPostProcessor doesn't work with " + "non-ConfigurableBeanFactory: " + beanFactory.getClass()); } this.beanFactory = (ConfigurableBeanFactory) beanFactory; // Required so that references (up container hierarchies) are correctly resolved. this.scriptBeanFactory.setParentBeanFactory(this.beanFactory); // Required so that all BeanPostProcessors, Scopes, etc become available. this.scriptBeanFactory.copyConfigurationFrom(this.beanFactory); // Filter out BeanPostProcessors that are part of the AOP infrastructure, // since those are only meant to apply to beans defined in the original factory. this.scriptBeanFactory.getBeanPostProcessors().removeIf(beanPostProcessor -> beanPostProcessor instanceof AopInfrastructureBean); }
static boolean removeEmptyDetachedBlocks(MethodNode mth) { return mth.getBasicBlocks().removeIf(block -> block.getInstructions().isEmpty() && block.getPredecessors().isEmpty() && block.getSuccessors().isEmpty() ); } }
@Override public void afterConfigurerAdded(WebTestClient.Builder builder, @Nullable WebHttpHandlerBuilder httpHandlerBuilder, @Nullable ClientHttpConnector connector) { Assert.notNull(httpHandlerBuilder, "Not a mock server"); httpHandlerBuilder.filters(filters -> { filters.removeIf(filter -> filter instanceof IdentityFilter); filters.add(0, this.filter); }); } }
private MethodSpec.Builder baseResSetter(ClassName builderName) { final String parameterName = Strings.PREFIX_RES + WordUtils.capitalize(getName()); final List<AnnotationSpec> annotations = new ArrayList<>(getAnnotations()); annotations.removeIf(Arrays.asList(Types.NULLABLE, Types.NON_NULL)::contains); annotations.add(Types.STRING_RES); return MethodSpec.methodBuilder(Strings.PREFIX_SETTER + WordUtils.capitalize(parameterName)) .addParameter(ParameterSpec.builder(TypeName.INT, parameterName).addAnnotations(annotations).build()) .addModifiers(Modifier.PUBLIC) .addAnnotation(Types.NON_NULL) .returns(builderName); }
/** * Build an internal BeanFactory for resolving target beans. * @param containingFactory the containing BeanFactory that originally defines the beans * @return an independent internal BeanFactory to hold copies of some target beans */ protected DefaultListableBeanFactory buildInternalBeanFactory(ConfigurableBeanFactory containingFactory) { // Set parent so that references (up container hierarchies) are correctly resolved. DefaultListableBeanFactory internalBeanFactory = new DefaultListableBeanFactory(containingFactory); // Required so that all BeanPostProcessors, Scopes, etc become available. internalBeanFactory.copyConfigurationFrom(containingFactory); // Filter out BeanPostProcessors that are part of the AOP infrastructure, // since those are only meant to apply to beans defined in the original factory. internalBeanFactory.getBeanPostProcessors().removeIf(beanPostProcessor -> beanPostProcessor instanceof AopInfrastructureBean); return internalBeanFactory; }
private static void removeInsns(MethodNode mth) { for (BlockNode block : mth.getBasicBlocks()) { block.getInstructions().removeIf(insn -> { if (!insn.isAttrStorageEmpty()) { return false; } InsnType insnType = insn.getType(); return insnType == InsnType.GOTO || insnType == InsnType.NOP; }); } }
private static void removeMarkedBlocks(MethodNode mth) { mth.getBasicBlocks().removeIf(block -> { if (block.contains(AFlag.REMOVE)) { if (!block.getPredecessors().isEmpty() || !block.getSuccessors().isEmpty()) { LOG.warn("Block {} not deleted, method: {}", block, mth); } else { CatchAttr catchAttr = block.get(AType.CATCH_BLOCK); if (catchAttr != null) { catchAttr.getTryBlock().removeBlock(mth, block); } return true; } } return false; }); }
@Override public void dropColumn(String databaseName, String tableName, String columnName) { verifyCanDropColumn(this, databaseName, tableName, columnName); org.apache.hadoop.hive.metastore.api.Table table = delegate.getTable(databaseName, tableName) .orElseThrow(() -> new TableNotFoundException(new SchemaTableName(databaseName, tableName))); table.getSd().getCols().removeIf(fieldSchema -> fieldSchema.getName().equals(columnName)); alterTable(databaseName, tableName, table); }