java.util.HashSet

Here are the examples of the java api class java.util.HashSet taken from open source projects.

1. JimpleModifier#isModifier()

Project: JAADAS
File: JimpleModifier.java
public static boolean isModifier(String token) {
    HashSet modifiers = new HashSet();
    modifiers.add("abstract");
    modifiers.add("final");
    modifiers.add("native");
    modifiers.add("public");
    modifiers.add("protected");
    modifiers.add("private");
    modifiers.add("static");
    modifiers.add("synchronized");
    modifiers.add("transient");
    modifiers.add("volatile");
    if (modifiers.contains(token))
        return true;
    else
        return false;
}

2. AllNamespacesTestCase#shouldExist()

Project: axis1-java
File: AllNamespacesTestCase.java
/**
     * List of files which should be generated.
     */
protected Set shouldExist() {
    HashSet set = new HashSet();
    String bean1Dir = "bean1";
    String bean2Dir = "bean2";
    String servicesDir = "services";
    set.add(bean1Dir + File.separator + "Bean1.java");
    set.add(bean2Dir + File.separator + "Bean2.java");
    set.add(servicesDir + File.separator + "Reporter.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
    set.add(servicesDir + File.separator + "deploy.wsdd");
    set.add(servicesDir + File.separator + "undeploy.wsdd");
    return set;
}

3. ExcludeBeanTestCase#shouldExist()

Project: axis1-java
File: ExcludeBeanTestCase.java
/**
     * List of files which should be generated.
     */
protected Set shouldExist() {
    HashSet set = new HashSet();
    String bean1Dir = "bean1";
    String bean2Dir = "bean2";
    String servicesDir = "services";
    //excluded - set.add(bean1Dir + File.separator + "Bean1.java");
    set.add(bean2Dir + File.separator + "Bean2.java");
    set.add(servicesDir + File.separator + "Reporter.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
    set.add(servicesDir + File.separator + "deploy.wsdd");
    set.add(servicesDir + File.separator + "undeploy.wsdd");
    return set;
}

4. CmdLineExcludeTestCase#shouldExist()

Project: axis1-java
File: CmdLineExcludeTestCase.java
/**
     * List of files which should be generated.
     */
protected Set shouldExist() {
    HashSet set = new HashSet();
    String bean1Dir = "bean1";
    String bean2Dir = "bean2";
    String servicesDir = "services";
    //excluded - set.add(bean1Dir + File.separator + "Bean1.java");
    set.add(bean2Dir + File.separator + "Bean2.java");
    set.add(servicesDir + File.separator + "Reporter.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
    set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
    set.add(servicesDir + File.separator + "deploy.wsdd");
    set.add(servicesDir + File.separator + "undeploy.wsdd");
    return set;
}

5. HashSetObjT#main()

Project: java-core-learning-example
File: HashSetObjT.java
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) {
    HashSet objs = new HashSet();
    objs.add(new A());
    objs.add(new B());
    objs.add(new C());
    objs.add(new A());
    objs.add(new B());
    objs.add(new C());
    System.out.println("HashSet Elements:");
    System.out.print("\t" + objs + "\n");
}

6. IncludeServiceTestCase#shouldExist()

Project: axis1-java
File: IncludeServiceTestCase.java
/**
     * List of files which should be generated.
     */
protected Set shouldExist() {
    HashSet set = new HashSet();
    //not included - set.add(bean1Dir + File.separator + "Bean1.java");
    //not included - set.add(bean2Dir + File.separator + "Bean2.java");
    set.add("Reporter.java");
    set.add("ReporterSoapBindingImpl.java");
    set.add("ReporterSoapBindingStub.java");
    set.add("ReporterSoapBindingSkeleton.java");
    set.add("deploy.wsdd");
    set.add("undeploy.wsdd");
    return set;
}

7. TestFSVisitor#setUp()

Project: hindex
File: TestFSVisitor.java
@Before
public void setUp() throws Exception {
    fs = FileSystem.get(TEST_UTIL.getConfiguration());
    rootDir = TEST_UTIL.getDataTestDir("hbase");
    logsDir = new Path(rootDir, HConstants.HREGION_LOGDIR_NAME);
    tableFamilies = new HashSet<String>();
    tableRegions = new HashSet<String>();
    recoveredEdits = new HashSet<String>();
    tableHFiles = new HashSet<String>();
    regionServers = new HashSet<String>();
    serverLogs = new HashSet<String>();
    tableDir = createTableFiles(rootDir, TABLE_NAME, tableRegions, tableFamilies, tableHFiles);
    createRecoverEdits(tableDir, tableRegions, recoveredEdits);
    createLogs(logsDir, regionServers, serverLogs);
    FSUtils.logFileSystemState(fs, rootDir, LOG);
}

8. ArrayIndexLivenessAnalysis#merge()

Project: JAADAS
File: ArrayIndexLivenessAnalysis.java
protected void merge(Object in1, Object in2, Object out) {
    HashSet inset1 = (HashSet) in1;
    HashSet inset2 = (HashSet) in2;
    HashSet outset = (HashSet) out;
    HashSet src = inset1;
    if (outset == inset1)
        src = inset2;
    else if (outset == inset2)
        src = inset1;
    else {
        outset.clear();
        outset.addAll(inset2);
    }
    outset.addAll(src);
}

9. SimpleACLAuthorizer#prepare()

Project: jstorm
File: SimpleACLAuthorizer.java
/**
     * Invoked once immediately after construction
     * 
     * @param conf Storm configuration
     */
@Override
public void prepare(Map conf) {
    _admins = new HashSet<String>();
    _supervisors = new HashSet<String>();
    _nimbusUsers = new HashSet<String>();
    _nimbusGroups = new HashSet<String>();
    if (conf.containsKey(Config.NIMBUS_ADMINS)) {
        _admins.addAll((Collection<String>) conf.get(Config.NIMBUS_ADMINS));
    }
    if (conf.containsKey(Config.NIMBUS_SUPERVISOR_USERS)) {
        _supervisors.addAll((Collection<String>) conf.get(Config.NIMBUS_SUPERVISOR_USERS));
    }
    if (conf.containsKey(Config.NIMBUS_USERS)) {
        _nimbusUsers.addAll((Collection<String>) conf.get(Config.NIMBUS_USERS));
    }
    if (conf.containsKey(Config.NIMBUS_GROUPS)) {
        _nimbusGroups.addAll((Collection<String>) conf.get(Config.NIMBUS_GROUPS));
    }
    _ptol = AuthUtils.GetPrincipalToLocalPlugin(conf);
    _groupMappingProvider = AuthUtils.GetGroupMappingServiceProviderPlugin(conf);
}

10. ClasspathResolver#resolveClasspathEntries()

Project: che
File: ClasspathResolver.java
/** Reads and parses classpath entries. */
public void resolveClasspathEntries(List<ClasspathEntryDto> entries) {
    libs = new HashSet<>();
    containers = new HashSet<>();
    sources = new HashSet<>();
    projects = new HashSet<>();
    for (ClasspathEntryDto entry : entries) {
        switch(entry.getEntryKind()) {
            case ClasspathEntryKind.LIBRARY:
                libs.add(entry.getPath());
                break;
            case ClasspathEntryKind.CONTAINER:
                containers.add(entry);
                break;
            case ClasspathEntryKind.SOURCE:
                sources.add(entry.getPath());
                break;
            case ClasspathEntryKind.PROJECT:
                projects.add(WORKSPACE_PATH + entry.getPath());
                break;
            default:
        }
    }
}

11. Translator#reset()

Project: ardublock
File: Translator.java
public void reset() {
    headerFileSet = new LinkedHashSet<String>();
    definitionSet = new LinkedHashSet<String>();
    setupCommand = new LinkedList<String>();
    guinoCommand = new LinkedList<String>();
    functionNameSet = new HashSet<String>();
    inputPinSet = new HashSet<String>();
    outputPinSet = new HashSet<String>();
    bodyTranslatreFinishCallbackSet = new HashSet<TranslatorBlock>();
    numberVariableSet = new HashMap<String, String>();
    booleanVariableSet = new HashMap<String, String>();
    stringVariableSet = new HashMap<String, String>();
    internalData = new HashMap<String, Object>();
    blockAdaptor = buildOpenBlocksAdaptor();
    variableCnt = 0;
    rootBlockName = null;
    isScoopProgram = false;
    isGuinoProgram = false;
}

12. SimpleACLAuthorizer#prepare()

Project: apache-storm-test
File: SimpleACLAuthorizer.java
/**
     * Invoked once immediately after construction
     * @param conf Storm configuration
     */
@Override
public void prepare(Map conf) {
    _admins = new HashSet<>();
    _supervisors = new HashSet<>();
    _nimbusUsers = new HashSet<>();
    _nimbusGroups = new HashSet<>();
    if (conf.containsKey(Config.NIMBUS_ADMINS)) {
        _admins.addAll((Collection<String>) conf.get(Config.NIMBUS_ADMINS));
    }
    if (conf.containsKey(Config.NIMBUS_SUPERVISOR_USERS)) {
        _supervisors.addAll((Collection<String>) conf.get(Config.NIMBUS_SUPERVISOR_USERS));
    }
    if (conf.containsKey(Config.NIMBUS_USERS)) {
        _nimbusUsers.addAll((Collection<String>) conf.get(Config.NIMBUS_USERS));
    }
    if (conf.containsKey(Config.NIMBUS_GROUPS)) {
        _nimbusGroups.addAll((Collection<String>) conf.get(Config.NIMBUS_GROUPS));
    }
    _ptol = AuthUtils.GetPrincipalToLocalPlugin(conf);
    _groupMappingProvider = AuthUtils.GetGroupMappingServiceProviderPlugin(conf);
}

13. ActiveMQSecurityManagerImplTest#testRemovingRoles()

Project: activemq-artemis
File: ActiveMQSecurityManagerImplTest.java
@Test
public void testRemovingRoles() {
    securityManager.getConfiguration().addUser("newuser1", "newpassword1");
    securityManager.getConfiguration().addRole("newuser1", "role1");
    securityManager.getConfiguration().addRole("newuser1", "role2");
    securityManager.getConfiguration().addRole("newuser1", "role3");
    securityManager.getConfiguration().addRole("newuser1", "role4");
    securityManager.getConfiguration().removeRole("newuser1", "role2");
    securityManager.getConfiguration().removeRole("newuser1", "role4");
    HashSet<Role> roles = new HashSet<>();
    roles.add(new Role("role1", true, true, true, true, true, true, true));
    Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    roles = new HashSet<>();
    roles.add(new Role("role2", true, true, true, true, true, true, true));
    Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    roles = new HashSet<>();
    roles.add(new Role("role3", true, true, true, true, true, true, true));
    Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    roles = new HashSet<>();
    roles.add(new Role("role4", true, true, true, true, true, true, true));
    Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    roles = new HashSet<>();
    roles.add(new Role("role5", true, true, true, true, true, true, true));
    Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
}

14. ActiveMQSecurityManagerImplTest#testAddingRoles()

Project: activemq-artemis
File: ActiveMQSecurityManagerImplTest.java
@Test
public void testAddingRoles() {
    securityManager.getConfiguration().addUser("newuser1", "newpassword1");
    securityManager.getConfiguration().addRole("newuser1", "role1");
    securityManager.getConfiguration().addRole("newuser1", "role2");
    securityManager.getConfiguration().addRole("newuser1", "role3");
    securityManager.getConfiguration().addRole("newuser1", "role4");
    HashSet<Role> roles = new HashSet<>();
    roles.add(new Role("role1", true, true, true, true, true, true, true));
    Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    roles = new HashSet<>();
    roles.add(new Role("role2", true, true, true, true, true, true, true));
    Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    roles = new HashSet<>();
    roles.add(new Role("role3", true, true, true, true, true, true, true));
    Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    roles = new HashSet<>();
    roles.add(new Role("role4", true, true, true, true, true, true, true));
    Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
    roles = new HashSet<>();
    roles.add(new Role("role5", true, true, true, true, true, true, true));
    Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
}

15. IncludeBeanTestCase#shouldExist()

Project: axis1-java
File: IncludeBeanTestCase.java
/**
     * List of files which should be generated.
     */
protected Set shouldExist() {
    HashSet set = new HashSet();
    set.add("Bean1.java");
    set.add("Bean2.java");
    /* excluded - 
        set.add(servicesDir + File.separator + "Reporter.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
        set.add(servicesDir + File.separator + "deploy.wsdd");
        set.add(servicesDir + File.separator + "undeploy.wsdd");
        */
    return set;
}

16. ExcludeServiceTestCase#shouldExist()

Project: axis1-java
File: ExcludeServiceTestCase.java
/**
     * List of files which should be generated.
     */
protected Set shouldExist() {
    HashSet set = new HashSet();
    String bean1Dir = "bean1";
    String bean2Dir = "bean2";
    String servicesDir = "services";
    set.add(bean1Dir + File.separator + "Bean1.java");
    set.add(bean2Dir + File.separator + "Bean2.java");
    /* excluded - 
        set.add(servicesDir + File.separator + "Reporter.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
        set.add(servicesDir + File.separator + "deploy.wsdd");
        set.add(servicesDir + File.separator + "undeploy.wsdd");
         */
    return set;
}

17. CmdLineIncludeTestCase#shouldExist()

Project: axis1-java
File: CmdLineIncludeTestCase.java
/**
     * List of files which should be generated.
     */
protected Set shouldExist() {
    HashSet set = new HashSet();
    set.add("Bean1.java");
    set.add("Bean2.java");
    /* not included - 
        set.add(servicesDir + File.separator + "Reporter.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
        set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
        set.add(servicesDir + File.separator + "deploy.wsdd");
        set.add(servicesDir + File.separator + "undeploy.wsdd");
        */
    return set;
}

18. NERFeatureFactoryITest#testSloppyGazette()

Project: CoreNLP
File: NERFeatureFactoryITest.java
public void testSloppyGazette() {
    List<CoreLabel> sentence = SentenceUtils.toCoreLabelList("For three years , John Bauer has worked at Stanford .".split(" +"));
    PaddedList<CoreLabel> paddedSentence = new PaddedList<CoreLabel>(sentence, new CoreLabel());
    Properties props = new Properties();
    props.setProperty("useGazettes", "true");
    props.setProperty("sloppyGazette", "true");
    props.setProperty("gazette", "projects/core/data/edu/stanford/nlp/ie/test_gazette.txt");
    SeqClassifierFlags flags = new SeqClassifierFlags(props);
    NERFeatureFactory<CoreLabel> factory = new NERFeatureFactory<CoreLabel>();
    factory.init(flags);
    Set<String> features;
    features = new HashSet<String>(factory.featuresC(paddedSentence, 4));
    checkFeatures(features, "BAR-GAZ", "BAZ-GAZ", "FOO-GAZ", "BAR-GAZ2", "BAZ-GAZ2", "FOO-GAZ1", "John-WORD");
    features = new HashSet<String>(factory.featuresC(paddedSentence, 5));
    checkFeatures(features, "BAR-GAZ", "BAZ-GAZ", "BAR-GAZ2", "BAZ-GAZ2", "Bauer-WORD");
    features = new HashSet<String>(factory.featuresC(paddedSentence, 6));
    checkFeatures(features, "has-WORD");
}

19. DefaultCachedRepository#getInheritableClassAttributes()

Project: commons-attributes
File: DefaultCachedRepository.java
private static Collection getInheritableClassAttributes(Class c) {
    if (c == null) {
        return new ArrayList(0);
    }
    HashSet result = new HashSet();
    result.addAll(getInheritableAttributes(Attributes.getAttributes(c)));
    // Traverse the class hierarchy
    result.addAll(getInheritableClassAttributes(c.getSuperclass()));
    // Traverse the interface hierarchy
    Class[] ifs = c.getInterfaces();
    for (int i = 0; i < ifs.length; i++) {
        result.addAll(getInheritableClassAttributes(ifs[i]));
    }
    return result;
}

20. SimpleCocoonCrawlerImpl#crawl()

Project: cocoon
File: SimpleCocoonCrawlerImpl.java
/**
     * Start crawling a URL.
     *
     * <p>
     *   Use this method to start crawling.
     *   Get the this url, and all its children  by using <code>iterator()</code>.
     *   The Iterator object will return URL objects.
     * </p>
     * <p>
     *  You may use the crawl(), and iterator() methods the following way:
     * </p>
     * <pre><tt>
     *   SimpleCocoonCrawlerImpl scci = ....;
     *   scci.crawl( "http://foo/bar" );
     *   Iterator i = scci.iterator();
     *   while (i.hasNext()) {
     *     URL url = (URL)i.next();
     *     ...
     *   }
     * </tt></pre>
     * <p>
     *   The i.next() method returns a URL, and calculates the links of the
     *   URL before return it.
     * </p>
     *
     * @param  url  Crawl this URL, getting all links from this URL.
     * @param  maxDepth  maximum depth to crawl to. -1 for no maximum.
     */
public void crawl(URL url, int maxDepth) {
    crawled = new HashSet();
    urlsToProcess = new HashSet();
    urlsNextDepth = new HashSet();
    depth = maxDepth;
    if (getLogger().isDebugEnabled()) {
        getLogger().debug("crawl URL " + url + " to depth " + maxDepth);
    }
    urlsToProcess.add(url);
}

21. ProxyVMContext#getKeys()

Project: bboss
File: ProxyVMContext.java
/**
     * @see bboss.org.apache.velocity.context.Context#getKeys()
     */
public Object[] getKeys() {
    if (localcontext.isEmpty()) {
        return vmproxyhash.keySet().toArray();
    } else if (vmproxyhash.isEmpty()) {
        return localcontext.keySet().toArray();
    }
    HashSet keys = new HashSet(localcontext.keySet());
    keys.addAll(vmproxyhash.keySet());
    return keys.toArray();
}

22. SetAnalysis#analyze()

Project: mr4c
File: SetAnalysis.java
private void analyze() {
    m_only1 = new HashSet<T>();
    m_only1.addAll(m_set1);
    m_only1.addAll(m_set2);
    m_only1.removeAll(m_set2);
    m_only2 = new HashSet<T>();
    m_only2.addAll(m_set1);
    m_only2.addAll(m_set2);
    m_only2.removeAll(m_set1);
    m_both = new HashSet<T>();
    m_both.addAll(m_set1);
    m_both.retainAll(m_set2);
}

23. JSONArrayTest#testToJSONStringCollection()

Project: json-simple
File: JSONArrayTest.java
public void testToJSONStringCollection() throws ParseException {
    final HashSet testSet = new HashSet();
    testSet.add("First item");
    testSet.add("Second item");
    final JSONArray jsonArray = new JSONArray(testSet);
    final JSONParser parser = new JSONParser();
    final JSONArray parsedArray = (JSONArray) parser.parse(jsonArray.toJSONString());
    assertTrue(parsedArray.containsAll(jsonArray));
    assertTrue(jsonArray.containsAll(parsedArray));
    assertEquals(2, jsonArray.size());
}

24. JSONArrayTest#testWriteJSONStringCollectionWriter()

Project: json-simple
File: JSONArrayTest.java
public void testWriteJSONStringCollectionWriter() throws IOException, ParseException {
    final HashSet testSet = new HashSet();
    testSet.add("First item");
    testSet.add("Second item");
    final JSONArray jsonArray = new JSONArray(testSet);
    final StringWriter writer = new StringWriter();
    jsonArray.writeJSONString(writer);
    final JSONParser parser = new JSONParser();
    final JSONArray parsedArray = (JSONArray) parser.parse(writer.toString());
    assertTrue(parsedArray.containsAll(jsonArray));
    assertTrue(jsonArray.containsAll(parsedArray));
    assertEquals(2, jsonArray.size());
}

25. MockDirectoryWrapper#crash()

Project: lucene-solr
File: MockDirectoryWrapper.java
/** Simulates a crash of OS or machine by overwriting
   *  unsynced files. */
public synchronized void crash() throws IOException {
    openFiles = new HashMap<>();
    openFilesForWrite = new HashSet<>();
    openFilesDeleted = new HashSet<>();
    // first force-close all files, so we can corrupt on windows etc.
    // clone the file map, as these guys want to remove themselves on close.
    Map<Closeable, Exception> m = new IdentityHashMap<>(openFileHandles);
    for (Closeable f : m.keySet()) {
        try {
            f.close();
        } catch (Exception ignored) {
        }
    }
    corruptFiles(unSyncedFiles);
    crashed = true;
    unSyncedFiles = new HashSet<>();
}

26. UsbMidiDriver#open()

Project: USB-MIDI-Driver
File: UsbMidiDriver.java
/**
     * Starts using UsbMidiDriver.
     *
     * Starts the USB device watching and communicating thread.
     */
public final void open() {
    if (isOpen) {
        // already opened
        return;
    }
    isOpen = true;
    connectedUsbDevices = new HashSet<>();
    midiInputDevices = new HashSet<>();
    midiOutputDevices = new HashSet<>();
    UsbManager usbManager = (UsbManager) context.getApplicationContext().getSystemService(Context.USB_SERVICE);
    deviceAttachedListener = new OnMidiDeviceAttachedListenerImpl();
    deviceDetachedListener = new OnMidiDeviceDetachedListenerImpl();
    deviceConnectionWatcher = new MidiDeviceConnectionWatcher(context.getApplicationContext(), usbManager, deviceAttachedListener, deviceDetachedListener);
}

27. TxnState#removeMgr()

Project: river
File: TxnState.java
/**
     * Remove the given mgr from the list of known managers.  Return the
     * number of mgrs still associated with this entry.
     */
private int removeMgr(TransactableMgr mgr) {
    if (mgrs == null)
        return 0;
    if (mgr == mgrs) {
        mgrs = null;
        return 0;
    }
    final HashSet tab = (HashSet) mgrs;
    tab.remove(mgr);
    return tab.size();
}

28. TestUtils#getTestAttributes()

Project: passport
File: TestUtils.java
public static Map<String, Set<String>> getTestAttributes() {
    final Map<String, Set<String>> attributes = new HashMap<>();
    Set<String> attributeValues = new HashSet<>();
    attributeValues.add("uid");
    attributes.put("uid", attributeValues);
    attributeValues = new HashSet<>();
    attributeValues.add("CASUser");
    attributes.put("givenName", attributeValues);
    attributeValues = new HashSet<>();
    attributeValues.add("admin");
    attributeValues.add("system");
    attributeValues.add("cas");
    attributes.put("memberOf", attributeValues);
    return attributes;
}

29. Env#setCheckPackages()

Project: openjdk
File: Env.java
void setCheckPackages(String packages) {
    includePackages = new HashSet<>();
    excludePackages = new HashSet<>();
    for (String pack : packages.split(DocLint.SEPARATOR)) {
        boolean excluded = false;
        if (pack.startsWith("-")) {
            pack = pack.substring(1);
            excluded = true;
        }
        if (pack.isEmpty())
            continue;
        Pattern pattern = MatchingUtils.validImportStringToPattern(pack);
        if (excluded) {
            excludePackages.add(pattern);
        } else {
            includePackages.add(pattern);
        }
    }
}

30. ClassTypeImpl#addInterfaces()

Project: openjdk
File: ClassTypeImpl.java
void addInterfaces(List list) {
    List immediate = interfaces();
    HashSet hashList = new HashSet(list);
    hashList.addAll(immediate);
    list.clear();
    list.addAll(hashList);
    Iterator iter = immediate.iterator();
    while (iter.hasNext()) {
        InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next();
        interfaze.addSuperinterfaces(list);
    }
    ClassTypeImpl superclass = (ClassTypeImpl) superclass();
    if (superclass != null) {
        superclass.addInterfaces(list);
    }
}

31. FileRetrievalSystem#resetVariables()

Project: oodt
File: FileRetrievalSystem.java
/**
     * Initializes variables that must be reset when more than one crawl is done
     *
     * @throws ThreadEvaluatorException
     */
void resetVariables() {
    numberOfSessions = 0;
    stagingAreas = new HashSet<File>();
    avaliableSessions = new Vector<Protocol>();
    currentlyDownloading = new HashSet<ProtocolFile>();
    failedDownloadList = new LinkedList<ProtocolFile>();
    max_allowed_failed_downloads = config.getMaxFailedDownloads();
    max_sessions = config.getRecommendedThreadCount();
    threadController = new ThreadPoolExecutor(this.max_sessions, this.max_sessions, EXTRA_LAZY_SESSIONS_TIMEOUT, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
    if (config.useTracker()) {
        dtEval = new DownloadThreadEvaluator(this.absMaxAllowedSessions);
    }
}

32. Utility#parseCommaList()

Project: oodt
File: Utility.java
/** Parse a list.
	 *
	 * This yields an iterator created from a list where commas (and optional leading
	 * and trailing whitespace) separate each element.  Each element will occur only
	 * once in the iterator regardless of how many times it appeared in the string.
	 *
	 * @param list The list to parse.
	 * @return The iterator over unique elements in the <var>list</var>.
	 */
public static Iterator parseCommaList(final String list) {
    if (list == null) {
        return new Iterator() {

            public boolean hasNext() {
                return false;
            }

            public Object next() {
                throw new java.util.NoSuchElementException("There weren't ANY elements in this iterator, ever");
            }

            public void remove() {
                throw new UnsupportedOperationException("Can't remove elements from this iterator");
            }
        };
    }
    HashSet set = new HashSet();
    StringTokenizer tokens = new StringTokenizer(list, ",");
    while (tokens.hasMoreTokens()) {
        set.add(tokens.nextToken().trim());
    }
    return set.iterator();
}

33. InterpolatingEntitySystemTest#setUp()

Project: mini2Dx
File: InterpolatingEntitySystemTest.java
@Before
public void setUp() {
    expectedDelta = 0f;
    expectedAlpha = 0f;
    updatedIds = new HashSet<Integer>();
    interpolatedIds = new HashSet<Integer>();
    system = new InterpolatingEntitySystemTest();
    WorldConfiguration configuration = new WorldConfiguration();
    configuration.setSystem(system);
    world = new MdxWorld(configuration);
}

34. InstallMojo#execute()

Project: maven-plugins
File: InstallMojo.java
/**
     * Performs this mojo's tasks.
     *
     * @throws MojoExecutionException If the artifacts could not be installed.
     */
public void execute() throws MojoExecutionException {
    if (skipInstallation) {
        getLog().info("Skipping artifact installation per configuration.");
        return;
    }
    createTestRepository();
    installedArtifacts = new HashSet<String>();
    copiedArtifacts = new HashSet<String>();
    installProjectDependencies(project, reactorProjects);
    installProjectParents(project);
    installProjectArtifacts(project);
    installExtraArtifacts(extraArtifacts);
}

35. AbstractFilter#initLoginParameters()

Project: linkbinder
File: AbstractFilter.java
private void initLoginParameters(ServletContext context) {
    String redirect = context.getInitParameter(PARAM_REDIRECT_PAGE);
    if (StringUtils.isNotEmpty(redirect)) {
        redirectPage = redirect;
    }
    ignorePages = new HashSet<String>();
    String pages = context.getInitParameter(PARAM_IGNORE_PAGES);
    if (StringUtils.isNotEmpty(pages)) {
        for (String page : pages.split("\\s+")) {
            ignorePages.add(page);
        }
    }
    directLoginPages = new HashSet<String>();
    pages = context.getInitParameter(PARAM_DIRECTLOGIN_PAGES);
    if (StringUtils.isNotEmpty(pages)) {
        for (String page : pages.split("\\s+")) {
            directLoginPages.add(page);
        }
    }
}

36. ChangeUtils#merge()

Project: kontraktor
File: ChangeUtils.java
public static String[] merge(String fieldsA[], String fieldsB[]) {
    HashSet set = new HashSet();
    for (int i = 0; i < fieldsA.length; i++) {
        set.add(fieldsA[i]);
    }
    for (int i = 0; i < fieldsB.length; i++) {
        set.add(fieldsB[i]);
    }
    String res[] = new String[set.size()];
    set.toArray(res);
    return res;
}

37. MidiFragmentHostActivity#onCreate()

Project: USB-MIDI-Driver
File: MidiFragmentHostActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    midiInputDevices = new HashSet<MidiInputDevice>();
    midiOutputDevices = new HashSet<MidiOutputDevice>();
    UsbManager usbManager = (UsbManager) getApplicationContext().getSystemService(Context.USB_SERVICE);
    deviceAttachedListener = new OnMidiDeviceAttachedListenerImpl();
    deviceDetachedListener = new OnMidiDeviceDetachedListenerImpl();
    deviceConnectionWatcher = new MidiDeviceConnectionWatcher(getApplicationContext(), usbManager, deviceAttachedListener, deviceDetachedListener);
}

38. AbstractMultipleMidiActivity#onCreate()

Project: USB-MIDI-Driver
File: AbstractMultipleMidiActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    midiInputDevices = new HashSet<MidiInputDevice>();
    midiOutputDevices = new HashSet<MidiOutputDevice>();
    UsbManager usbManager = (UsbManager) getApplicationContext().getSystemService(Context.USB_SERVICE);
    deviceAttachedListener = new OnMidiDeviceAttachedListenerImpl();
    deviceDetachedListener = new OnMidiDeviceDetachedListenerImpl();
    deviceConnectionWatcher = new MidiDeviceConnectionWatcher(getApplicationContext(), usbManager, deviceAttachedListener, deviceDetachedListener);
}

39. SensorCtsHelperTest#testGet95PercentileValue()

Project: CtsVerifier
File: SensorCtsHelperTest.java
/**
     * Test {@link SensorCtsHelper#get95PercentileValue(Collection)}.
     */
public void testGet95PercentileValue() {
    Collection<Integer> values = new HashSet<Integer>();
    for (int i = 0; i < 100; i++) {
        values.add(i);
    }
    assertEquals(95, (int) SensorCtsHelper.get95PercentileValue(values));
    values = new HashSet<Integer>();
    for (int i = 0; i < 1000; i++) {
        values.add(i);
    }
    assertEquals(950, (int) SensorCtsHelper.get95PercentileValue(values));
    values = new HashSet<Integer>();
    for (int i = 0; i < 100; i++) {
        values.add(i * i);
    }
    assertEquals(95 * 95, (int) SensorCtsHelper.get95PercentileValue(values));
}

40. Prior#main()

Project: CoreNLP
File: Prior.java
public static void main(String args[]) throws Exception {
    BufferedReader br = new BufferedReader(new FileReader("/tmp/acstats"));
    Prior p = new Prior(br);
    HashSet hs = new HashSet();
    hs.add("workshopname");
    //hs.add("workshopacronym");
    double d = p.get(hs);
    System.out.println("d is " + d);
}

41. MLAnaysisModeExpansionTest#testExactLangWC()

Project: community-edition
File: MLAnaysisModeExpansionTest.java
public void testExactLangWC() {
    HashSet<Locale> locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_AND_ALL_CONTAINED_LOCALES, new Locale("en", "GB", ""), true));
    assertEquals(2, locales.size());
    assertTrue(locales.contains(new Locale("en", "GB", "")));
    assertTrue(locales.contains(new Locale("en", "GB", "*")));
    locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.EXACT_LANGUAGE, new Locale("en", "GB", ""), true));
    assertEquals(1, locales.size());
    assertTrue(locales.contains(new Locale("en", "", "")));
    locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.EXACT_LANGUAGE_AND_ALL, new Locale("en", "GB", ""), true));
    assertEquals(3, locales.size());
    assertTrue(locales.contains(new Locale("", "", "")));
    assertTrue(locales.contains(new Locale("*", "", "")));
    assertTrue(locales.contains(new Locale("en", "", "")));
}

