vipcxj / jasync

make async-await code style available in java just like csharp and es6
Apache License 2.0
129 stars 14 forks source link

ContinueException in 【for...continue...】 #6

Closed qw623577789 closed 2 years ago

qw623577789 commented 2 years ago
  @Async(logResultTree = true)
  public JPromise<Void> get() {
      ArrayList<Long> list = new ArrayList<>() {
          {
              add(1l);
              add(2l);
          }
      };

      for (Long l : list) {
          if (true) continue;   // throw io.github.vipcxj.jasync.spec.ContinueException
          JAsync.just().await();
      }

      return JAsync.just();
  }

but the following example is successful

  @Async(logResultTree = true)
  public JPromise<Void> get() {
      ArrayList<Long> list = new ArrayList<>() {
          {
              add(1l);
              add(2l);
          }
      };

      for (Long l : list) {
          JAsync.just().await();
          if (true) continue;
      }

      return JAsync.just();
  }
vipcxj commented 2 years ago

I have just released v0.1.7 that references this issue.

Closing this issue. Please re-open if you think there's still more to do.