Example usage for com.google.gwt.dev.util.collect Sets create

List of usage examples for com.google.gwt.dev.util.collect Sets create

Introduction

In this page you can find the example usage for com.google.gwt.dev.util.collect Sets create.

Prototype

public static <T> Set<T> create() 

Source Link

Usage

From source file:com.googlecode.gwt.test.internal.rewrite.RewriteSingleJsoImplDispatches.java

License:Apache License

private Set<String> computeAllInterfaces(String intfName) {
    Set<String> toReturn = intfNamesToAllInterfaces.get(intfName);
    if (toReturn != null) {
        return toReturn;
    }//  w ww.j  av a2  s  .  com

    toReturn = Sets.create();
    List<JClassType> q = new LinkedList<JClassType>();
    JClassType intf = typeOracle.findType(intfName.replace('/', '.').replace('$', '.'));

    /*
     * If the interface's compilation unit wasn't retained due to an error, then it won't be
     * available in the typeOracle for us to rewrite
     */
    if (intf != null) {
        q.add(intf);
    }

    while (!q.isEmpty()) {
        intf = q.remove(0);
        String resourceName = getResourceName(intf);
        if (!toReturn.contains(resourceName)) {
            toReturn = Sets.add(toReturn, resourceName);
            Collections.addAll(q, intf.getImplementedInterfaces());
        }
    }

    intfNamesToAllInterfaces = Maps.put(intfNamesToAllInterfaces, intfName, toReturn);
    return toReturn;
}