42. MLAnaysisModeExpansionTest#testLangWC()

Project: community-edition
File: MLAnaysisModeExpansionTest.java
public void testLangWC() {
    HashSet<Locale> locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_AND_ALL_CONTAINED_LOCALES, new Locale("en", "GB", ""), true));
    assertEquals(2, locales.size());
    assertTrue(locales.contains(new Locale("en", "GB", "")));
    assertTrue(locales.contains(new Locale("en", "GB", "*")));
    locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.ALL_LANGUAGES, new Locale("en", "GB", ""), true));
    assertEquals(2, locales.size());
    assertTrue(locales.contains(new Locale("en", "", "")));
    assertTrue(locales.contains(new Locale("en", "*", "")));
    locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.ALL_LANGUAGES_AND_ALL, new Locale("en", "GB", ""), true));
    assertEquals(4, locales.size());
    assertTrue(locales.contains(new Locale("", "", "")));
    assertTrue(locales.contains(new Locale("*", "", "")));
    assertTrue(locales.contains(new Locale("en", "", "")));
    assertTrue(locales.contains(new Locale("en", "*", "")));
}

43. MLAnaysisModeExpansionTest#testExactLang()

Project: community-edition
File: MLAnaysisModeExpansionTest.java
public void testExactLang() {
    HashSet<Locale> locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_AND_ALL_CONTAINED_LOCALES, new Locale("en", "GB", ""), false));
    assertTrue(locales.size() >= 1);
    assertTrue(locales.contains(new Locale("en", "GB", "")));
    locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.EXACT_LANGUAGE, new Locale("en", "GB", ""), false));
    assertEquals(1, locales.size());
    assertTrue(locales.contains(new Locale("en", "", "")));
    locales = new HashSet<Locale>();
    locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.EXACT_LANGUAGE_AND_ALL, new Locale("en", "GB", ""), false));
    assertEquals(2, locales.size());
    assertTrue(locales.contains(new Locale("", "", "")));
    assertTrue(locales.contains(new Locale("en", "", "")));
}

