Example usage for org.eclipse.jdt.internal.core.util HashSetOfArray add

List of usage examples for org.eclipse.jdt.internal.core.util HashSetOfArray add

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.util HashSetOfArray add.

Prototype

public Object add(Object[] array) 

Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.JavaProjectElementInfo.java

License:Open Source License

private void initializePackageNames(IPackageFragmentRoot root, HashSetOfArray fragmentsCache) {
    IJavaElement[] frags = null;//from  w  w  w.ja  v  a2s  .c om
    try {
        if (!root.isOpen()) {
            PackageFragmentRootInfo info = root.isArchive() ? new JarPackageFragmentRootInfo()
                    : new PackageFragmentRootInfo();
            ((PackageFragmentRoot) root).computeChildren(info, ((JavaElement) root).resource());
            frags = info.children;
        } else
            frags = root.getChildren();
    } catch (JavaModelException e) {
        // root doesn't exist: ignore
        return;
    }
    for (int j = 0, length = frags.length; j < length; j++) {
        fragmentsCache.add(((PackageFragment) frags[j]).names);
    }
}