persistence@glassfish.java.net

Re: Code review for Issue 1911: Make entity-persistence module compilable in JDK 6

From: Tom Ware <tom.ware_at_oracle.com>
Date: Mon, 08 Jan 2007 10:45:41 -0500

Hi Wonseok,

  The changes look good to me as a solution the the reported bug.

  I think we will need to do some work to figure out what work we need
to do to take full advantage of JDK 6 features. I guess for the time
being, if anyonoe thinks of anything that would be useful to exploit, it
would be a good idea to file an Enhancement.

-Tom

Wonseok Kim wrote:

> Hi Tom, Marina
>
> This issue is to exploit JDK 6 for development platform.
> https://glassfish.dev.java.net/issues/show_bug.cgi?id=1911
>
> What I know is that DataSourceImpl class is just wrapper or helper to
> get JNDI datasource, so other method implementations seem to have no
> meaning.
> So I simply added two JDBC 4.0 methods without worrying as below diff.
>
> I've run entity-persistence-tests with JDK 6 also, there was no failure.
>
> Please review!
> Thanks
> -Wonseok
>
> [Diff]
>
> Index:
> entity-persistence/src/java/oracle/toplink/essentials/descriptors/ClassDescriptor.java
> ===================================================================
> RCS file:
> /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/descriptors/ClassDescriptor.java,v
> retrieving revision 1.11
> diff -c -w -r1.11 ClassDescriptor.java
> ***
> entity-persistence/src/java/oracle/toplink/essentials/descriptors/ClassDescriptor.java
> 4 Jan 2007 14:30:31 -0000 1.11
> ---
> entity-persistence/src/java/oracle/toplink/essentials/descriptors/ClassDescriptor.java
> 8 Jan 2007 12:59:22 -0000
> ***************
> *** 21,28 ****
> // Copyright (c) 1998, 2007, Oracle. All rights reserved.
> package oracle.toplink.essentials.descriptors;
>
> - import com.sun.jndi.ldap.EntryChangeResponseControl ;
> -
> import java.security.AccessController;
> import java.security.PrivilegedActionException;
> import java.util.*;
> --- 21,26 ----
> Index:
> entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/jdbc/base/DataSourceImpl.java
> ===================================================================
> RCS file:
> /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/jdbc/base/DataSourceImpl.java,v
>
> retrieving revision 1.3
> diff -c -w -r1.3 DataSourceImpl.java
> ***
> entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/jdbc/base/DataSourceImpl.java
> 4 Jan 2007 14:30:44 -0000 1.3
> ---
> entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/jdbc/base/DataSourceImpl.java
> 8 Jan 2007 12:59:22 -0000
> ***************
> *** 148,151 ****
> --- 148,165 ----
> public void setLoginTimeout(int seconds) throws SQLException {
> DriverManager.setLoginTimeout(seconds);
> }
> +
> + /*
> + * JDBC 4.0
> + */
> + public <T> T unwrap(Class<T> iface) throws SQLException {
> + throw new SQLException();
> + }
> +
> + /*
> + * JDBC 4.0
> + */
> + public boolean isWrapperFor(Class<?> iface) throws SQLException {
> + return false;
> + }
> }
>