44. SetUtilsTest#setUp()

Project: commons-collections
File: SetUtilsTest.java
@Before
public void setUp() {
    setA = new HashSet<Integer>();
    setA.add(1);
    setA.add(2);
    setA.add(3);
    setA.add(4);
    setA.add(5);
    setB = new HashSet<Integer>();
    setB.add(3);
    setB.add(4);
    setB.add(5);
    setB.add(6);
    setB.add(7);
}

45. JsDocInfoParserTest#setUp()

Project: closure-compiler
File: JsDocInfoParserTest.java
@Override
public void setUp() throws Exception {
    super.setUp();
    fileLevelJsDocBuilder = null;
    extraAnnotations = new HashSet<>(ParserRunner.createConfig(LanguageMode.ECMASCRIPT3, null).annotationNames.keySet());
    extraSuppressions = new HashSet<>(ParserRunner.createConfig(LanguageMode.ECMASCRIPT3, null).suppressionNames);
    extraSuppressions.add("x");
    extraSuppressions.add("y");
    extraSuppressions.add("z");
}

46. JavaModelManager#containerRemoveInitializationInProgress()

Project: che
File: JavaModelManager.java
private void containerRemoveInitializationInProgress(IJavaProject project, IPath containerPath) {
    Map initializations = (Map) this.containerInitializationInProgress.get();
    if (initializations == null)
        return;
    HashSet projectInitializations = (HashSet) initializations.get(project);
    if (projectInitializations == null)
        return;
    projectInitializations.remove(containerPath);
    if (projectInitializations.size() == 0)
        initializations.remove(project);
    if (initializations.size() == 0)
        this.containerInitializationInProgress.set(null);
}

