[eclipse-dtp] Fix build against Java 7 SQL interfaces. Also update .gitignore.
Andrew Overholt
overholt at fedoraproject.org
Fri Dec 2 20:49:56 UTC 2011
commit bd06f792f77316f6e879a5ca052d4135bdd6c943
Author: Andrew Overholt <overholt at redhat.com>
Date: Fri Dec 2 15:44:06 2011 -0500
Fix build against Java 7 SQL interfaces. Also update .gitignore.
.gitignore | 2 +
eclipse-dtp-java6.patch => eclipse-dtp-java7.patch | 146 ++++++++++++++------
eclipse-dtp.spec | 22 ++-
3 files changed, 123 insertions(+), 47 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 90142d6..5107c01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,5 @@ org.eclipse.datatools.enablement.general-DTP_1_9_1_Release_201109031845.tar.bz2
/org.eclipse.datatools.incubator-DTP_1_9_1_Release_201109031845.tar.bz2
/org.eclipse.datatools.modelbase-DTP_1_9_1_Release_201109031845.tar.bz2
/org.eclipse.datatools.sqltools-DTP_1_9_1_Release_201109031845.tar.bz2
+/eclipse-dtp-1.9.1
+/noarch
diff --git a/eclipse-dtp-java6.patch b/eclipse-dtp-java7.patch
similarity index 65%
rename from eclipse-dtp-java6.patch
rename to eclipse-dtp-java7.patch
index d8d015d..a82b0d6 100644
--- a/eclipse-dtp-java6.patch
+++ b/eclipse-dtp-java7.patch
@@ -1,13 +1,40 @@
-### Eclipse Workspace Patch 1.0
-#P org.eclipse.datatools.connectivity.sqm.core
-Index: src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ConnectionAdapter.java
-===================================================================
-RCS file: /cvsroot/datatools/org.eclipse.datatools.connectivity/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ConnectionAdapter.java,v
-retrieving revision 1.5
-diff -u -r1.5 ConnectionAdapter.java
---- src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ConnectionAdapter.java 17 Feb 2009 14:52:31 -0000 1.5
-+++ src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ConnectionAdapter.java 20 Jul 2010 15:22:13 -0000
-@@ -10,15 +10,23 @@
+commit 27dbf596874e44a8449afaa22e27dbba359b010c
+Author: Andrew Overholt <overholt at redhat.com>
+Date: Fri Dec 2 15:32:05 2011 -0500
+
+ 220787: Fix Delelegation of our ConnectionAdapter when compiling against
+ the Java 6 API
+ https://bugs.eclipse.org/bugs/show_bug.cgi?id=220787
+
+ Update old patch for Java 6 source compatibility to apply against 1.9.1.
+
+diff --git a/plugins/org.eclipse.datatools.connectivity.sqm.core/.classpath b/plugins/org.eclipse.datatools.connectivity.sqm.core/.classpath
+index 64c5e31..ad0ad09 100644
+--- a/plugins/org.eclipse.datatools.connectivity.sqm.core/.classpath
++++ b/plugins/org.eclipse.datatools.connectivity.sqm.core/.classpath
+@@ -1,6 +1,6 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <classpath>
+- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
++ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+diff --git a/plugins/org.eclipse.datatools.connectivity.sqm.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.datatools.connectivity.sqm.core/META-INF/MANIFEST.MF
+index 12ec4ae..1c694ef 100644
+--- a/plugins/org.eclipse.datatools.connectivity.sqm.core/META-INF/MANIFEST.MF
++++ b/plugins/org.eclipse.datatools.connectivity.sqm.core/META-INF/MANIFEST.MF
+@@ -34,4 +34,4 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
+ com.ibm.icu;bundle-version="[3.4.0,5.0.0)"
+ Eclipse-LazyStart: true
+ Bundle-ActivationPolicy: lazy
+-Bundle-RequiredExecutionEnvironment: J2SE-1.5
++Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+diff --git a/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ConnectionAdapter.java b/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ConnectionAdapter.java
+index cc78c4e..7ce282e 100644
+--- a/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ConnectionAdapter.java
++++ b/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ConnectionAdapter.java
+@@ -10,15 +10,24 @@
*******************************************************************************/
package org.eclipse.datatools.connectivity.sqm.internal.core.connection;
@@ -28,10 +55,11 @@ diff -u -r1.5 ConnectionAdapter.java
+import java.sql.Struct;
import java.util.Map;
+import java.util.Properties;
++import java.util.concurrent.Executor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-@@ -183,18 +191,74 @@
+@@ -183,18 +192,95 @@ public class ConnectionAdapter implements Connection {
}
public CallableStatement prepareCall(String arg0, int arg1, int arg2, int arg3) throws SQLException {
@@ -102,22 +130,40 @@ diff -u -r1.5 ConnectionAdapter.java
+ connection.setClientInfo(name, value);
+ }
+
-+ public boolean isWrapperFor(Class arg0) throws SQLException {
-+ return connection.isWrapperFor(arg0);
++ public void setSchema(String schema) throws SQLException {
++ connection.setSchema(schema);
+ }
+
-+ public Object unwrap(Class arg0) throws SQLException {
-+ return connection.unwrap(arg0);
++ public String getSchema() throws SQLException {
++ return connection.getSchema();
++ }
++
++ public void abort(Executor executor) throws SQLException {
++ connection.abort(executor);
++ }
++
++ public void setNetworkTimeout(Executor executor, int milliseconds)
++ throws SQLException {
++ connection.setNetworkTimeout(executor, milliseconds);
++ }
++
++ public int getNetworkTimeout() throws SQLException {
++ return connection.getNetworkTimeout();
++ }
++
++ public <T> T unwrap(Class<T> iface) throws SQLException {
++ return connection.unwrap(iface);
++ }
++
++ public boolean isWrapperFor(Class<?> iface) throws SQLException {
++ return connection.isWrapperFor(iface);
}
}
-Index: src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ResultSetAdapter.java
-===================================================================
-RCS file: /cvsroot/datatools/org.eclipse.datatools.connectivity/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ResultSetAdapter.java,v
-retrieving revision 1.5
-diff -u -r1.5 ResultSetAdapter.java
---- src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ResultSetAdapter.java 17 Feb 2009 14:52:31 -0000 1.5
-+++ src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ResultSetAdapter.java 20 Jul 2010 15:22:13 -0000
-@@ -18,11 +18,14 @@
+diff --git a/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ResultSetAdapter.java b/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ResultSetAdapter.java
+index c560777..179fb5c 100644
+--- a/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ResultSetAdapter.java
++++ b/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/ResultSetAdapter.java
+@@ -18,11 +18,14 @@ import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
@@ -132,7 +178,7 @@ diff -u -r1.5 ResultSetAdapter.java
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
-@@ -516,4 +519,184 @@
+@@ -516,4 +519,191 @@ public class ResultSetAdapter implements ResultSet {
public boolean wasNull() throws SQLException {
return resultSet.wasNull();
}
@@ -316,32 +362,50 @@ diff -u -r1.5 ResultSetAdapter.java
+ throws SQLException {
+ resultSet.updateSQLXML(columnLabel, xmlObject);
+ }
- }
-Index: src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/StatementAdapter.java
-===================================================================
-RCS file: /cvsroot/datatools/org.eclipse.datatools.connectivity/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/StatementAdapter.java,v
-retrieving revision 1.8
-diff -u -r1.8 StatementAdapter.java
---- src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/StatementAdapter.java 28 Feb 2010 09:54:06 -0000 1.8
-+++ src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/StatementAdapter.java 20 Jul 2010 15:22:13 -0000
-@@ -204,4 +204,20 @@
- }
-
- private static ArrayList handers = null;
-+
-+ public boolean isWrapperFor(Class arg0) throws SQLException {
-+ return statement.isWrapperFor(arg0);
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ return resultSet.getObject(columnIndex, type);
+ }
-+ public Object unwrap(Class arg0) throws SQLException {
-+ return statement.unwrap(arg0);
++ public <T> T getObject(String columnLabel, Class<T> type)
++ throws SQLException {
++ return resultSet.getObject(columnLabel, type);
+ }
+ }
+diff --git a/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/StatementAdapter.java b/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/StatementAdapter.java
+index a226a0d..511595d 100644
+--- a/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/StatementAdapter.java
++++ b/plugins/org.eclipse.datatools.connectivity.sqm.core/src/org/eclipse/datatools/connectivity/sqm/internal/core/connection/StatementAdapter.java
+@@ -169,6 +169,22 @@ public class StatementAdapter implements Statement {
+ return statement.toString();
+ }
+
+ public boolean isClosed() throws SQLException {
+ return statement.isClosed();
+ }
+ public boolean isPoolable() throws SQLException {
+ return statement.isPoolable();
+ }
++ public boolean isWrapperFor(Class arg0) throws SQLException {
++ return statement.isWrapperFor(arg0);
++ }
+ public void setPoolable(boolean poolable) throws SQLException {
+ statement.setPoolable(poolable);
+ }
++ public Object unwrap(Class arg0) throws SQLException {
++ return statement.unwrap(arg0);
++ }
++
+ private void notifySQLExceptionHandler (SQLException sqlexception) {
+ ArrayList handlers = getSQLExceptionHandler();
+ for (int i = 0; i < handlers.size(); i++) {
+@@ -204,4 +220,11 @@ public class StatementAdapter implements Statement {
+ }
+
+ private static ArrayList handers = null;
++
++ public void closeOnCompletion() throws SQLException {
++ statement.closeOnCompletion();
++ }
++ public boolean isCloseOnCompletion() throws SQLException {
++ return statement.isCloseOnCompletion();
++ }
}
diff --git a/eclipse-dtp.spec b/eclipse-dtp.spec
index 131bb08..daeb26e 100644
--- a/eclipse-dtp.spec
+++ b/eclipse-dtp.spec
@@ -14,7 +14,7 @@
Name: eclipse-dtp
Version: 1.9.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Eclipse Data Tools Platform
Group: System Environment/Libraries
License: EPL
@@ -41,8 +41,8 @@ Source16: http://git.eclipse.org/c/datatools/org.eclipse.datatools.modelbase.gi
Source17: http://git.eclipse.org/c/datatools/org.eclipse.datatools.sqltools.git/snapshot/org.eclipse.datatools.sqltools-%{tag}.tar.bz2
Source18: get-dtp.sh
-# Build with Java 6 SQL interfaces
-Patch0: %{name}-java6.patch
+# Build with Java 7 SQL interfaces
+Patch0: %{name}-java7.patch
# remove duplicate plugin from sqltools features (it's actually built in the
# connectivity feature)
@@ -59,7 +59,10 @@ ExclusiveArch: %{ix86} x86_64
%endif
BuildArch: noarch
-BuildRequires: java-devel
+# FIXME:
+# This should be java-devle >= 1:1.7.0 but at the moment OpenJDK's 1.7 RPMs
+# don't Provide that
+BuildRequires: java-1.7.0-openjdk-devel
BuildRequires: jpackage-utils
BuildRequires: eclipse-pde >= 1:3.6.1
BuildRequires: eclipse-emf >= 2.6.0
@@ -71,7 +74,10 @@ BuildRequires: xalan-j2 >= 2.7.0-7.5
BuildRequires: xml-commons-apis >= 1.3.04-1.4
BuildRequires: lpg-java-compat = 1.1.0
-Requires: java
+# FIXME:
+# This should be java >= 1:1.7.0 but at the moment OpenJDK's 1.7 RPMs don't
+# Provide that
+Requires: java-1.7.0-openjdk
Requires: jpackage-utils
Requires: eclipse-platform >= 1:3.4.2
Requires: eclipse-emf
@@ -93,7 +99,7 @@ data-centric technologies and supported by the DTP ecosystem.
# apply patches
pushd org.eclipse.datatools.connectivity-%{tag}/plugins/org.eclipse.datatools.connectivity.sqm.core
-%patch0
+%patch0 -p3
popd
pushd org.eclipse.datatools.build-%{tag}
%patch1 -p1
@@ -189,6 +195,10 @@ rm -rf %{buildroot}
%doc org.eclipse.datatools.build-%{tag}/features/org.eclipse.datatools.sdk-all.feature/rootfiles/*
%changelog
+* Fri Dec 2 2011 Andrew Overholt <overholt at redhat.com> 1.9.1-1
+- Update patch to build against Java 7 SQL interfaces.
+- Bump Java build and runtime requirements accordingly.
+
* Wed Nov 30 2011 Andrew Overholt <overholt at redhat.com> 1.9.1-1
- Update to 1.9.1.
More information about the scm-commits
mailing list