[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Patch: FYI: minor cleanups in vm/
From: |
Tom Tromey |
Subject: |
[cp-patches] Patch: FYI: minor cleanups in vm/ |
Date: |
04 Jan 2005 17:04:51 -0700 |
I'm checking this in.
This fixes some trivia in vm/, namely modifier ordering and a case
where using 'private' caused unnecessary accessors.
Tom
Index: ChangeLog
from Tom Tromey <address@hidden>
* vm/reference/java/lang/VMProcess.java (VMProcess): Constructor
now package-private.
(processThread, workList, reapedPid, reapedExitValue, state, cmd,
env, dir, exception, pid, stdin, stdout, stderr, exitValue): Now
package-private.
(nativeSpawn, nativeReap): Likewise.
* vm/reference/java/lang/VMThread.java (currentThread): Reordered
modifiers.
* vm/reference/java/security/VMAccessController.java
(DEFAULT_CONTEXT): Reordered modifiers.
Index: vm/reference/java/lang/VMProcess.java
===================================================================
RCS file: /cvsroot/classpath/classpath/vm/reference/java/lang/VMProcess.java,v
retrieving revision 1.4
diff -u -r1.4 VMProcess.java
--- vm/reference/java/lang/VMProcess.java 2 Dec 2004 13:17:21 -0000 1.4
+++ vm/reference/java/lang/VMProcess.java 5 Jan 2005 00:07:19 -0000
@@ -1,5 +1,5 @@
/* java.lang.VMProcess -- VM implementation of java.lang.Process
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -73,27 +73,27 @@
private static final int TERMINATED = 2;
// Dedicated thread that does all the fork()'ing and wait()'ing.
- private static Thread processThread;
+ static Thread processThread;
// New processes waiting to be spawned by processThread.
- private static final LinkedList workList = new LinkedList();
+ static final LinkedList workList = new LinkedList();
// Return values set by nativeReap() when a child is reaped.
// These are only accessed by processThread so no locking required.
- private static long reapedPid;
- private static int reapedExitValue;
+ static long reapedPid;
+ static int reapedExitValue;
// Information about this process
- private int state; // current state of process
- private final String[] cmd; // copied from Runtime.exec()
- private final String[] env; // copied from Runtime.exec()
- private final File dir; // copied from Runtime.exec()
- private Throwable exception; // if process failed to start
- private long pid; // process id
- private OutputStream stdin; // process input stream
- private InputStream stdout; // process output stream
- private InputStream stderr; // process error stream
- private int exitValue; // process exit value
+ int state; // current state of process
+ final String[] cmd; // copied from Runtime.exec()
+ final String[] env; // copied from Runtime.exec()
+ final File dir; // copied from Runtime.exec()
+ Throwable exception; // if process failed to start
+ long pid; // process id
+ OutputStream stdin; // process input stream
+ InputStream stdout; // process output stream
+ InputStream stderr; // process error stream
+ int exitValue; // process exit value
//
// Dedicated thread that does all the fork()'ing and wait()'ing
@@ -115,7 +115,7 @@
// constructor will be private, which means the compiler will have
// to generate a second package-private constructor, which is
// bogus.
- public ProcessThread ()
+ ProcessThread ()
{
}
@@ -349,7 +349,7 @@
*
* @throws IOException if the O/S process could not be created.
*/
- private native void nativeSpawn(String[] cmd, String[] env, File dir)
+ native void nativeSpawn(String[] cmd, String[] env, File dir)
throws IOException;
/**
@@ -360,7 +360,8 @@
*
* @return true if a child was reaped, otherwise false
*/
- private static native boolean nativeReap();
+ // This is not private as it is called from an inner class.
+ static native boolean nativeReap();
/**
* Kill a process. This sends it a fatal signal but does not reap it.
Index: vm/reference/java/lang/VMThread.java
===================================================================
RCS file: /cvsroot/classpath/classpath/vm/reference/java/lang/VMThread.java,v
retrieving revision 1.5
diff -u -r1.5 VMThread.java
--- vm/reference/java/lang/VMThread.java 2 Jan 2005 17:29:34 -0000 1.5
+++ vm/reference/java/lang/VMThread.java 5 Jan 2005 00:07:20 -0000
@@ -1,5 +1,5 @@
/* VMThread -- VM interface for Thread of executable code
- Copyright (C) 2003, 2004 Free Software Foundation
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -345,7 +345,7 @@
*
* @return the currently executing Thread
*/
- native static Thread currentThread();
+ static native Thread currentThread();
/**
* Yield to another thread. The Thread will not lose any locks it holds
Index: vm/reference/java/security/VMAccessController.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/vm/reference/java/security/VMAccessController.java,v
retrieving revision 1.3
diff -u -r1.3 VMAccessController.java
--- vm/reference/java/security/VMAccessController.java 21 Aug 2004 22:51:19
-0000 1.3
+++ vm/reference/java/security/VMAccessController.java 5 Jan 2005 00:07:20 -0000
@@ -1,5 +1,5 @@
/* VMAccessController.java -- VM-specific access controller methods.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -70,7 +70,7 @@
* And we return this all-permissive context to ensure that privileged
* methods called from getContext succeed.
*/
- private final static AccessControlContext DEFAULT_CONTEXT;
+ private static final AccessControlContext DEFAULT_CONTEXT;
static
{
CodeSource source = new CodeSource(null, null);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] Patch: FYI: minor cleanups in vm/,
Tom Tromey <=