47. TestUtils#getTestAttributes()

Project: cas
File: TestUtils.java
public static Map<String, Set<String>> getTestAttributes() {
    final Map<String, Set<String>> attributes = new HashMap<>();
    Set<String> attributeValues = new HashSet<>();
    attributeValues.add("uid");
    attributes.put("uid", attributeValues);
    attributeValues = new HashSet<>();
    attributeValues.add("CASUser");
    attributes.put("givenName", attributeValues);
    attributeValues = new HashSet<>();
    attributeValues.add("admin");
    attributeValues.add("system");
    attributeValues.add("cas");
    attributes.put("memberOf", attributeValues);
    return attributes;
}

48. LevelDBFullPrunedBlockStore#beginDatabaseBatchWrite()

Project: bitcoinj
File: LevelDBFullPrunedBlockStore.java
@Override
public void beginDatabaseBatchWrite() throws BlockStoreException {
    // We just ignore the second call.
    if (!autoCommit) {
        return;
    }
    if (instrument)
        beginMethod("beginDatabaseBatchWrite");
    batch = db.createWriteBatch();
    uncommited = new HashMap<ByteBuffer, byte[]>();
    uncommitedDeletes = new HashSet<ByteBuffer>();
    utxoUncommittedCache = new HashMap<ByteBuffer, UTXO>();
    utxoUncommittedDeletedCache = new HashSet<ByteBuffer>();
    autoCommit = false;
    if (instrument)
        endMethod("beginDatabaseBatchWrite");
}

49. ParInterfaceDecl#unimplementedMethods_compute()

Project: JAADAS
File: ParInterfaceDecl.java
/**
   * @apilevel internal
   */
private Collection unimplementedMethods_compute() {
    HashSet set = new HashSet();
    HashSet result = new HashSet();
    for (Iterator iter = genericDecl().unimplementedMethods().iterator(); iter.hasNext(); ) {
        MethodDecl m = (MethodDecl) iter.next();
        set.add(m.sourceMethodDecl());
    }
    for (Iterator iter = super.unimplementedMethods().iterator(); iter.hasNext(); ) {
        MethodDecl m = (MethodDecl) iter.next();
        if (set.contains(m.sourceMethodDecl()))
            result.add(m);
    }
    return result;
}

50. ParClassDecl#unimplementedMethods_compute()

Project: JAADAS
File: ParClassDecl.java
/**
   * @apilevel internal
   */
private Collection unimplementedMethods_compute() {
    HashSet set = new HashSet();
    HashSet result = new HashSet();
    for (Iterator iter = genericDecl().unimplementedMethods().iterator(); iter.hasNext(); ) {
        MethodDecl m = (MethodDecl) iter.next();
        set.add(m.sourceMethodDecl());
    }
    for (Iterator iter = super.unimplementedMethods().iterator(); iter.hasNext(); ) {
        MethodDecl m = (MethodDecl) iter.next();
        if (set.contains(m.sourceMethodDecl()))
            result.add(m);
    }
    return result;
}

51. LUBType#MEC()

Project: JAADAS
File: LUBType.java
/**
     * The minimal erased candidate set for Tj
     * is MEC = {V | V in EC, forall  W != V in EC, not W <: V}
     * @return minimal erased candidate set for Tj
     * @ast method 
   * @aspect GenericMethodsInference
   * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethodsInference.jrag:690
   */
public static HashSet MEC(ArrayList list) {
    HashSet EC = LUBType.EC(list);
    if (EC.size() == 1)
        return EC;
    HashSet MEC = new HashSet();
    for (Iterator iter = EC.iterator(); iter.hasNext(); ) {
        TypeDecl V = (TypeDecl) iter.next();
        boolean keep = true;
        for (Iterator i2 = EC.iterator(); i2.hasNext(); ) {
            TypeDecl W = (TypeDecl) i2.next();
            if (!(V instanceof TypeVariable) && V != W && W.instanceOf(V))
                keep = false;
        }
        if (keep)
            MEC.add(V);
    }
    return MEC;
}

52. GLBTypeFactory#mostSpecificSuperClass()

Project: JAADAS
File: GLBTypeFactory.java
/**
         * Return most specific superclass of t.
         * 
         * @param t
         * @return most specific superclass of t
         */
private static final TypeDecl mostSpecificSuperClass(final TypeDecl t) {
    HashSet superTypes = new HashSet();
    addSuperClasses(t, superTypes);
    if (superTypes.isEmpty())
        return t.typeObject();
    ArrayList result = new ArrayList(superTypes.size());
    result.addAll(superTypes);
    greatestLowerBounds(result);
    if (result.size() == 1)
        return (TypeDecl) result.get(0);
    else
        return (TypeDecl) t.typeObject();
}

