This patch makes the DRLVM work with the latest Harmony class libraries. The summary of changes incorporated in this patch are: - Harmony class libraries are taken from SVN at --revision {20060531T0000} ; - Building system migrated to the use of 1.5 compiler, you'll need javac 1.5 to be able to build the DRLVM now; - HARMONY-39, HARMONY-88 contributions are no longer used - beans, regex, math, jndi, logging, sql are all now taken from their "regular" locations in SVN classlib tree; - URLClassLoader in patches was synchronized with recent version (generics are used now); - com/ibm/oti/vm/VM.java was moved to org/apache/harmony/kernel/VM.java; - com/ibm/oti/vm/MsgHelp.java was moved to org/apache/harmony/luni/util/MsgHelp.java - java.lang.Class is parametrized and added empty isSynthetic() method to java.lang.reflect.Method/Field/Constructor to enable complation with the rest of Harmony class libraries. --- 4bc260576b0070b3869736f641a645494f0cc3df build/build.bat | 6 + build/build.sh | 10 +- build/make/build.xml | 12 ++ build/make/components/classlib/beans.xml | 27 +++++ build/make/components/classlib/jndi.xml | 26 ++++ build/make/components/classlib/logging.xml | 30 +++++ build/make/components/classlib/luni.xml | 4 + build/make/components/classlib/prefs.xml | 57 ++++++++++ build/make/components/classlib/regex.xml | 3 + build/make/components/classlib/security.xml | 7 + build/make/components/classlib/sql.xml | 5 + build/make/components/extra.xml | 2 build/make/components/extra/harmony39.xml | 34 ------ build/make/components/extra/harmony39/beans.xml | 60 ---------- build/make/components/extra/harmony39/math.xml | 48 -------- build/make/components/extra/harmony39/regex.xml | 51 --------- build/make/components/extra/harmony88.xml | 33 ------ build/make/components/extra/harmony88/logging.xml | 55 --------- build/make/components/extra/icu4c.xml | 42 ++++--- build/make/deploy.xml | 59 +++++----- build/make/lnx.properties | 10 -- build/make/setup.xml | 4 - build/make/targets/build.jar.xml | 49 ++++++++ build/make/targets/build.java.xml | 7 + build/make/targets/common_classlib.xml | 12 ++ build/make/win.properties | 10 -- .../luni/src/main/java/com/ibm/oti/vm/MsgHelp.java | 117 ----------------------- .../src/main/java/java/net/URLClassLoader.java | 38 ++++--- vm/vmcore/src/init/bootclasspath.properties | 8 + vm/vmcore/src/init/properties.cpp | 10 +- .../kernel_classes/javasrc/com/ibm/oti/vm/VM.java | 109 --------------------- .../kernel_classes/javasrc/java/lang/Class.java | 2 .../javasrc/java/lang/reflect/Constructor.java | 9 ++ .../javasrc/java/lang/reflect/Field.java | 8 ++ .../javasrc/java/lang/reflect/Method.java | 8 ++ .../javasrc/org/apache/harmony/kernel/VM.java | 112 ++++++++++++++++++++++ .../kernel_classes/native/com_ibm_oti_vm_VM.cpp | 46 --------- .../src/kernel_classes/native/com_ibm_oti_vm_VM.h | 56 ----------- .../native/org_apache_harmony_kernel_vm_VM.cpp | 46 +++++++++ .../native/org_apache_harmony_kernel_vm_VM.h | 47 +++++++++ 40 files changed, 557 insertions(+), 722 deletions(-) create mode 100644 build/make/components/classlib/beans.xml create mode 100644 build/make/components/classlib/jndi.xml create mode 100644 build/make/components/classlib/logging.xml mode change 100644 => 100755 build/make/components/classlib/luni.xml create mode 100644 build/make/components/classlib/prefs.xml mode change 100644 => 100755 build/make/components/classlib/regex.xml mode change 100644 => 100755 build/make/components/classlib/security.xml mode change 100644 => 100755 build/make/components/classlib/sql.xml delete mode 100644 build/make/components/extra/harmony39.xml delete mode 100644 build/make/components/extra/harmony39/beans.xml delete mode 100644 build/make/components/extra/harmony39/math.xml delete mode 100644 build/make/components/extra/harmony39/regex.xml delete mode 100644 build/make/components/extra/harmony88.xml delete mode 100644 build/make/components/extra/harmony88/logging.xml mode change 100644 => 100755 build/make/deploy.xml delete mode 100644 build/patches/common/CLASSLIB/modules/luni/src/main/java/com/ibm/oti/vm/MsgHelp.java delete mode 100644 vm/vmcore/src/kernel_classes/javasrc/com/ibm/oti/vm/VM.java create mode 100644 vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/VM.java delete mode 100755 vm/vmcore/src/kernel_classes/native/com_ibm_oti_vm_VM.cpp delete mode 100755 vm/vmcore/src/kernel_classes/native/com_ibm_oti_vm_VM.h create mode 100644 vm/vmcore/src/kernel_classes/native/org_apache_harmony_kernel_vm_VM.cpp create mode 100644 vm/vmcore/src/kernel_classes/native/org_apache_harmony_kernel_vm_VM.h 4bc260576b0070b3869736f641a645494f0cc3df diff --git a/build/build.bat b/build/build.bat index 6d111db..8923221 100755 --- a/build/build.bat +++ b/build/build.bat @@ -33,7 +33,7 @@ REM Check environment variables. REM REM For the quick start, build needs the following REM variables to be set: -REM JAVA_HOME = +REM JAVA_HOME = REM ANT_HOME = REM COMPILER_CFG_SCRIPT = REM ================================================ @@ -98,7 +98,7 @@ REM ==================================== IF NOT EXIST "%JAVA_HOME%\bin\java.exe" ( IF NOT EXIST "%JAVA_HOME%\bin\ij.exe" ( ECHO * Neigher "%JAVA_HOME%\bin\java.exe" nor "%JAVA_HOME%\bin\ij.exe" found. - ECHO * Make sure you have Harmony JRE or DRLVM installed on your computer and that + ECHO * Make sure you have JRE 1.5 or DRLVM installed on your computer and that ECHO * JAVA_HOME environment variable points out to its installation dir, e.g. ECHO * SET JAVA_HOME=c:\jre GOTO ERROR @@ -133,7 +133,7 @@ SET CLASSPATH=.\make\tmp\ant-contrib.jar REM Ant launcher doesn't know about ij.exe IF EXIST "%JAVA_HOME%\bin\ij.exe" ( - SET ANT_COMMAND=%JAVA_HOME%\bin\ij.exe -Duser.timezone=en_US -classpath %ANT_HOME%\lib\ant-launcher.jar -Dant.home=%ANT_HOME% org.apache.tools.ant.launch.Launcher -cp %CLASSPATH% -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter + SET ANT_COMMAND=%JAVA_HOME%\bin\ij.exe -Duser.timezone=en_US -classpath %ANT_HOME%\lib\ant-launcher.jar -Dant.home=%ANT_HOME% org.apache.tools.ant.launch.Launcher -cp %CLASSPATH% ) ELSE ( SET ANT_COMMAND=%ANT_HOME%\bin\ant.bat ) diff --git a/build/build.sh b/build/build.sh index ddafa55..5e7fe2f 100755 --- a/build/build.sh +++ b/build/build.sh @@ -40,7 +40,7 @@ # Set default environment variables # ================================================ if [ -z "$JAVA_HOME" ]; then - JAVA_HOME=/usr/local/jrockit-j2sdk1.4.2_04 + JAVA_HOME=/usr/local/jrockit-jdk1.5.0 fi # Apache Ant 1.6.2 or higher (can be obtained at http://ant.apache.org) @@ -55,9 +55,9 @@ # ====================================== if [ ! -x $JAVA_HOME/bin/java ] && [ ! -x $JAVA_HOME/bin/ij ]; then echo "* Neigher $JAVA_HOME/bin/java nor $JAVA_HOME/bin/ij found." - echo "* Make sure you have J2SDK or DRLVM installed on your computer and that" + echo "* Make sure you have J2SDK 1.5 or DRLVM installed on your computer and that" echo "* JAVA_HOME environment variable points out to its installation dir, e.g." - echo "* export JAVA_HOME=/usr/local/jdk_1.4.2" + echo "* export JAVA_HOME=/usr/local/jdk_1.5.0" ERROR elif [ ! -x $ANT_HOME/bin/ant ]; then echo "* File $ANT_HOME/bin/ant not found." @@ -83,9 +83,9 @@ CLASSPATH=`pwd`/make/tmp/ant-contrib.jar export CLASSPATH if [ -x $JAVA_HOME/bin/ij ]; then - ANT_COMMAND="$JAVA_HOME/bin/ij -Duser.timezone=en_US -classpath $ANT_HOME/lib/ant-launcher.jar -Dant.home=$ANT_HOME org.apache.tools.ant.launch.Launcher -cp $CLASSPATH -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter" + ANT_COMMAND="$JAVA_HOME/bin/ij -Duser.timezone=en_US -classpath $ANT_HOME/lib/ant-launcher.jar -Dant.home=$ANT_HOME org.apache.tools.ant.launch.Launcher -cp $CLASSPATH" else - ANT_COMMAND="$ANT_HOME/bin/ant --noconfig -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter" + ANT_COMMAND="$ANT_HOME/bin/ant --noconfig" fi # it is necessarily to compile 'vm.jitrino' in release mode diff --git a/build/make/build.xml b/build/make/build.xml index 7c9c925..092a781 100644 --- a/build/make/build.xml +++ b/build/make/build.xml @@ -200,7 +200,7 @@ Version: $Revision: 1.16.2.20 $ - + @@ -278,6 +278,16 @@ Version: $Revision: 1.16.2.20 $ + + + + + + + + + + diff --git a/build/make/components/classlib/beans.xml b/build/make/components/classlib/beans.xml new file mode 100644 index 0000000..6f0c6fb --- /dev/null +++ b/build/make/components/classlib/beans.xml @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/build/make/components/classlib/jndi.xml b/build/make/components/classlib/jndi.xml new file mode 100644 index 0000000..fa8c799 --- /dev/null +++ b/build/make/components/classlib/jndi.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/build/make/components/classlib/logging.xml b/build/make/components/classlib/logging.xml new file mode 100644 index 0000000..d0c1916 --- /dev/null +++ b/build/make/components/classlib/logging.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/build/make/components/classlib/luni.xml b/build/make/components/classlib/luni.xml old mode 100644 new mode 100755 index af9f2bf..4f25f96 --- a/build/make/components/classlib/luni.xml +++ b/build/make/components/classlib/luni.xml @@ -28,7 +28,7 @@ Version: $Revision: 1.3.2.6 $ - + @@ -39,6 +39,7 @@ Version: $Revision: 1.3.2.6 $ + @@ -57,6 +58,7 @@ Version: $Revision: 1.3.2.6 $ + + + + + + + + + + + + + + + + + + + + + diff --git a/build/make/components/classlib/regex.xml b/build/make/components/classlib/regex.xml old mode 100644 new mode 100755 index 7d8bf93..7262d87 --- a/build/make/components/classlib/regex.xml +++ b/build/make/components/classlib/regex.xml @@ -28,5 +28,8 @@ Version: $Revision: 1.3.2.2 $ + + diff --git a/build/make/components/classlib/security.xml b/build/make/components/classlib/security.xml old mode 100644 new mode 100755 index 8dd704d..ee566dd --- a/build/make/components/classlib/security.xml +++ b/build/make/components/classlib/security.xml @@ -27,6 +27,11 @@ Version: $Revision: 1.3.2.4 $ --> - + + + + + + diff --git a/build/make/components/classlib/sql.xml b/build/make/components/classlib/sql.xml old mode 100644 new mode 100755 index 0dd851a..0161f66 --- a/build/make/components/classlib/sql.xml +++ b/build/make/components/classlib/sql.xml @@ -27,7 +27,10 @@ Version: $Revision: 1.1.2.3 $ --> + - + + diff --git a/build/make/components/extra.xml b/build/make/components/extra.xml index 843ba1f..5fe6610 100644 --- a/build/make/components/extra.xml +++ b/build/make/components/extra.xml @@ -32,8 +32,6 @@ Version: $Revision: 1.1.2.11 $ extra.aprutil, extra.bcprov, extra.eclipse_script, - extra.harmony39, - extra.harmony88, extra.hello, extra.icu4c, extra.hyplugin, diff --git a/build/make/components/extra/harmony39.xml b/build/make/components/extra/harmony39.xml deleted file mode 100644 index 769088d..0000000 --- a/build/make/components/extra/harmony39.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - diff --git a/build/make/components/extra/harmony39/beans.xml b/build/make/components/extra/harmony39/beans.xml deleted file mode 100644 index f2ae402..0000000 --- a/build/make/components/extra/harmony39/beans.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/make/components/extra/harmony39/math.xml b/build/make/components/extra/harmony39/math.xml deleted file mode 100644 index f7a81ae..0000000 --- a/build/make/components/extra/harmony39/math.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/make/components/extra/harmony39/regex.xml b/build/make/components/extra/harmony39/regex.xml deleted file mode 100644 index 1b11e54..0000000 --- a/build/make/components/extra/harmony39/regex.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/make/components/extra/harmony88.xml b/build/make/components/extra/harmony88.xml deleted file mode 100644 index 7c2794e..0000000 --- a/build/make/components/extra/harmony88.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - diff --git a/build/make/components/extra/harmony88/logging.xml b/build/make/components/extra/harmony88/logging.xml deleted file mode 100644 index a9a370a..0000000 --- a/build/make/components/extra/harmony88/logging.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/make/components/extra/icu4c.xml b/build/make/components/extra/icu4c.xml index c5b9548..a428d95 100644 --- a/build/make/components/extra/icu4c.xml +++ b/build/make/components/extra/icu4c.xml @@ -16,7 +16,7 @@ --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + diff --git a/build/make/targets/build.java.xml b/build/make/targets/build.java.xml index 8420dee..b8d3306 100644 --- a/build/make/targets/build.java.xml +++ b/build/make/targets/build.java.xml @@ -22,8 +22,11 @@ Version: $Revision: 1.4.2.2 $ - - + + diff --git a/build/make/targets/common_classlib.xml b/build/make/targets/common_classlib.xml index 43dcf3f..1967bb2 100644 --- a/build/make/targets/common_classlib.xml +++ b/build/make/targets/common_classlib.xml @@ -150,11 +150,13 @@ Version: $Revision: 1.7.2.7 $ + + @@ -169,15 +171,21 @@ Version: $Revision: 1.7.2.7 $ + + + + - + - + diff --git a/build/make/win.properties b/build/make/win.properties index 47fadf1..fd32ef0 100644 --- a/build/make/win.properties +++ b/build/make/win.properties @@ -49,7 +49,7 @@ remote.ZLIB.archive=http://www.zlib.net/ # Harmony class libraries (sources & pre-built binaries) # https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk -remote.CLASSLIB.archive=-r 385366 https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk +remote.CLASSLIB.archive=--revision {20060531T0000} https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk remote.CLASSLIB.archive.type=svn # Apache Portable Runtime, version 1.1 or above @@ -76,14 +76,6 @@ # Xalan-Java version 2.4.1 # http://archive.apache.org/dist/xml/xalan-j remote.XALAN.archive=http://www.reverse.net/pub/apache/xml/xalan-j/xalan-j_2_7_0-bin.zip -# Intel's contribution of Beans/Regex/Math packages -# http://issues.apache.org/jira/browse/HARMONY-39 -remote.HARMONY39.archive=http://issues.apache.org/jira/secure/attachment/12322254/regex_beans_math_src_20060120_1845-Harmony.zip - -# IBM's contribution of jndi, logging, prefs and sql -# http://issues.apache.org/jira/browse/HARMONY-88 -remote.HARMONY88.archive=http://issues.apache.org/jira/secure/attachment/12322917/Harmony-Contribution.zip - # BoundCastle Crypto API # http://www.bouncycastle.org/download/bcprov-jdk14-129.jar remote.BCPROV.archive=http://www.bouncycastle.org/download/bcprov-jdk14-129.jar diff --git a/build/patches/common/CLASSLIB/modules/luni/src/main/java/com/ibm/oti/vm/MsgHelp.java b/build/patches/common/CLASSLIB/modules/luni/src/main/java/com/ibm/oti/vm/MsgHelp.java deleted file mode 100644 index 156cc4c..0000000 --- a/build/patches/common/CLASSLIB/modules/luni/src/main/java/com/ibm/oti/vm/MsgHelp.java +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright 2003, 2005 The Apache Software Foundation or its licensors, as applicable - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.oti.vm; - - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * This class contains helper methods for loading resource bundles and - * formatting external message strings. - */ - -public final class MsgHelp { - - /** - * Generates a formatted text string given a source string containing - * "argument markers" of the form "{argNum}" where each argNum must be in - * the range 0..9. The result is generated by inserting the toString of each - * argument into the position indicated in the string. - *

