Refine search
private IndexLimitation[] limitationsUnion( Iterable<IndexCapability> capabilities ) { HashSet<IndexLimitation> union = new HashSet<>(); for ( IndexCapability capability : capabilities ) { union.addAll( Arrays.asList( capability.limitations() ) ); } return union.toArray( new IndexLimitation[union.size()] ); } }
public String[] getPropertyGroups(String prefix) { Enumeration<?> keys = props.propertyNames(); HashSet<String> groups = new HashSet<String>(10); if (!prefix.endsWith(".")) { prefix += "."; } while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (key.startsWith(prefix)) { String groupName = key.substring(prefix.length(), key.indexOf( '.', prefix.length())); groups.add(groupName); } } return (String[]) groups.toArray(new String[groups.size()]); }
HashSet<String> envProfiles = new HashSet<>(Arrays.asList(activeProfiles)); envProfiles.addAll(Arrays.asList(StringUtils.commaDelimitedListToStringArray(profiles))); envProfiles.add("strict"); context.getEnvironment().setActiveProfiles(envProfiles.toArray(new String[0])); } else { context.getEnvironment().setActiveProfiles(StringUtils.commaDelimitedListToStringArray(profiles));
public String[] getPropertyGroups(String prefix) { Enumeration<?> keys = props.propertyNames(); HashSet<String> groups = new HashSet<String>(10); if (!prefix.endsWith(".")) { prefix += "."; } while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (key.startsWith(prefix)) { String groupName = key.substring(prefix.length(), key.indexOf( '.', prefix.length())); groups.add(groupName); } } return (String[]) groups.toArray(new String[groups.size()]); }
attr.add(ah.compress(parent)); } else { AttributeGroupHandler agh = (AttributeGroupHandler) o; attr.add(ah.compress(parent)); } else { AttributeGroupHandler agh = (AttributeGroupHandler) o; attr.add(it[i]); dct.attributes = (Attribute[]) attr.toArray(new Attribute[attr.size()]); dct.namespace = parent.getTargetNamespace(); dct.block = block;
/** * Returns all the profiles that define certain prop's key name. * Key name is given as a wildcard, or it can be matched fully. */ public String[] getProfilesFor(final String propKeyNameWildcard) { HashSet<String> profiles = new HashSet<>(); profile: for (Map.Entry<String, Map<String, PropsEntry>> entries : data.profileProperties.entrySet()) { String profileName = entries.getKey(); Map<String, PropsEntry> value = entries.getValue(); for (String propKeyName : value.keySet()) { if (Wildcard.equalsOrMatch(propKeyName, propKeyNameWildcard)) { profiles.add(profileName); continue profile; } } } return profiles.toArray(new String[0]); }
/** * Get the list of excluded http methods * * @return excluded http methods if the exist, null if there were no excluded security constraints */ public String[] getExcludedMethods() { String[] httpMethods = null; if (excludedMethods != null) { httpMethods = new String[excludedMethods.size()]; excludedMethods.toArray(httpMethods); } return httpMethods; }
public static ActiveMQDestination[] getDurableTopicDestinations(final Set<ActiveMQDestination> durableDestinations) { if (durableDestinations != null) { HashSet<ActiveMQDestination> topics = new HashSet<ActiveMQDestination>(); for (ActiveMQDestination d : durableDestinations) { if( d.isTopic() ) { topics.add(d); } } ActiveMQDestination[] dest = new ActiveMQDestination[topics.size()]; dest = topics.toArray(dest); return dest; } return null; }
/** * Creates an array of tables where all occurences of tables in the provided list of tables and columns are included */ public static Table[] getTables(Collection<Table> tableList, Iterable<Column> columnList) { HashSet<Table> set = new HashSet<Table>(); set.addAll(tableList); for (Column column : columnList) { set.add(column.getTable()); } return set.toArray(new Table[set.size()]); }
public static File[] getJarsWithNatives() { HashSet<File> jarFiles = new HashSet<File>(); for (Map.Entry<NativeLibrary.Key, NativeLibrary> lib : nativeLibraryMap.entrySet()) { File jarFile = getJarForNativeLibrary(lib.getValue().getPlatform(), lib.getValue().getName()); if (jarFile != null) { jarFiles.add(jarFile); } } return jarFiles.toArray(new File[0]); }
/** resolves (and deduplicates) host specification */ private InetAddress[] resolveInetAddresses(String hosts[]) throws IOException { if (hosts.length == 0) { throw new IllegalArgumentException("empty host specification"); } // deduplicate, in case of resolver misconfiguration // stuff like https://bugzilla.redhat.com/show_bug.cgi?id=496300 HashSet<InetAddress> set = new HashSet<>(); for (String host : hosts) { set.addAll(Arrays.asList(resolveInternal(host))); } return set.toArray(new InetAddress[set.size()]); }
public static Integer[] storm_task_ids(StormClusterState stat, String storm_id) { HashSet<Integer> rtn = new HashSet<Integer>(); Assignment ass = stat.assignment_info(storm_id, null); if (ass != null) { for (Integer task : ass.getTaskToNodeport().keySet()) { rtn.add(task); } } Integer[] rtnarr = new Integer[rtn.size()]; return rtn.toArray(rtnarr); }
/** * Creates an array of tables where all occurences of tables in the provided list of tables and columns are included */ public static Table[] getTables(Collection<Table> tableList, Iterable<Column> columnList) { HashSet<Table> set = new HashSet<Table>(); set.addAll(tableList); for (Column column : columnList) { set.add(column.getTable()); } return set.toArray(new Table[set.size()]); }
/** * Stores information about dismissed notification about editing ignored file. * * @param project current project * @param file current file */ public static void setDismissedIgnoredEditingNotification(@NotNull Project project, @NotNull VirtualFile file) { final PropertiesComponent props = properties(project); String[] values = props.getValues(DISMISSED_IGNORED_EDITING_NOTIFICATION); final HashSet<String> set = ContainerUtil.newHashSet(values != null ? values : new String[0]); set.add(file.getCanonicalPath()); props.setValues(DISMISSED_IGNORED_EDITING_NOTIFICATION, set.toArray(new String[0])); }