53. HashSetTest#test_iterator()

Project: j2objc
File: HashSetTest.java
/**
	 * @tests java.util.HashSet#iterator()
	 */
public void test_iterator() {
    // Test for method java.util.Iterator java.util.HashSet.iterator()
    Iterator i = hs.iterator();
    int x = 0;
    while (i.hasNext()) {
        assertTrue("Failed to iterate over all elements", hs.contains(i.next()));
        ++x;
    }
    assertTrue("Returned iteration of incorrect size", hs.size() == x);
    HashSet s = new HashSet();
    s.add(null);
    assertNull("Cannot handle null", s.iterator().next());
}

54. CollectionsTest#setUp()

Project: j2objc
File: CollectionsTest.java
/**
     * Sets up the fixture, for example, open a network connection. This method
     * is called before a test is executed.
     */
protected void setUp() {
    ll = new LinkedList();
    myll = new LinkedList();
    s = new HashSet();
    mys = new HashSet();
    // to be sorted in reverse order
    reversedLinkedList = new LinkedList();
    // to be sorted in reverse
    myReversedLinkedList = new LinkedList();
    // order
    hm = new HashMap();
    for (int i = 0; i < objArray.length; i++) {
        ll.add(objArray[i]);
        myll.add(myobjArray[i]);
        s.add(objArray[i]);
        mys.add(myobjArray[i]);
        reversedLinkedList.add(objArray[objArray.length - i - 1]);
        myReversedLinkedList.add(myobjArray[myobjArray.length - i - 1]);
        hm.put(objArray[i].toString(), objArray[i]);
    }
}

55. LaunchModeTests#testResetRunPerspectiveJavaLaunchDelegate()

Project: grails-ide
File: LaunchModeTests.java
/**
	 * Tests that the default debug perspective can be over-ridden and reset
	 * Same notion as <code>testResetRunLaunchPerspective2()</code>, but using the 
	 * JDT Java launch delegate instead of <code>null</code>
	 * 
	 * @since 3.3
	 */
public void testResetRunPerspectiveJavaLaunchDelegate() {
    ILaunchConfigurationType javaType = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
    HashSet modes = new HashSet();
    modes.add(ILaunchManager.RUN_MODE);
    //$NON-NLS-1$
    ILaunchDelegate delegate = ((LaunchManager) getLaunchManager()).getLaunchDelegate("org.eclipse.jdt.launching.localJavaApplication");
    //$NON-NLS-1$
    assertNotNull("Java launch delegate should not be null", delegate);
    //$NON-NLS-1$
    assertNull("Java run perspective should be null", DebugUITools.getLaunchPerspective(javaType, delegate, modes));
    // set to NONE
    DebugUITools.setLaunchPerspective(javaType, null, modes, IDebugUIConstants.PERSPECTIVE_NONE);
    //$NON-NLS-1$
    assertNull("Java run perspective should now be null", DebugUITools.getLaunchPerspective(javaType, delegate, modes));
    // re-set to default
    DebugUITools.setLaunchPerspective(javaType, null, modes, IDebugUIConstants.PERSPECTIVE_DEFAULT);
    //$NON-NLS-1$
    assertNull("Java run perspective should now be null", DebugUITools.getLaunchPerspective(javaType, delegate, modes));
}

56. LaunchModeTests#testResetRunLaunchPerspective2()

Project: grails-ide
File: LaunchModeTests.java
/**
	 * Tests that the default run perspective can be over-ridden and reset.
	 * Same notion as <code>testResetRunLaunchPerspective()</code>, but using the new API
	 * for getting/setting/re-setting perspective settings.
	 * 
	 * @since 3.3
	 */
public void testResetRunLaunchPerspective2() {
    ILaunchConfigurationType javaType = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
    HashSet modes = new HashSet();
    modes.add(ILaunchManager.RUN_MODE);
    //$NON-NLS-1$
    assertNull("Java run perspective should be null", DebugUITools.getLaunchPerspective(javaType, null, modes));
    // set to Java perspective
    DebugUITools.setLaunchPerspective(javaType, null, modes, JavaUI.ID_PERSPECTIVE);
    //$NON-NLS-1$
    assertEquals("Java run perspective should now be java", JavaUI.ID_PERSPECTIVE, DebugUITools.getLaunchPerspective(javaType, null, modes));
    // re-set to default
    DebugUITools.setLaunchPerspective(javaType, ILaunchManager.RUN_MODE, IDebugUIConstants.PERSPECTIVE_DEFAULT);
    //$NON-NLS-1$
    assertNull("Java run perspective should now be null", DebugUITools.getLaunchPerspective(javaType, null, modes));
}

57. LaunchModeTests#testResetDebugPerspectiveJavaLaunchDelegate()

Project: grails-ide
File: LaunchModeTests.java
/**
	 * Tests that the default debug perspective can be over-ridden and reset
	 * Same notion as <code>testResetDebugLaunchPerspective2()</code>, but using the 
	 * JDT Java launch delegate instead of <code>null</code>
	 * 
	 * @since 3.3
	 */
public void testResetDebugPerspectiveJavaLaunchDelegate() {
    ILaunchConfigurationType javaType = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
    HashSet modes = new HashSet();
    modes.add(ILaunchManager.DEBUG_MODE);
    //$NON-NLS-1$
    ILaunchDelegate delegate = ((LaunchManager) getLaunchManager()).getLaunchDelegate("org.eclipse.jdt.launching.localJavaApplication");
    //$NON-NLS-1$
    assertNotNull("Java launch delegate should not be null", delegate);
    //$NON-NLS-1$
    assertEquals("Java debug perspective should be debug", IDebugUIConstants.ID_DEBUG_PERSPECTIVE, DebugUITools.getLaunchPerspective(javaType, delegate, modes));
    // set to NONE
    DebugUITools.setLaunchPerspective(javaType, null, modes, IDebugUIConstants.PERSPECTIVE_NONE);
    //$NON-NLS-1$
    assertNull("Java debug perspective should now be null", DebugUITools.getLaunchPerspective(javaType, delegate, modes));
    // re-set to default
    DebugUITools.setLaunchPerspective(javaType, null, modes, IDebugUIConstants.PERSPECTIVE_DEFAULT);
    //$NON-NLS-1$
    assertEquals("Java debug perspective should now be debug", IDebugUIConstants.ID_DEBUG_PERSPECTIVE, DebugUITools.getLaunchPerspective(javaType, delegate, modes));
}

58. LaunchModeTests#testResetDebugLaunchPerspective2()

Project: grails-ide
File: LaunchModeTests.java
/**
	 * Tests that the default debug perspective can be over-ridden and reset.
	 * Same notion as <code>testResetDebugLaunchPerspective()</code>, but using the new API
	 * for setting an resetting perspectives.
	 * 
	 * @since 3.3
	 */
public void testResetDebugLaunchPerspective2() {
    ILaunchConfigurationType javaType = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
    HashSet modes = new HashSet();
    modes.add(ILaunchManager.DEBUG_MODE);
    //$NON-NLS-1$
    assertEquals("Java debug perspective should be debug", IDebugUIConstants.ID_DEBUG_PERSPECTIVE, DebugUITools.getLaunchPerspective(javaType, null, modes));
    // set to NONE
    DebugUITools.setLaunchPerspective(javaType, null, modes, IDebugUIConstants.PERSPECTIVE_NONE);
    //$NON-NLS-1$
    assertNull("Java debug perspective should now be null", DebugUITools.getLaunchPerspective(javaType, null, modes));
    // re-set to default
    DebugUITools.setLaunchPerspective(javaType, null, modes, IDebugUIConstants.PERSPECTIVE_DEFAULT);
    //$NON-NLS-1$
    assertEquals("Java debug perspective should now be debug", IDebugUIConstants.ID_DEBUG_PERSPECTIVE, DebugUITools.getLaunchPerspective(javaType, null, modes));
}

59. SolrSearchGenerator#preparePost()

Project: forrest
File: SolrSearchGenerator.java
private PostMethod preparePost() {
    PostMethod filePost = new PostMethod(destination);
    filePost.addRequestHeader("User-Agent", AGENT);
    Iterator keys = map.keySet().iterator();
    HashSet set = new HashSet();
    while (keys.hasNext()) {
        String element = (String) keys.next();
        if (!QUERY_PARAM.equals(element)) {
            String value = (String) map.get(element);
            set.add(new NameValuePair(element, value));
        }
    }
    //make sure we send the query (even if null) to get a response
    set.add(new NameValuePair(QUERY_PARAM, query));
    for (Iterator iter = set.iterator(); iter.hasNext(); ) {
        filePost.addParameter((NameValuePair) iter.next());
    }
    return filePost;
}

60. ClusterStatsNodes#readFrom()

Project: elassandra
File: ClusterStatsNodes.java
@Override
public void readFrom(StreamInput in) throws IOException {
    counts = Counts.readCounts(in);
    int size = in.readVInt();
    versions = new HashSet<>(size);
    for (; size > 0; size--) {
        versions.add(Version.readVersion(in));
    }
    os = OsStats.readOsStats(in);
    process = ProcessStats.readStats(in);
    jvm = JvmStats.readJvmStats(in);
    fs = FsInfo.Path.readInfoFrom(in);
    size = in.readVInt();
    plugins = new HashSet<>(size);
    for (; size > 0; size--) {
        plugins.add(PluginInfo.readFromStream(in));
    }
}

61. BaseActivity#initFields()

Project: q-municate-android
File: BaseActivity.java
private void initFields() {
    app = App.getInstance();
    appSharedHelper = App.getInstance().getAppSharedHelper();
    activityUIHelper = new ActivityUIHelper(this);
    failAction = new FailAction();
    successAction = new SuccessAction();
    broadcastReceiver = new BaseBroadcastReceiver();
    globalBroadcastReceiver = new GlobalBroadcastReceiver();
    userStatusBroadcastReceiver = new UserStatusBroadcastReceiver();
    networkBroadcastReceiver = new NetworkBroadcastReceiver();
    broadcastCommandMap = new HashMap<>();
    fragmentsStatusChangingSet = new HashSet<>();
    fragmentsServiceConnectionSet = new HashSet<>();
    serviceConnection = new QBChatServiceConnection();
    localBroadcastManager = LocalBroadcastManager.getInstance(this);
}

