About adba DataSource.Builder

Alexander Kjäll alexander.kjall at gmail.com
Thu Jan 17 18:32:51 UTC 2019


Thanks for the quick reply.

Since clone() has protected access in Object that doesn't really compile.

//Alex

Den tors 17 jan. 2019 kl 19:28 skrev Douglas Surber <douglas.surber at oracle.com>:
>
> The implementation doesn't decide at compile time. It decides at runtime.
>
>   if (value instanceof Cloneable) val = value.clone();
>   else val = value;
>
> Douglas
>
> > On Jan 17, 2019, at 10:24 AM, Alexander Kjäll <alexander.kjall at gmail.com> wrote:
> >
> > Hi
> >
> > The function
> >
> > public Builder sessionProperty(SessionProperty property, Object value);
> >
> > Specifies in the javadoc that objects should be cloned if they
> > implement Cloneable
> >
> > * @param value the value to set as the default for {@code property}. If
> > * value is {@link Cloneable} it is cloned otherwise it is retained
> >
> > But since the implementation doesn't know the concrete class at
> > compile time it can't call clone().
> >
> > best regards
> > Alexander Kjäll
>


More information about the jdbc-spec-discuss mailing list