DESCRIPTION

Improve error message raised for buggy Adaptable

Bug: 522532
Change-Id: I46174ffaed920903ea8aebe2415d6c0b8fdb205c
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2017-09-20 19:58:41.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2017-09-20 19:58:50.000000000

Patch Set 1:

Build Started https://ci.eclipse.org/egit/job/egit.gerrit/10162/

-------------------------------------
author: Brenden Conley
date: 2017-09-20 20:21:53.000000000

Patch Set 1: Verified+1

Build Successful 

https://ci.eclipse.org/egit/job/egit.gerrit/10162/ : SUCCESS

-------------------------------------
author: Alayna Houston
date: 2017-09-20 22:37:47.000000000

Patch Set 1:

(1 comment)

Line:200, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> I don't think that's an improvement. Consider:

  class Foo implements Adaptable {

    private Bar bar = new Bar();

    Object getAdapter(Class type) {
       return bar;
    }

  }

  Foo foo = new Foo();

  Foobar foobar = Utils.getAdapter(foo, Foobar.class);

This produces the message

  Adaptable of type Foo returned from getAdapter(Foobar.class)
  an object of type Bar, which is not of the
  requested type. Please ask the provider of Foo
  to fix this bug in their code.

Why would you want to add an "is" in there?

We could simplify it to

  Foo.getAdapter(Foobar.class) returned
  an object of type Bar, which is not of the
  requested type. Please ask the provider of Foo
  to fix this bug in their code.

though.

-------------------------------------