62. FakeBackupFileSystem#setupTest()

Project: Priam
File: FakeBackupFileSystem.java
public void setupTest(List<String> files) {
    clearTest();
    flist = new ArrayList<AbstractBackupPath>();
    for (String file : files) {
        S3BackupPath path = pathProvider.get();
        path.parseRemote(file);
        flist.add(path);
    }
    downloadedFiles = new HashSet<String>();
    uploadedFiles = new HashSet<String>();
}

63. ExportDisplayAction#init()

Project: Prefuse
File: ExportDisplayAction.java
private void init() {
    scaler = new ScaleSelector();
    chooser = new JFileChooser();
    chooser.setDialogType(JFileChooser.SAVE_DIALOG);
    chooser.setDialogTitle("Export Prefuse Display...");
    chooser.setAcceptAllFileFilterUsed(false);
    HashSet seen = new HashSet();
    String[] fmts = ImageIO.getWriterFormatNames();
    for (int i = 0; i < fmts.length; i++) {
        String s = fmts[i].toLowerCase();
        if (s.length() == 3 && !seen.contains(s)) {
            seen.add(s);
            chooser.setFileFilter(new SimpleFileFilter(s, s.toUpperCase() + " Image (*." + s + ")"));
        }
    }
    seen.clear();
    seen = null;
    chooser.setAccessory(scaler);
}

64. LockableHashtable#getAllKeys()

Project: axis1-java
File: LockableHashtable.java
/**
     * Returns the keys in this hashtable, and its parent chain
     */
public Set getAllKeys() {
    HashSet set = new HashSet();
    set.addAll(super.keySet());
    Hashtable p = parent;
    while (p != null) {
        set.addAll(p.keySet());
        if (p instanceof LockableHashtable) {
            p = ((LockableHashtable) p).getParent();
        } else {
            p = null;
        }
    }
    return set;
}

65. CreditRecordStore#init()

Project: aries
File: CreditRecordStore.java
void init(Set<CreditRecord> records) {
    personidindex = new HashSet<String>();
    personrecords = new HashSet<PersonCreditRecords>();
    for (CreditRecord arecord : records) {
        personidindex.add(arecord.getPersonid());
    }
    for (String personid : personidindex) {
        personrecords.add(new PersonCreditRecords(personid));
    }
    for (CreditRecord arecord : records) {
        PersonCreditRecords target = getAPersonRecords(arecord.getPersonid());
        if (target != null) {
            target.add(arecord);
        }
    }
}

66. CreditRecordStore#init()

Project: apache-aries
File: CreditRecordStore.java
void init(Set<CreditRecord> records) {
    personidindex = new HashSet<String>();
    personrecords = new HashSet<PersonCreditRecords>();
    for (CreditRecord arecord : records) {
        personidindex.add(arecord.getPersonid());
    }
    for (String personid : personidindex) {
        personrecords.add(new PersonCreditRecords(personid));
    }
    for (CreditRecord arecord : records) {
        PersonCreditRecords target = getAPersonRecords(arecord.getPersonid());
        if (target != null) {
            target.add(arecord);
        }
    }
}

67. Extensions#makeOidsLists()

Project: android-vts
File: Extensions.java
//
// Makes the separated lists with oids of critical
// and non-critical extensions
//
private void makeOidsLists() {
    if (extensions == null) {
        return;
    }
    int size = extensions.size();
    critical = new HashSet<String>(size);
    noncritical = new HashSet<String>(size);
    for (Extension extension : extensions) {
        String oid = extension.getExtnID();
        if (extension.getCritical()) {
            if (!SUPPORTED_CRITICAL.contains(oid)) {
                hasUnsupported = true;
            }
            critical.add(oid);
        } else {
            noncritical.add(oid);
        }
    }
}

68. SetOpsTest#setUp()

Project: aima-java
File: SetOpsTest.java
@Before
public void setUp() {
    s1 = new HashSet<Integer>();
    s1.add(new Integer(1));
    s1.add(new Integer(2));
    s1.add(new Integer(3));
    s1.add(new Integer(4));
    s2 = new HashSet<Integer>();
    s2.add(new Integer(4));
    s2.add(new Integer(5));
    s2.add(new Integer(6));
}

69. BookImportStorage#parse()

Project: actor-platform
File: BookImportStorage.java
@Override
public void parse(BserValues values) throws IOException {
    importedEmails = new HashSet<>();
    importedPhones = new HashSet<>();
    for (String s : values.getRepeatedString(1)) {
        importedEmails.add(s);
    }
    for (Long p : values.getRepeatedLong(2)) {
        importedPhones.add(p);
    }
}

70. DispatcherMaxAgeHeaderFilterTest#setup()

Project: acs-aem-commons
File: DispatcherMaxAgeHeaderFilterTest.java
@Before
public void setup() throws Exception {
    properties = new Hashtable<String, Object>();
    properties.put(DispatcherMaxAgeHeaderFilter.PROP_MAX_AGE, maxage);
    agents = new HashSet<String>();
    cachecontrol = new HashSet<String>();
    params = new HashMap();
    filter = new DispatcherMaxAgeHeaderFilter();
    when(request.getMethod()).thenReturn("GET");
    when(request.getParameterMap()).thenReturn(params);
    agents.add(AbstractDispatcherCacheHeaderFilter.DISPATCHER_AGENT_HEADER_VALUE);
    when(request.getHeaders(AbstractDispatcherCacheHeaderFilter.SERVER_AGENT_NAME)).thenReturn(Collections.enumeration(agents));
}

71. AbstractExpiresHeaderFilterTest#setup()

Project: acs-aem-commons
File: AbstractExpiresHeaderFilterTest.java
@Before
public void setup() throws Exception {
    properties = new Hashtable<String, Object>();
    properties.put(AbstractExpiresHeaderFilter.PROP_EXPIRES_TIME, exipres);
    agents = new HashSet<String>();
    expires = new HashSet<String>();
    params = new HashMap();
    filter = new AbstractExpiresHeaderFilter() {

        @Override
        protected void adjustExpires(Calendar nextExpiration) {
        // Do nothing.
        }
    };
    when(request.getMethod()).thenReturn("GET");
    when(request.getParameterMap()).thenReturn(params);
    agents.add(AbstractDispatcherCacheHeaderFilter.DISPATCHER_AGENT_HEADER_VALUE);
    when(request.getHeaders(AbstractDispatcherCacheHeaderFilter.SERVER_AGENT_NAME)).thenReturn(Collections.enumeration(agents));
}

72. TemplateContentOutlinePage#updateContent()

Project: aws-toolkit-eclipse
File: TemplateContentOutlinePage.java
private void updateContent() {
    TreeViewer viewer = getTreeViewer();
    if (document.getModel() == null)
        return;
    expandedPaths = new HashSet<String>();
    for (Object obj : viewer.getExpandedElements()) {
        TemplateOutlineNode expandedNode = (TemplateOutlineNode) obj;
        expandedPaths.add(expandedNode.getNode().getPath());
    }
    viewer.setInput(new TemplateOutlineNode("ROOT", document.getModel()));
    for (TreeItem treeItem : viewer.getTree().getItems()) {
        expandTreeItems(treeItem, expandedPaths);
    }
}

73. AppHelper#init()

Project: aws-sdk-android-samples
File: AppHelper.java
public static void init(Context context) {
    setData();
    if (appHelper != null && userPool != null) {
        return;
    }
    if (appHelper == null) {
        appHelper = new AppHelper();
    }
    if (userPool == null) {
        userPool = new CognitoUserPool(context, userPoolId, clientId, clientSecret, new ClientConfiguration());
    }
    phoneVerified = false;
    phoneAvailable = false;
    emailVerified = false;
    emailAvailable = false;
    currUserAttributes = new HashSet<String>();
    currDisplayedItems = new ArrayList<ItemToDisplay>();
}

74. StatefulBoltExecutorTest#setUp()

Project: apache-storm-test
File: StatefulBoltExecutorTest.java
@Before
public void setUp() throws Exception {
    mockBolt = Mockito.mock(IStatefulBolt.class);
    executor = new StatefulBoltExecutor<>(mockBolt);
    GlobalStreamId mockGlobalStreamId = Mockito.mock(GlobalStreamId.class);
    Mockito.when(mockGlobalStreamId.get_streamId()).thenReturn(CheckpointSpout.CHECKPOINT_STREAM_ID);
    mockStreamIds = new HashSet<>();
    mockStreamIds.add(mockGlobalStreamId);
    mockTopologyContext = Mockito.mock(TopologyContext.class);
    mockOutputCollector = Mockito.mock(OutputCollector.class);
    mockGlobalStream = Mockito.mock(Map.class);
    mockState = Mockito.mock(State.class);
    Mockito.when(mockTopologyContext.getThisComponentId()).thenReturn("test");
    Mockito.when(mockTopologyContext.getThisTaskId()).thenReturn(1);
    Mockito.when(mockTopologyContext.getThisSources()).thenReturn(mockGlobalStream);
    Mockito.when(mockTopologyContext.getComponentTasks(Mockito.anyString())).thenReturn(Collections.singletonList(1));
    Mockito.when(mockGlobalStream.keySet()).thenReturn(mockStreamIds);
    mockTuple = Mockito.mock(Tuple.class);
    mockCheckpointTuple = Mockito.mock(Tuple.class);
    executor.prepare(mockStormConf, mockTopologyContext, mockOutputCollector, mockState);
}

75. TvBrowseFragment#onActivityCreated()

Project: android-UniversalMusicPlayer
File: TvBrowseFragment.java
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    LogHelper.d(TAG, "onActivityCreated");
    mSubscribedMediaIds = new HashSet<>();
    // set search icon color
    setSearchAffordanceColor(getResources().getColor(R.color.tv_search_button));
    loadRows();
    setupEventListeners();
}

76. XmlUtils#readThisSetXml()

