jamvm

changeset 398:6476eceedae8

Comment out Java code that won't compile with OpenJDK's class library.

2008-08-04 Andrew John Hughes <gnu_andrew@member.fsf.org>

* lib/java/lang/VMClassLoader.java,
* lib/java/lang/VMRuntime.java,
* lib/java/lang/VMThread.java,
* lib/java/security/VMAccessController.java:
Remove GNU Classpath specific code through commenting.
author andrew
date Tue Aug 05 04:04:18 2008 +0100 (2008-08-05)
parents 9e2432d9a77d
children 2b94bfbe7ec6
files .hgignore ChangeLog lib/java/lang/VMClassLoader.java lib/java/lang/VMRuntime.java lib/java/lang/VMThread.java lib/java/security/VMAccessController.java
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/.hgignore	Tue Aug 05 04:04:18 2008 +0100
     1.3 @@ -0,0 +1,2 @@
     1.4 +patches
     1.5 +tmp
     2.1 --- a/ChangeLog	Sun Aug 03 17:23:33 2008 +0000
     2.2 +++ b/ChangeLog	Tue Aug 05 04:04:18 2008 +0100
     2.3 @@ -1,2 +1,13 @@
     2.4  Please refer to the NEWS file for details of changes
     2.5  between releases.
     2.6 +
     2.7 +CVMI ChangeLog
     2.8 +==============
     2.9 +2008-08-04  Andrew John Hughes  <gnu_andrew@member.fsf.org>
    2.10 +
    2.11 +	* lib/java/lang/VMClassLoader.java,
    2.12 +	* lib/java/lang/VMRuntime.java,
    2.13 +	* lib/java/lang/VMThread.java,
    2.14 +	* lib/java/security/VMAccessController.java:
    2.15 +	Remove GNU Classpath specific code through commenting.
    2.16 +
     3.1 --- a/lib/java/lang/VMClassLoader.java	Sun Aug 03 17:23:33 2008 +0000
     3.2 +++ b/lib/java/lang/VMClassLoader.java	Tue Aug 05 04:04:18 2008 +0100
     3.3 @@ -44,10 +44,14 @@
     3.4  
     3.5  package java.lang;
     3.6  
     3.7 +/*
     3.8  import gnu.classpath.Configuration;
     3.9  import gnu.classpath.SystemProperties;
    3.10  import gnu.java.lang.InstrumentationImpl;
    3.11  
    3.12 +Removed to allow building against OpenJDK
    3.13 +Andrew John Hughes - July 2008
    3.14 +*/
    3.15  import java.io.BufferedReader;
    3.16  import java.io.IOException;
    3.17  import java.io.InputStreamReader;
    3.18 @@ -86,12 +90,19 @@
    3.19      
    3.20      if( packages != null)
    3.21        {
    3.22 +	/* Changed to work with OpenJDK
    3.23 +	   Not the same as these calls include security checks.
    3.24 +	   Andrew John Hughes - July 2008
    3.25 +	*/
    3.26          String specName = 
    3.27 -              SystemProperties.getProperty("java.specification.name");
    3.28 +	  //SystemProperties.getProperty("java.specification.name");
    3.29 +	  System.getProperty("java.specification.name");  
    3.30          String vendor =
    3.31 -              SystemProperties.getProperty("java.specification.vendor");
    3.32 +	  //SystemProperties.getProperty("java.specification.vendor");
    3.33 +              System.getProperty("java.specification.vendor");
    3.34          String version =
    3.35 -              SystemProperties.getProperty("java.specification.version");
    3.36 +	  //SystemProperties.getProperty("java.specification.version");
    3.37 +              System.getProperty("java.specification.version");
    3.38          
    3.39          Package p;
    3.40                
    3.41 @@ -101,9 +112,14 @@
    3.42                    specName,
    3.43                    vendor,
    3.44                    version,
    3.45 +			    /* Changed to support OpenJDK
    3.46                    "GNU Classpath",
    3.47                    "GNU",
    3.48                    Configuration.CLASSPATH_VERSION,
    3.49 +			    */
    3.50 +			    "OpenJDK Common VM Interface",
    3.51 +			    "Andrew John Hughes",
    3.52 +			    "0.01",
    3.53                    null,
    3.54                    null);
    3.55  
    3.56 @@ -321,10 +337,14 @@
    3.57      return new HashMap();
    3.58    }
    3.59  
    3.60 +  /*
    3.61 +Removed to allow building against OpenJDK
    3.62 +Andrew John Hughes - July 2008
    3.63    static ClassLoader getSystemClassLoader()
    3.64    {
    3.65      return ClassLoader.defaultGetSystemClassLoader();
    3.66    }
    3.67 +  */
    3.68  
    3.69    /**
    3.70     * Find the class if this class loader previously defined this class
    3.71 @@ -361,12 +381,16 @@
    3.72        {
    3.73          byte[] modifiedData = new byte[len];
    3.74          System.arraycopy(data, offset, modifiedData, 0, len);
    3.75 +	/*
    3.76 +Removed to allow building against OpenJDK
    3.77 +Andrew John Hughes - July 2008
    3.78          modifiedData =
    3.79            ((InstrumentationImpl)instrumenter).callTransformers(loader, name,
    3.80              null, pd, modifiedData);
    3.81 -        
    3.82          return defineClass(loader, name, modifiedData, 0, modifiedData.length,
    3.83              pd);
    3.84 +	*/
    3.85 +	throw new InternalError("No transformers called.");
    3.86        }
    3.87      else
    3.88        {
     4.1 --- a/lib/java/lang/VMRuntime.java	Sun Aug 03 17:23:33 2008 +0000
     4.2 +++ b/lib/java/lang/VMRuntime.java	Tue Aug 05 04:04:18 2008 +0100
     4.3 @@ -178,7 +178,12 @@
     4.4       */
     4.5      static Process exec(String[] cmd, String[] env, File dir)
     4.6   	throws IOException {
     4.7 -      return VMProcess.exec(cmd, env, dir);
     4.8 +      throw new InternalError("Process execution not implemented.");
     4.9 +      /*
    4.10 +	Removed to allow building against OpenJDK
    4.11 +	Andrew John Hughes - July 2008
    4.12 +      return VMProcess.exec(cmd, env, dir); 
    4.13 +      */
    4.14      }
    4.15  
    4.16      /**
     5.1 --- a/lib/java/lang/VMThread.java	Sun Aug 03 17:23:33 2008 +0000
     5.2 +++ b/lib/java/lang/VMThread.java	Tue Aug 05 04:04:18 2008 +0100
     5.3 @@ -96,7 +96,12 @@
     5.4       */
     5.5      String getName()
     5.6      {
     5.7 -	return thread.name;
     5.8 +      /*
     5.9 +Removed to allow building against OpenJDK
    5.10 +Andrew John Hughes - July 2008
    5.11 +      return thread.name;
    5.12 +      */
    5.13 +      return thread.getName();
    5.14      }
    5.15  
    5.16      /**
    5.17 @@ -107,7 +112,11 @@
    5.18       */
    5.19      void setName(String name)
    5.20      {
    5.21 +      /**
    5.22 +Removed to allow building against OpenJDK
    5.23 +Andrew John Hughes - July 2008
    5.24  	thread.name = name;
    5.25 +      */
    5.26      }
    5.27  
    5.28      /**
    5.29 @@ -117,8 +126,11 @@
    5.30       * @param priority The new priority
    5.31       */
    5.32      void setPriority(int priority)
    5.33 -    {
    5.34 +    {/**
    5.35 +Removed to allow building against OpenJDK
    5.36 +Andrew John Hughes - July 2008
    5.37  	thread.priority = priority;
    5.38 +     */
    5.39  	nativeSetPriority(priority);
    5.40      }
    5.41  
    5.42 @@ -130,7 +142,12 @@
    5.43       */
    5.44      int getPriority()
    5.45      {
    5.46 +      /*
    5.47 +Removed to allow building against OpenJDK
    5.48 +Andrew John Hughes - July 2008
    5.49          return thread.priority;
    5.50 +      */
    5.51 +      return thread.getPriority();
    5.52      }
    5.53  
    5.54      /**
    5.55 @@ -142,7 +159,12 @@
    5.56       */
    5.57      boolean isDaemon()
    5.58      {
    5.59 +      /*
    5.60 +Removed to allow building against OpenJDK
    5.61 +Andrew John Hughes - July 2008
    5.62          return thread.daemon;
    5.63 +      */
    5.64 +      return thread.isDaemon();
    5.65      }
    5.66  
    5.67      /**
     6.1 --- a/lib/java/security/VMAccessController.java	Sun Aug 03 17:23:33 2008 +0000
     6.2 +++ b/lib/java/security/VMAccessController.java	Tue Aug 05 04:04:18 2008 +0100
     6.3 @@ -231,8 +231,13 @@
     6.4      // Intersect the derived protection domain with the context supplied
     6.5      // to doPrivileged.
     6.6      if (context != null)
     6.7 +      /*
     6.8 +Removed to allow building against OpenJDK
     6.9 +Andrew John Hughes - July 2008
    6.10        context = new AccessControlContext(result, context,
    6.11                                           IntersectingDomainCombiner.SINGLETON);
    6.12 +      */
    6.13 +      throw new InternalError("Can't intersect context with derived protection domain");
    6.14      // No context was supplied. Return the derived one.
    6.15      else
    6.16        context = new AccessControlContext(result);