- * To insert the "{" character into the output, use a single backslash - * character to escape it (i.e. "\{"). The "}" character does not need to be - * escaped. - * - * @param format - * String the format to use when printing. - * @param args - * Object[] the arguments to use. - * @return String the formatted message. - */ - public static String format(String format, Object[] args) { - StringBuffer answer = new StringBuffer(format.length() - + (args.length * 20)); - String[] argStrings = new String[args.length]; - for (int i = 0; i < args.length; ++i) { - if (args[i] == null) - argStrings[i] = ""; - else - argStrings[i] = args[i].toString(); - } - int lastI = 0; - for (int i = format.indexOf('{', 0); i >= 0; i = format.indexOf('{', - lastI)) { - if (i != 0 && format.charAt(i - 1) == '\\') { - // It's escaped, just print and loop. - if (i != 1) - answer.append(format.substring(lastI, i - 1)); - answer.append('{'); - lastI = i + 1; - } else { - // It's a format character. - if (i > format.length() - 3) { - // Bad format, just print and loop. - answer.append(format.substring(lastI, format.length())); - lastI = format.length(); - } else { - int argnum = (byte) Character.digit(format.charAt(i + 1), - 10); - if (argnum < 0 || format.charAt(i + 2) != '}') { - // Bad format, just print and loop. - answer.append(format.substring(lastI, i + 1)); - lastI = i + 1; - } else { - // Got a good one! - answer.append(format.substring(lastI, i)); - if (argnum >= argStrings.length) - answer.append(""); - else - answer.append(argStrings[argnum]); - lastI = i + 3; - } - } - } - } - if (lastI < format.length()) - answer.append(format.substring(lastI, format.length())); - return answer.toString(); - } - - /** - * Changes the locale of the messages. - * - * @param locale - * Locale the locale to change to. - */ - static public ResourceBundle setLocale(final Locale locale, - final String resource) { - try { - final ClassLoader loader = VM.getStackClassLoader(1); - return (ResourceBundle) AccessController - .doPrivileged(new PrivilegedAction() { - public Object run() { - return ResourceBundle.getBundle(resource, locale, loader != null ? loader : ClassLoader.getSystemClassLoader()); - } - }); - } catch (MissingResourceException e) { - } - return null; - } -} diff --git a/build/patches/common/CLASSLIB/modules/luni/src/main/java/java/net/URLClassLoader.java b/build/patches/common/CLASSLIB/modules/luni/src/main/java/java/net/URLClassLoader.java index 34f9ece..4895f7d 100644 --- a/build/patches/common/CLASSLIB/modules/luni/src/main/java/java/net/URLClassLoader.java +++ b/build/patches/common/CLASSLIB/modules/luni/src/main/java/java/net/URLClassLoader.java @@ -44,7 +44,7 @@ import java.util.jar.JarFile; import java.util.jar.Manifest; import java.util.zip.ZipEntry; -import com.ibm.oti.util.InvalidJarIndexException; +import org.apache.harmony.luni.util.InvalidJarIndexException; /** * This class loader is responsible for loading classes and resources from a @@ -200,9 +200,9 @@ public class URLClassLoader extends Secu public Enumeration findResources(final String name) throws IOException { if (name == null) return null; - Vector result = (Vector) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + Vector result = AccessController.doPrivileged( + new PrivilegedAction() { + public Vector run() { return findResources(urls, name, new Vector()); } }, currentContext); @@ -494,9 +494,9 @@ public class URLClassLoader extends Secu * URLClassloader */ public static URLClassLoader newInstance(final URL[] urls) { - URLClassLoader sub = (URLClassLoader) AccessController - .doPrivileged(new PrivilegedAction() { - public Object run() { + URLClassLoader sub = AccessController.doPrivileged( + new PrivilegedAction() { + public URLClassLoader run() { return new SubURLClassLoader(urls); } }); @@ -520,9 +520,9 @@ public class URLClassLoader extends Secu */ public static URLClassLoader newInstance(final URL[] urls, final ClassLoader parentCl) { - URLClassLoader sub = (URLClassLoader) AccessController - .doPrivileged(new PrivilegedAction() { - public Object run() { + URLClassLoader sub = AccessController.doPrivileged( + new PrivilegedAction() { + public URLClassLoader run() { return new SubURLClassLoader(urls, parentCl); } }); @@ -592,9 +592,9 @@ public class URLClassLoader extends Secu */ protected Class findClass(final String clsName) throws ClassNotFoundException { - Class cls = (Class) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + Class cls = AccessController.doPrivileged( + new PrivilegedAction() { + public Class run() { return findClassImpl(urls, clsName); } }, currentContext); @@ -639,9 +639,9 @@ public class URLClassLoader extends Secu public URL findResource(final String name) { if (name == null) return null; - URL result = (URL) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + URL result = AccessController.doPrivileged( + new PrivilegedAction() { + public URL run() { return findResourceImpl(urls, name); } }, currentContext); @@ -908,7 +908,7 @@ public class URLClassLoader extends Secu */ private ArrayList readLines(InputStream in) throws IOException { byte[] buff = new byte[144]; - ArrayList lines = new ArrayList(); + ArrayList lines = new ArrayList(); int pos = 0; int next; while ((next = in.read()) != -1) { @@ -1080,7 +1080,7 @@ public class URLClassLoader extends Secu exception = packageObj.isSealed(); if (exception) throw new SecurityException( - com.ibm.oti.util.Msg + org.apache.harmony.luni.util.Msg .getString("K004c")); } } @@ -1140,7 +1140,7 @@ public class URLClassLoader extends Secu if (ze != null) { if (url.equals(urls[indexNumber])) { try { - Hashtable index = new Hashtable(15); + Hashtable index = new Hashtable(15); InputStream indexIS = jf.getInputStream(ze); List lines = readLines(indexIS); indexIS.close(); diff --git a/vm/vmcore/src/init/bootclasspath.properties b/vm/vmcore/src/init/bootclasspath.properties index 445c135..83ddc03 100644 --- a/vm/vmcore/src/init/bootclasspath.properties +++ b/vm/vmcore/src/init/bootclasspath.properties @@ -46,7 +46,7 @@ bootclasspath.3=beans.jar bootclasspath.4=crypto.jar -bootclasspath.5=icu4j_3_4.jar +bootclasspath.5=icu4j-3.4.jar bootclasspath.6=icu4jni-3.4.jar @@ -81,3 +81,9 @@ bootclasspath.20=xalan.jar bootclasspath.21=xercesImpl.jar bootclasspath.22=xml-apis.jar + +bootclasspath.23=auth.jar + +bootclasspath.24=jndi.jar + +bootclasspath.25=prefs.jar diff --git a/vm/vmcore/src/init/properties.cpp b/vm/vmcore/src/init/properties.cpp index 22d8466..6447248 100755 --- a/vm/vmcore/src/init/properties.cpp +++ b/vm/vmcore/src/init/properties.cpp @@ -99,10 +99,10 @@ #define API_DLL5 "hyzlib" #define API_DLL6 "hytext" #define API_DLL7 "hypool" #define API_DLL8 "vmi" -#define API_DLL9 "hynio" +//#define API_DLL9 "hynio" #define API_DLLA "hyluni" #define API_DLLB "hyarchive" -#define API_DLLC "hymath" +//#define API_DLLC "hymath" #define GC_DLL "gc" #define EM_DLL "em" @@ -268,10 +268,10 @@ static void define_undefined_predefined_ API_DLL5, API_DLL6, API_DLL8, - API_DLL9, +// API_DLL9, API_DLLA, - API_DLLB, - API_DLLC + API_DLLB +// API_DLLC }; int n_api_dll_files = sizeof(api_dll_files) / sizeof(char *); diff --git a/vm/vmcore/src/kernel_classes/javasrc/com/ibm/oti/vm/VM.java b/vm/vmcore/src/kernel_classes/javasrc/com/ibm/oti/vm/VM.java deleted file mode 100644 index 3f3a04d..0000000 --- a/vm/vmcore/src/kernel_classes/javasrc/com/ibm/oti/vm/VM.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @author Evgueni V. Brevnov - * @version $Revision: 1.1.2.3.4.3 $ - */ - -package com.ibm.oti.vm; - -import org.apache.harmony.vm.VMStack; -import com.ibm.oti.net.www.protocol.jar.JarURLConnection; -import com.ibm.oti.util.DeleteOnExit; - -public final class VM { - - private static boolean closeJars = false; - private static boolean deleteOnExit = false; - - private VM() { - } - - /* PUBLIC */ - - /** - * 1) Our implementation uses null for bootstrap class loader. So we return - * first non-null class loader. - * 2) We expect this method will be removed since it's - * not safe to return class loader from the stack with out security checks. - * @deprecated - */ - public static ClassLoader getNonBootstrapClassLoader() { - - for (int i = 0;;i++) { - Class clazz = VMStack.getCallerClass(i); - if (clazz == null) { - return null; - } - ClassLoader loader = getClassLoader(clazz); - if (loader != null) { - return loader; - } - } - } - - /** - * 1) We expect this method will be removed since it's - * not safe to return class loader from the stack with out security checks. - * @deprecated - */ - public static ClassLoader callerClassLoader() { - return getClassLoader(VMStack.getCallerClass(1)); - } - - private static native ClassLoader getClassLoader(Class clazz); - - /* PACKAGE PRIVATE */ - - static final ClassLoader getStackClassLoader(int depth) { - Class clazz = VMStack.getCallerClass(depth); - return clazz != null ? getClassLoader(clazz) : null; - } - - /* PRIVATE */ - - /** - * 1) This is temporary implementation - * 2) We've proposed another approach to perform shutdown actions. - */ - public static void closeJars() { - class CloseJarsHook implements Runnable { - public void run() { - JarURLConnection.closeCachedFiles(); - } - } - if (!closeJars) { - closeJars = true; - Runtime.getRuntime().addShutdownHook(new Thread(new CloseJarsHook())); - } - } - - /** - * 1) This is temporary implementation - * 2) We've proposed another approach to perform shutdown actions. - */ - public static void deleteOnExit() { - class DeleteOnExitHook implements Runnable { - public void run() { - DeleteOnExit.deleteOnExit(); - } - } - if (!deleteOnExit) { - deleteOnExit = true; - Runtime.getRuntime().addShutdownHook(new Thread(new DeleteOnExitHook())); - } - } -} diff --git a/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java b/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java index 4b22210..bc7cef8 100644 --- a/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java +++ b/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java @@ -44,7 +44,7 @@ import org.apache.harmony.vm.VMStack; * @author Evgueni Brevnov * @version $Revision: 1.1.2.2.4.5 $ */ -public final class Class implements Serializable { +public final class Class implements Serializable { private static final long serialVersionUID = 3206093459760846163L; diff --git a/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java b/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java index 01bdc43..9fb3dfd 100644 --- a/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java +++ b/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java @@ -29,6 +29,15 @@ import org.apache.harmony.vm.VMStack; */ public final class Constructor extends AccessibleObject implements Member { + + /** + * TODO: add fair implementation here + */ + public boolean isSynthetic() { + return false; + } + + /** * cache of the constructor data */ diff --git a/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java b/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java index 999f74a..78e4cf6 100644 --- a/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java +++ b/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java @@ -27,6 +27,14 @@ import org.apache.harmony.vm.VMStack; */ public final class Field extends AccessibleObject implements Member { + + /** + * TODO: add fair implementation here + */ + public boolean isSynthetic() { + return false; + } + /** * cache of the field data */ diff --git a/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java b/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java index 9198229..21f2619 100644 --- a/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java +++ b/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java @@ -29,6 +29,14 @@ import org.apache.harmony.vm.VMStack; */ public final class Method extends AccessibleObject implements Member { + + /** + * TODO: add fair implementation here + */ + public boolean isSynthetic() { + return false; + } + /** * cache of the method data */ diff --git a/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/VM.java b/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/VM.java new file mode 100644 index 0000000..8fd7ada --- /dev/null +++ b/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/kernel/VM.java @@ -0,0 +1,112 @@ +/* + * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @author Evgueni V. Brevnov + * @version $Revision: 1.1.2.2 $ + */ + +package org.apache.harmony.kernel.vm; + +import org.apache.harmony.vm.VMStack; +//import com.ibm.oti.net.www.protocol.jar.JarURLConnection; +//import com.ibm.oti.util.DeleteOnExit; +import org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection; +import org.apache.harmony.luni.util.DeleteOnExit; + + +public final class VM { + + private static boolean closeJars = false; + private static boolean deleteOnExit = false; + + private VM() { + } + + /* PUBLIC */ + + /** + * 1) Our implementation uses null for bootstrap class loader. So we return + * first non-null class loader. + * 2) We expect this method will be removed since it's + * not safe to return class loader from the stack with out security checks. + * @deprecated + */ + public static ClassLoader getNonBootstrapClassLoader() { + + for (int i = 0;;i++) { + Class clazz = VMStack.getCallerClass(i); + if (clazz == null) { + return null; + } + ClassLoader loader = getClassLoader(clazz); + if (loader != null) { + return loader; + } + } + } + + /** + * 1) We expect this method will be removed since it's + * not safe to return class loader from the stack with out security checks. + * @deprecated + */ + public static ClassLoader callerClassLoader() { + return getClassLoader(VMStack.getCallerClass(1)); + } + + private static native ClassLoader getClassLoader(Class clazz); + + /* PACKAGE PRIVATE */ + + public static final ClassLoader getStackClassLoader(int depth) { + Class clazz = VMStack.getCallerClass(depth); + return clazz != null ? getClassLoader(clazz) : null; + } + + /* PRIVATE */ + + /** + * 1) This is temporary implementation + * 2) We've proposed another approach to perform shutdown actions. + */ + public static void closeJars() { + class CloseJarsHook implements Runnable { + public void run() { + JarURLConnection.closeCachedFiles(); + } + } + if (!closeJars) { + closeJars = true; + Runtime.getRuntime().addShutdownHook(new Thread(new CloseJarsHook())); + } + } + + /** + * 1) This is temporary implementation + * 2) We've proposed another approach to perform shutdown actions. + */ + public static void deleteOnExit() { + class DeleteOnExitHook implements Runnable { + public void run() { + DeleteOnExit.deleteOnExit(); + } + } + if (!deleteOnExit) { + deleteOnExit = true; + Runtime.getRuntime().addShutdownHook(new Thread(new DeleteOnExitHook())); + } + } +} diff --git a/vm/vmcore/src/kernel_classes/native/com_ibm_oti_vm_VM.cpp b/vm/vmcore/src/kernel_classes/native/com_ibm_oti_vm_VM.cpp deleted file mode 100755 index 2e4cc00..0000000 --- a/vm/vmcore/src/kernel_classes/native/com_ibm_oti_vm_VM.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @author Euguene Ostrovsky - * @version $Revision: 1.1.2.1.4.6 $ - */ - -/** - * @file com_ibm_oti_vm_VM.cpp - * - * This file is a part of kernel class natives VM core component. - * It contains implementation for native methods of com.ibm.oti.vm.VM kernel - * class. Not all of the methods are implemented now. - */ - -#include - -#define LOG_DOMAIN "vm.accessors" -#include "jni_utils.h" - -#include "com_ibm_oti_vm_VM.h" -#include "java_lang_VMClassRegistry.h" - -/** - * Implements java.lang.String.intern(..) method. - * For details see kernel classes component documentation. - */ -JNIEXPORT jobject JNICALL Java_com_ibm_oti_vm_VM_getClassLoader -(JNIEnv *jenv, jclass, jclass clazz) -{ - // reuse similar method in VMClassRegistry - return Java_java_lang_VMClassRegistry_getClassLoader(jenv, NULL, clazz); -} diff --git a/vm/vmcore/src/kernel_classes/native/com_ibm_oti_vm_VM.h b/vm/vmcore/src/kernel_classes/native/com_ibm_oti_vm_VM.h deleted file mode 100755 index 801555c..0000000 --- a/vm/vmcore/src/kernel_classes/native/com_ibm_oti_vm_VM.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @author Euguene Ostrovsky - * @version $Revision: 1.1.2.1.4.6 $ - */ - -/* - * THE FILE HAS BEEN AUTOGENERATED BY INTEL IJH TOOL. - * Please be aware that all changes made to this file manually - * will be overwritten by the tool if it runs again. - */ - -#include - - -/* Header for class com.ibm.oti.vm.VM */ - -#ifndef _COM_IBM_OTI_VM_VM_H -#define _COM_IBM_OTI_VM_VM_H - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Native methods */ - -/* - * Method: com.ibm.oti.vm.VM.getClassLoader(Ljava/lang/Class;)Ljava/lang/ClassLoader; - */ -JNIEXPORT jobject JNICALL -Java_com_ibm_oti_vm_VM_getClassLoader(JNIEnv *, jclass, - jclass); - - -#ifdef __cplusplus -} -#endif - -#endif /* _COM_IBM_OTI_VM_VM_H */ - diff --git a/vm/vmcore/src/kernel_classes/native/org_apache_harmony_kernel_vm_VM.cpp b/vm/vmcore/src/kernel_classes/native/org_apache_harmony_kernel_vm_VM.cpp new file mode 100644 index 0000000..2e73033 --- /dev/null +++ b/vm/vmcore/src/kernel_classes/native/org_apache_harmony_kernel_vm_VM.cpp @@ -0,0 +1,46 @@ +/* + * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @author Euguene Ostrovsky + * @version $Revision: 1.1.2.2 $ + */ + +/** + * @file org_apache_harmony_kernel_vm_VM.cpp + * + * This file is a part of kernel class natives VM core component. + * It contains implementation for native methods of com.ibm.oti.vm.VM kernel + * class. Not all of the methods are implemented now. + */ + +#include + +#define LOG_DOMAIN "vm.accessors" +#include "jni_utils.h" + +#include "org_apache_harmony_kernel_vm_VM.h" +#include "java_lang_VMClassRegistry.h" + +/** + * Implements java.lang.String.intern(..) method. + * For details see kernel classes component documentation. + */ +JNIEXPORT jobject JNICALL Java_org_apache_harmony_kernel_vm_VM_getClassLoader +(JNIEnv *jenv, jclass, jclass clazz) +{ + // reuse similar method in VMClassRegistry + return Java_java_lang_VMClassRegistry_getClassLoader(jenv, NULL, clazz); +} diff --git a/vm/vmcore/src/kernel_classes/native/org_apache_harmony_kernel_vm_VM.h b/vm/vmcore/src/kernel_classes/native/org_apache_harmony_kernel_vm_VM.h new file mode 100644 index 0000000..37f1ee2 --- /dev/null +++ b/vm/vmcore/src/kernel_classes/native/org_apache_harmony_kernel_vm_VM.h @@ -0,0 +1,47 @@ +/* + * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @author Euguene Ostrovsky + * @version $Revision: 1.1.2.1 $ + */ + +/* + * THE FILE HAS BEEN AUTOGENERATED BY INTEL IJH TOOL. + * Please be aware that all changes made to this file manually + * will be overwritten by the tool if it runs again. + */ + +#include +/* Header for class com.ibm.oti.vm.VM */ + +#ifndef _Included_org_apache_harmony_kernel_vm_VM +#define _Included_org_apache_harmony_kernel_vm_VM +#ifdef __cplusplus +extern "C" { +#endif + +/* Native methods */ + +/* + * Method: com.ibm.oti.vm.VM.getClassLoader(Ljava/lang/Class;)Ljava/lang/ClassLoader; + */ +JNIEXPORT jobject JNICALL Java_org_apache_harmony_kernel_vm_VM_getClassLoader(JNIEnv *, jclass, + jclass); + +#ifdef __cplusplus +} +#endif +#endif -- 1.3.3.gfd40