You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2007/11/19 21:17:30 UTC
svn commit: r596424 - in
/db/derby/code/branches/10.3/java/engine/org/apache/derby:
iapi/services/info/JVMInfo.java impl/services/monitor/BaseMonitor.java
modules.properties
Author: rhillegas
Date: Mon Nov 19 12:17:29 2007
New Revision: 596424
URL: http://svn.apache.org/viewvc?rev=596424&view=rev
Log:
DERBY-3176: Port 594184 from trunk to 10.3 branch, re-enabling support on 10.3 for phoneME platform.
Modified:
db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/info/JVMInfo.java
db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
db/derby/code/branches/10.3/java/engine/org/apache/derby/modules.properties
Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/info/JVMInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/info/JVMInfo.java?rev=596424&r1=596423&r2=596424&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/info/JVMInfo.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/info/JVMInfo.java Mon Nov 19 12:17:29 2007
@@ -23,7 +23,8 @@
/**
- What's the current JDK runtime environment.
+ This class is used to determine which Java specification Derby will run at.
+ For a useful discussion of how this class is used, please see DERBY-3176.
*/
public abstract class JVMInfo
{
@@ -31,10 +32,11 @@
The JVM's runtime environment.
<UL>
<LI> 1 - not used was JDK 1.1
- <LI> 2 - J2SE_13- JDK 1.2, 1.3
+ <LI> 2 - not used, was for JDK 1.2 and 1.3
<LI> 4 - J2SE_14 - JDK 1.4.0 or 1.4.1
<LI> 5 - J2SE_142 - JDK 1.4.2
<LI> 6 - J2SE_15 - JDK 1.5
+ <LI> 7 - J2SE_16 - JDK 1.6
</UL>
*/
public static final int JDK_ID;
@@ -80,23 +82,25 @@
}
try {
- javaVersion = System.getProperty("java.specification.version", "1.3");
+ javaVersion = System.getProperty("java.specification.version", "1.4");
} catch (SecurityException se) {
// some vms do not know about this property so they
// throw a security exception when access is restricted.
- javaVersion = "1.3";
+ javaVersion = "1.4";
}
- if (javaSpec != null && javaSpec.startsWith("J2ME"))
+ if (javaSpec != null &&
+ (
+ javaSpec.startsWith("J2ME") || // recognize IBM WCTME
+ (
+ (javaSpec.indexOf( "Profile" ) > -1) && // recognize phoneME
+ (javaSpec.indexOf( "Specification" ) > -1)
+ )
+ )
+ )
{
- // IBM's WCTME 5.7 returns these values for CDC 1.0 profiles.
- // "J2ME Foundation Specification"
- //
-
- // Foundation 1.0 and Personal Profile 1.0 based
- // upon CDC 1.0 which is JDK 1.3 based
- id = J2SE_13;
+ id = J2SE_14;
isJ2ME = true;
}
else
@@ -104,11 +108,7 @@
// J2SE/J2EE
isJ2ME = false;
- if (javaVersion.equals("1.2") || javaVersion.equals("1.3"))
- {
- id = J2SE_13; //jdk1.3 is still Java2 platform with the same API
- }
- else if (javaVersion.equals("1.4"))
+ if (javaVersion.equals("1.4"))
{
String vmVersion = System.getProperty("java.version", "1.4.0");
@@ -129,7 +129,7 @@
{
// aussme our lowest support unless the java spec
// is greater than our highest level.
- id = J2SE_13;
+ id = J2SE_14;
try {
@@ -162,12 +162,12 @@
{
switch (JDK_ID)
{
- case J2SE_13: return J2ME ? "J2ME - JDBC for CDC/FP 1.0" : "J2SE 1.3 - JDBC 2.1";
- case J2SE_14: return "J2SE 1.4 - JDBC 3.0";
+ case J2SE_14: return J2ME ? "J2ME - JDBC for CDC/FP 1.1" : "J2SE 1.4 - JDBC 3.0";
case J2SE_142: return "J2SE 1.4.2 - JDBC 3.0";
case J2SE_15: return "J2SE 5.0 - JDBC 3.0";
case J2SE_16: return "Java SE 6 - JDBC 4.0";
default: return "?-?";
}
}
+
}
Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java?rev=596424&r1=596423&r2=596424&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java Mon Nov 19 12:17:29 2007
@@ -1663,7 +1663,7 @@
private static final HashMap storageFactories = new HashMap();
static {
String dirStorageFactoryClass;
- if( JVMInfo.JDK_ID >= JVMInfo.J2SE_14)
+ if( !JVMInfo.J2ME && (JVMInfo.JDK_ID >= JVMInfo.J2SE_14) )
dirStorageFactoryClass = "org.apache.derby.impl.io.DirStorageFactory4";
else
dirStorageFactoryClass = "org.apache.derby.impl.io.DirStorageFactory";
Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/modules.properties
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/modules.properties?rev=596424&r1=596423&r2=596424&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/modules.properties (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/modules.properties Mon Nov 19 12:17:29 2007
@@ -289,6 +289,7 @@
# Enhanced version using NIO API; requires Java 1.4
derby.module.rawStore.data.genericJ4=org.apache.derby.impl.store.raw.data.BaseDataFileFactoryJ4
derby.env.jdk.rawStore.data.genericJ4=4
+derby.env.classes.rawStore.data.genericJ4=java.nio.Buffer
cloudscape.config.rawStore.data.genericJ4=derby
# Generic version using older IO interfaces