Menu

#1291 BC_IMPOSSIBLE_CAST false positive

3.0.1
closed-fixed
None
5
2014-09-21
2014-07-28
No

There seems to be a problem with multi catch:

  public void test() throws ArrayIndexOutOfBoundsException, UnsupportedOperationException {

  }

  Exception exception = null;

  protected void a() {
    try {
      test();
    }
    catch (ArrayIndexOutOfBoundsException | UnsupportedOperationException ex) {
      exception = ex;
    }
  }

  protected void b(int state) {
    if (exception != null) {
      if (exception instanceof ArrayIndexOutOfBoundsException) { // ok
        return;
      }
      else if (exception instanceof UnsupportedOperationException) { // marked as error
        return;
      }
    }
  }

Discussion

  • Andrey Loskutov

    Andrey Loskutov - 2014-08-18
    • status: open --> open-accepted
     
  • William Pugh

    William Pugh - 2014-09-19

    fixed. Thanks.

     
  • William Pugh

    William Pugh - 2014-09-19
    • status: open-accepted --> closed-fixed
    • assigned_to: William Pugh
     
  • Andrey Loskutov

    Andrey Loskutov - 2014-09-21
    • Group: 3.x --> 3.0.1
     

Log in to post a comment.