Please file an RFE for this issue so that the core-libs team can evaluate.
While this seems like a good use for default methods, it may be difficult to 
justify including a convenience method
at this late stage in the JDK 9 schedule.

Thanks.


> On 14 Oct 2016, at 22:21, Laird Nelson <ljnel...@gmail.com> wrote:
> 
> On Fri, Oct 14, 2016 at 7:19 AM Vincent Ryan <vincent.x.r...@oracle.com 
> <mailto:vincent.x.r...@oracle.com>> wrote:
> The problem of having to cast the result of Context.lookup 
> <http://download.java.net/java/jdk9/docs/api/javax/naming/Context.html#lookup-javax.naming.Name->
>  can be solved using an existing method:
>     InitialContext.doLookup 
> <http://download.java.net/java/jdk9/docs/api/javax/naming/InitialContext.html#doLookup-javax.naming.Name->
> 
> That solves the simple casting problem from an initial Context, but not for 
> all Contexts, and the simple addition of a relatively trivial default method 
> like this in the Context interface it seems to me would open the door for 
> Context implementers to reimplement it to do more sophisticated—and 
> deliberate—type conversion.
> 
> Best,
> Laird

Reply via email to