About adba DataSource.Builder

Douglas Surber douglas.surber at oracle.com
Thu Jan 17 21:00:57 UTC 2019


I think it is important to make a copy when possible because that way it is guaranteed that the value doesn't change, at least not to a first approximation. The alternative is to say that the implementation retains the value object and that modifications to the value object are erroneous may cause expected behavior. I guess that's ok but I prefer that the API protect itself where possible rather than relying on the user to conform to restrictions in the spec. I'm willing to go either way; whatever the consensus of the group is.

By the way, I use the word "erroneous" to describe things that should cause exceptions but are not detectable by the implementation. The Ada LRM uses this word in the same way. Any program that does something described as erroneous can fail in any arbitrary way. Ideally implementations detect erroneous actions, but they absolutely are not required or even expected to. If the spec says something is erroneous an app should avoid it as though such an action would call Runtime.halt. If an implementation detects such an action, which probably isn't possible in the general case, it can fail in any way it wants, including calling Runtime.halt.

Douglas

> On Jan 17, 2019, at 10:45 AM, Alexander Kjäll <alexander.kjall at gmail.com> wrote:
> 
> Thanks, good to get confirmation that it's intended to use reflection,
> I normally stay far away from that.
> 
> //Alex
> 
> Den tors 17 jan. 2019 kl 19:38 skrev Douglas Surber <douglas.surber at oracle.com>:
>> 
>> True. This is just pseudo code. A bit of reflection does the trick. The JavaDoc should say "and overrides clone making it public accessible" as that is required.
>> 
>> Douglas
>> 
>> 



More information about the jdbc-spec-discuss mailing list