[BLUEJ-475] Package-private class from other package on object bench causes invocation problems
It's possible for a method call to return an instance of a type that is package-private to another package (by proxy through a public class in the other package). It's then possible to put this instance on the Object Bench. When this is done, interactive method invocations and codepad invocations can fail with an error about accessing a package-private type from another package.
I think we should disallow putting such objects on the object bench.
An alternative would be to put them on the bench 'as' only the interface via which they statically implement, i.e. if the original method call is declared to return 'A' (which is accessible) but returns an instance of 'B' (which implements or extends 'A' but is not accessible) then put the object on the bench as an object of type 'A' and disallow calling methods specific to 'B'. Doing this more closely aligns interactive method call activity with actual code, but it is a fundamental change to the way BlueJ works.
Issue metadata
- Issue type: Bug
- Priority: Low