Project: android-job
File: XmlUtils.java
/**
     * Read a HashSet object from an XmlPullParser. The XML data could previously
     * have been generated by writeSetXml(). The XmlPullParser must be positioned
     * <em>after</em> the tag that begins the set.
     *
     * @param parser The XmlPullParser from which to read the set data.
     * @param endTag Name of the tag that will end the set, usually "set".
     * @param name An array of one string, used to return the name attribute
     *             of the set's tag.
     *
     * @return HashSet The newly generated set.
     *
     * @throws XmlPullParserException
     * @throws java.io.IOException
     *
     * @see #readSetXml
     */
private static final HashSet readThisSetXml(XmlPullParser parser, String endTag, String[] name, ReadMapCallback callback) throws XmlPullParserException, java.io.IOException {
    HashSet set = new HashSet();
    int eventType = parser.getEventType();
    do {
        if (eventType == parser.START_TAG) {
            Object val = readThisValueXml(parser, name, callback);
            set.add(val);
        //System.out.println("Adding to set: " + val);
        } else if (eventType == parser.END_TAG) {
            if (parser.getName().equals(endTag)) {
                return set;
            }
            throw new XmlPullParserException("Expected " + endTag + " end tag at: " + parser.getName());
        }
        eventType = parser.next();
    } while (eventType != parser.END_DOCUMENT);
    throw new XmlPullParserException("Document ended before " + endTag + " end tag");
}

77. XmlUtils#readThisSetXml()

Project: AcDisplay
File: XmlUtils.java
/**
     * Read a HashSet object from an XmlPullParser. The XML data could previously
     * have been generated by writeSetXml(). The XmlPullParser must be positioned
     * <em>after</em> the tag that begins the set.
     *
     * @param parser The XmlPullParser from which to read the set data.
     * @param endTag Name of the tag that will end the set, usually "set".
     * @param name   An array of one string, used to return the name attribute
     *               of the set's tag.
     * @return HashSet The newly generated set.
     * @throws XmlPullParserException
     * @throws java.io.IOException
     * @see #readSetXml
     */
private static HashSet readThisSetXml(XmlPullParser parser, String endTag, String[] name, ReadMapCallback callback) throws XmlPullParserException, java.io.IOException {
    HashSet set = new HashSet();
    int eventType = parser.getEventType();
    do {
        if (eventType == XmlPullParser.START_TAG) {
            Object val = readThisValueXml(parser, name, callback);
            set.add(val);
        //System.out.println("Adding to set: " + val);
        } else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals(endTag)) {
                return set;
            }
            throw new XmlPullParserException("Expected " + endTag + " end tag at: " + parser.getName());
        }
        eventType = parser.next();
    } while (eventType != XmlPullParser.END_DOCUMENT);
    throw new XmlPullParserException("Document ended before " + endTag + " end tag");
}

78. RegularLevel#restoreFromBundle()

Project: Easier-Vanilla-Pixel-Dungeon
File: RegularLevel.java
@SuppressWarnings("unchecked")
@Override
public void restoreFromBundle(Bundle bundle) {
    super.restoreFromBundle(bundle);
    rooms = new HashSet<>((Collection<Room>) ((Collection<?>) bundle.getCollection("rooms")));
    for (Room r : rooms) {
        if (r.type == Type.WEAK_FLOOR) {
            weakFloorCreated = true;
            break;
        }
    }
}

79. RegularLevel#initRooms()

Project: Easier-Vanilla-Pixel-Dungeon
File: RegularLevel.java
protected boolean initRooms() {
    rooms = new HashSet<Room>();
    split(new Rect(0, 0, WIDTH - 1, HEIGHT - 1));
    if (rooms.size() < 8) {
        return false;
    }
    Room[] ra = rooms.toArray(new Room[0]);
    for (int i = 0; i < ra.length - 1; i++) {
        for (int j = i + 1; j < ra.length; j++) {
            ra[i].addNeigbour(ra[j]);
        }
    }
    return true;
}

80. UtilsTest#setUp()

Project: druid
File: UtilsTest.java
@Before
public void setUp() throws IOException {
    jobConfig = new Configuration();
    mockJobContext = EasyMock.createMock(JobContext.class);
    EasyMock.expect(mockJobContext.getConfiguration()).andReturn(jobConfig).anyTimes();
    EasyMock.replay(mockJobContext);
    setOfKeys = new HashSet();
    setOfKeys.addAll(new ArrayList<>(Arrays.asList("key1", "key2", "key3")));
    expectedMap = (Map<String, Object>) Maps.asMap(setOfKeys, new CreateValueFromKey());
    tmpFile = tmpFolder.newFile(TMP_FILE_NAME);
    tmpPath = new Path(tmpFile.getAbsolutePath());
    defaultFileSystem = tmpPath.getFileSystem(jobConfig);
}

81. AbstractBTreePartition#initInstance()

Project: directory-server
File: AbstractBTreePartition.java
/**
     * Intializes the instance.
     */
private void initInstance() {
    indexedAttributes = new HashSet<Index<?, String>>();
    // Initialize Attribute types used all over this method
    objectClassAT = schemaManager.getAttributeType(SchemaConstants.OBJECT_CLASS_AT);
    aliasedObjectNameAT = schemaManager.getAttributeType(SchemaConstants.ALIASED_OBJECT_NAME_AT);
    entryCsnAT = schemaManager.getAttributeType(SchemaConstants.ENTRY_CSN_AT);
    entryDnAT = schemaManager.getAttributeType(SchemaConstants.ENTRY_DN_AT);
    entryUuidAT = schemaManager.getAttributeType(SchemaConstants.ENTRY_UUID_AT);
    administrativeRoleAT = schemaManager.getAttributeType(SchemaConstants.ADMINISTRATIVE_ROLE_AT);
    contextCsnAT = schemaManager.getAttributeType(SchemaConstants.CONTEXT_CSN_AT);
}

82. KerberosConfig#prepareEncryptionTypes()

Project: directory-server
File: KerberosConfig.java
/**
     * Construct an HashSet containing the default encryption types
     */
private void prepareEncryptionTypes() {
    String[] encryptionTypeStrings = KerberosConfig.DEFAULT_ENCRYPTION_TYPES;
    encryptionTypes = new HashSet<EncryptionType>();
    for (String enc : encryptionTypeStrings) {
        for (EncryptionType type : EncryptionType.getEncryptionTypes()) {
            if (type.getName().equalsIgnoreCase(enc)) {
                encryptionTypes.add(type);
            }
        }
    }
    encryptionTypes = KerberosUtils.orderEtypesByStrength(encryptionTypes);
}

83. AvlTreePerfTest#createTree()

Project: directory-server
File: AvlTreePerfTest.java
@Before
public void createTree() {
    tree = new AvlTreeImpl<Integer>(new Comparator<Integer>() {

        public int compare(Integer i1, Integer i2) {
            return i1.compareTo(i2);
        }
    });
    set = new HashSet<Integer>();
    start = end = 0;
}

84. StageRunner#filterNonActiveConfigurationsFromMissing()

