About adba DataSource.Builder

Douglas Surber douglas.surber at oracle.com
Thu Jan 17 18:28:44 UTC 2019


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