예제 #1
0
  private static void logInitialLoadSequence(
      TreeLogger logger, LinkedHashSet<JRunAsync> initialLoadSequence) {
    if (!logger.isLoggable(TreeLogger.TRACE)) {
      return;
    }

    StringBuilder message = new StringBuilder();
    message.append("Initial load sequence of split points: ");
    if (initialLoadSequence.isEmpty()) {
      message.append("(none)");
    } else {
      Collection<Integer> runAsyncIds =
          Collections2.transform(
              initialLoadSequence,
              new Function<JRunAsync, Integer>() {
                @Override
                public Integer apply(JRunAsync runAsync) {
                  return runAsync.getRunAsyncId();
                }
              });
      message.append(Joiner.on(", ").join(runAsyncIds));
    }

    logger.log(TreeLogger.TRACE, message.toString());
  }
예제 #2
0
파일: JProgram.java 프로젝트: imatellan/gwt
 public Collection<JType> getSubclasses(JType type) {
   return Collections2.transform(
       typeOracle.getSubTypeNames(type.getName()),
       new Function<String, JType>() {
         @Override
         public JType apply(String typeName) {
           return getFromTypeMap(typeName);
         }
       });
 }
예제 #3
0
 /**
  * Returns the collection of asyncs as a collection of singleton collections containing one async
  * each.
  */
 static Collection<Collection<JRunAsync>> getListOfLists(Collection<JRunAsync> runAsyncs) {
   return Collections2.transform(
       runAsyncs,
       new Function<JRunAsync, Collection<JRunAsync>>() {
         @Override
         public Collection<JRunAsync> apply(JRunAsync runAsync) {
           return Lists.newArrayList(runAsync);
         }
       });
 }
예제 #4
0
파일: JProgram.java 프로젝트: imatellan/gwt
 public void setInitialAsyncSequence(LinkedHashSet<JRunAsync> initialAsyncSequence) {
   assert this.initialAsyncSequence.isEmpty();
   initialFragmentIdSequence = Lists.newArrayList();
   // TODO(rluble): hack for now the initial fragments correspond to the initial runAsyncIds.
   initialFragmentIdSequence.addAll(
       Collections2.transform(
           initialAsyncSequence,
           new Function<JRunAsync, Integer>() {
             @Override
             public Integer apply(JRunAsync runAsync) {
               return runAsync.getRunAsyncId();
             }
           }));
   this.initialAsyncSequence = initialAsyncSequence;
 }