Project: datacollector
File: StageRunner.java
private Set<String> filterNonActiveConfigurationsFromMissing(S stage, Map<String, Object> configuration, Set<String> missingConfigs) {
    missingConfigs = new HashSet<>(missingConfigs);
    Iterator<String> it = missingConfigs.iterator();
    while (it.hasNext()) {
        String name = it.next();
        try {
            Field field = stage.getClass().getField(name);
            ConfigDef annotation = field.getAnnotation(ConfigDef.class);
            if (!annotation.required() || !isConfigurationActive(annotation, configuration)) {
                it.remove();
            }
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
    return missingConfigs;
}

85. XSQLBluePrint#getInheritance()

Project: controller
File: XSQLBluePrint.java
public static Set<Class<?>> getInheritance(Class<?> myObjectClass, Class<?> returnType) {
    if (returnType != null && myObjectClass.equals(returnType)) {
        return new HashSet<>();
    }
    Set<Class<?>> result = superClassMap.get(myObjectClass);
    if (result != null) {
        return result;
    }
    result = new HashSet<>();
    superClassMap.put(myObjectClass, result);
    if (returnType != null) {
        if (!returnType.equals(myObjectClass)) {
            Class<?> mySuperClass = myObjectClass.getSuperclass();
            while (mySuperClass != null) {
                result.add(mySuperClass);
                mySuperClass = mySuperClass.getSuperclass();
            }
            result.addAll(collectInterfaces(myObjectClass));
        }
    }
    return result;
}

86. RpcServiceMetadata#retrievedSchemaContext()

Project: controller
File: RpcServiceMetadata.java
private void retrievedSchemaContext(SchemaContext schemaContext) {
    LOG.debug("{}: retrievedSchemaContext", logName());
    QNameModule moduleName = BindingReflections.getQNameModule(rpcInterface);
    Module module = schemaContext.findModuleByNamespaceAndRevision(moduleName.getNamespace(), moduleName.getRevision());
    LOG.debug("{}: Got Module: {}", logName(), module);
    rpcSchemaPaths = new HashSet<>();
    for (RpcDefinition rpcDef : module.getRpcs()) {
        rpcSchemaPaths.add(rpcDef.getPath());
    }
    LOG.debug("{}: Got SchemaPaths: {}", logName(), rpcSchemaPaths);
    // First get the DOMRpcService OSGi service. This will be used to register a listener to be notified
    // when the underlying DOM RPC service is available.
    retrieveService("DOMRpcService", DOMRpcService.class,  service -> retrievedDOMRpcService((DOMRpcService) service));
}

87. BaseToolManager#registerActions()

Project: consulo
File: BaseToolManager.java
void registerActions() {
    unregisterActions();
    // register
    // to prevent exception if 2 or more targets have the same name
    HashSet registeredIds = new HashSet();
    List<T> tools = getTools();
    for (T tool : tools) {
        String actionId = tool.getActionId();
        if (!registeredIds.contains(actionId)) {
            registeredIds.add(actionId);
            myActionManager.registerAction(actionId, createToolAction(tool));
        }
    }
}

88. AbstractMappingMetadataExtracter#setSupportedDateFormats()

Project: community-edition
File: AbstractMappingMetadataExtracter.java
/**
     * Set the date formats, over and above the {@link ISO8601DateFormat ISO8601 format}, that will
     * be supported for string to date conversions.  The supported syntax is described by the
     * <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat Javadocs</a>.
     * 
     * @param supportedDateFormats      a list of supported date formats.
     */
public void setSupportedDateFormats(List<String> supportedDateFormats) {
    supportedDateFormatters = new HashSet<DateTimeFormatter>();
    // Now have a set of them.
    for (String dateFormatStr : supportedDateFormats) {
        try {
            supportedDateFormatters.add(DateTimeFormat.forPattern(dateFormatStr));
        } catch (Throwable e) {
            throw new AlfrescoRuntimeException("Unable to set supported date format: " + dateFormatStr, e);
        }
    }
}

89. SOLRSerializer#init()

Project: community-edition
File: SOLRSerializer.java
public void init() {
    PropertyCheck.mandatory(this, "dictionaryService", dictionaryService);
    PropertyCheck.mandatory(this, "namespaceService", namespaceService);
    NUMBER_TYPES = new HashSet<QName>(4);
    NUMBER_TYPES.add(DataTypeDefinition.DOUBLE);
    NUMBER_TYPES.add(DataTypeDefinition.FLOAT);
    NUMBER_TYPES.add(DataTypeDefinition.INT);
    NUMBER_TYPES.add(DataTypeDefinition.LONG);
    typeConverter = new SOLRTypeConverter(namespaceService);
}

90. AlfrescoMeetingServiceHandlerTest#testRemoveMeeting()

Project: community-edition
File: AlfrescoMeetingServiceHandlerTest.java
@Test
public void testRemoveMeeting() {
    // remove occurrence 09/09/2013
    removeMeeting(20130909);
    // remove updated occurrence 27/09/2013
    updateOccurrence();
    removeMeeting(20130927);
    Set<QName> childNodeTypeQNames = new HashSet<QName>();
    childNodeTypeQNames = new HashSet<QName>();
    childNodeTypeQNames.add(CalendarModel.TYPE_UPDATED_EVENT);
    List<ChildAssociationRef> updatedOccurrencesList = nodeService.getChildAssocs(RECURRENCE.getNodeRef(), childNodeTypeQNames);
    // updated occurrence should be removed
    assertTrue(updatedOccurrencesList.size() == 0);
}

91. EvalContext#constructIterator()

Project: commons-jxpath
File: EvalContext.java
/**
     * Construct an iterator.
     * @return whether the Iterator was constructed
     */
private boolean constructIterator() {
    HashSet set = new HashSet();
    ArrayList list = new ArrayList();
    while (nextSet()) {
        while (nextNode()) {
            NodePointer pointer = getCurrentNodePointer();
            if (!set.contains(pointer)) {
                set.add(pointer);
                list.add(pointer);
            }
        }
    }
    if (list.isEmpty()) {
        return false;
    }
    sortPointers(list);
    pointerIterator = list.iterator();
    return true;
}

92. CoreOperationRelationalExpression#findMatch()

Project: commons-jxpath
File: CoreOperationRelationalExpression.java
/**
     * Learn whether there is an intersection between two Iterators.
     * @param lit left Iterator
     * @param rit right Iterator
     * @return whether a match was found
     */
private boolean findMatch(Iterator lit, Iterator rit) {
    HashSet left = new HashSet();
    while (lit.hasNext()) {
        left.add(lit.next());
    }
    while (rit.hasNext()) {
        if (containsMatch(left.iterator(), rit.next())) {
            return true;
        }
    }
    return false;
}

93. CoreOperationCompare#findMatch()

Project: commons-jxpath
File: CoreOperationCompare.java
/**
     * Learn whether lit intersects rit.
     * @param lit left Iterator
     * @param rit right Iterator
     * @return boolean
     */
protected boolean findMatch(Iterator lit, Iterator rit) {
    HashSet left = new HashSet();
    while (lit.hasNext()) {
        left.add(lit.next());
    }
    while (rit.hasNext()) {
        if (contains(left.iterator(), rit.next())) {
            return true;
        }
    }
    return false;
}

94. DefaultCachedRepository#getInheritableAttributes()

Project: commons-attributes
File: DefaultCachedRepository.java
private static Collection getInheritableAttributes(Collection attrs) {
    HashSet result = new HashSet();
    Iterator iter = attrs.iterator();
    while (iter.hasNext()) {
        Object attr = iter.next();
        if (Attributes.hasAttributeType(attr.getClass(), Inheritable.class)) {
            result.add(attr);
        }
    }
    return result;
}

95. Attributes#getAttributes()

Project: commons-attributes
File: Attributes.java
/**
     * Selects from a collection of attributes only those with a given class.
     *
     * @since 2.1
     */
private static Collection getAttributes(Collection attrs, Class attributeClass) {
    HashSet result = new HashSet();
    Iterator iter = attrs.iterator();
    while (iter.hasNext()) {
        Object attr = iter.next();
        if (attr.getClass() == attributeClass) {
            result.add(attr);
        }
    }
    return Collections.unmodifiableCollection(result);
}

96. NameTranslatorClassVisitor#visit()

Project: CodenameOne
File: NameTranslatorClassVisitor.java
public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) {
    final String newSuperName = translator.getClassMirrorTranslation(superName);
    String newInterfaces[] = new String[interfaces.length];
    for (int i = 0; i < interfaces.length; i++) {
        newInterfaces[i] = translator.getClassMirrorTranslation(interfaces[i]);
    }
    className = name;
    visitedMethods = new HashSet<String>();
    super.visit(version, access, name, translateSignature(signature, false), newSuperName, newInterfaces);
}

97. AbstractConfigurableSourceInspector#configure()

Project: cocoon
File: AbstractConfigurableSourceInspector.java
/**
     * Configure this source inspector to handle properties of required types.
     * <p>
     *  Configuration is in the form of a set of property elements as follows:<br>
     *  <code><property name="owner" namespace="meta"></code>
     * </p>
     */
public void configure(Configuration configuration) throws ConfigurationException {
    final Configuration[] properties = configuration.getChildren("property");
    m_properties = new HashSet(properties.length);
    for (int i = 0; i < properties.length; i++) {
        String namespace = properties[i].getAttribute("namespace");
        String name = properties[i].getAttribute("name");
        if (namespace.indexOf('#') != -1 || name.indexOf('#') != -1) {
            final String message = "Illegal character '#' in definition at " + properties[i].getLocation();
            throw new ConfigurationException(message);
        }
        String property = namespace + "#" + name;
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Handling '" + property + "'");
        }
        m_properties.add(property);
    }
}

98. InlineProperties#buildInvalidatingTypeSet()

Project: closure-compiler
File: InlineProperties.java
// TODO(johnlenz): this is a direct copy of the invalidation code
// from AmbiguateProperties, if in the end we don't need to modify it
// we should move it to a common location.
private void buildInvalidatingTypeSet() {
    TypeIRegistry registry = compiler.getTypeIRegistry();
    invalidatingTypes = new HashSet<>(ImmutableSet.of((JSType) registry.getNativeType(JSTypeNative.ALL_TYPE), (JSType) registry.getNativeType(JSTypeNative.NO_OBJECT_TYPE), (JSType) registry.getNativeType(JSTypeNative.NO_TYPE), (JSType) registry.getNativeType(JSTypeNative.NULL_TYPE), (JSType) registry.getNativeType(JSTypeNative.VOID_TYPE), (JSType) registry.getNativeType(JSTypeNative.FUNCTION_FUNCTION_TYPE), (JSType) registry.getNativeType(JSTypeNative.FUNCTION_INSTANCE_TYPE), (JSType) registry.getNativeType(JSTypeNative.FUNCTION_PROTOTYPE), (JSType) registry.getNativeType(JSTypeNative.GLOBAL_THIS), (JSType) registry.getNativeType(JSTypeNative.OBJECT_TYPE), (JSType) registry.getNativeType(JSTypeNative.OBJECT_PROTOTYPE), (JSType) registry.getNativeType(JSTypeNative.OBJECT_FUNCTION_TYPE), (JSType) registry.getNativeType(JSTypeNative.TOP_LEVEL_PROTOTYPE), (JSType) registry.getNativeType(JSTypeNative.UNKNOWN_TYPE)));
    for (TypeMismatch mis : compiler.getTypeMismatches()) {
        addInvalidatingType(mis.typeA);
        addInvalidatingType(mis.typeB);
    }
}

99. RippleMethodFinder2#createUnionFind()

Project: che
File: RippleMethodFinder2.java
private void createUnionFind() throws JavaModelException {
    fRootTypes = new HashSet<IType>(fTypeToMethod.keySet());
    fUnionFind = new UnionFind();
    for (Iterator<IType> iter = fTypeToMethod.keySet().iterator(); iter.hasNext(); ) {
        IType type = iter.next();
        fUnionFind.init(type);
    }
    for (Iterator<IType> iter = fTypeToMethod.keySet().iterator(); iter.hasNext(); ) {
        IType type = iter.next();
        uniteWithSupertypes(type, type);
    }
    fRootReps = new MultiMap<IType, IType>();
    for (Iterator<IType> iter = fRootTypes.iterator(); iter.hasNext(); ) {
        IType type = iter.next();
        IType rep = fUnionFind.find(type);
        if (rep != null)
            fRootReps.put(rep, type);
    }
    fRootHierarchies = new HashMap<IType, ITypeHierarchy>();
}

100. RefactoringScanner#scan()

Project: che
File: RefactoringScanner.java
public void scan(ICompilationUnit cu) throws JavaModelException {
    char[] chars = cu.getBuffer().getCharacters();
    fMatches = new HashSet<TextMatch>();
    fScanner = ToolFactory.createScanner(true, true, false, true);
    fScanner.setSource(chars);
    //		IImportContainer importContainer= cu.getImportContainer();
    //		if (importContainer.exists())
    //			fNoFlyZone= importContainer.getSourceRange();
    //		else
    //			fNoFlyZone= null;
    doScan();
    fScanner = null;
}