Allow unthrown exceptions to be declared as thrown in jgit methods
commitfa942aab13c2598f26cec7ca692aefc6e6321504
authorShawn O. Pearce <spearce@spearce.org>
Wed, 14 May 2008 03:41:24 +0000 (13 23:41 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 17 May 2008 03:59:48 +0000 (16 23:59 -0400)
tree4dbd6c0069c8f9006ccfa4f7a57fd7fe1e1822af
parent61133091d5f22398828b350ff772165e9945db8a
Allow unthrown exceptions to be declared as thrown in jgit methods

The following is not a compile error:

  class A {
    void parse(RevObject o) throws IOException {
      o.flags |= PARSED;
    }
  }

  class B extends A {
Repository local;

@Override
    void parse(RevObject o) throws IOException {
  super.parse(o);
  final ObjectLoader ldr = local.openObject(o);
}
  }

If we write a method with a default implementation but an overidden
implementation of the same method needs to throw a checked exception,
that checked exception must get declared in the initial declaration
of the method.  This should not be an error.

It may be useful as a warning, to signal that perhaps the throws
declaration is unnecessary, so I am not ignoring it outright.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/.settings/org.eclipse.jdt.core.prefs