From: <ls...@us...> - 2009-03-14 10:45:25
|
Revision: 5101 http://jnode.svn.sourceforge.net/jnode/?rev=5101&view=rev Author: lsantha Date: 2009-03-14 10:45:16 +0000 (Sat, 14 Mar 2009) Log Message: ----------- OpenJDK integration. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/VmSystem.java Added Paths: ----------- trunk/core/src/openjdk/java/java/net/AbstractPlainDatagramSocketImpl.java trunk/core/src/openjdk/java/java/net/AbstractPlainSocketImpl.java trunk/core/src/openjdk/java/java/net/Authenticator.java trunk/core/src/openjdk/java/java/net/ContentHandler.java trunk/core/src/openjdk/java/java/net/DatagramPacket.java trunk/core/src/openjdk/java/java/net/DatagramSocketImpl.java trunk/core/src/openjdk/java/java/net/HttpURLConnection.java trunk/core/src/openjdk/java/java/net/JarURLConnection.java trunk/core/src/openjdk/java/java/net/NetPermission.java trunk/core/src/openjdk/java/java/net/PasswordAuthentication.java trunk/core/src/openjdk/java/java/net/Proxy.java trunk/core/src/openjdk/java/java/net/ProxySelector.java trunk/core/src/openjdk/java/java/net/SocketAddress.java trunk/core/src/openjdk/java/java/net/SocketImpl.java trunk/core/src/openjdk/java/java/net/SocksConsts.java trunk/core/src/openjdk/java/java/net/URLConnection.java trunk/core/src/openjdk/vm/java/net/ trunk/core/src/openjdk/vm/java/net/NativeDatagramPacket.java Removed Paths: ------------- trunk/core/src/classpath/java/java/net/Authenticator.java trunk/core/src/classpath/java/java/net/ContentHandler.java trunk/core/src/classpath/java/java/net/DatagramPacket.java trunk/core/src/classpath/java/java/net/DatagramSocketImpl.java trunk/core/src/classpath/java/java/net/HttpURLConnection.java trunk/core/src/classpath/java/java/net/JarURLConnection.java trunk/core/src/classpath/java/java/net/NetPermission.java trunk/core/src/classpath/java/java/net/PasswordAuthentication.java trunk/core/src/classpath/java/java/net/Proxy.java trunk/core/src/classpath/java/java/net/ProxySelector.java trunk/core/src/classpath/java/java/net/ResolverCache.java trunk/core/src/classpath/java/java/net/SocketAddress.java trunk/core/src/classpath/java/java/net/SocketImpl.java trunk/core/src/classpath/java/java/net/URLConnection.java Deleted: trunk/core/src/classpath/java/java/net/Authenticator.java =================================================================== --- trunk/core/src/classpath/java/java/net/Authenticator.java 2009-03-13 20:43:06 UTC (rev 5100) +++ trunk/core/src/classpath/java/java/net/Authenticator.java 2009-03-14 10:45:16 UTC (rev 5101) @@ -1,313 +0,0 @@ -/* Authenticator.java -- Abstract class for obtaining authentication info - Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.net; - - -/** - * This abstract class provides a model for obtaining authentication - * information (in the form of a username and password) required by - * some network operations (such as hitting a password protected - * web site). - * <p> - * To make use of this feature, a programmer must create a subclass - * that knows how to obtain the necessary info. An example - * would be a class that popped up a dialog box to prompt the user. - * After creating an instance of that subclass, the static - * <code>setDefault</code> method of this class is called to set up - * that instance as the object to use on subsequent calls to obtain - * authorization. - * - * @since 1.2 - * - * @author Aaron M. Renn (ar...@ur...) - * @status Believed to be JDK 1.4 complete - */ -public abstract class Authenticator -{ - /* - * Class Variables - */ - - /** - * This is the default Authenticator object to use for password requests - */ - private static Authenticator defaultAuthenticator; - - /* - * Instance Variables - */ - - /** - * The hostname of the site requesting authentication - */ - private String host; - - /** - * InternetAddress of the site requesting authentication - */ - private InetAddress addr; - - /** - * The port number of the site requesting authentication - */ - private int port; - - /** - * The protocol name of the site requesting authentication - */ - private String protocol; - - /** - * The prompt to display to the user when requesting authentication info - */ - private String prompt; - - /** - * The authentication scheme in use - */ - private String scheme; - - /* - * Class Methods - */ - - /** - * This method sets the default <code>Authenticator</code> object (an - * instance of a subclass of <code>Authenticator</code>) to use when - * prompting the user for - * information. Note that this method checks to see if the caller is - * allowed to set this value (the "setDefaultAuthenticator" permission) - * and throws a <code>SecurityException</code> if it is not. - * - * @param defAuth The new default <code>Authenticator</code> object to use - * - * @exception SecurityException If the caller does not have permission - * to perform this operation - */ - public static void setDefault(Authenticator defAuth) - { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPermission(new NetPermission("setDefaultAuthenticator")); - - defaultAuthenticator = defAuth; - } - - /** - * This method is called whenever a username and password for a given - * network operation is required. First, a security check is made to see - * if the caller has the "requestPasswordAuthentication" - * permission. If not, the method thows an exception. If there is no - * default <code>Authenticator</code> object, the method then returns - * <code>null</code>. Otherwise, the default authenticators's instance - * variables are initialized and it's <code>getPasswordAuthentication</code> - * method is called to get the actual authentication information to return. - * - * @param addr The address requesting authentication - * @param port The port requesting authentication - * @param protocol The protocol requesting authentication - * @param prompt The prompt to display to the user when requesting - * authentication info - * @param scheme The authentication scheme in use - * - * @return A <code>PasswordAuthentication</code> object with the user's - * authentication info. - * - * @exception SecurityException If the caller does not have permission to - * perform this operation - */ - public static PasswordAuthentication requestPasswordAuthentication(InetAddress addr, - int port, - String protocol, - String prompt, - String scheme) - throws SecurityException - { - return requestPasswordAuthentication(null, addr, port, protocol, prompt, - scheme); - } - - /** - * This method is called whenever a username and password for a given - * network operation is required. First, a security check is made to see - * if the caller has the "requestPasswordAuthentication" - * permission. If not, the method thows an exception. If there is no - * default <code>Authenticator</code> object, the method then returns - * <code>null</code>. Otherwise, the default authenticators's instance - * variables are initialized and it's <code>getPasswordAuthentication</code> - * method is called to get the actual authentication information to return. - * This method is the preferred one as it can be used with hostname - * when addr is unknown. - * - * @param host The hostname requesting authentication - * @param addr The address requesting authentication - * @param port The port requesting authentication - * @param protocol The protocol requesting authentication - * @param prompt The prompt to display to the user when requesting - * authentication info - * @param scheme The authentication scheme in use - * - * @return A <code>PasswordAuthentication</code> object with the user's - * authentication info. - * - * @exception SecurityException If the caller does not have permission to - * perform this operation - * - * @since 1.4 - */ - public static PasswordAuthentication requestPasswordAuthentication(String host, - InetAddress addr, - int port, - String protocol, - String prompt, - String scheme) - throws SecurityException - { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPermission(new NetPermission("requestPasswordAuthentication")); - - if (defaultAuthenticator == null) - return null; - - defaultAuthenticator.host = host; - defaultAuthenticator.addr = addr; - defaultAuthenticator.port = port; - defaultAuthenticator.protocol = protocol; - defaultAuthenticator.prompt = prompt; - defaultAuthenticator.scheme = scheme; - - return defaultAuthenticator.getPasswordAuthentication(); - } - - /* - * Constructors - */ - - /** - * Default, no-argument constructor for subclasses to call. - */ - public Authenticator() - { - } - - /* - * Instance Methods - */ - - /** - * This method returns the address of the site that is requesting - * authentication. - * - * @return The requesting site's address - */ - protected final InetAddress getRequestingSite() - { - return addr; - } - - /** - * Returns the hostname of the host or proxy requesting authorization, - * or <code>null</code> if not available. - * - * @return The name of the host requesting authentication, or - * <code>null</code> if it is not available. - * - * @since 1.4 - */ - protected final String getRequestingHost() - { - return host; - } - - /** - * This method returns the port of the site that is requesting - * authentication. - * - * @return The requesting port - */ - protected final int getRequestingPort() - { - return port; - } - - /** - * This method returns the requesting protocol of the operation that is - * requesting authentication - * - * @return The requesting protocol - */ - protected final String getRequestingProtocol() - { - return protocol; - } - - /** - * Returns the prompt that should be used when requesting authentication - * information from the user - * - * @return The user prompt - */ - protected final String getRequestingPrompt() - { - return prompt; - } - - /** - * This method returns the authentication scheme in use - * - * @return The authentication scheme - */ - protected final String getRequestingScheme() - { - return scheme; - } - - /** - * This method is called whenever a request for authentication is made. It - * can call the other getXXX methods to determine the information relevant - * to this request. Subclasses should override this method, which returns - * <code>null</code> by default. - * - * @return The <code>PasswordAuthentication</code> information - */ - protected PasswordAuthentication getPasswordAuthentication() - { - return null; - } -} // class Authenticator Deleted: trunk/core/src/classpath/java/java/net/ContentHandler.java =================================================================== --- trunk/core/src/classpath/java/java/net/ContentHandler.java 2009-03-13 20:43:06 UTC (rev 5100) +++ trunk/core/src/classpath/java/java/net/ContentHandler.java 2009-03-14 10:45:16 UTC (rev 5101) @@ -1,126 +0,0 @@ -/* ContentHandler.java -- Abstract class for handling content from URL's - Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.net; - -import java.io.IOException; - -/** - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * Status: Believed complete and correct. - */ - -/** - * This is an abstract class that is the superclass for classes that read - * objects from URL's. Calling the <code>getContent()</code> method in the - * <code>URL</code> class or the <code>URLConnection</code> class will cause - * an instance of a subclass of <code>ContentHandler</code> to be created for - * the MIME type of the object being downloaded from the URL. Thus, this - * class is seldom needed by applications/applets directly, but only - * indirectly through methods in other classes. - * - * @author Aaron M. Renn (ar...@ur...) - * @author Warren Levy (wa...@cy...) - */ -public abstract class ContentHandler -{ - /* - * Constructors - */ - - /** - * Default, no-argument constructor. - */ - public ContentHandler() - { - } - - /* - * Instance Methods - */ - - /** - * This method reads from the <code>InputStream</code> of the passed in URL - * connection and uses the data downloaded to create an <code>Object</code> - * represening the content. For example, if the URL is pointing to a GIF - * file, this method might return an <code>Image</code> object. This method - * must be implemented by subclasses. - * - * @param urlc A <code>URLConnection</code> object to read data from. - * - * @return An object representing the data read - * - * @exception IOException If an error occurs - */ - public abstract Object getContent(URLConnection urlc) - throws IOException; - - /** - * This method reads from the <code>InputStream</code> of the passed in URL - * connection and uses the data downloaded to create an <code>Object</code> - * represening the content. For example, if the URL is pointing to a GIF - * file, this method might return an <code>Image</code> object. This method - * must be implemented by subclasses. This method uses the list of - * supplied classes as candidate types. If the data read doesn't match - * any of the supplied type, <code>null</code> is returned. - * - * @param urlc A <code>URLConnection</code> object to read data from. - * @param classes An array of types of objects that are candidate types - * for the data to be read. - * - * @return An object representing the data read, or <code>null</code> - * if the data does not match any of the candidate types. - * - * @exception IOException If an error occurs - * - * @since 1.3 - */ - public Object getContent(URLConnection urlc, Class[] classes) - throws IOException - { - Object obj = getContent(urlc); - - for (int i = 0; i < classes.length; i++) - { - if (classes[i].isInstance(obj)) - return obj; - } - - return null; - } -} // class ContentHandler Deleted: trunk/core/src/classpath/java/java/net/DatagramPacket.java =================================================================== --- trunk/core/src/classpath/java/java/net/DatagramPacket.java 2009-03-13 20:43:06 UTC (rev 5100) +++ trunk/core/src/classpath/java/java/net/DatagramPacket.java 2009-03-14 10:45:16 UTC (rev 5101) @@ -1,391 +0,0 @@ -/* DatagramPacket.java -- Class to model a packet to be sent via UDP - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.net; - - -/* - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * Status: Believed complete and correct. - */ - -/** - * This class models a packet of data that is to be sent across the network - * using a connectionless protocol such as UDP. It contains the data - * to be send, as well as the destination address and port. Note that - * datagram packets can arrive in any order and are not guaranteed to be - * delivered at all. - * <p> - * This class can also be used for receiving data from the network. - * <p> - * Note that for all method below where the buffer length passed by the - * caller cannot exceed the actually length of the byte array passed as - * the buffer, if this condition is not true, then the method silently - * reduces the length value to maximum allowable value. - * - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * Status: Believed complete and correct. - * - * @author Warren Levy (wa...@cy...) - * @author Aarom M. Renn (ar...@ur...) (Documentation comments) - * @date April 28, 1999. - */ -public final class DatagramPacket -{ - /** - * The data buffer to send - */ - private byte[] buffer; - - /** - * This is the offset into the buffer to start sending from or receiving to. - */ - private int offset; - - /** - * The length of the data buffer to send. - */ - int length; - - /** - * The maximal length of the buffer. - */ - int maxlen; - - /** - * The address to which the packet should be sent or from which it - * was received. - */ - private InetAddress address; - - /** - * The port to which the packet should be sent or from which it was - * was received. - */ - private int port; - - /** - * This method initializes a new instance of <code>DatagramPacket</code> - * which has the specified buffer, offset, and length. - * - * @param buf The buffer for holding the incoming datagram. - * @param offset The offset into the buffer to start writing. - * @param length The maximum number of bytes to read. - * - * @since 1.2 - */ - public DatagramPacket(byte[] buf, int offset, int length) - { - setData(buf, offset, length); - address = null; - port = -1; - } - - /** - * Initializes a new instance of <code>DatagramPacket</code> for - * receiving packets from the network. - * - * @param buf A buffer for storing the returned packet data - * @param length The length of the buffer (must be <= buf.length) - */ - public DatagramPacket(byte[] buf, int length) - { - this(buf, 0, length); - } - - /** - * Initializes a new instance of <code>DatagramPacket</code> for - * transmitting packets across the network. - * - * @param buf A buffer containing the data to send - * @param offset The offset into the buffer to start writing from. - * @param length The length of the buffer (must be <= buf.length) - * @param address The address to send to - * @param port The port to send to - * - * @since 1.2 - */ - public DatagramPacket(byte[] buf, int offset, int length, - InetAddress address, int port) - { - setData(buf, offset, length); - setAddress(address); - setPort(port); - } - - /** - * Initializes a new instance of <code>DatagramPacket</code> for - * transmitting packets across the network. - * - * @param buf A buffer containing the data to send - * @param length The length of the buffer (must be <= buf.length) - * @param address The address to send to - * @param port The port to send to - */ - public DatagramPacket(byte[] buf, int length, InetAddress address, int port) - { - this(buf, 0, length, address, port); - } - - /** - * Initializes a new instance of <code>DatagramPacket</code> for - * transmitting packets across the network. - * - * @param buf A buffer containing the data to send - * @param offset The offset into the buffer to start writing from. - * @param length The length of the buffer (must be <= buf.length) - * @param address The socket address to send to - * - * @exception SocketException If an error occurs - * @exception IllegalArgumentException If address type is not supported - * - * @since 1.4 - */ - public DatagramPacket(byte[] buf, int offset, int length, - SocketAddress address) throws SocketException - { - if (! (address instanceof InetSocketAddress)) - throw new IllegalArgumentException("unsupported address type"); - - InetSocketAddress tmp = (InetSocketAddress) address; - setData(buf, offset, length); - setAddress(tmp.getAddress()); - setPort(tmp.getPort()); - } - - /** - * Initializes a new instance of <code>DatagramPacket</code> for - * transmitting packets across the network. - * - * @param buf A buffer containing the data to send - * @param length The length of the buffer (must be <= buf.length) - * @param address The socket address to send to - * - * @exception SocketException If an error occurs - * @exception IllegalArgumentException If address type is not supported - * - * @since 1.4 - */ - public DatagramPacket(byte[] buf, int length, SocketAddress address) - throws SocketException - { - this(buf, 0, length, address); - } - - /** - * Returns the address that this packet is being sent to or, if it was used - * to receive a packet, the address that is was received from. If the - * constructor that doesn not take an address was used to create this object - * and no packet was actually read into this object, then this method - * returns <code>null</code>. - * - * @return The address for this packet. - */ - public synchronized InetAddress getAddress() - { - return address; - } - - /** - * Returns the port number this packet is being sent to or, if it was used - * to receive a packet, the port that it was received from. If the - * constructor that doesn not take an address was used to create this object - * and no packet was actually read into this object, then this method - * will return 0. - * - * @return The port number for this packet - */ - public synchronized int getPort() - { - return port; - } - - /** - * Returns the data buffer for this packet - * - * @return This packet's data buffer - */ - public synchronized byte[] getData() - { - return buffer; - } - - /** - * This method returns the current offset value into the data buffer - * where data will be sent from. - * - * @return The buffer offset. - * - * @since 1.2 - */ - public synchronized int getOffset() - { - return offset; - } - - /** - * Returns the length of the data in the buffer - * - * @return The length of the data - */ - public synchronized int getLength() - { - return length; - } - - /** - * This sets the address to which the data packet will be transmitted. - * - * @param address The destination address - * - * @since 1.1 - */ - public synchronized void setAddress(InetAddress address) - { - this.address = address; - } - - /** - * This sets the port to which the data packet will be transmitted. - * - * @param port The destination port - * - * @since 1.1 - */ - public synchronized void setPort(int port) - { - if (port < 0 || port > 65535) - throw new IllegalArgumentException("Invalid port: " + port); - - this.port = port; - } - - /** - * Sets the address of the remote host this package will be sent - * - * @param address The socket address of the remove host - * - * @exception IllegalArgumentException If address type is not supported - * - * @since 1.4 - */ - public void setSocketAddress(SocketAddress address) - throws IllegalArgumentException - { - if (address == null) - throw new IllegalArgumentException("address may not be null"); - - InetSocketAddress tmp = (InetSocketAddress) address; - this.address = tmp.getAddress(); - this.port = tmp.getPort(); - } - - /** - * Gets the socket address of the host this packet - * will be sent to/is coming from - * - * @return The socket address of the remote host - * - * @since 1.4 - */ - public SocketAddress getSocketAddress() - { - return new InetSocketAddress(address, port); - } - - /** - * Sets the data buffer for this packet. - * - * @param buf The new buffer for this packet - * - * @exception NullPointerException If the argument is null - * - * @since 1.1 - */ - public void setData(byte[] buf) - { - setData(buf, 0, buf.length); - } - - /** - * This method sets the data buffer for the packet. - * - * @param buf The byte array containing the data for this packet. - * @param offset The offset into the buffer to start reading data from. - * @param length The number of bytes of data in the buffer. - * - * @exception NullPointerException If the argument is null - * - * @since 1.2 - */ - public synchronized void setData(byte[] buf, int offset, int length) - { - // This form of setData must be used if offset is to be changed. - if (buf == null) - throw new NullPointerException("Null buffer"); - if (offset < 0) - throw new IllegalArgumentException("Invalid offset: " + offset); - - buffer = buf; - this.offset = offset; - setLength(length); - } - - /** - * Sets the length of the data in the buffer. - * - * @param length The new length. (Where len <= buf.length) - * - * @exception IllegalArgumentException If the length is negative or - * if the length is greater than the packet's data buffer length - * - * @since 1.1 - */ - public synchronized void setLength(int length) - { - if (length < 0) - throw new IllegalArgumentException("Invalid length: " + length); - if (offset + length > buffer.length) - throw new IllegalArgumentException("Potential buffer overflow - offset: " - + offset + " length: " + length); - - this.length = length; - this.maxlen = length; - } -} Deleted: trunk/core/src/classpath/java/java/net/DatagramSocketImpl.java =================================================================== --- trunk/core/src/classpath/java/java/net/DatagramSocketImpl.java 2009-03-13 20:43:06 UTC (rev 5100) +++ trunk/core/src/classpath/java/java/net/DatagramSocketImpl.java 2009-03-14 10:45:16 UTC (rev 5101) @@ -1,296 +0,0 @@ -/* DatagramSocketImpl.java -- Abstract class for UDP socket implementations - Copyright (C) 1998, 1999 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.net; - -import java.io.FileDescriptor; -import java.io.IOException; - - -/** - * This abstract class models a datagram socket implementation. An - * actual implementation class would implement these methods, probably - * via redirecting them to native code. - * <p> - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * <p> - * Status: Believed complete and correct. - * - * @author Aaron M. Renn (ar...@ur...) - * @author Warren Levy (wa...@cy...) - * @since 1.1 - */ -public abstract class DatagramSocketImpl implements SocketOptions -{ - /** - * The local port to which this socket is bound - */ - protected int localPort; - - /** - * The FileDescriptor object for this object. - */ - protected FileDescriptor fd; - - /** - * Default, no-argument constructor for subclasses to call. - */ - public DatagramSocketImpl() - { - } - - /** - * This method binds the socket to the specified local port and address. - * - * @param lport The port number to bind to - * @param laddr The address to bind to - * - * @exception SocketException If an error occurs - */ - protected abstract void bind(int lport, InetAddress laddr) - throws SocketException; - - /** - * This methods closes the socket - */ - protected abstract void close(); - - /** - * Creates a new datagram socket. - * - * @exception SocketException If an error occurs - */ - protected abstract void create() throws SocketException; - - /** - * Takes a peek at the next packet received in order to retrieve the - * address of the sender - * - * @param i The <code>InetAddress</code> to fill in with the information - * about the sender if the next packet - * - * @return The port number of the sender of the packet - * - * @exception IOException If an error occurs - * @exception PortUnreachableException May be thrown if the socket is - * connected to a currently unreachable destination. Note, there is no - * guarantee that the exception will be thrown. - */ - protected abstract int peek(InetAddress i) throws IOException; - - /** - * Takes a peek at the next packet received. This packet is not consumed. - * With the next peekData/receive operation this packet will be read again. - * - * @param p The <code>DatagramPacket</code> to fill in with the data sent. - * - * @return The port number of the sender of the packet. - * - * @exception IOException If an error occurs - * @exception PortUnreachableException May be thrown if the socket is - * connected to a currently unreachable destination. Note, there is no - * guarantee that the exception will be thrown. - * - * @since 1.4 - */ - protected abstract int peekData(DatagramPacket p) throws IOException; - - /** - * Transmits the specified packet of data to the network. The destination - * host and port should be encoded in the packet. - * - * @param p The packet to send - * - * @exception IOException If an error occurs - * @exception PortUnreachableException May be thrown if the socket is - * connected to a currently unreachable destination. Note, there is no - * guarantee that the exception will be thrown. - */ - protected abstract void send(DatagramPacket p) throws IOException; - - /** - * Receives a packet of data from the network Will block until a packet - * arrives. The packet info in populated into the passed in - * <code>DatagramPacket</code> object. - * - * @param p A place to store the incoming packet. - * - * @exception IOException If an error occurs - * @exception PortUnreachableException May be thrown if the socket is - * connected to a currently unreachable destination. Note, there is no - * guarantee that the exception will be thrown. - */ - protected abstract void receive(DatagramPacket p) throws IOException; - - /** - * Connects the socket to a host specified by address and port. - * - * @param address The <code>InetAddress</code> of the host to connect to - * @param port The port number of the host to connect to - * - * @exception SocketException If an error occurs - * - * @since 1.4 - */ - protected void connect(InetAddress address, int port) - throws SocketException - { - // This method has to be overwritten by real implementations - } - - /** - * Disconnects the socket. - * - * @since 1.4 - */ - protected void disconnect() - { - // This method has to be overwritten by real implementations - } - - /** - * Sets the Time to Live (TTL) setting on this socket to the specified - * value. <b>Use <code>setTimeToLive(int)</code></b> instead. - * - * @param ttl The new Time to Live value - * - * @exception IOException If an error occurs - * @deprecated - */ - protected abstract void setTTL(byte ttl) throws IOException; - - /** - * This method returns the current Time to Live (TTL) setting on this - * socket. <b>Use <code>getTimeToLive()</code></b> instead. - * - * @return the current time-to-live - * - * @exception IOException If an error occurs - * - * @deprecated // FIXME: when ? - */ - protected abstract byte getTTL() throws IOException; - - /** - * Sets the Time to Live (TTL) setting on this socket to the specified - * value. - * - * @param ttl The new Time to Live value - * - * @exception IOException If an error occurs - */ - protected abstract void setTimeToLive(int ttl) throws IOException; - - /** - * This method returns the current Time to Live (TTL) setting on this - * socket. - * - * @return the current time-to-live - * - * @exception IOException If an error occurs - */ - protected abstract int getTimeToLive() throws IOException; - - /** - * Causes this socket to join the specified multicast group - * - * @param inetaddr The multicast address to join with - * - * @exception IOException If an error occurs - */ - protected abstract void join(InetAddress inetaddr) throws IOException; - - /** - * Causes the socket to leave the specified multicast group. - * - * @param inetaddr The multicast address to leave - * - * @exception IOException If an error occurs - */ - protected abstract void leave(InetAddress inetaddr) throws IOException; - - /** - * Causes this socket to join the specified multicast group on a specified - * device - * - * @param mcastaddr The address to leave - * @param netIf The specified network interface to join the group at - * - * @exception IOException If an error occurs - * - * @since 1.4 - */ - protected abstract void joinGroup(SocketAddress mcastaddr, - NetworkInterface netIf) - throws IOException; - - /** - * Leaves a multicast group - * - * @param mcastaddr The address to join - * @param netIf The specified network interface to leave the group at - * - * @exception IOException If an error occurs - * - * @since 1.4 - */ - protected abstract void leaveGroup(SocketAddress mcastaddr, - NetworkInterface netIf) - throws IOException; - - /** - * Returns the FileDescriptor for this socket - * - * @return the file descriptor associated with this socket - */ - protected FileDescriptor getFileDescriptor() - { - return fd; - } - - /** - * Returns the local port this socket is bound to - * - * @return the local port - */ - protected int getLocalPort() - { - return localPort; - } -} Deleted: trunk/core/src/classpath/java/java/net/HttpURLConnection.java =================================================================== --- trunk/core/src/classpath/java/java/net/HttpURLConnection.java 2009-03-13 20:43:06 UTC (rev 5100) +++ trunk/core/src/classpath/java/java/net/HttpURLConnection.java 2009-03-14 10:45:16 UTC (rev 5101) @@ -1,598 +0,0 @@ -/* HttpURLConnection.java -- Subclass of communications links using - Hypertext Transfer Protocol. - Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.net; - -import java.io.IOException; -import java.io.InputStream; -import java.io.PushbackInputStream; -import java.security.Permission; - - -/* - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * Status: Believed complete and correct. - */ - -/** - * This class provides a common abstract implementation for those - * URL connection classes that will connect using the HTTP protocol. - * In addition to the functionality provided by the URLConnection - * class, it defines constants for HTTP return code values and - * methods for setting the HTTP request method and determining whether - * or not to follow redirects. - * - * @since 1.1 - * - * @author Warren Levy (wa...@cy...) - * @author Aaron M. Renn (ar...@ur...) - */ -public abstract class HttpURLConnection extends URLConnection -{ - /* HTTP Success Response Codes */ - - /** - * Indicates that the client may continue with its request. This value - * is specified as part of RFC 2068 but was not included in Sun's JDK, so - * beware of using this value - */ - static final int HTTP_CONTINUE = 100; - - /** - * Indicates the request succeeded. - */ - public static final int HTTP_OK = 200; - - /** - * The requested resource has been created. - */ - public static final int HTTP_CREATED = 201; - - /** - * The request has been accepted for processing but has not completed. - * There is no guarantee that the requested action will actually ever - * be completed succesfully, but everything is ok so far. - */ - public static final int HTTP_ACCEPTED = 202; - - /** - * The meta-information returned in the header is not the actual data - * from the original server, but may be from a local or other copy. - * Normally this still indicates a successful completion. - */ - public static final int HTTP_NOT_AUTHORITATIVE = 203; - - /** - * The server performed the request, but there is no data to send - * back. This indicates that the user's display should not be changed. - */ - public static final int HTTP_NO_CONTENT = 204; - - /** - * The server performed the request, but there is no data to sent back, - * however, the user's display should be "reset" to clear out any form - * fields entered. - */ - public static final int HTTP_RESET = 205; - - /** - * The server completed the partial GET request for the resource. - */ - public static final int HTTP_PARTIAL = 206; - - /* HTTP Redirection Response Codes */ - - /** - * There is a list of choices available for the requested resource. - */ - public static final int HTTP_MULT_CHOICE = 300; - - /** - * The resource has been permanently moved to a new location. - */ - public static final int HTTP_MOVED_PERM = 301; - - /** - * The resource requested has been temporarily moved to a new location. - */ - public static final int HTTP_MOVED_TEMP = 302; - - /** - * The response to the request issued is available at another location. - */ - public static final int HTTP_SEE_OTHER = 303; - - /** - * The document has not been modified since the criteria specified in - * a conditional GET. - */ - public static final int HTTP_NOT_MODIFIED = 304; - - /** - * The requested resource needs to be accessed through a proxy. - */ - public static final int HTTP_USE_PROXY = 305; - - /* HTTP Client Error Response Codes */ - - /** - * The request was misformed or could not be understood. - */ - public static final int HTTP_BAD_REQUEST = 400; - - /** - * The request made requires user authorization. Try again with - * a correct authentication header. - */ - public static final int HTTP_UNAUTHORIZED = 401; - - /** - * Code reserved for future use - I hope way in the future. - */ - public static final int HTTP_PAYMENT_REQUIRED = 402; - - /** - * There is no permission to access the requested resource. - */ - public static final int HTTP_FORBIDDEN = 403; - - /** - * The requested resource was not found. - */ - public static final int HTTP_NOT_FOUND = 404; - - /** - * The specified request method is not allowed for this resource. - */ - public static final int HTTP_BAD_METHOD = 405; - - /** - * Based on the input headers sent, the resource returned in response - * to the request would not be acceptable to the client. - */ - public static final int HTTP_NOT_ACCEPTABLE = 406; - - /** - * The client must authenticate with a proxy prior to attempting this - * request. - */ - public static final int HTTP_PROXY_AUTH = 407; - - /** - * The request timed out. - */ - public static final int HTTP_CLIENT_TIMEOUT = 408; - - /** - * There is a conflict between the current state of the resource and the - * requested action. - */ - public static final int HTTP_CONFLICT = 409; - - /** - * The requested resource is no longer available. This ususally indicates - * a permanent condition. - */ - public static final int HTTP_GONE = 410; - - /** - * A Content-Length header is required for this request, but was not - * supplied. - */ - public static final int HTTP_LENGTH_REQUIRED = 411; - - /** - * A client specified pre-condition was not met on the server. - */ - public static final int HTTP_PRECON_FAILED = 412; - - /** - * The request sent was too large for the server to handle. - */ - public static final int HTTP_ENTITY_TOO_LARGE = 413; - - /** - * The name of the resource specified was too long. - */ - public static final int HTTP_REQ_TOO_LONG = 414; - - /** - * The request is in a format not supported by the requested resource. - */ - public static final int HTTP_UNSUPPORTED_TYPE = 415; - - /* HTTP Server Error Response Codes */ - - /** - * This error code indicates that some sort of server error occurred. - * - * @deprecated - */ - public static final int HTTP_SERVER_ERROR = 500; - - /** - * The server encountered an unexpected error (such as a CGI script crash) - * that prevents the request from being fulfilled. - */ - public static final int HTTP_INTERNAL_ERROR = 500; - - /** - * The server does not support the requested functionality. - * @since 1.3 - */ - public static final int HTTP_NOT_IMPLEMENTED = 501; - - /** - * The proxy encountered a bad response from the server it was proxy-ing for - */ - public static final int HTTP_BAD_GATEWAY = 502; - - /** - * The HTTP service is not availalble, such as because it is overloaded - * and does not want additional requests. - */ - public static final int HTTP_UNAVAILABLE = 503; - - /** - * The proxy timed out getting a reply from the remote server it was - * proxy-ing for. - */ - public static final int HTTP_GATEWAY_TIMEOUT = 504; - - /** - * This server does not support the protocol version requested. - */ - public static final int HTTP_VERSION = 505; - - // Non-HTTP response static variables - - /** - * Flag to indicate whether or not redirects should be automatically - * followed by default. - */ - private static boolean followRedirects = true; - - /** - * This is a list of valid request methods, separated by "|" characters. - */ - private static final String valid_methods = - "|GET|POST|HEAD|OPTIONS|PUT|DELETE|TRACE|"; - - // Instance Variables - - /** - * The requested method in use for this connection. Default is GET. - */ - protected String method = "GET"; - - /** - * The response code received from the server - */ - protected int responseCode = -1; - - /** - * The response message string received from the server. - */ - protected String responseMessage; - - /** - * If this instance should follow redirect requests. - */ - protected boolean instanceFollowRedirects = followRedirects; - - /** - * Whether we already got a valid response code for this connection. - * Used by <code>getResponseCode()</code> and - * <code>getResponseMessage()</code>. - */ - private boolean gotResponseVals; - - /** - * Create an HttpURLConnection for the specified URL - * - * @param url The URL to create this connection for. - */ - protected HttpURLConnection(URL url) - { - super(url); - } - - /** - * Closes the connection to the server. - */ - public abstract void disconnect(); - - /** - * Returns a boolean indicating whether or not this connection is going - * through a proxy - * - * @return true if through a proxy, false otherwise - */ - public abstract boolean usingProxy(); - - /** - * Sets whether HTTP redirects (requests with response code 3xx) should be - * automatically followed by this class. True by default - * - * @param set true if redirects should be followed, false otherwis. - * - * @exception SecurityException If a security manager exists and its - * checkSetFactory method doesn't allow the operation - */ - public static void setFollowRedirects(boolean set) - { - // Throw an exception if an extant security mgr precludes - // setting the factory. - SecurityManager s = System.getSecurityManager(); - if (s != null) - s.checkSetFactory(); - - followRedirects = set; - } - - /** - * Returns a boolean indicating whether or not HTTP redirects will - * automatically be followed or not. - * - * @return true if redirects will be followed, false otherwise - */ - public static boolean getFollowRedirects() - { - return followRedirects; - } - - /** - * Returns the value of this HttpURLConnection's instanceFollowRedirects - * field - * - * @return true if following redirects is enabled, false otherwise - */ - public boolean getInstanceFollowRedirects() - { - return instanceFollowRedirects; - } - - /** - * Sets the value of this HttpURLConnection's instanceFollowRedirects field - * - * @param follow true to enable following redirects, false otherwise - */ - public void setInstanceFollowRedirects(boolean follow) - { - instanceFollowRedirects = follow; - } - - /** - * Set the method for the URL request, one of: - * GET POST HEAD OPTIONS PUT DELETE TRACE are legal - * - * @param method the method to use - * - * @exception ProtocolException If the method cannot be reset or if the - * requested method isn't valid for HTTP - */ - public void setRequestMethod(String method) throws ProtocolException - { - if (connected) - throw new ProtocolException("Already connected"); - - method = method.toUpperCase(); - if (valid_methods.indexOf("|" + method + "|") != -1) - this.method = method; - else - throw new ProtocolException("Invalid HTTP request method: " + method); - } - - /** - * The request method currently in use for this connection. - * - * @return The request method - */ - public String getRequestMethod() - { - return method; - } - - /** - * Gets the status code from an HTTP response message, or -1 if - * the response code could not be determined. - * Note that all valid response codes have class variables - * defined for them in this class. - * - * @return The response code - * - * @exception IOException If an error occurs - */ - public int getResponseCode() throws IOException - { - if (! gotResponseVals) - getResponseVals(); - return responseCode; - } - - /** - * Gets the HTTP response message, if any, returned along with the - * response code from a server. Null if no response message was set - * or an error occured while connecting. - * - * @return The response message - * - * @exception IOException If an error occurs - */ - public String getResponseMessage() throws IOException - { - if (! gotResponseVals) - getResponseVals(); - return responseMessage; - } - - private void getResponseVals() throws IOException - { - // getHeaderField() will connect for us, but do it here first in - // order to pick up IOExceptions. - if (! connected) - connect(); - - gotResponseVals = true; - - // If responseCode not yet explicitly set by subclass - if (responseCode == -1) - { - // Response is the first header received from the connection. - String respField = getHeaderField(0); - - if (respField == null || ! respField.startsWith("HTTP/")) - { - // Set to default values on failure. - responseCode = -1; - responseMessage = null; - return; - } - - int firstSpc; - int nextSpc; - firstSpc = respField.indexOf(' '); - nextSpc = respField.indexOf(' ', firstSpc + 1); - responseMessage = respField.substring(nextSpc + 1); - String codeStr = respField.substring(firstSpc + 1, nextSpc); - try - { - responseCode = Integer.parseInt(codeStr); - } - catch (NumberFormatException e) - { - // Set to default values on failure. - responseCode = -1; - responseMessage = null; - } - } - } - - /** - * Returns a permission object representing the permission necessary to make - * the connection represented by this object - * - * @return the permission necessary for this connection - * - * @exception IOException If an error occurs - */ - public Permission getPermission() throws IOException - { - URL url = getURL(); - String host = url.getHost(); - int port = url.getPort(); - if (port == -1) - port = 80; - - host = host + ":" + port; - - return new SocketPermission(host, "connect"); - } - - /** - * This method allows the caller to retrieve any data that might have - * been sent despite the fact that an error occurred. For example, the - * HTML page sent along with a 404 File Not Found error. If the socket - * is not connected, or if no error occurred or no data was returned, - * this method returns <code>null</code>. - * - * @return An <code>InputStream</code> for reading error data. - */ - public InputStream getErrorStream() - { - if (! connected) - return null; - - int code; - try - { - code = getResponseCode(); - } - catch (IOException e) - { - code = -1; - } - - if (code == -1) - return null; - - if (((code / 100) != 4) || ((code / 100) != 5)) - return null; - - try - { - PushbackInputStream pbis = new PushbackInputStream(getInputStream()); - - int i = pbis.read(); - if (i == -1) - return null; - - pbis.unread(i); - return pbis; - } - catch (IOException e) - { - return null; - } - } - - /** - * Returns the value of the named field parsed as date - * - * @param key the key of the header field - * @param value the default value if the header field is not present - * - * @return the value of the header field - */ - public long getHeaderFieldDate(String key, long value) - { - // FIXME: implement this correctly - // http://www.w3.org/Protocols/HTTP-NG/ng-notes.txt - return super.getHeaderFieldDate(key, value); - } - //jnode openjdk - public void setChunkedStreamingMode(Integer chunkSize) { - //todo implement it - - } - - public void setFixedLengthStreamingMode (int contentLength) { - //todo implement it - } -} Deleted: trunk/core/src/classpath/java/java/net/JarURLConnection.java =================================================================== --- trunk/core/src/classpath/java/java/net/JarURLConnection.java 2009-03-13 20:43:06 UTC (rev 5100) +++ trunk/core/src/classpath/java/java/net/JarURLConnection.java 2009-03-14 10:45:16 UTC (rev 5101) @@ -1,229 +0,0 @@ -/* JarURLConnection.java -- Class for manipulating remote jar files - Copyright (C) 1998, 2002, 2003, 2005 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.net; - -import java.io.IOException; -import java.security.cert.Certificate; -import java.util.jar.Attributes; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.jar.Manifest; - - -/** - * This abstract class represents a common superclass for implementations - * of jar URL's. A jar URL is a special type of URL that allows JAR - * files on remote systems to be accessed. It has the form: - * <p> - * jar:<standard URL pointing to jar filei>!/file/within/jarfile - * <p> for example: - * <p> - * jar:http://www.urbanophile.com/java/foo.jar!/com/urbanophile/bar.class - * <p> - * That example URL points to the file /com/urbanophile/bar.class in the - * remote JAR file http://www.urbanophile.com/java/foo.jar. The HTTP - *... [truncated message content] |
From: <ls...@us...> - 2009-03-21 08:36:38
|
Revision: 5138 http://jnode.svn.sourceforge.net/jnode/?rev=5138&view=rev Author: lsantha Date: 2009-03-21 08:36:28 +0000 (Sat, 21 Mar 2009) Log Message: ----------- OpenJDK integration. Added Paths: ----------- trunk/core/src/openjdk/java/java/nio/charset/CoderMalfunctionError.java trunk/core/src/openjdk/java/java/nio/charset/CoderResult.java trunk/core/src/openjdk/java/java/nio/charset/CodingErrorAction.java trunk/core/src/openjdk/java/java/nio/charset/MalformedInputException.java trunk/core/src/openjdk/java/java/nio/charset/UnmappableCharacterException.java trunk/core/src/openjdk/java/java/nio/charset/spi/ trunk/core/src/openjdk/java/java/nio/charset/spi/CharsetProvider.java trunk/core/src/openjdk/java/java/nio/charset/spi/package.html Removed Paths: ------------- trunk/core/src/classpath/java/java/nio/charset/CoderMalfunctionError.java trunk/core/src/classpath/java/java/nio/charset/CoderResult.java trunk/core/src/classpath/java/java/nio/charset/CodingErrorAction.java trunk/core/src/classpath/java/java/nio/charset/MalformedInputException.java trunk/core/src/classpath/java/java/nio/charset/UnmappableCharacterException.java trunk/core/src/classpath/java/java/nio/charset/spi/ Deleted: trunk/core/src/classpath/java/java/nio/charset/CoderMalfunctionError.java =================================================================== --- trunk/core/src/classpath/java/java/nio/charset/CoderMalfunctionError.java 2009-03-21 04:33:32 UTC (rev 5137) +++ trunk/core/src/classpath/java/java/nio/charset/CoderMalfunctionError.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -1,54 +0,0 @@ -/* CoderMalfunctionError.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.charset; - -/** - * @since 1.4 - */ -public class CoderMalfunctionError extends Error -{ - private static final long serialVersionUID = - 1151412348057794301L; - - /** - * Creates the error - */ - public CoderMalfunctionError(Exception cause) - { - super (cause); - } -} Deleted: trunk/core/src/classpath/java/java/nio/charset/CoderResult.java =================================================================== --- trunk/core/src/classpath/java/java/nio/charset/CoderResult.java 2009-03-21 04:33:32 UTC (rev 5137) +++ trunk/core/src/classpath/java/java/nio/charset/CoderResult.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -1,189 +0,0 @@ -/* CoderResult.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.charset; - -import java.lang.ref.WeakReference; -import java.nio.BufferOverflowException; -import java.nio.BufferUnderflowException; -import java.util.HashMap; - -/** - * @author Jesse Rosenstock - * @since 1.4 - */ -public class CoderResult -{ - private static final int TYPE_MALFORMED = 0; - private static final int TYPE_OVERFLOW = 1; - private static final int TYPE_UNDERFLOW = 2; - private static final int TYPE_UNMAPPABLE = 3; - - public static final CoderResult OVERFLOW - = new CoderResult (TYPE_OVERFLOW, 0); - public static final CoderResult UNDERFLOW - = new CoderResult (TYPE_UNDERFLOW, 0); - - private static final String[] names - = { "MALFORMED", "OVERFLOW", "UNDERFLOW", "UNMAPPABLE" }; - - private static final Cache malformedCache - = new Cache () - { - protected CoderResult make (int length) - { - return new CoderResult (TYPE_MALFORMED, length); - } - }; - - private static final Cache unmappableCache - = new Cache () - { - protected CoderResult make (int length) - { - return new CoderResult (TYPE_UNMAPPABLE, length); - } - }; - - private final int type; - private final int length; - - // Package-private to avoid a trampoline constructor. - CoderResult (int type, int length) - { - this.type = type; - this.length = length; - } - - public boolean isError () - { - return length > 0; - } - - public boolean isMalformed () - { - return type == TYPE_MALFORMED; - } - - public boolean isOverflow () - { - return type == TYPE_OVERFLOW; - } - - public boolean isUnderflow () - { - return type == TYPE_UNDERFLOW; - } - - public boolean isUnmappable () - { - return type == TYPE_UNMAPPABLE; - } - - public int length () - { - if (length <= 0) - throw new UnsupportedOperationException (); - else - return length; - } - - public static CoderResult malformedForLength (int length) - { - return malformedCache.get (length); - } - - public void throwException () - throws CharacterCodingException - { - switch (type) - { - case TYPE_MALFORMED: - throw new MalformedInputException (length); - case TYPE_OVERFLOW: - throw new BufferOverflowException (); - case TYPE_UNDERFLOW: - throw new BufferUnderflowException (); - case TYPE_UNMAPPABLE: - throw new UnmappableCharacterException (length); - } - } - - public String toString () - { - String name = names[type]; - return (length > 0) ? name + '[' + length + ']' : name; - } - - public static CoderResult unmappableForLength (int length) - { - return unmappableCache.get (length); - } - - private abstract static class Cache - { - private final HashMap cache; - - // Package-private to avoid a trampoline constructor. - Cache () - { - cache = new HashMap (); - } - - // Package-private to avoid a trampoline. - synchronized CoderResult get (int length) - { - if (length <= 0) - throw new IllegalArgumentException ("Non-positive length"); - - Integer len = new Integer (length); - CoderResult cr = null; - Object o; - if ((o = cache.get (len)) != null) - cr = (CoderResult) ((WeakReference) o).get (); - if (cr == null) - { - cr = make (length); - cache.put (len, new WeakReference (cr)); - } - - return cr; - } - - protected abstract CoderResult make (int length); - } -} Deleted: trunk/core/src/classpath/java/java/nio/charset/CodingErrorAction.java =================================================================== --- trunk/core/src/classpath/java/java/nio/charset/CodingErrorAction.java 2009-03-21 04:33:32 UTC (rev 5137) +++ trunk/core/src/classpath/java/java/nio/charset/CodingErrorAction.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -1,66 +0,0 @@ -/* CodingErrorAction.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.charset; - -public class CodingErrorAction -{ - public static final CodingErrorAction IGNORE - = new CodingErrorAction("ignore"); - public static final CodingErrorAction REPLACE - = new CodingErrorAction("replace"); - public static final CodingErrorAction REPORT - = new CodingErrorAction("report"); - - private final String name; - - /** - * Private constructor only used to create the constant CodingErrorActions. - */ - private CodingErrorAction(String name) - { - this.name = name; - } - - /** - * Returns the name of the CodingErrorAction. - */ - public String toString () - { - return name; - } -} Deleted: trunk/core/src/classpath/java/java/nio/charset/MalformedInputException.java =================================================================== --- trunk/core/src/classpath/java/java/nio/charset/MalformedInputException.java 2009-03-21 04:33:32 UTC (rev 5137) +++ trunk/core/src/classpath/java/java/nio/charset/MalformedInputException.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -1,79 +0,0 @@ -/* MalformedInputException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.charset; - -/** - * @since 1.4 - */ -public class MalformedInputException extends CharacterCodingException -{ - private static final long serialVersionUID = - 3438823399834806194L; - - private int inputLength; - - /** - * Creates the exception - * - * @param inputLength the position of malformed input in the input stream - */ - public MalformedInputException (int inputLength) - { - super (); - this.inputLength = inputLength; - } - - /** - * Retrieves the position of the malformed input in the input stream. - * - * @return the position - */ - public int getInputLength () - { - return inputLength; - } - - /** - * Returns the detail message string of this throwable - * - * @return the message - */ - public String getMessage () - { - return "Input length = " + inputLength; - } -} Deleted: trunk/core/src/classpath/java/java/nio/charset/UnmappableCharacterException.java =================================================================== --- trunk/core/src/classpath/java/java/nio/charset/UnmappableCharacterException.java 2009-03-21 04:33:32 UTC (rev 5137) +++ trunk/core/src/classpath/java/java/nio/charset/UnmappableCharacterException.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -1,73 +0,0 @@ -/* UnmappableCharacterException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.charset; - -/** - * @since 1.4 - */ -public class UnmappableCharacterException extends CharacterCodingException -{ - private static final long serialVersionUID = - 7026962371537706123L; - - private int inputLength; - - /** - * Creates the exception - */ - public UnmappableCharacterException (int inputLength) - { - super (); - this.inputLength = inputLength; - } - - /** - * Retrieves the illegal charset name - */ - public int getInputLength () - { - return inputLength; - } - - /** - * Returns the detail message string of this throwable - */ - public String getMessage () - { - return "Input length = " + inputLength; - } -} Added: trunk/core/src/openjdk/java/java/nio/charset/CoderMalfunctionError.java =================================================================== --- trunk/core/src/openjdk/java/java/nio/charset/CoderMalfunctionError.java (rev 0) +++ trunk/core/src/openjdk/java/java/nio/charset/CoderMalfunctionError.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -0,0 +1,54 @@ +/* + * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.nio.charset; + + +/** + * Error thrown when the {@link CharsetDecoder#decodeLoop decodeLoop} method of + * a {@link CharsetDecoder}, or the {@link CharsetEncoder#encodeLoop + * encodeLoop} method of a {@link CharsetEncoder}, throws an unexpected + * exception. + * + * @since 1.4 + */ + +public class CoderMalfunctionError + extends Error +{ + + private static final long serialVersionUID = -1151412348057794301L; + + /** + * Initializes an instance of this class. + * + * @param cause + * The unexpected exception that was thrown + */ + public CoderMalfunctionError(Exception cause) { + super(cause); + } + +} Added: trunk/core/src/openjdk/java/java/nio/charset/CoderResult.java =================================================================== --- trunk/core/src/openjdk/java/java/nio/charset/CoderResult.java (rev 0) +++ trunk/core/src/openjdk/java/java/nio/charset/CoderResult.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -0,0 +1,284 @@ +/* + * Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.nio.charset; + +import java.lang.ref.WeakReference; +import java.nio.*; +import java.util.Map; +import java.util.HashMap; + + +/** + * A description of the result state of a coder. + * + * <p> A charset coder, that is, either a decoder or an encoder, consumes bytes + * (or characters) from an input buffer, translates them, and writes the + * resulting characters (or bytes) to an output buffer. A coding process + * terminates for one of four categories of reasons, which are described by + * instances of this class: + * + * <ul> + * + * <li><p> <i>Underflow</i> is reported when there is no more input to be + * processed, or there is insufficient input and additional input is + * required. This condition is represented by the unique result object + * {@link #UNDERFLOW}, whose {@link #isUnderflow() isUnderflow} method + * returns <tt>true</tt>. </p></li> + * + * <li><p> <i>Overflow</i> is reported when there is insufficient room + * remaining in the output buffer. This condition is represented by the + * unique result object {@link #OVERFLOW}, whose {@link #isOverflow() + * isOverflow} method returns <tt>true</tt>. </p></li> + * + * <li><p> A <i>malformed-input error</i> is reported when a sequence of + * input units is not well-formed. Such errors are described by instances of + * this class whose {@link #isMalformed() isMalformed} method returns + * <tt>true</tt> and whose {@link #length() length} method returns the length + * of the malformed sequence. There is one unique instance of this class for + * all malformed-input errors of a given length. </p></li> + * + * <li><p> An <i>unmappable-character error</i> is reported when a sequence + * of input units denotes a character that cannot be represented in the + * output charset. Such errors are described by instances of this class + * whose {@link #isUnmappable() isUnmappable} method returns <tt>true</tt> and + * whose {@link #length() length} method returns the length of the input + * sequence denoting the unmappable character. There is one unique instance + * of this class for all unmappable-character errors of a given length. + * </p></li> + * + * </ul> + * + * For convenience, the {@link #isError() isError} method returns <tt>true</tt> + * for result objects that describe malformed-input and unmappable-character + * errors but <tt>false</tt> for those that describe underflow or overflow + * conditions. </p> + * + * + * @author Mark Reinhold + * @author JSR-51 Expert Group + * @since 1.4 + */ + +public class CoderResult { + + private static final int CR_UNDERFLOW = 0; + private static final int CR_OVERFLOW = 1; + private static final int CR_ERROR_MIN = 2; + private static final int CR_MALFORMED = 2; + private static final int CR_UNMAPPABLE = 3; + + private static final String[] names + = { "UNDERFLOW", "OVERFLOW", "MALFORMED", "UNMAPPABLE" }; + + private final int type; + private final int length; + + private CoderResult(int type, int length) { + this.type = type; + this.length = length; + } + + /** + * Returns a string describing this coder result. + * + * @return A descriptive string + */ + public String toString() { + String nm = names[type]; + return isError() ? nm + "[" + length + "]" : nm; + } + + /** + * Tells whether or not this object describes an underflow condition. </p> + * + * @return <tt>true</tt> if, and only if, this object denotes underflow + */ + public boolean isUnderflow() { + return (type == CR_UNDERFLOW); + } + + /** + * Tells whether or not this object describes an overflow condition. </p> + * + * @return <tt>true</tt> if, and only if, this object denotes overflow + */ + public boolean isOverflow() { + return (type == CR_OVERFLOW); + } + + /** + * Tells whether or not this object describes an error condition. </p> + * + * @return <tt>true</tt> if, and only if, this object denotes either a + * malformed-input error or an unmappable-character error + */ + public boolean isError() { + return (type >= CR_ERROR_MIN); + } + + /** + * Tells whether or not this object describes a malformed-input error. + * </p> + * + * @return <tt>true</tt> if, and only if, this object denotes a + * malformed-input error + */ + public boolean isMalformed() { + return (type == CR_MALFORMED); + } + + /** + * Tells whether or not this object describes an unmappable-character + * error. </p> + * + * @return <tt>true</tt> if, and only if, this object denotes an + * unmappable-character error + */ + public boolean isUnmappable() { + return (type == CR_UNMAPPABLE); + } + + /** + * Returns the length of the erroneous input described by this + * object <i>(optional operation)</i>. </p> + * + * @return The length of the erroneous input, a positive integer + * + * @throws UnsupportedOperationException + * If this object does not describe an error condition, that is, + * if the {@link #isError() isError} does not return <tt>true</tt> + */ + public int length() { + if (!isError()) + throw new UnsupportedOperationException(); + return length; + } + + /** + * Result object indicating underflow, meaning that either the input buffer + * has been completely consumed or, if the input buffer is not yet empty, + * that additional input is required. </p> + */ + public static final CoderResult UNDERFLOW + = new CoderResult(CR_UNDERFLOW, 0); + + /** + * Result object indicating overflow, meaning that there is insufficient + * room in the output buffer. </p> + */ + public static final CoderResult OVERFLOW + = new CoderResult(CR_OVERFLOW, 0); + + private static abstract class Cache { + + private Map cache = null; + + protected abstract CoderResult create(int len); + + private synchronized CoderResult get(int len) { + if (len <= 0) + throw new IllegalArgumentException("Non-positive length"); + Integer k = new Integer(len); + WeakReference w; + CoderResult e = null; + if (cache == null) { + cache = new HashMap(); + } else if ((w = (WeakReference)cache.get(k)) != null) { + e = (CoderResult)w.get(); + } + if (e == null) { + e = create(len); + cache.put(k, new WeakReference(e)); + } + return e; + } + + } + + private static Cache malformedCache + = new Cache() { + public CoderResult create(int len) { + return new CoderResult(CR_MALFORMED, len); + }}; + + /** + * Static factory method that returns the unique object describing a + * malformed-input error of the given length. </p> + * + * @return The requested coder-result object + */ + public static CoderResult malformedForLength(int length) { + return malformedCache.get(length); + } + + private static Cache unmappableCache + = new Cache() { + public CoderResult create(int len) { + return new CoderResult(CR_UNMAPPABLE, len); + }}; + + /** + * Static factory method that returns the unique result object describing + * an unmappable-character error of the given length. </p> + * + * @return The requested coder-result object + */ + public static CoderResult unmappableForLength(int length) { + return unmappableCache.get(length); + } + + /** + * Throws an exception appropriate to the result described by this object. + * </p> + * + * @throws BufferUnderflowException + * If this object is {@link #UNDERFLOW} + * + * @throws BufferOverflowException + * If this object is {@link #OVERFLOW} + * + * @throws MalformedInputException + * If this object represents a malformed-input error; the + * exception's length value will be that of this object + * + * @throws UnmappableCharacterException + * If this object represents an unmappable-character error; the + * exceptions length value will be that of this object + */ + public void throwException() + throws CharacterCodingException + { + switch (type) { + case CR_UNDERFLOW: throw new BufferUnderflowException(); + case CR_OVERFLOW: throw new BufferOverflowException(); + case CR_MALFORMED: throw new MalformedInputException(length); + case CR_UNMAPPABLE: throw new UnmappableCharacterException(length); + default: + assert false; + } + } + +} Added: trunk/core/src/openjdk/java/java/nio/charset/CodingErrorAction.java =================================================================== --- trunk/core/src/openjdk/java/java/nio/charset/CodingErrorAction.java (rev 0) +++ trunk/core/src/openjdk/java/java/nio/charset/CodingErrorAction.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -0,0 +1,84 @@ +/* + * Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.nio.charset; + + +/** + * A typesafe enumeration for coding-error actions. + * + * <p> Instances of this class are used to specify how malformed-input and + * unmappable-character errors are to be handled by charset <a + * href="CharsetDecoder.html#cae">decoders</a> and <a + * href="CharsetEncoder.html#cae">encoders</a>. </p> + * + * + * @author Mark Reinhold + * @author JSR-51 Expert Group + * @since 1.4 + */ + +public class CodingErrorAction { + + private String name; + + private CodingErrorAction(String name) { + this.name = name; + } + + /** + * Action indicating that a coding error is to be handled by dropping the + * erroneous input and resuming the coding operation. </p> + */ + public static final CodingErrorAction IGNORE + = new CodingErrorAction("IGNORE"); + + /** + * Action indicating that a coding error is to be handled by dropping the + * erroneous input, appending the coder's replacement value to the output + * buffer, and resuming the coding operation. </p> + */ + public static final CodingErrorAction REPLACE + = new CodingErrorAction("REPLACE"); + + /** + * Action indicating that a coding error is to be reported, either by + * returning a {@link CoderResult} object or by throwing a {@link + * CharacterCodingException}, whichever is appropriate for the method + * implementing the coding process. + */ + public static final CodingErrorAction REPORT + = new CodingErrorAction("REPORT"); + + /** + * Returns a string describing this action. </p> + * + * @return A descriptive string + */ + public String toString() { + return name; + } + +} Added: trunk/core/src/openjdk/java/java/nio/charset/MalformedInputException.java =================================================================== --- trunk/core/src/openjdk/java/java/nio/charset/MalformedInputException.java (rev 0) +++ trunk/core/src/openjdk/java/java/nio/charset/MalformedInputException.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -0,0 +1,57 @@ +/* + * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.nio.charset; + + +/** + * Checked exception thrown when an input byte sequence is not legal for given + * charset, or an input character sequence is not a legal sixteen-bit Unicode + * sequence. + * + * @since 1.4 + */ + +public class MalformedInputException + extends CharacterCodingException +{ + + private static final long serialVersionUID = -3438823399834806194L; + + private int inputLength; + + public MalformedInputException(int inputLength) { + this.inputLength = inputLength; + } + + public int getInputLength() { + return inputLength; + } + + public String getMessage() { + return "Input length = " + inputLength; + } + +} Added: trunk/core/src/openjdk/java/java/nio/charset/UnmappableCharacterException.java =================================================================== --- trunk/core/src/openjdk/java/java/nio/charset/UnmappableCharacterException.java (rev 0) +++ trunk/core/src/openjdk/java/java/nio/charset/UnmappableCharacterException.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -0,0 +1,57 @@ +/* + * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.nio.charset; + + +/** + * Checked exception thrown when an input character (or byte) sequence + * is valid but cannot be mapped to an output byte (or character) + * sequence. </p> + * + * @since 1.4 + */ + +public class UnmappableCharacterException + extends CharacterCodingException +{ + + private static final long serialVersionUID = -7026962371537706123L; + + private int inputLength; + + public UnmappableCharacterException(int inputLength) { + this.inputLength = inputLength; + } + + public int getInputLength() { + return inputLength; + } + + public String getMessage() { + return "Input length = " + inputLength; + } + +} Added: trunk/core/src/openjdk/java/java/nio/charset/spi/CharsetProvider.java =================================================================== --- trunk/core/src/openjdk/java/java/nio/charset/spi/CharsetProvider.java (rev 0) +++ trunk/core/src/openjdk/java/java/nio/charset/spi/CharsetProvider.java 2009-03-21 08:36:28 UTC (rev 5138) @@ -0,0 +1,110 @@ +/* + * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.nio.charset.spi; + +import java.nio.charset.Charset; +import java.util.Iterator; + + +/** + * Charset service-provider class. + * + * <p> A charset provider is a concrete subclass of this class that has a + * zero-argument constructor and some number of associated charset + * implementation classes. Charset providers may be installed in an instance + * of the Java platform as extensions, that is, jar files placed into any of + * the usual extension directories. Providers may also be made available by + * adding them to the applet or application class path or by some other + * platform-specific means. Charset providers are looked up via the current + * thread's {@link java.lang.Thread#getContextClassLoader() </code>context + * class loader<code>}. + * + * <p> A charset provider identifies itself with a provider-configuration file + * named <tt>java.nio.charset.spi.CharsetProvider</tt> in the resource + * directory <tt>META-INF/services</tt>. The file should contain a list of + * fully-qualified concrete charset-provider class names, one per line. A line + * is terminated by any one of a line feed (<tt>'\n'</tt>), a carriage return + * (<tt>'\r'</tt>), or a carriage return followed immediately by a line feed. + * Space and tab characters surrounding each name, as well as blank lines, are + * ignored. The comment character is <tt>'#'</tt> (<tt>'\u0023'</tt>); on + * each line all characters following the first comment character are ignored. + * The file must be encoded in UTF-8. + * + * <p> If a particular concrete charset provider class is named in more than + * one configuration file, or is named in the same configuration file more than + * once, then the duplicates will be ignored. The configuration file naming a + * particular provider need not be in the same jar file or other distribution + * unit as the provider itself. The provider must be accessible from the same + * class loader that was initially queried to locate the configuration file; + * this is not necessarily the class loader that loaded the file. </p> + * + * + * @author Mark Reinhold + * @author JSR-51 Expert Group + * @since 1.4 + * + * @see java.nio.charset.Charset + */ + +public abstract class CharsetProvider { + + /** + * Initializes a new charset provider. </p> + * + * @throws SecurityException + * If a security manager has been installed and it denies + * {@link RuntimePermission}<tt>("charsetProvider")</tt> + */ + protected CharsetProvider() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkPermission(new RuntimePermission("charsetProvider")); + } + + /** + * Creates an iterator that iterates over the charsets supported by this + * provider. This method is used in the implementation of the {@link + * java.nio.charset.Charset#availableCharsets Charset.availableCharsets} + * method. </p> + * + * @return The new iterator + */ + public abstract Iterator<Charset> charsets(); + + /** + * Retrieves a charset for the given charset name. </p> + * + * @param charsetName + * The name of the requested charset; may be either + * a canonical name or an alias + * + * @return A charset object for the named charset, + * or <tt>null</tt> if the named charset + * is not supported by this provider + */ + public abstract Charset charsetForName(String charsetName); + +} Added: trunk/core/src/openjdk/java/java/nio/charset/spi/package.html =================================================================== --- trunk/core/src/openjdk/java/java/nio/charset/spi/package.html (rev 0) +++ trunk/core/src/openjdk/java/java/nio/charset/spi/package.html 2009-03-21 08:36:28 UTC (rev 5138) @@ -0,0 +1,45 @@ +<!-- + Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + + This code is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License version 2 only, as + published by the Free Software Foundation. Sun designates this + particular file as subject to the "Classpath" exception as provided + by Sun in the LICENSE file that accompanied this code. + + This code is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + version 2 for more details (a copy is included in the LICENSE file that + accompanied this code). + + You should have received a copy of the GNU General Public License version + 2 along with this work; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + CA 95054 USA or visit www.sun.com if you need additional information or + have any questions. +--> + +<!doctype html public "-//IETF//DTD HTML//EN"> +<html> +<body bgcolor="white"> + +Service-provider classes for the <tt>{@link java.nio.charset}</tt> package. + +<p> Only developers who are defining new charsets should need to make direct +use of this package. </p> + +<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor +or method in any class or interface in this package will cause a {@link +java.lang.NullPointerException NullPointerException} to be thrown. + + +@since 1.4 +@author Mark Reinhold +@author JSR-51 Expert Group + +</body> +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-03-21 15:00:03
|
Revision: 5139 http://jnode.svn.sourceforge.net/jnode/?rev=5139&view=rev Author: crawley Date: 2009-03-21 14:59:56 +0000 (Sat, 21 Mar 2009) Log Message: ----------- Mostly fixing javadocs and code style. Also added some FIXMEs for some questionable code. Modified Paths: -------------- trunk/core/src/classpath/vm/org/jnode/java/io/VMFileHandle.java trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java trunk/core/src/core/org/jnode/log4j/config/JNodeSystemAppender.java trunk/core/src/core/org/jnode/log4j/config/UnsafeDebugAppender.java trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginLoaderManager.java trunk/core/src/core/org/jnode/plugin/model/Factory.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginJar.java trunk/core/src/core/org/jnode/system/repository/spi/SystemRepositoryProvider.java Modified: trunk/core/src/classpath/vm/org/jnode/java/io/VMFileHandle.java =================================================================== --- trunk/core/src/classpath/vm/org/jnode/java/io/VMFileHandle.java 2009-03-21 08:36:28 UTC (rev 5138) +++ trunk/core/src/classpath/vm/org/jnode/java/io/VMFileHandle.java 2009-03-21 14:59:56 UTC (rev 5139) @@ -31,74 +31,58 @@ */ public interface VMFileHandle { - /** - * Gets the length (in bytes) of this file - * @return long - */ - public long getLength(); - - /** - * Sets the length of this file. - * @param length - * @throws IOException - */ - public void setLength(long length) - throws IOException; + /** + * Gets the length (in bytes) of this file + * @return long + */ + public long getLength(); - /** - * Gets the current position in the file - * @return long - */ - public long getPosition(); - - /** - * Sets the position in the file. - * @param position - * @throws IOException - */ - public void setPosition(long position) - throws IOException; + /** + * Sets the length of this file. + * @param length + * @throws IOException + */ + public void setLength(long length) throws IOException; - /** - * Read <code>len</code> bytes from the given position. - * The read data is read fom this file starting at offset <code>fileOffset</code> - * and stored in <code>dest</code> starting at offset <code>ofs</code>. - * @param dest - * @param off - * @param len - * @return - * @throws IOException - */ -// public int read(byte[] dest, int off, int len) -// throws IOException; - public int read(ByteBuffer dest) - throws IOException; - - - /** - * Write <code>len</code> bytes to the given position. - * The data is read from <code>src</code> starting at offset - * <code>ofs</code> and written to this file starting at offset <code>fileOffset</code>. - * @param src - * @param off - * @param len - * @throws IOException - */ - //public void write(byte[] src, int off, int len) - public void write(ByteBuffer src) - throws IOException; + /** + * Gets the current position in the file + * @return long + */ + public long getPosition(); - /** - * Close this file. - */ - public void close() - throws IOException; - - /** - * Has this handle been closed? - */ - public boolean isClosed(); + /** + * Sets the position in the file. + * @param position + * @throws IOException + */ + public void setPosition(long position) throws IOException; + /** + * Read bytes into the {@code dest} buffer. + * @param dest + * @return the number of bytes read. + * @throws IOException + */ + public int read(ByteBuffer dest) throws IOException; + + + /** + * Write bytes from the {@code src} buffer. + * @param src + * @throws IOException + */ + public void write(ByteBuffer src) throws IOException; + + /** + * Close this file. + */ + public void close() throws IOException; + + /** + * Has this handle been closed? + */ + public boolean isClosed(); + public int available(); public void unlock(long pos, long len); Modified: trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java 2009-03-21 08:36:28 UTC (rev 5138) +++ trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java 2009-03-21 14:59:56 UTC (rev 5139) @@ -267,13 +267,13 @@ public abstract void setResolver(ObjectResolver resolver); /** - * Start a new object and write its header. An ObjectInfo object is - * returned, on which the <code>markEnd</code> mehod must be called after - * all data has been written into the object. + * Start a new object and write its header, returning an + * {@link org.jnode.assembler.NativeStream.ObjectInfo} instance. + * The <code>markEnd</code> method must be called on the ObjectInfo + * instance once all data has been written for the object started. * * @param cls * @return The info for the started object - * @see ObjectInfo */ public abstract ObjectInfo startObject(VmType cls); Modified: trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2009-03-21 08:36:28 UTC (rev 5138) +++ trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2009-03-21 14:59:56 UTC (rev 5139) @@ -63,7 +63,7 @@ BootImageNativeStream, X86Operation { - public static final class Key { + static final class Key { private final Object key; @@ -72,14 +72,17 @@ } /** - * @param obj - * @return True if obj is equal to this, false otherwise - * @see java.lang.Object#equals(java.lang.Object) + * Test if this Key is equal to the supplied object. The semantics + * of equality depend on what the 'key' is. If it is a {@link Label}, then two + * Keys are equal if the Label values are equal. Otherwise, two keys are equal if + * the 'key' values refer to the same object. + * + * @param obj the object to test for equality. + * @return Return {@code true} if obj is 'equal to' this, {@code false} otherwise. */ public final boolean equals(Object obj) { - /* - * if (!(obj instanceof Key)) { return false; - */ + // FIXME ... this method will throw exceptions where a well-behaved implementation + // of 'equals' should return false; i.e. if obj is null or not a Key. obj = ((Key) obj).key; if (this.key instanceof Label) { return key.equals(obj); @@ -89,8 +92,9 @@ } /** - * @return The hashcode - * @see java.lang.Object#hashCode() + * The hashcode is the hashcode for the Key's 'key' object. + * + * @return This Key instance's hashcode. */ public final int hashCode() { return key.hashCode(); @@ -844,9 +848,6 @@ } } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeADC(int, GPR, int, int) - */ public void writeADC(int operandSize, GPR dstReg, int dstDisp, int imm32) { testSize(dstReg, mode.getSize()); if (isByte(imm32)) { @@ -933,9 +934,6 @@ } } - /** - * @see @see org.jnode.assembler.x86.X86Assembler#writeADD(int, SR, int, int) - */ public void writeADD(int operandSize, SR dstReg, int dstDisp, int imm32) { testOperandSize(operandSize, BITS32); writeSegPrefix(dstReg); @@ -1244,9 +1242,6 @@ writeObjectRef(tablePtr, offset, rawAddress); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCALL(GPR) - */ public void writeCALL(GPR reg) { testSize(reg, mode.getSize()); // Since CALL in 64-bit mode always use 64-bit targets, we @@ -1266,9 +1261,6 @@ write1bOpcodeModRM(0xFF, 0, reg, offset, 2); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCALL(GPR, GPR, int, int) - */ public void writeCALL(GPR regBase, GPR regIndex, int scale, int disp) { // Since CALL in 64-bit mode always use 64-bit targets, we // specify a 0 operand size, so we won't get a REX prefix @@ -1621,9 +1613,6 @@ write1bOpcodeModRM(0xdc, 0, srcReg, srcDisp, 0); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFADDP(X86Register) - */ public void writeFADDP(X86Register fpuReg) { write8(0xde); write8(0xc0 + fpuReg.getNr()); @@ -1657,9 +1646,6 @@ write1bOpcodeModRM(0xdc, 0, srcReg, srcDisp, 6); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFDIVP(X86Register) - */ public void writeFDIVP(X86Register fpuReg) { write8(0xde); write8(0xf8 + fpuReg.getNr()); @@ -1794,9 +1780,6 @@ write1bOpcodeModRM(0xdc, 0, srcReg, srcDisp, 1); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFMULP(X86Register) - */ public void writeFMULP(X86Register fpuReg) { write8(0xde); write8(0xc8 + fpuReg.getNr()); @@ -1860,9 +1843,6 @@ writeModRM(srcReg.getNr() & 7, srcDisp, 7); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSTP(X86Register) - */ public void writeFSTP(X86Register fpuReg) { write8(0xDD); write8(0xD8 + fpuReg.getNr()); @@ -1908,9 +1888,6 @@ write1bOpcodeModRM(0xdc, 0, srcReg, srcDisp, 4); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSUBP(X86Register) - */ public void writeFSUBP(X86Register fpuReg) { write8(0xde); write8(0xe8 + fpuReg.getNr()); @@ -1924,9 +1901,6 @@ write8(0xe9); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFXCH(X86Register) - */ public void writeFXCH(X86Register fpuReg) { write8(0xd9); write8(0xc8 + fpuReg.getNr()); @@ -1956,16 +1930,12 @@ writeModRM(srcReg.getNr() & 7, srcDisp, 0); } - /** - * - */ public void writeHLT() { write8(0xF4); } /** * Create an idiv edx:eax, srcReg. - * <p/> * If srcReg is 64-bit, the idiv rdx:rax, srcReg is created. * * @param srcReg @@ -3980,9 +3950,6 @@ write1bOpcodeModRM(0x8f, 0, dstReg, dstDisp, 0); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePOPA() - */ public void writePOPA() { if (code64) { throw new InvalidOpcodeException(); @@ -3990,31 +3957,19 @@ write8(0x61); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePOPF() - */ public void writePOPF() { write8(0x9D); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePrefix(int) - */ public void writePrefix(int prefix) { write8(prefix); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePSHUFW(MMX,MMX,int) - */ public void writePSHUFW(MMX dstMmx, MMX srcMmx, int imm8) { writeModRR_MMX(0x70, dstMmx, srcMmx); write8(imm8); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePSRLW(MMX,int) - */ public void writePSRLW(X86Register.MMX mmx, int imm8) { write8(0x0F); write8(0x71); @@ -4022,16 +3977,10 @@ write8(imm8); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePSUBW(MMX,MMX) - */ public void writePSUBW(MMX dstMmx, MMX srcMmx) { writeModRR_MMX(0xF9, dstMmx, srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePUNPCKLBW(MMX,MMX) - */ public void writePUNPCKLBW(MMX dstMmx, MMX srcMmx) { writeModRR_MMX(0x60, dstMmx, srcMmx); } @@ -4167,9 +4116,6 @@ return rc; } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePUSHA() - */ public void writePUSHA() { if (code64) { throw new InvalidOpcodeException(); @@ -4177,16 +4123,10 @@ write8(0x60); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePUSHF() - */ public void writePUSHF() { write8(0x9C); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePXOR(MMX,MMX) - */ public void writePXOR(MMX dstMmx, MMX srcMmx) { writeModRR_MMX(0xEF, dstMmx, srcMmx); } @@ -4433,9 +4373,6 @@ write8(imm8); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHL(int, GPR, int, int) - */ public void writeSHL(int operandSize, GPR dstReg, int dstDisp, int imm8) { testSize(dstReg, mode.getSize()); write1bOpcodeModRM(0xc1, operandSize, dstReg, dstDisp, 4); @@ -4452,9 +4389,6 @@ write1bOpcodeModRR(0xd3, dstReg.getSize(), dstReg, 4); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHL_CL(int, GPR, int) - */ public void writeSHL_CL(int operandSize, GPR dstReg, int dstDisp) { testSize(dstReg, mode.getSize()); write1bOpcodeModRM(0xd3, operandSize, dstReg, dstDisp, 4); @@ -4826,9 +4760,6 @@ } } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeXCHG(SR, int, GPR) - */ public void writeXCHG(SR dstReg, int dstDisp, GPR srcReg) { testSize(srcReg, mode.getSize()); writeSegPrefix(dstReg); @@ -4837,9 +4768,6 @@ write32(dstDisp); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeXCHG(GPR, int, GPR) - */ public void writeXCHG(GPR dstReg, int dstDisp, GPR srcReg) { testSize(dstReg, mode.getSize()); testSize(srcReg, mode.getSize()); @@ -4847,9 +4775,6 @@ .getNr()); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeXCHG(GPR, GPR) - */ public void writeXCHG(GPR dstReg, GPR srcReg) { testSize(dstReg, mode.getSize()); testSize(srcReg, mode.getSize()); @@ -4938,17 +4863,11 @@ .getNr()); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeRDMSR() - */ public void writeRDMSR() { write8(0x0F); write8(0x32); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeWRMSR() - */ public void writeWRMSR() { write8(0x0F); write8(0x30); Modified: trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2009-03-21 08:36:28 UTC (rev 5138) +++ trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2009-03-21 14:59:56 UTC (rev 5139) @@ -49,9 +49,6 @@ public class X86TextAssembler extends X86Assembler implements X86Operation { class ObjectInfoImpl extends NativeStream.ObjectInfo { - /** - * @see org.jnode.assembler.NativeStream.ObjectInfo#markEnd() - */ public void markEnd() { println(";\n; -- End of Object --\n;"); } @@ -64,16 +61,10 @@ super(object); } - /** - * @see org.jnode.assembler.NativeStream.ObjectRef#getOffset() - */ public int getOffset() throws UnresolvedObjectRefException { return 0; } - /** - * @see org.jnode.assembler.NativeStream.ObjectRef#isResolved() - */ public boolean isResolved() { return true; } @@ -83,9 +74,6 @@ } - /** - * @see org.jnode.assembler.NativeStream.ObjectRef#link(org.jnode.assembler.NativeStream.ObjectRef) - */ public void link(ObjectRef objectRef) throws UnresolvedObjectRefException { } @@ -178,9 +166,6 @@ this.stripPrefix = stripPrefix; } - /** - * @see org.jnode.assembler.x86.X86Assembler#align(int) - */ public int align(int value) { return 0; } @@ -229,72 +214,42 @@ out.flush(); } - /** - * @see org.jnode.assembler.x86.X86Assembler#get32(int) - */ public int get32(int offset) { return 0; } - /** - * @see org.jnode.assembler.x86.X86Assembler#get8(int) - */ public int get8(int offset) { return 0; } - /** - * @see org.jnode.assembler.NativeStream#getBaseAddr() - */ public long getBaseAddr() { return 0; } - /** - * @see org.jnode.assembler.NativeStream#getBytes() - */ public byte[] getBytes() { return dummy; } - /** - * @see org.jnode.assembler.NativeStream#getLength() - */ public int getLength() { return idx + buf.length(); } - /** - * @see org.jnode.assembler.NativeStream#getObjectRef(java.lang.Object) - */ public ObjectRef getObjectRef(Object keyObj) { return new ObjectRefImpl(keyObj); } - /** - * @see org.jnode.assembler.NativeStream#getObjectRefs() - */ public Collection<? extends ObjectRef> getObjectRefs() { return null; } - /** - * @see org.jnode.assembler.x86.X86Assembler#getResolver() - */ public ObjectResolver getResolver() { return null; } - /** - * @see org.jnode.assembler.NativeStream#getUnresolvedObjectRefs() - */ public Collection getUnresolvedObjectRefs() { return null; } - /** - * @see org.jnode.assembler.NativeStream#hasUnresolvedObjectRefs() - */ public boolean hasUnresolvedObjectRefs() { return false; } @@ -309,9 +264,6 @@ return true; } - /** - * @see org.jnode.assembler.x86.X86Assembler#isTextStream() - */ public boolean isTextStream() { return true; } @@ -343,51 +295,26 @@ return rc; } - /** - * @see org.jnode.assembler.x86.X86Assembler#set64(int, long) - */ public void set64(int offset, long v64) { } - /** - * @see org.jnode.assembler.x86.X86Assembler#set32(int, int) - */ public void set32(int offset, int v32) { } - /** - * @see org.jnode.assembler.x86.X86Assembler#set16(int, int) - */ public void set16(int offset, int v16) { } - /** - * @see org.jnode.assembler.x86.X86Assembler#set8(int, int) - */ public void set8(int offset, int v8) { - // TODO Auto-generated method stub - } - - /** - * @see org.jnode.assembler.NativeStream#setObjectRef(java.lang.Object) - */ + public ObjectRef setObjectRef(Object label) { println(label(label) + ":"); return new ObjectRefImpl(label); } - /** - * @see org.jnode.assembler.x86.X86Assembler#setResolver(org.jnode.assembler.ObjectResolver) - */ public void setResolver(ObjectResolver resolver) { - // TODO Auto-generated method stub - } - /** - * @see org.jnode.assembler.NativeStream#startObject(org.jnode.vm.classmgr.VmType) - */ public ObjectInfo startObject(VmType cls) { println(";\n; -- Start of object --\n;"); return new ObjectInfoImpl(); @@ -403,9 +330,6 @@ // println("\t; TRIM " + count + " bytes"); } - /** - * @see org.jnode.assembler.NativeStream#write(byte[], int, int) - */ public void write(byte[] data, int ofs, int len) { buf.append("\tdb "); for (int i = 0; i < len; i++) { @@ -417,30 +341,18 @@ buf.append('\n'); } - /** - * @see org.jnode.assembler.NativeStream#write16(int) - */ public void write16(int v16) { println("\tdw " + v16); } - /** - * @see org.jnode.assembler.NativeStream#write32(int) - */ public void write32(int v32) { println("\tdd " + v32); } - /** - * @see org.jnode.assembler.NativeStream#write64(long) - */ public void write64(long v64) { println("\tdq " + v64); } - /** - * @see org.jnode.assembler.NativeStream#write8(int) - */ public void write8(int v8) { println("\tdb " + v8); } @@ -455,17 +367,11 @@ println("\tadc " + dstReg + "," + imm32); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeADC(int, GPR, int, int) - */ public void writeADC(int operandSize, GPR dstReg, int dstDisp, int imm32) { println("\tadc " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "]," + imm32); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeADC(GPR, int, GPR) - */ public void writeADC(GPR dstReg, int dstDisp, GPR srcReg) { println("\tadc [" + dstReg + disp(dstDisp) + "]," + srcReg); } @@ -477,7 +383,6 @@ * @param srcReg */ public void writeADC(GPR dstReg, GPR srcReg) { - println("\tadc " + dstReg + "," + srcReg); } @@ -518,9 +423,6 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see @see org.jnode.assembler.x86.X86Assembler#writeADD(int, SR, int, int) - */ public void writeADD(int operandSize, SR dstReg, int dstDisp, int imm32) { println("\tadd " + size(operandSize) + "[" + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "],0x" + NumberUtils.hex(imm32)); @@ -530,16 +432,10 @@ println("\tadd " + reg + ",[0x" + NumberUtils.hex(memPtr32) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeADD(GPR, int, GPR) - */ public void writeADD(GPR dstReg, int dstDisp, GPR srcReg) { println("\tadd [" + dstReg + disp(dstDisp) + "]," + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeADD(GPR, GPR) - */ public void writeADD(GPR dstReg, GPR srcReg) { println("\tadd " + dstReg + "," + srcReg); } @@ -555,11 +451,7 @@ println("\tadd " + dstReg + ",[" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeAND(GPR, int) - */ public void writeAND(GPR reg, int imm32) { - println("\tand " + reg + ",0x" + NumberUtils.hex(imm32)); } @@ -578,11 +470,7 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeAND(GPR, int, GPR) - */ public void writeAND(GPR dstReg, int dstDisp, GPR srcReg) { - println("\tand [" + dstReg + disp(dstDisp) + "]," + srcReg); } @@ -597,11 +485,7 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeAND(GPR, GPR) - */ public void writeAND(GPR dstReg, GPR srcReg) { - println("\tand " + dstReg + "," + srcReg); } @@ -634,23 +518,14 @@ println("\t" + op + "S" + dst + ", " + src); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeBOUND(GPR, GPR, int) - */ public void writeBOUND(GPR lReg, GPR rReg, int rDisp) { println("\tbound " + lReg + ",[" + rReg + disp(rDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeBreakPoint() - */ public void writeBreakPoint() { println("\tint 3"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCALL(Label) - */ public void writeCALL(Label label) { println("\tcall " + label(label)); @@ -668,9 +543,6 @@ println("\tcall [" + tablePtr + disp(offset) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCALL(GPR) - */ public void writeCALL(GPR reg) { println("\tcall " + reg); } @@ -685,9 +557,6 @@ println("\tcall [" + reg + disp(offset) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCALL(GPR, GPR, int, int) - */ public void writeCALL(GPR regBase, GPR regIndex, int scale, int disp) { println("\tcall [" + regBase + "+" + regIndex + "*" + scale + disp(disp) + "]"); @@ -697,9 +566,6 @@ println("\tcall [" + regIndex + "*" + scale + disp(disp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCDQ(int) - */ public void writeCDQ(int operandSize) { testOperandSize(operandSize, BITS32 | BITS64); if (operandSize == BITS32) { @@ -725,23 +591,14 @@ println("\tcdqe"); } - /** - * - */ public void writeCLD() { println("\tCLD"); } - /** - * - */ public void writeCLI() { println("\tCLI"); } - /** - * - */ public void writeCLTS() { println("\tCLTS"); } @@ -780,9 +637,6 @@ println("\tcmp [" + reg1 + disp(disp) + "]," + reg2); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCMP(GPR, GPR) - */ public void writeCMP(GPR reg1, GPR reg2) { println("\tcmp " + reg1 + "," + reg2); } @@ -809,9 +663,6 @@ println("\tcmp " + reg1 + ",[" + reg2 + disp(disp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCMP_Const(GPR, int) - */ public void writeCMP_Const(GPR reg, int imm32) { println("\tcmp " + reg + ",0x" + NumberUtils.hex(imm32)); } @@ -841,9 +692,6 @@ + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCMP_EAX(int, int) - */ public void writeCMP_EAX(int operandSize, int imm32) { testOperandSize(operandSize, BITS32 | BITS64); if (operandSize == BITS32) { @@ -853,9 +701,6 @@ } } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCMP_MEM(int, int, int) - */ public void writeCMP_MEM(int operandSize, int memPtr, int imm32) { println("\tcmp " + size(operandSize) + "[" + memPtr + "],0x" + NumberUtils.hex(imm32)); @@ -871,10 +716,6 @@ println("\tcmp " + reg + ", [" + memPtr + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeCMPXCHG_EAX(GPR, int, GPR, - * boolean) - */ public void writeCMPXCHG_EAX(GPR dstReg, int dstDisp, GPR srcReg, boolean lock) { println("\tcmpxchg [" + dstReg + disp(dstDisp) + "]," + srcReg); @@ -884,24 +725,15 @@ println("\tcpuid"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeDEC(GPR) - */ public void writeDEC(GPR dstReg) { println("\tdec " + dstReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeDEC(int, GPR, int) - */ public void writeDEC(int operandSize, GPR dstReg, int dstDisp) { println("\tdec " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeDIV_EAX(GPR) - */ public void writeDIV_EAX(GPR srcReg) { println("\tdiv " + srcReg); @@ -911,304 +743,167 @@ println("\temms"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFADD32(GPR, int) - */ public void writeFADD32(GPR srcReg, int srcDisp) { println("\tfadd dword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFADD64(GPR, int) - */ public void writeFADD64(GPR srcReg, int srcDisp) { println("\tfadd qword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFADDP(X86Register) - */ public void writeFADDP(X86Register fpuReg) { println("\tfaddp " + fpuReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFCHS() - */ public void writeFCHS() { println("\tfchs"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFDIV32(GPR, int) - */ public void writeFDIV32(GPR srcReg, int srcDisp) { - println("\tfdiv dword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFDIV64(GPR, int) - */ public void writeFDIV64(GPR srcReg, int srcDisp) { - println("\tfdiv qword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFDIVP(X86Register) - */ public void writeFDIVP(X86Register fpuReg) { println("\tfdivp " + fpuReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFFREE(X86Register) - */ public void writeFFREE(X86Register fReg) { - println("\tffree " + fReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFILD32(GPR, int) - */ public void writeFILD32(GPR dstReg, int dstDisp) { - println("\tfild dword [" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFILD64(GPR, int) - */ public void writeFILD64(GPR dstReg, int dstDisp) { println("\tfild qword [" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFISTP32(GPR, int) - */ public void writeFISTP32(GPR dstReg, int dstDisp) { - println("\tfistp dword [" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFISTP64(GPR, int) - */ public void writeFISTP64(GPR dstReg, int dstDisp) { - println("\tfistp qword [" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFLD32(GPR, int) - */ public void writeFLD32(GPR srcReg, int srcDisp) { - println("\tfld dword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFLD32(GPR, GPR, int, int) - */ public void writeFLD32(GPR srcBaseReg, GPR srcIndexReg, int srcScale, int srcDisp) { println("\tfld dword [" + srcBaseReg + '+' + srcIndexReg + '*' + srcScale + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFLD64(GPR, int) - */ public void writeFLD64(GPR srcReg, int srcDisp) { - println("\tfld qword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFLD64(GPR, int) - */ public void writeFLD64(GPR srcBaseReg, GPR srcIndexReg, int srcScale, int srcDisp) { println("\tfld qword [" + srcBaseReg + '+' + srcIndexReg + '*' + srcScale + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFLDCW(GPR, int) - */ public void writeFLDCW(GPR srcReg, int srcDisp) { println("\tfldcw word [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFMUL32(GPR, int) - */ public void writeFMUL32(GPR srcReg, int srcDisp) { println("\tfmul dword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFMUL64(GPR, int) - */ public void writeFMUL64(GPR srcReg, int srcDisp) { - println("\tfmul qword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFMULP(X86Register) - */ public void writeFMULP(X86Register fpuReg) { println("\tfmulp " + fpuReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFNINIT() - */ public void writeFNINIT() { - println("\tfninit"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFNSAVE(GPR, int) - */ public void writeFNSAVE(GPR srcReg, int srcDisp) { println("\tfnsave [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFNSTSW_AX() - */ public void writeFNSTSW_AX() { - println("\tfnstsw_ax"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFPREM() - */ public void writeFPREM() { println("\tfprem"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFRSTOR(GPR, int) - */ public void writeFRSTOR(GPR srcReg, int srcDisp) { println("\tfrstor [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSTCW(GPR, int) - */ public void writeFSTCW(GPR srcReg, int srcDisp) { println("\tfstcw word [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSTP(X86Register) - */ public void writeFSTP(X86Register fpuReg) { println("\tfstp " + fpuReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSTP32(GPR, int) - */ public void writeFSTP32(GPR dstReg, int dstDisp) { println("\tfstp dword [" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSTP64(GPR, int) - */ public void writeFSTP64(GPR dstReg, int dstDisp) { - println("\tfstp qword [" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSUB32(GPR, int) - */ public void writeFSUB32(GPR srcReg, int srcDisp) { println("\tfsub32 dword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSUB64(GPR, int) - */ public void writeFSUB64(GPR srcReg, int srcDisp) { - println("\tfsub64 qword [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFSUBP(X86Register) - */ public void writeFSUBP(X86Register fpuReg) { println("\tfsubp " + fpuReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFUCOMPP() - */ public void writeFUCOMPP() { - println("\tfucompp"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFXCH(X86Register) - */ public void writeFXCH(X86Register fpuReg) { println("\tfxch " + fpuReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFXRSTOR(GPR, int) - */ public void writeFXRSTOR(GPR srcReg, int srcDisp) { println("\tfxrstor [" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeFXSAVE(GPR, int) - */ public void writeFXSAVE(GPR srcReg, int srcDisp) { println("\tfxsave [" + srcReg + disp(srcDisp) + "]"); } - /** - * - */ public void writeHLT() { println("\thlt"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeIDIV_EAX(GPR) - */ public void writeIDIV_EAX(GPR srcReg) { - println("\tidiv " + srcReg); } - /** - * @param srcReg - * @param srcDisp - */ public void writeIDIV_EAX(int operandSize, GPR srcReg, int srcDisp) { println("\tidiv " + size(operandSize) + "[" + srcReg + disp(srcDisp) + "]"); } - /** - * @param dstReg - * @param srcReg - */ public void writeIMUL(GPR dstReg, GPR srcReg) { println("\timul " + dstReg + "," + srcReg); } @@ -1244,9 +939,6 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeIMUL_EAX(GPR) - */ public void writeIMUL_EAX(GPR srcReg) { println("\timul " + srcReg); } @@ -1275,9 +967,6 @@ } } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeINC(GPR) - */ public void writeINC(GPR dstReg) { println("\tinc " + dstReg); } @@ -1308,37 +997,22 @@ println("\tinc " + size(operandSize) + "[" + dstDisp + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeINT(int) - */ public void writeINT(int vector) { println("\tint 0x" + NumberUtils.hex(vector, 2)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeIRET() - */ public void writeIRET() { println("\tiret"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeJCC(Label, int) - */ public void writeJCC(Label label, int jumpOpcode) { println("\tj" + ccName(jumpOpcode) + " " + label(label)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeJECXZ(Label) - */ public void writeJECXZ(Label label) { println("\tjecxz" + label(label)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeJMP(Label) - */ public void writeJMP(Label label) { println("\tjmp " + label(label)); } @@ -1377,9 +1051,6 @@ println("\tjmp [" + tablePtr + "+" + offsetReg + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeJMP(GPR) - */ public void writeJMP(GPR reg32) { println("\tjmp " + reg32); } @@ -1393,16 +1064,10 @@ println("\tjmp [" + reg32 + disp(disp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeLDMXCSR(GPR, int) - */ public void writeLDMXCSR(GPR srcReg, int disp) { println("\tldmxcsr dword [" + srcReg + disp(disp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeLEA(GPR, GPR, int) - */ public void writeLEA(GPR dstReg, GPR srcReg, int disp) { println("\tlea " + dstReg + ",[" + srcReg + disp(disp) + "]"); } @@ -1419,57 +1084,32 @@ println("\tlidt [" + disp(disp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeLEA(GPR, GPR, GPR, int, - * int) - */ public void writeLEA(GPR dstReg, GPR srcReg, GPR srcIdxReg, int scale, int disp) { println("\tlea " + dstReg + ",[" + srcReg + disp(disp) + "+" + srcIdxReg + "*" + scale + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeLMSW(GPR) - */ public void writeLMSW(GPR srcReg) { println("\tlmsw " + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeLODSD() - */ public void writeLODSD() { - println("\tlodsd"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeLODSW() - */ public void writeLODSW() { - println("\tlodsw"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeLOOP(Label) - */ public void writeLOOP(Label label) throws UnresolvedObjectRefException { - println("\tloop " + label(label)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeLTR(GPR) - */ public void writeLTR(GPR srcReg) { println("\tltr " + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(int, GPR, int, GPR) - */ public void writeMOV(int operandSize, GPR dstReg, int dstDisp, GPR srcReg) { println("\tmov " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "]," + srcReg); @@ -1484,65 +1124,38 @@ println("\tmov " + "[" + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "]," + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(CRX, GPR) - */ public void writeMOV(CRX dstReg, GPR srcReg) { println("\tmov " + dstReg + "," + size(BITS32) + " " + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(GPR, CRX) - */ public void writeMOV(GPR dstReg, CRX srcReg) { println("\tmov " + dstReg + "," + size(BITS32) + " " + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(CRX, GPR) - */ public void writeMOV(SR dstReg, GPR srcReg) { println("\tmov " + dstReg + "," + size(BITS16) + " " + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(GPR, CRX) - */ public void writeMOV(GPR dstReg, SR srcReg) { println("\tmov " + dstReg + "," + size(BITS16) + " " + srcReg); } - - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(int, GPR, GPR) - */ public void writeMOV(int operandSize, GPR dstReg, GPR srcReg) { println("\tmov " + dstReg + "," + size(operandSize) + " " + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(int, GPR, GPR, int) - */ public void writeMOV(int operandSize, GPR dstReg, GPR srcReg, int srcDisp) { println("\tmov " + dstReg + "," + size(operandSize) + "[" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(int, GPR, GPR, int, - * int, GPR) - */ public void writeMOV(int operandSize, GPR dstReg, GPR dstIdxReg, int scale, int dstDisp, GPR srcReg) { println("\tmov " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "+" + dstIdxReg + "*" + scale + "]," + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV(int, GPR, GPR, GPR, - * int, int) - */ - public void writeMOV(int operandSize, GPR dstReg, GPR srcReg, + public void writeMOV(int operandSize, GPR dstReg, GPR srcReg, GPR srcIdxReg, int scale, int srcDisp) { println("\tmov " + dstReg + "," + size(operandSize) + "[" + srcReg + disp(srcDisp) + "+" + srcIdxReg + "*" + scale + "]"); @@ -1572,9 +1185,6 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV_Const(GPR, int) - */ public void writeMOV_Const(GPR dstReg, int imm32) { if (dstReg.getSize() == BITS32) { println("\tmov " + dstReg + ",0x" + NumberUtils.hex(imm32)); @@ -1583,9 +1193,6 @@ } } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV_Const(GPR, int) - */ public void writeMOV_Const(GPR dstReg, long imm64) { println("\tmov " + dstReg + ",0x" + NumberUtils.hex(imm64)); } @@ -1615,10 +1222,6 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOV_Const(GPR, - * java.lang.Object) - */ public void writeMOV_Const(GPR dstReg, Object label) { println("\tmov " + dstReg + "," + label); } @@ -1636,38 +1239,22 @@ + "*" + scale + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOVD(int, org.jnode.assembler.x86.X86Register.MMX , GPR, int) - */ public void writeMOVD(int operandSize, X86Register.MMX mmx, X86Register.GPR reg, int disp) { println("\tmovd " + mmx + "," + size(operandSize) + "[" + reg + disp(disp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOVD(int, GPR, int, org.jnode.assembler.x86.X86Register.MMX) - */ public void writeMOVD(int operandSize, X86Register.GPR dstReg, int dstDisp, X86Register.MMX srcMmx) { println("\tmovd " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "]," + srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOVQ(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writeMOVQ(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tmovd " + dstMmx + "," + srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOVQ(int, org.jnode.assembler.x86.X86Register.MMX , GPR, int) - */ public void writeMOVQ(int operandSize, X86Register.MMX dstMmx, X86Register.GPR srcGpr, int srcDisp) { println("\tmovq " + dstMmx + "," + size(operandSize) + "[" + srcGpr + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOVQ(int, org.jnode.assembler.x86.X86Register.MMX , int) - */ public void writeMOVQ(int operandSize, X86Register.MMX dstMmx, int srcDisp) { println("\tmovq " + dstMmx + "," + size(operandSize) + "[" + disp(srcDisp) + "]"); } @@ -1703,10 +1290,7 @@ public void writeMOVSS(XMM dst, XMM src) { println("\tmovss " + dst + "," + src); } - - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOVSX(GPR, GPR, int) - */ + public void writeMOVSX(GPR dstReg, GPR srcReg, int srcSize) { println("\tmovsx " + dstReg + "," + size(srcSize) + " " + srcReg); } @@ -1735,9 +1319,6 @@ println("\tmovsw"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMOVZX(GPR, GPR, int) - */ public void writeMOVZX(GPR dstReg, GPR srcReg, int srcSize) { println("\tmovzx " + dstReg + "," + size(srcSize) + " " + srcReg); } @@ -1747,45 +1328,27 @@ + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeMUL_EAX(GPR) - */ public void writeMUL_EAX(GPR srcReg) { println("\tmul " + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeNEG(GPR) - */ public void writeNEG(GPR dstReg) { println("\tneg " + dstReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeNEG(int, GPR, int) - */ public void writeNEG(int operandSize, GPR dstReg, int dstDisp) { println("\tneg " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeNOP() - */ public void writeNOP() { println("\tnop"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeNOT(GPR) - */ public void writeNOT(GPR dstReg) { println("\tnot " + dstReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeNOT(int, GPR, int) - */ public void writeNOT(int operandSize, GPR dstReg, int dstDisp) { println("\tnot " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "]"); @@ -1810,9 +1373,6 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeOR(GPR, int, GPR) - */ public void writeOR(GPR dstReg, int dstDisp, GPR srcReg) { println("\tor [" + dstReg + disp(dstDisp) + "]," + srcReg); } @@ -1838,9 +1398,6 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeOR(GPR, GPR) - */ public void writeOR(GPR dstReg, GPR srcReg) { println("\tor " + dstReg + "," + srcReg); } @@ -1854,9 +1411,6 @@ println("\tor " + dstReg + ",[" + srcReg + disp(srcDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeOUT(int) - */ public void writeOUT(int operandSize) { if (operandSize == X86Constants.BITS8) { println("\tout " + X86Register.DX + "," + X86Register.AL); @@ -1869,9 +1423,6 @@ } } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeOUT(int, int) - */ public void writeOUT(int operandSize, int imm8) { if (operandSize == X86Constants.BITS8) { println("\tout " + imm8 + "," + X86Register.AL); @@ -1884,84 +1435,46 @@ } } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePACKUSWB(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writePACKUSWB(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tpackuswb " + dstMmx + "," + srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePADDW(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writePADDW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tpaddw " + dstMmx + "," + srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePAND(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writePAND(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tpand " + dstMmx + "," + srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePCMPGTW(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writePCMPGTW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tpcmpgtw " + dstMmx + "," + srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePMULLW(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writePMULLW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tpmullw " + dstMmx + "," + srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePOP(GPR) - */ public void writePOP(GPR dstReg) { println("\tpop " + dstReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePOP(SR) - */ public void writePOP(SR dstReg) { println("\tpop " + dstReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePOP(GPR, int) - */ public void writePOP(GPR dstReg, int dstDisp) { println("\tpop [" + dstReg + disp(dstDisp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePOPA() - */ public void writePOPA() { println("\tpopa"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePOPF() - */ public void writePOPF() { println("\tpopf"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePrefix(int) - */ public void writePrefix(int prefix) { final String str; switch (prefix) { @@ -1980,80 +1493,59 @@ println("\tprefix " + str); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePSHUFW(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX ,int) - */ public void writePSHUFW(X86Register.MMX dstMmx, X86Register.MMX srcMmx, int imm8) { println("\tpshufw " + dstMmx + "," + srcMmx + ",0x" + NumberUtils.hex(imm8)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePSRLW(org.jnode.assembler.x86.X86Register.MMX ,int) - */ public void writePSRLW(X86Register.MMX mmx, int imm8) { println("\tpsrlw " + mmx + ",0x" + NumberUtils.hex(imm8)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePSUBW(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writePSUBW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tpsubw " + dstMmx + "," + srcMmx); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePUNPCKLBW(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writePUNPCKLBW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tpsunpcklbw " + dstMmx + "," + srcMmx); } /** - * @return The ofset of the start of the instruction. - * @see org.jnode.assembler.x86.X86Assembler#writePUSH(int) + * @return The offset of the start of the instruction. */ public int writePUSH(int imm32) { return println("\tpush 0x" + NumberUtils.hex(imm32)); } /** - * @return The ofset of the start of the instruction. - * @see org.jnode.assembler.x86.X86Assembler#writePUSH(GPR) + * @return The offset of the start of the instruction. */ public int writePUSH(GPR srcReg) { return println("\tpush " + srcReg); } /** - * @return The ofset of the start of the instruction. - * @see org.jnode.assembler.x86.X86Assembler#writePUSH(SR) + * @return The offset of the start of the instruction. */ public int writePUSH(SR srcReg) { return println("\tpush " + srcReg); } /** - * @return The ofset of the start of the instruction. - * @see org.jnode.assembler.x86.X86Assembler#writePUSH(GPR, int) + * @return The offset of the start of the instruction. */ public int writePUSH(GPR srcReg, int srcDisp) { return println("\tpush [" + srcReg + disp(srcDisp) + "]"); } /** - * @return The ofset of the start of the instruction. - * @see org.jnode.assembler.x86.X86Assembler#writePUSH(GPR, int) + * @return The offset of the start of the instruction. */ public int writePUSH(SR srcReg, int srcDisp) { return println("\tpush [" + srcReg + ":" + srcDisp + "]"); } /** - * @return The ofset of the start of the instruction. - * @see org.jnode.assembler.x86.X86Assembler#writePUSH(GPR, GPR, int, int) + * @return The offset of the start of the instruction. */ public int writePUSH(GPR srcBaseReg, GPR srcIndexReg, int srcScale, int srcDisp) { @@ -2064,30 +1556,19 @@ // PR /** * @return The offset of the start of the instruction. - * @see org.jnode.assembler.x86.X86Assembler#writePUSH_Const(Object) */ public int writePUSH_Const(Object objRef) { return println("\tpush " + objRef); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePUSHA() - */ public void writePUSHA() { println("\tpusha"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePUSHF() - */ public void writePUSHF() { println("\tpushf"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writePXOR(org.jnode.assembler.x86.X86Register.MMX , - * org.jnode.assembler.x86.X86Register.MMX) - */ public void writePXOR(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { println("\tpxor " + dstMmx + "," + srcMmx); } @@ -2105,30 +1586,18 @@ println("\tdd relative " + label(label)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeRET() - */ public void writeRET() { println("\tret"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeRET(int) - */ public void writeRET(int imm16) { println("\tret " + imm16); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSAHF() - */ public void writeSAHF() { println("\tsahf"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSAL(GPR, int) - */ public void writeSAL(GPR dstReg, int imm8) { println("\tsal " + dstReg + "," + imm8); } @@ -2143,9 +1612,6 @@ + "]," + imm8); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSAL_CL(GPR) - */ public void writeSAL_CL(GPR dstReg) { println("\tsal " + dstReg + ",cl"); } @@ -2159,9 +1625,6 @@ + "],cl"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSAR(GPR, int) - */ public void writeSAR(GPR dstReg, int imm8) { println("\tsar " + dstReg + "," + imm8); } @@ -2176,9 +1639,6 @@ + "]," + imm8); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSAR_CL(GPR) - */ public void writeSAR_CL(GPR dstReg) { println("\tsar " + dstReg + ",cl"); } @@ -2202,24 +1662,15 @@ println("\tsbb " + dstReg + ",0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSBB(int, GPR, int, int) - */ public void writeSBB(int operandSize, GPR dstReg, int dstDisp, int imm32) { println("\tsbb " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSBB(GPR, int, GPR) - */ public void writeSBB(GPR dstReg, int dstDisp, GPR srcReg) { println("\tsbb [" + dstReg + disp(dstDisp) + "]," + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSBB(GPR, GPR) - */ public void writeSBB(GPR dstReg, GPR srcReg) { println("\tsbb " + dstReg + "," + srcReg); } @@ -2243,46 +1694,28 @@ println("\tset" + ccName(cc) + " " + dstReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHL(GPR, int) - */ public void writeSHL(GPR dstReg, int imm8) { println("\tshl " + dstReg + "," + imm8); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHL(int, GPR, int, int) - */ public void writeSHL(int operandSize, GPR dstReg, int dstDisp, int imm8) { println("\tshl " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "]," + imm8); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHL_CL(GPR) - */ public void writeSHL_CL(GPR dstReg) { println("\tshl " + dstReg + ",cl"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHL_CL(int, GPR, int) - */ public void writeSHL_CL(int operandSize, GPR dstReg, int dstDisp) { println("\tshl " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "],CL"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHLD_CL(GPR, GPR) - */ public void writeSHLD_CL(GPR dstReg, GPR srcReg) { println("\tshld " + dstReg + "," + srcReg + ",cl"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHR(GPR, int) - */ public void writeSHR(GPR dstReg, int imm8) { println("\tshr " + dstReg + "," + imm8); } @@ -2297,9 +1730,6 @@ + "]," + imm8); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHR_CL(GPR) - */ public void writeSHR_CL(GPR dstReg) { println("\tshr " + dstReg + ",cl"); } @@ -2313,51 +1743,30 @@ + "],cl"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSHRD_CL(GPR, GPR) - */ public void writeSHRD_CL(GPR dstReg, GPR srcReg) { println("\tshrd " + dstReg + "," + srcReg + ",cl"); } - /** - * - */ public void writeSTD() { println("\tstd"); } - /** - * - */ public void writeSTI() { println("\tsti"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSTMXCSR(GPR, int) - */ public void writeSTMXCSR(GPR srcReg, int disp) { println("\tstmxcsr dword [" + srcReg + disp(disp) + "]"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSTOSB() - */ public void writeSTOSB() { println("\tstosb"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSTOSD() - */ public void writeSTOSD() { println("\tstosd"); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSTOSW() - */ public void writeSTOSW() { println("\tstosw"); } @@ -2390,16 +1799,10 @@ + "],0x" + NumberUtils.hex(imm32)); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSUB(GPR, int, GPR) - */ public void writeSUB(GPR dstReg, int dstDisp, GPR srcReg) { println("\tsub [" + dstReg + disp(dstDisp) + "]," + srcReg); } - /** - * @see org.jnode.assembler.x86.X86Assembler#writeSUB(GPR, GPR) - */ public void writeSUB(GPR dstReg, GPR srcReg) { println("\tsub " + dstReg + "," + srcReg); } @@ -2414,9 +1817,6 @@ println("\tsub " + dstReg + ", [" + srcReg + disp(srcDisp) + "]"); } - ... [truncated message content] |
From: <cr...@us...> - 2009-03-23 09:49:33
|
Revision: 5144 http://jnode.svn.sourceforge.net/jnode/?rev=5144&view=rev Author: crawley Date: 2009-03-23 09:49:28 +0000 (Mon, 23 Mar 2009) Log Message: ----------- Javadoc fixes Modified Paths: -------------- trunk/core/src/classpath/vm/java/lang/ClassLoader.java trunk/core/src/core/org/jnode/vm/compiler/ir/LiveRange.java trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java trunk/core/src/core/org/jnode/vm/compiler/ir/Variable.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConstantRefAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/Quad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnconditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VarReturnQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VoidReturnQuad.java trunk/core/src/core/org/jnode/vm/isolate/LinkMessageFactory.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolateLocal.java trunk/core/src/core/org/jnode/vm/isolate/VmLink.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java Modified: trunk/core/src/classpath/vm/java/lang/ClassLoader.java =================================================================== --- trunk/core/src/classpath/vm/java/lang/ClassLoader.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/classpath/vm/java/lang/ClassLoader.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -742,7 +742,7 @@ * Avoid trying to load the given class via its parent classloader? * * @param name - * @return + * @return {@code true} if the parent classloader should be skipped. */ public boolean skipParentLoader(String name) { return false; Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/LiveRange.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/LiveRange.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/LiveRange.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -28,9 +28,6 @@ private int assignAddress; private int lastUseAddress; - /** - * - */ public LiveRange(Variable<T> v) { this.variable = v; this.assignAddress = v.getAssignAddress(); @@ -46,9 +43,6 @@ return variable; } - /** - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ public int compareTo(LiveRange<T> other) { return assignAddress - other.getVariable().getAssignAddress(); } @@ -64,28 +58,28 @@ } /** - * @return + * @return the address at which the variable is assigned */ public int getAssignAddress() { return assignAddress; } /** - * @return + * @return the address at which the variable is last used */ public int getLastUseAddress() { return lastUseAddress; } /** - * @return + * @return the assigned register location */ public Location<T> getLocation() { return variable.getLocation(); } /** - * @param loc + * @param loc the assigned register location */ public void setLocation(Location<T> loc) { variable.setLocation(loc); Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -70,7 +70,7 @@ } /** - * @return + * @return the sources */ public List<Operand<T>> getSources() { return sources; Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/Variable.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/Variable.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/Variable.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -46,14 +46,14 @@ } /** - * @return + * @return the variable's index */ public int getIndex() { return index; } /** - * @return + * @return the variable's SSA value */ public int getSSAValue() { return ssaValue; @@ -71,14 +71,14 @@ /** * Returns the AssignQuad where this variable was last assigned. * - * @return + * @return the Quad. */ public AssignQuad<T> getAssignQuad() { return assignQuad; } /** - * @return + * @return the address of the last use of this variable. */ public int getLastUseAddress() { return lastUseAddress; @@ -115,7 +115,7 @@ } /** - * @return + * @return the assigned variable location */ public Location<T> getLocation() { return this.location; Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -341,7 +341,7 @@ * simplify will combine phi references and propagate copies * This method will also update liveness of operands by setting last use addr * - * @see org.jnode.vm.compiler.ir.quad.Quad#doPass2(org.jnode.util.BootableHashMap) + * @see org.jnode.vm.compiler.ir.quad.Quad#doPass2() */ public void doPass2() { refs[0] = refs[0].simplify(); Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -45,14 +45,14 @@ } /** - * @return + * @return the start address of the target block */ public int getTargetAddress() { return targetBlock.getStartPC(); } /** - * @return + * @return the target block */ public IRBasicBlock<T> getTargetBlock() { return targetBlock; Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -121,21 +121,21 @@ } /** - * @return + * @return the first operand */ public Operand<T> getOperand1() { return refs[0]; } /** - * @return + * @return the second operand */ public Operand<T> getOperand2() { return refs[1]; } /** - * @return + * @return the branch condition */ public BranchCondition getCondition() { return condition; @@ -152,9 +152,6 @@ } } - /** - * @see org.jnode.vm.compiler.ir.Quad#doPass2(org.jnode.util.BootableHashMap) - */ public void doPass2() { refs[0] = refs[0].simplify(); if (refs.length > 1 && refs[1] != null) { @@ -162,9 +159,6 @@ } } - /** - * @see org.jnode.vm.compiler.ir.Quad#generateCode(org.jnode.vm.compiler.ir.CodeGenerator) - */ public void generateCode(CodeGenerator<T> cg) { // cg.generateCodeFor(this); if (condition.isBinary()) { Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConstantRefAssignQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConstantRefAssignQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConstantRefAssignQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -56,37 +56,24 @@ } /** - * @return + * @return the RHS of the assignment */ public Constant<T> getRHS() { return rhs; } - /** - * @param operand - * @return - */ public Operand<T> propagate(Variable<T> operand) { setDeadCode(true); return rhs; } - /** - * @see org.jnode.vm.compiler.ir.Quad#doPass2(org.jnode.util.BootableHashMap) - */ public void doPass2() { } - /** - * @see org.jnode.vm.compiler.ir.Quad#generateCode(org.jnode.vm.compiler.ir.CodeGenerator) - */ public void generateCode(CodeGenerator<T> cg) { cg.generateCodeFor(this); } - /** - * @see org.jnode.vm.compiler.ir.AssignQuad#getLHSLiveAddress() - */ public int getLHSLiveAddress() { return this.getAddress() + 1; } Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -54,47 +54,29 @@ return phi; } - /** - * @see org.jnode.vm.compiler.ir.quad.AssignQuad#propagate(org.jnode.vm.compiler.ir.Variable) - */ public Operand<T> propagate(Variable<T> operand) { return operand; } - /** - * @see org.jnode.vm.compiler.ir.quad.AssignQuad#getLHSLiveAddress() - */ public int getLHSLiveAddress() { // TODO Auto-generated method stub return 0; } - /** - * @see org.jnode.vm.compiler.ir.quad.Quad#getReferencedOps() - */ public Operand<T>[] getReferencedOps() { // TODO Auto-generated method stub return null; } - /** - * @see org.jnode.vm.compiler.ir.quad.Quad#doPass2(org.jnode.util.BootableHashMap) - */ public void doPass2() { phi.simplify(); } - /** - * @see org.jnode.vm.compiler.ir.quad.Quad#generateCode(org.jnode.vm.compiler.ir.CodeGenerator) - */ public void generateCode(CodeGenerator cg) { // TODO Auto-generated method stub } - /** - * @see java.lang.Object#equals(java.lang.Object) - */ public boolean equals(Object obj) { if (obj instanceof PhiAssignQuad) { PhiAssignQuad<T> paq = (PhiAssignQuad<T>) obj; Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/Quad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/Quad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/Quad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -89,7 +89,7 @@ } /** - * @return + * @return {@code true} if this is dead code. */ public boolean isDeadCode() { return deadCode; @@ -103,7 +103,7 @@ } /** - * @return + * @return the basic block */ public IRBasicBlock<T> getBasicBlock() { return basicBlock; Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -51,22 +51,19 @@ refs = new Operand[]{getOperand(varIndex)}; } - /** - * @see org.jnode.vm.compiler.ir.Quad#getReferencedOps() - */ public Operand<T>[] getReferencedOps() { return refs; } /** - * @return + * @return the operand */ public Operand<T> getOperand() { return refs[0]; } /** - * @return + * @return the operation */ public UnaryOperation getOperation() { return operation; @@ -77,11 +74,8 @@ operation.name() + " " + refs[0].toString(); } - /** - * @see org.jnode.vm.compiler.ir.AssignQuad#propagate(org.jnode.vm.compiler.ir.Variable) - */ - // TODO should fold constants, see BinaryQuad::propagate(...) public Operand<T> propagate(Variable<T> operand) { + // TODO should fold constants, see BinaryQuad::propagate(...) Quad<T> quad = foldConstants(); if (quad instanceof ConstantRefAssignQuad) { //setDeadCode(true); @@ -180,16 +174,10 @@ } - /** - * @see org.jnode.vm.compiler.ir.Quad#doPass2(org.jnode.util.BootableHashMap) - */ public void doPass2() { refs[0] = refs[0].simplify(); } - /** - * @see org.jnode.vm.compiler.ir.Quad#generateCode(org.jnode.vm.compiler.ir.CodeGenerator) - */ public void generateCode(CodeGenerator<T> cg) { Variable<T> lhs = getLHS(); Location<T> lhsLoc = lhs.getLocation(); @@ -241,9 +229,6 @@ } } - /** - * @see org.jnode.vm.compiler.ir.AssignQuad#getLHSLiveAddress() - */ public int getLHSLiveAddress() { return this.getAddress() + 1; } Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnconditionalBranchQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnconditionalBranchQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnconditionalBranchQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -36,16 +36,10 @@ super(address, block, targetAddress); } - /** - * @see org.jnode.vm.compiler.ir.Quad#getDefinedOp() - */ public Operand<T> getDefinedOp() { return null; } - /** - * @see org.jnode.vm.compiler.ir.Quad#getReferencedOps() - */ public Operand<T>[] getReferencedOps() { return null; } @@ -54,15 +48,9 @@ return getAddress() + ": goto " + getTargetBlock(); } - /** - * @see org.jnode.vm.compiler.ir.Quad#doPass2(org.jnode.util.BootableHashMap) - */ public void doPass2() { } - /** - * @see org.jnode.vm.compiler.ir.Quad#generateCode(org.jnode.vm.compiler.ir.CodeGenerator) - */ public void generateCode(CodeGenerator<T> cg) { cg.generateCodeFor(this); } Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VarReturnQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VarReturnQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VarReturnQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -38,20 +38,17 @@ refs = new Operand[]{getOperand(varIndex)}; } - /** - * @see org.jnode.vm.compiler.ir.quad.Quad#getDefinedOp() - */ public Operand<T> getDefinedOp() { return null; } - /** - * @see org.jnode.vm.compiler.ir.quad.Quad#getReferencedOps() - */ public Operand<T>[] getReferencedOps() { return refs; } + /** + * @return the operand for the 'return' + */ public Operand<T> getOperand() { return refs[0]; } @@ -60,16 +57,10 @@ return getAddress() + ": return " + refs[0]; } - /** - * @see org.jnode.vm.compiler.ir.Quad#doPass2(org.jnode.util.BootableHashMap) - */ public void doPass2() { refs[0] = refs[0].simplify(); } - /** - * @see org.jnode.vm.compiler.ir.Quad#generateCode(org.jnode.vm.compiler.ir.CodeGenerator) - */ public void generateCode(CodeGenerator<T> cg) { cg.generateCodeFor(this); } Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -51,9 +51,6 @@ refs = new Operand[]{rhs}; } - /** - * @see org.jnode.vm.compiler.ir.quad.Quad#getReferencedOps() - */ public Operand<T>[] getReferencedOps() { return refs; } @@ -63,40 +60,27 @@ } /** - * @return + * @return the RHS of the assignment */ public Operand<T> getRHS() { return refs[0]; } - /** - * @param operand - * @return - */ public Operand<T> propagate(Variable<T> operand) { setDeadCode(true); return refs[0]; } - /** - * @see org.jnode.vm.compiler.ir.Quad#doPass2(org.jnode.util.BootableHashMap) - */ - // This operation will almost always become dead code, but I wanted to play it - // safe and compute liveness assuming it might survive. public void doPass2() { + // This operation will almost always become dead code, but I wanted to play it + // safe and compute liveness assuming it might survive. refs[0] = refs[0].simplify(); } - /** - * @see org.jnode.vm.compiler.ir.Quad#generateCode(org.jnode.vm.compiler.ir.CodeGenerator) - */ public void generateCode(CodeGenerator<T> cg) { cg.generateCodeFor(this); } - /** - * @see org.jnode.vm.compiler.ir.AssignQuad#getLHSLiveAddress() - */ public int getLHSLiveAddress() { return this.getAddress() + 1; } Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VoidReturnQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VoidReturnQuad.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VoidReturnQuad.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -35,16 +35,10 @@ super(address, block); } - /** - * @see org.jnode.vm.compiler.ir.quad.Quad#getDefinedOp() - */ public Operand<T> getDefinedOp() { return null; } - /** - * @see org.jnode.vm.compiler.ir.quad.Quad#getReferencedOps() - */ public Operand<T>[] getReferencedOps() { return null; } @@ -53,15 +47,9 @@ return getAddress() + ": return"; } - /** - * @see org.jnode.vm.compiler.ir.Quad#doPass2(org.jnode.util.BootableHashMap) - */ public void doPass2() { } - /** - * @see org.jnode.vm.compiler.ir.Quad#generateCode(org.jnode.vm.compiler.ir.CodeGenerator) - */ public void generateCode(CodeGenerator<T> cg) { cg.generateCodeFor(this); } Modified: trunk/core/src/core/org/jnode/vm/isolate/LinkMessageFactory.java =================================================================== --- trunk/core/src/core/org/jnode/vm/isolate/LinkMessageFactory.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/isolate/LinkMessageFactory.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -33,7 +33,7 @@ * Create a LinkMessage containing the given link messages. * * @param messages - * @return + * @return the LinkMessage */ public static LinkMessage newCompositeMessage(LinkMessage... messages) { throw new UnsupportedOperationException(); @@ -43,7 +43,7 @@ * Create a LinkMessage containing the given data. * * @param bytes - * @return + * @return the LinkMessage */ public static LinkMessage newDataMessage(byte[] bytes, int offset, int length) { return new DataLinkMessage(bytes, offset, length); @@ -53,7 +53,7 @@ * Create a LinkMessage containing the given isolate. * * @param isolate - * @return + * @return the LinkMessage */ public static LinkMessage newIsolateMessage(VmIsolate isolate) { throw new UnsupportedOperationException(); @@ -62,7 +62,7 @@ /** * Create a LinkMessage containing the given link. * - * @return + * @return the LinkMessage */ public static LinkMessage newLinkMessage(Link link) { return new LinkLinkMessage(((LinkImpl) link).getImpl()); @@ -71,7 +71,7 @@ /** * Create a LinkMessage containing the given server socket. * - * @return + * @return the LinkMessage */ public static LinkMessage newServerSocketMessage(ServerSocket socket) { throw new UnsupportedOperationException(); @@ -80,7 +80,7 @@ /** * Create a LinkMessage containing the given socket. * - * @return + * @return the LinkMessage */ public static LinkMessage newSocketMessage(Socket socket) { throw new UnsupportedOperationException(); @@ -90,7 +90,7 @@ * Create a LinkMessage containing the given string. * * @param string - * @return + * @return the LinkMessage */ public static LinkMessage newStringMessage(String string) { return new StringLinkMessage(string); Modified: trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java =================================================================== --- trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -346,7 +346,7 @@ /** * Gets the current isolate. * - * @return + * @return the current isolate */ public static VmIsolate currentIsolate() { VmIsolate result = IsolatedStaticData.current; @@ -377,7 +377,7 @@ /** * Gets the isolate object that this object implements. * - * @return + * @return the exposed Isolate object */ public final Isolate getIsolate() { return isolate; @@ -574,7 +574,7 @@ /** * Has this isolate reached the exited state. * - * @return + * @return {@code true} if the isolate has 'exited', otherwise {@code false} */ public final boolean hasExited() { switch (state) { @@ -589,7 +589,7 @@ /** * Has this isolate reached the terminated state. * - * @return + * @return {@code true} if the isolate has 'terminated', otherwise {@code false} */ public final boolean hasTerminated() { switch (state) { @@ -603,7 +603,7 @@ /** * Has this isolate reached the started state. * - * @return + * @return {@code true} if the isolate has been 'started', otherwise {@code false} */ public final boolean hasStarted() { switch (state) { Modified: trunk/core/src/core/org/jnode/vm/isolate/VmIsolateLocal.java =================================================================== --- trunk/core/src/core/org/jnode/vm/isolate/VmIsolateLocal.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/isolate/VmIsolateLocal.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -38,7 +38,7 @@ /** * Gets the stored object reference. * - * @return + * @return the stored object reference */ public T get() { if (VmIsolate.isRoot()) { Modified: trunk/core/src/core/org/jnode/vm/isolate/VmLink.java =================================================================== --- trunk/core/src/core/org/jnode/vm/isolate/VmLink.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/isolate/VmLink.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -52,7 +52,7 @@ * * @param sender * @param receiver - * @return + * @return the new Link */ public static Link newLink(VmIsolate sender, VmIsolate receiver) { if (sender == receiver) { @@ -78,7 +78,7 @@ /** * Gets this shared link as Link instance. * - * @return + * @return the Link instance */ public final Link asLink() { final LinkImpl link = linkHolder.get(); @@ -110,7 +110,7 @@ /** * Is this link currently open. * - * @return + * @return {@code true} if the link is open, otherwise {@code false}. */ final boolean isOpen() { return !closed; Modified: trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java 2009-03-22 14:45:17 UTC (rev 5143) +++ trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java 2009-03-23 09:49:28 UTC (rev 5144) @@ -394,9 +394,9 @@ } /** - * Output a debug message controlled by the heap trace flags. + * Output a a number as debug message controlled by the heap trace flags. * - * @param text + * @param number */ protected void debug(int number) { if ((heapFlags & TRACE_FLAGS) != 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-03-23 13:52:42
|
Revision: 5146 http://jnode.svn.sourceforge.net/jnode/?rev=5146&view=rev Author: crawley Date: 2009-03-23 13:52:30 +0000 (Mon, 23 Mar 2009) Log Message: ----------- Javadoc fixes Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/x86/performance/X86PerformanceCounters.java trunk/core/src/core/org/jnode/work/WorkPlugin.java trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBaseAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceConfig.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType0.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType1.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType2.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PMCapability.java trunk/core/src/driver/org/jnode/driver/console/Console.java trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/KeyEventBindings.java trunk/core/src/driver/org/jnode/driver/console/TextConsole.java trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardHandler.java trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java trunk/core/src/driver/org/jnode/driver/input/KeyboardAPIAdapter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java trunk/core/src/driver/org/jnode/driver/input/MouseProtocolHandler.java Modified: trunk/core/src/core/org/jnode/vm/x86/performance/X86PerformanceCounters.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/performance/X86PerformanceCounters.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/core/org/jnode/vm/x86/performance/X86PerformanceCounters.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -32,6 +32,9 @@ import org.vmmagic.pragma.Uninterruptible; /** + * Base class for x86 performance counters. The base-class behavior is to provide no + * meaningful support for counters. + * * @author Ewout Prangsma (ep...@us...) */ public class X86PerformanceCounters extends PerformanceCounters implements Uninterruptible { @@ -40,7 +43,7 @@ * Create the appropriate instance for the specific cpu. * * @param id - * @return + * @return a new counter instance */ public static final X86PerformanceCounters create(VmX86Processor processor, X86CpuID id) { @@ -85,30 +88,18 @@ this.cpu = cpu; } - /** - * @see org.jnode.vm.performance.PerformanceCounters#getAvailableEvents()() - */ public Set<PerformanceCounterEvent> getAvailableEvents() { return Collections.emptySet(); } - /** - * @see org.jnode.vm.performance.PerformanceCounters#getAvailableEvent(java.lang.String) - */ public PerformanceCounterEvent getAvailableEvent(String id) { return null; } - /** - * @see org.jnode.vm.performance.PerformanceCounters#getMaximumCounters() - */ public final int getMaximumCounters() { return maxCounters; } - /** - * @see org.jnode.vm.performance.PerformanceCounters#getCounters(long[]) - */ public final void getCounterValues(long[] counters) { // Force a read of the counters by yielding UnsafeX86.saveMSRs(); @@ -126,10 +117,6 @@ // Override me } - /** - * @see org.jnode.vm.performance.PerformanceCounters# - * startCounters(org.jnode.vm.performance.PerformanceCounterEvent[]) - */ public final void startCounters(PerformanceCounterEvent[] events) throws IllegalArgumentException { // Test if the events array is not too long @@ -153,19 +140,11 @@ } - /** - * Stop the counters on the given thread. - * - * @see org.jnode.vm.performance.PerformanceCounters#stopCounters() - */ protected void startCounters(PerformanceCounterEvent[] events, VmX86Thread thread) throws IllegalArgumentException { // Override me } - /** - * @see org.jnode.vm.performance.PerformanceCounters#stopCounters() - */ public final void stopCounters() { // TODO Implement me final VmX86Thread thread = (VmX86Thread) cpu.getCurrentThread(); @@ -176,10 +155,9 @@ } /** - * Start the counters on the given thread. - * - * @see org.jnode.vm.performance.PerformanceCounters# - * startCounters(org.jnode.vm.performance.PerformanceCounterEvent[]) + * Stop the counters on the given thread. + * + * @param thread */ protected void stopCounters(VmX86Thread thread) throws IllegalArgumentException { // Override me Modified: trunk/core/src/core/org/jnode/work/WorkPlugin.java =================================================================== --- trunk/core/src/core/org/jnode/work/WorkPlugin.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/core/org/jnode/work/WorkPlugin.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -132,7 +132,7 @@ /** * Gets the number of entries in the work queue. * - * @return + * @return the number entries */ public final int queueSize() { return queue.size(); @@ -141,7 +141,7 @@ /** * Is the work queue empty. * - * @return + * @return {@code true} if the queue is empty, otherwise {@code false}. */ public final boolean isEmpty() { return queue.isEmpty(); Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -31,10 +31,12 @@ * Offset of this capability in the device config space */ private final int offset; + /** * The device this is a capability of */ private final PCIDevice device; + /** * The capability id */ @@ -50,22 +52,27 @@ * Power Management */ public static final int PM = 0x01; + /** * Accelerated Graphics Port */ public static final int AGP = 0x02; + /** * Vital Product Data */ public static final int VPD = 0x03; + /** * Slot Identification */ public static final int SLOTID = 0x04; + /** * Message Signalled Interrupts */ public static final int MSI = 0x05; + /** * CompactPCI HotSwap */ @@ -95,7 +102,7 @@ * * @param device * @param offset - * @return + * @return the Capability created */ static final Capability createCapability(PCIDevice device, int offset) { final int id = device.readConfigByte(offset + PCI_CAP_LIST_ID); @@ -127,11 +134,6 @@ return id; } - /** - * Convert to a string representation. - * - * @see java.lang.Object#toString() - */ public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("id=0x"); Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBaseAddress.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBaseAddress.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBaseAddress.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -42,37 +42,44 @@ * Is this base address in IO Space? */ private final boolean isIO; + /** * The base address in the IO space */ private final int ioAddress; + /** * Memory type */ private final byte memType; + /** * The base address in the memory space */ private final long memAddress; + /** * Must a memory address be relocated below 1Mb? */ private final boolean below1Mb; + /** * Is this a 64-bit memory address? */ private final boolean b64; + /** * Size of the address space */ private final int size; /** - * Read a base address at a given index (0..5) + * Read a base address at a given index in a Device's config data. * * @param dev - * @param index - * @return + * @param address0Offset + * @param index an index in the range 0 ... 5 inclusive + * @return the base address */ public static PCIBaseAddress read(PCIDevice dev, int address0Offset, int index) { if ((index < 0) || (index > 5)) { Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceConfig.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceConfig.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceConfig.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -49,34 +49,42 @@ * My device */ protected final PCIDevice device; + /** * My device ID */ private final int deviceID; + /** * The vendor ID */ private final int vendorID; + /** * The major class */ private final int majorClass; + /** * The sub class */ private final int subClass; + /** * The minor class */ private int minorClass; + /** * The revision */ private final int revision; + /** * The header type */ private final int headerTypeRaw; + /** * The list of capabilities */ @@ -104,7 +112,7 @@ * based on the header type of the device configuration settings. * * @param device - * @return + * @return the config instance */ static final PCIDeviceConfig createConfig(PCIDevice device) { final int headerTypeRaw = device.readConfigByte(PCI_HEADER_TYPE); @@ -136,7 +144,7 @@ * @param bus * @param unit * @param func - * @return + * @return the ID */ static final int getDeviceID(PCIDriver pci, int bus, int unit, int func) { return pci.readConfigWord(bus, unit, func, PCI_DEVICE_ID); @@ -309,7 +317,7 @@ /** * Gets all capabilities. * - * @return + * @return the device capabilities */ public final Collection<Capability> getCapabilities() { if (capabilities == null) { @@ -321,7 +329,7 @@ /** * Is this a header type 0 configuration. * - * @return + * @return {@code true} if this is a type 0 configuration. */ public final boolean isHeaderType0() { return (getHeaderType() == HEADER_TYPE_NORMAL); @@ -330,7 +338,7 @@ /** * Is this a header type 1 configuration. * - * @return + * @return {@code true} if this is a type 1 configuration. */ public final boolean isHeaderType1() { return (getHeaderType() == HEADER_TYPE_BRIDGE); @@ -339,7 +347,7 @@ /** * Is this a header type 2 configuration. * - * @return + * @return {@code true} if this is a type 2 configuration. */ public final boolean isHeaderType2() { return (getHeaderType() == HEADER_TYPE_CARDBUS); @@ -348,7 +356,7 @@ /** * Gets this configuration as a header type 0 (normal devices) accessor. * - * @return + * @return the configuration * @throws ClassCastException If header type != 0. */ public final PCIHeaderType0 asHeaderType0() { @@ -358,7 +366,7 @@ /** * Gets this configuration as a header type 1 (pci-pci bridge) accessor. * - * @return + * @return the configuration * @throws ClassCastException If header type != 1. */ public final PCIHeaderType1 asHeaderType1() { @@ -368,18 +376,13 @@ /** * Gets this configuration as a header type 2 (cardbus bridge) accessor. * - * @return + * @return the configuration * @throws ClassCastException If header type != 2. */ public final PCIHeaderType2 asHeaderType2() { return (PCIHeaderType2) this; } - /** - * Convert myself to a String representation. - * - * @see java.lang.Object#toString() - */ public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("device=0x"); @@ -424,16 +427,16 @@ * Gets a 32-bit int from the device's configuration space. * * @param offset Byte offset of the requested dword. - * @return + * @return the value fetched. */ public int getDWord(int offset) { return device.readConfigDword(offset); } /** - * Read the capability list. + * Load the capability map from the device's configuration space. * - * @return + * @return the capability map */ private Map<Integer, Capability> readCapabilities() { if ((getStatus() & PCI_STATUS_CAP_LIST) == 0) { Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType0.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType0.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType0.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -60,7 +60,7 @@ /** * Gets the resource addresses. * - * @return + * @return the resource addresses */ public final PCIBaseAddress[] getBaseAddresses() { PCIBaseAddress[] addresses = new PCIBaseAddress[6]; @@ -116,17 +116,14 @@ } /** - * Gets the ROM base address, or null is no rom is found. + * Gets the ROM base address, or {@code null} if no ROM is found. * - * @return + * @return the ROM addres or {@code null} */ public final PCIRomAddress getRomAddress() { return romAddress; } - /** - * @see org.jnode.driver.bus.pci.PCIDeviceConfig#toString() - */ public final String toString() { final StringBuilder sb = new StringBuilder(super.toString()); if (getInterruptPin() != 0) { Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType1.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType1.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType1.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -172,9 +172,6 @@ return device.readConfigByte(PCI_SUBORDINATE_BUS); } - /** - * @see org.jnode.driver.pci.PCIDeviceConfig#toString() - */ public String toString() { return super.toString() + ", " + "primary-bus=" + getPrimaryBus() + ", " + "secondary-bus=" + getSecondaryBus() Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType2.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType2.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType2.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -96,9 +96,6 @@ return device.readConfigByte(PCI_CB_SUBORDINATE_BUS); } - /** - * @see org.jnode.driver.pci.PCIDeviceConfig#toString() - */ public String toString() { return super.toString() + ", " + "primary-bus=" + getPrimaryBus() + ", " + "card-bus=" + getCardBus() Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -93,14 +93,16 @@ /** * Is the ROM base address enabled. * - * @return + * @return {@code true} if the base address is enabled, otherwise {@code false}. */ public final boolean isEnabled() { return ((dev.readConfigDword(offset) & PCI_ROM_ADDRESS_ENABLE) != 0); } /** - * Enable/disable the ROM + * Enable/disable the ROM. + * + * @param enabled {@code true} to enable, {@code false} to disable. */ public final void setEnabled(boolean enabled) { int v = dev.readConfigDword(offset); @@ -112,11 +114,6 @@ dev.writeConfigDword(offset, v); } - /** - * Convert this to a String representation - * - * @see java.lang.Object#toString() - */ public String toString() { final int base = getRomBase(); return NumberUtils.hex(getRomBase()) + "-" + NumberUtils.hex(base + size - 1) + Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/PMCapability.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/PMCapability.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/PMCapability.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -38,7 +38,7 @@ /** * Gets the power management capabilities. * - * @return + * @return the capability word */ public final int getCapabilities() { return readConfigWord(0x02); @@ -47,7 +47,7 @@ /** * Gets the status register. * - * @return + * @return the status register address */ public final int getStatus() { return readConfigWord(0x04); @@ -56,7 +56,7 @@ /** * Gets the data register. * - * @return + * @return the data register address */ public final int getData() { return readConfigByte(0x07); @@ -65,7 +65,7 @@ /** * Gets the bridge support register. * - * @return + * @return the bridge support register address */ public final int getBridgeSupportExtensions() { return readConfigByte(0x06); Modified: trunk/core/src/driver/org/jnode/driver/console/Console.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/console/Console.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/console/Console.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -32,9 +32,9 @@ PointerListener { /** - * Has this control the focus. + * Does this console have focus. * - * @return + * @return {@code true} if the console has focus, otherwise {@code false}. */ public boolean isFocused(); @@ -108,7 +108,7 @@ /** * Gets the manager this console is registered with. * - * @return + * @return the {@link ConsoleManager} */ public ConsoleManager getManager(); Modified: trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -48,35 +48,35 @@ * Gets the console with the given accelerator keycode. * * @param keyCode - * @return + * @return The console */ public Console getConsoleByAccelerator(int keyCode); /** - * Gets the names of all registers consoles. + * Gets the names of all consoles currently registered * - * @return + * @return a set of console names. */ public Set<String> getConsoleNames(); /** - * Register a new console. + * Add a new console. * - * @param console + * @param console the console to be registered. */ public void registerConsole(Console console); /** - * Remove an already registered console. + * Remove a currently registered console. * - * @param console + * @param console the console to be unregistered. */ public void unregisterConsole(Console console); /** - * Gets the currently focused console. + * Gets the console that currently has focus. * - * @return Console + * @return the focussed console */ public Console getFocus(); @@ -97,14 +97,14 @@ /** * Return the parent of this console manager. * - * @return + * @return the parent or {@code null}. */ public ConsoleManager getParent(); /** * Set the parent of this console manager. * - * @param parent + * @param parent the new parent */ public void setParent(ConsoleManager parent); @@ -135,18 +135,19 @@ public static final int STACKED = 0x08; /** - * Do not create a line-editting input stream for the console. + * Do not create a line-editing input stream for the console. * The console's input will be whatever System.in currently is. */ public static final int NO_LINE_EDITTING = 0x10; } /** - * Create a new console. + * Create a new console with given properties and optionally a given name. * - * @param name The name of the new console, or null for an automatic name. - * @param options The options that determine the type of console to create. - * @return + * @param name The name of the new console, or {@code null} for an automatic name. + * @param options The options that determine the properties of console to be created; + * see {@link CreateOptions}. + * @return the new console. */ public Console createConsole(String name, int options); Modified: trunk/core/src/driver/org/jnode/driver/console/KeyEventBindings.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/console/KeyEventBindings.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/console/KeyEventBindings.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -63,7 +63,7 @@ } /** - * Reset the bindings to the state created by the constructor {@link #KeyEventBindings()}. + * Reset the bindings to the state created by the constructor. */ public void clear() { charMap = new CodeMap(this.defaultCharAction); @@ -73,7 +73,7 @@ /** * Lookup the action for a given KeyboardEvent. * - * @param ch the character + * @param event the event * @return the corresponding action. */ public T getKeyboardEventAction(KeyboardEvent event) { Modified: trunk/core/src/driver/org/jnode/driver/console/TextConsole.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/console/TextConsole.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/console/TextConsole.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -217,7 +217,7 @@ /** * Set the console's input completer * - * @param The new completer or <code>null</code>. + * @param completer The new completer or <code>null</code>. */ public void setCompleter(InputCompleter completer); Modified: trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardHandler.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardHandler.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardHandler.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -67,7 +67,7 @@ * Get the next KeyboardEvent from the internal queue (and wait if none is * available). * - * @return + * @return the next event */ public final KeyboardEvent getEvent() { return queue.get(); Modified: trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -472,7 +472,7 @@ /** * Get the options used to create this {@link TextScreenConsole} - * @return + * @return the options. */ final int getOptions() { return options; Modified: trunk/core/src/driver/org/jnode/driver/input/KeyboardAPIAdapter.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/KeyboardAPIAdapter.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/input/KeyboardAPIAdapter.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -38,14 +38,12 @@ * All listeners */ private final ArrayList<KeyboardListener> listeners = new ArrayList<KeyboardListener>(); + /** * The interpreter */ private KeyboardInterpreter interpreter = null/*new KeyboardInterpreter()*/; - /** - * @see org.jnode.driver.input.KeyboardAPI#addKeyboardListener(org.jnode.driver.input.KeyboardListener) - */ public synchronized void addKeyboardListener(KeyboardListener l) { listeners.add(l); } @@ -68,23 +66,14 @@ } } - /** - * @see org.jnode.driver.input.KeyboardAPI#getKbInterpreter() - */ public KeyboardInterpreter getKbInterpreter() { return interpreter; } - /** - * @see org.jnode.driver.input.KeyboardAPI#removeKeyboardListener(org.jnode.driver.input.KeyboardListener) - */ public synchronized void removeKeyboardListener(KeyboardListener l) { listeners.remove(l); } - /** - * @see org.jnode.driver.input.KeyboardAPI#setKbInterpreter(org.jnode.driver.input.AbstractKeyboardInterpreter) - */ public void setKbInterpreter(KeyboardInterpreter kbInterpreter) { if (kbInterpreter == null) { throw new IllegalArgumentException("kbInterpreter==null"); Modified: trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -50,15 +50,18 @@ public static final int XT_EXTENDED = 0xE0; /** - * Interpret a given scancode into a keyevent. + * Interpret a given scancode as a KeyboardEvent. * - * @param scancode + * @param scancode a scancode + * @return the corresponding KeyboardEvent */ public KeyboardEvent interpretScancode(int scancode); /** - * @param keycode - * @return + * Interpret a given keycode as a KeyboardEvent. + * + * @param keycode a keycode + * @return the corresponding KeyboardEvent * @throws UnsupportedKeyException */ public KeyboardEvent interpretKeycode(int keycode); Modified: trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -132,7 +132,7 @@ * Create a new keyboard interpreter object. Note that keyboard interpreter * objects are stateful and therefore cannot be shared by multiple keyboards. * - * @param a keyboard layout name or identifier. + * @param id a keyboard layout name or identifier. * @return a KeyboardInterpreter * @throws KeyboardInterpreterException */ Modified: trunk/core/src/driver/org/jnode/driver/input/MouseProtocolHandler.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/MouseProtocolHandler.java 2009-03-23 12:46:23 UTC (rev 5145) +++ trunk/core/src/driver/org/jnode/driver/input/MouseProtocolHandler.java 2009-03-23 13:52:30 UTC (rev 5146) @@ -28,7 +28,7 @@ /** * Gets the name of the protocol of this handler. * - * @return String + * @return the protocol name */ public String getName(); @@ -36,22 +36,22 @@ * Does this protocol handler support a given mouse id. * * @param id - * @return True if this handler supports the given id, false otherwise. + * @return {@code true} if this handler supports the given id, {@code false} otherwise. */ public boolean supportsId(int id); /** * Gets the size in bytes of a single packet in this protocol. * - * @return + * @return the size of a packet */ public int getPacketSize(); /** - * Create an event based of the given data packet. + * Create an event based on the supplied data packet. * - * @param data - * @return + * @param data a data packet + * @return a PointerEvent */ public PointerEvent buildEvent(byte[] data); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-03-24 12:32:47
|
Revision: 5148 http://jnode.svn.sourceforge.net/jnode/?rev=5148&view=rev Author: crawley Date: 2009-03-24 12:32:31 +0000 (Tue, 24 Mar 2009) Log Message: ----------- Javadoc fixes Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java trunk/core/src/driver/org/jnode/driver/console/TextConsole.java trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiSystemTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/SystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/firmware/AcpiDevice.java trunk/core/src/driver/org/jnode/driver/textscreen/TextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenUtils.java trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLElement.java trunk/core/src/test/org/jnode/test/ResourceTest.java trunk/core/src/test/org/jnode/test/core/ProxyTest.java Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -166,7 +166,7 @@ } /** - * @param quad + * @param q a quad */ public void add(Quad<T> q) { addDef(q); @@ -216,7 +216,7 @@ } /** - * @return + * @return the predecessors */ public List<IRBasicBlock<T>> getPredecessors() { return predecessors; @@ -358,7 +358,8 @@ } /** - * @return {@code if this block is the start of an exception handler + * @return {@code true} if this block is the start of an exception handler, + * otherwise {@code false} */ public boolean isStartOfExceptionHandler() { return startOfExceptionHandler; Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -52,7 +52,7 @@ /** * Create all determined basic blocks * - * @return + * @return the blocks. */ public IRBasicBlock<T>[] createBasicBlocks() { // Sort the blocks on start PC Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -44,7 +44,7 @@ /** * @param dfb - * @param def + * @param lhsIndex */ public PhiAssignQuad(IRBasicBlock<T> dfb, int lhsIndex) { this(dfb.getStartPC(), dfb, lhsIndex); Modified: trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java =================================================================== --- trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -784,7 +784,7 @@ if (executor == null) { executor = AccessController.doPrivileged(new PrivilegedAction<ExecutorService>() { public ExecutorService run() { - return Executors.newSingleThreadExecutor(new IsolateThreadFactory2(VmIsolate.this)); + return Executors.newSingleThreadExecutor(new IsolateThreadFactory(VmIsolate.this)); } }); } @@ -1102,7 +1102,7 @@ /** * Returns the VmIsolate instance which created this VmIsolate instance. * - * @return + * @return the creator */ public VmIsolate getCreator() { return creator; Modified: trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -279,7 +279,7 @@ * Gets the stack pointer of this thread. * Valid only when the thread is not running. * - * @return + * @return the stack pointer */ public final Address getStackPointer() { return esp; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -129,7 +129,7 @@ /** * Create a clone of this item, which must be a constant. * - * @return + * @return the clone */ protected abstract DoubleWordItem cloneConstant(EmitterContext ec); @@ -148,7 +148,7 @@ * Gets the offset from the LSB part of this item to the FramePointer * register. This is only valid if this item has a LOCAL kind. * - * @return + * @return the offset */ final int getLsbOffsetToFP(EmitterContext ec) { return super.getOffsetToFP(ec); @@ -157,7 +157,7 @@ /** * Gets the register holding the LSB part of this item in 32-bit mode. * - * @return + * @return the register */ final X86Register.GPR getLsbRegister(EmitterContext ec) { if (!ec.getStream().isCode32()) { @@ -174,7 +174,7 @@ * Gets the offset from the MSB part of this item to the FramePointer * register. This is only valid if this item has a LOCAL kind. * - * @return + * @return the offset */ final int getMsbOffsetToFP(EmitterContext ec) { return super.getOffsetToFP(ec) + 4; @@ -183,7 +183,7 @@ /** * Gets the register holding the MSB part of this item in 32-bit mode. * - * @return + * @return the register */ final X86Register.GPR getMsbRegister(EmitterContext ec) { if (!ec.getStream().isCode32()) { @@ -199,7 +199,7 @@ /** * Gets the register holding this item in 64-bit mode. * - * @return + * @return the register */ final X86Register.GPR64 getRegister(EmitterContext ec) { if (!ec.getStream().isCode64()) { Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -128,7 +128,7 @@ /** * Gets the capability ID. * - * @return + * @return the id */ public final int getId() { return id; Modified: trunk/core/src/driver/org/jnode/driver/console/TextConsole.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/console/TextConsole.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/console/TextConsole.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -176,21 +176,21 @@ * characters are the result of processing keyboard events, performing line * editing and completion. * - * @return + * @return the Reader */ public Reader getIn(); /** * Gets the Writer that receives 'error' output for this console. * - * @return + * @return the error Writer */ public Writer getErr(); /** * Gets the Writer that receives 'normal' output for this console. * - * @return + * @return the normal Writer */ public Writer getOut(); Modified: trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -224,81 +224,51 @@ return tabSize; } - /** - * @param tabSize The tabSize to set. - */ @Override public void setTabSize(int tabSize) { this.tabSize = tabSize; } - /** - * @see org.jnode.driver.console.TextConsole#getColor(int, int) - */ @Override public int getColor(int x, int y) { return screen.getColor(screen.getOffset(x, y)); } - /** - * @see org.jnode.driver.console.TextConsole#getChar(int, int) - */ @Override public char getChar(int x, int y) { return screen.getChar(screen.getOffset(x, y)); } - /** - * @see org.jnode.driver.console.TextConsole#getCursorX() - */ @Override public int getCursorX() { return curX; } - /** - * @see org.jnode.driver.console.TextConsole#getCursorY() - */ @Override public int getCursorY() { return curY; } - /** - * @see org.jnode.driver.console.TextConsole#getHeight() - */ @Override public int getHeight() { return screen.getHeight(); } - /** - * @see org.jnode.driver.console.TextConsole#getWidth() - */ @Override public int getWidth() { return screen.getWidth(); } - /** - * @see org.jnode.driver.console.TextConsole#getHeight() - */ @Override public int getDeviceHeight() { return screen.getDeviceHeight(); } - /** - * @see org.jnode.driver.console.TextConsole#getWidth() - */ @Override public int getDeviceWidth() { return screen.getDeviceWidth(); } - /** - * @see org.jnode.driver.console.TextConsole#setChar(int, int, char, int) - */ @Override public void setChar(int x, int y, char ch, int color) { int offset = screen.getOffset(x, y); @@ -320,9 +290,6 @@ syncScreen(offset, cLength); } - /** - * @see org.jnode.driver.console.TextConsole#setCursor(int, int) - */ @Override public void setCursor(int x, int y) { this.curX = x; @@ -371,9 +338,6 @@ } } - /** - * @see org.jnode.driver.console.TextConsole#getIn() - */ @Override public Reader getIn() { return in; @@ -383,17 +347,11 @@ this.in = in; } - /** - * @see org.jnode.driver.console.TextConsole#getErr() - */ @Override public Writer getErr() { return err; } - /** - * @see org.jnode.driver.console.TextConsole#getOut() - */ @Override public Writer getOut() { return out; @@ -419,9 +377,6 @@ syncScreen(offset, 1); } - /** - * @see org.jnode.system.event.FocusListener#focusGained(org.jnode.system.event.FocusEvent) - */ @Override public void focusGained(FocusEvent event) { super.focusGained(event); @@ -444,9 +399,6 @@ } } - /** - * @see org.jnode.system.event.FocusListener#focusLost(org.jnode.system.event.FocusEvent) - */ @Override public void focusLost(FocusEvent event) { if (in instanceof FocusListener) { @@ -478,9 +430,6 @@ return options; } - /** - * @see Console#systemScreenChanged(TextScreen) - */ @Override public void systemScreenChanged(TextScreen systemScreen) { // ensure that old and new screens are compatible Modified: trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiSystemTable.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiSystemTable.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiSystemTable.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -51,11 +51,6 @@ this.creatorRevision = getString(32, 4); } - /** - * Convert to a String representation. - * - * @see java.lang.Object#toString() - */ public String toString() { return super.toString() + "/{" + oemId + ", " + creatorId + "}"; } @@ -63,7 +58,7 @@ /** * Gets the OEM ID. * - * @return + * @return the id */ public final String getOemId() { return oemId; @@ -72,7 +67,7 @@ /** * Gets the OEM table ID. * - * @return + * @return the table id */ public final String getOemTableId() { return oemTableId; Modified: trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -59,7 +59,7 @@ /** * Gets the length of this table in bytes. * - * @return + * @return the table size */ public final int getSize() { return tableResource.getSize().toInt(); @@ -75,7 +75,7 @@ /** * Gets the signature of this table. * - * @return + * @return the sigarure */ public String getSignature() { return signature; @@ -85,7 +85,7 @@ * Gets a 32-bit address from a given offset in the table. * * @param offset - * @return + * @return the address */ protected final Address getAddress32(int offset) { return Address.fromIntZeroExtend(tableResource.getInt(offset)); @@ -95,7 +95,7 @@ * Gets a 64-bit address from a given offset in the table. * * @param offset - * @return + * @return the address */ protected final Address getAddress64(int offset) { return Address.fromLong(tableResource.getLong(offset)); @@ -105,7 +105,7 @@ * Gets a 32-bit integer from a given offset in the table. * * @param offset - * @return + * @return the integer */ protected final int getInt(int offset) { return tableResource.getInt(offset); @@ -115,7 +115,7 @@ * Gets a 16-bit integer from a given offset in the table. * * @param offset - * @return + * @return the short without sign extension */ protected final int getShort(int offset) { return ((tableResource.getByte(offset + 1) & 0xff) << 8) @@ -127,7 +127,7 @@ * * @param offset * @param length Length in bytes of the string. - * @return + * @return the string */ protected final String getString(int offset, int length) { final char[] arr = new char[length]; @@ -141,7 +141,7 @@ * Gets a 8-bit integer from a given offset in the table. * * @param offset - * @return + * @return the byte without sign extension */ protected final int getByte(int offset) { return tableResource.getByte(offset) & 0xff; @@ -151,7 +151,6 @@ * Gets a series 8-bit integer from a given offset in the table. * * @param offset - * @return */ protected final void getBytes(int offset, byte[] dst, int dstOfs, int length) { tableResource.getBytes(offset, dst, dstOfs, length); Modified: trunk/core/src/driver/org/jnode/driver/system/acpi/SystemDescriptionTable.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/system/acpi/SystemDescriptionTable.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/system/acpi/SystemDescriptionTable.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -45,9 +45,9 @@ } /** - * List of AcpiTable. + * List of AcpiTables * - * @return + * @return the tables */ public final List<AcpiTable> getTables() { return Collections.unmodifiableList(tables); @@ -56,7 +56,7 @@ /** * Release all resources. * - * @see org.jnode.driver.system.acpi.AcpiTable#release() + * @see AcpiTable#release() */ public void release() { super.release(); Modified: trunk/core/src/driver/org/jnode/driver/system/firmware/AcpiDevice.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/system/firmware/AcpiDevice.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/system/firmware/AcpiDevice.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -45,7 +45,7 @@ /** * Gets the information of the ACPI root descriptor table. * - * @return + * @return the information descriptor */ public final AcpiRSDPInfo getRsdpInfo() { return rsdpInfo; Modified: trunk/core/src/driver/org/jnode/driver/textscreen/TextScreen.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/textscreen/TextScreen.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/textscreen/TextScreen.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -96,7 +96,7 @@ /** * Gets the height of the virtual screen in characters. For a buffered * screen this is the height of the buffer. The height of the physical - * screen is given by {@line #getDeviceHeight()}. + * screen is given by {@link #getDeviceHeight()}. * * @return Returns the virtual screen height. */ @@ -105,7 +105,7 @@ /** * Gets the width of the virtual screen in characters. For a buffered * screen this is the width of the buffer. The width of the physical - * screen is given by {@line #getDeviceWidth()}. + * screen is given by {@link #getDeviceWidth()}. * * @return Returns the virtual screen width. */ @@ -130,7 +130,7 @@ * * @param x * @param y - * @return + * @return the offset */ public int getOffset(int x, int y); @@ -145,7 +145,7 @@ * Create an in-memory buffer text screen that is compatible * with this screen. * - * @return + * @return the text screen. */ public TextScreen createCompatibleBufferScreen(); @@ -153,7 +153,7 @@ * Create an in-memory buffer text screen that is compatible * with this, but larger and supports scrolling. * - * @return + * @return the buffer screen */ public ScrollableTextScreen createCompatibleScrollableBufferScreen(int height); Modified: trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcTextScreen.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcTextScreen.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcTextScreen.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -91,7 +91,7 @@ * * @param x * @param y - * @return + * @return the offset */ @Override public final int getOffset(int x, int y) { @@ -118,7 +118,7 @@ * Create an in-memory buffer text screen that is compatible * with the system screen, but larges and supports scrolling. * - * @return + * @return the text screen */ @Override public final ScrollableTextScreen createCompatibleScrollableBufferScreen(int height) { Modified: trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenUtils.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenUtils.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenUtils.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -49,9 +49,9 @@ } /** - * Exchange the background and the foreground colors + * Exchange the background and the foreground colors in a character/color value * @param characterAndColor - * @return + * @return the modified character/color value */ public static final char exchangeColors(char characterAndColor) { int color = PcTextScreenUtils.decodeColor(characterAndColor); Modified: trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLElement.java =================================================================== --- trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLElement.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLElement.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -63,30 +63,28 @@ * </CODE></UL></DD></DL> * <DL><DT><B>Retrieving Attributes</B></DT> * <DD> - * You can enumerate the attributes of an element using the method - * {@link #enumerateAttributeNames() enumerateAttributeNames}. + * You can get the attributes of an element using the method + * {@link #attributeNames() attributeNames}. * The attribute values can be retrieved using the method * {@link #getStringAttribute(String) getStringAttribute}. * The following example shows how to list the attributes of an element: - * <UL><CODE> - * XMLElement element = ...;<BR> - * Enumeration enum = element.getAttributeNames();<BR> - * while (enum.hasMoreElements()) {<BR> - * String key = (String) enum.nextElement();<BR> - * String value = element.getStringAttribute(key);<BR> - * System.out.println(key + " = " + value);<BR> - * } - * </CODE></UL></DD></DL> + * <UL><pre> + * XMLElement element = ...; + * for (String key : element.getAttributeNames()) { + * String value = element.getStringAttribute(key); + * System.out.println(key + " = " + value); + * } + * </pre></UL></DD></DL> * <DL><DT><B>Retrieving Child Elements</B></DT> * <DD> * You can enumerate the children of an element using - * {@link #enumerateChildren() enumerateChildren}. + * {@link #iteratorChildren() iteratorChildren}. * The number of child elements can be retrieved using * {@link #countChildren() countChildren}. * </DD></DL> * <DL><DT><B>Elements Containing Character Data</B></DT> * <DD> - * If an elements contains character data, like in the following example: + * If an element contains character data, as in the following example: * <UL><CODE> * <title>The Title</title> * </CODE></UL> @@ -268,9 +266,9 @@ * * <dl><dt><b>Postconditions:</b></dt><dd> * <ul><li>countChildren() => 0 - * <li>enumerateChildren() => empty enumeration - * <li>enumeratePropertyNames() => empty enumeration - * <li>getChildren() => empty vector + * <li>iteratorChildren() => empty iteration + * <li>attributeNames() => empty set + * <li>getChildren() => empty list * <li>getContent() => "" * <li>getLineNr() => 0 * <li>getName() => null @@ -303,9 +301,9 @@ * * <dl><dt><b>Postconditions:</b></dt><dd> * <ul><li>countChildren() => 0 - * <li>enumerateChildren() => empty enumeration - * <li>enumeratePropertyNames() => empty enumeration - * <li>getChildren() => empty vector + * <li>iteratorChildren() => empty iteration + * <li>attributeNames() => empty set + * <li>getChildren() => empty list * <li>getContent() => "" * <li>getLineNr() => 0 * <li>getName() => null @@ -334,9 +332,9 @@ * * </dl><dl><dt><b>Postconditions:</b></dt><dd> * <ul><li>countChildren() => 0 - * <li>enumerateChildren() => empty enumeration - * <li>enumeratePropertyNames() => empty enumeration - * <li>getChildren() => empty vector + * <li>iteratorChildren() => empty iteration + * <li>attributeNames() => empty set + * <li>getChildren() => empty list * <li>getContent() => "" * <li>getLineNr() => 0 * <li>getName() => null @@ -372,9 +370,9 @@ * * <dl><dt><b>Postconditions:</b></dt><dd> * <ul><li>countChildren() => 0 - * <li>enumerateChildren() => empty enumeration - * <li>enumeratePropertyNames() => empty enumeration - * <li>getChildren() => empty vector + * <li>iteratorChildren() => empty iteration + * <li>attributeNames() => empty set + * <li>getChildren() => empty list * <li>getContent() => "" * <li>getLineNr() => 0 * <li>getName() => null @@ -410,9 +408,9 @@ * * <dl><dt><b>Postconditions:</b></dt><dd> * <ul><li>countChildren() => 0 - * <li>enumerateChildren() => empty enumeration - * <li>enumeratePropertyNames() => empty enumeration - * <li>getChildren() => empty vector + * <li>iteratorChildren() => empty iteration + * <li>attributeNames() => empty set + * <li>getChildren() => empty list * <li>getContent() => "" * <li>getLineNr() => 0 * <li>getName() => null @@ -437,7 +435,7 @@ * Creates and initializes a new XML element. * <P> * This constructor should <I>only</I> be called from - * {@link #createAnotherElement() createAnotherElement} + * {@link #createAnotherElement()} * to create child elements. * * @param entities @@ -462,9 +460,9 @@ * * <dl><dt><b>Postconditions:</b></dt><dd> * <ul><li>countChildren() => 0 - * <li>enumerateChildren() => empty enumeration - * <li>enumeratePropertyNames() => empty enumeration - * <li>getChildren() => empty vector + * <li>iteratorChildren() => empty iteration + * <li>attributeNames() => empty set + * <li>getChildren() => empty list * <li>getContent() => "" * <li>getLineNr() => 0 * <li>getName() => null @@ -518,12 +516,12 @@ * * <dl><dt><b>Postconditions:</b></dt><dd> * <ul><li>countChildren() => old.countChildren() + 1 - * <li>enumerateChildren() => old.enumerateChildren() + child - * <li>getChildren() => old.enumerateChildren() + child + * <li>iteratorChildren() => old.iteratorChildren() + child + * <li>getChildren() => old.iteratorChildren() + child * </ul></dd></dl><dl> * * @see XMLElement#countChildren() - * @see XMLElement#enumerateChildren() + * @see XMLElement#iteratorChildren() * @see XMLElement#getChildren() * @see XMLElement#removeChild(XMLElement) * removeChild(XMLElement) @@ -549,8 +547,7 @@ * </ul></dd></dl> * * <dl><dt><b>Postconditions:</b></dt><dd> - * <ul><li>enumerateAttributeNames() - * => old.enumerateAttributeNames() + name + * <ul><li>attributeNames() => old.ttributeNames() + name * <li>getAttribute(name) => value * </ul></dd></dl><dl> * @@ -558,7 +555,7 @@ * setDoubleAttribute(String, double) * @see XMLElement#setIntAttribute(String, int) * setIntAttribute(String, int) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getAttribute(String) * getAttribute(String) * @see XMLElement#getAttribute(String, Object) @@ -595,8 +592,7 @@ * @param value * The value of the attribute. * - * @deprecated Use {@link #setAttribute(String, Object) - * setAttribute} instead. + * @deprecated Use {@link #setAttribute(String, Object)} instead. */ public void addProperty(String name, Object value) @@ -619,8 +615,7 @@ * </ul></dd></dl> * * <dl><dt><b>Postconditions:</b></dt><dd> - * <ul><li>enumerateAttributeNames() - * => old.enumerateAttributeNames() + name + * <ul><li>attributeNames() => old.attributeNames() + name * <li>getIntAttribute(name) => value * </ul></dd></dl><dl> * @@ -630,7 +625,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getIntAttribute(String) * getIntAttribute(String) * @see XMLElement#getIntAttribute(String, int) @@ -658,13 +653,12 @@ * @param value * The value of the attribute. * - * @deprecated Use {@link #setIntAttribute(String, int) - * setIntAttribute} instead. + * @deprecated Use {@link #setIntAttribute(String, int)} instead. */ - public void addProperty(String key, + public void addProperty(String name, int value) { - this.setIntAttribute(key, value); + this.setIntAttribute(name, value); } @@ -682,8 +676,7 @@ * </ul></dd></dl> * * <dl><dt><b>Postconditions:</b></dt><dd> - * <ul><li>enumerateAttributeNames() - * => old.enumerateAttributeNames() + name + * <ul><li>attributeNames() => old.attributeNames() + name * <li>getDoubleAttribute(name) => value * </ul></dd></dl><dl> * @@ -693,7 +686,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getDoubleAttribute(String) * getDoubleAttribute(String) * @see XMLElement#getDoubleAttribute(String, double) @@ -721,8 +714,7 @@ * @param value * The value of the attribute. * - * @deprecated Use {@link #setDoubleAttribute(String, double) - * setDoubleAttribute} instead. + * @deprecated Use {@link #setDoubleAttribute(String, double)} instead. */ public void addProperty(String name, double value) @@ -740,7 +732,7 @@ * * @see XMLElement#addChild(XMLElement) * addChild(XMLElement) - * @see XMLElement#enumerateChildren() + * @see XMLElement#iteratorChildren() * @see XMLElement#getChildren() * @see XMLElement#removeChild(XMLElement) * removeChild(XMLElement) @@ -841,7 +833,7 @@ * @see XMLElement#addChild(XMLElement) * addChild(XMLElement) * @see XMLElement#countChildren() - * @see XMLElement#enumerateChildren() + * @see XMLElement#iteratorChildren() * @see XMLElement#removeChild(XMLElement) * removeChild(XMLElement) */ @@ -855,7 +847,7 @@ * Returns the PCDATA content of the object. If there is no such content, * <CODE>null</CODE> is returned. * - * @deprecated Use {@link #getContent() getContent} instead. + * @deprecated Use {@link #getContent()} instead. */ public String getContents() { @@ -905,7 +897,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getAttribute(String, Object) * getAttribute(String, Object) * @see XMLElement#getAttribute(String, @@ -935,7 +927,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getAttribute(String) * getAttribute(String) * @see XMLElement#getAttribute(String, @@ -988,7 +980,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getAttribute(String) * getAttribute(String) * @see XMLElement#getAttribute(String, Object) @@ -1034,7 +1026,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getStringAttribute(String, * String) * getStringAttribute(String, String) @@ -1065,7 +1057,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getStringAttribute(String) * getStringAttribute(String) * @see XMLElement#getStringAttribute(String, @@ -1112,7 +1104,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getStringAttribute(String) * getStringAttribute(String) * @see XMLElement#getStringAttribute(String, @@ -1142,7 +1134,7 @@ * * @see XMLElement#setIntAttribute(String, int) * setIntAttribute(String, int) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getIntAttribute(String, int) * getIntAttribute(String, int) * @see XMLElement#getIntAttribute(String, @@ -1170,7 +1162,7 @@ * * @see XMLElement#setIntAttribute(String, int) * setIntAttribute(String, int) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getIntAttribute(String) * getIntAttribute(String) * @see XMLElement#getIntAttribute(String, @@ -1228,7 +1220,7 @@ * * @see XMLElement#setIntAttribute(String, int) * setIntAttribute(String, int) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getIntAttribute(String) * getIntAttribute(String) * @see XMLElement#getIntAttribute(String, int) @@ -1279,7 +1271,7 @@ * * @see XMLElement#setDoubleAttribute(String, double) * setDoubleAttribute(String, double) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getDoubleAttribute(String, double) * getDoubleAttribute(String, double) * @see XMLElement#getDoubleAttribute(String, @@ -1307,7 +1299,7 @@ * * @see XMLElement#setDoubleAttribute(String, double) * setDoubleAttribute(String, double) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getDoubleAttribute(String) * getDoubleAttribute(String) * @see XMLElement#getDoubleAttribute(String, @@ -1366,7 +1358,7 @@ * * @see XMLElement#setDoubleAttribute(String, double) * setDoubleAttribute(String, double) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#getDoubleAttribute(String) * getDoubleAttribute(String) * @see XMLElement#getDoubleAttribute(String, double) @@ -1430,7 +1422,7 @@ * setAttribute(String, Object) * @see XMLElement#removeAttribute(String) * removeAttribute(String) - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() */ public boolean getBooleanAttribute(String name, String trueValue, @@ -1457,8 +1449,7 @@ * Returns an attribute by looking up a key in a hashtable. * * @deprecated Use {@link #getIntAttribute(String, - * java.util.Hashtable, String, boolean) - * getIntAttribute} instead. + * java.util.Hashtable, String, boolean)} instead. */ public int getIntProperty(String name, Hashtable valueSet, @@ -1471,8 +1462,7 @@ /** * Returns an attribute. * - * @deprecated Use {@link #getStringAttribute(String) - * getStringAttribute} instead. + * @deprecated Use {@link #getStringAttribute(String)} instead. */ public String getProperty(String name) { @@ -1483,8 +1473,7 @@ /** * Returns an attribute. * - * @deprecated Use {@link #getStringAttribute(String, - * String) getStringAttribute} instead. + * @deprecated Use {@link #getStringAttribute(String, String)} instead. */ public String getProperty(String name, String defaultValue) @@ -1496,8 +1485,7 @@ /** * Returns an attribute. * - * @deprecated Use {@link #getIntAttribute(String, int) - * getIntAttribute} instead. + * @deprecated Use {@link #getIntAttribute(String, int)} instead. */ public int getProperty(String name, int defaultValue) @@ -1509,8 +1497,7 @@ /** * Returns an attribute. * - * @deprecated Use {@link #getDoubleAttribute(String, double) - * getDoubleAttribute} instead. + * @deprecated Use {@link #getDoubleAttribute(String, double)} instead. */ public double getProperty(String name, double defaultValue) @@ -1523,8 +1510,7 @@ * Returns an attribute. * * @deprecated Use {@link #getBooleanAttribute(String, - * String, String, boolean) - * getBooleanAttribute} instead. + * String, String, boolean)} instead. */ public boolean getProperty(String key, String trueValue, @@ -1540,8 +1526,7 @@ * Returns an attribute by looking up a key in a hashtable. * * @deprecated Use {@link #getAttribute(String, - * java.util.Hashtable, String, boolean) - * getAttribute} instead. + * java.util.Hashtable, String, boolean)} instead. */ public Object getProperty(String name, Hashtable valueSet, @@ -1555,8 +1540,7 @@ * Returns an attribute by looking up a key in a hashtable. * * @deprecated Use {@link #getStringAttribute(String, - * java.util.Hashtable, String, boolean) - * getStringAttribute} instead. + * java.util.Hashtable, String, boolean)} instead. */ public String getStringProperty(String name, Hashtable valueSet, @@ -1570,8 +1554,7 @@ * Returns an attribute by looking up a key in a hashtable. * * @deprecated Use {@link #getIntAttribute(String, - * java.util.Hashtable, String, boolean) - * getIntAttribute} instead. + * java.util.Hashtable, String, boolean)} instead. */ public int getSpecialIntProperty(String name, Hashtable valueSet, @@ -1585,8 +1568,7 @@ * Returns an attribute by looking up a key in a hashtable. * * @deprecated Use {@link #getDoubleAttribute(String, - * java.util.Hashtable, String, boolean) - * getDoubleAttribute} instead. + * java.util.Hashtable, String, boolean)} instead. */ public double getSpecialDoubleProperty(String name, Hashtable valueSet, @@ -1610,7 +1592,7 @@ /** * Returns the name of the element. * - * @deprecated Use {@link #getName() getName} instead. + * @deprecated Use {@link #getName()} instead. */ public String getTagName() { @@ -1708,8 +1690,8 @@ /** * Reads one XML element from a String and parses it. * - * @param reader - * The reader from which to retrieve the XML data. + * @param string + * The string from which to read the XML data. * * </dl><dl><dt><b>Preconditions:</b></dt><dd> * <ul><li><code>string != null</code> @@ -1739,8 +1721,8 @@ /** * Reads one XML element from a String and parses it. * - * @param reader - * The reader from which to retrieve the XML data. + * @param string + * The String from which to read the XML data. * @param offset * The first character in <code>string</code> to scan. * @@ -1769,8 +1751,8 @@ /** * Reads one XML element from a String and parses it. * - * @param reader - * The reader from which to retrieve the XML data. + * @param string + * The String from which to read the XML data. * @param offset * The first character in <code>string</code> to scan. * @param end @@ -1804,8 +1786,8 @@ /** * Reads one XML element from a String and parses it. * - * @param reader - * The reader from which to retrieve the XML data. + * @param string + * The String from which to read the XML data. * @param offset * The first character in <code>string</code> to scan. * @param end @@ -1847,8 +1829,8 @@ /** * Reads one XML element from a char array and parses it. * - * @param reader - * The reader from which to retrieve the XML data. + * @param input + * The array from which to read the XML data. * @param offset * The first character in <code>string</code> to scan. * @param end @@ -1882,8 +1864,8 @@ /** * Reads one XML element from a char array and parses it. * - * @param reader - * The reader from which to retrieve the XML data. + * @param input + * The array from which to read the XML data. * @param offset * The first character in <code>string</code> to scan. * @param end @@ -1935,14 +1917,14 @@ * * <dl><dt><b>Postconditions:</b></dt><dd> * <ul><li>countChildren() => old.countChildren() - 1 - * <li>enumerateChildren() => old.enumerateChildren() - child - * <li>getChildren() => old.enumerateChildren() - child + * <li>iteratorChildren() => old.iteratorChildren() - child + * <li>getChildren() => old.iteratorChildren() - child * </ul></dd></dl><dl> * * @see XMLElement#addChild(XMLElement) * addChild(XMLElement) * @see XMLElement#countChildren() - * @see XMLElement#enumerateChildren() + * @see XMLElement#iteratorChildren() * @see XMLElement#getChildren() */ public void removeChild(XMLElement child) @@ -1963,12 +1945,11 @@ * </ul></dd></dl> * * <dl><dt><b>Postconditions:</b></dt><dd> - * <ul><li>enumerateAttributeNames() - * => old.enumerateAttributeNames() - name + * <ul><li>ttributeNames() => old.attributeNames() - name * <li>getAttribute(name) => <code>null</code> * </ul></dd></dl><dl> * - * @see XMLElement#enumerateAttributeNames() + * @see XMLElement#attributeNames() * @see XMLElement#setDoubleAttribute(String, double) * setDoubleAttribute(String, double) * @see XMLElement#setIntAttribute(String, int) Modified: trunk/core/src/test/org/jnode/test/ResourceTest.java =================================================================== --- trunk/core/src/test/org/jnode/test/ResourceTest.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/test/org/jnode/test/ResourceTest.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -33,7 +33,7 @@ import org.jnode.plugin.PluginUtils; /** - * Documentation at {@link http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html} + * Documentation at http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html. * * @author Ewout Prangsma (ep...@us...) * @author Fabien DUMINY (fd...@jn...) Modified: trunk/core/src/test/org/jnode/test/core/ProxyTest.java =================================================================== --- trunk/core/src/test/org/jnode/test/core/ProxyTest.java 2009-03-23 13:59:36 UTC (rev 5147) +++ trunk/core/src/test/org/jnode/test/core/ProxyTest.java 2009-03-24 12:32:31 UTC (rev 5148) @@ -31,8 +31,7 @@ /** * @param args - * @throws java.io.FileNotFoundException - * @throws + * @throws IOException; */ public static void main(String[] args) throws IOException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-03-25 05:00:06
|
Revision: 5151 http://jnode.svn.sourceforge.net/jnode/?rev=5151&view=rev Author: chrisboertien Date: 2009-03-25 04:59:56 +0000 (Wed, 25 Mar 2009) Log Message: ----------- Impelemntation of java.util.zip checksums Added Paths: ----------- trunk/core/src/openjdk/java/java/util/zip/Adler32.java trunk/core/src/openjdk/java/java/util/zip/CRC32.java trunk/core/src/openjdk/java/java/util/zip/Checksum.java trunk/core/src/openjdk/vm/java/util/zip/ trunk/core/src/openjdk/vm/java/util/zip/NativeAdler32.java trunk/core/src/openjdk/vm/java/util/zip/NativeCRC32.java Removed Paths: ------------- trunk/core/src/classpath/java/java/util/zip/Adler32.java trunk/core/src/classpath/java/java/util/zip/CRC32.java trunk/core/src/classpath/java/java/util/zip/Checksum.java Deleted: trunk/core/src/classpath/java/java/util/zip/Adler32.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/Adler32.java 2009-03-24 14:08:37 UTC (rev 5150) +++ trunk/core/src/classpath/java/java/util/zip/Adler32.java 2009-03-25 04:59:56 UTC (rev 5151) @@ -1,205 +0,0 @@ -/* Adler32.java - Computes Adler32 data checksum of a data stream - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.util.zip; - -/* - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * The actual Adler32 algorithm is taken from RFC 1950. - * Status: Believed complete and correct. - */ - -/** - * Computes Adler32 checksum for a stream of data. An Adler32 - * checksum is not as reliable as a CRC32 checksum, but a lot faster to - * compute. - *<p> - * The specification for Adler32 may be found in RFC 1950. - * (ZLIB Compressed Data Format Specification version 3.3) - *<p> - *<p> - * From that document: - *<p> - * "ADLER32 (Adler-32 checksum) - * This contains a checksum value of the uncompressed data - * (excluding any dictionary data) computed according to Adler-32 - * algorithm. This algorithm is a 32-bit extension and improvement - * of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 - * standard. - *<p> - * Adler-32 is composed of two sums accumulated per byte: s1 is - * the sum of all bytes, s2 is the sum of all s1 values. Both sums - * are done modulo 65521. s1 is initialized to 1, s2 to zero. The - * Adler-32 checksum is stored as s2*65536 + s1 in most- - * significant-byte first (network) order." - *<p> - * "8.2. The Adler-32 algorithm - *<p> - * The Adler-32 algorithm is much faster than the CRC32 algorithm yet - * still provides an extremely low probability of undetected errors. - *<p> - * The modulo on unsigned long accumulators can be delayed for 5552 - * bytes, so the modulo operation time is negligible. If the bytes - * are a, b, c, the second sum is 3a + 2b + c + 3, and so is position - * and order sensitive, unlike the first sum, which is just a - * checksum. That 65521 is prime is important to avoid a possible - * large class of two-byte errors that leave the check unchanged. - * (The Fletcher checksum uses 255, which is not prime and which also - * makes the Fletcher check insensitive to single byte changes 0 <-> - * 255.) - *<p> - * The sum s1 is initialized to 1 instead of zero to make the length - * of the sequence part of s2, so that the length does not have to be - * checked separately. (Any sequence of zeroes has a Fletcher - * checksum of zero.)" - * - * @author John Leuner, Per Bothner - * @since JDK 1.1 - * - * @see InflaterInputStream - * @see DeflaterOutputStream - */ -public class Adler32 implements Checksum -{ - - /** largest prime smaller than 65536 */ - private static final int BASE = 65521; - - private int checksum; //we do all in int. - - //Note that java doesn't have unsigned integers, - //so we have to be careful with what arithmetic - //we do. We return the checksum as a long to - //avoid sign confusion. - - /** - * Creates a new instance of the <code>Adler32</code> class. - * The checksum starts off with a value of 1. - */ - public Adler32 () - { - reset(); - } - - /** - * Resets the Adler32 checksum to the initial value. - */ - public void reset () - { - checksum = 1; //Initialize to 1 - } - - /** - * Updates the checksum with the byte b. - * - * @param bval the data value to add. The high byte of the int is ignored. - */ - public void update (int bval) - { - //We could make a length 1 byte array and call update again, but I - //would rather not have that overhead - int s1 = checksum & 0xffff; - int s2 = checksum >>> 16; - - s1 = (s1 + (bval & 0xFF)) % BASE; - s2 = (s1 + s2) % BASE; - - checksum = (s2 << 16) + s1; - } - - /** - * Updates the checksum with the bytes taken from the array. - * - * @param buffer an array of bytes - */ - public void update (byte[] buffer) - { - update(buffer, 0, buffer.length); - } - - /** - * Updates the checksum with the bytes taken from the array. - * - * @param buf an array of bytes - * @param off the start of the data used for this update - * @param len the number of bytes to use for this update - */ - public void update (byte[] buf, int off, int len) - { - //(By Per Bothner) - int s1 = checksum & 0xffff; - int s2 = checksum >>> 16; - - while (len > 0) - { - // We can defer the modulo operation: - // s1 maximally grows from 65521 to 65521 + 255 * 3800 - // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 - int n = 3800; - if (n > len) - n = len; - len -= n; - while (--n >= 0) - { - s1 = s1 + (buf[off++] & 0xFF); - s2 = s2 + s1; - } - s1 %= BASE; - s2 %= BASE; - } - - /*Old implementation, borrowed from somewhere: - int n; - - while (len-- > 0) { - - s1 = (s1 + (bs[offset++] & 0xff)) % BASE; - s2 = (s2 + s1) % BASE; - }*/ - - checksum = (s2 << 16) | s1; - } - - /** - * Returns the Adler32 data checksum computed so far. - */ - public long getValue() - { - return (long) checksum & 0xffffffffL; - } -} Deleted: trunk/core/src/classpath/java/java/util/zip/CRC32.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/CRC32.java 2009-03-24 14:08:37 UTC (rev 5150) +++ trunk/core/src/classpath/java/java/util/zip/CRC32.java 2009-03-25 04:59:56 UTC (rev 5151) @@ -1,132 +0,0 @@ -/* CRC32.java - Computes CRC32 data checksum of a data stream - Copyright (C) 1999. 2000, 2001 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.util.zip; - -/* - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * The actual CRC32 algorithm is taken from RFC 1952. - * Status: Believed complete and correct. - */ - -/** - * Computes CRC32 data checksum of a data stream. - * The actual CRC32 algorithm is described in RFC 1952 - * (GZIP file format specification version 4.3). - * Can be used to get the CRC32 over a stream if used with checked input/output - * streams. - * - * @see InflaterInputStream - * @see DeflaterOutputStream - * - * @author Per Bothner - * @date April 1, 1999. - */ -public class CRC32 implements Checksum -{ - /** The crc data checksum so far. */ - private int crc = 0; - - /** The fast CRC table. Computed once when the CRC32 class is loaded. */ - private static int[] crc_table = make_crc_table(); - - /** Make the table for a fast CRC. */ - private static int[] make_crc_table () - { - int[] crc_table = new int[256]; - for (int n = 0; n < 256; n++) - { - int c = n; - for (int k = 8; --k >= 0; ) - { - if ((c & 1) != 0) - c = 0xedb88320 ^ (c >>> 1); - else - c = c >>> 1; - } - crc_table[n] = c; - } - return crc_table; - } - - /** - * Returns the CRC32 data checksum computed so far. - */ - public long getValue () - { - return (long) crc & 0xffffffffL; - } - - /** - * Resets the CRC32 data checksum as if no update was ever called. - */ - public void reset () { crc = 0; } - - /** - * Updates the checksum with the int bval. - * - * @param bval (the byte is taken as the lower 8 bits of bval) - */ - - public void update (int bval) - { - int c = ~crc; - c = crc_table[(c ^ bval) & 0xff] ^ (c >>> 8); - crc = ~c; - } - - /** - * Adds the byte array to the data checksum. - * - * @param buf the buffer which contains the data - * @param off the offset in the buffer where the data starts - * @param len the length of the data - */ - public void update (byte[] buf, int off, int len) - { - int c = ~crc; - while (--len >= 0) - c = crc_table[(c ^ buf[off++]) & 0xff] ^ (c >>> 8); - crc = ~c; - } - - /** - * Adds the complete byte array to the data checksum. - */ - public void update (byte[] buf) { update(buf, 0, buf.length); } -} Deleted: trunk/core/src/classpath/java/java/util/zip/Checksum.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/Checksum.java 2009-03-24 14:08:37 UTC (rev 5150) +++ trunk/core/src/classpath/java/java/util/zip/Checksum.java 2009-03-25 04:59:56 UTC (rev 5151) @@ -1,86 +0,0 @@ -/* Checksum.java - Interface to compute a data checksum - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.util.zip; - -/* - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * Status: Believed complete and correct. - */ - -/** - * Interface to compute a data checksum used by checked input/output streams. - * A data checksum can be updated by one byte or with a byte array. After each - * update the value of the current checksum can be returned by calling - * <code>getValue</code>. The complete checksum object can also be reset - * so it can be used again with new data. - * - * @see CheckedInputStream - * @see CheckedOutputStream - * - * @author Per Bothner - * @author Jochen Hoenicke - */ -public interface Checksum -{ - /** - * Returns the data checksum computed so far. - */ - long getValue(); - - /** - * Resets the data checksum as if no update was ever called. - */ - void reset(); - - /** - * Adds one byte to the data checksum. - * - * @param bval the data value to add. The high byte of the int is ignored. - */ - void update (int bval); - - /** - * Adds the byte array to the data checksum. - * - * @param buf the buffer which contains the data - * @param off the offset in the buffer where the data starts - * @param len the length of the data - */ - void update (byte[] buf, int off, int len); -} Added: trunk/core/src/openjdk/java/java/util/zip/Adler32.java =================================================================== --- trunk/core/src/openjdk/java/java/util/zip/Adler32.java (rev 0) +++ trunk/core/src/openjdk/java/java/util/zip/Adler32.java 2009-03-25 04:59:56 UTC (rev 5151) @@ -0,0 +1,93 @@ +/* + * Copyright 1996-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.util.zip; + +/** + * A class that can be used to compute the Adler-32 checksum of a data + * stream. An Adler-32 checksum is almost as reliable as a CRC-32 but + * can be computed much faster. + * + * @see Checksum + * @author David Connelly + */ +public +class Adler32 implements Checksum { + private int adler = 1; + + /** + * Creates a new Adler32 object. + */ + public Adler32() { + } + + + /** + * Updates checksum with specified byte. + * + * @param b an array of bytes + */ + public void update(int b) { + adler = update(adler, b); + } + + /** + * Updates checksum with specified array of bytes. + */ + public void update(byte[] b, int off, int len) { + if (b == null) { + throw new NullPointerException(); + } + if (off < 0 || len < 0 || off > b.length - len) { + throw new ArrayIndexOutOfBoundsException(); + } + adler = updateBytes(adler, b, off, len); + } + + /** + * Updates checksum with specified array of bytes. + */ + public void update(byte[] b) { + adler = updateBytes(adler, b, 0, b.length); + } + + /** + * Resets checksum to initial value. + */ + public void reset() { + adler = 1; + } + + /** + * Returns checksum value. + */ + public long getValue() { + return (long)adler & 0xffffffffL; + } + + private native static int update(int adler, int b); + private native static int updateBytes(int adler, byte[] b, int off, + int len); +} Added: trunk/core/src/openjdk/java/java/util/zip/CRC32.java =================================================================== --- trunk/core/src/openjdk/java/java/util/zip/CRC32.java (rev 0) +++ trunk/core/src/openjdk/java/java/util/zip/CRC32.java 2009-03-25 04:59:56 UTC (rev 5151) @@ -0,0 +1,90 @@ +/* + * Copyright 1996-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.util.zip; + +/** + * A class that can be used to compute the CRC-32 of a data stream. + * + * @see Checksum + * @author David Connelly + */ +public +class CRC32 implements Checksum { + private int crc; + + /** + * Creates a new CRC32 object. + */ + public CRC32() { + } + + + /** + * Updates CRC-32 with specified byte. + */ + public void update(int b) { + crc = update(crc, b); + } + + /** + * Updates CRC-32 with specified array of bytes. + */ + public void update(byte[] b, int off, int len) { + if (b == null) { + throw new NullPointerException(); + } + if (off < 0 || len < 0 || off > b.length - len) { + throw new ArrayIndexOutOfBoundsException(); + } + crc = updateBytes(crc, b, off, len); + } + + /** + * Updates checksum with specified array of bytes. + * + * @param b the array of bytes to update the checksum with + */ + public void update(byte[] b) { + crc = updateBytes(crc, b, 0, b.length); + } + + /** + * Resets CRC-32 to initial value. + */ + public void reset() { + crc = 0; + } + + /** + * Returns CRC-32 value. + */ + public long getValue() { + return (long)crc & 0xffffffffL; + } + + private native static int update(int crc, int b); + private native static int updateBytes(int crc, byte[] b, int off, int len); +} Added: trunk/core/src/openjdk/java/java/util/zip/Checksum.java =================================================================== --- trunk/core/src/openjdk/java/java/util/zip/Checksum.java (rev 0) +++ trunk/core/src/openjdk/java/java/util/zip/Checksum.java 2009-03-25 04:59:56 UTC (rev 5151) @@ -0,0 +1,60 @@ +/* + * Copyright 1996-1999 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.util.zip; + +/** + * An interface representing a data checksum. + * + * @author David Connelly + */ +public +interface Checksum { + /** + * Updates the current checksum with the specified byte. + * + * @param b the byte to update the checksum with + */ + public void update(int b); + + /** + * Updates the current checksum with the specified array of bytes. + * @param b the byte array to update the checksum with + * @param off the start offset of the data + * @param len the number of bytes to use for the update + */ + public void update(byte[] b, int off, int len); + + /** + * Returns the current checksum value. + * @return the current checksum value + */ + public long getValue(); + + /** + * Resets the checksum to its initial value. + */ + public void reset(); +} Added: trunk/core/src/openjdk/vm/java/util/zip/NativeAdler32.java =================================================================== --- trunk/core/src/openjdk/vm/java/util/zip/NativeAdler32.java (rev 0) +++ trunk/core/src/openjdk/vm/java/util/zip/NativeAdler32.java 2009-03-25 04:59:56 UTC (rev 5151) @@ -0,0 +1,61 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package java.util.zip; + +/** + * Implementation of java.util.zip.Adler32 native methods. + * + * @author Chris Boertien + * @date Mar 24, 2009 + */ + +public class NativeAdler32 { + + private static int update( int adler , int b ) { + int s1 = adler & 0xffff; + int s2 = adler >>> 16; + + s1 = (s1 + (b & 0xFF)) % 65521; + s2 = (s1 + s2) % 65521; + + return (s2 << 16) + s1; + } + + private static int updateBytes( int adler , byte[] b , int off , int len ) { + int n; + int s1 = adler & 0xffff; + int s2 = adler >>> 16; + + while (len > 0) { + n = 3800; + if (n > len) n = len; + len -= n; + while (--n >= 0) { + s1 = s1 + (b[off++] & 0xFF); + s2 = s2 + s1; + } + s1 %= 65521; + s2 %= 65521; + } + + return (s2 << 16) | s1; + } +} Added: trunk/core/src/openjdk/vm/java/util/zip/NativeCRC32.java =================================================================== --- trunk/core/src/openjdk/vm/java/util/zip/NativeCRC32.java (rev 0) +++ trunk/core/src/openjdk/vm/java/util/zip/NativeCRC32.java 2009-03-25 04:59:56 UTC (rev 5151) @@ -0,0 +1,62 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package java.util.zip; + +/** + * Implementation of java.util.zip.CRC32 native methods. + * + * @author Chris Boertien + * @date Mar 24, 2009 + */ +public class NativeCRC32 { + + /** The fast CRC table. Computed once when the CRC32 class is loaded. */ + private static final int[] fastCRCTable = fastCRCTable(); + + /** Make the table for a fast CRC. */ + private static int[] fastCRCTable() { + int[] crc_table = new int[256]; + for (int n = 0; n < 256; n++) { + int c = n; + for (int k = 8; --k >= 0;) { + if ((c & 1) != 0) + c = 0xedb88320 ^ (c >>> 1); + else + c = c >>> 1; + } + crc_table[n] = c; + } + return crc_table; + } + + private static int update( int crc , int b ) { + int c = ~crc; + c = fastCRCTable[(c^b) & 0xff] ^ (c >>> 8); + return ~c; + } + + private static int updateBytes( int crc , byte[] b , int off , int len ) { + int c = ~crc; + while (--len >= 0) + c = fastCRCTable[(c ^ b[off++]) & 0xff] ^ (c >>> 8); + return ~c; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-03-25 11:00:32
|
Revision: 5152 http://jnode.svn.sourceforge.net/jnode/?rev=5152&view=rev Author: chrisboertien Date: 2009-03-25 11:00:27 +0000 (Wed, 25 Mar 2009) Log Message: ----------- More implementation of java.util.zip native methods Added Paths: ----------- trunk/core/src/openjdk/java/java/util/zip/DataFormatException.java trunk/core/src/openjdk/java/java/util/zip/ZipConstants.java trunk/core/src/openjdk/java/java/util/zip/ZipEntry.java trunk/core/src/openjdk/java/java/util/zip/ZipException.java trunk/core/src/openjdk/java/java/util/zip/ZipFile.java trunk/core/src/openjdk/java/java/util/zip/ZipInputStream.java trunk/core/src/openjdk/java/java/util/zip/ZipOutputStream.java trunk/core/src/openjdk/java/java/util/zip/package.html trunk/core/src/openjdk/vm/java/util/zip/NativeZipEntry.java trunk/core/src/openjdk/vm/java/util/zip/NativeZipFile.java trunk/core/src/openjdk/vm/java/util/zip/PartialInputStream.java trunk/core/src/openjdk/vm/java/util/zip/StructCache.java trunk/core/src/openjdk/vm/java/util/zip/ZipEntryStruct.java trunk/core/src/openjdk/vm/java/util/zip/ZipFileStruct.java trunk/core/src/openjdk/vm/java/util/zip/ZipUtil.java Removed Paths: ------------- trunk/core/src/classpath/java/java/util/zip/DataFormatException.java trunk/core/src/classpath/java/java/util/zip/ZipConstants.java trunk/core/src/classpath/java/java/util/zip/ZipEntry.java trunk/core/src/classpath/java/java/util/zip/ZipException.java trunk/core/src/classpath/java/java/util/zip/ZipFile.java trunk/core/src/classpath/java/java/util/zip/ZipInputStream.java trunk/core/src/classpath/java/java/util/zip/ZipOutputStream.java trunk/core/src/classpath/java/java/util/zip/package.html Deleted: trunk/core/src/classpath/java/java/util/zip/DataFormatException.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/DataFormatException.java 2009-03-25 04:59:56 UTC (rev 5151) +++ trunk/core/src/classpath/java/java/util/zip/DataFormatException.java 2009-03-25 11:00:27 UTC (rev 5152) @@ -1,71 +0,0 @@ -/* DataformatException.java -- thrown when compressed data is corrupt - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.util.zip; - -/** - * Exception thrown when compressed data is corrupt. - * - * @author Tom Tromey - * @author John Leuner - * @since 1.1 - * @status updated to 1.4 - */ -public class DataFormatException extends Exception -{ - /** - * Compatible with JDK 1.1+. - */ - private static final long serialVersionUID = 2219632870893641452L; - - /** - * Create an exception without a message. - */ - public DataFormatException() - { - } - - /** - * Create an exception with a message. - * - * @param msg the message - */ - public DataFormatException(String msg) - { - super(msg); - } -} Deleted: trunk/core/src/classpath/java/java/util/zip/ZipConstants.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/ZipConstants.java 2009-03-25 04:59:56 UTC (rev 5151) +++ trunk/core/src/classpath/java/java/util/zip/ZipConstants.java 2009-03-25 11:00:27 UTC (rev 5152) @@ -1,94 +0,0 @@ -/* java.util.zip.ZipConstants - Copyright (C) 2001, 2006 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.util.zip; - -interface ZipConstants -{ - /* The local file header */ - int LOCHDR = 30; - long LOCSIG = 'P'|('K'<<8)|(3<<16)|(4<<24); - - int LOCVER = 4; - int LOCFLG = 6; - int LOCHOW = 8; - int LOCTIM = 10; - int LOCCRC = 14; - int LOCSIZ = 18; - int LOCLEN = 22; - int LOCNAM = 26; - int LOCEXT = 28; - - /* The Data descriptor */ - long EXTSIG = 'P'|('K'<<8)|(7<<16)|(8<<24); - int EXTHDR = 16; - - int EXTCRC = 4; - int EXTSIZ = 8; - int EXTLEN = 12; - - /* The central directory file header */ - long CENSIG = 'P'|('K'<<8)|(1<<16)|(2<<24); - int CENHDR = 46; - - int CENVEM = 4; - int CENVER = 6; - int CENFLG = 8; - int CENHOW = 10; - int CENTIM = 12; - int CENCRC = 16; - int CENSIZ = 20; - int CENLEN = 24; - int CENNAM = 28; - int CENEXT = 30; - int CENCOM = 32; - int CENDSK = 34; - int CENATT = 36; - int CENATX = 38; - int CENOFF = 42; - - /* The entries in the end of central directory */ - long ENDSIG = 'P'|('K'<<8)|(5<<16)|(6<<24); - int ENDHDR = 22; - - int ENDSUB = 8; - int ENDTOT = 10; - int ENDSIZ = 12; - int ENDOFF = 16; - int ENDCOM = 20; -} - Deleted: trunk/core/src/classpath/java/java/util/zip/ZipEntry.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/ZipEntry.java 2009-03-25 04:59:56 UTC (rev 5151) +++ trunk/core/src/classpath/java/java/util/zip/ZipEntry.java 2009-03-25 11:00:27 UTC (rev 5152) @@ -1,431 +0,0 @@ -/* ZipEntry.java -- - Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package java.util.zip; - -import java.util.Calendar; - -/** - * This class represents a member of a zip archive. ZipFile and - * ZipInputStream will give you instances of this class as information - * about the members in an archive. On the other hand ZipOutputStream - * needs an instance of this class to create a new member. - * - * @author Jochen Hoenicke - */ -public class ZipEntry implements ZipConstants, Cloneable -{ - private static final int KNOWN_SIZE = 1; - private static final int KNOWN_CSIZE = 2; - private static final int KNOWN_CRC = 4; - private static final int KNOWN_TIME = 8; - private static final int KNOWN_EXTRA = 16; - - private static Calendar cal; - - private String name; - private int size; - private long compressedSize = -1; - private int crc; - private int dostime; - private short known = 0; - private short method = -1; - private byte[] extra = null; - private String comment = null; - - int flags; /* used by ZipOutputStream */ - int offset; /* used by ZipFile and ZipOutputStream */ - - /** - * Compression method. This method doesn't compress at all. - */ - public static final int STORED = 0; - /** - * Compression method. This method uses the Deflater. - */ - public static final int DEFLATED = 8; - - /** - * Creates a zip entry with the given name. - * @param name the name. May include directory components separated - * by '/'. - * - * @exception NullPointerException when name is null. - * @exception IllegalArgumentException when name is bigger then 65535 chars. - */ - public ZipEntry(String name) - { - int length = name.length(); - if (length > 65535) - throw new IllegalArgumentException("name length is " + length); - this.name = name; - } - - /** - * Creates a copy of the given zip entry. - * @param e the entry to copy. - */ - public ZipEntry(ZipEntry e) - { - this(e, e.name); - } - - ZipEntry(ZipEntry e, String name) - { - this.name = name; - known = e.known; - size = e.size; - compressedSize = e.compressedSize; - crc = e.crc; - dostime = e.dostime; - method = e.method; - extra = e.extra; - comment = e.comment; - } - - final void setDOSTime(int dostime) - { - this.dostime = dostime; - known |= KNOWN_TIME; - } - - final int getDOSTime() - { - if ((known & KNOWN_TIME) == 0) - return 0; - else - return dostime; - } - - /** - * Creates a copy of this zip entry. - */ - /** - * Clones the entry. - */ - public Object clone() - { - try - { - // The JCL says that the `extra' field is also copied. - ZipEntry clone = (ZipEntry) super.clone(); - if (extra != null) - clone.extra = (byte[]) extra.clone(); - return clone; - } - catch (CloneNotSupportedException ex) - { - throw new InternalError(); - } - } - - /** - * Returns the entry name. The path components in the entry are - * always separated by slashes ('/'). - */ - public String getName() - { - return name; - } - - /** - * Sets the time of last modification of the entry. - * @time the time of last modification of the entry. - */ - public void setTime(long time) - { - Calendar cal = getCalendar(); - synchronized (cal) - { - cal.setTimeInMillis(time); - dostime = (cal.get(Calendar.YEAR) - 1980 & 0x7f) << 25 - | (cal.get(Calendar.MONTH) + 1) << 21 - | (cal.get(Calendar.DAY_OF_MONTH)) << 16 - | (cal.get(Calendar.HOUR_OF_DAY)) << 11 - | (cal.get(Calendar.MINUTE)) << 5 - | (cal.get(Calendar.SECOND)) >> 1; - } - this.known |= KNOWN_TIME; - } - - /** - * Gets the time of last modification of the entry. - * @return the time of last modification of the entry, or -1 if unknown. - */ - public long getTime() - { - // The extra bytes might contain the time (posix/unix extension) - parseExtra(); - - if ((known & KNOWN_TIME) == 0) - return -1; - - int sec = 2 * (dostime & 0x1f); - int min = (dostime >> 5) & 0x3f; - int hrs = (dostime >> 11) & 0x1f; - int day = (dostime >> 16) & 0x1f; - int mon = ((dostime >> 21) & 0xf) - 1; - int year = ((dostime >> 25) & 0x7f) + 1980; /* since 1900 */ - - try - { - cal = getCalendar(); - synchronized (cal) - { - cal.set(year, mon, day, hrs, min, sec); - return cal.getTimeInMillis(); - } - } - catch (RuntimeException ex) - { - /* Ignore illegal time stamp */ - known &= ~KNOWN_TIME; - return -1; - } - } - - private static synchronized Calendar getCalendar() - { - if (cal == null) - cal = Calendar.getInstance(); - - return cal; - } - - /** - * Sets the size of the uncompressed data. - * @exception IllegalArgumentException if size is not in 0..0xffffffffL - */ - public void setSize(long size) - { - if ((size & 0xffffffff00000000L) != 0) - throw new IllegalArgumentException(); - this.size = (int) size; - this.known |= KNOWN_SIZE; - } - - /** - * Gets the size of the uncompressed data. - * @return the size or -1 if unknown. - */ - public long getSize() - { - return (known & KNOWN_SIZE) != 0 ? size & 0xffffffffL : -1L; - } - - /** - * Sets the size of the compressed data. - */ - public void setCompressedSize(long csize) - { - this.compressedSize = csize; - } - - /** - * Gets the size of the compressed data. - * @return the size or -1 if unknown. - */ - public long getCompressedSize() - { - return compressedSize; - } - - /** - * Sets the crc of the uncompressed data. - * @exception IllegalArgumentException if crc is not in 0..0xffffffffL - */ - public void setCrc(long crc) - { - if ((crc & 0xffffffff00000000L) != 0) - throw new IllegalArgumentException(); - this.crc = (int) crc; - this.known |= KNOWN_CRC; - } - - /** - * Gets the crc of the uncompressed data. - * @return the crc or -1 if unknown. - */ - public long getCrc() - { - return (known & KNOWN_CRC) != 0 ? crc & 0xffffffffL : -1L; - } - - /** - * Sets the compression method. Only DEFLATED and STORED are - * supported. - * @exception IllegalArgumentException if method is not supported. - * @see ZipOutputStream#DEFLATED - * @see ZipOutputStream#STORED - */ - public void setMethod(int method) - { - if (method != ZipOutputStream.STORED - && method != ZipOutputStream.DEFLATED) - throw new IllegalArgumentException(); - this.method = (short) method; - } - - /** - * Gets the compression method. - * @return the compression method or -1 if unknown. - */ - public int getMethod() - { - return method; - } - - /** - * Sets the extra data. - * @exception IllegalArgumentException if extra is longer than 0xffff bytes. - */ - public void setExtra(byte[] extra) - { - if (extra == null) - { - this.extra = null; - return; - } - if (extra.length > 0xffff) - throw new IllegalArgumentException(); - this.extra = extra; - } - - private void parseExtra() - { - // Already parsed? - if ((known & KNOWN_EXTRA) != 0) - return; - - if (extra == null) - { - known |= KNOWN_EXTRA; - return; - } - - try - { - int pos = 0; - while (pos < extra.length) - { - int sig = (extra[pos++] & 0xff) - | (extra[pos++] & 0xff) << 8; - int len = (extra[pos++] & 0xff) - | (extra[pos++] & 0xff) << 8; - if (sig == 0x5455) - { - /* extended time stamp */ - int flags = extra[pos]; - if ((flags & 1) != 0) - { - long time = ((extra[pos+1] & 0xff) - | (extra[pos+2] & 0xff) << 8 - | (extra[pos+3] & 0xff) << 16 - | (extra[pos+4] & 0xff) << 24); - setTime(time); - } - } - pos += len; - } - } - catch (ArrayIndexOutOfBoundsException ex) - { - /* be lenient */ - } - - known |= KNOWN_EXTRA; - return; - } - - /** - * Gets the extra data. - * @return the extra data or null if not set. - */ - public byte[] getExtra() - { - return extra; - } - - /** - * Sets the entry comment. - * @exception IllegalArgumentException if comment is longer than 0xffff. - */ - public void setComment(String comment) - { - if (comment != null && comment.length() > 0xffff) - throw new IllegalArgumentException(); - this.comment = comment; - } - - /** - * Gets the comment. - * @return the comment or null if not set. - */ - public String getComment() - { - return comment; - } - - /** - * Gets true, if the entry is a directory. This is solely - * determined by the name, a trailing slash '/' marks a directory. - */ - public boolean isDirectory() - { - int nlen = name.length(); - return nlen > 0 && name.charAt(nlen - 1) == '/'; - } - - /** - * Gets the string representation of this ZipEntry. This is just - * the name as returned by getName(). - */ - public String toString() - { - return name; - } - - /** - * Gets the hashCode of this ZipEntry. This is just the hashCode - * of the name. Note that the equals method isn't changed, though. - */ - public int hashCode() - { - return name.hashCode(); - } -} Deleted: trunk/core/src/classpath/java/java/util/zip/ZipException.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/ZipException.java 2009-03-25 04:59:56 UTC (rev 5151) +++ trunk/core/src/classpath/java/java/util/zip/ZipException.java 2009-03-25 11:00:27 UTC (rev 5152) @@ -1,72 +0,0 @@ -/* ZipException.java - exception representing a zip related error - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.util.zip; - -import java.io.IOException; - -/** - * Thrown during the creation or input of a zip file. - * - * @author Jochen Hoenicke - * @author Per Bothner - * @status updated to 1.4 - */ -public class ZipException extends IOException -{ - /** - * Compatible with JDK 1.0+. - */ - private static final long serialVersionUID = 8000196834066748623L; - - /** - * Create an exception without a message. - */ - public ZipException() - { - } - - /** - * Create an exception with a message. - * - * @param msg the message - */ - public ZipException (String msg) - { - super(msg); - } -} Deleted: trunk/core/src/classpath/java/java/util/zip/ZipFile.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/ZipFile.java 2009-03-25 04:59:56 UTC (rev 5151) +++ trunk/core/src/classpath/java/java/util/zip/ZipFile.java 2009-03-25 11:00:27 UTC (rev 5152) @@ -1,782 +0,0 @@ -/* ZipFile.java -- - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package java.util.zip; - -import gnu.java.util.EmptyEnumeration; - -import java.io.EOFException; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.RandomAccessFile; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.CharsetDecoder; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.LinkedHashMap; - -/** - * This class represents a Zip archive. You can ask for the contained - * entries, or get an input stream for a file entry. The entry is - * automatically decompressed. - * - * This class is thread safe: You can open input streams for arbitrary - * entries in different threads. - * - * @author Jochen Hoenicke - * @author Artur Biesiadowski - */ -public class ZipFile implements ZipConstants -{ - - /** - * Mode flag to open a zip file for reading. - */ - public static final int OPEN_READ = 0x1; - - /** - * Mode flag to delete a zip file after reading. - */ - public static final int OPEN_DELETE = 0x4; - - /** - * This field isn't defined in the JDK's ZipConstants, but should be. - */ - static final int ENDNRD = 4; - - // Name of this zip file. - private final String name; - - // File from which zip entries are read. - private final RandomAccessFile raf; - - // The entries of this zip file when initialized and not yet closed. - private LinkedHashMap<String, ZipEntry> entries; - - private boolean closed = false; - - - /** - * Helper function to open RandomAccessFile and throw the proper - * ZipException in case opening the file fails. - * - * @param name the file name, or null if file is provided - * - * @param file the file, or null if name is provided - * - * @return the newly open RandomAccessFile, never null - */ - private RandomAccessFile openFile(String name, - File file) - throws ZipException, IOException - { - try - { - return - (name != null) - ? new RandomAccessFile(name, "r") - : new RandomAccessFile(file, "r"); - } - catch (FileNotFoundException f) - { - ZipException ze = new ZipException(f.getMessage()); - ze.initCause(f); - throw ze; - } - } - - - /** - * Opens a Zip file with the given name for reading. - * @exception IOException if a i/o error occured. - * @exception ZipException if the file doesn't contain a valid zip - * archive. - */ - public ZipFile(String name) throws ZipException, IOException - { - this.raf = openFile(name,null); - this.name = name; - checkZipFile(); - } - - /** - * Opens a Zip file reading the given File. - * @exception IOException if a i/o error occured. - * @exception ZipException if the file doesn't contain a valid zip - * archive. - */ - public ZipFile(File file) throws ZipException, IOException - { - this.raf = openFile(null,file); - this.name = file.getPath(); - checkZipFile(); - } - - /** - * Opens a Zip file reading the given File in the given mode. - * - * If the OPEN_DELETE mode is specified, the zip file will be deleted at - * some time moment after it is opened. It will be deleted before the zip - * file is closed or the Virtual Machine exits. - * - * The contents of the zip file will be accessible until it is closed. - * - * @since JDK1.3 - * @param mode Must be one of OPEN_READ or OPEN_READ | OPEN_DELETE - * - * @exception IOException if a i/o error occured. - * @exception ZipException if the file doesn't contain a valid zip - * archive. - */ - public ZipFile(File file, int mode) throws ZipException, IOException - { - if (mode != OPEN_READ && mode != (OPEN_READ | OPEN_DELETE)) - throw new IllegalArgumentException("invalid mode"); - if ((mode & OPEN_DELETE) != 0) - file.deleteOnExit(); - this.raf = openFile(null,file); - this.name = file.getPath(); - checkZipFile(); - } - - private void checkZipFile() throws ZipException - { - boolean valid = false; - - try - { - byte[] buf = new byte[4]; - raf.readFully(buf); - int sig = buf[0] & 0xFF - | ((buf[1] & 0xFF) << 8) - | ((buf[2] & 0xFF) << 16) - | ((buf[3] & 0xFF) << 24); - valid = sig == LOCSIG; - } - catch (IOException _) - { - } - - if (!valid) - { - try - { - raf.close(); - } - catch (IOException _) - { - } - throw new ZipException("Not a valid zip file"); - } - } - - /** - * Checks if file is closed and throws an exception. - */ - private void checkClosed() - { - if (closed) - throw new IllegalStateException("ZipFile has closed: " + name); - } - - /** - * Read the central directory of a zip file and fill the entries - * array. This is called exactly once when first needed. It is called - * while holding the lock on <code>raf</code>. - * - * @exception IOException if a i/o error occured. - * @exception ZipException if the central directory is malformed - */ - private void readEntries() throws ZipException, IOException - { - /* Search for the End Of Central Directory. When a zip comment is - * present the directory may start earlier. - * Note that a comment has a maximum length of 64K, so that is the - * maximum we search backwards. - */ - PartialInputStream inp = new PartialInputStream(raf, 4096); - long pos = raf.length() - ENDHDR; - long top = Math.max(0, pos - 65536); - do - { - if (pos < top) - throw new ZipException - ("central directory not found, probably not a zip file: " + name); - inp.seek(pos--); - } - while (inp.readLeInt() != ENDSIG); - - if (inp.skip(ENDTOT - ENDNRD) != ENDTOT - ENDNRD) - throw new EOFException(name); - int count = inp.readLeShort(); - if (inp.skip(ENDOFF - ENDSIZ) != ENDOFF - ENDSIZ) - throw new EOFException(name); - int centralOffset = inp.readLeInt(); - - entries = new LinkedHashMap<String, ZipEntry> (count+count/2); - inp.seek(centralOffset); - - for (int i = 0; i < count; i++) - { - if (inp.readLeInt() != CENSIG) - throw new ZipException("Wrong Central Directory signature: " + name); - - inp.skip(6); - int method = inp.readLeShort(); - int dostime = inp.readLeInt(); - int crc = inp.readLeInt(); - int csize = inp.readLeInt(); - int size = inp.readLeInt(); - int nameLen = inp.readLeShort(); - int extraLen = inp.readLeShort(); - int commentLen = inp.readLeShort(); - inp.skip(8); - int offset = inp.readLeInt(); - String name = inp.readString(nameLen); - - ZipEntry entry = new ZipEntry(name); - entry.setMethod(method); - entry.setCrc(crc & 0xffffffffL); - entry.setSize(size & 0xffffffffL); - entry.setCompressedSize(csize & 0xffffffffL); - entry.setDOSTime(dostime); - if (extraLen > 0) - { - byte[] extra = new byte[extraLen]; - inp.readFully(extra); - entry.setExtra(extra); - } - if (commentLen > 0) - { - entry.setComment(inp.readString(commentLen)); - } - entry.offset = offset; - entries.put(name, entry); - } - } - - /** - * Closes the ZipFile. This also closes all input streams given by - * this class. After this is called, no further method should be - * called. - * - * @exception IOException if a i/o error occured. - */ - public void close() throws IOException - { - RandomAccessFile raf = this.raf; - if (raf == null) - return; - - synchronized (raf) - { - closed = true; - entries = null; - raf.close(); - } - } - - /** - * Calls the <code>close()</code> method when this ZipFile has not yet - * been explicitly closed. - */ - protected void finalize() throws IOException - { - if (!closed && raf != null) close(); - } - - /** - * Returns an enumeration of all Zip entries in this Zip file. - * - * @exception IllegalStateException when the ZipFile has already been closed - */ - public Enumeration<? extends ZipEntry> entries() - { - checkClosed(); - - try - { - return new ZipEntryEnumeration(getEntries().values().iterator()); - } - catch (IOException ioe) - { - return EmptyEnumeration.getInstance(); - } - } - - /** - * Checks that the ZipFile is still open and reads entries when necessary. - * - * @exception IllegalStateException when the ZipFile has already been closed. - * @exception IOException when the entries could not be read. - */ - private LinkedHashMap<String, ZipEntry> getEntries() throws IOException - { - synchronized(raf) - { - checkClosed(); - - if (entries == null) - readEntries(); - - return entries; - } - } - - /** - * Searches for a zip entry in this archive with the given name. - * - * @param name the name. May contain directory components separated by - * slashes ('/'). - * @return the zip entry, or null if no entry with that name exists. - * - * @exception IllegalStateException when the ZipFile has already been closed - */ - public ZipEntry getEntry(String name) - { - checkClosed(); - - try - { - LinkedHashMap<String, ZipEntry> entries = getEntries(); - ZipEntry entry = entries.get(name); - // If we didn't find it, maybe it's a directory. - if (entry == null && !name.endsWith("/")) - entry = entries.get(name + '/'); - return entry != null ? new ZipEntry(entry, name) : null; - } - catch (IOException ioe) - { - return null; - } - } - - /** - * Creates an input stream reading the given zip entry as - * uncompressed data. Normally zip entry should be an entry - * returned by getEntry() or entries(). - * - * This implementation returns null if the requested entry does not - * exist. This decision is not obviously correct, however, it does - * appear to mirror Sun's implementation, and it is consistant with - * their javadoc. On the other hand, the old JCL book, 2nd Edition, - * claims that this should return a "non-null ZIP entry". We have - * chosen for now ignore the old book, as modern versions of Ant (an - * important application) depend on this behaviour. See discussion - * in this thread: - * http://gcc.gnu.org/ml/java-patches/2004-q2/msg00602.html - * - * @param entry the entry to create an InputStream for. - * @return the input stream, or null if the requested entry does not exist. - * - * @exception IllegalStateException when the ZipFile has already been closed - * @exception IOException if a i/o error occured. - * @exception ZipException if the Zip archive is malformed. - */ - public InputStream getInputStream(ZipEntry entry) throws IOException - { - checkClosed(); - - LinkedHashMap<String, ZipEntry> entries = getEntries(); - String name = entry.getName(); - ZipEntry zipEntry = entries.get(name); - if (zipEntry == null) - return null; - - PartialInputStream inp = new PartialInputStream(raf, 1024); - inp.seek(zipEntry.offset); - - if (inp.readLeInt() != LOCSIG) - throw new ZipException("Wrong Local header signature: " + name); - - inp.skip(4); - - if (zipEntry.getMethod() != inp.readLeShort()) - throw new ZipException("Compression method mismatch: " + name); - - inp.skip(16); - - int nameLen = inp.readLeShort(); - int extraLen = inp.readLeShort(); - inp.skip(nameLen + extraLen); - - inp.setLength(zipEntry.getCompressedSize()); - - int method = zipEntry.getMethod(); - switch (method) - { - case ZipOutputStream.STORED: - return inp; - case ZipOutputStream.DEFLATED: - inp.addDummyByte(); - final Inflater inf = new Inflater(true); - final int sz = (int) entry.getSize(); - return new InflaterInputStream(inp, inf) - { - public int available() throws IOException - { - if (sz == -1) - return super.available(); - if (super.available() != 0) - return sz - inf.getTotalOut(); - return 0; - } - }; - default: - throw new ZipException("Unknown compression method " + method); - } - } - - /** - * Returns the (path) name of this zip file. - */ - public String getName() - { - return name; - } - - /** - * Returns the number of entries in this zip file. - * - * @exception IllegalStateException when the ZipFile has already been closed - */ - public int size() - { - checkClosed(); - - try - { - return getEntries().size(); - } - catch (IOException ioe) - { - return 0; - } - } - - private static class ZipEntryEnumeration implements Enumeration<ZipEntry> - { - private final Iterator<ZipEntry> elements; - - public ZipEntryEnumeration(Iterator<ZipEntry> elements) - { - this.elements = elements; - } - - public boolean hasMoreElements() - { - return elements.hasNext(); - } - - public ZipEntry nextElement() - { - /* We return a clone, just to be safe that the user doesn't - * change the entry. - */ - return (ZipEntry) (elements.next().clone()); - } - } - - private static final class PartialInputStream extends InputStream - { - /** - * The UTF-8 charset use for decoding the filenames. - */ - private static final Charset UTF8CHARSET = Charset.forName("UTF-8"); - - /** - * The actual UTF-8 decoder. Created on demand. - */ - private CharsetDecoder utf8Decoder; - - private final RandomAccessFile raf; - private final byte[] buffer; - private long bufferOffset; - private int pos; - private long end; - // We may need to supply an extra dummy byte to our reader. - // See Inflater. We use a count here to simplify the logic - // elsewhere in this class. Note that we ignore the dummy - // byte in methods where we know it is not needed. - private int dummyByteCount; - - public PartialInputStream(RandomAccessFile raf, int bufferSize) - throws IOException - { - this.raf = raf; - buffer = new byte[bufferSize]; - bufferOffset = -buffer.length; - pos = buffer.length; - end = raf.length(); - } - - void setLength(long length) - { - end = bufferOffset + pos + length; - } - - private void fillBuffer() throws IOException - { - synchronized (raf) - { - long len = end - bufferOffset; - if (len == 0 && dummyByteCount > 0) - { - buffer[0] = 0; - dummyByteCount = 0; - } - else - { - raf.seek(bufferOffset); - raf.readFully(buffer, 0, (int) Math.min(buffer.length, len)); - } - } - } - - public int available() - { - long amount = end - (bufferOffset + pos); - if (amount > Integer.MAX_VALUE) - return Integer.MAX_VALUE; - return (int) amount; - } - - public int read() throws IOException - { - if (bufferOffset + pos >= end + dummyByteCount) - return -1; - if (pos == buffer.length) - { - bufferOffset += buffer.length; - pos = 0; - fillBuffer(); - } - - return buffer[pos++] & 0xFF; - } - - public int read(byte[] b, int off, int len) throws IOException - { - if (len > end + dummyByteCount - (bufferOffset + pos)) - { - len = (int) (end + dummyByteCount - (bufferOffset + pos)); - if (len == 0) - return -1; - } - - int totalBytesRead = Math.min(buffer.length - pos, len); - System.arraycopy(buffer, pos, b, off, totalBytesRead); - pos += totalBytesRead; - off += totalBytesRead; - len -= totalBytesRead; - - while (len > 0) - { - bufferOffset += buffer.length; - pos = 0; - fillBuffer(); - int remain = Math.min(buffer.length, len); - System.arraycopy(buffer, pos, b, off, remain); - pos += remain; - off += remain; - len -= remain; - totalBytesRead += remain; - } - - return totalBytesRead; - } - - public long skip(long amount) throws IOException - { - if (amount < 0) - return 0; - if (amount > end - (bufferOffset + pos)) - amount = end - (bufferOffset + pos); - seek(bufferOffset + pos + amount); - return amount; - } - - void seek(long newpos) throws IOException - { - long offset = newpos - bufferOffset; - if (offset >= 0 && offset <= buffer.length) - { - pos = (int) offset; - } - else - { - bufferOffset = newpos; - pos = 0; - fillBuffer(); - } - } - - void readFully(byte[] buf) throws IOException - { - if (read(buf, 0, buf.length) != buf.length) - throw new EOFException(); - } - - void readFully(byte[] buf, int off, int len) throws IOException - { - if (read(buf, off, len) != len) - throw new EOFException(); - } - - int readLeShort() throws IOException - { - int result; - if(pos + 1 < buffer.length) - { - result = ((buffer[pos + 0] & 0xff) | (buffer[pos + 1] & 0xff) << 8); - pos += 2; - } - else - { - int b0 = read(); - int b1 = read(); - if (b1 == -1) - throw new EOFException(); - result = (b0 & 0xff) | (b1 & 0xff) << 8; - } - return result; - } - - int readLeInt() throws IOException - { - int result; - if(pos + 3 < buffer.length) - { - result = (((buffer[pos + 0] & 0xff) | (buffer[pos + 1] & 0xff) << 8) - | ((buffer[pos + 2] & 0xff) - | (buffer[pos + 3] & 0xff) << 8) << 16); - pos += 4; - } - else - { - int b0 = read(); - int b1 = read(); - int b2 = read(); - int b3 = read(); - if (b3 == -1) - throw new EOFException(); - result = (((b0 & 0xff) | (b1 & 0xff) << 8) | ((b2 & 0xff) - | (b3 & 0xff) << 8) << 16); - } - return result; - } - - /** - * Decode chars from byte buffer using UTF8 encoding. This - * operation is performance-critical since a jar file contains a - * large number of strings for the name of each file in the - * archive. This routine therefore avoids using the expensive - * utf8Decoder when decoding is straightforward. - * - * @param buffer the buffer that contains the encoded character - * data - * @param pos the index in buffer of the first byte of the encoded - * data - * @param length the length of the encoded data in number of - * bytes. - * - * @return a String that contains the decoded characters. - */ - private String decodeChars(byte[] buffer, int pos, int length) - throws IOException - { - String result; - int i=length - 1; - while ((i >= 0) && (buffer[i] <= 0x7f)) - { - i--; - } - if (i < 0) - { - result = new String(buffer, 0, pos, length); - } - else - { - ByteBuffer bufferBuffer = ByteBuffer.wrap(buffer, pos, length); - if (utf8Decoder == null) - utf8Decoder = UTF8CHARSET.newDecoder(); - utf8Decoder.reset(); - char [] characters = utf8Decoder.decode(bufferBuffer).array(); - result = String.valueOf(characters); - } - return result; - } - - String readString(int length) throws IOException - { - if (length > end - (bufferOffset + pos)) - throw new EOFException(); - - String result = null; - try - { - if (buffer.length - pos >= length) - { - result = decodeChars(buffer, pos, length); - pos += length; - } - else - { - byte[] b = new byte[length]; - readFully(b); - result = decodeChars(b, 0, length); - } - } - catch (UnsupportedEncodingException uee) - { - throw new AssertionError(uee); - } - return result; - } - - public void addDummyByte() - { - dummyByteCount = 1; - } - } -} Deleted: trunk/core/src/classpath/java/java/util/zip/ZipInputStream.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/ZipInputStream.java 2009-03-25 04:59:56 UTC (rev 5151) +++ trunk/core/src/classpath/java/java/util/zip/ZipInputStream.java 2009-03-25 11:00:27 UTC (rev 5152) @@ -1,381 +0,0 @@ -/* ZipInputStream.java -- - Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package java.util.zip; - -import java.io.EOFException; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; - -/** - * This is a FilterInputStream that reads the files in an zip archive - * one after another. It has a special method to get the zip entry of - * the next file. The zip entry contains information about the file name - * size, compressed size, CRC, etc. - * - * It includes support for STORED and DEFLATED entries. - * - * @author Jochen Hoenicke - */ -public class ZipInputStream extends InflaterInputStream implements ZipConstants -{ - private CRC32 crc = new CRC32(); - private ZipEntry entry = null; - - private int csize; - private int size; - private int method; - private int flags; - private int avail; - private boolean entryAtEOF; - - /** - * Creates a new Zip input stream, reading a zip archive. - */ - public ZipInputStream(InputStream in) - { - super(in, new Inflater(true)); - } - - private void fillBuf() throws IOException - { - avail = len = in.read(buf, 0, buf.length); - } - - private int readBuf(byte[] out, int offset, int length) throws IOException - { - if (avail <= 0) - { - fillBuf(); - if (avail <= 0) - return -1; - } - if (length > avail) - length = avail; - System.arraycopy(buf, len - avail, out, offset, length); - avail -= length; - return length; - } - - private void readFully(byte[] out) throws IOException - { - int off = 0; - int len = out.length; - while (len > 0) - { - int count = readBuf(out, off, len); - if (count == -1) - throw new EOFException(); - off += count; - len -= count; - } - } - - private int readLeByte() throws IOException - { - if (avail <= 0) - { - fillBuf(); - if (avail <= 0) - throw new ZipException("EOF in header"); - } - return buf[len - avail--] & 0xff; - } - - /** - * Read an unsigned short in little endian byte order. - */ - private int readLeShort() throws IOException - { - return readLeByte() | (readLeByte() << 8); - } - - /** - * Read an int in little endian byte order. - */ - private int readLeInt() throws IOException - { - return readLeShort() | (readLeShort() << 16); - } - - /** - * Open the next entry from the zip archive, and return its description. - * If the previous entry wasn't closed, this method will close it. - */ - public ZipEntry getNextEntry() throws IOException - { - if (crc == null) - throw new IOException("Stream closed."); - if (entry != null) - closeEntry(); - - int header = readLeInt(); - if (header == CENSIG) - { - /* Central Header reached. */ - close(); - return null; - } - if (header != LOCSIG) - throw new ZipException("Wrong Local header signature: " - + Integer.toHexString(header)); - /* skip version */ - readLeShort(); - flags = readLeShort(); - method = readLeShort(); - int dostime = readLeInt(); - int crc = readLeInt(); - csize = readLeInt(); - size = readLeInt(); - int nameLen = readLeShort(); - int extraLen = readLeShort(); - - if (method == ZipOutputStream.STORED && csize != size) - throw new ZipException("Stored, but compressed != uncompressed"); - - - byte[] buffer = new byte[nameLen]; - readFully(buffer); - String name; - try - { - name = new String(buffer, "UTF-8"); - } - catch (UnsupportedEncodingException uee) - { - throw new AssertionError(uee); - } - - entry = createZipEntry(name); - entryAtEOF = false; - entry.setMethod(method); - if ((flags & 8) == 0) - { - entry.setCrc(crc & 0xffffffffL); - entry.setSize(size & 0xffffffffL); - entry.setCompressedSize(csize & 0xffffffffL); - } - entry.setDOSTime(dostime); - if (extraLen > 0) - { - byte[] extra = new byte[extraLen]; - readFully(extra); - entry.setExtra(extra); - } - - if (method == ZipOutputStream.DEFLATED && avail > 0) - { - System.arraycopy(buf, len - avail, buf, 0, avail); - len = avail; - avail = 0; - inf.setInput(buf, 0, len); - } - return entry; - } - - private void readDataDescr() throws IOException - { - if (readLeInt() != EXTSIG) - throw new ZipException("Data descriptor signature not found"); - entry.setCrc(readLeInt() & 0xffffffffL); - csize = readLeInt(); - size = readLeInt(); - entry.setSize(size & 0xffffffffL); - entry.setCompressedSize(csize & 0xffffffffL); - } - - /** - * Closes the current zip entry and moves to the next one. - */ - public void closeEntry() throws IOException - { - if (crc == null) - throw new IOException("Stream closed."); - if (entry == null) - return; - - if (method == ZipOutputStream.DEFLATED) - { - if ((flags & 8) != 0) - { - /* We don't know how much we must skip, read until end. */ - byte[] tmp = new byte[2048]; - while (read(tmp) > 0) - ; - - /* read will close this entry */ - return; - } - csize -= inf.getTotalIn(); - avail = inf.getRemaining(); - } - - if (avail > csize && csize >= 0) - avail -= csize; - else - { - csize -= avail; - avail = 0; - while (csize != 0) - { - long skipped = in.skip(csize & 0xffffffffL); - if (skipped <= 0) - throw new ZipException("zip archive ends early."); - csize -= skipped; - } - } - - size = 0; - crc.reset(); - if (method == ZipOutputStream.DEFLATED) - inf.reset(); - entry = null; - entryAtEOF = true; - } - - public int available() throws IOException - { - return entryAtEOF ? 0 : 1; - } - - /** - * Reads a byte from the current zip entry. - * @return the byte or -1 on EOF. - * @exception IOException if a i/o error occured. - * @exception ZipException if the deflated stream is corrupted. - */ - public int read() throws IOException - { - byte[] b = new byte[1]; - if (read(b, 0, 1) <= 0) - return -1; - return b[0] & 0xff; - } - - /** - * Reads a block of bytes from the current zip entry. - * @return the number of bytes read (may be smaller, even before - * EOF), or -1 on EOF. - * @exception IOException if a i/o error occured. - * @exception ZipException if the deflated stream is corrupted. - */ - public int read(byte[] b, int off, int len) throws IOException - { - if (len == 0) - return 0; - if (crc == null) - throw new IOException("Stream closed."); - if (entry == null) - return -1; - boolean finished = false; - switch (method) - { - case ZipOutputStream.DEFLATED: - len = super.read(b, off, len); - if (len < 0) - { - if (!inf.finished()) - throw new ZipException("Inflater not finished!?"); - avail = inf.getRemaining(); - if ((flags & 8) != 0) - readDataDescr(); - - if (inf.getTotalIn() != csize - || inf.getTotalOut() != size) - throw new ZipException("size mismatch: "+csize+";"+size+" <-> "+inf.getTotalIn()+";"+inf.getTotalOut()); - inf.reset(); - finished = true; - } - break; - - case ZipOutputStream.STORED: - - if (len > csize && csize >= 0) - len = csize; - - len = readBuf(b, off, len); - if (len > 0) - { - csize -= len; - size -= len; - } - - if (csize == 0) - finished = true; - else if (len < 0) - throw new ZipException("EOF in stored block"); - break; - } - - if (len > 0) - crc.update(b, off, len); - - if (finished) - { - if ((crc.getValue() & 0xffffffffL) != entry.getCrc()) - throw new ZipException("CRC mismatch"); - crc.reset(); - entry = null; - entryAtEOF = true; - } - return len; - } - - /** - * Closes the zip file. - * @exception IOException if a i/o error occured. - */ - public void close() throws IOException - { - super.close(); - crc = null; - entry = null; - entryAtEOF = true; - } - - /** - * Creates a new zip entry for the given name. This is equivalent - * to new ZipEntry(name). - * @param name the name of the zip entry. - */ - protected ZipEntry createZipEntry(String name) - { - return new ZipEntry(name); - } -} Deleted: trunk/core/src/classpath/java/java/util/zip/ZipOutputStream.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/ZipOutputStream.java 2009-03-25 04:59:56 UTC (rev 5151) +++ trunk/core/src/classpath/java/java/util/zip/ZipOutputStream.java 2009-03-25 11:00:27 UTC (rev 5152) @@ -1,440 +0,0 @@ -/* ZipOutputStream.java -- - Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package java.util.zip; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.util.Enumeration; -import java.util.Vector; - -/** - * This is a FilterOutputStream that writes the files into a zip - * archive one after another. It has a special method to start a new - * zip entry. The zip entries contains information about the file name - * size, compressed size, CRC, etc. - * - * It includes support for STORED and DEFLATED entries. - * - * This class is not thread safe. - * - * @author Jochen Hoenicke - */ -public class ZipOutputStream extends DeflaterOutputStream implements ZipConstants -{ - private Vector entries = new Vector(); - private CRC32 crc = new CRC32(); - private ZipEntry curEntry = null; - - private int curMethod; - private int size; - private int offset = 0; - - private byte[] zipComment = new byte[0]; - private int defaultMethod = DEFLATED; - - /** - * Our Zip version is hard coded to 1.0 resp. 2.0 - */ - private static final int ZIP_STORED_VERSION = 10; - private static final int ZIP_DEFLATED_VERSION = 20; - - /** - * Compression method. This method doesn't compress at all. - */ - public static final int STORED = 0; - - /** - * Compression method. This method uses the Deflater. - */ - public static final int DEFLATED = 8; - - /** - * Creates a new Zip output stream, writing a zip archive. - * @param out the output stream to which the zip archive is written. - */ - public ZipOutputStream(OutputStream out) - { - super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true)); - } - - /** - * Set the zip file comment. - * @param comment the comment. - * @exception IllegalArgumentException if encoding of comment is - * longer than 0xffff bytes. - */ - public void setComment(String comment) - { - byte[] commentBytes; - try - { - commentBytes = comment.getBytes("UTF-8"); - } - catch (UnsupportedEncodingException uee) - { - throw new AssertionError(uee); - } - if (commentBytes.length > 0xffff) - throw new IllegalArgumentException("Comment too long."); - zipComment = commentBytes; - } - - /** - * Sets default compression method. If the Zip entry specifies - * another method its method takes precedence. - * @param method the method. - * @exception IllegalArgumentException if method is not supported. - * @see #STORED - * @see #DEFLATED - */ - public void setMethod(int method) - { - if (method != STORED && method != DEFLATED) - throw new IllegalArgumentException("Method not supported."); - defaultMethod = method; - } - - /** - * Sets default compression level. The new level will be activated - * immediately. - * @exception IllegalArgumentException if level is not supported. - * @see Deflater - */ - public void setLevel(int level) - { - def.setLevel(level); - } - - /** - * Write an unsigned short in little endian byte order. - */ - private void writeLeShort(int value) throws IOException - { - out.write(value & 0xff); - out.write((value >> 8) & 0xff); - } - - /** - * Write an int in little endian byte order. - */ - private void writeLeInt(int value) throws IOException - { - writeLeShort(value); - writeLeShort(value >> 16); - } - - /** - * Write a long value as an int. Some of the zip constants - * are declared as longs even though they fit perfectly well - * into integers. - */ - private void writeLeInt(long value) throws IOException - { - writeLeInt((int) value); - } - - /** - * Starts a new Zip entry. It automatically closes the previous - * entry if present. If the compression method is stored, the entry - * must have a valid size and crc, otherwise all elements (except - * name) are optional, but must be correct if present. If the time - * is not set in the entry, the current time is used. - * @param entry the entry. - * @exception IOException if an I/O error occured. - * @exception ZipException if stream was finished. - */ - public void putNextEntry(ZipEntry entry) throws IOException - { - if (entries == null) - throw new ZipException("ZipOutputStream was finished"); - - int method = entry.getMethod(); - int flags = 0; - i... [truncated message content] |
From: <chr...@us...> - 2009-04-03 05:36:48
|
Revision: 5212 http://jnode.svn.sourceforge.net/jnode/?rev=5212&view=rev Author: chrisboertien Date: 2009-04-03 05:36:41 +0000 (Fri, 03 Apr 2009) Log Message: ----------- Revert java.util.zip back to classpath implementation Signed-off-by: Chris Boertien <chr...@gm...> Added Paths: ----------- trunk/core/src/classpath/java/java/util/zip/Adler32.java trunk/core/src/classpath/java/java/util/zip/CRC32.java trunk/core/src/classpath/java/java/util/zip/CheckedInputStream.java trunk/core/src/classpath/java/java/util/zip/CheckedOutputStream.java trunk/core/src/classpath/java/java/util/zip/Checksum.java trunk/core/src/classpath/java/java/util/zip/DataFormatException.java trunk/core/src/classpath/java/java/util/zip/DeflaterOutputStream.java trunk/core/src/classpath/java/java/util/zip/GZIPInputStream.java trunk/core/src/classpath/java/java/util/zip/GZIPOutputStream.java trunk/core/src/classpath/java/java/util/zip/InflaterInputStream.java trunk/core/src/classpath/java/java/util/zip/ZipConstants.java trunk/core/src/classpath/java/java/util/zip/ZipEntry.java trunk/core/src/classpath/java/java/util/zip/ZipException.java trunk/core/src/classpath/java/java/util/zip/ZipFile.java trunk/core/src/classpath/java/java/util/zip/ZipInputStream.java trunk/core/src/classpath/java/java/util/zip/ZipOutputStream.java trunk/core/src/classpath/java/java/util/zip/package.html Removed Paths: ------------- trunk/core/src/openjdk/java/java/util/zip/Adler32.java trunk/core/src/openjdk/java/java/util/zip/CRC32.java trunk/core/src/openjdk/java/java/util/zip/CheckedInputStream.java trunk/core/src/openjdk/java/java/util/zip/CheckedOutputStream.java trunk/core/src/openjdk/java/java/util/zip/Checksum.java trunk/core/src/openjdk/java/java/util/zip/DataFormatException.java trunk/core/src/openjdk/java/java/util/zip/DeflaterOutputStream.java trunk/core/src/openjdk/java/java/util/zip/GZIPInputStream.java trunk/core/src/openjdk/java/java/util/zip/GZIPOutputStream.java trunk/core/src/openjdk/java/java/util/zip/InflaterInputStream.java trunk/core/src/openjdk/java/java/util/zip/ZipConstants.java trunk/core/src/openjdk/java/java/util/zip/ZipEntry.java trunk/core/src/openjdk/java/java/util/zip/ZipError.java trunk/core/src/openjdk/java/java/util/zip/ZipException.java trunk/core/src/openjdk/java/java/util/zip/ZipFile.java trunk/core/src/openjdk/java/java/util/zip/ZipInputStream.java trunk/core/src/openjdk/java/java/util/zip/ZipOutputStream.java trunk/core/src/openjdk/java/java/util/zip/package.html trunk/core/src/openjdk/vm/java/util/zip/NativeAdler32.java trunk/core/src/openjdk/vm/java/util/zip/NativeCRC32.java trunk/core/src/openjdk/vm/java/util/zip/NativeZipEntry.java trunk/core/src/openjdk/vm/java/util/zip/NativeZipFile.java trunk/core/src/openjdk/vm/java/util/zip/PartialInputStream.java trunk/core/src/openjdk/vm/java/util/zip/StructCache.java trunk/core/src/openjdk/vm/java/util/zip/ZipEntryStruct.java trunk/core/src/openjdk/vm/java/util/zip/ZipFileStruct.java trunk/core/src/openjdk/vm/java/util/zip/ZipUtil.java Added: trunk/core/src/classpath/java/java/util/zip/Adler32.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/Adler32.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/Adler32.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,205 @@ +/* Adler32.java - Computes Adler32 data checksum of a data stream + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.util.zip; + +/* + * Written using on-line Java Platform 1.2 API Specification, as well + * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). + * The actual Adler32 algorithm is taken from RFC 1950. + * Status: Believed complete and correct. + */ + +/** + * Computes Adler32 checksum for a stream of data. An Adler32 + * checksum is not as reliable as a CRC32 checksum, but a lot faster to + * compute. + *<p> + * The specification for Adler32 may be found in RFC 1950. + * (ZLIB Compressed Data Format Specification version 3.3) + *<p> + *<p> + * From that document: + *<p> + * "ADLER32 (Adler-32 checksum) + * This contains a checksum value of the uncompressed data + * (excluding any dictionary data) computed according to Adler-32 + * algorithm. This algorithm is a 32-bit extension and improvement + * of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 + * standard. + *<p> + * Adler-32 is composed of two sums accumulated per byte: s1 is + * the sum of all bytes, s2 is the sum of all s1 values. Both sums + * are done modulo 65521. s1 is initialized to 1, s2 to zero. The + * Adler-32 checksum is stored as s2*65536 + s1 in most- + * significant-byte first (network) order." + *<p> + * "8.2. The Adler-32 algorithm + *<p> + * The Adler-32 algorithm is much faster than the CRC32 algorithm yet + * still provides an extremely low probability of undetected errors. + *<p> + * The modulo on unsigned long accumulators can be delayed for 5552 + * bytes, so the modulo operation time is negligible. If the bytes + * are a, b, c, the second sum is 3a + 2b + c + 3, and so is position + * and order sensitive, unlike the first sum, which is just a + * checksum. That 65521 is prime is important to avoid a possible + * large class of two-byte errors that leave the check unchanged. + * (The Fletcher checksum uses 255, which is not prime and which also + * makes the Fletcher check insensitive to single byte changes 0 <-> + * 255.) + *<p> + * The sum s1 is initialized to 1 instead of zero to make the length + * of the sequence part of s2, so that the length does not have to be + * checked separately. (Any sequence of zeroes has a Fletcher + * checksum of zero.)" + * + * @author John Leuner, Per Bothner + * @since JDK 1.1 + * + * @see InflaterInputStream + * @see DeflaterOutputStream + */ +public class Adler32 implements Checksum +{ + + /** largest prime smaller than 65536 */ + private static final int BASE = 65521; + + private int checksum; //we do all in int. + + //Note that java doesn't have unsigned integers, + //so we have to be careful with what arithmetic + //we do. We return the checksum as a long to + //avoid sign confusion. + + /** + * Creates a new instance of the <code>Adler32</code> class. + * The checksum starts off with a value of 1. + */ + public Adler32 () + { + reset(); + } + + /** + * Resets the Adler32 checksum to the initial value. + */ + public void reset () + { + checksum = 1; //Initialize to 1 + } + + /** + * Updates the checksum with the byte b. + * + * @param bval the data value to add. The high byte of the int is ignored. + */ + public void update (int bval) + { + //We could make a length 1 byte array and call update again, but I + //would rather not have that overhead + int s1 = checksum & 0xffff; + int s2 = checksum >>> 16; + + s1 = (s1 + (bval & 0xFF)) % BASE; + s2 = (s1 + s2) % BASE; + + checksum = (s2 << 16) + s1; + } + + /** + * Updates the checksum with the bytes taken from the array. + * + * @param buffer an array of bytes + */ + public void update (byte[] buffer) + { + update(buffer, 0, buffer.length); + } + + /** + * Updates the checksum with the bytes taken from the array. + * + * @param buf an array of bytes + * @param off the start of the data used for this update + * @param len the number of bytes to use for this update + */ + public void update (byte[] buf, int off, int len) + { + //(By Per Bothner) + int s1 = checksum & 0xffff; + int s2 = checksum >>> 16; + + while (len > 0) + { + // We can defer the modulo operation: + // s1 maximally grows from 65521 to 65521 + 255 * 3800 + // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 + int n = 3800; + if (n > len) + n = len; + len -= n; + while (--n >= 0) + { + s1 = s1 + (buf[off++] & 0xFF); + s2 = s2 + s1; + } + s1 %= BASE; + s2 %= BASE; + } + + /*Old implementation, borrowed from somewhere: + int n; + + while (len-- > 0) { + + s1 = (s1 + (bs[offset++] & 0xff)) % BASE; + s2 = (s2 + s1) % BASE; + }*/ + + checksum = (s2 << 16) | s1; + } + + /** + * Returns the Adler32 data checksum computed so far. + */ + public long getValue() + { + return (long) checksum & 0xffffffffL; + } +} Added: trunk/core/src/classpath/java/java/util/zip/CRC32.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/CRC32.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/CRC32.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,132 @@ +/* CRC32.java - Computes CRC32 data checksum of a data stream + Copyright (C) 1999. 2000, 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.util.zip; + +/* + * Written using on-line Java Platform 1.2 API Specification, as well + * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). + * The actual CRC32 algorithm is taken from RFC 1952. + * Status: Believed complete and correct. + */ + +/** + * Computes CRC32 data checksum of a data stream. + * The actual CRC32 algorithm is described in RFC 1952 + * (GZIP file format specification version 4.3). + * Can be used to get the CRC32 over a stream if used with checked input/output + * streams. + * + * @see InflaterInputStream + * @see DeflaterOutputStream + * + * @author Per Bothner + * @date April 1, 1999. + */ +public class CRC32 implements Checksum +{ + /** The crc data checksum so far. */ + private int crc = 0; + + /** The fast CRC table. Computed once when the CRC32 class is loaded. */ + private static int[] crc_table = make_crc_table(); + + /** Make the table for a fast CRC. */ + private static int[] make_crc_table () + { + int[] crc_table = new int[256]; + for (int n = 0; n < 256; n++) + { + int c = n; + for (int k = 8; --k >= 0; ) + { + if ((c & 1) != 0) + c = 0xedb88320 ^ (c >>> 1); + else + c = c >>> 1; + } + crc_table[n] = c; + } + return crc_table; + } + + /** + * Returns the CRC32 data checksum computed so far. + */ + public long getValue () + { + return (long) crc & 0xffffffffL; + } + + /** + * Resets the CRC32 data checksum as if no update was ever called. + */ + public void reset () { crc = 0; } + + /** + * Updates the checksum with the int bval. + * + * @param bval (the byte is taken as the lower 8 bits of bval) + */ + + public void update (int bval) + { + int c = ~crc; + c = crc_table[(c ^ bval) & 0xff] ^ (c >>> 8); + crc = ~c; + } + + /** + * Adds the byte array to the data checksum. + * + * @param buf the buffer which contains the data + * @param off the offset in the buffer where the data starts + * @param len the length of the data + */ + public void update (byte[] buf, int off, int len) + { + int c = ~crc; + while (--len >= 0) + c = crc_table[(c ^ buf[off++]) & 0xff] ^ (c >>> 8); + crc = ~c; + } + + /** + * Adds the complete byte array to the data checksum. + */ + public void update (byte[] buf) { update(buf, 0, buf.length); } +} Added: trunk/core/src/classpath/java/java/util/zip/CheckedInputStream.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/CheckedInputStream.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/CheckedInputStream.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,135 @@ +/* CheckedInputStream.java - Compute checksum of data being read + Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.util.zip; + +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; + +/* Written using on-line Java Platform 1.2 API Specification + * and JCL book. + * Believed complete and correct. + */ + +/** + * InputStream that computes a checksum of the data being read using a + * supplied Checksum object. + * + * @see Checksum + * + * @author Tom Tromey + * @date May 17, 1999 + */ +public class CheckedInputStream extends FilterInputStream +{ + /** + * Creates a new CheckInputStream on top of the supplied OutputStream + * using the supplied Checksum. + */ + public CheckedInputStream (InputStream in, Checksum sum) + { + super (in); + this.sum = sum; + } + + /** + * Returns the Checksum object used. To get the data checksum computed so + * far call <code>getChecksum.getValue()</code>. + */ + public Checksum getChecksum () + { + return sum; + } + + /** + * Reads one byte, updates the checksum and returns the read byte + * (or -1 when the end of file was reached). + */ + public int read () throws IOException + { + int x = in.read(); + if (x != -1) + sum.update(x); + return x; + } + + /** + * Reads at most len bytes in the supplied buffer and updates the checksum + * with it. Returns the number of bytes actually read or -1 when the end + * of file was reached. + */ + public int read (byte[] buf, int off, int len) throws IOException + { + int r = in.read(buf, off, len); + if (r != -1) + sum.update(buf, off, r); + return r; + } + + /** + * Skips n bytes by reading them in a temporary buffer and updating the + * the checksum with that buffer. Returns the actual number of bytes skiped + * which can be less then requested when the end of file is reached. + */ + public long skip (long n) throws IOException + { + if (n == 0) + return 0; + + int min = (int) Math.min(n, 1024); + byte[] buf = new byte[min]; + + long s = 0; + while (n > 0) + { + int r = in.read(buf, 0, min); + if (r == -1) + break; + n -= r; + s += r; + min = (int) Math.min(n, 1024); + sum.update(buf, 0, r); + } + + return s; + } + + /** The checksum object. */ + private Checksum sum; +} Added: trunk/core/src/classpath/java/java/util/zip/CheckedOutputStream.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/CheckedOutputStream.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/CheckedOutputStream.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,100 @@ +/* CheckedOutputStream.java - Compute checksum of data being written. + Copyright (C) 1999, 2000 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.util.zip; + +import java.io.FilterOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +/* Written using on-line Java Platform 1.2 API Specification + * and JCL book. + * Believed complete and correct. + */ + +/** + * OutputStream that computes a checksum of data being written using a + * supplied Checksum object. + * + * @see Checksum + * + * @author Tom Tromey + * @date May 17, 1999 + */ +public class CheckedOutputStream extends FilterOutputStream +{ + /** + * Creates a new CheckInputStream on top of the supplied OutputStream + * using the supplied Checksum. + */ + public CheckedOutputStream (OutputStream out, Checksum cksum) + { + super (out); + this.sum = cksum; + } + + /** + * Returns the Checksum object used. To get the data checksum computed so + * far call <code>getChecksum.getValue()</code>. + */ + public Checksum getChecksum () + { + return sum; + } + + /** + * Writes one byte to the OutputStream and updates the Checksum. + */ + public void write (int bval) throws IOException + { + out.write(bval); + sum.update(bval); + } + + /** + * Writes the byte array to the OutputStream and updates the Checksum. + */ + public void write (byte[] buf, int off, int len) throws IOException + { + out.write(buf, off, len); + sum.update(buf, off, len); + } + + /** The checksum object. */ + private Checksum sum; +} Added: trunk/core/src/classpath/java/java/util/zip/Checksum.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/Checksum.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/Checksum.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,86 @@ +/* Checksum.java - Interface to compute a data checksum + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.util.zip; + +/* + * Written using on-line Java Platform 1.2 API Specification, as well + * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). + * Status: Believed complete and correct. + */ + +/** + * Interface to compute a data checksum used by checked input/output streams. + * A data checksum can be updated by one byte or with a byte array. After each + * update the value of the current checksum can be returned by calling + * <code>getValue</code>. The complete checksum object can also be reset + * so it can be used again with new data. + * + * @see CheckedInputStream + * @see CheckedOutputStream + * + * @author Per Bothner + * @author Jochen Hoenicke + */ +public interface Checksum +{ + /** + * Returns the data checksum computed so far. + */ + long getValue(); + + /** + * Resets the data checksum as if no update was ever called. + */ + void reset(); + + /** + * Adds one byte to the data checksum. + * + * @param bval the data value to add. The high byte of the int is ignored. + */ + void update (int bval); + + /** + * Adds the byte array to the data checksum. + * + * @param buf the buffer which contains the data + * @param off the offset in the buffer where the data starts + * @param len the length of the data + */ + void update (byte[] buf, int off, int len); +} Added: trunk/core/src/classpath/java/java/util/zip/DataFormatException.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/DataFormatException.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/DataFormatException.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,71 @@ +/* DataformatException.java -- thrown when compressed data is corrupt + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.util.zip; + +/** + * Exception thrown when compressed data is corrupt. + * + * @author Tom Tromey + * @author John Leuner + * @since 1.1 + * @status updated to 1.4 + */ +public class DataFormatException extends Exception +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 2219632870893641452L; + + /** + * Create an exception without a message. + */ + public DataFormatException() + { + } + + /** + * Create an exception with a message. + * + * @param msg the message + */ + public DataFormatException(String msg) + { + super(msg); + } +} Added: trunk/core/src/classpath/java/java/util/zip/DeflaterOutputStream.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/DeflaterOutputStream.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/DeflaterOutputStream.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,198 @@ +/* DeflaterOutputStream.java - Output filter for compressing. + Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.util.zip; + +import java.io.FilterOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +/* Written using on-line Java Platform 1.2 API Specification + * and JCL book. + * Believed complete and correct. + */ + +/** + * This is a special FilterOutputStream deflating the bytes that are + * written through it. It uses the Deflater for deflating. + * + * A special thing to be noted is that flush() doesn't flush + * everything in Sun's JDK, but it does so in jazzlib. This is because + * Sun's Deflater doesn't have a way to flush() everything, without + * finishing the stream. + * + * @author Tom Tromey, Jochen Hoenicke + * @date Jan 11, 2001 + */ +public class DeflaterOutputStream extends FilterOutputStream +{ + /** + * This buffer is used temporarily to retrieve the bytes from the + * deflater and write them to the underlying output stream. + */ + protected byte[] buf; + + /** + * The deflater which is used to deflate the stream. + */ + protected Deflater def; + + /** + * Deflates everything in the def's input buffers. This will call + * <code>def.deflate()</code> until all bytes from the input buffers + * are processed. + */ + protected void deflate() throws IOException + { + while (! def.needsInput()) + { + int len = def.deflate(buf, 0, buf.length); + + // System.err.println("DOS deflated " + len + " out of " + buf.length); + if (len <= 0) + break; + out.write(buf, 0, len); + } + + if (! def.needsInput()) + throw new InternalError("Can't deflate all input?"); + } + + /** + * Creates a new DeflaterOutputStream with a default Deflater and + * default buffer size. + * @param out the output stream where deflated output should be written. + */ + public DeflaterOutputStream(OutputStream out) + { + this(out, new Deflater(), 4096); + } + + /** + * Creates a new DeflaterOutputStream with the given Deflater and + * default buffer size. + * @param out the output stream where deflated output should be written. + * @param defl the underlying deflater. + */ + public DeflaterOutputStream(OutputStream out, Deflater defl) + { + this(out, defl, 4096); + } + + /** + * Creates a new DeflaterOutputStream with the given Deflater and + * buffer size. + * @param out the output stream where deflated output should be written. + * @param defl the underlying deflater. + * @param bufsize the buffer size. + * @exception IllegalArgumentException if bufsize isn't positive. + */ + public DeflaterOutputStream(OutputStream out, Deflater defl, int bufsize) + { + super(out); + if (bufsize <= 0) + throw new IllegalArgumentException("bufsize <= 0"); + buf = new byte[bufsize]; + def = defl; + } + + /** + * Flushes the stream by calling flush() on the deflater and then + * on the underlying stream. This ensures that all bytes are + * flushed. This function doesn't work in Sun's JDK, but only in + * jazzlib. + */ + public void flush() throws IOException + { + def.flush(); + deflate(); + out.flush(); + } + + /** + * Finishes the stream by calling finish() on the deflater. This + * was the only way to ensure that all bytes are flushed in Sun's + * JDK. + */ + public void finish() throws IOException + { + def.finish(); + while (! def.finished()) + { + int len = def.deflate(buf, 0, buf.length); + if (len <= 0) + break; + out.write(buf, 0, len); + } + if (! def.finished()) + throw new InternalError("Can't deflate all input?"); + out.flush(); + } + + /** + * Calls finish() and closes the stream. + */ + public void close() throws IOException + { + finish(); + out.close(); + } + + /** + * Writes a single byte to the compressed output stream. + * @param bval the byte value. + */ + public void write(int bval) throws IOException + { + byte[] b = new byte[1]; + b[0] = (byte) bval; + write(b, 0, 1); + } + + /** + * Writes a len bytes from an array to the compressed stream. + * @param buf the byte array. + * @param off the offset into the byte array where to start. + * @param len the number of bytes to write. + */ + public void write(byte[] buf, int off, int len) throws IOException + { + def.setInput(buf, off, len); + deflate(); + } +} Added: trunk/core/src/classpath/java/java/util/zip/GZIPInputStream.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/GZIPInputStream.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/GZIPInputStream.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,355 @@ +/* GZIPInputStream.java - Input filter for reading gzip file + Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.util.zip; + +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; + +/** + * This filter stream is used to decompress a "GZIP" format stream. + * The "GZIP" format is described in RFC 1952. + * + * @author John Leuner + * @author Tom Tromey + * @since JDK 1.1 + */ +public class GZIPInputStream + extends InflaterInputStream +{ + /** + * The magic number found at the start of a GZIP stream. + */ + public static final int GZIP_MAGIC = 0x8b1f; + + /** + * The mask for bit 0 of the flag byte. + */ + static final int FTEXT = 0x1; + + /** + * The mask for bit 1 of the flag byte. + */ + static final int FHCRC = 0x2; + + /** + * The mask for bit 2 of the flag byte. + */ + static final int FEXTRA = 0x4; + + /** + * The mask for bit 3 of the flag byte. + */ + static final int FNAME = 0x8; + + /** + * The mask for bit 4 of the flag byte. + */ + static final int FCOMMENT = 0x10; + + /** + * The CRC-32 checksum value for uncompressed data. + */ + protected CRC32 crc; + + /** + * Indicates whether or not the end of the stream has been reached. + */ + protected boolean eos; + + /** + * Indicates whether or not the GZIP header has been read in. + */ + private boolean readGZIPHeader; + + /** + * Creates a GZIPInputStream with the default buffer size. + * + * @param in The stream to read compressed data from + * (in GZIP format). + * + * @throws IOException if an error occurs during an I/O operation. + */ + public GZIPInputStream(InputStream in) + throws IOException + { + this(in, 4096); + } + + /** + * Creates a GZIPInputStream with the specified buffer size. + * + * @param in The stream to read compressed data from + * (in GZIP format). + * @param size The size of the buffer to use. + * + * @throws IOException if an error occurs during an I/O operation. + * @throws IllegalArgumentException if <code>size</code> + * is less than or equal to 0. + */ + public GZIPInputStream(InputStream in, int size) + throws IOException + { + super(in, new Inflater(true), size); + crc = new CRC32(); + readHeader(); + } + + /** + * Closes the input stream. + * + * @throws IOException if an error occurs during an I/O operation. + */ + public void close() + throws IOException + { + // Nothing to do here. + super.close(); + } + + /** + * Reads in GZIP-compressed data and stores it in uncompressed form + * into an array of bytes. The method will block until either + * enough input data becomes available or the compressed stream + * reaches its end. + * + * @param buf the buffer into which the uncompressed data will + * be stored. + * @param offset the offset indicating where in <code>buf</code> + * the uncompressed data should be placed. + * @param len the number of uncompressed bytes to be read. + */ + public int read(byte[] buf, int offset, int len) throws IOException + { + // We first have to slurp in the GZIP header, then we feed all the + // rest of the data to the superclass. + // + // As we do that we continually update the CRC32. Once the data is + // finished, we check the CRC32. + // + // This means we don't need our own buffer, as everything is done + // in the superclass. + if (!readGZIPHeader) + readHeader(); + + if (eos) + return -1; + + // System.err.println("GZIPIS.read(byte[], off, len ... " + offset + " and len " + len); + + /* We don't have to read the header, + * so we just grab data from the superclass. + */ + int numRead = super.read(buf, offset, len); + if (numRead > 0) + crc.update(buf, offset, numRead); + + if (inf.finished()) + readFooter(); + return numRead; + } + + + /** + * Reads in the GZIP header. + */ + private void readHeader() throws IOException + { + /* 1. Check the two magic bytes */ + CRC32 headCRC = new CRC32(); + int magic = in.read(); + if (magic < 0) + { + eos = true; + return; + } + int magic2 = in.read(); + if ((magic + (magic2 << 8)) != GZIP_MAGIC) + throw new IOException("Error in GZIP header, bad magic code"); + headCRC.update(magic); + headCRC.update(magic2); + + /* 2. Check the compression type (must be 8) */ + int CM = in.read(); + if (CM != Deflater.DEFLATED) + throw new IOException("Error in GZIP header, data not in deflate format"); + headCRC.update(CM); + + /* 3. Check the flags */ + int flags = in.read(); + if (flags < 0) + throw new EOFException("Early EOF in GZIP header"); + headCRC.update(flags); + + /* This flag byte is divided into individual bits as follows: + + bit 0 FTEXT + bit 1 FHCRC + bit 2 FEXTRA + bit 3 FNAME + bit 4 FCOMMENT + bit 5 reserved + bit 6 reserved + bit 7 reserved + */ + + /* 3.1 Check the reserved bits are zero */ + if ((flags & 0xd0) != 0) + throw new IOException("Reserved flag bits in GZIP header != 0"); + + /* 4.-6. Skip the modification time, extra flags, and OS type */ + for (int i=0; i< 6; i++) + { + int readByte = in.read(); + if (readByte < 0) + throw new EOFException("Early EOF in GZIP header"); + headCRC.update(readByte); + } + + /* 7. Read extra field */ + if ((flags & FEXTRA) != 0) + { + /* Skip subfield id */ + for (int i=0; i< 2; i++) + { + int readByte = in.read(); + if (readByte < 0) + throw new EOFException("Early EOF in GZIP header"); + headCRC.update(readByte); + } + if (in.read() < 0 || in.read() < 0) + throw new EOFException("Early EOF in GZIP header"); + + int len1, len2, extraLen; + len1 = in.read(); + len2 = in.read(); + if ((len1 < 0) || (len2 < 0)) + throw new EOFException("Early EOF in GZIP header"); + headCRC.update(len1); + headCRC.update(len2); + + extraLen = (len1 << 8) | len2; + for (int i = 0; i < extraLen;i++) + { + int readByte = in.read(); + if (readByte < 0) + throw new EOFException("Early EOF in GZIP header"); + headCRC.update(readByte); + } + } + + /* 8. Read file name */ + if ((flags & FNAME) != 0) + { + int readByte; + while ( (readByte = in.read()) > 0) + headCRC.update(readByte); + if (readByte < 0) + throw new EOFException("Early EOF in GZIP file name"); + headCRC.update(readByte); + } + + /* 9. Read comment */ + if ((flags & FCOMMENT) != 0) + { + int readByte; + while ( (readByte = in.read()) > 0) + headCRC.update(readByte); + + if (readByte < 0) + throw new EOFException("Early EOF in GZIP comment"); + headCRC.update(readByte); + } + + /* 10. Read header CRC */ + if ((flags & FHCRC) != 0) + { + int tempByte; + int crcval = in.read(); + if (crcval < 0) + throw new EOFException("Early EOF in GZIP header"); + + tempByte = in.read(); + if (tempByte < 0) + throw new EOFException("Early EOF in GZIP header"); + + crcval = (crcval << 8) | tempByte; + if (crcval != ((int) headCRC.getValue() & 0xffff)) + throw new IOException("Header CRC value mismatch"); + } + + readGZIPHeader = true; + //System.err.println("Read GZIP header"); + } + + private void readFooter() throws IOException + { + byte[] footer = new byte[8]; + int avail = inf.getRemaining(); + if (avail > 8) + avail = 8; + System.arraycopy(buf, len - inf.getRemaining(), footer, 0, avail); + int needed = 8 - avail; + while (needed > 0) + { + int count = in.read(footer, 8-needed, needed); + if (count <= 0) + throw new EOFException("Early EOF in GZIP footer"); + needed -= count; //Jewel Jan 16 + } + + int crcval = (footer[0] & 0xff) | ((footer[1] & 0xff) << 8) + | ((footer[2] & 0xff) << 16) | (footer[3] << 24); + if (crcval != (int) crc.getValue()) + throw new IOException("GZIP crc sum mismatch, theirs \"" + + Integer.toHexString(crcval) + + "\" and ours \"" + + Integer.toHexString( (int) crc.getValue())); + + int total = (footer[4] & 0xff) | ((footer[5] & 0xff) << 8) + | ((footer[6] & 0xff) << 16) | (footer[7] << 24); + if (total != inf.getTotalOut()) + throw new IOException("Number of bytes mismatch"); + + /* FIXME" XXX Should we support multiple members. + * Difficult, since there may be some bytes still in buf + */ + eos = true; + } +} Added: trunk/core/src/classpath/java/java/util/zip/GZIPOutputStream.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/GZIPOutputStream.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/GZIPOutputStream.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,151 @@ +/* GZIPOutputStream.java - Create a file in gzip format + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.util.zip; + +import java.io.IOException; +import java.io.OutputStream; + +/** + * This filter stream is used to compress a stream into a "GZIP" stream. + * The "GZIP" format is described in RFC 1952. + * + * @author John Leuner + * @author Tom Tromey + * @since JDK 1.1 + */ + +/* Written using on-line Java Platform 1.2 API Specification + * and JCL book. + * Believed complete and correct. + */ + +public class GZIPOutputStream extends DeflaterOutputStream +{ + /** + * CRC-32 value for uncompressed data + */ + protected CRC32 crc; + + /** + * Creates a GZIPOutputStream with the default buffer size + * + * @param out The stream to read data (to be compressed) from + * + */ + public GZIPOutputStream(OutputStream out) throws IOException + { + this(out, 4096); + } + + /** + * Creates a GZIPOutputStream with the specified buffer size + * + * @param out The stream to read compressed data from + * @param size Size of the buffer to use + */ + public GZIPOutputStream(OutputStream out, int size) throws IOException + { + super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size); + crc = new CRC32(); + int mod_time = (int) (System.currentTimeMillis() / 1000L); + byte[] gzipHeader = + { + /* The two magic bytes */ + (byte) GZIPInputStream.GZIP_MAGIC, + (byte) (GZIPInputStream.GZIP_MAGIC >> 8), + + /* The compression type */ + (byte) Deflater.DEFLATED, + + /* The flags (not set) */ + 0, + + /* The modification time */ + (byte) mod_time, (byte) (mod_time >> 8), + (byte) (mod_time >> 16), (byte) (mod_time >> 24), + + /* The extra flags */ + 0, + + /* The OS type (unknown) */ + (byte) 255 + }; + + out.write(gzipHeader); + // System.err.println("wrote GZIP header (" + gzipHeader.length + " bytes )"); + } + + public synchronized void write(byte[] buf, int off, int len) + throws IOException + { + super.write(buf, off, len); + crc.update(buf, off, len); + } + + /** + * Writes remaining compressed output data to the output stream + * and closes it. + */ + public void close() throws IOException + { + finish(); + out.close(); + } + + public void finish() throws IOException + { + super.finish(); + + int totalin = def.getTotalIn(); + int crcval = (int) (crc.getValue() & 0xffffffff); + + // System.err.println("CRC val is " + Integer.toHexString( crcval ) + " and length " + Integer.toHexString(totalin)); + + byte[] gzipFooter = + { + (byte) crcval, (byte) (crcval >> 8), + (byte) (crcval >> 16), (byte) (crcval >> 24), + + (byte) totalin, (byte) (totalin >> 8), + (byte) (totalin >> 16), (byte) (totalin >> 24) + }; + + out.write(gzipFooter); + // System.err.println("wrote GZIP trailer (" + gzipFooter.length + " bytes )"); + } +} Added: trunk/core/src/classpath/java/java/util/zip/InflaterInputStream.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/InflaterInputStream.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/InflaterInputStream.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,261 @@ +/* InflaterInputStream.java - Input stream filter for decompressing + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.util.zip; + +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; + +/** + * This filter stream is used to decompress data compressed in the "deflate" + * format. The "deflate" format is described in RFC 1951. + * + * This stream may form the basis for other decompression filters, such + * as the <code>GZIPInputStream</code>. + * + * @author John Leuner + * @author Tom Tromey + * @since 1.1 + */ +public class InflaterInputStream extends FilterInputStream +{ + /** + * Decompressor for this filter + */ + protected Inflater inf; + + /** + * Byte array used as a buffer + */ + protected byte[] buf; + + /** + * Size of buffer + */ + protected int len; + + // We just use this if we are decoding one byte at a time with the + // read() call. + private byte[] onebytebuffer = new byte[1]; + + /** + * Create an InflaterInputStream with the default decompresseor + * and a default buffer size. + * + * @param in the InputStream to read bytes from + */ + public InflaterInputStream(InputStream in) + { + this(in, new Inflater(), 4096); + } + + /** + * Create an InflaterInputStream with the specified decompresseor + * and a default buffer size. + * + * @param in the InputStream to read bytes from + * @param inf the decompressor used to decompress data read from in + */ + public InflaterInputStream(InputStream in, Inflater inf) + { + this(in, inf, 4096); + } + + /** + * Create an InflaterInputStream with the specified decompresseor + * and a specified buffer size. + * + * @param in the InputStream to read bytes from + * @param inf the decompressor used to decompress data read from in + * @param size size of the buffer to use + */ + public InflaterInputStream(InputStream in, Inflater inf, int size) + { + super(in); + + if (in == null) + throw new NullPointerException("in may not be null"); + if (inf == null) + throw new NullPointerException("inf may not be null"); + if (size < 0) + throw new IllegalArgumentException("size may not be negative"); + + this.inf = inf; + this.buf = new byte [size]; + } + + /** + * Returns 0 once the end of the stream (EOF) has been reached. + * Otherwise returns 1. + */ + public int available() throws IOException + { + // According to the JDK 1.2 docs, this should only ever return 0 + // or 1 and should not be relied upon by Java programs. + if (inf == null) + throw new IOException("stream closed"); + return inf.finished() ? 0 : 1; + } + + /** + * Closes the input stream + */ + public synchronized void close() throws IOException + { + if (in != null) + in.close(); + in = null; + } + + /** + * Fills the buffer with more data to decompress. + */ + protected void fill() throws IOException + { + if (in == null) + throw new ZipException ("InflaterInputStream is closed"); + + len = in.read(buf, 0, buf.length); + + if (len < 0) + throw new ZipException("Deflated stream ends early."); + + inf.setInput(buf, 0, len); + } + + /** + * Reads one byte of decompressed data. + * + * The byte is in the lower 8 bits of the int. + */ + public int read() throws IOException + { + int nread = read(onebytebuffer, 0, 1); + if (nread > 0) + return onebytebuffer[0] & 0xff; + return -1; + } + + /** + * Decompresses data into the byte array + * + * @param b the array to read and decompress data into + * @param off the offset indicating where the data should be placed + * @param len the number of bytes to decompress + */ + public int read(byte[] b, int off, int len) throws IOException + { + if (inf == null) + throw new IOException("stream closed"); + if (len == 0) + return 0; + + int count = 0; + for (;;) + { + + try + { + count = inf.inflate(b, off, len); + } + catch (DataFormatException dfe) + { + throw new ZipException(dfe.getMessage()); + } + + if (count > 0) + return count; + + if (inf.needsDictionary() + | inf.finished()) + return -1; + else if (inf.needsInput()) + fill(); + else + throw new InternalError("Don't know what to do"); + } + } + + /** + * Skip specified number of bytes of uncompressed data + * + * @param n number of bytes to skip + */ + public long skip(long n) throws IOException + { + if (inf == null) + throw new IOException("stream closed"); + if (n < 0) + throw new IllegalArgumentException(); + + if (n == 0) + return 0; + + int buflen = (int) Math.min(n, 2048); + byte[] tmpbuf = new byte[buflen]; + + long skipped = 0L; + while (n > 0L) + { + int numread = read(tmpbuf, 0, buflen); + if (numread <= 0) + break; + n -= numread; + skipped += numread; + buflen = (int) Math.min(n, 2048); + } + + return skipped; + } + + public boolean markSupported() + { + return false; + } + + public void mark(int readLimit) + { + } + + public void reset() throws IOException + { + throw new IOException("reset not supported"); + } +} Added: trunk/core/src/classpath/java/java/util/zip/ZipConstants.java =================================================================== --- trunk/core/src/classpath/java/java/util/zip/ZipConstants.java (rev 0) +++ trunk/core/src/classpath/java/java/util/zip/ZipConstants.java 2009-04-03 05:36:41 UTC (rev 5212) @@ -0,0 +1,94 @@ +/* java.util.zip.ZipConstants + Copyright (C) 2001, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, pr... [truncated message content] |
From: <ls...@us...> - 2009-04-06 14:55:33
|
Revision: 5226 http://jnode.svn.sourceforge.net/jnode/?rev=5226&view=rev Author: lsantha Date: 2009-04-06 14:55:27 +0000 (Mon, 06 Apr 2009) Log Message: ----------- Separating jnode specific code from classlib. Modified Paths: -------------- trunk/core/src/classlib/org/jnode/annotation/AllowedPackages.java trunk/core/src/classlib/org/jnode/annotation/CheckPermission.java trunk/core/src/classlib/org/jnode/annotation/DoPrivileged.java trunk/core/src/classlib/org/jnode/annotation/Inline.java trunk/core/src/classlib/org/jnode/annotation/Internal.java trunk/core/src/classlib/org/jnode/annotation/KernelSpace.java trunk/core/src/classlib/org/jnode/annotation/LoadStatics.java trunk/core/src/classlib/org/jnode/annotation/MagicPermission.java trunk/core/src/classlib/org/jnode/annotation/NoFieldAlignments.java trunk/core/src/classlib/org/jnode/annotation/NoInline.java trunk/core/src/classlib/org/jnode/annotation/NoReadBarrier.java trunk/core/src/classlib/org/jnode/annotation/NoWriteBarrier.java trunk/core/src/classlib/org/jnode/annotation/PrivilegedActionPragma.java trunk/core/src/classlib/org/jnode/annotation/SharedStatics.java trunk/core/src/classlib/org/jnode/annotation/Uninterruptible.java trunk/core/src/classpath/ext/javax/isolate/IsolateStatus.java trunk/core/src/classpath/gnu/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java trunk/core/src/classpath/gnu/gnu/classpath/jdwp/transport/TransportFactory.java trunk/core/src/classpath/gnu/gnu/java/awt/ClasspathToolkit.java trunk/core/src/classpath/java/java/lang/ClassLoader.java trunk/core/src/classpath/java/java/lang/Thread.java trunk/core/src/classpath/javax/javax/imageio/spi/IIORegistry.java trunk/core/src/classpath/vm/java/lang/NativeThread.java trunk/core/src/classpath/vm/java/lang/ThreadHelper.java trunk/core/src/classpath/vm/java/net/VMNetUtils.java trunk/core/src/core/org/jnode/boot/Main.java trunk/core/src/core/org/jnode/boot/MemoryResourceInputStream.java trunk/core/src/core/org/jnode/naming/DefaultNameSpace.java trunk/core/src/core/org/jnode/naming/InitialNaming.java trunk/core/src/core/org/jnode/system/IOResource.java trunk/core/src/core/org/jnode/system/MemoryResource.java trunk/core/src/core/org/jnode/system/x86/DMA.java trunk/core/src/core/org/jnode/system/x86/DMAPlugin.java trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java trunk/core/src/core/org/jnode/util/DecimalScaleFactor.java trunk/core/src/core/org/jnode/util/SizeUnit.java trunk/core/src/core/org/jnode/vm/AllocationBitmap.java trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java trunk/core/src/core/org/jnode/vm/LoadCompileService.java trunk/core/src/core/org/jnode/vm/MathSupport.java trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java trunk/core/src/core/org/jnode/vm/MemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/MemoryScannerImpl.java trunk/core/src/core/org/jnode/vm/MultiMediaMemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/ResourceManagerImpl.java trunk/core/src/core/org/jnode/vm/SoftByteCodes.java trunk/core/src/core/org/jnode/vm/Unsafe.java trunk/core/src/core/org/jnode/vm/Vm.java trunk/core/src/core/org/jnode/vm/VmAccessController.java trunk/core/src/core/org/jnode/vm/VmAddress.java trunk/core/src/core/org/jnode/vm/VmArchitecture.java trunk/core/src/core/org/jnode/vm/VmJavaClassLoader.java trunk/core/src/core/org/jnode/vm/VmJavaMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/core/org/jnode/vm/VmReflection.java trunk/core/src/core/org/jnode/vm/VmStackFrameEnumerator.java trunk/core/src/core/org/jnode/vm/VmStackReader.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/CompiledCodeList.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java trunk/core/src/core/org/jnode/vm/classmgr/VmCompiledCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmCompiledExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/VmMember.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultWriteBarrier.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerThread.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCMarkVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSetWhiteVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCStack.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSweepVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCVerifyVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmAbstractHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmBootHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmDefaultHeap.java trunk/core/src/core/org/jnode/vm/scheduler/IRQManager.java trunk/core/src/core/org/jnode/vm/scheduler/IRQThread.java trunk/core/src/core/org/jnode/vm/scheduler/Monitor.java trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.java trunk/core/src/core/org/jnode/vm/scheduler/ProcessorLock.java trunk/core/src/core/org/jnode/vm/scheduler/SpinLock.java trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java trunk/core/src/core/org/jnode/vm/scheduler/VmScheduler.java trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueue.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueueEntry.java trunk/core/src/core/org/jnode/vm/x86/GDT.java trunk/core/src/core/org/jnode/vm/x86/IOAPIC.java trunk/core/src/core/org/jnode/vm/x86/LocalAPIC.java trunk/core/src/core/org/jnode/vm/x86/MPConfigTable.java trunk/core/src/core/org/jnode/vm/x86/MPFloatingPointerStructure.java trunk/core/src/core/org/jnode/vm/x86/MPIOAPICEntry.java trunk/core/src/core/org/jnode/vm/x86/PIC8259A.java trunk/core/src/core/org/jnode/vm/x86/TSS32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture64.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor64.java trunk/core/src/core/org/jnode/vm/x86/VmX86StackReader.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java trunk/core/src/core/org/jnode/vm/x86/X86IRQManager.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86GCMapIterator.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/genrc/HeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/genrc/Plan.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/ms/HeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/ms/Plan.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/nogc/HeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/nogc/Plan.java trunk/core/src/mmtk-vm/org/mmtk/vm/Barriers.java trunk/core/src/mmtk-vm/org/mmtk/vm/Memory.java trunk/core/src/mmtk-vm/org/mmtk/vm/ObjectModel.java trunk/core/src/mmtk-vm/org/mmtk/vm/Plan.java trunk/core/src/mmtk-vm/org/mmtk/vm/Scanning.java trunk/core/src/mmtk-vm/org/mmtk/vm/TraceInterface.java trunk/core/src/openjdk/java/java/awt/Toolkit.java trunk/core/src/openjdk/java/java/lang/System.java trunk/core/src/openjdk/sun/sun/misc/Unsafe.java trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java trunk/core/src/openjdk/vm/java/awt/NativeToolkit.java trunk/core/src/openjdk/vm/java/lang/NativeProcessEnvironment.java trunk/core/src/openjdk/vm/java/lang/NativeString.java trunk/core/src/openjdk/vm/java/lang/NativeSystem.java trunk/core/src/openjdk/vm/java/lang/NativeThrowable.java trunk/core/src/openjdk/vm/java/net/NativeInetAddress.java trunk/core/src/openjdk/vm/sun/misc/NativeUnsafe.java trunk/core/src/openjdk/vm/sun/misc/UnsafeHelper.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java Added Paths: ----------- trunk/core/src/classlib/ trunk/core/src/classlib/org/ trunk/core/src/classlib/org/jnode/ trunk/core/src/classlib/org/jnode/annotation/ trunk/core/src/classlib/org/jnode/java/ trunk/core/src/classlib/org/jnode/java/io/ trunk/core/src/classlib/org/jnode/java/io/VMFileHandle.java trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java trunk/core/src/classlib/org/jnode/java/nio/ trunk/core/src/classlib/org/jnode/java/nio/VmChannel.java trunk/core/src/classpath/gnu/gnu/classpath/Configuration.java trunk/core/src/classpath/gnu/gnu/classpath/VMStackWalker.java trunk/core/src/classpath/gnu/gnu/classpath/VMSystemProperties.java trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMFrame.java trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMIdManager.java trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMMethod.java trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMVirtualMachine.java trunk/core/src/classpath/gnu/gnu/java/lang/VMClassHelper.java trunk/core/src/classpath/gnu/gnu/java/lang/VMInstrumentationImpl.java trunk/core/src/classpath/gnu/gnu/java/nio/VMChannel.java trunk/core/src/classpath/gnu/gnu/java/nio/VMPipe.java trunk/core/src/classpath/gnu/gnu/java/nio/VMSelector.java trunk/core/src/classpath/java/java/io/VMFile.java trunk/core/src/classpath/java/java/io/VMIOUtils.java trunk/core/src/classpath/java/java/io/VMOpenMode.java trunk/core/src/classpath/java/java/lang/VMClassLoader.java trunk/core/src/classpath/java/java/net/ trunk/core/src/classpath/java/java/net/MimeTypeMapper.java trunk/core/src/classpath/vm/gnu/classpath/NativeVMStackWalker.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/ trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/NativeTransportFactory.java trunk/core/src/classpath/vm/java/lang/NativeVMClassLoader.java trunk/core/src/classpath/vm/javax/ trunk/core/src/classpath/vm/javax/imageio/ trunk/core/src/classpath/vm/javax/imageio/spi/ trunk/core/src/classpath/vm/javax/imageio/spi/NativeIIORegistry.java trunk/core/src/openjdk/svm/sun/java2d/ trunk/core/src/openjdk/svm/sun/java2d/SurfaceManagerFactory.java trunk/core/src/openjdk/svm/sun/misc/ trunk/core/src/openjdk/svm/sun/misc/Version.java trunk/core/src/openjdk/svm/sun/security/provider/NativeSeedGenerator.java Removed Paths: ------------- trunk/core/src/classpath/vm/gnu/classpath/Configuration.java trunk/core/src/classpath/vm/gnu/classpath/VMStackWalker.java trunk/core/src/classpath/vm/gnu/classpath/VMSystemProperties.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/VMFrame.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/VMIdManager.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/VMMethod.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/VMVirtualMachine.java trunk/core/src/classpath/vm/gnu/java/lang/VMClassHelper.java trunk/core/src/classpath/vm/gnu/java/lang/VMInstrumentationImpl.java trunk/core/src/classpath/vm/gnu/java/nio/VMChannel.java trunk/core/src/classpath/vm/gnu/java/nio/VMPipe.java trunk/core/src/classpath/vm/gnu/java/nio/VMSelector.java trunk/core/src/classpath/vm/java/io/VMFile.java trunk/core/src/classpath/vm/java/io/VMIOUtils.java trunk/core/src/classpath/vm/java/io/VMOpenMode.java trunk/core/src/classpath/vm/java/lang/VMClassLoader.java trunk/core/src/classpath/vm/java/net/MimeTypeMapper.java trunk/core/src/classpath/vm/org/jnode/java/io/VMFileHandle.java trunk/core/src/classpath/vm/org/jnode/java/io/VMFileSystemAPI.java trunk/core/src/core/org/jnode/vm/VmChannel.java trunk/core/src/core/org/jnode/vm/annotation/ trunk/core/src/openjdk/vm/sun/java2d/SurfaceManagerFactory.java trunk/core/src/openjdk/vm/sun/misc/Version.java trunk/core/src/openjdk/vm/sun/security/provider/NativeSeedGenerator.java Modified: trunk/core/src/classlib/org/jnode/annotation/AllowedPackages.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/AllowedPackages.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/AllowedPackages.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; Modified: trunk/core/src/classlib/org/jnode/annotation/CheckPermission.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/CheckPermission.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/CheckPermission.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/DoPrivileged.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/DoPrivileged.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/DoPrivileged.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/Inline.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/Inline.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/Inline.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.CONSTRUCTOR; import static java.lang.annotation.ElementType.METHOD; Modified: trunk/core/src/classlib/org/jnode/annotation/Internal.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/Internal.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/Internal.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; Modified: trunk/core/src/classlib/org/jnode/annotation/KernelSpace.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/KernelSpace.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/KernelSpace.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/LoadStatics.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/LoadStatics.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/LoadStatics.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/MagicPermission.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/MagicPermission.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/MagicPermission.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/NoFieldAlignments.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/NoFieldAlignments.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/NoFieldAlignments.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/NoInline.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/NoInline.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/NoInline.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.CONSTRUCTOR; import static java.lang.annotation.ElementType.METHOD; Modified: trunk/core/src/classlib/org/jnode/annotation/NoReadBarrier.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/NoReadBarrier.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/NoReadBarrier.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/NoWriteBarrier.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/NoWriteBarrier.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/NoWriteBarrier.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/PrivilegedActionPragma.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/PrivilegedActionPragma.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/PrivilegedActionPragma.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.CONSTRUCTOR; import static java.lang.annotation.ElementType.METHOD; Modified: trunk/core/src/classlib/org/jnode/annotation/SharedStatics.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/SharedStatics.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/SharedStatics.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.CLASS; Modified: trunk/core/src/classlib/org/jnode/annotation/Uninterruptible.java =================================================================== --- trunk/core/src/core/org/jnode/vm/annotation/Uninterruptible.java 2009-04-05 15:46:19 UTC (rev 5222) +++ trunk/core/src/classlib/org/jnode/annotation/Uninterruptible.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package org.jnode.vm.annotation; +package org.jnode.annotation; import static java.lang.annotation.ElementType.CONSTRUCTOR; import static java.lang.annotation.ElementType.METHOD; Copied: trunk/core/src/classlib/org/jnode/java/io/VMFileHandle.java (from rev 5222, trunk/core/src/classpath/vm/org/jnode/java/io/VMFileHandle.java) =================================================================== --- trunk/core/src/classlib/org/jnode/java/io/VMFileHandle.java (rev 0) +++ trunk/core/src/classlib/org/jnode/java/io/VMFileHandle.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -0,0 +1,97 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.java.io; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.MappedByteBuffer; + + +/** + * A FileHandle represents a single, opened file for a single principal. + * @author epr + */ +public interface VMFileHandle { + + /** + * Gets the length (in bytes) of this file + * @return long + */ + public long getLength(); + + /** + * Sets the length of this file. + * @param length + * @throws IOException + */ + public void setLength(long length) throws IOException; + + /** + * Gets the current position in the file + * @return long + */ + public long getPosition(); + + /** + * Sets the position in the file. + * @param position + * @throws IOException + */ + public void setPosition(long position) throws IOException; + + /** + * Read bytes into the {@code dest} buffer. + * @param dest + * @return the number of bytes read. + * @throws IOException + */ + public int read(ByteBuffer dest) throws IOException; + + + /** + * Write bytes from the {@code src} buffer. + * @param src + * @throws IOException + */ + public void write(ByteBuffer src) throws IOException; + + /** + * Close this file. + */ + public void close() throws IOException; + + /** + * Has this handle been closed? + */ + public boolean isClosed(); + + public int available(); + + public void unlock(long pos, long len); + + public int read() throws IOException; + + public void write(int b) throws IOException; + + public boolean lock(); + + public MappedByteBuffer mapImpl(char mode, long position, int size); +} Property changes on: trunk/core/src/classlib/org/jnode/java/io/VMFileHandle.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java (from rev 5222, trunk/core/src/classpath/vm/org/jnode/java/io/VMFileSystemAPI.java) =================================================================== --- trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java (rev 0) +++ trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -0,0 +1,156 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.java.io; + +import java.io.IOException; +import java.io.File; +import java.io.VMOpenMode; + +/** + * The implementation of this interface is used to connect the java.io package with the JNode + * filesystem services. + * The file paths given to the various methods are absolute and canonical. + * + * @modif add mkDir mkFile Yves Galante (yve...@jm...) 01.04.2004 + * @author epr + */ +public interface VMFileSystemAPI { + + /** + * Does a given file exist? + */ + public boolean fileExists(String file); + + /** + * Is the given File a plain file? + */ + public boolean isFile(String file); + + /** + * Is the given File a directory? + */ + public boolean isDirectory(String file); + + /** + * Can the given file be read? + * + * @param file + */ + public boolean canRead(String file) throws IOException; + + /** + * Can the given file be written to? + * + * @param file + */ + public boolean canWrite(String file) throws IOException; + + public boolean canExecute(String file) throws IOException; + + /** + * Gets the length in bytes of the given file or 0 if the file does not exist. + * + * @param file + */ + public long getLength(String file); + + /** + * Gets the last modification date of the given file. + * + * @param file + */ + public long getLastModified(String file); + + /** + * Sets the last modification date of the given file. + * + * @param file + */ + public void setLastModified(String file, long time) throws IOException; + + /** + * Mark the given file as readonly. + * + * @param file + * @throws IOException + */ + public void setReadOnly(String file) throws IOException; + + public boolean setReadable(String normalizedPath, boolean enable, + boolean owneronly) throws IOException; + + public boolean setWritable(String normalizedPath, boolean enable, + boolean owneronly) throws IOException; + + public boolean setExecutable(String normalizedPath, boolean enable, + boolean owneronly) throws IOException; + + /** + * Delete the given file. + * + * @param file + * @throws IOException + */ + public void delete(String file) throws IOException; + + /** + * This method returns an array of filesystem roots. + */ + public File[] getRoots(); + + /** + * Gets an array of names of all entries of the given directory. All names are relative to the + * given directory. + * + * @param directory + */ + public String[] list(String directory) throws IOException; + + /** + * Open a given file + * + * @param file + * @throws IOException + */ + public VMFileHandle open(String file, VMOpenMode mode) throws IOException; + + /** + * Make a directory + * + * @param file + * @throws IOException + */ + public boolean mkDir(String file) throws IOException; + + /** + * Make a file + * + * @param file + * @throws IOException + */ + public boolean mkFile(String file, VMOpenMode mode) throws IOException; + + public long getTotalSpace(String normalizedPath) throws IOException; + + public long getFreeSpace(String normalizedPath) throws IOException; + + public long getUsableSpace(String normalizedPath) throws IOException; +} Property changes on: trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/core/src/classlib/org/jnode/java/nio/VmChannel.java (from rev 5222, trunk/core/src/core/org/jnode/vm/VmChannel.java) =================================================================== --- trunk/core/src/classlib/org/jnode/java/nio/VmChannel.java (rev 0) +++ trunk/core/src/classlib/org/jnode/java/nio/VmChannel.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -0,0 +1,188 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.java.nio; + +import java.io.IOException; +import java.net.SocketException; +import java.nio.ByteBuffer; +import java.nio.MappedByteBuffer; + +/** + * Native interface to support configuring of channel to run in a non-blocking + * manner and support scatter/gather io operations. + * <p/> + * <p/> + * This has to give the functionality of the classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c + * + */ +public final class VmChannel { + + public static int stdin_fd() throws IOException { + // shouldn't throw IOException + throw new IOException("Not implemented"); + } + + public static int stdout_fd() throws IOException { + // shouldn't throw IOException + throw new IOException("Not implemented"); + } + + public static int stderr_fd() throws IOException { + // shouldn't throw IOException + throw new IOException("Not implemented"); + } + + public static void setBlocking(int fd, boolean blocking) throws IOException { + throw new IOException("Not implemented"); + } + + public static int available(int native_fd) throws IOException { + throw new IOException("Not implemented"); + } + + public static int read(int fd, ByteBuffer dst) throws IOException { + throw new IOException("Not implemented"); + } + + public static int read(int fd) throws IOException { + throw new IOException("Not implemented"); + } + + public static long readScattering(int fd, ByteBuffer[] dsts, int offset, int length) throws IOException { + throw new IOException("Not implemented"); + } + + + public static int receive(int fd, ByteBuffer dst, ByteBuffer address) throws IOException { + throw new IOException("Not implemented"); + } + + public static int write(int fd, ByteBuffer src) throws IOException { + throw new IOException("Not implemented"); + } + + public static long writeGathering(int fd, ByteBuffer[] srcs, int offset, int length) throws IOException { + throw new IOException("Not implemented"); + } + + // Send to an IPv4 address. + public static int send(int fd, ByteBuffer src, byte[] addr, int port) throws IOException { + throw new IOException("Not implemented"); + } + + // Send to an IPv6 address. + public static int send6(int fd, ByteBuffer src, byte[] addr, int port) throws IOException { + throw new IOException("Not implemented"); + } + + public static void write(int fd, int b) throws IOException { + throw new IOException("Not implemented"); + } + + public static void initIDs() throws IOException { + // shouldn't throw IOException + throw new IOException("Not implemented"); + } + + // Network (socket) specific methods. + + /** + * Create a new socket, returning the native file descriptor. + * + * @param stream Set to true for streaming sockets{} false for datagrams. + * @return The native file descriptor. + * @throws java.io.IOException If creating the socket fails. + */ + public static int socket(boolean stream) throws IOException { + throw new IOException("Not implemented"); + } + + + public static boolean connect(int fd, byte[] addr, int port, int timeout) throws SocketException { + throw new SocketException("Not implemented"); + } + + public static boolean connect6(int fd, byte[] addr, int port, int timeout) throws SocketException { + throw new SocketException("Not implemented"); + } + + public static void disconnect(int fd) throws IOException { + throw new IOException("Not implemented"); + } + + public static int getsockname(int fd, ByteBuffer name) throws IOException { + throw new IOException("Not implemented"); + } + + /* + * The format here is the peer address, followed by the port number. + * The returned value is the length of the peer address{} thus, there + * will be LEN + 2 valid bytes put into NAME. + */ + public static int getpeername(int fd, ByteBuffer name) throws IOException { + throw new IOException("Not implemented"); + } + + public static int accept(int native_fd) throws IOException { + throw new IOException("Not implemented"); + } + + + public static int open(String path, int mode) throws IOException { + throw new IOException("Not implemented"); + } + + public static long position(int fd) throws IOException { + throw new IOException("Not implemented"); + } + + public static void seek(int fd, long pos) throws IOException { + throw new IOException("Not implemented"); + } + + public static void truncate(int fd, long len) throws IOException { + throw new IOException("Not implemented"); + } + + public static boolean lock(int fd, long pos, long len, boolean shared, boolean wait) throws IOException { + throw new IOException("Not implemented"); + } + + public static void unlock(int fd, long pos, long len) throws IOException { + throw new IOException("Not implemented"); + } + + public static long size(int fd) throws IOException { + throw new IOException("Not implemented"); + } + + public static MappedByteBuffer map(int fd, char mode, long position, int size) throws IOException { + throw new IOException("Not implemented"); + } + + public static boolean flush(int fd, boolean metadata) throws IOException { + throw new IOException("Not implemented"); + } + + public static void close(int native_fd) throws IOException { + throw new IOException("Not implemented"); + } +} Modified: trunk/core/src/classpath/ext/javax/isolate/IsolateStatus.java =================================================================== --- trunk/core/src/classpath/ext/javax/isolate/IsolateStatus.java 2009-04-06 13:08:49 UTC (rev 5225) +++ trunk/core/src/classpath/ext/javax/isolate/IsolateStatus.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -20,7 +20,7 @@ package javax.isolate; -import org.jnode.vm.annotation.SharedStatics; +import org.jnode.annotation.SharedStatics; /** * Represents isolate status, capturing such information as isolate state, exit code, and exit reason. Copied: trunk/core/src/classpath/gnu/gnu/classpath/Configuration.java (from rev 5210, trunk/core/src/classpath/vm/gnu/classpath/Configuration.java) =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/Configuration.java (rev 0) +++ trunk/core/src/classpath/gnu/gnu/classpath/Configuration.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -0,0 +1,96 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package gnu.classpath; + +/** + * This file defines compile-time constants that can be accessed by + * java code. It is pre-processed by configure. + */ +public interface Configuration +{ + /** + * The value of CLASSPATH_HOME is the location that the classpath + * libraries and support files where installed in. It is set according to + * the argument for --prefix given to configure and used to set the + * System property gnu.classpath.home. + */ + String CLASSPATH_HOME = "@prefix@"; + + /** + * The release version number of GNU Classpath. + * It is set according to the value of 'version' in the configure[.in] file + * and used to set the System property gnu.classpath.version. + */ + String CLASSPATH_VERSION = "@VERSION@"; + + /** + * The value of DEBUG is substituted according to whether the + * "--enable-debug" argument was passed to configure. Code + * which is made conditional based on the value of this flag - typically + * code that generates debugging output - will be removed by the optimizer + * in a non-debug build. + */ + boolean DEBUG = false; + + /** + * The value of LOAD_LIBRARY is substituted according to whether the + * "--enable-load-library" or "--disable-load-library" argument was passed + * to configure. By default, configure should define this is as true. + * If set to false, loadLibrary() calls to load native function + * implementations, typically found in static initializers of classes + * which contain native functions, will be omitted. This is useful for + * runtimes which pre-link their native function implementations and do + * not require additional shared libraries to be loaded. + */ + boolean INIT_LOAD_LIBRARY = false; + + /** + * Set to true if the VM provides a native method to implement + * Proxy.getProxyClass completely, including argument verification. + * If this is true, HAVE_NATIVE_GET_PROXY_DATA and + * HAVE_NATIVE_GENERATE_PROXY_CLASS should be false. + * @see java.lang.reflect.Proxy + */ + boolean HAVE_NATIVE_GET_PROXY_CLASS = false; + + /** + * Set to true if the VM provides a native method to implement + * the first part of Proxy.getProxyClass: generation of the array + * of methods to convert, and verification of the arguments. + * If this is true, HAVE_NATIVE_GET_PROXY_CLASS should be false. + * @see java.lang.reflect.Proxy + */ + boolean HAVE_NATIVE_GET_PROXY_DATA = false; + + /** + * Set to true if the VM provides a native method to implement + * the second part of Proxy.getProxyClass: conversion of an array of + * methods into an actual proxy class. + * If this is true, HAVE_NATIVE_GET_PROXY_CLASS should be false. + * @see java.lang.reflect.Proxy + */ + boolean HAVE_NATIVE_GENERATE_PROXY_CLASS = false; + + /** + * Name of default AWT peer library. + */ + String default_awt_peer_toolkit = "org.jnode.awt.swingpeers.SwingToolkit"; +} Property changes on: trunk/core/src/classpath/gnu/gnu/classpath/Configuration.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/core/src/classpath/gnu/gnu/classpath/VMStackWalker.java (from rev 5210, trunk/core/src/classpath/vm/gnu/classpath/VMStackWalker.java) =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/VMStackWalker.java (rev 0) +++ trunk/core/src/classpath/gnu/gnu/classpath/VMStackWalker.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -0,0 +1,131 @@ +/* VMStackWalker.java -- Reference implementation of VM hooks for stack access + Copyright (C) 2005, 2006 Free Software Foundation + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.classpath; + +/** + * This class provides access to the classes on the Java stack + * for reflection and security purposes. + * + * <p> + * This class is only available to privileged code (i.e., code loaded + * by the bootstrap loader). + * + * @author John Keiser + * @author Eric Blake <eb...@em...> + * @author Archie Cobbs + */ +public final class VMStackWalker { + /** + * Get a list of all the classes currently executing methods on the + * Java stack. <code>getClassContext()[0]</code> is the class associated + * with the currently executing method, i.e., the method that called + * <code>VMStackWalker.getClassContext()</code> (possibly through + * reflection). So you may need to pop off these stack frames from + * the top of the stack: + * <ul> + * <li><code>VMStackWalker.getClassContext()</code> + * <li><code>Method.invoke()</code> + * </ul> + * + * @return an array of the declaring classes of each stack frame + */ + public static native Class[] getClassContext(); + + /** + * Get the class associated with the method invoking the method + * invoking this method, or <code>null</code> if the stack is not + * that deep (e.g., invoked via JNI invocation API). This method + * is an optimization for the expression <code>getClassContext()[1]</code> + * and should return the same result. + * + * <p> + * VM implementers are encouraged to provide a more efficient + * version of this method. + */ + public static Class getCallingClass() { + Class[] ctx = getClassContext(); + if (ctx.length < 5) + return null; + return ctx[4]; + } + + /** + * Get the class loader associated with the Class returned by + * <code>getCallingClass()</code>, or <code>null</code> if no such class + * exists or it is the boot loader. This method is an optimization for the + * expression <code>VMStackWalker.getClassLoader(getClassContext()[1])</code> + * and should return the same result. + * + * <p> + * VM implementers are encouraged to provide a more efficient + * version of this method. + */ + public static ClassLoader getCallingClassLoader() { + Class[] ctx = getClassContext(); + if (ctx.length < 5) + return null; + return ctx[4].getClassLoader(); + } + + /** + * Retrieve the class's ClassLoader, or <code>null</code> if loaded + * by the bootstrap loader. I.e., this should return the same thing + * as {@link Class#getClassLoader()}. This duplicate version + * is here to work around access permissions. + */ + public static ClassLoader getClassLoader(Class cl){ + //TODO FIX it according to the javadoc above + return cl.getClassLoader(); + }; + + /** + * Walk up the stack and return the first non-null class loader. + * If there aren't any non-null class loaders on the stack, return null. + */ + public static ClassLoader firstNonNullClassLoader() + { + Class[] stack = getClassContext(); + for (int i = 0; i < stack.length; i++) + { + ClassLoader loader = getClassLoader(stack[i]); + if (loader != null) + return loader; +} + return null; + } +} Property changes on: trunk/core/src/classpath/gnu/gnu/classpath/VMStackWalker.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/core/src/classpath/gnu/gnu/classpath/VMSystemProperties.java (from rev 5210, trunk/core/src/classpath/vm/gnu/classpath/VMSystemProperties.java) =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/VMSystemProperties.java (rev 0) +++ trunk/core/src/classpath/gnu/gnu/classpath/VMSystemProperties.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -0,0 +1,88 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package gnu.classpath; + +import java.util.Properties; + +class VMSystemProperties +{ + /** + * Get the system properties. This is done here, instead of in System, + * because of the bootstrap sequence. Note that the native code should + * not try to use the Java I/O classes yet, as they rely on the properties + * already existing. The only safe method to use to insert these default + * system properties is {@link Properties#setProperty(String, String)}. + * + * <p>These properties MUST include: + * <dl> + * <dt>java.version <dd>Java version number + * <dt>java.vendor <dd>Java vendor specific string + * <dt>java.vendor.url <dd>Java vendor URL + * <dt>java.home <dd>Java installation directory + * <dt>java.vm.specification.version <dd>VM Spec version + * <dt>java.vm.specification.vendor <dd>VM Spec vendor + * <dt>java.vm.specification.name <dd>VM Spec name + * <dt>java.vm.version <dd>VM implementation version + * <dt>java.vm.vendor <dd>VM implementation vendor + * <dt>java.vm.name <dd>VM implementation name + * <dt>java.specification.version <dd>Java Runtime Environment version + * <dt>java.specification.vendor <dd>Java Runtime Environment vendor + * <dt>java.specification.name <dd>Java Runtime Environment name + * <dt>java.class.version <dd>Java class version number + * <dt>java.class.path <dd>Java classpath + * <dt>java.library.path <dd>Path for finding Java libraries + * <dt>java.io.tmpdir <dd>Default temp file path + * <dt>java.compiler <dd>Name of JIT to use + * <dt>java.ext.dirs <dd>Java extension path + * <dt>os.name <dd>Operating System Name + * <dt>os.arch <dd>Operating System Architecture + * <dt>os.version <dd>Operating System Version + * <dt>file.separator <dd>File separator ("/" on Unix) + * <dt>path.separator <dd>Path separator (":" on Unix) + * <dt>line.separator <dd>Line separator ("\n" on Unix) + * <dt>user.name <dd>User account name + * <dt>user.home <dd>User home directory + * <dt>user.dir <dd>User's current working directory + * <dt>gnu.cpu.endian <dd>"big" or "little" + * </dl> + * + * @param properties the Properties object to insert the system properties into + */ + static void preInit(Properties properties) { + try { + Class clazz = Class.forName("org.jnode.vm.VmSystem"); + clazz.getMethod("insertSystemProperties", Properties.class).invoke(null, properties); + } catch (Exception x) { + x.printStackTrace(); + throw new RuntimeException(); + } + } + + /** + * Here you get a chance to overwrite some of the properties set by + * the common SystemProperties code. For example, it might be + * a good idea to process the properties specified on the command + * line here. + */ + static void postInit(Properties properties) + { + } +} Property changes on: trunk/core/src/classpath/gnu/gnu/classpath/VMSystemProperties.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMFrame.java (from rev 5210, trunk/core/src/classpath/vm/gnu/classpath/jdwp/VMFrame.java) =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMFrame.java (rev 0) +++ trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMFrame.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -0,0 +1,106 @@ +/* VMFrame.java -- Reference implementation of VM hooks for JDWP Frame access. + Copyright (C) 2005, 2006 Free Software Foundation + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.classpath.jdwp; + +import gnu.classpath.jdwp.util.Location; + +/** + * Reference implementation of VM hooks for JDWP Frame access. + * + * @author aluchko + */ + +public class VMFrame +{ + /** + * Returns the size of a frame ID over JDWP + */ + public static final int SIZE = 8; + + // The object this frame resides in + private Object obj; + + // The current location of this frame + private Location loc; + + // id of this frame + private long id; + + /** + * Gets the current location of the frame. + */ + public Location getLocation() + { + return loc; + } + + /** + * Returns the value of the variable in the given slot. + * + * @param slot the slot containing the variable + */ + public native Object getValue(int slot); + + /** + * Assigns the given variable to the given value. + * @param slot The slot which contains the variable + * @param value The value to assign the variable to + */ + public native void setValue(int slot, Object value); + + /** + * Get the object which is represented by 'this' in the context of the frame, + * returns null if the method is native or static. + */ + public Object getObject() + { + return obj; + } + + /** + * Get the frameID + * @return an id which is unique within the scope of the VM + */ + public long getId() + { + return id; + } + +} Property changes on: trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMFrame.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMIdManager.java (from rev 5210, trunk/core/src/classpath/vm/gnu/classpath/jdwp/VMIdManager.java) =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMIdManager.java (rev 0) +++ trunk/core/src/classpath/gnu/gnu/classpath/jdwp/VMIdManager.java 2009-04-06 14:55:27 UTC (rev 5226) @@ -0,0 +1,429 @@ +/* VMIdManager.java -- A reference/example implementation of a manager for + JDWP object/reference type IDs + + Copyright (C) 2005, 2006 Free Software Foundation + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.classpath.jdwp; + +import gnu.classpath.jdwp.exception.InvalidClassException; +import gnu.classpath.jdwp.exception.InvalidObjectException; +import gnu.classpath.jdwp.id.*; + +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.SoftReference; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Iterator; + +/** + * This class manages objects and referencetypes that are reported + * to the debugger. All objects and referencetypes reported to the + * debugger should go through this manager. + * + * A brief summary of what an <code>IdManager</code> must provide: + * + * <code> + * public ObjectId getObjectId (Object theObject); + * public ObjectId get (long id); + * public ObjectId readObjectId (ByteBuffer bb); + * public ReferenceTypeId getReferenceTypeId (Class clazz); + * public ReferenceTypeId getReferenceType (long id); + * public ReferenceTypeId readReferenceTypeId (ByteBuffer bb); + * </code> + * + * See the javadoc on these methods later in this file for more + * information on these functions. + * + * <b>NOTE:</b> All IDs handled by the ID manager (all object and reference + * type IDs) are assumed to be of type <code>long</code>. + * + * <b>NOTE:</b> This class does not manage virtual machine-specific types, + * like methods, fields, and frames. These already have unique IDs within + * the virtu... [truncated message content] |
From: <cr...@us...> - 2009-04-18 15:07:15
|
Revision: 5307 http://jnode.svn.sourceforge.net/jnode/?rev=5307&view=rev Author: crawley Date: 2009-04-18 15:07:04 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Fixed warnings: raw type use, missing serialVersionNo's. Minor style fixes. Modified Paths: -------------- trunk/core/src/classpath/ext/javax/isolate/ClosedLinkException.java trunk/core/src/classpath/ext/javax/isolate/IsolatePermission.java trunk/core/src/classpath/ext/javax/isolate/IsolateStartupException.java trunk/core/src/core/org/jnode/assembler/Label.java trunk/core/src/core/org/jnode/assembler/NativeStream.java trunk/core/src/core/org/jnode/assembler/UnresolvedObjectRefException.java trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java trunk/core/src/core/org/jnode/boot/Main.java trunk/core/src/core/org/jnode/debug/UDPOutputStream.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGException.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReader.java trunk/core/src/openjdk/vm/java/io/NativeObjectInputStream.java trunk/core/src/openjdk/vm/java/io/NativeObjectStreamClass.java trunk/core/src/openjdk/vm/java/lang/NativeClass.java trunk/core/src/openjdk/vm/java/lang/NativeStrictMath.java trunk/core/src/openjdk/vm/java/lang/reflect/NativeArray.java trunk/core/src/openjdk/vm/java/lang/reflect/NativeProxy.java trunk/core/src/openjdk/vm/java/util/NativeResourceBundle.java trunk/core/src/openjdk/vm/java/util/jar/NativeJarFile.java trunk/core/src/openjdk/vm/sun/awt/image/NativeBufImgSurfaceData.java trunk/core/src/openjdk/vm/sun/awt/image/NativeJPEGImageDecoder.java trunk/core/src/openjdk/vm/sun/font/NativeFontManager.java trunk/core/src/openjdk/vm/sun/font/NativeFreetypeFontScaler.java trunk/core/src/openjdk/vm/sun/java2d/loops/NativeGraphicsPrimitiveMgr.java trunk/core/src/openjdk/vm/sun/java2d/pipe/NativeSpanClipRenderer.java trunk/core/src/openjdk/vm/sun/misc/NativeUnsafe.java trunk/core/src/openjdk/vm/sun/reflect/NativeConstantPool.java trunk/core/src/openjdk/vm/sun/reflect/NativeNativeConstructorAccessorImpl.java trunk/core/src/openjdk/vm/sun/reflect/NativeNativeMethodAccessorImpl.java trunk/core/src/openjdk/vm/sun/reflect/NativeReflection.java Modified: trunk/core/src/classpath/ext/javax/isolate/ClosedLinkException.java =================================================================== --- trunk/core/src/classpath/ext/javax/isolate/ClosedLinkException.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/classpath/ext/javax/isolate/ClosedLinkException.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -27,6 +27,8 @@ */ public class ClosedLinkException extends IOException { + private static final long serialVersionUID = 1L; + /** * Initialize this instance. */ Modified: trunk/core/src/classpath/ext/javax/isolate/IsolatePermission.java =================================================================== --- trunk/core/src/classpath/ext/javax/isolate/IsolatePermission.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/classpath/ext/javax/isolate/IsolatePermission.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -27,6 +27,8 @@ */ public class IsolatePermission extends BasicPermission { + private static final long serialVersionUID = 1L; + /** * @param name * @param actions Modified: trunk/core/src/classpath/ext/javax/isolate/IsolateStartupException.java =================================================================== --- trunk/core/src/classpath/ext/javax/isolate/IsolateStartupException.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/classpath/ext/javax/isolate/IsolateStartupException.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -28,6 +28,8 @@ */ public class IsolateStartupException extends Exception { + private static final long serialVersionUID = 1L; + private final String remoteName; private final String remoteMessage; Modified: trunk/core/src/core/org/jnode/assembler/Label.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/Label.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/assembler/Label.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -27,7 +27,7 @@ * * @author Ewout Prangsma (ep...@us...) */ -public class Label extends VmAddress implements Comparable { +public class Label extends VmAddress implements Comparable<Object> { private final String label; Modified: trunk/core/src/core/org/jnode/assembler/NativeStream.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/NativeStream.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/assembler/NativeStream.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -77,7 +77,7 @@ * @return The object info for the started object * @see ObjectInfo */ - public abstract ObjectInfo startObject(VmType cls); + public abstract ObjectInfo startObject(VmType<?> cls); /** * Gets an objectref for a given object. @@ -99,7 +99,7 @@ * * @return Collection */ - public abstract Collection getUnresolvedObjectRefs(); + public abstract Collection<?> getUnresolvedObjectRefs(); /** * Are there unresolved references? Modified: trunk/core/src/core/org/jnode/assembler/UnresolvedObjectRefException.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/UnresolvedObjectRefException.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/assembler/UnresolvedObjectRefException.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -25,6 +25,8 @@ */ public class UnresolvedObjectRefException extends Exception { + private static final long serialVersionUID = 1L; + /** * */ Modified: trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -156,7 +156,7 @@ * * @return Collection */ - public abstract Collection getUnresolvedObjectRefs(); + public abstract Collection<?> getUnresolvedObjectRefs(); /** * Gets the size of a word in bytes. @@ -275,7 +275,7 @@ * @param cls * @return The info for the started object */ - public abstract ObjectInfo startObject(VmType cls); + public abstract ObjectInfo startObject(VmType<?> cls); /** * Remove count bytes from the end of the generated stream. Modified: trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -718,7 +718,7 @@ * @return The info for the started object * @see ObjectInfo */ - public final ObjectInfo startObject(VmType cls) { + public final ObjectInfo startObject(VmType<?> cls) { if (inObject) { throw new RuntimeException( "Cannot start an object within an object"); Modified: trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -246,7 +246,7 @@ return null; } - public Collection getUnresolvedObjectRefs() { + public Collection<?> getUnresolvedObjectRefs() { return null; } @@ -315,7 +315,7 @@ public void setResolver(ObjectResolver resolver) { } - public ObjectInfo startObject(VmType cls) { + public ObjectInfo startObject(VmType<?> cls) { println(";\n; -- Start of object --\n;"); return new ObjectInfoImpl(); } Modified: trunk/core/src/core/org/jnode/boot/Main.java =================================================================== --- trunk/core/src/core/org/jnode/boot/Main.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/boot/Main.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -75,7 +75,7 @@ final ClassLoader loader = pluginRegistry.getPluginsClassLoader(); final String mainClassName = proc.getMainClassName(); - final Class mainClass; + final Class<?> mainClass; if (mainClassName != null) { mainClass = loader.loadClass(mainClassName); } else { @@ -87,7 +87,8 @@ if (mainClass != null) { try { - final Method mainMethod = mainClass.getMethod("main", new Class[]{String[].class}); + final Method mainMethod = + mainClass.getMethod("main", new Class[]{String[].class}); mainMethod.invoke(null, new Object[]{proc.getMainClassArguments()}); } catch (NoSuchMethodException x) { final Object insatnce = mainClass.newInstance(); Modified: trunk/core/src/core/org/jnode/debug/UDPOutputStream.java =================================================================== --- trunk/core/src/core/org/jnode/debug/UDPOutputStream.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/debug/UDPOutputStream.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -75,7 +75,7 @@ if (!inWrite) { inWrite = true; try { - AccessController.doPrivileged(new PrivilegedExceptionAction() { + AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { public Object run() throws IOException { final DatagramPacket p = new DatagramPacket(b, off, len); p.setSocketAddress(address); Modified: trunk/core/src/core/org/jnode/imageio/jpeg/JPEGException.java =================================================================== --- trunk/core/src/core/org/jnode/imageio/jpeg/JPEGException.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/imageio/jpeg/JPEGException.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -23,6 +23,9 @@ import javax.imageio.IIOException; public class JPEGException extends IIOException { + + private static final long serialVersionUID = 1L; + public JPEGException(String message) { super(message); } Modified: trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReader.java =================================================================== --- trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReader.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReader.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -27,6 +27,7 @@ import javax.imageio.IIOException; import javax.imageio.ImageReadParam; import javax.imageio.ImageReader; +import javax.imageio.ImageTypeSpecifier; import javax.imageio.metadata.IIOMetadata; import javax.imageio.spi.ImageReaderSpi; import javax.imageio.stream.ImageInputStream; @@ -51,7 +52,7 @@ return null; } - public Iterator getImageTypes(int imageIndex) throws IOException { + public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException { return null; } Modified: trunk/core/src/openjdk/vm/java/io/NativeObjectInputStream.java =================================================================== --- trunk/core/src/openjdk/vm/java/io/NativeObjectInputStream.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/java/io/NativeObjectInputStream.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -31,10 +31,10 @@ * @see java.io.ObjectInputStream#bytesToFloats(byte[], int, float[], int, int) */ private static void bytesToFloats(byte[] src, int srcpos, float[] dst, int dstpos, int nfloats) { - if(src == null) throw new NullPointerException(); - if(dst == null) throw new NullPointerException(); + if (src == null) throw new NullPointerException(); + if (dst == null) throw new NullPointerException(); int dstend = dstpos + nfloats; - while(dstpos < dstend){ + while (dstpos < dstend) { int ival = ((src[srcpos ++ ] & 0xff) << 24) + ((src[srcpos ++ ] & 0xff) << 16) + @@ -47,10 +47,10 @@ * @see java.io.ObjectInputStream#bytesToDoubles(byte[], int, double[], int, int) */ private static void bytesToDoubles(byte[] src, int srcpos, double[] dst, int dstpos, int ndoubles) { - if(src == null) throw new NullPointerException(); - if(dst == null) throw new NullPointerException(); + if (src == null) throw new NullPointerException(); + if (dst == null) throw new NullPointerException(); int dstend = dstpos + ndoubles; - while(dstpos < dstend){ + while (dstpos < dstend) { long lval = ((src[srcpos ++ ] & 0xffL) << 56) + ((src[srcpos ++ ] & 0xffL) << 48) + @@ -67,11 +67,11 @@ * @see java.io.ObjectInputStream#latestUserDefinedLoader() */ private static ClassLoader latestUserDefinedLoader() { - Class[] ctx = VmSystem.getClassContext(); + Class<?>[] ctx = VmSystem.getClassContext(); for(int i = 0; i < ctx.length; i++){ - Class c = ctx[i]; + Class<?> c = ctx[i]; if(!sun.reflect.MethodAccessor.class.isAssignableFrom(c) && - !sun.reflect.ConstructorAccessor.class.isAssignableFrom(c)){ + !sun.reflect.ConstructorAccessor.class.isAssignableFrom(c)) { return c.getClassLoader(); } } Modified: trunk/core/src/openjdk/vm/java/io/NativeObjectStreamClass.java =================================================================== --- trunk/core/src/openjdk/vm/java/io/NativeObjectStreamClass.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/java/io/NativeObjectStreamClass.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -34,11 +34,12 @@ private static void initNative() { //empty } + /** * @see java.io.ObjectStreamClass#hasStaticInitializer(java.lang.Class) */ - private static boolean hasStaticInitializer(Class clazz) { - VmType vmt = VmType.fromClass(clazz); + private static boolean hasStaticInitializer(Class<?> clazz) { + VmType<?> vmt = VmType.fromClass(clazz); VmMethod met = vmt.getDeclaredMethod("<clinit>", "()V"); return met != null && met.isStatic(); } Modified: trunk/core/src/openjdk/vm/java/lang/NativeClass.java =================================================================== --- trunk/core/src/openjdk/vm/java/lang/NativeClass.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/java/lang/NativeClass.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -48,64 +48,74 @@ private static void registerNatives() { } + /** * @see java.lang.Class#forName0(java.lang.String, boolean, java.lang.ClassLoader) */ - private static Class forName0(String arg1, boolean arg2, ClassLoader arg3) throws ClassNotFoundException { + private static Class<?> forName0(String arg1, boolean arg2, ClassLoader arg3) + throws ClassNotFoundException { return (arg3 == null) ? VmSystem.forName(arg1) : arg3.loadClass(arg1, arg2); } + /** * @see java.lang.Class#isInstance(java.lang.Object) */ - private static boolean isInstance(Class instance, Object arg1) { + private static boolean isInstance(Class<?> instance, Object arg1) { return SoftByteCodes.isInstanceof(arg1, getLinkedVmClass(instance)); } + /** * @see java.lang.Class#isAssignableFrom(java.lang.Class) */ - private static boolean isAssignableFrom(Class instance, Class arg1) { + private static boolean isAssignableFrom(Class<?> instance, Class<?> arg1) { return getLinkedVmClass(instance).isAssignableFrom(getLinkedVmClass(arg1)); } + /** * @see java.lang.Class#isInterface() */ - private static boolean isInterface(Class instance) { + private static boolean isInterface(Class<?> instance) { return VmType.fromClass(instance).isInterface(); } + /** * @see java.lang.Class#isArray() */ - private static boolean isArray(Class instance) { + private static boolean isArray(Class<?> instance) { return VmType.fromClass(instance).isArray(); } + /** * @see java.lang.Class#isPrimitive() */ - private static boolean isPrimitive(Class instance) { + private static boolean isPrimitive(Class<?> instance) { return VmType.fromClass(instance).isPrimitive(); } + /** * @see java.lang.Class#getName0() */ - private static String getName0(Class instance) { + private static String getName0(Class<?> instance) { return VmType.fromClass(instance).getName().replace('/', '.'); } + /** * @see java.lang.Class#getClassLoader0() */ - private static ClassLoader getClassLoader0(Class instance) { + private static ClassLoader getClassLoader0(Class<?> instance) { VmClassLoader loader = VmType.fromClass(instance).getLoader(); return loader.isSystemClassLoader() ? null : loader.asClassLoader(); } + /** * @see java.lang.Class#getSuperclass() */ - private static <T> Class getSuperclass(Class instance) { + private static <T> Class<?> getSuperclass(Class<T> instance) { VmType<T> vmType = getLinkedVmClass(instance); - - if(vmType.isPrimitive() || vmType.isInterface()) + + if (vmType.isPrimitive() || vmType.isInterface()) { return null; - + } VmType< ? super T> superCls = vmType.getSuperClass(); if (superCls != null) { return superCls.asClass(); @@ -113,12 +123,13 @@ return null; } } + /** * @see java.lang.Class#getInterfaces() */ - private static <T> Class[] getInterfaces(Class instance) { + private static <T> Class<?>[] getInterfaces(Class<T> instance) { // if (interfaces == null) { - final ArrayList<Class> list = new ArrayList<Class>(); + final ArrayList<Class<?>> list = new ArrayList<Class<?>>(); final VmType<T> vmClass = getLinkedVmClass(instance); final int cnt = vmClass.getNoInterfaces(); for (int i = 0; i < cnt; i++) { @@ -129,10 +140,11 @@ // return (Class[]) interfaces.toArray(new Class[interfaces.size()]); return list.toArray(new Class[list.size()]); } + /** * @see java.lang.Class#getComponentType() */ - private static <T> Class getComponentType(Class instance) { + private static <T> Class<?> getComponentType(Class<T> instance) { final VmType<T> vmClass = getLinkedVmClass(instance); if (vmClass instanceof VmArrayClass) { final VmType< ? > vmCompType = ((VmArrayClass<T>) vmClass) @@ -143,43 +155,49 @@ } return null; } + /** * @see java.lang.Class#getModifiers() */ - private static int getModifiers(Class instance) { + private static int getModifiers(Class<?> instance) { return VmType.fromClass(instance).getAccessFlags(); } + /** * @see java.lang.Class#getSigners() */ - private static Object[] getSigners(Class instance) { + private static Object[] getSigners(Class<?> instance) { //todo implement it return null; } + /** * @see java.lang.Class#setSigners(java.lang.Object[]) */ - private static void setSigners(Class instance, Object[] arg1) { + private static void setSigners(Class<?> instance, Object[] arg1) { //todo implement it } + /** * @see java.lang.Class#getEnclosingMethod0() */ - private static Object[] getEnclosingMethod0(Class instance) { + private static Object[] getEnclosingMethod0(Class<?> instance) { //todo implement it return null; } + /** * @see java.lang.Class#getDeclaringClass() */ - private static Class getDeclaringClass(Class instance) { + private static Class<?> getDeclaringClass(Class<?> instance) { //todo implement it return null; } + /** * @see java.lang.Class#getProtectionDomain0() */ - private static ProtectionDomain getProtectionDomain0(Class instance) { + private static ProtectionDomain getProtectionDomain0(Class<?> instance) { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission("getProtectionDomain")); @@ -191,16 +209,18 @@ return getUnknownProtectionDomain(); } } + /** * @see java.lang.Class#setProtectionDomain0(java.security.ProtectionDomain) */ - private static void setProtectionDomain0(Class instance, ProtectionDomain arg1) { + private static void setProtectionDomain0(Class<?> instance, ProtectionDomain arg1) { //todo implement it } + /** * @see java.lang.Class#getPrimitiveClass(java.lang.String) */ - private static Class getPrimitiveClass(String type) { + private static Class<?> getPrimitiveClass(String type) { if(type.equals("double")) return getPrimitiveClass('D'); else if(type.equals("float")) @@ -222,30 +242,34 @@ else throw new IllegalArgumentException("Unknown type " + type); } + /** * @see java.lang.Class#getGenericSignature() */ - private static String getGenericSignature(Class instance) { + private static String getGenericSignature(Class<?> instance) { return VmType.fromClass(instance).getSignature(); } + /** * @see java.lang.Class#getRawAnnotations() */ - private static byte[] getRawAnnotations(Class instance) { + private static byte[] getRawAnnotations(Class<?> instance) { //todo implement it return null; } + /** * @see java.lang.Class#getConstantPool() */ - private static ConstantPool getConstantPool(Class instance) { + private static ConstantPool getConstantPool(Class<?> instance) { //todo implement it return null; } + /** * @see java.lang.Class#getDeclaredFields0(boolean) */ - private static <T> Field[] getDeclaredFields0(Class instance, boolean publicOnly) { + private static <T> Field[] getDeclaredFields0(Class<T> instance, boolean publicOnly) { //todo optimize , simplify Field[] declaredFields; { @@ -274,10 +298,11 @@ return declaredFields; } } + /** * @see java.lang.Class#getDeclaredMethods0(boolean) */ - private static <T> Method[] getDeclaredMethods0(Class instance, boolean publicOnly) { + private static <T> Method[] getDeclaredMethods0(Class<T> instance, boolean publicOnly) { final VmType<T> vmClass = getLinkedVmClass(instance); final int cnt = vmClass.getNoDeclaredMethods(); int max = 0; @@ -299,51 +324,55 @@ } return list; } + /** * @see java.lang.Class#getDeclaredConstructors0(boolean) */ - private static <T> Constructor[] getDeclaredConstructors0(Class instance, boolean arg1) { + private static <T> Constructor<?>[] getDeclaredConstructors0(Class<T> instance, boolean arg1) { //todo fix public only !!! - final VmType<T> vmClass = getLinkedVmClass(instance); - int cnt = vmClass.getNoDeclaredMethods(); - int max = 0; - for (int i = 0; i < cnt; i++) { - if (vmClass.getDeclaredMethod(i).isConstructor()) { - max++; - } + final VmType<T> vmClass = getLinkedVmClass(instance); + int cnt = vmClass.getNoDeclaredMethods(); + int max = 0; + for (int i = 0; i < cnt; i++) { + if (vmClass.getDeclaredMethod(i).isConstructor()) { + max++; } - Constructor[] list = new Constructor[max]; - max = 0; - for (int i = 0; i < cnt; i++) { - VmMethod vmMethod = vmClass.getDeclaredMethod(i); - if (vmMethod.isConstructor()) { - list[max++] = (Constructor) vmMethod.asMember(); - } + } + Constructor<?>[] list = new Constructor[max]; + max = 0; + for (int i = 0; i < cnt; i++) { + VmMethod vmMethod = vmClass.getDeclaredMethod(i); + if (vmMethod.isConstructor()) { + list[max++] = (Constructor<?>) vmMethod.asMember(); } + } return list; } + /** * @see java.lang.Class#getDeclaredClasses0() */ - private static Class[] getDeclaredClasses0(Class instance) { + private static Class<?>[] getDeclaredClasses0(Class<?> instance) { //todo implement it return new Class[0]; } + /** * @see java.lang.Class#desiredAssertionStatus0(java.lang.Class) */ - private static boolean desiredAssertionStatus0(Class arg1) { + private static boolean desiredAssertionStatus0(Class<?> arg1) { //todo implement it return false; } - private static <T> VmType<T> getLinkedVmClass(Class clazz) { - final VmType vmClass = VmType.fromClass(clazz); + private static <T> VmType<T> getLinkedVmClass(Class<T> clazz) { + final VmType<T> vmClass = VmType.fromClass(clazz); vmClass.link(); return vmClass; } private static ProtectionDomain unknownProtectionDomain; + /** * Gets the unknown protection domain. Create on demand. * @@ -358,7 +387,7 @@ return unknownProtectionDomain; } - static Class getPrimitiveClass(char type) { + static Class<?> getPrimitiveClass(char type) { return VmType.getPrimitiveClass(type).asClass(); } } Modified: trunk/core/src/openjdk/vm/java/lang/NativeStrictMath.java =================================================================== --- trunk/core/src/openjdk/vm/java/lang/NativeStrictMath.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/java/lang/NativeStrictMath.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -53,8 +53,6 @@ import gnu.classpath.Configuration; -import java.util.Random; - /** * Helper class containing useful mathematical functions and constants. * This class mirrors {@link Math}, but is 100% portable, because it uses Modified: trunk/core/src/openjdk/vm/java/lang/reflect/NativeArray.java =================================================================== --- trunk/core/src/openjdk/vm/java/lang/reflect/NativeArray.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/java/lang/reflect/NativeArray.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -285,7 +285,7 @@ /** * @see java.lang.reflect.Array#newArray(java.lang.Class, int) */ - private static Object newArray(Class arg1, int arg2) { + private static Object newArray(Class<?> arg1, int arg2) { if (!((Class<?>) arg1).isPrimitive()) return createObjectArray((Class<?>) arg1, arg2); if ((Class<?>) arg1 == boolean.class) @@ -311,32 +311,32 @@ /** * @see java.lang.reflect.Array#multiNewArray(java.lang.Class, int[]) */ - private static Object multiNewArray(Class arg1, int[] arg2) { + private static Object multiNewArray(Class<?> arg1, int[] arg2) { if (arg2.length <= 0) throw new IllegalArgumentException("Empty dimensions array."); if (arg2.length - 1 == 0) return newInstance((Class<?>) arg1, arg2[0]); - Object toAdd = createMultiArray((Class) (Class<?>) arg1, arg2, arg2.length - 1 - 1); - Class thisType = toAdd.getClass(); + Object toAdd = createMultiArray((Class<?>) arg1, arg2, arg2.length - 1 - 1); + Class<?> thisType = toAdd.getClass(); Object[] retval = (Object[]) createObjectArray(thisType, arg2[(arg2.length - 1)]); if (arg2[(arg2.length - 1)] > 0) retval[0] = toAdd; int i = arg2[(arg2.length - 1)]; while (--i > 0) - retval[i] = createMultiArray((Class) (Class<?>) arg1, arg2, arg2.length - 1 - 1); + retval[i] = createMultiArray((Class<?>) arg1, arg2, arg2.length - 1 - 1); return retval; } - static Object createMultiArray(Class type, int[] dimensions, + static Object createMultiArray(Class<?> type, int[] dimensions, int index) { if (index == 0) return newInstance(type, dimensions[0]); Object toAdd = createMultiArray(type, dimensions, index - 1); - Class thisType = toAdd.getClass(); + Class<?> thisType = toAdd.getClass(); Object[] retval = (Object[]) createObjectArray(thisType, dimensions[index]); if (dimensions[index] > 0) @@ -391,16 +391,16 @@ * @throws NegativeArraySizeException if dim is negative * @throws OutOfMemoryError if memory allocation fails */ - static Object createObjectArray(final Class type, int dim) { - final VmType vmClass = AccessController.doPrivileged( - new PrivilegedAction<VmType>() { - public VmType run() { + static Object createObjectArray(final Class<?> type, int dim) { + final VmType<?> vmClass = AccessController.doPrivileged( + new PrivilegedAction<VmType<?>>() { + public VmType<?> run() { return VmType.fromClass(type); } }); final String arrClsName = vmClass.getArrayClassName(); - final VmType arrCls; + final VmType<?> arrCls; try { final VmClassLoader curLoader = vmClass.getLoader(); arrCls = curLoader.loadClass(arrClsName, true); @@ -411,7 +411,7 @@ throw new NoClassDefFoundError(arrClsName); } - return Vm.getHeapManager().newArray((VmArrayClass) arrCls, dim); + return Vm.getHeapManager().newArray((VmArrayClass<?>) arrCls, dim); } } Modified: trunk/core/src/openjdk/vm/java/lang/reflect/NativeProxy.java =================================================================== --- trunk/core/src/openjdk/vm/java/lang/reflect/NativeProxy.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/java/lang/reflect/NativeProxy.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -29,9 +29,9 @@ /** * @see java.lang.reflect.Proxy#defineClass0(ClassLoader, String, byte[], int, int) */ - private static Class defineClass0(ClassLoader loader, String name, + private static Class<?> defineClass0(ClassLoader loader, String name, byte[] b, int off, int len){ - if(loader == null) + if (loader == null) loader = Thread.currentThread().getContextClassLoader(); return ((VmClassLoader)loader.getVmClassLoader()). defineClass(name, b, off, len, Object.class.getProtectionDomain()).asClass(); Modified: trunk/core/src/openjdk/vm/java/util/NativeResourceBundle.java =================================================================== --- trunk/core/src/openjdk/vm/java/util/NativeResourceBundle.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/java/util/NativeResourceBundle.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -26,10 +26,11 @@ * @author Levente S\u00e1ntha */ class NativeResourceBundle { - static Class[] getClassContext(){ + + static Class<?>[] getClassContext(){ //skip the call to VmSystem.getRealClassContext() - Class[] context = VmSystem.getRealClassContext(); - Class[] ret = new Class[context.length - 2]; + Class<?>[] context = VmSystem.getRealClassContext(); + Class<?>[] ret = new Class[context.length - 2]; System.arraycopy(context, 2, ret, 0, ret.length); return ret; Modified: trunk/core/src/openjdk/vm/java/util/jar/NativeJarFile.java =================================================================== --- trunk/core/src/openjdk/vm/java/util/jar/NativeJarFile.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/java/util/jar/NativeJarFile.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -14,10 +14,11 @@ private static String[] getMetaInfEntryNames(JarFile instance) { ArrayList<String> ret = new ArrayList<String>(); - for (Enumeration e = instance.entries(); e.hasMoreElements(); ) { + for (Enumeration<?> e = instance.entries(); e.hasMoreElements(); ) { String name = ((ZipEntry) e.nextElement()).getName(); - if (name.startsWith("META-INF/")) + if (name.startsWith("META-INF/")) { ret.add(name); + } } return ret.isEmpty() ? null : ret.toArray(new String[ret.size()]); Modified: trunk/core/src/openjdk/vm/sun/awt/image/NativeBufImgSurfaceData.java =================================================================== --- trunk/core/src/openjdk/vm/sun/awt/image/NativeBufImgSurfaceData.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/awt/image/NativeBufImgSurfaceData.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -30,15 +30,19 @@ /** * @see sun.awt.image.BufImgSurfaceData#initIDs(Class) */ - private static void initIDs(Class arg1) { + private static void initIDs(Class<?> arg1) { //todo implement it } + /** * @see sun.awt.image.BufImgSurfaceData#initRaster(java.lang.Object, int, int, int, int, int, int, java.awt.image.IndexColorModel) */ - private static void initRaster(BufImgSurfaceData instance, Object arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, IndexColorModel arg8) { + private static void initRaster(BufImgSurfaceData instance, + Object arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, + IndexColorModel arg8) { //todo implement it } + /** * @see sun.awt.image.BufImgSurfaceData#freeNativeICMData(java.awt.image.IndexColorModel) */ Modified: trunk/core/src/openjdk/vm/sun/awt/image/NativeJPEGImageDecoder.java =================================================================== --- trunk/core/src/openjdk/vm/sun/awt/image/NativeJPEGImageDecoder.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/awt/image/NativeJPEGImageDecoder.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -30,9 +30,10 @@ /** * @see sun.awt.image.JPEGImageDecoder#initIDs(java.lang.Class) */ - private static void initIDs(Class arg1) { + private static void initIDs(Class<?> arg1) { //todo implement it } + /** * @see sun.awt.image.JPEGImageDecoder#readImage(java.io.InputStream, byte[]) */ Modified: trunk/core/src/openjdk/vm/sun/font/NativeFontManager.java =================================================================== --- trunk/core/src/openjdk/vm/sun/font/NativeFontManager.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/font/NativeFontManager.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -38,12 +38,14 @@ private static void initIDs() { //todo implement it } + /** * @see sun.font.FontManager#setFont2D(java.awt.Font, sun.font.Font2DHandle) */ private static void setFont2D(Font arg1, Font2DHandle arg2) { //todo implement it } + /** * @see sun.font.FontManager#isCreatedFont(java.awt.Font) */ @@ -51,18 +53,22 @@ //todo implement it return false; } + /** * @see sun.font.FontManager#setCreatedFont(java.awt.Font) */ private static void setCreatedFont(Font arg1) { //todo implement it } + /** * @see sun.font.FontManager#populateFontFileNameMap(java.util.HashMap, java.util.HashMap, java.util.HashMap, java.util.Locale) */ - private static void populateFontFileNameMap(HashMap arg1, HashMap arg2, HashMap arg3, Locale arg4) { + private static void populateFontFileNameMap( + HashMap<?, ?> arg1, HashMap<?, ?> arg2, HashMap<?, ?> arg3, Locale arg4) { //todo implement it } + /** * @see sun.font.FontManager#getFont2D(java.awt.Font) */ Modified: trunk/core/src/openjdk/vm/sun/font/NativeFreetypeFontScaler.java =================================================================== --- trunk/core/src/openjdk/vm/sun/font/NativeFreetypeFontScaler.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/font/NativeFreetypeFontScaler.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -31,71 +31,93 @@ /** * @see sun.font.FreetypeFontScaler#initIDs(java.lang.Class) */ - private static void initIDs(Class arg1) { + private static void initIDs(Class<?> arg1) { //todo implement it } + /** * @see sun.font.FreetypeFontScaler#initNativeScaler(sun.font.Font2D, int, int, boolean, int) */ - private static long initNativeScaler(FreetypeFontScaler instance, Font2D arg1, int arg2, int arg3, boolean arg4, int arg5) { + private static long initNativeScaler( + FreetypeFontScaler instance, Font2D arg1, int arg2, int arg3, boolean arg4, int arg5) { //todo implement it return 0; } + /** * @see sun.font.FreetypeFontScaler#getFontMetricsNative(sun.font.Font2D, long, long) */ - private static StrikeMetrics getFontMetricsNative(FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3) { + private static StrikeMetrics getFontMetricsNative( + FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3) { //todo implement it return null; } + /** * @see sun.font.FreetypeFontScaler#getGlyphAdvanceNative(sun.font.Font2D, long, long, int) */ - private static float getGlyphAdvanceNative(FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4) { + private static float getGlyphAdvanceNative( + FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4) { //todo implement it return 0; } + /** * @see sun.font.FreetypeFontScaler#getGlyphMetricsNative(sun.font.Font2D, long, long, int, java.awt.geom.Point2D.Float) */ - private static void getGlyphMetricsNative(FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4, Point2D.Float arg5) { + private static void getGlyphMetricsNative( + FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4, + Point2D.Float arg5) { //todo implement it } + /** * @see sun.font.FreetypeFontScaler#getGlyphImageNative(sun.font.Font2D, long, long, int) */ - private static long getGlyphImageNative(FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4) { + private static long getGlyphImageNative( + FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4) { //todo implement it return 0; } + /** * @see sun.font.FreetypeFontScaler#getGlyphOutlineBoundsNative(sun.font.Font2D, long, long, int) */ - private static Rectangle2D.Float getGlyphOutlineBoundsNative(FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4) { + private static Rectangle2D.Float getGlyphOutlineBoundsNative( + FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4) { //todo implement it return null; } + /** * @see sun.font.FreetypeFontScaler#getGlyphOutlineNative(sun.font.Font2D, long, long, int, float, float) */ - private static GeneralPath getGlyphOutlineNative(FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4, float arg5, float arg6) { + private static GeneralPath getGlyphOutlineNative( + FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4, + float arg5, float arg6) { //todo implement it return null; } + /** * @see sun.font.FreetypeFontScaler#getGlyphVectorOutlineNative(sun.font.Font2D, long, long, int[], int, float, float) */ - private static GeneralPath getGlyphVectorOutlineNative(FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int[] arg4, int arg5, float arg6, float arg7) { + private static GeneralPath getGlyphVectorOutlineNative( + FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int[] arg4, + int arg5, float arg6, float arg7) { //todo implement it return null; } + /** * @see sun.font.FreetypeFontScaler#getGlyphPointNative(sun.font.Font2D, long, long, int, int) */ - private static Point2D.Float getGlyphPointNative(FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4, int arg5) { + private static Point2D.Float getGlyphPointNative( + FreetypeFontScaler instance, Font2D arg1, long arg2, long arg3, int arg4, int arg5) { //todo implement it return null; } + /** * @see sun.font.FreetypeFontScaler#getLayoutTableCacheNative(long) */ @@ -103,12 +125,14 @@ //todo implement it return 0; } + /** * @see sun.font.FreetypeFontScaler#disposeNativeScaler(long) */ private static void disposeNativeScaler(FreetypeFontScaler instance, long arg1) { //todo implement it } + /** * @see sun.font.FreetypeFontScaler#getGlyphCodeNative(long, char) */ @@ -116,6 +140,7 @@ //todo implement it return 0; } + /** * @see sun.font.FreetypeFontScaler#getNumGlyphsNative(long) */ @@ -123,6 +148,7 @@ //todo implement it return 0; } + /** * @see sun.font.FreetypeFontScaler#getMissingGlyphCodeNative(long) */ @@ -130,6 +156,7 @@ //todo implement it return 0; } + /** * @see sun.font.FreetypeFontScaler#getUnitsPerEMNative(long) */ @@ -137,6 +164,7 @@ //todo implement it return 0; } + /** * @see sun.font.FreetypeFontScaler#createScalerContextNative(long, double[], boolean, int, int, float, float) */ Modified: trunk/core/src/openjdk/vm/sun/java2d/loops/NativeGraphicsPrimitiveMgr.java =================================================================== --- trunk/core/src/openjdk/vm/sun/java2d/loops/NativeGraphicsPrimitiveMgr.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/java2d/loops/NativeGraphicsPrimitiveMgr.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -27,9 +27,13 @@ /** * @see sun.java2d.loops.GraphicsPrimitiveMgr#initIDs(java.lang.Class, java.lang.Class, java.lang.Class, java.lang.Class, java.lang.Class, java.lang.Class, java.lang.Class, java.lang.Class, java.lang.Class, java.lang.Class, java.lang.Class) */ - private static void initIDs(Class arg1, Class arg2, Class arg3, Class arg4, Class arg5, Class arg6, Class arg7, Class arg8, Class arg9, Class arg10, Class arg11) { + private static void initIDs( + Class<?> arg1, Class<?> arg2, Class<?> arg3, Class<?> arg4, Class<?> arg5, + Class<?> arg6, Class<?> arg7, Class<?> arg8, Class<?> arg9, Class<?> arg10, + Class<?> arg11) { //todo implement it } + /** * @see sun.java2d.loops.GraphicsPrimitiveMgr#registerNativeLoops() */ Modified: trunk/core/src/openjdk/vm/sun/java2d/pipe/NativeSpanClipRenderer.java =================================================================== --- trunk/core/src/openjdk/vm/sun/java2d/pipe/NativeSpanClipRenderer.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/java2d/pipe/NativeSpanClipRenderer.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -28,19 +28,23 @@ /** * @see sun.java2d.pipe.SpanClipRenderer#initIDs(java.lang.Class, java.lang.Class) */ - private static void initIDs(Class arg1, Class arg2) { + private static void initIDs(Class<?> arg1, Class<?> arg2) { //todo implement it } + /** * @see sun.java2d.pipe.SpanClipRenderer#fillTile(sun.java2d.pipe.RegionIterator, byte[], int, int, int[]) */ - private static void fillTile(SpanClipRenderer instance, RegionIterator arg1, byte[] arg2, int arg3, int arg4, int[] arg5) { + private static void fillTile(SpanClipRenderer instance, RegionIterator arg1, + byte[] arg2, int arg3, int arg4, int[] arg5) { //todo implement it } + /** * @see sun.java2d.pipe.SpanClipRenderer#eraseTile(sun.java2d.pipe.RegionIterator, byte[], int, int, int[]) */ - private static void eraseTile(SpanClipRenderer instance, RegionIterator arg1, byte[] arg2, int arg3, int arg4, int[] arg5) { + private static void eraseTile(SpanClipRenderer instance, RegionIterator arg1, + byte[] arg2, int arg3, int arg4, int[] arg5) { //todo implement it } } Modified: trunk/core/src/openjdk/vm/sun/misc/NativeUnsafe.java =================================================================== --- trunk/core/src/openjdk/vm/sun/misc/NativeUnsafe.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/misc/NativeUnsafe.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -441,18 +441,18 @@ return vmClass.getDeclaredField(f.getSlot()); } - public static void ensureClassInitialized(Unsafe instance, Class c) { + public static void ensureClassInitialized(Unsafe instance, Class<?> c) { VmType.fromClass(c).initialize(); } - public static int arrayBaseOffset(Unsafe instance, Class arrayClass) { + public static int arrayBaseOffset(Unsafe instance, Class<?> arrayClass) { return VmArray.DATA_OFFSET * VmProcessor.current().getArchitecture().getReferenceSize(); } - public static int arrayIndexScale(Unsafe instance, Class arrayClass) { + public static int arrayIndexScale(Unsafe instance, Class<?> arrayClass) { //see VmHeapManager.newArray() final int elemSize; - VmType arrayCls = VmType.fromClass(arrayClass); + VmType<?> arrayCls = VmType.fromClass(arrayClass); if (arrayCls.isPrimitiveArray()) { switch (arrayCls.getSecondNameChar()) { case 'B': // byte @@ -488,9 +488,8 @@ throw new UnsupportedOperationException(); } - public static Class defineClass(Unsafe instance, String name, byte[] b, int off, int len, - ClassLoader loader, - ProtectionDomain protDomain) { + public static Class<?> defineClass(Unsafe instance, String name, byte[] b, int off, int len, + ClassLoader loader, ProtectionDomain protDomain) { if (protDomain == null) { protDomain = AccessController .doPrivileged(new PrivilegedAction<ProtectionDomain>() { @@ -501,15 +500,16 @@ } }); } - return ((VmClassLoader)loader.getVmClassLoader()).defineClass(name, b, off, len, protDomain).asClass(); + return ((VmClassLoader) loader.getVmClassLoader()). + defineClass(name, b, off, len, protDomain).asClass(); } - public static Class defineClass(Unsafe instance, String name, byte[] b, int off, int len) { + public static Class<?> defineClass(Unsafe instance, String name, byte[] b, int off, int len) { throw new UnsupportedOperationException(); } - public static Object allocateInstance(Unsafe instance, Class cls) + public static Object allocateInstance(Unsafe instance, Class<?> cls) throws InstantiationException { //todo improve exception handling try { Modified: trunk/core/src/openjdk/vm/sun/reflect/NativeConstantPool.java =================================================================== --- trunk/core/src/openjdk/vm/sun/reflect/NativeConstantPool.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/reflect/NativeConstantPool.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -31,11 +31,11 @@ throw new UnsupportedOperationException(); } - private static Class getClassAt0(ConstantPool instance, Object constantPoolOop, int index) { + private static Class<?> getClassAt0(ConstantPool instance, Object constantPoolOop, int index) { throw new UnsupportedOperationException(); } - private static Class getClassAtIfLoaded0(ConstantPool instance, Object constantPoolOop, int index) { + private static Class<?> getClassAtIfLoaded0(ConstantPool instance, Object constantPoolOop, int index) { throw new UnsupportedOperationException(); } Modified: trunk/core/src/openjdk/vm/sun/reflect/NativeNativeConstructorAccessorImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/reflect/NativeNativeConstructorAccessorImpl.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/reflect/NativeNativeConstructorAccessorImpl.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -33,10 +33,10 @@ /** * @see sun.reflect.NativeConstructorAccessorImpl#newInstance0(java.lang.reflect.Constructor, java.lang.Object[]) */ - private static Object newInstance0(Constructor arg1, Object[] arg2) throws InstantiationException, + private static Object newInstance0(Constructor<?> arg1, Object[] arg2) throws InstantiationException, IllegalArgumentException, InvocationTargetException{ - VmType vmt = VmType.fromClass(arg1.getDeclaringClass()); + VmType<?> vmt = VmType.fromClass(arg1.getDeclaringClass()); VmMethod vmm = vmt.getDeclaredMethod(arg1.getSlot()); try { return VmReflection.newInstance(vmm, arg2); Modified: trunk/core/src/openjdk/vm/sun/reflect/NativeNativeMethodAccessorImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/reflect/NativeNativeMethodAccessorImpl.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/reflect/NativeNativeMethodAccessorImpl.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -35,7 +35,7 @@ */ private static Object invoke0(Method arg1, Object arg2, Object[] arg3) throws IllegalArgumentException, InvocationTargetException { - VmType vmt = VmType.fromClass((Class<?>) arg1.getDeclaringClass()); + VmType<?> vmt = VmType.fromClass((Class<?>) arg1.getDeclaringClass()); VmMethod vmm = vmt.getDeclaredMethod(arg1.getSlot()); return VmReflection.invoke(vmm, arg2, arg3); } Modified: trunk/core/src/openjdk/vm/sun/reflect/NativeReflection.java =================================================================== --- trunk/core/src/openjdk/vm/sun/reflect/NativeReflection.java 2009-04-18 15:03:26 UTC (rev 5306) +++ trunk/core/src/openjdk/vm/sun/reflect/NativeReflection.java 2009-04-18 15:07:04 UTC (rev 5307) @@ -34,7 +34,7 @@ * @return * @see Reflection#getCallerClass(int) */ - static Class getCallerClass(int realFramesToSkip){ + static Class<?> getCallerClass(int realFramesToSkip){ // using realFramesToSkip + 1 to skip VmSystem return VmSystem.getRealClassContext()[realFramesToSkip + 1]; } @@ -45,7 +45,7 @@ * @return * @see Reflection#getClassAccessFlags(Class) */ - static int getClassAccessFlags(Class c) { + static int getClassAccessFlags(Class<?> c) { return VmType.fromClass(c).getAccessFlags(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2009-08-16 09:56:19
|
Revision: 5649 http://jnode.svn.sourceforge.net/jnode/?rev=5649&view=rev Author: fduminy Date: 2009-08-16 09:56:10 +0000 (Sun, 16 Aug 2009) Log Message: ----------- fixed type safety warnings Modified Paths: -------------- trunk/core/src/core/org/jnode/system/x86/DMA.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCICore.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI_SMBusControler.java trunk/core/src/driver/org/jnode/driver/serial/SerialPortDriver.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOSPlugin.java trunk/core/src/test/org/jnode/test/JMXTest.java Modified: trunk/core/src/core/org/jnode/system/x86/DMA.java =================================================================== --- trunk/core/src/core/org/jnode/system/x86/DMA.java 2009-08-16 09:50:44 UTC (rev 5648) +++ trunk/core/src/core/org/jnode/system/x86/DMA.java 2009-08-16 09:56:10 UTC (rev 5649) @@ -343,8 +343,8 @@ private IOResource claimPorts(final ResourceManager rm, final ResourceOwner owner, final int low, final int length) throws ResourceNotFreeException, DMAException { try { - return (IOResource) AccessControllerUtils.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws ResourceNotFreeException { + return AccessControllerUtils.doPrivileged(new PrivilegedExceptionAction<IOResource>() { + public IOResource run() throws ResourceNotFreeException { return rm.claimIOResource(owner, low, length); } }); Modified: trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java 2009-08-16 09:50:44 UTC (rev 5648) +++ trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java 2009-08-16 09:56:10 UTC (rev 5649) @@ -481,10 +481,10 @@ final ResourceOwner owner) throws ResourceNotFreeException, DriverException { try { - return (IOResource) AccessControllerUtils - .doPrivileged(new PrivilegedExceptionAction() { + return AccessControllerUtils + .doPrivileged(new PrivilegedExceptionAction<IOResource>() { - public Object run() throws ResourceNotFreeException { + public IOResource run() throws ResourceNotFreeException { return rm.claimIOResource(owner, PCI_FIRST_PORT, PCI_LAST_PORT - PCI_FIRST_PORT + 1); } Modified: trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCICore.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCICore.java 2009-08-16 09:50:44 UTC (rev 5648) +++ trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCICore.java 2009-08-16 09:56:10 UTC (rev 5649) @@ -237,8 +237,8 @@ private IOResource claimPorts(final ResourceManager rm, final ResourceOwner owner, final int low, final int length) throws ResourceNotFreeException, DriverException { try { - return (IOResource) AccessControllerUtils.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws ResourceNotFreeException { + return AccessControllerUtils.doPrivileged(new PrivilegedExceptionAction<IOResource>() { + public IOResource run() throws ResourceNotFreeException { return rm.claimIOResource(owner, low, length); } }); Modified: trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI_SMBusControler.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI_SMBusControler.java 2009-08-16 09:50:44 UTC (rev 5648) +++ trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI_SMBusControler.java 2009-08-16 09:56:10 UTC (rev 5649) @@ -340,8 +340,8 @@ private IOResource claimPorts(final ResourceManager rm, final ResourceOwner owner, final int low, final int length) throws ResourceNotFreeException, DriverException { try { - return (IOResource) AccessControllerUtils.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws ResourceNotFreeException { + return AccessControllerUtils.doPrivileged(new PrivilegedExceptionAction<IOResource>() { + public IOResource run() throws ResourceNotFreeException { return rm.claimIOResource(owner, low, length); } }); Modified: trunk/core/src/driver/org/jnode/driver/serial/SerialPortDriver.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/serial/SerialPortDriver.java 2009-08-16 09:50:44 UTC (rev 5648) +++ trunk/core/src/driver/org/jnode/driver/serial/SerialPortDriver.java 2009-08-16 09:56:10 UTC (rev 5649) @@ -186,10 +186,10 @@ final ResourceOwner owner, final int low, final int length) throws ResourceNotFreeException, DriverException { try { - return (IOResource) AccessControllerUtils - .doPrivileged(new PrivilegedExceptionAction() { + return AccessControllerUtils + .doPrivileged(new PrivilegedExceptionAction<IOResource>() { - public Object run() throws ResourceNotFreeException { + public IOResource run() throws ResourceNotFreeException { return rm.claimIOResource(owner, low, length); } }); Modified: trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOSPlugin.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOSPlugin.java 2009-08-16 09:50:44 UTC (rev 5648) +++ trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOSPlugin.java 2009-08-16 09:56:10 UTC (rev 5649) @@ -71,8 +71,8 @@ protected void startPlugin() throws PluginException { try { final ResourceOwner owner = new SimpleResourceOwner("CMOS"); - cmos = (CMOS) AccessControllerUtils.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws ResourceNotFreeException { + cmos = AccessControllerUtils.doPrivileged(new PrivilegedExceptionAction<CMOS>() { + public CMOS run() throws ResourceNotFreeException { return new CMOS(owner); } }); Modified: trunk/core/src/test/org/jnode/test/JMXTest.java =================================================================== --- trunk/core/src/test/org/jnode/test/JMXTest.java 2009-08-16 09:50:44 UTC (rev 5648) +++ trunk/core/src/test/org/jnode/test/JMXTest.java 2009-08-16 09:56:10 UTC (rev 5649) @@ -34,7 +34,7 @@ public class JMXTest { public static void main(String[] args) throws Exception { - AccessController.doPrivileged(new PrivilegedExceptionAction() { + AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { public Object run() throws Exception { MBeanServerFactory.createMBeanServer(); printMBeanServers(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-08-16 11:48:36
|
Revision: 5651 http://jnode.svn.sourceforge.net/jnode/?rev=5651&view=rev Author: lsantha Date: 2009-08-16 11:48:25 +0000 (Sun, 16 Aug 2009) Log Message: ----------- Improved runtime annotation support. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java trunk/core/src/core/org/jnode/vm/classmgr/VmField.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java trunk/core/src/openjdk/vm/java/lang/NativeClass.java Modified: trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java 2009-08-16 11:35:45 UTC (rev 5650) +++ trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java 2009-08-16 11:48:25 UTC (rev 5651) @@ -426,6 +426,9 @@ final String attrName = cp.getUTF8(data.getChar()); final int length = data.getInt(); if (VmArray.equals(RuntimeVisibleAnnotationsAttrName, attrName)) { + byte[] buf = new byte[length]; + data.slice().get(buf); + cls.setRawAnnotations(buf); rVisAnn = readRuntimeAnnotations(data, cp, true, clc); } else if (VmArray.equals(RuntimeInvisibleAnnotationsAttrName, attrName)) { @@ -641,6 +644,7 @@ // Read field attributes final int acount = data.getChar(); VmAnnotation[] rVisAnn = null; + byte[] rawAnnotations = null; Object constantValue = null; for (int a = 0; a < acount; a++) { final String attrName = cp.getUTF8(data.getChar()); @@ -650,6 +654,8 @@ constantValue = cp.getAny(data.getChar()); } else if (VmArray.equals( RuntimeVisibleAnnotationsAttrName, attrName)) { + rawAnnotations = new byte[length]; + data.slice().get(rawAnnotations); rVisAnn = readRuntimeAnnotations(data, cp, true, loader); } else if (VmArray.equals( RuntimeInvisibleAnnotationsAttrName, attrName)) { @@ -659,8 +665,7 @@ } } - ftable[i] = new FieldData(name, signature, modifiers, - constantValue, rVisAnn); + ftable[i] = new FieldData(name, signature, modifiers, constantValue, rVisAnn, rawAnnotations); } return ftable; } else { @@ -773,8 +778,7 @@ } ftable[i] = fs; - // Read field attributes - final VmAnnotation[] rVisAnn = fd.rVisAnn; + // Read field attributes if (isstatic && (fd.constantValue != null)) { switch (signature.charAt(0)) { case 'B': @@ -782,34 +786,28 @@ case 'I': case 'S': case 'Z': - statics.setInt(staticsIdx, ((VmConstInt) fd.constantValue) - .intValue()); + statics.setInt(staticsIdx, ((VmConstInt) fd.constantValue).intValue()); break; case 'D': - final long lval = Double - .doubleToRawLongBits(((VmConstDouble) fd.constantValue) - .doubleValue()); + final long lval = Double.doubleToRawLongBits(((VmConstDouble) fd.constantValue).doubleValue()); statics.setLong(staticsIdx, lval); break; case 'F': - final int ival = Float - .floatToRawIntBits(((VmConstFloat) fd.constantValue) - .floatValue()); + final int ival = Float.floatToRawIntBits(((VmConstFloat) fd.constantValue) .floatValue()); statics.setInt(staticsIdx, ival); break; case 'J': - statics.setLong(staticsIdx, - ((VmConstLong) fd.constantValue).longValue()); + statics.setLong(staticsIdx, ((VmConstLong) fd.constantValue).longValue()); break; default: // throw new IllegalArgumentException("signature " // + signature); - statics.setObject(staticsIdx, - (VmConstString) fd.constantValue); + statics.setObject(staticsIdx, fd.constantValue); break; } } - fs.setRuntimeAnnotations(rVisAnn); + fs.setRuntimeAnnotations(fd.rVisAnn); + fs.setRawAnnotations(fd.rawAnnotations); } // Align the instance fields for minimal object size. @@ -951,9 +949,7 @@ mts.setBytecode(readCode(data, cls, cp, mts)); } else if (VmArray.equals(ExceptionsAttrName, attrName)) { mts.setExceptions(readExceptions(data, cls, cp)); - } else if (VmArray.equals( - RuntimeVisibleAnnotationsAttrName, attrName)) { - + } else if (VmArray.equals(RuntimeVisibleAnnotationsAttrName, attrName)) { byte[] buf = new byte[length]; data.slice().get(buf); mts.setRawAnnotations(buf); @@ -962,21 +958,16 @@ //rVisAnn = readRuntimeAnnotations(data, cp, true, cl); rVisAnn = readRuntimeAnnotations2(data, cp, true, cl, cls); - } else if (VmArray.equals( - RuntimeInvisibleAnnotationsAttrName, attrName)) { + } else if (VmArray.equals(RuntimeInvisibleAnnotationsAttrName, attrName)) { rInvisAnn = readRuntimeAnnotations(data, cp, false, cl); - } else if (VmArray.equals( - RuntimeVisibleParameterAnnotationsAttrName, - attrName)) { + } else if (VmArray.equals(RuntimeVisibleParameterAnnotationsAttrName, attrName)) { byte[] buf = new byte[length]; data.slice().get(buf); mts.setRawParameterAnnotations(buf); //todo will get obsolate with openjdk based annotation support readRuntimeParameterAnnotations(data, cp, true, cl); - } else if (VmArray.equals( - RuntimeInvisibleParameterAnnotationsAttrName, - attrName)) { + } else if (VmArray.equals(RuntimeInvisibleParameterAnnotationsAttrName, attrName)) { readRuntimeParameterAnnotations(data, cp, false, cl); } else if (VmArray.equals(AnnotationDefaultAttrName, attrName)) { //todo will get obsolate with openjdk based annotation support @@ -1466,38 +1457,46 @@ } private static final class PragmaAnnotation { + private static final String[] EMPTY_PACKAGES = new String[0]; public final char flags; public final String typeDescr; - private final String[] allowedPackages; + private String[] allowedPackages; public PragmaAnnotation(Class<? extends Annotation> cls, char flags) { this.typeDescr = "L" + cls.getName().replace('.', '/') + ";"; this.flags = flags; - final AllowedPackages ann = cls - .getAnnotation(AllowedPackages.class); - if (ann != null) { - allowedPackages = ann.value(); - } else { - allowedPackages = null; - } } /** * Is this annotation allowed for the given classname. */ public final void checkPragmaAllowed(String className) { - if (allowedPackages != null) { - final String pkg = className.substring(0, className - .lastIndexOf('.')); + //lazy initialization of allowPackages to avoid startup failure + if (allowedPackages == null) { + String class_name = typeDescr.substring(1, typeDescr.length() - 1).replace('/', '.'); + try { + Class<Annotation> cls = (Class<Annotation>) Class.forName(class_name); + final AllowedPackages ann = cls.getAnnotation(AllowedPackages.class); + if (ann != null) { + allowedPackages = ann.value(); + } else { + allowedPackages = EMPTY_PACKAGES; + } + } catch (ClassNotFoundException x) { + throw new RuntimeException(x); + } + } + + if (allowedPackages.length > 0) { + final String pkg = className.substring(0, className.lastIndexOf('.')); for (String allowedPkg : allowedPackages) { if (pkg.equals(allowedPkg)) { return; } } - throw new SecurityException("Pragma " + typeDescr - + " is not allowed in class " + className); + throw new SecurityException("Pragma " + typeDescr + " is not allowed in class " + className); } } } @@ -1513,6 +1512,7 @@ public final VmAnnotation[] rVisAnn; + public final byte[] rawAnnotations; /** * @param name * @param signature @@ -1521,12 +1521,13 @@ * @param rVisAnn */ public FieldData(String name, String signature, int modifiers, - Object value, VmAnnotation[] rVisAnn) { + Object value, VmAnnotation[] rVisAnn, byte[] rawAnnotations) { this.name = name; this.signature = signature; this.modifiers = modifiers; this.constantValue = value; this.rVisAnn = rVisAnn; + this.rawAnnotations = rawAnnotations; } } Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java 2009-08-16 11:35:45 UTC (rev 5650) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java 2009-08-16 11:48:25 UTC (rev 5651) @@ -155,4 +155,25 @@ * @return the parent element */ protected abstract VmAnnotatedElement getSuperElement(); + + /** + * Raw runtime annotations to be parsed by java.lang.Class of OpenJDK. + */ + private byte[] rawAnnotations; + + /** + * Returns the raw runtime annotations. + * @return the raw annotation data as a byte[] + */ + public byte[] getRawAnnotations() { + return rawAnnotations; + } + + /** + * Sets the raw runtime annotations. + * @param rawAnnotations the raw annotation data as a byte[] + */ + public void setRawAnnotations(byte[] rawAnnotations) { + this.rawAnnotations = rawAnnotations; + } } Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmField.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmField.java 2009-08-16 11:35:45 UTC (rev 5650) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmField.java 2009-08-16 11:48:25 UTC (rev 5651) @@ -133,9 +133,8 @@ if (slot == -1) { throw new ClassFormatError("Invalid field: " + this.getName()); } - //todo add annotations javaField = new Field(d_class.asClass(), getName(), getType().asClass(), getModifiers(), slot, - getSignature(), null); + getSignature(), getRawAnnotations()); javaFieldHolder.set(javaField); } return javaField; Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java 2009-08-16 11:35:45 UTC (rev 5650) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java 2009-08-16 11:48:25 UTC (rev 5651) @@ -102,7 +102,6 @@ private Object annotationDefault; private byte[] rawAnnotationDefault; - private byte[] rawAnnotations; private byte[] rawParameterAnnotations; /** @@ -696,14 +695,6 @@ this.rawAnnotationDefault = rawAnnotationDefault; } - public byte[] getRawAnnotations() { - return rawAnnotations; - } - - public void setRawAnnotations(byte[] rawAnnotations) { - this.rawAnnotations = rawAnnotations; - } - public byte[] getRawParameterAnnotations() { return rawParameterAnnotations; } Modified: trunk/core/src/openjdk/vm/java/lang/NativeClass.java =================================================================== --- trunk/core/src/openjdk/vm/java/lang/NativeClass.java 2009-08-16 11:35:45 UTC (rev 5650) +++ trunk/core/src/openjdk/vm/java/lang/NativeClass.java 2009-08-16 11:48:25 UTC (rev 5651) @@ -35,6 +35,7 @@ import org.jnode.vm.classmgr.VmClassLoader; import org.jnode.vm.classmgr.VmArrayClass; import org.jnode.vm.classmgr.VmMethod; +import org.jnode.vm.classmgr.VmConstantPool; /** * @see java.lang.Class @@ -254,16 +255,14 @@ * @see java.lang.Class#getRawAnnotations() */ private static byte[] getRawAnnotations(Class<?> instance) { - //todo implement it - return null; + return VmType.fromClass(instance).getRawAnnotations(); } /** * @see java.lang.Class#getConstantPool() */ private static ConstantPool getConstantPool(Class<?> instance) { - //todo implement it - return null; + return new VmConstantPool(VmType.fromClass(instance)); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2009-12-06 19:15:57
|
Revision: 5690 http://jnode.svn.sourceforge.net/jnode/?rev=5690&view=rev Author: fduminy Date: 2009-12-06 19:15:41 +0000 (Sun, 06 Dec 2009) Log Message: ----------- added javadoc + links to MagicClass and MagicMethod classes, where "magic" methods are referenced Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java Modified: trunk/core/src/core/org/jnode/vm/VmMagic.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmMagic.java 2009-12-03 21:18:57 UTC (rev 5689) +++ trunk/core/src/core/org/jnode/vm/VmMagic.java 2009-12-06 19:15:41 UTC (rev 5690) @@ -33,9 +33,11 @@ * instead of being executed as normal java methods. The actual method * bodies are not used. * <p/> - * Methods is this class can also be called from inside JNode. + * Methods in this class can also be called from inside JNode. * * @author Ewout Prangsma (ep...@us...) + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass} to get the list of "magic" classes (including this class). + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod} to get the list of "magic" methods. */ @MagicPermission public final class VmMagic { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2009-12-03 21:18:57 UTC (rev 5689) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2009-12-06 19:15:41 UTC (rev 5690) @@ -18,7 +18,15 @@ import org.jnode.annotation.Uninterruptible; /** - * Stub implementation of an Address type. Needs commenting. + * Stub implementation of an Address type. + * <p/> + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. The actual method bodies are not used. <br/> + * For further details, see the + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} + * and the + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2009-12-03 21:18:57 UTC (rev 5689) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2009-12-06 19:15:41 UTC (rev 5690) @@ -14,8 +14,14 @@ package org.vmmagic.unboxed; /** - * Commenting required - * + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. The actual method bodies are not used. <br/> + * For further details, see the + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} + * and the + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. + * * @author Daniel Frampton */ public final class Extent implements UnboxedObject { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2009-12-03 21:18:57 UTC (rev 5689) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2009-12-06 19:15:41 UTC (rev 5690) @@ -14,8 +14,15 @@ package org.vmmagic.unboxed; /** - * To be commented - * + * <p/> + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. The actual method bodies are not used. <br/> + * For further details, see the + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} + * and the + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. + * * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2009-12-03 21:18:57 UTC (rev 5689) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2009-12-06 19:15:41 UTC (rev 5690) @@ -17,7 +17,14 @@ import org.jnode.annotation.Uninterruptible; /** - * To be commented. + * <p/> + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. The actual method bodies are not used. <br/> + * For further details, see the + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} + * and the + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2009-12-11 17:49:14
|
Revision: 5696 http://jnode.svn.sourceforge.net/jnode/?rev=5696&view=rev Author: fduminy Date: 2009-12-11 17:49:06 +0000 (Fri, 11 Dec 2009) Log Message: ----------- - before, VmType and BaseMagicHelper had both definition of magic classes. now, it's centralized in BaseMagicHelper - moved BaseMagicHelper from org.jnode.vm.x86.compiler to org.jnode.vm.classmgr to avoid that classmgr depends on x86 compiler Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java Added Paths: ----------- trunk/core/src/core/org/jnode/vm/classmgr/BaseMagicHelper.java Removed Paths: ------------- trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java Modified: trunk/core/src/core/org/jnode/vm/VmMagic.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmMagic.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/core/org/jnode/vm/VmMagic.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -36,8 +36,8 @@ * Methods in this class can also be called from inside JNode. * * @author Ewout Prangsma (ep...@us...) - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass} to get the list of "magic" classes (including this class). - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod} to get the list of "magic" methods. + * @see {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass} to get the list of "magic" classes (including this class). + * @see {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod} to get the list of "magic" methods. */ @MagicPermission public final class VmMagic { Copied: trunk/core/src/core/org/jnode/vm/classmgr/BaseMagicHelper.java (from rev 5693, trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java) =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/BaseMagicHelper.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/classmgr/BaseMagicHelper.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -0,0 +1,321 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.vm.classmgr; + +import java.util.Map; + +import org.jnode.util.BootableHashMap; +import org.jnode.annotation.SharedStatics; + +/** + * @author Ewout Prangsma (ep...@us...) + */ +public class BaseMagicHelper { + + /** + * Enum of all magic classes. + * + * @author Ewout Prangsma (ep...@us...) + */ + @SharedStatics + public enum MagicClass { + ADDRESS("org.vmmagic.unboxed.Address"), + EXTENT("org.vmmagic.unboxed.Extent"), + OBJECTREFERENCE("org.vmmagic.unboxed.ObjectReference"), + OFFSET("org.vmmagic.unboxed.Offset"), + WORD("org.vmmagic.unboxed.Word"), + ADDRESSARRAY("org.vmmagic.unboxed.AddressArray"), + EXTENTARRAY("org.vmmagic.unboxed.ExtentArray"), + OBJECTREFERENCEARRAY("org.vmmagic.unboxed.ObjectReferenceArray"), + OFFSETARRAY("org.vmmagic.unboxed.OffsetArray"), + WORDARRAY("org.vmmagic.unboxed.WordArray"), + VMMAGIC("org.jnode.vm.VmMagic"); + + /** + * Name of the class + */ + private final String name; + + /** + * Lookup table + */ + private static final Map<String, MagicClass> nameToClass; + + /** + * Initialize this instance. + * + * @param name + */ + private MagicClass(String name) { + this.name = name; + } + + /** + * Initialize the lookup table + */ + static { + nameToClass = new BootableHashMap<String, MagicClass>(); + for (MagicClass mc : values()) { + nameToClass.put(mc.name, mc); + } + } + + /** + * Gets the MagicClass instance for the given type. + * + * @param type + * @return a MagicClass instance + * @throws InternalError When type is no magic type. + */ + public static MagicClass get(VmType<?> type) { + MagicClass mc = nameToClass.get(type.getName()); + if (mc == null) { + throw new InternalError("Unknown magic type " + type.getName()); + } else { + return mc; + } + } + + /** + * Indicate if the given class name corresponds to a magic class. + * + * @param name Name of a class. + * @return true if the class is magic. + */ + static boolean isMagic(String name) { + boolean magic = false; + for (MagicClass mc : values()) { + if (mc.name.equals(name)) { + magic = true; + break; + } + } + return magic; + } + } + + /** + * Enum of all methods in all magic classes. + * + * @author Ewout Prangsma (ep...@us...) + */ + @SharedStatics + public enum MagicMethod { + ADD("add", false), + AND("and", false), + OR("or", false), + NOT("not", false), + SUB("sub", false), + XOR("xor", false), + ZERO("zero", false), + MAX("max", false), + ONE("one", false), + TOINT("toInt", false), + TOLONG("toLong", false), + TOWORD("toWord", false), + TOADDRESS("toAddress", true), + TOEXTENT("toExtent", false), + TOOFFSET("toOffset", false), + TOOBJECTREFERENCE("toObjectReference", true), + EQUALS("equals", false), + ISZERO("isZero", false), + ISMAX("isMax", false), + ISNULL("isNull", false), + EQ("EQ", false), + NE("NE", false), + GT("GT", false), + GE("GE", false), + LT("LT", false), + LE("LE", false), + SGT("sGT", false), + SGE("sGE", false), + SLT("sLT", false), + SLE("sLE", false), + FROMINT("fromInt", false), + FROMINTSIGNEXTEND("fromIntSignExtend", false), + FROMINTZEROEXTEND("fromIntZeroExtend", false), + FROMLONG("fromLong", false), + LSH("lsh", false), + RSHL("rshl", false), + RSHA("rsha", false), + LOADBYTE("loadByte", true, "()B"), + LOADBYTE_OFS("loadByte", true, "(Lorg/vmmagic/unboxed/Offset;)B"), + LOADCHAR("loadChar", true, "()C"), + LOADCHAR_OFS("loadChar", true, "(Lorg/vmmagic/unboxed/Offset;)C"), + LOADSHORT("loadShort", true, "()S"), + LOADSHORT_OFS("loadShort", true, "(Lorg/vmmagic/unboxed/Offset;)S"), + LOADINT("loadInt", true, "()I"), + LOADINT_OFS("loadInt", true, "(Lorg/vmmagic/unboxed/Offset;)I"), + LOADFLOAT("loadFloat", true, "()F"), + LOADFLOAT_OFS("loadFloat", true, "(Lorg/vmmagic/unboxed/Offset;)F"), + LOADLONG("loadLong", true, "()J"), + LOADLONG_OFS("loadLong", true, "(Lorg/vmmagic/unboxed/Offset;)J"), + LOADDOUBLE("loadDouble", true, "()D"), + LOADDOUBLE_OFS("loadDouble", true, "(Lorg/vmmagic/unboxed/Offset;)D"), + LOADADDRESS("loadAddress", true, "()Lorg/vmmagic/unboxed/Address;"), + LOADADDRESS_OFS("loadAddress", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Address;"), + LOADWORD("loadWord", true, "()Lorg/vmmagic/unboxed/Word;"), + LOADWORD_OFS("loadWord", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Word;"), + LOADOBJECTREFERENCE("loadObjectReference", true, "()Lorg/vmmagic/unboxed/ObjectReference;"), + LOADOBJECTREFERENCE_OFS("loadObjectReference", true, + "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/ObjectReference;"), + SIZE("size", false), + STOREBYTE("store", true, "(B)V"), + STOREBYTE_OFS("store", true, "(BLorg/vmmagic/unboxed/Offset;)V"), + STORECHAR("store", true, "(C)V"), + STORECHAR_OFS("store", true, "(CLorg/vmmagic/unboxed/Offset;)V"), + STORESHORT("store", true, "(S)V"), + STORESHORT_OFS("store", true, "(SLorg/vmmagic/unboxed/Offset;)V"), + STOREINT("store", true, "(I)V"), + STOREINT_OFS("store", true, "(ILorg/vmmagic/unboxed/Offset;)V"), + STOREFLOAT("store", true, "(F)V"), + STOREFLOAT_OFS("store", true, "(FLorg/vmmagic/unboxed/Offset;)V"), + STORELONG("store", true, "(J)V"), + STORELONG_OFS("store", true, "(JLorg/vmmagic/unboxed/Offset;)V"), + STOREDOUBLE("store", true, "(D)V"), + STOREDOUBLE_OFS("store", true, "(DLorg/vmmagic/unboxed/Offset;)V"), + STOREADDRESS("store", true, "(Lorg/vmmagic/unboxed/Address;)V"), + STOREADDRESS_OFS("store", true, "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Offset;)V"), + STOREWORD("store", true, "(Lorg/vmmagic/unboxed/Word;)V"), + STOREWORD_OFS("store", true, "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Offset;)V"), + STOREOBJECTREFERENCE("store", true, "(Lorg/vmmagic/unboxed/ObjectReference;)V"), + STOREOBJECTREFERENCE_OFS("store", true, "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/Offset;)V"), + PREPAREINT("prepareInt", true, "()I"), + PREPAREINT_OFS("prepareInt", true, "(Lorg/vmmagic/unboxed/Offset;)I"), + PREPAREADDRESS("prepareAddress", true, "()Lorg/vmmagic/unboxed/Address;"), + PREPAREADDRESS_OFS("prepareAddress", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Address;"), + PREPAREWORD("prepareWord", true, "()Lorg/vmmagic/unboxed/Word;"), + PREPAREWORD_OFS("prepareWord", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Word;"), + PREPAREOBJECTREFERENCE("prepareObjectReference", true, "()Lorg/vmmagic/unboxed/ObjectReference;"), + PREPAREOBJECTREFERENCE_OFS("prepareObjectReference", true, + "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/ObjectReference;"), + ATTEMPTINT("attempt", true, "(II)Z"), + ATTEMPTINT_OFS("attempt", true, "(IILorg/vmmagic/unboxed/Offset;)Z"), + ATTEMPTADDRESS("attempt", true, "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;)Z"), + ATTEMPTADDRESS_OFS("attempt", true, + "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Offset;)Z"), + ATTEMPTOBJECTREFERENCE("attempt", true, + "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/ObjectReference;)Z"), + ATTEMPTOBJECTREFERENCE_OFS("attempt", true, + "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/ObjectReference;" + + "Lorg/vmmagic/unboxed/Offset;)Z"), + ATTEMPTWORD("attempt", true, "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Word;)Z"), + ATTEMPTWORD_OFS("attempt", true, + "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Offset;)Z"), + FROMOBJECT("fromObject", true), + FROMADDRESS("fromAddress", true), + GETOBJECTTYPE("getObjectType", true), + GETTIB("getTIB", true), + GETOBJECTFLAGS("getObjectFlags", true), + SETOBJECTFLAGS("setObjectFlags", true), + TOOBJECT("toObject", true), + GETARRAYDATA("getArrayData", true), + GETOBJECTCOLOR("getObjectColor", true), + ISFINALIZED("isFinalized", true), + ATOMICADD("atomicAdd", true), + ATOMICAND("atomicAnd", true), + ATOMICOR("atomicOr", true), + ATOMICSUB("atomicSub", true), + GETCURRENTFRAME("getCurrentFrame", true), + GETTIMESTAMP("getTimeStamp", true), + INTBITSTOFLOAT("intBitsToFloat", false), + FLOATTORAWINTBITS("floatToRawIntBits", false), + LONGBITSTODOUBLE("longBitsToDouble", false), + DOUBLETORAWLONGBITS("doubleToRawLongBits", false), + BREAKPOINT("breakPoint", true), + DIFF("diff", false), + NULLREFERENCE("nullReference", false), + CURRENTPROCESSOR("currentProcessor", true, "()Lorg/jnode/vm/scheduler/VmProcessor;"), + GETSHAREDSTATICSFIELDADDRESS("getSharedStaticFieldAddress", true), + GETISOLATEDSTATICSFIELDADDRESS("getIsolatedStaticFieldAddress", true), + ISRUNNINGJNODE("isRunningJNode", false, "()Z"), + + // Array classes + ARR_CREATE("create", true), + ARR_GET("get", true), + ARR_SET("set", true), + ARR_LENGTH("length", false); + + private final String name; + private final String signature; + private final boolean permissionRequired; + private static BootableHashMap<VmMethod, MagicMethod> methods = new BootableHashMap<VmMethod, MagicMethod>(); + + private MagicMethod(String name, boolean permissionRequired) { + this.name = name; + this.signature = null; + this.permissionRequired = permissionRequired; + } + + private MagicMethod(String name, boolean permissionRequired, String signature) { + this.name = name; + this.permissionRequired = permissionRequired; + this.signature = signature; + } + + public static MagicMethod get(VmMethod method) { + MagicMethod mm = methods.get(method); + if (mm != null) { + return mm; + } + final String mname = method.getName(); + final String msignature = method.getSignature(); + + for (MagicMethod m : values()) { + if (m.name.equals(mname)) { + if ((m.signature == null) || m.signature.equals(msignature)) { + methods.put(method, m); + return m; + } + + } + } + throw new InternalError("Unknown method " + mname + '#' + msignature + " in " + + method.getDeclaringClass().getName()); + } + + /** + * Is MagicPermission required for this method. + * + * @return + */ + final boolean isPermissionRequired() { + return this.permissionRequired; + } + } + + /** + * Is the given method allowed to call magic code. + * + * @param caller + */ + public static void testMagicPermission(MagicMethod callee, VmMethod caller) + throws SecurityException { + if (callee.isPermissionRequired()) { + if (!caller.getDeclaringClass().isMagicPermissionGranted()) { + System.out.println("MagicPermission is not granted for type: " + + caller.getDeclaringClass().getName()); + // throw new SecurityException("MagicPermission is not granted + // for method: " + caller.getFullName()); + } + } + } +} Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmType.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -302,18 +302,8 @@ throw new IllegalArgumentException("name contains '/'"); } - final String pkg = VMClassHelper.getPackagePortion(name); - if (pkg.equals("org.vmmagic.unboxed") || pkg.equals("org.jnode.vm")) { - final String cname = VMClassHelper.getClassNamePortion(name); - if (cname.equals("Address") || cname.equals("AddressArray") - || cname.equals("Extent") || cname.equals("ExtentArray") - || cname.equals("ObjectReference") - || cname.equals("ObjectReferenceArray") - || cname.equals("Offset") || cname.equals("OffsetArray") - || cname.equals("Word") || cname.equals("WordArray") - | cname.equals("VmMagic")) { - modifiers |= Modifier.ACC_MAGIC; - } + if (BaseMagicHelper.MagicClass.isMagic(name)) { + modifiers |= Modifier.ACC_MAGIC; } this.name = InternString.internString(name); Deleted: trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -1,306 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2009 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.vm.compiler; - -import java.util.Map; - -import org.jnode.util.BootableHashMap; -import org.jnode.vm.classmgr.VmMethod; -import org.jnode.vm.classmgr.VmType; -import org.jnode.annotation.SharedStatics; - -/** - * @author Ewout Prangsma (ep...@us...) - */ -public class BaseMagicHelper { - - /** - * Enum of all magic classes. - * - * @author Ewout Prangsma (ep...@us...) - */ - @SharedStatics - public enum MagicClass { - ADDRESS("org.vmmagic.unboxed.Address"), - EXTENT("org.vmmagic.unboxed.Extent"), - OBJECTREFERENCE("org.vmmagic.unboxed.ObjectReference"), - OFFSET("org.vmmagic.unboxed.Offset"), - WORD("org.vmmagic.unboxed.Word"), - ADDRESSARRAY("org.vmmagic.unboxed.AddressArray"), - EXTENTARRAY("org.vmmagic.unboxed.ExtentArray"), - OBJECTREFERENCEARRAY("org.vmmagic.unboxed.ObjectReferenceArray"), - OFFSETARRAY("org.vmmagic.unboxed.OffsetArray"), - WORDARRAY("org.vmmagic.unboxed.WordArray"), - VMMAGIC("org.jnode.vm.VmMagic"); - - /** - * Name of the class - */ - private final String name; - - /** - * Lookup table - */ - private static final Map<String, MagicClass> nameToClass; - - /** - * Initialize this instance. - * - * @param name - */ - private MagicClass(String name) { - this.name = name; - } - - /** - * Initialize the lookup table - */ - static { - nameToClass = new BootableHashMap<String, MagicClass>(); - for (MagicClass mc : values()) { - nameToClass.put(mc.name, mc); - } - } - - /** - * Gets the MagicClass instance for the given type. - * - * @param type - * @return a MagicClass instance - * @throws InternalError When type is no magic type. - */ - public static MagicClass get(VmType<?> type) { - MagicClass mc = nameToClass.get(type.getName()); - if (mc == null) { - throw new InternalError("Unknown magic type " + type.getName()); - } else { - return mc; - } - } - } - - /** - * Enum of all methods in all magic classes. - * - * @author Ewout Prangsma (ep...@us...) - */ - @SharedStatics - public enum MagicMethod { - ADD("add", false), - AND("and", false), - OR("or", false), - NOT("not", false), - SUB("sub", false), - XOR("xor", false), - ZERO("zero", false), - MAX("max", false), - ONE("one", false), - TOINT("toInt", false), - TOLONG("toLong", false), - TOWORD("toWord", false), - TOADDRESS("toAddress", true), - TOEXTENT("toExtent", false), - TOOFFSET("toOffset", false), - TOOBJECTREFERENCE("toObjectReference", true), - EQUALS("equals", false), - ISZERO("isZero", false), - ISMAX("isMax", false), - ISNULL("isNull", false), - EQ("EQ", false), - NE("NE", false), - GT("GT", false), - GE("GE", false), - LT("LT", false), - LE("LE", false), - SGT("sGT", false), - SGE("sGE", false), - SLT("sLT", false), - SLE("sLE", false), - FROMINT("fromInt", false), - FROMINTSIGNEXTEND("fromIntSignExtend", false), - FROMINTZEROEXTEND("fromIntZeroExtend", false), - FROMLONG("fromLong", false), - LSH("lsh", false), - RSHL("rshl", false), - RSHA("rsha", false), - LOADBYTE("loadByte", true, "()B"), - LOADBYTE_OFS("loadByte", true, "(Lorg/vmmagic/unboxed/Offset;)B"), - LOADCHAR("loadChar", true, "()C"), - LOADCHAR_OFS("loadChar", true, "(Lorg/vmmagic/unboxed/Offset;)C"), - LOADSHORT("loadShort", true, "()S"), - LOADSHORT_OFS("loadShort", true, "(Lorg/vmmagic/unboxed/Offset;)S"), - LOADINT("loadInt", true, "()I"), - LOADINT_OFS("loadInt", true, "(Lorg/vmmagic/unboxed/Offset;)I"), - LOADFLOAT("loadFloat", true, "()F"), - LOADFLOAT_OFS("loadFloat", true, "(Lorg/vmmagic/unboxed/Offset;)F"), - LOADLONG("loadLong", true, "()J"), - LOADLONG_OFS("loadLong", true, "(Lorg/vmmagic/unboxed/Offset;)J"), - LOADDOUBLE("loadDouble", true, "()D"), - LOADDOUBLE_OFS("loadDouble", true, "(Lorg/vmmagic/unboxed/Offset;)D"), - LOADADDRESS("loadAddress", true, "()Lorg/vmmagic/unboxed/Address;"), - LOADADDRESS_OFS("loadAddress", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Address;"), - LOADWORD("loadWord", true, "()Lorg/vmmagic/unboxed/Word;"), - LOADWORD_OFS("loadWord", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Word;"), - LOADOBJECTREFERENCE("loadObjectReference", true, "()Lorg/vmmagic/unboxed/ObjectReference;"), - LOADOBJECTREFERENCE_OFS("loadObjectReference", true, - "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/ObjectReference;"), - SIZE("size", false), - STOREBYTE("store", true, "(B)V"), - STOREBYTE_OFS("store", true, "(BLorg/vmmagic/unboxed/Offset;)V"), - STORECHAR("store", true, "(C)V"), - STORECHAR_OFS("store", true, "(CLorg/vmmagic/unboxed/Offset;)V"), - STORESHORT("store", true, "(S)V"), - STORESHORT_OFS("store", true, "(SLorg/vmmagic/unboxed/Offset;)V"), - STOREINT("store", true, "(I)V"), - STOREINT_OFS("store", true, "(ILorg/vmmagic/unboxed/Offset;)V"), - STOREFLOAT("store", true, "(F)V"), - STOREFLOAT_OFS("store", true, "(FLorg/vmmagic/unboxed/Offset;)V"), - STORELONG("store", true, "(J)V"), - STORELONG_OFS("store", true, "(JLorg/vmmagic/unboxed/Offset;)V"), - STOREDOUBLE("store", true, "(D)V"), - STOREDOUBLE_OFS("store", true, "(DLorg/vmmagic/unboxed/Offset;)V"), - STOREADDRESS("store", true, "(Lorg/vmmagic/unboxed/Address;)V"), - STOREADDRESS_OFS("store", true, "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Offset;)V"), - STOREWORD("store", true, "(Lorg/vmmagic/unboxed/Word;)V"), - STOREWORD_OFS("store", true, "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Offset;)V"), - STOREOBJECTREFERENCE("store", true, "(Lorg/vmmagic/unboxed/ObjectReference;)V"), - STOREOBJECTREFERENCE_OFS("store", true, "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/Offset;)V"), - PREPAREINT("prepareInt", true, "()I"), - PREPAREINT_OFS("prepareInt", true, "(Lorg/vmmagic/unboxed/Offset;)I"), - PREPAREADDRESS("prepareAddress", true, "()Lorg/vmmagic/unboxed/Address;"), - PREPAREADDRESS_OFS("prepareAddress", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Address;"), - PREPAREWORD("prepareWord", true, "()Lorg/vmmagic/unboxed/Word;"), - PREPAREWORD_OFS("prepareWord", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Word;"), - PREPAREOBJECTREFERENCE("prepareObjectReference", true, "()Lorg/vmmagic/unboxed/ObjectReference;"), - PREPAREOBJECTREFERENCE_OFS("prepareObjectReference", true, - "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/ObjectReference;"), - ATTEMPTINT("attempt", true, "(II)Z"), - ATTEMPTINT_OFS("attempt", true, "(IILorg/vmmagic/unboxed/Offset;)Z"), - ATTEMPTADDRESS("attempt", true, "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;)Z"), - ATTEMPTADDRESS_OFS("attempt", true, - "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Offset;)Z"), - ATTEMPTOBJECTREFERENCE("attempt", true, - "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/ObjectReference;)Z"), - ATTEMPTOBJECTREFERENCE_OFS("attempt", true, - "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/ObjectReference;" + - "Lorg/vmmagic/unboxed/Offset;)Z"), - ATTEMPTWORD("attempt", true, "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Word;)Z"), - ATTEMPTWORD_OFS("attempt", true, - "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Offset;)Z"), - FROMOBJECT("fromObject", true), - FROMADDRESS("fromAddress", true), - GETOBJECTTYPE("getObjectType", true), - GETTIB("getTIB", true), - GETOBJECTFLAGS("getObjectFlags", true), - SETOBJECTFLAGS("setObjectFlags", true), - TOOBJECT("toObject", true), - GETARRAYDATA("getArrayData", true), - GETOBJECTCOLOR("getObjectColor", true), - ISFINALIZED("isFinalized", true), - ATOMICADD("atomicAdd", true), - ATOMICAND("atomicAnd", true), - ATOMICOR("atomicOr", true), - ATOMICSUB("atomicSub", true), - GETCURRENTFRAME("getCurrentFrame", true), - GETTIMESTAMP("getTimeStamp", true), - INTBITSTOFLOAT("intBitsToFloat", false), - FLOATTORAWINTBITS("floatToRawIntBits", false), - LONGBITSTODOUBLE("longBitsToDouble", false), - DOUBLETORAWLONGBITS("doubleToRawLongBits", false), - BREAKPOINT("breakPoint", true), - DIFF("diff", false), - NULLREFERENCE("nullReference", false), - CURRENTPROCESSOR("currentProcessor", true, "()Lorg/jnode/vm/scheduler/VmProcessor;"), - GETSHAREDSTATICSFIELDADDRESS("getSharedStaticFieldAddress", true), - GETISOLATEDSTATICSFIELDADDRESS("getIsolatedStaticFieldAddress", true), - ISRUNNINGJNODE("isRunningJNode", false, "()Z"), - - // Array classes - ARR_CREATE("create", true), - ARR_GET("get", true), - ARR_SET("set", true), - ARR_LENGTH("length", false); - - private final String name; - private final String signature; - private final boolean permissionRequired; - private static BootableHashMap<VmMethod, MagicMethod> methods = new BootableHashMap<VmMethod, MagicMethod>(); - - private MagicMethod(String name, boolean permissionRequired) { - this.name = name; - this.signature = null; - this.permissionRequired = permissionRequired; - } - - private MagicMethod(String name, boolean permissionRequired, String signature) { - this.name = name; - this.permissionRequired = permissionRequired; - this.signature = signature; - } - - public static MagicMethod get(VmMethod method) { - MagicMethod mm = methods.get(method); - if (mm != null) { - return mm; - } - final String mname = method.getName(); - final String msignature = method.getSignature(); - - for (MagicMethod m : values()) { - if (m.name.equals(mname)) { - if ((m.signature == null) || m.signature.equals(msignature)) { - methods.put(method, m); - return m; - } - - } - } - throw new InternalError("Unknown method " + mname + '#' + msignature + " in " - + method.getDeclaringClass().getName()); - } - - /** - * Is MagicPermission required for this method. - * - * @return - */ - final boolean isPermissionRequired() { - return this.permissionRequired; - } - } - - /** - * Is the given method allowed to call magic code. - * - * @param caller - */ - public static void testMagicPermission(MagicMethod callee, VmMethod caller) - throws SecurityException { - if (callee.isPermissionRequired()) { - if (!caller.getDeclaringClass().isMagicPermissionGranted()) { - System.out.println("MagicPermission is not granted for type: " - + caller.getDeclaringClass().getName()); - // throw new SecurityException("MagicPermission is not granted - // for method: " + caller.getFullName()); - } - } - } -} Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -23,7 +23,7 @@ import org.jnode.assembler.x86.X86Constants; import org.jnode.assembler.x86.X86Operation; import org.jnode.vm.JvmType; -import org.jnode.vm.compiler.BaseMagicHelper; +import org.jnode.vm.classmgr.BaseMagicHelper; /** * @author Ewout Prangsma (ep...@us...) Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -20,12 +20,12 @@ package org.jnode.vm.x86.compiler.l1a; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.ATTEMPTINT; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.FROMINTZEROEXTEND; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.INTBITSTOFLOAT; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LOADCHAR; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LOADCHAR_OFS; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LONGBITSTODOUBLE; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.ATTEMPTINT; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.FROMINTZEROEXTEND; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.INTBITSTOFLOAT; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LOADCHAR; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LOADCHAR_OFS; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LONGBITSTODOUBLE; import org.jnode.assembler.x86.X86Assembler; import org.jnode.assembler.x86.X86Constants; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -20,12 +20,12 @@ package org.jnode.vm.x86.compiler.l1b; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.ATTEMPTINT; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.FROMINTZEROEXTEND; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.INTBITSTOFLOAT; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LOADCHAR; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LOADCHAR_OFS; -import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LONGBITSTODOUBLE; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.ATTEMPTINT; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.FROMINTZEROEXTEND; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.INTBITSTOFLOAT; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LOADCHAR; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LOADCHAR_OFS; +import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LONGBITSTODOUBLE; import org.jnode.assembler.x86.X86Assembler; import org.jnode.assembler.x86.X86Constants; Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -24,9 +24,9 @@ * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. The actual method bodies are not used. <br/> * For further details, see the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} + * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass list of "magic" classes} * and the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. + * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -18,9 +18,9 @@ * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. The actual method bodies are not used. <br/> * For further details, see the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} + * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass list of "magic" classes} * and the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. + * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -19,9 +19,9 @@ * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. The actual method bodies are not used. <br/> * For further details, see the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} + * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass list of "magic" classes} * and the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. + * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2009-12-11 00:14:12 UTC (rev 5695) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2009-12-11 17:49:06 UTC (rev 5696) @@ -22,9 +22,9 @@ * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. The actual method bodies are not used. <br/> * For further details, see the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} + * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass list of "magic" classes} * and the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. + * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2009-12-12 16:15:13
|
Revision: 5697 http://jnode.svn.sourceforge.net/jnode/?rev=5697&view=rev Author: fduminy Date: 2009-12-12 16:15:04 +0000 (Sat, 12 Dec 2009) Log Message: ----------- reverted changes in r5696 Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java Added Paths: ----------- trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java Modified: trunk/core/src/core/org/jnode/vm/VmMagic.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmMagic.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/core/org/jnode/vm/VmMagic.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -36,8 +36,8 @@ * Methods in this class can also be called from inside JNode. * * @author Ewout Prangsma (ep...@us...) - * @see {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass} to get the list of "magic" classes (including this class). - * @see {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod} to get the list of "magic" methods. + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass} to get the list of "magic" classes (including this class). + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod} to get the list of "magic" methods. */ @MagicPermission public final class VmMagic { Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmType.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -302,8 +302,18 @@ throw new IllegalArgumentException("name contains '/'"); } - if (BaseMagicHelper.MagicClass.isMagic(name)) { - modifiers |= Modifier.ACC_MAGIC; + final String pkg = VMClassHelper.getPackagePortion(name); + if (pkg.equals("org.vmmagic.unboxed") || pkg.equals("org.jnode.vm")) { + final String cname = VMClassHelper.getClassNamePortion(name); + if (cname.equals("Address") || cname.equals("AddressArray") + || cname.equals("Extent") || cname.equals("ExtentArray") + || cname.equals("ObjectReference") + || cname.equals("ObjectReferenceArray") + || cname.equals("Offset") || cname.equals("OffsetArray") + || cname.equals("Word") || cname.equals("WordArray") + | cname.equals("VmMagic")) { + modifiers |= Modifier.ACC_MAGIC; + } } this.name = InternString.internString(name); Added: trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -0,0 +1,306 @@ +/* + * $Id: BaseMagicHelper.java 5226 2009-04-06 14:55:27Z lsantha $ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.vm.compiler; + +import java.util.Map; + +import org.jnode.util.BootableHashMap; +import org.jnode.vm.classmgr.VmMethod; +import org.jnode.vm.classmgr.VmType; +import org.jnode.annotation.SharedStatics; + +/** + * @author Ewout Prangsma (ep...@us...) + */ +public class BaseMagicHelper { + + /** + * Enum of all magic classes. + * + * @author Ewout Prangsma (ep...@us...) + */ + @SharedStatics + public enum MagicClass { + ADDRESS("org.vmmagic.unboxed.Address"), + EXTENT("org.vmmagic.unboxed.Extent"), + OBJECTREFERENCE("org.vmmagic.unboxed.ObjectReference"), + OFFSET("org.vmmagic.unboxed.Offset"), + WORD("org.vmmagic.unboxed.Word"), + ADDRESSARRAY("org.vmmagic.unboxed.AddressArray"), + EXTENTARRAY("org.vmmagic.unboxed.ExtentArray"), + OBJECTREFERENCEARRAY("org.vmmagic.unboxed.ObjectReferenceArray"), + OFFSETARRAY("org.vmmagic.unboxed.OffsetArray"), + WORDARRAY("org.vmmagic.unboxed.WordArray"), + VMMAGIC("org.jnode.vm.VmMagic"); + + /** + * Name of the class + */ + private final String name; + + /** + * Lookup table + */ + private static final Map<String, MagicClass> nameToClass; + + /** + * Initialize this instance. + * + * @param name + */ + private MagicClass(String name) { + this.name = name; + } + + /** + * Initialize the lookup table + */ + static { + nameToClass = new BootableHashMap<String, MagicClass>(); + for (MagicClass mc : values()) { + nameToClass.put(mc.name, mc); + } + } + + /** + * Gets the MagicClass instance for the given type. + * + * @param type + * @return a MagicClass instance + * @throws InternalError When type is no magic type. + */ + public static MagicClass get(VmType<?> type) { + MagicClass mc = nameToClass.get(type.getName()); + if (mc == null) { + throw new InternalError("Unknown magic type " + type.getName()); + } else { + return mc; + } + } + } + + /** + * Enum of all methods in all magic classes. + * + * @author Ewout Prangsma (ep...@us...) + */ + @SharedStatics + public enum MagicMethod { + ADD("add", false), + AND("and", false), + OR("or", false), + NOT("not", false), + SUB("sub", false), + XOR("xor", false), + ZERO("zero", false), + MAX("max", false), + ONE("one", false), + TOINT("toInt", false), + TOLONG("toLong", false), + TOWORD("toWord", false), + TOADDRESS("toAddress", true), + TOEXTENT("toExtent", false), + TOOFFSET("toOffset", false), + TOOBJECTREFERENCE("toObjectReference", true), + EQUALS("equals", false), + ISZERO("isZero", false), + ISMAX("isMax", false), + ISNULL("isNull", false), + EQ("EQ", false), + NE("NE", false), + GT("GT", false), + GE("GE", false), + LT("LT", false), + LE("LE", false), + SGT("sGT", false), + SGE("sGE", false), + SLT("sLT", false), + SLE("sLE", false), + FROMINT("fromInt", false), + FROMINTSIGNEXTEND("fromIntSignExtend", false), + FROMINTZEROEXTEND("fromIntZeroExtend", false), + FROMLONG("fromLong", false), + LSH("lsh", false), + RSHL("rshl", false), + RSHA("rsha", false), + LOADBYTE("loadByte", true, "()B"), + LOADBYTE_OFS("loadByte", true, "(Lorg/vmmagic/unboxed/Offset;)B"), + LOADCHAR("loadChar", true, "()C"), + LOADCHAR_OFS("loadChar", true, "(Lorg/vmmagic/unboxed/Offset;)C"), + LOADSHORT("loadShort", true, "()S"), + LOADSHORT_OFS("loadShort", true, "(Lorg/vmmagic/unboxed/Offset;)S"), + LOADINT("loadInt", true, "()I"), + LOADINT_OFS("loadInt", true, "(Lorg/vmmagic/unboxed/Offset;)I"), + LOADFLOAT("loadFloat", true, "()F"), + LOADFLOAT_OFS("loadFloat", true, "(Lorg/vmmagic/unboxed/Offset;)F"), + LOADLONG("loadLong", true, "()J"), + LOADLONG_OFS("loadLong", true, "(Lorg/vmmagic/unboxed/Offset;)J"), + LOADDOUBLE("loadDouble", true, "()D"), + LOADDOUBLE_OFS("loadDouble", true, "(Lorg/vmmagic/unboxed/Offset;)D"), + LOADADDRESS("loadAddress", true, "()Lorg/vmmagic/unboxed/Address;"), + LOADADDRESS_OFS("loadAddress", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Address;"), + LOADWORD("loadWord", true, "()Lorg/vmmagic/unboxed/Word;"), + LOADWORD_OFS("loadWord", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Word;"), + LOADOBJECTREFERENCE("loadObjectReference", true, "()Lorg/vmmagic/unboxed/ObjectReference;"), + LOADOBJECTREFERENCE_OFS("loadObjectReference", true, + "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/ObjectReference;"), + SIZE("size", false), + STOREBYTE("store", true, "(B)V"), + STOREBYTE_OFS("store", true, "(BLorg/vmmagic/unboxed/Offset;)V"), + STORECHAR("store", true, "(C)V"), + STORECHAR_OFS("store", true, "(CLorg/vmmagic/unboxed/Offset;)V"), + STORESHORT("store", true, "(S)V"), + STORESHORT_OFS("store", true, "(SLorg/vmmagic/unboxed/Offset;)V"), + STOREINT("store", true, "(I)V"), + STOREINT_OFS("store", true, "(ILorg/vmmagic/unboxed/Offset;)V"), + STOREFLOAT("store", true, "(F)V"), + STOREFLOAT_OFS("store", true, "(FLorg/vmmagic/unboxed/Offset;)V"), + STORELONG("store", true, "(J)V"), + STORELONG_OFS("store", true, "(JLorg/vmmagic/unboxed/Offset;)V"), + STOREDOUBLE("store", true, "(D)V"), + STOREDOUBLE_OFS("store", true, "(DLorg/vmmagic/unboxed/Offset;)V"), + STOREADDRESS("store", true, "(Lorg/vmmagic/unboxed/Address;)V"), + STOREADDRESS_OFS("store", true, "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Offset;)V"), + STOREWORD("store", true, "(Lorg/vmmagic/unboxed/Word;)V"), + STOREWORD_OFS("store", true, "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Offset;)V"), + STOREOBJECTREFERENCE("store", true, "(Lorg/vmmagic/unboxed/ObjectReference;)V"), + STOREOBJECTREFERENCE_OFS("store", true, "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/Offset;)V"), + PREPAREINT("prepareInt", true, "()I"), + PREPAREINT_OFS("prepareInt", true, "(Lorg/vmmagic/unboxed/Offset;)I"), + PREPAREADDRESS("prepareAddress", true, "()Lorg/vmmagic/unboxed/Address;"), + PREPAREADDRESS_OFS("prepareAddress", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Address;"), + PREPAREWORD("prepareWord", true, "()Lorg/vmmagic/unboxed/Word;"), + PREPAREWORD_OFS("prepareWord", true, "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/Word;"), + PREPAREOBJECTREFERENCE("prepareObjectReference", true, "()Lorg/vmmagic/unboxed/ObjectReference;"), + PREPAREOBJECTREFERENCE_OFS("prepareObjectReference", true, + "(Lorg/vmmagic/unboxed/Offset;)Lorg/vmmagic/unboxed/ObjectReference;"), + ATTEMPTINT("attempt", true, "(II)Z"), + ATTEMPTINT_OFS("attempt", true, "(IILorg/vmmagic/unboxed/Offset;)Z"), + ATTEMPTADDRESS("attempt", true, "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;)Z"), + ATTEMPTADDRESS_OFS("attempt", true, + "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Offset;)Z"), + ATTEMPTOBJECTREFERENCE("attempt", true, + "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/ObjectReference;)Z"), + ATTEMPTOBJECTREFERENCE_OFS("attempt", true, + "(Lorg/vmmagic/unboxed/ObjectReference;Lorg/vmmagic/unboxed/ObjectReference;" + + "Lorg/vmmagic/unboxed/Offset;)Z"), + ATTEMPTWORD("attempt", true, "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Word;)Z"), + ATTEMPTWORD_OFS("attempt", true, + "(Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Word;Lorg/vmmagic/unboxed/Offset;)Z"), + FROMOBJECT("fromObject", true), + FROMADDRESS("fromAddress", true), + GETOBJECTTYPE("getObjectType", true), + GETTIB("getTIB", true), + GETOBJECTFLAGS("getObjectFlags", true), + SETOBJECTFLAGS("setObjectFlags", true), + TOOBJECT("toObject", true), + GETARRAYDATA("getArrayData", true), + GETOBJECTCOLOR("getObjectColor", true), + ISFINALIZED("isFinalized", true), + ATOMICADD("atomicAdd", true), + ATOMICAND("atomicAnd", true), + ATOMICOR("atomicOr", true), + ATOMICSUB("atomicSub", true), + GETCURRENTFRAME("getCurrentFrame", true), + GETTIMESTAMP("getTimeStamp", true), + INTBITSTOFLOAT("intBitsToFloat", false), + FLOATTORAWINTBITS("floatToRawIntBits", false), + LONGBITSTODOUBLE("longBitsToDouble", false), + DOUBLETORAWLONGBITS("doubleToRawLongBits", false), + BREAKPOINT("breakPoint", true), + DIFF("diff", false), + NULLREFERENCE("nullReference", false), + CURRENTPROCESSOR("currentProcessor", true, "()Lorg/jnode/vm/scheduler/VmProcessor;"), + GETSHAREDSTATICSFIELDADDRESS("getSharedStaticFieldAddress", true), + GETISOLATEDSTATICSFIELDADDRESS("getIsolatedStaticFieldAddress", true), + ISRUNNINGJNODE("isRunningJNode", false, "()Z"), + + // Array classes + ARR_CREATE("create", true), + ARR_GET("get", true), + ARR_SET("set", true), + ARR_LENGTH("length", false); + + private final String name; + private final String signature; + private final boolean permissionRequired; + private static BootableHashMap<VmMethod, MagicMethod> methods = new BootableHashMap<VmMethod, MagicMethod>(); + + private MagicMethod(String name, boolean permissionRequired) { + this.name = name; + this.signature = null; + this.permissionRequired = permissionRequired; + } + + private MagicMethod(String name, boolean permissionRequired, String signature) { + this.name = name; + this.permissionRequired = permissionRequired; + this.signature = signature; + } + + public static MagicMethod get(VmMethod method) { + MagicMethod mm = methods.get(method); + if (mm != null) { + return mm; + } + final String mname = method.getName(); + final String msignature = method.getSignature(); + + for (MagicMethod m : values()) { + if (m.name.equals(mname)) { + if ((m.signature == null) || m.signature.equals(msignature)) { + methods.put(method, m); + return m; + } + + } + } + throw new InternalError("Unknown method " + mname + '#' + msignature + " in " + + method.getDeclaringClass().getName()); + } + + /** + * Is MagicPermission required for this method. + * + * @return + */ + final boolean isPermissionRequired() { + return this.permissionRequired; + } + } + + /** + * Is the given method allowed to call magic code. + * + * @param caller + */ + public static void testMagicPermission(MagicMethod callee, VmMethod caller) + throws SecurityException { + if (callee.isPermissionRequired()) { + if (!caller.getDeclaringClass().isMagicPermissionGranted()) { + System.out.println("MagicPermission is not granted for type: " + + caller.getDeclaringClass().getName()); + // throw new SecurityException("MagicPermission is not granted + // for method: " + caller.getFullName()); + } + } + } +} Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -23,7 +23,7 @@ import org.jnode.assembler.x86.X86Constants; import org.jnode.assembler.x86.X86Operation; import org.jnode.vm.JvmType; -import org.jnode.vm.classmgr.BaseMagicHelper; +import org.jnode.vm.compiler.BaseMagicHelper; /** * @author Ewout Prangsma (ep...@us...) Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -20,12 +20,12 @@ package org.jnode.vm.x86.compiler.l1a; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.ATTEMPTINT; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.FROMINTZEROEXTEND; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.INTBITSTOFLOAT; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LOADCHAR; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LOADCHAR_OFS; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LONGBITSTODOUBLE; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.ATTEMPTINT; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.FROMINTZEROEXTEND; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.INTBITSTOFLOAT; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LOADCHAR; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LOADCHAR_OFS; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LONGBITSTODOUBLE; import org.jnode.assembler.x86.X86Assembler; import org.jnode.assembler.x86.X86Constants; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -20,12 +20,12 @@ package org.jnode.vm.x86.compiler.l1b; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.ATTEMPTINT; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.FROMINTZEROEXTEND; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.INTBITSTOFLOAT; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LOADCHAR; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LOADCHAR_OFS; -import static org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod.LONGBITSTODOUBLE; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.ATTEMPTINT; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.FROMINTZEROEXTEND; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.INTBITSTOFLOAT; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LOADCHAR; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LOADCHAR_OFS; +import static org.jnode.vm.compiler.BaseMagicHelper.MagicMethod.LONGBITSTODOUBLE; import org.jnode.assembler.x86.X86Assembler; import org.jnode.assembler.x86.X86Constants; Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -24,9 +24,9 @@ * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. The actual method bodies are not used. <br/> * For further details, see the - * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass list of "magic" classes} + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} * and the - * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod list of "magic" methods}. + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -18,9 +18,9 @@ * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. The actual method bodies are not used. <br/> * For further details, see the - * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass list of "magic" classes} + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} * and the - * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod list of "magic" methods}. + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -19,9 +19,9 @@ * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. The actual method bodies are not used. <br/> * For further details, see the - * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass list of "magic" classes} + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} * and the - * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod list of "magic" methods}. + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2009-12-11 17:49:06 UTC (rev 5696) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2009-12-12 16:15:04 UTC (rev 5697) @@ -22,9 +22,9 @@ * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. The actual method bodies are not used. <br/> * For further details, see the - * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicClass list of "magic" classes} + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} * and the - * {@link org.jnode.vm.classmgr.BaseMagicHelper.MagicMethod list of "magic" methods}. + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. * * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-01-03 11:46:58
|
Revision: 5709 http://jnode.svn.sourceforge.net/jnode/?rev=5709&view=rev Author: lsantha Date: 2010-01-03 11:46:38 +0000 (Sun, 03 Jan 2010) Log Message: ----------- Updated file headers. Modified Paths: -------------- trunk/core/src/classpath/ext/java/nio/channels/LinkChannel.java trunk/core/src/classpath/ext/java/util/prefs/TransientPreferences.java trunk/core/src/classpath/ext/javax/cache/Cache.java trunk/core/src/classpath/ext/javax/cache/CacheEntry.java trunk/core/src/classpath/ext/javax/cache/CacheException.java trunk/core/src/classpath/ext/javax/cache/CacheFactory.java trunk/core/src/classpath/ext/javax/cache/CacheListener.java trunk/core/src/classpath/ext/javax/cache/CacheLoader.java trunk/core/src/classpath/ext/javax/cache/CacheManager.java trunk/core/src/classpath/ext/javax/cache/CacheStatistics.java trunk/core/src/classpath/ext/javax/cache/EvictionStrategy.java trunk/core/src/classpath/ext/javax/isolate/AbstractLinkMessageHandler.java trunk/core/src/classpath/ext/javax/isolate/ClosedLinkException.java trunk/core/src/classpath/ext/javax/isolate/Isolate.java trunk/core/src/classpath/ext/javax/isolate/IsolatePermission.java trunk/core/src/classpath/ext/javax/isolate/IsolateStartupException.java trunk/core/src/classpath/ext/javax/isolate/IsolateStatus.java trunk/core/src/classpath/ext/javax/isolate/Link.java trunk/core/src/classpath/ext/javax/isolate/LinkMessage.java trunk/core/src/classpath/ext/javax/isolate/LinkMessageDispatcher.java trunk/core/src/classpath/ext/javax/isolate/LinkMessageHandler.java trunk/core/src/classpath/ext/javax/isolate/StreamBindings.java trunk/core/src/classpath/vm/gnu/classpath/NativeSystemProperties.java trunk/core/src/classpath/vm/gnu/classpath/NativeVMStackWalker.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/JNodeSocketTransport.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMFrame.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMMethod.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/NativeTransportFactory.java trunk/core/src/classpath/vm/gnu/java/security/action/GetEnvAction.java trunk/core/src/classpath/vm/gnu/java/security/action/GetPolicyAction.java trunk/core/src/classpath/vm/gnu/java/security/action/GetPropertiesAction.java trunk/core/src/classpath/vm/gnu/java/security/action/InvokeAction.java trunk/core/src/classpath/vm/gnu/java/security/action/SetPropertyAction.java trunk/core/src/classpath/vm/gnu/java/security/util/SimplePermissionCollection.java trunk/core/src/classpath/vm/java/awt/VMAwtAPI.java trunk/core/src/classpath/vm/java/awt/image/VMImageAPI.java trunk/core/src/classpath/vm/java/awt/image/VMImageUtils.java trunk/core/src/classpath/vm/java/lang/NativeClassLoader.java trunk/core/src/classpath/vm/java/lang/NativeSecurityManager.java trunk/core/src/classpath/vm/java/lang/NativeThread.java trunk/core/src/classpath/vm/java/lang/NativeVMClassLoader.java trunk/core/src/classpath/vm/java/lang/ThreadHelper.java trunk/core/src/classpath/vm/java/lang/VMRuntime.java trunk/core/src/classpath/vm/java/lang/VMSecurityManager.java trunk/core/src/classpath/vm/java/net/ExSocketOptions.java trunk/core/src/classpath/vm/java/net/VMInetAddress.java trunk/core/src/classpath/vm/java/net/VMNetAPI.java trunk/core/src/classpath/vm/java/net/VMNetDevice.java trunk/core/src/classpath/vm/java/net/VMNetUtils.java trunk/core/src/classpath/vm/java/net/VMNetworkInterface.java trunk/core/src/classpath/vm/java/nio/MemoryRawData.java trunk/core/src/classpath/vm/java/nio/NativeVMDirectByteBuffer.java trunk/core/src/classpath/vm/java/nio/channels/NativeVMChannels.java trunk/core/src/classpath/vm/java/security/NativeAccessControlContext.java trunk/core/src/classpath/vm/java/security/NativeAccessController.java trunk/core/src/classpath/vm/java/security/VMSecureRandom.java trunk/core/src/classpath/vm/javax/imageio/spi/NativeIIORegistry.java trunk/core/src/core/org/jnode/assembler/BootImageNativeStream.java trunk/core/src/core/org/jnode/assembler/Label.java trunk/core/src/core/org/jnode/assembler/NativeStream.java trunk/core/src/core/org/jnode/assembler/ObjectResolver.java trunk/core/src/core/org/jnode/assembler/UnresolvedObjectRefException.java trunk/core/src/core/org/jnode/assembler/x86/InvalidOpcodeException.java trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86Constants.java trunk/core/src/core/org/jnode/assembler/x86/X86Operation.java trunk/core/src/core/org/jnode/assembler/x86/X86Register.java trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86Utils.java trunk/core/src/core/org/jnode/boot/InitJarProcessor.java trunk/core/src/core/org/jnode/boot/Main.java trunk/core/src/core/org/jnode/boot/MemoryResourceInputStream.java trunk/core/src/core/org/jnode/boot/NoCloseInputStream.java trunk/core/src/core/org/jnode/debug/RemoteAppender.java trunk/core/src/core/org/jnode/debug/RemoteReceiver.java trunk/core/src/core/org/jnode/debug/UDPOutputStream.java trunk/core/src/core/org/jnode/debugger/DebugState.java trunk/core/src/core/org/jnode/debugger/Debugger.java trunk/core/src/core/org/jnode/debugger/DebuggerPlugin.java trunk/core/src/core/org/jnode/debugger/DebuggerUtils.java trunk/core/src/core/org/jnode/debugger/RootState.java trunk/core/src/core/org/jnode/debugger/ThreadListState.java trunk/core/src/core/org/jnode/debugger/ThreadState.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoder.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoderAdapter.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGException.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReader.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReaderSpi.java trunk/core/src/core/org/jnode/log4j/config/JNodeSystemAppender.java trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java trunk/core/src/core/org/jnode/log4j/config/UnsafeDebugAppender.java trunk/core/src/core/org/jnode/log4j/config/VirtualConsoleAppender.java trunk/core/src/core/org/jnode/naming/AbstractNameSpace.java trunk/core/src/core/org/jnode/naming/DefaultNameSpace.java trunk/core/src/core/org/jnode/naming/InitialNaming.java trunk/core/src/core/org/jnode/naming/NameSpace.java trunk/core/src/core/org/jnode/naming/NameSpaceListener.java trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java trunk/core/src/core/org/jnode/plugin/ConfigurationElement.java trunk/core/src/core/org/jnode/plugin/Extension.java trunk/core/src/core/org/jnode/plugin/ExtensionPoint.java trunk/core/src/core/org/jnode/plugin/ExtensionPointListener.java trunk/core/src/core/org/jnode/plugin/FragmentDescriptor.java trunk/core/src/core/org/jnode/plugin/Library.java trunk/core/src/core/org/jnode/plugin/Plugin.java trunk/core/src/core/org/jnode/plugin/PluginClassLoader.java trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java trunk/core/src/core/org/jnode/plugin/PluginDescriptorListener.java trunk/core/src/core/org/jnode/plugin/PluginException.java trunk/core/src/core/org/jnode/plugin/PluginLoader.java trunk/core/src/core/org/jnode/plugin/PluginLoaderManager.java trunk/core/src/core/org/jnode/plugin/PluginManager.java trunk/core/src/core/org/jnode/plugin/PluginPrerequisite.java trunk/core/src/core/org/jnode/plugin/PluginReference.java trunk/core/src/core/org/jnode/plugin/PluginRegistry.java trunk/core/src/core/org/jnode/plugin/PluginSecurityConstants.java trunk/core/src/core/org/jnode/plugin/PluginUtils.java trunk/core/src/core/org/jnode/plugin/Runtime.java trunk/core/src/core/org/jnode/plugin/URLPluginLoader.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginLoaderManager.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java trunk/core/src/core/org/jnode/plugin/model/AbstractModelObject.java trunk/core/src/core/org/jnode/plugin/model/AttributeModel.java trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java trunk/core/src/core/org/jnode/plugin/model/EmptyPlugin.java trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java trunk/core/src/core/org/jnode/plugin/model/Factory.java trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginJar.java trunk/core/src/core/org/jnode/plugin/model/PluginModelObject.java trunk/core/src/core/org/jnode/plugin/model/PluginPrerequisiteModel.java trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginsClassLoader.java trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java trunk/core/src/core/org/jnode/protocol/plugin/Handler.java trunk/core/src/core/org/jnode/protocol/plugin/PluginURLConnection.java trunk/core/src/core/org/jnode/protocol/system/Handler.java trunk/core/src/core/org/jnode/protocol/system/SystemURLConnection.java trunk/core/src/core/org/jnode/security/JNodePermission.java trunk/core/src/core/org/jnode/security/JNodePolicy.java trunk/core/src/core/org/jnode/security/JNodeSecurityManager.java trunk/core/src/core/org/jnode/security/SecurityPlugin.java trunk/core/src/core/org/jnode/system/BootLog.java trunk/core/src/core/org/jnode/system/DMAException.java trunk/core/src/core/org/jnode/system/DMAManager.java trunk/core/src/core/org/jnode/system/DMAResource.java trunk/core/src/core/org/jnode/system/IOResource.java trunk/core/src/core/org/jnode/system/IRQHandler.java trunk/core/src/core/org/jnode/system/IRQResource.java trunk/core/src/core/org/jnode/system/MemoryResource.java trunk/core/src/core/org/jnode/system/MemoryScanner.java trunk/core/src/core/org/jnode/system/MultiMediaMemoryResource.java trunk/core/src/core/org/jnode/system/Resource.java trunk/core/src/core/org/jnode/system/ResourceManager.java trunk/core/src/core/org/jnode/system/ResourceNotFreeException.java trunk/core/src/core/org/jnode/system/ResourceOwner.java trunk/core/src/core/org/jnode/system/ResourcePermission.java trunk/core/src/core/org/jnode/system/SimpleResourceOwner.java trunk/core/src/core/org/jnode/system/event/FocusEvent.java trunk/core/src/core/org/jnode/system/event/FocusListener.java trunk/core/src/core/org/jnode/system/event/SystemEvent.java trunk/core/src/core/org/jnode/system/repository/Repository.java trunk/core/src/core/org/jnode/system/repository/RepositoryPlugin.java trunk/core/src/core/org/jnode/system/repository/RepositoryPluginLoader.java trunk/core/src/core/org/jnode/system/repository/SystemRepository.java trunk/core/src/core/org/jnode/system/repository/SystemRepositoryPlugin.java trunk/core/src/core/org/jnode/system/repository/plugins/PluginLoaderPlugin.java trunk/core/src/core/org/jnode/system/repository/spi/SystemRepositoryProvider.java trunk/core/src/core/org/jnode/system/x86/DMA.java trunk/core/src/core/org/jnode/system/x86/DMAConstants.java trunk/core/src/core/org/jnode/system/x86/DMAPlugin.java trunk/core/src/core/org/jnode/system/x86/X86DMAChannel.java trunk/core/src/core/org/jnode/util/AccessControllerUtils.java trunk/core/src/core/org/jnode/util/BCDUtils.java trunk/core/src/core/org/jnode/util/BeanUtils.java trunk/core/src/core/org/jnode/util/BigEndian.java trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java trunk/core/src/core/org/jnode/util/BooleanUtils.java trunk/core/src/core/org/jnode/util/BootableArrayList.java trunk/core/src/core/org/jnode/util/BootableHashMap.java trunk/core/src/core/org/jnode/util/ByteBufferInputStream.java trunk/core/src/core/org/jnode/util/ByteBufferUtils.java trunk/core/src/core/org/jnode/util/ByteQueue.java trunk/core/src/core/org/jnode/util/ByteQueueProcessor.java trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java trunk/core/src/core/org/jnode/util/ChannelInputStream.java trunk/core/src/core/org/jnode/util/ChannelOutputStream.java trunk/core/src/core/org/jnode/util/Command.java trunk/core/src/core/org/jnode/util/ConsoleStream.java trunk/core/src/core/org/jnode/util/Counter.java trunk/core/src/core/org/jnode/util/CounterGroup.java trunk/core/src/core/org/jnode/util/DecimalScaleFactor.java trunk/core/src/core/org/jnode/util/EmptyInputStream.java trunk/core/src/core/org/jnode/util/FileUtils.java trunk/core/src/core/org/jnode/util/IOUtils.java trunk/core/src/core/org/jnode/util/JarBuffer.java trunk/core/src/core/org/jnode/util/JarConstants.java trunk/core/src/core/org/jnode/util/LittleEndian.java trunk/core/src/core/org/jnode/util/NumberUtils.java trunk/core/src/core/org/jnode/util/ObjectArrayIterator.java trunk/core/src/core/org/jnode/util/ObjectUtils.java trunk/core/src/core/org/jnode/util/OsUtils.java trunk/core/src/core/org/jnode/util/PipeStream.java trunk/core/src/core/org/jnode/util/ProxyStream.java trunk/core/src/core/org/jnode/util/ProxyStreamException.java trunk/core/src/core/org/jnode/util/Queue.java trunk/core/src/core/org/jnode/util/QueueProcessor.java trunk/core/src/core/org/jnode/util/QueueProcessorThread.java trunk/core/src/core/org/jnode/util/ReaderInputStream.java trunk/core/src/core/org/jnode/util/ScaleFactor.java trunk/core/src/core/org/jnode/util/SizeUnit.java trunk/core/src/core/org/jnode/util/Statistic.java trunk/core/src/core/org/jnode/util/Statistics.java trunk/core/src/core/org/jnode/util/StopWatch.java trunk/core/src/core/org/jnode/util/SynchronizedCounter.java trunk/core/src/core/org/jnode/util/SystemInputStream.java trunk/core/src/core/org/jnode/util/TimeUtils.java trunk/core/src/core/org/jnode/util/TimeoutException.java trunk/core/src/core/org/jnode/util/Token.java trunk/core/src/core/org/jnode/util/WriterOutputStream.java trunk/core/src/core/org/jnode/vm/AllocationBitmap.java trunk/core/src/core/org/jnode/vm/BootableObject.java trunk/core/src/core/org/jnode/vm/CpuID.java trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java trunk/core/src/core/org/jnode/vm/IOContext.java trunk/core/src/core/org/jnode/vm/IOResourceImpl.java trunk/core/src/core/org/jnode/vm/InternString.java trunk/core/src/core/org/jnode/vm/JvmType.java trunk/core/src/core/org/jnode/vm/LoadCompileService.java trunk/core/src/core/org/jnode/vm/LoadCompileThread.java trunk/core/src/core/org/jnode/vm/MathSupport.java trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java trunk/core/src/core/org/jnode/vm/MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/MemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/MemoryScannerImpl.java trunk/core/src/core/org/jnode/vm/MultiMediaMemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/ObjectVisitor.java trunk/core/src/core/org/jnode/vm/RTCService.java trunk/core/src/core/org/jnode/vm/Region.java trunk/core/src/core/org/jnode/vm/ResourceLoader.java trunk/core/src/core/org/jnode/vm/ResourceManagerImpl.java trunk/core/src/core/org/jnode/vm/SoftByteCodes.java trunk/core/src/core/org/jnode/vm/Unsafe.java trunk/core/src/core/org/jnode/vm/VirtualMemoryRegion.java trunk/core/src/core/org/jnode/vm/Vm.java trunk/core/src/core/org/jnode/vm/VmAbstractClassLoader.java trunk/core/src/core/org/jnode/vm/VmAccessControlContext.java trunk/core/src/core/org/jnode/vm/VmAccessController.java trunk/core/src/core/org/jnode/vm/VmAddress.java trunk/core/src/core/org/jnode/vm/VmArchitecture.java trunk/core/src/core/org/jnode/vm/VmExit.java trunk/core/src/core/org/jnode/vm/VmIOContext.java trunk/core/src/core/org/jnode/vm/VmJavaClassLoader.java trunk/core/src/core/org/jnode/vm/VmJavaMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/core/org/jnode/vm/VmMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/VmProcess.java trunk/core/src/core/org/jnode/vm/VmProcessClassLoader.java trunk/core/src/core/org/jnode/vm/VmReflection.java trunk/core/src/core/org/jnode/vm/VmStackFrame.java trunk/core/src/core/org/jnode/vm/VmStackFrameEnumerator.java trunk/core/src/core/org/jnode/vm/VmStackReader.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java trunk/core/src/core/org/jnode/vm/VmSystemObject.java trunk/core/src/core/org/jnode/vm/VmUtils.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeFlags.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeParser.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeViewer.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeVisitorSupport.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeWriter.java trunk/core/src/core/org/jnode/vm/bytecode/ControlFlowGraph.java trunk/core/src/core/org/jnode/vm/bytecode/DelegatingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/bytecode/StackException.java trunk/core/src/core/org/jnode/vm/bytecode/TypeStack.java trunk/core/src/core/org/jnode/vm/classmgr/AbstractCode.java trunk/core/src/core/org/jnode/vm/classmgr/AbstractExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/CompiledCodeList.java trunk/core/src/core/org/jnode/vm/classmgr/IMTBuilder.java trunk/core/src/core/org/jnode/vm/classmgr/MethodPragmaFlags.java trunk/core/src/core/org/jnode/vm/classmgr/Modifier.java trunk/core/src/core/org/jnode/vm/classmgr/NotResolvedYetException.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectFlags.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.java trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java trunk/core/src/core/org/jnode/vm/classmgr/Signature.java trunk/core/src/core/org/jnode/vm/classmgr/TIBBuilder.java trunk/core/src/core/org/jnode/vm/classmgr/TIBLayout.java trunk/core/src/core/org/jnode/vm/classmgr/TypePragmaFlags.java trunk/core/src/core/org/jnode/vm/classmgr/TypeSizeInfo.java trunk/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java trunk/core/src/core/org/jnode/vm/classmgr/VmArray.java trunk/core/src/core/org/jnode/vm/classmgr/VmArrayClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmByteCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmCP.java trunk/core/src/core/org/jnode/vm/classmgr/VmClassLoader.java trunk/core/src/core/org/jnode/vm/classmgr/VmClassType.java trunk/core/src/core/org/jnode/vm/classmgr/VmCompiledCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmCompiledExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstDouble.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstFieldRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstFloat.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstIMethodRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstInt.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstLong.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstMemberRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstMethodRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstString.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstantPool.java trunk/core/src/core/org/jnode/vm/classmgr/VmExceptions.java trunk/core/src/core/org/jnode/vm/classmgr/VmField.java trunk/core/src/core/org/jnode/vm/classmgr/VmImplementedInterface.java trunk/core/src/core/org/jnode/vm/classmgr/VmInstanceField.java trunk/core/src/core/org/jnode/vm/classmgr/VmInstanceMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmInterfaceClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmInterpretedExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/VmIsolatedStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmIsolatedStaticsEntry.java trunk/core/src/core/org/jnode/vm/classmgr/VmLineNumberMap.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariable.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariableTable.java trunk/core/src/core/org/jnode/vm/classmgr/VmMember.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethodCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmNormalClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmPrimitiveClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmResolvableConstObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmSharedStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmSharedStaticsEntry.java trunk/core/src/core/org/jnode/vm/classmgr/VmSpecialMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticField.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsAllocator.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsBase.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsIterator.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/classmgr/VmTypeState.java trunk/core/src/core/org/jnode/vm/classmgr/VmUTF8Convert.java trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java trunk/core/src/core/org/jnode/vm/compiler/CompileError.java trunk/core/src/core/org/jnode/vm/compiler/CompiledExceptionHandler.java trunk/core/src/core/org/jnode/vm/compiler/CompiledIMT.java trunk/core/src/core/org/jnode/vm/compiler/CompiledMethod.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeViewer.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/DelegatingCompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java trunk/core/src/core/org/jnode/vm/compiler/GCMapIterator.java trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java trunk/core/src/core/org/jnode/vm/compiler/IllegalModeException.java trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/ir/AddressingMode.java trunk/core/src/core/org/jnode/vm/compiler/ir/CodeGenerator.java trunk/core/src/core/org/jnode/vm/compiler/ir/Constant.java trunk/core/src/core/org/jnode/vm/compiler/ir/DoubleConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/FloatConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRGenerator.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/IntConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/LinearScanAllocator.java trunk/core/src/core/org/jnode/vm/compiler/ir/LiveRange.java trunk/core/src/core/org/jnode/vm/compiler/ir/LocalVariable.java trunk/core/src/core/org/jnode/vm/compiler/ir/Location.java trunk/core/src/core/org/jnode/vm/compiler/ir/LongConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/MethodArgument.java trunk/core/src/core/org/jnode/vm/compiler/ir/NativeTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/Operand.java trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java trunk/core/src/core/org/jnode/vm/compiler/ir/PrimitiveTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/ReferenceConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/RegisterLocation.java trunk/core/src/core/org/jnode/vm/compiler/ir/RegisterPool.java trunk/core/src/core/org/jnode/vm/compiler/ir/SSAStack.java trunk/core/src/core/org/jnode/vm/compiler/ir/StackLocation.java trunk/core/src/core/org/jnode/vm/compiler/ir/StackVariable.java trunk/core/src/core/org/jnode/vm/compiler/ir/Variable.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/AssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryOperation.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchCondition.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConstantRefAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/Quad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryOperation.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnconditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VarReturnQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VoidReturnQuad.java trunk/core/src/core/org/jnode/vm/isolate/DataLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/IsolateLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/IsolateStatusImpl.java trunk/core/src/core/org/jnode/vm/isolate/IsolateThread.java trunk/core/src/core/org/jnode/vm/isolate/IsolateThreadFactory.java trunk/core/src/core/org/jnode/vm/isolate/LinkImpl.java trunk/core/src/core/org/jnode/vm/isolate/LinkLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/LinkMessageFactory.java trunk/core/src/core/org/jnode/vm/isolate/LinkMessageImpl.java trunk/core/src/core/org/jnode/vm/isolate/ObjectLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/StatusLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/StringLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolateLocal.java trunk/core/src/core/org/jnode/vm/isolate/VmLink.java trunk/core/src/core/org/jnode/vm/isolate/VmStreamBindings.java trunk/core/src/core/org/jnode/vm/memmgr/GCStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/HeapHelper.java trunk/core/src/core/org/jnode/vm/memmgr/HeapStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/VmWriteBarrier.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefGCStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultWriteBarrier.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerThread.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCMarkVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSetWhiteVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCStack.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSweepVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCThread.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCVerifyVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/HeapStatisticsVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmAbstractHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmBootHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmDefaultHeap.java trunk/core/src/core/org/jnode/vm/performance/PerformanceCounterEvent.java trunk/core/src/core/org/jnode/vm/performance/PerformanceCounters.java trunk/core/src/core/org/jnode/vm/performance/PresetEvent.java trunk/core/src/core/org/jnode/vm/scheduler/IRQManager.java trunk/core/src/core/org/jnode/vm/scheduler/IRQThread.java trunk/core/src/core/org/jnode/vm/scheduler/IdleThread.java trunk/core/src/core/org/jnode/vm/scheduler/KernelDebugger.java trunk/core/src/core/org/jnode/vm/scheduler/Monitor.java trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.java trunk/core/src/core/org/jnode/vm/scheduler/ProcessorLock.java trunk/core/src/core/org/jnode/vm/scheduler/SpinLock.java trunk/core/src/core/org/jnode/vm/scheduler/SystemThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java trunk/core/src/core/org/jnode/vm/scheduler/VmScheduler.java trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueue.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueueEntry.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadVisitor.java trunk/core/src/core/org/jnode/vm/x86/GDT.java trunk/core/src/core/org/jnode/vm/x86/IOAPIC.java trunk/core/src/core/org/jnode/vm/x86/IOAPICRedirectionEntry.java trunk/core/src/core/org/jnode/vm/x86/LocalAPIC.java trunk/core/src/core/org/jnode/vm/x86/MMXMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/x86/MPBusEntry.java trunk/core/src/core/org/jnode/vm/x86/MPConfigTable.java trunk/core/src/core/org/jnode/vm/x86/MPEntry.java trunk/core/src/core/org/jnode/vm/x86/MPFloatingPointerStructure.java trunk/core/src/core/org/jnode/vm/x86/MPIOAPICEntry.java trunk/core/src/core/org/jnode/vm/x86/MPIOInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPLocalInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPProcessorEntry.java trunk/core/src/core/org/jnode/vm/x86/MSR.java trunk/core/src/core/org/jnode/vm/x86/PIC8259A.java trunk/core/src/core/org/jnode/vm/x86/TSS32.java trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture64.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor64.java trunk/core/src/core/org/jnode/vm/x86/VmX86StackReader.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java trunk/core/src/core/org/jnode/vm/x86/X86Cpu.java trunk/core/src/core/org/jnode/vm/x86/X86CpuID.java trunk/core/src/core/org/jnode/vm/x86/X86IRQManager.java trunk/core/src/core/org/jnode/vm/x86/X86MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/x86/X86Vendor.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompiledIMT.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerConstants.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86JumpTable.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RegisterVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RegisterVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86Level1BCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/X86CodeGenerator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/stub/EmptyGCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java trunk/core/src/core/org/jnode/vm/x86/performance/Athlon64PerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/DualMSRPerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/P4FamilyPerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/P6PerformanceCouters.java trunk/core/src/core/org/jnode/vm/x86/performance/Pentium4PerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/X86PerformanceCounters.java trunk/core/src/core/org/jnode/work/Work.java trunk/core/src/core/org/jnode/work/WorkManager.java trunk/core/src/core/org/jnode/work/WorkPlugin.java trunk/core/src/core/org/jnode/work/WorkUtils.java trunk/core/src/driver/org/jnode/driver/AbstractDeviceManager.java trunk/core/src/driver/org/jnode/driver/ApiNotFoundException.java trunk/core/src/driver/org/jnode/driver/Bus.java trunk/core/src/driver/org/jnode/driver/DefaultDeviceManager.java trunk/core/src/driver/org/jnode/driver/Device.java trunk/core/src/driver/org/jnode/driver/DeviceAPI.java trunk/core/src/driver/org/jnode/driver/DeviceAlreadyConnectedException.java trunk/core/src/driver/org/jnode/driver/DeviceAlreadyRegisteredException.java trunk/core/src/driver/org/jnode/driver/DeviceException.java trunk/core/src/driver/org/jnode/driver/DeviceFinder.java trunk/core/src/driver/org/jnode/driver/DeviceFinderPlugin.java trunk/core/src/driver/org/jnode/driver/DeviceInfoAPI.java trunk/core/src/driver/org/jnode/driver/DeviceListener.java trunk/core/src/driver/org/jnode/driver/DeviceManager.java trunk/core/src/driver/org/jnode/driver/DeviceManagerListener.java trunk/core/src/driver/org/jnode/driver/DeviceNotFoundException.java trunk/core/src/driver/org/jnode/driver/DeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/DeviceUtils.java trunk/core/src/driver/org/jnode/driver/Driver.java trunk/core/src/driver/org/jnode/driver/DriverException.java trunk/core/src/driver/org/jnode/driver/DriverPermission.java trunk/core/src/driver/org/jnode/driver/DriverPlugin.java trunk/core/src/driver/org/jnode/driver/InvalidDriverException.java trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireBus.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireDevice.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireDriver.java trunk/core/src/driver/org/jnode/driver/bus/pci/AGPCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/AbstractPCIDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java trunk/core/src/driver/org/jnode/driver/bus/pci/CompactHotSwapCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/DeviceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/pci/MSICapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBaseAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBus.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBusAPI.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIClassToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIConstants.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDescriptors.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDevice.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceConfig.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIException.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIFinder.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType0.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType1.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType2.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCI_IDs.java trunk/core/src/driver/org/jnode/driver/bus/pci/PMCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/SlotIDCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/VPDCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/VendorDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusBus.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDevice.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDriver.java trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMM.java trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMMDriver.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBus.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBusControler.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBusDevice.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractDeviceItem.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractHostControllerDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/ConfigurationDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/DeviceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/EndPointDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/InterfaceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/SetupPacket.java trunk/core/src/driver/org/jnode/driver/bus/usb/StringDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/StringDescriptorZero.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBBus.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBConfiguration.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBControlPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBDataPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBDevice.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBEndPoint.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBException.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHostControllerAPI.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHubAPI.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHubMonitor.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBInterface.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPacket.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPipeListener.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/HubDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/PortStatus.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBControlRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBDataRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/AbstractStructure.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/AbstractTreeStructure.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/FrameList.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/QueueHead.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/Schedule.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/TransferDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIControlPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIControlRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCICore.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDataPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDataRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIIO.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipeManager.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIRootHub.java trunk/core/src/driver/org/jnode/driver/character/ChannelAlreadyOwnedException.java trunk/core/src/driver/org/jnode/driver/character/CharacterDeviceAPI.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i440BXDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI_SMBusControler.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ISABridge.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_USBController.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82443BX_HostPCIBridge.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82443BX_PCIPCIBridge.java trunk/core/src/driver/org/jnode/driver/chipset/via/Via82C686.java trunk/core/src/driver/org/jnode/driver/chipset/via/Via8363_0.java trunk/core/src/driver/org/jnode/driver/chipset/via/ViaDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/chipset/via/ViaQuirks.java trunk/core/src/driver/org/jnode/driver/console/ActiveTextConsole.java trunk/core/src/driver/org/jnode/driver/console/CompletionInfo.java trunk/core/src/driver/org/jnode/driver/console/Console.java trunk/core/src/driver/org/jnode/driver/console/ConsoleEvent.java trunk/core/src/driver/org/jnode/driver/console/ConsoleException.java trunk/core/src/driver/org/jnode/driver/console/ConsoleListener.java trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/InputCompleter.java trunk/core/src/driver/org/jnode/driver/console/InputHistory.java trunk/core/src/driver/org/jnode/driver/console/KeyEventBindings.java trunk/core/src/driver/org/jnode/driver/console/ScrollableTextConsole.java trunk/core/src/driver/org/jnode/driver/console/TextConsole.java trunk/core/src/driver/org/jnode/driver/console/VirtualKey.java trunk/core/src/driver/org/jnode/driver/console/VirtualTextConsole.java trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsole.java trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/spi/ConsoleWriter.java trunk/core/src/driver/org/jnode/driver/console/textscreen/ConsoleKeyEventBindings.java trunk/core/src/driver/org/jnode/driver/console/textscreen/DefaultKeyboardHandler.java trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardHandler.java trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardReader.java trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardReaderAction.java trunk/core/src/driver/org/jnode/driver/console/textscreen/Line.java trunk/core/src/driver/org/jnode/driver/console/textscreen/ScrollableTextScreenConsole.java trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsolePlugin.java trunk/core/src/driver/org/jnode/driver/input/AbstractInputDriver.java trunk/core/src/driver/org/jnode/driver/input/AbstractKeyboardDriver.java trunk/core/src/driver/org/jnode/driver/input/AbstractKeyboardInterpreter.java trunk/core/src/driver/org/jnode/driver/input/AbstractPointerDriver.java trunk/core/src/driver/org/jnode/driver/input/DeadKeyException.java trunk/core/src/driver/org/jnode/driver/input/Key.java trunk/core/src/driver/org/jnode/driver/input/KeyboardAPI.java trunk/core/src/driver/org/jnode/driver/input/KeyboardAPIAdapter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardAdapter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardConstants.java trunk/core/src/driver/org/jnode/driver/input/KeyboardEvent.java trunk/core/src/driver/org/jnode/driver/input/KeyboardInputPlugin.java trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreterException.java trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java trunk/core/src/driver/org/jnode/driver/input/KeyboardListener.java trunk/core/src/driver/org/jnode/driver/input/Keys.java trunk/core/src/driver/org/jnode/driver/input/LogitechProtocol.java trunk/core/src/driver/org/jnode/driver/input/LogitechWheelMouseProtocol.java trunk/core/src/driver/org/jnode/driver/input/MissingKeyboardInterpreterClassException.java trunk/core/src/driver/org/jnode/driver/input/MouseInterpreter.java trunk/core/src/driver/org/jnode/driver/input/MouseProtocolHandler.java trunk/core/src/driver/org/jnode/driver/input/PointerAPI.java trunk/core/src/driver/org/jnode/driver/input/PointerAPIAdapter.java trunk/core/src/driver/org/jnode/driver/input/PointerEvent.java trunk/core/src/driver/org/jnode/driver/input/PointerInterpreter.java trunk/core/src/driver/org/jnode/driver/input/PointerListener.java trunk/core/src/driver/org/jnode/driver/input/SystemListener.java trunk/core/src/driver/org/jnode/driver/input/SystemTriggerAPI.java trunk/core/src/driver/org/jnode/driver/input/SystemTriggerListener.java trunk/core/src/driver/org/jnode/driver/input/UnsupportedKeyException.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_BE_fr.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_CH_fr.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_DE.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_DK.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_DV.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_ES.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_FR.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_FR_fr.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_GB_en.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_HU.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_HU_101.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_HU_hu.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_HU_hu_101.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_IT.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_IT_it.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_NO.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_RU.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_SE.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_US_en.java trunk/core/src/driver/org/jnode/driver/serial/SerialPortAPI.java trunk/core/src/driver/org/jnode/driver/serial/SerialPortDriver.java trunk/core/src/driver/org/jnode/driver/serial/SerialPortFinder.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiAPI.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiDriver.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiSystemTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/DifferentiatedSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/ExtendedSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/FirmwareAcpiControlStructure.java trunk/core/src/driver/org/jnode/driver/system/acpi/FixedAcpiDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/GenericAddress.java trunk/core/src/driver/org/jnode/driver/system/acpi/RSDP.java trunk/core/src/driver/org/jnode/driver/system/acpi/RootSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/SystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/Aml.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/AmlOpcode.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/NameString.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/ParseNode.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/Parser.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/AcpiInteger.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/AcpiNamedObject.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/AcpiObject.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/Buffer.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/ByteField.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/Device.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/NameSpace.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/Scope.java trunk/core/src/driver/org/jnode/driver/system/cmos/CMOSConstants.java trunk/core/src/driver/org/jnode/driver/system/cmos/CMOSService.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOS.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOSPlugin.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/RTC.java trunk/core/src/driver/org/jnode/driver/system/firmware/AcpiDevice.java trunk/core/src/driver/org/jnode/driver/system/firmware/AcpiRSDPInfo.java trunk/core/src/driver/org/jnode/driver/system/firmware/FirmwareAPI.java trunk/core/src/driver/org/jnode/driver/system/firmware/bios/BiosDriver.java trunk/core/src/driver/org/jnode/driver/system/firmware/bios/BiosFinder.java trunk/core/src/driver/org/jnode/driver/system/pnp/PnP.java trunk/core/src/driver/org/jnode/driver/system/ram/RAMControler.java trunk/core/src/driver/org/jnode/driver/system/ram/RAMModuleCollection.java trunk/core/src/driver/org/jnode/driver/system/ram/RAMModuleInfo.java trunk/core/src/driver/org/jnode/driver/textscreen/ScrollableTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/TextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/TextScreenManager.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcBufferTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcBufferTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcScrollableTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenManager.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenPlugin.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenUtils.java trunk/core/src/driver/org/jnode/driver/virtual/VirtualDevice.java trunk/core/src/driver/org/jnode/driver/virtual/VirtualDeviceDriver.java trunk/core/src/driver/org/jnode/driver/virtual/VirtualDeviceFactory.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkGCStatistics.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/genrc/GenRCStatistics.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/genrc/HeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/genrc/Plan.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/genrc/PlanConstants.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/ms/HeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/ms/MarkSweepStatistics.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/ms/Plan.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/ms/PlanConstants.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/nogc/HeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/nogc/NoGCStatistics.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/nogc/Plan.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/nogc/PlanConstants.java trunk/core/src/openjdk/vm/com/sun/java/util/jar/pack/NativeNativeUnpack.java trunk/core/src/openjdk/vm/com/sun/java/util/jar/pack/Pack200Command.java trunk/core/src/openjdk/vm/com/sun/java/util/jar/pack/Unpack200Command.java trunk/core/src/openjdk/vm/java/awt/NativeAWTEvent.java trunk/core/src/openjdk/vm/java/awt/NativeButton.java trunk/core/src/openjdk/vm/java/awt/NativeCheckbox.java trunk/core/src/openjdk/vm/java/awt/NativeCheckboxMenuItem.java trunk/core/src/openjdk/vm/java/awt/NativeColor.java trunk/core/src/openjdk/vm/java/awt/NativeComponent.java trunk/core/src/openjdk/vm/java/awt/NativeContainer.java trunk/core/src/openjdk/vm/java/awt/NativeDialog.java trunk/core/src/openjdk/vm/java/awt/NativeDimension.java trunk/core/src/openjdk/vm/java/awt/NativeEvent.java trunk/core/src/openjdk/vm/java/awt/NativeFileDialog.java trunk/core/src/openjdk/vm/java/awt/NativeFontMetrics.java trunk/core/src/openjdk/vm/java/awt/NativeFrame.java trunk/core/src/openjdk/vm/java/awt/NativeInsets.java trunk/core/src/openjdk/vm/java/awt/NativeKeyboardFocusManager.java trunk/core/src/openjdk/vm/java/awt/NativeLabel.java trunk/core/src/openjdk/vm/java/awt/NativeMenu.java trunk/core/src/openjdk/vm/java/awt/NativeMenuBar.java trunk/core/src/openjdk/vm/java/awt/NativeMenuComponent.java trunk/core/src/openjdk/vm/java/awt/NativeMenuItem.java trunk/core/src/openjdk/vm/java/awt/NativeRectangle.java trunk/core/src/openjdk/vm/java/awt/NativeScrollPane.java trunk/core/src/openjdk/vm/java/awt/NativeScrollPaneAdjustable.java trunk/core/src/openjdk/vm/java/awt/NativeScrollbar.java trunk/core/src/openjdk/vm/java/awt/NativeSplashScreen.java trunk/core/src/ope... [truncated message content] |
From: <fd...@us...> - 2010-04-03 19:17:35
|
Revision: 5746 http://jnode.svn.sourceforge.net/jnode/?rev=5746&view=rev Author: fduminy Date: 2010-04-03 19:17:29 +0000 (Sat, 03 Apr 2010) Log Message: ----------- removed unused BaseMagicHelper.MagicClass and updated javadoc pointing to it Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java trunk/core/src/vmmagic/org/vmmagic/unboxed/AddressArray.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java trunk/core/src/vmmagic/org/vmmagic/unboxed/ExtentArray.java trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReferenceArray.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java trunk/core/src/vmmagic/org/vmmagic/unboxed/OffsetArray.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java trunk/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java Modified: trunk/core/src/core/org/jnode/vm/VmMagic.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmMagic.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/core/org/jnode/vm/VmMagic.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -36,9 +36,9 @@ * Methods in this class can also be called from inside JNode. * * @author Ewout Prangsma (ep...@us...) - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass} to get the list of "magic" classes - * (including this class). - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod} to get the list of "magic" methods. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods */ @MagicPermission public final class VmMagic { Modified: trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -20,12 +20,9 @@ package org.jnode.vm.compiler; -import java.util.Map; - +import org.jnode.annotation.SharedStatics; import org.jnode.util.BootableHashMap; import org.jnode.vm.classmgr.VmMethod; -import org.jnode.vm.classmgr.VmType; -import org.jnode.annotation.SharedStatics; /** * @author Ewout Prangsma (ep...@us...) @@ -33,71 +30,6 @@ public class BaseMagicHelper { /** - * Enum of all magic classes. - * - * @author Ewout Prangsma (ep...@us...) - */ - @SharedStatics - public enum MagicClass { - ADDRESS("org.vmmagic.unboxed.Address"), - EXTENT("org.vmmagic.unboxed.Extent"), - OBJECTREFERENCE("org.vmmagic.unboxed.ObjectReference"), - OFFSET("org.vmmagic.unboxed.Offset"), - WORD("org.vmmagic.unboxed.Word"), - ADDRESSARRAY("org.vmmagic.unboxed.AddressArray"), - EXTENTARRAY("org.vmmagic.unboxed.ExtentArray"), - OBJECTREFERENCEARRAY("org.vmmagic.unboxed.ObjectReferenceArray"), - OFFSETARRAY("org.vmmagic.unboxed.OffsetArray"), - WORDARRAY("org.vmmagic.unboxed.WordArray"), - VMMAGIC("org.jnode.vm.VmMagic"); - - /** - * Name of the class - */ - private final String name; - - /** - * Lookup table - */ - private static final Map<String, MagicClass> nameToClass; - - /** - * Initialize this instance. - * - * @param name - */ - private MagicClass(String name) { - this.name = name; - } - - /** - * Initialize the lookup table - */ - static { - nameToClass = new BootableHashMap<String, MagicClass>(); - for (MagicClass mc : values()) { - nameToClass.put(mc.name, mc); - } - } - - /** - * Gets the MagicClass instance for the given type. - * - * @param type - * @return a MagicClass instance - * @throws InternalError When type is no magic type. - */ - public static MagicClass get(VmType<?> type) { - MagicClass mc = nameToClass.get(type.getName()); - if (mc == null) { - throw new InternalError("Unknown magic type " + type.getName()); - } else { - return mc; - } - } - } - - /** * Enum of all methods in all magic classes. * * @author Ewout Prangsma (ep...@us...) Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -14,6 +14,7 @@ package org.vmmagic.unboxed; import org.jnode.vm.VmAddress; +import org.jnode.vm.classmgr.VmType; import org.jnode.annotation.KernelSpace; import org.jnode.annotation.Uninterruptible; @@ -22,12 +23,10 @@ * <p/> * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed - * as normal java methods. The actual method bodies are not used. <br/> - * For further details, see the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} - * and the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. - * + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Daniel Frampton */ public final class Address implements UnboxedObject { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/AddressArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/AddressArray.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/AddressArray.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -14,8 +14,12 @@ package org.vmmagic.unboxed; /** - * Commenting required - * + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Daniel Frampton */ final public class AddressArray { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -16,12 +16,10 @@ /** * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed - * as normal java methods. The actual method bodies are not used. <br/> - * For further details, see the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} - * and the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. - * + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Daniel Frampton */ public final class Extent implements UnboxedObject { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/ExtentArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/ExtentArray.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/ExtentArray.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -14,8 +14,12 @@ package org.vmmagic.unboxed; /** - * Commenting required - * + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Daniel Frampton */ final public class ExtentArray { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -23,7 +23,13 @@ * distinction between objects the VM is written in, and objects that the VM is * managing. No operations that can not be completed in pure Java should be * allowed on Object. - * + * <br/><br/> + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Daniel Frampton */ public final class ObjectReference implements Uninterruptible { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReferenceArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReferenceArray.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReferenceArray.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -14,8 +14,12 @@ package org.vmmagic.unboxed; /** - * Commenting required - * + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Daniel Frampton */ final public class ObjectReferenceArray { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -17,12 +17,10 @@ * <p/> * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed - * as normal java methods. The actual method bodies are not used. <br/> - * For further details, see the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} - * and the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. - * + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/OffsetArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/OffsetArray.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/OffsetArray.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -14,8 +14,12 @@ package org.vmmagic.unboxed; /** - * Commenting required - * + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Daniel Frampton */ final public class OffsetArray { Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -20,12 +20,10 @@ * <p/> * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed - * as normal java methods. The actual method bodies are not used. <br/> - * For further details, see the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass list of "magic" classes} - * and the - * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod list of "magic" methods}. - * + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton * @see Address Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java 2010-04-03 18:01:32 UTC (rev 5745) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java 2010-04-03 19:17:29 UTC (rev 5746) @@ -14,8 +14,12 @@ package org.vmmagic.unboxed; /** - * Commenting required - * + * <u>JNode specific notes</u> : This class contains some "magic" + * methods that are interpreted by the VM itself, instead of being executed + * as normal java methods. <b>The actual method bodies are never used</b>. + * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods * @author Daniel Frampton */ final public class WordArray { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2010-05-12 10:29:08
|
Revision: 5748 http://jnode.svn.sourceforge.net/jnode/?rev=5748&view=rev Author: fduminy Date: 2010-05-12 10:29:02 +0000 (Wed, 12 May 2010) Log Message: ----------- removed depencency between Plugin and PluginDescriptorModel by using PluginDescriptor interface instead Signed-off-by: Fabien DUMINY <fab...@we...> Modified Paths: -------------- trunk/core/src/core/org/jnode/plugin/Plugin.java trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java Modified: trunk/core/src/core/org/jnode/plugin/Plugin.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/Plugin.java 2010-05-12 10:28:24 UTC (rev 5747) +++ trunk/core/src/core/org/jnode/plugin/Plugin.java 2010-05-12 10:29:02 UTC (rev 5748) @@ -24,7 +24,6 @@ import java.security.PrivilegedAction; import java.util.prefs.Preferences; -import org.jnode.plugin.model.PluginDescriptorModel; import org.jnode.system.BootLog; @@ -109,7 +108,7 @@ try { startPlugin(); } finally { - ((PluginDescriptorModel) descriptor).firePluginStarted(); + descriptor.firePluginStarted(); } } catch (PluginException ex) { throw ex; @@ -134,7 +133,7 @@ started = false; try { try { - ((PluginDescriptorModel) descriptor).firePluginStop(); + descriptor.firePluginStopped(); } finally { stopPlugin(); } Modified: trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java 2010-05-12 10:28:24 UTC (rev 5747) +++ trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java 2010-05-12 10:29:02 UTC (rev 5748) @@ -20,7 +20,10 @@ package org.jnode.plugin; +import java.util.ArrayList; +import java.util.List; + /** * Descriptor of a Plugin. * @@ -212,4 +215,14 @@ * @param listener */ public void removeListener(PluginDescriptorListener listener); + + /** + * Fire the pluginStarted event to this descriptor's listeners. + */ + public void firePluginStarted(); + + /** + * Fire the pluginStopped event to this descriptor's listeners. + */ + public void firePluginStopped(); } Modified: trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2010-05-12 10:28:24 UTC (rev 5747) +++ trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2010-05-12 10:29:02 UTC (rev 5748) @@ -294,7 +294,7 @@ } /** - * Fire the pluginStarted event to my listeners. + * {@inheritDoc} */ public final void firePluginStarted() { final List<PluginDescriptorListener> listeners; @@ -312,9 +312,9 @@ } /** - * Fire the pluginStop event to my listeners. + * {@inheritDoc} */ - public final void firePluginStop() { + public final void firePluginStopped() { final List<PluginDescriptorListener> listeners; synchronized (listenerLock) { if (this.listeners != null) { Modified: trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java =================================================================== --- trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java 2010-05-12 10:28:24 UTC (rev 5747) +++ trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java 2010-05-12 10:29:02 UTC (rev 5748) @@ -163,4 +163,12 @@ public PluginReference getPluginReference() { return null; } + + @Override + public void firePluginStarted() { + } + + @Override + public void firePluginStopped() { + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-12-27 18:41:55
|
Revision: 5759 http://jnode.svn.sourceforge.net/jnode/?rev=5759&view=rev Author: lsantha Date: 2010-12-27 18:41:44 +0000 (Mon, 27 Dec 2010) Log Message: ----------- Checkstyle fixes. Modified Paths: -------------- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java trunk/core/src/core/org/jnode/boot/InitJarProcessor.java trunk/core/src/core/org/jnode/bootlog/BootLog.java trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java trunk/core/src/core/org/jnode/naming/InitialNaming.java trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java trunk/core/src/core/org/jnode/plugin/Plugin.java trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java trunk/core/src/core/org/jnode/plugin/PluginManager.java trunk/core/src/core/org/jnode/plugin/PluginUtils.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java trunk/core/src/core/org/jnode/plugin/model/Factory.java trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginJar.java trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginsClassLoader.java trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java trunk/core/src/core/org/jnode/security/JNodePolicy.java trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java trunk/core/src/core/org/jnode/util/QueueProcessorThread.java trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java trunk/core/src/core/org/jnode/vm/BootLogImpl.java trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java trunk/core/src/core/org/jnode/vm/VmImpl.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java trunk/core/src/core/org/jnode/vm/classmgr/VmByteCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/compiler/CompiledMethod.java trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java trunk/core/src/core/org/jnode/vm/facade/Vm.java trunk/core/src/core/org/jnode/vm/facade/VmArchitecture.java trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java trunk/core/src/core/org/jnode/vm/facade/VmProcessor.java trunk/core/src/core/org/jnode/vm/facade/VmThread.java trunk/core/src/core/org/jnode/vm/facade/VmUtils.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java trunk/core/src/core/org/jnode/vm/x86/MPConfigTable.java trunk/core/src/core/org/jnode/vm/x86/MPFloatingPointerStructure.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RegisterVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RegisterVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86Level1BCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86StackFrame.java trunk/core/src/core/org/jnode/work/WorkUtils.java trunk/core/src/driver/org/jnode/driver/AbstractDeviceManager.java trunk/core/src/driver/org/jnode/driver/DefaultDeviceManager.java trunk/core/src/driver/org/jnode/driver/Device.java trunk/core/src/driver/org/jnode/driver/Driver.java trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/textscreen/DefaultKeyboardHandler.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreen.java trunk/core/src/test/org/jnode/test/core/StackView.java trunk/core/src/test/org/jnode/test/framework/TestRunnerPlugin.java Modified: trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.assembler.x86; import static org.jnode.assembler.x86.X86Register.CS; @@ -76,12 +76,12 @@ * of equality depend on what the 'key' is. If it is a {@link Label}, then two * Keys are equal if the Label values are equal. Otherwise, two keys are equal if * the 'key' values refer to the same object. - * + * * @param obj the object to test for equality. * @return Return {@code true} if obj is 'equal to' this, {@code false} otherwise. */ public final boolean equals(Object obj) { - if(obj==null || !(obj instanceof Key)){ + if (obj == null || !(obj instanceof Key)) { return false; } obj = ((Key) obj).key; @@ -94,7 +94,7 @@ /** * The hashcode is the hashcode for the Key's 'key' object. - * + * * @return This Key instance's hashcode. */ public final int hashCode() { @@ -2200,6 +2200,7 @@ //TODO this method does not handle the forward jumps correctly, needs further work. //Also the general purpose version of the method writeJCC(Lable lebal, int jumpcode) //for handling byte sized target for the jump would renders this method unnecessary. + /** * Create a LOOP label instruction. The given label must have be resolved * before! @@ -3299,6 +3300,7 @@ } //todo 64 bits support + /** * @param operandSize * @param dstMmx @@ -3321,6 +3323,7 @@ } //todo 64 bits support + /** * @param operandSize * @param dstReg @@ -3343,6 +3346,7 @@ } //todo 64 bits support + /** * @param dstMmx * @param srcMmx @@ -3352,6 +3356,7 @@ } //todo 64 bits support + /** * @param operandSize * @param dstMmx @@ -3376,6 +3381,7 @@ } //todo 64 bits support + /** * @param operandSize * @param dstMmx Modified: trunk/core/src/core/org/jnode/boot/InitJarProcessor.java =================================================================== --- trunk/core/src/core/org/jnode/boot/InitJarProcessor.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/boot/InitJarProcessor.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -30,7 +30,6 @@ import java.util.jar.Attributes; import java.util.jar.Manifest; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; Modified: trunk/core/src/core/org/jnode/bootlog/BootLog.java =================================================================== --- trunk/core/src/core/org/jnode/bootlog/BootLog.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/bootlog/BootLog.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.bootlog; import java.io.PrintStream; @@ -26,15 +26,14 @@ * Logging class used during bootstrap. * * @author Ewout Prangsma (ep...@us...) - * */ -public interface BootLog { +public interface BootLog { public static final int DEBUG = 1; public static final int INFO = 2; public static final int WARN = 3; public static final int ERROR = 4; public static final int FATAL = 5; - + /** * Log a debug message * Modified: trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java =================================================================== --- trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -8,34 +8,35 @@ /** - * Class holding the {@link BootLog} instance used by the system. - * + * Class holding the {@link BootLog} instance used by the system. + * * @author Fabien DUMINY - * */ public final class BootLogInstance { - private BootLogInstance () { - } - - /** - * Get the system's {@link BootLog}. - * @return the system's {@link BootLog}. - */ - public static BootLog get() { - try { - return InitialNaming.lookup(BootLog.class); - } catch (NameNotFoundException e) { - throw new Error("unable to find a BootLog instance", e); - } - } + private BootLogInstance() { + } - /** - * Set the system's {@link BootLog}. - * @param bootLog the system's {@link BootLog}. - * @throws NamingException - * @throws NameAlreadyBoundException - */ - public static void set(BootLog bootLog) throws NameAlreadyBoundException, NamingException { - InitialNaming.bind(BootLog.class, bootLog); - } + /** + * Get the system's {@link BootLog}. + * + * @return the system's {@link BootLog}. + */ + public static BootLog get() { + try { + return InitialNaming.lookup(BootLog.class); + } catch (NameNotFoundException e) { + throw new Error("unable to find a BootLog instance", e); + } + } + + /** + * Set the system's {@link BootLog}. + * + * @param bootLog the system's {@link BootLog}. + * @throws NamingException + * @throws NameAlreadyBoundException + */ + public static void set(BootLog bootLog) throws NameAlreadyBoundException, NamingException { + InitialNaming.bind(BootLog.class, bootLog); + } } Modified: trunk/core/src/core/org/jnode/naming/InitialNaming.java =================================================================== --- trunk/core/src/core/org/jnode/naming/InitialNaming.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/naming/InitialNaming.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.naming; import java.util.Set; @@ -49,27 +49,30 @@ /** * Add a {@link NameSpaceListener} to the NameSpace + * * @param <T> * @param name * @param l */ public static <T> void addNameSpaceListener(Class<T> name, NameSpaceListener<T> l) { - NAME_SPACE.addNameSpaceListener(name, l); + NAME_SPACE.addNameSpaceListener(name, l); } - + /** * Remove a {@link NameSpaceListener} from the NameSpace + * * @param <T> * @param name * @param l */ public static <T> void removeNameSpaceListener(Class<T> name, NameSpaceListener<T> l) { - NAME_SPACE.removeNameSpaceListener(name, l); + NAME_SPACE.removeNameSpaceListener(name, l); } /** * Define the {@link NameSpace} used for storing services. * If a {@link NameSpace} is already defined, then a {@link SecurityException} is thrown. + * * @param namespace */ public static void setNameSpace(NameSpace namespace) { @@ -89,7 +92,7 @@ */ public static <T, E extends T> void bind(Class<T> name, E service) throws NamingException, NameAlreadyBoundException { - NAME_SPACE.bind(name, service); + NAME_SPACE.bind(name, service); } /** @@ -99,7 +102,7 @@ * @param name */ public static void unbind(Class<?> name) { - NAME_SPACE.unbind(name); + NAME_SPACE.unbind(name); } /** Modified: trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.plugin; import java.io.File; @@ -28,16 +28,15 @@ /** - * This is a special implementation of {@link Plugin} for plugins that want - * to automatically unzip their content to a given directory + * This is a special implementation of {@link Plugin} for plugins that want + * to automatically unzip their content to a given directory * while they are started. - * - * @author fabien * + * @author fabien */ public class AutoUnzipPlugin extends Plugin { private boolean startFinished = false; - + public AutoUnzipPlugin(PluginDescriptor descriptor) { super(descriptor); } @@ -45,14 +44,14 @@ @Override protected void startPlugin() throws PluginException { startFinished = false; - new Thread() { + (new Thread() { @Override public void run() { copyResources(); } - } .start(); + }).start(); } - + public boolean isStartFinished() { return startFinished; } @@ -62,14 +61,14 @@ // do nothing for now // TODO should we remove the copied files ? } - + private void copyResources() { System.out.println("auto unzipping plugin " + getDescriptor().getId()); - - try { + + try { //FIXME shouldn't be hard coded but use java.home system property instead final File jnodeHome = new File("/jnode"); - + // wait the jnode home directory is created while (!jnodeHome.exists()) { try { @@ -78,25 +77,25 @@ e.printStackTrace(); } } - + // create the plugin root directory final File pluginRootFile = new File(jnodeHome, getDescriptor().getId()); pluginRootFile.mkdir(); - + // copy each plugin's resource to the plugin root directory final PluginDescriptor desc = AutoUnzipPlugin.this.getDescriptor(); final ClassLoader cl = desc.getPluginClassLoader(); final String pluginRoot = pluginRootFile.getAbsolutePath() + "/"; final byte[] buffer = new byte[10240]; - + if (!(cl instanceof PluginClassLoader)) { - System.err.println("Plugin's ClassLoader doesn't implements PluginClassLoader"); - return; + System.err.println("Plugin's ClassLoader doesn't implements PluginClassLoader"); + return; } - + for (String resName : ((PluginClassLoader) cl).getResources()) { final InputStream input = cl.getResourceAsStream(resName); - + try { copy(input, pluginRoot, resName, buffer); } catch (SecurityException e) { @@ -113,20 +112,20 @@ System.out.print("plugin " + getDescriptor().getId()); System.out.println(" has been unzipped to " + pluginRootFile.getAbsolutePath()); } finally { - startFinished = true; - } + startFinished = true; + } } - - private void copy(InputStream input, String pluginRoot, String name, byte[] buffer) + + private void copy(InputStream input, String pluginRoot, String name, byte[] buffer) throws SecurityException, IOException { File output = new File(pluginRoot + name); output.getParentFile().mkdirs(); - - FileOutputStream fos = null; + + FileOutputStream fos = null; try { fos = new FileOutputStream(output); int nbRead; - + while ((nbRead = input.read(buffer)) > 0) { fos.write(buffer, 0, nbRead); } @@ -134,7 +133,7 @@ if (fos != null) { fos.close(); } - + if (input != null) { input.close(); } Modified: trunk/core/src/core/org/jnode/plugin/Plugin.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/Plugin.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/Plugin.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -24,7 +24,6 @@ import java.security.PrivilegedAction; import java.util.prefs.Preferences; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; Modified: trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -20,10 +20,6 @@ package org.jnode.plugin; -import java.util.ArrayList; -import java.util.List; - - /** * Descriptor of a Plugin. * Modified: trunk/core/src/core/org/jnode/plugin/PluginManager.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginManager.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/PluginManager.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -22,7 +22,6 @@ import java.util.List; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; /** Modified: trunk/core/src/core/org/jnode/plugin/PluginUtils.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginUtils.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/PluginUtils.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -24,7 +24,6 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; /** Modified: trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -35,7 +35,6 @@ import javax.naming.NamingException; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.naming.InitialNaming; import org.jnode.permission.JNodePermission; Modified: trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -24,7 +24,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; - import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.ConfigurationElement; import org.jnode.plugin.PluginException; Modified: trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Iterator; - import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.ConfigurationElement; import org.jnode.plugin.Extension; Modified: trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.List; - import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.Extension; import org.jnode.plugin.ExtensionPoint; Modified: trunk/core/src/core/org/jnode/plugin/model/Factory.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/Factory.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/Factory.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -21,7 +21,6 @@ package org.jnode.plugin.model; import java.net.URL; - import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; Modified: trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -23,8 +23,6 @@ import java.net.URL; import java.nio.ByteBuffer; import java.util.List; - -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.FragmentDescriptor; Modified: trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Iterator; - import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.Library; import org.jnode.plugin.PluginException; Modified: trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -21,7 +21,6 @@ package org.jnode.plugin.model; import gnu.java.security.action.GetPolicyAction; - import java.net.URL; import java.nio.ByteBuffer; import java.security.AccessController; @@ -36,8 +35,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; - -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.PluginClassLoader; import org.jnode.plugin.PluginDescriptor; Modified: trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -29,8 +29,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; - -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.Extension; Modified: trunk/core/src/core/org/jnode/plugin/model/PluginJar.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginJar.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/PluginJar.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -29,7 +29,6 @@ import java.util.Collections; import java.util.Hashtable; import java.util.Map; - import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; @@ -37,7 +36,6 @@ import org.jnode.util.FileUtils; import org.jnode.util.JarBuffer; import org.jnode.vm.ResourceLoader; -import org.jnode.vm.VmImpl; import org.jnode.vm.facade.VmUtils; import org.jnode.vm.objects.BootableHashMap; import org.jnode.vm.objects.BootableObject; Modified: trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.plugin.model; import java.io.IOException; @@ -33,7 +33,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; - import org.jnode.plugin.Extension; import org.jnode.plugin.ExtensionPoint; import org.jnode.plugin.PluginDescriptor; @@ -137,11 +136,11 @@ } /** - * Resolve the plugins corresponding to a collection of supplied descriptors. - * + * Resolve the plugins corresponding to a collection of supplied descriptors. + * * @param descriptors the collection of descriptors to be resolved. */ - public void resolveDescriptors(Collection<PluginDescriptorModel> descriptors) + public void resolveDescriptors(Collection<PluginDescriptorModel> descriptors) throws PluginException { // This method uses the brute-force approach of repeatedly checking the descriptors // in order until if finds one that will resolve. This gives O(N**2) calls to @@ -164,7 +163,7 @@ /** * Check to see if a plugin is resolvable given the current (simulated) registry state. - * + * * @param descr the descriptor for the plugin at issue. * @return <code>true</code> if the plugin is resolvable. */ @@ -290,7 +289,8 @@ /** * {@inheritDoc} */ - public PluginDescriptor loadPlugin(final PluginLoader loader, final String pluginId, final String pluginVersion, boolean resolve) + public PluginDescriptor loadPlugin(final PluginLoader loader, final String pluginId, final String pluginVersion, + boolean resolve) throws PluginException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { @@ -298,17 +298,17 @@ } // Load the requested plugin final PluginDescriptorModel descr = loadPluginImpl(loader, pluginId, pluginVersion); - + if (resolve) { - final HashMap<String, PluginDescriptorModel> descriptors = new HashMap<String, PluginDescriptorModel>(); - descriptors.put(descr.getId(), descr); - // Load the dependent plugins - loadDependencies(loader, descr, descriptors); - - // Resolve the loaded descriptors. - resolveDescriptors(descriptors.values()); + final HashMap<String, PluginDescriptorModel> descriptors = new HashMap<String, PluginDescriptorModel>(); + descriptors.put(descr.getId(), descr); + // Load the dependent plugins + loadDependencies(loader, descr, descriptors); + + // Resolve the loaded descriptors. + resolveDescriptors(descriptors.values()); } - + return descr; } @@ -356,7 +356,7 @@ * @throws PluginException */ private final PluginDescriptorModel loadPluginImpl(final PluginLoader loader, final String pluginId, - final String pluginVersion) throws PluginException { + final String pluginVersion) throws PluginException { final PluginRegistryModel registry = this; final PluginJar pluginJar; try { Modified: trunk/core/src/core/org/jnode/plugin/model/PluginsClassLoader.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginsClassLoader.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/PluginsClassLoader.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -21,7 +21,6 @@ package org.jnode.plugin.model; import java.net.URL; - import org.jnode.plugin.PluginDescriptor; /** Modified: trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Iterator; - import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.Library; import org.jnode.plugin.PluginException; Modified: trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java =================================================================== --- trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -27,7 +27,6 @@ import java.security.PrivilegedAction; import java.util.HashMap; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.ConfigurationElement; import org.jnode.plugin.Extension; Modified: trunk/core/src/core/org/jnode/security/JNodePolicy.java =================================================================== --- trunk/core/src/core/org/jnode/security/JNodePolicy.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/security/JNodePolicy.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.security; import gnu.java.security.PolicyFile; @@ -36,7 +36,6 @@ import java.util.HashMap; import java.util.Map; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.ConfigurationElement; import org.jnode.plugin.Extension; @@ -176,7 +175,7 @@ final Permission p = (Permission) perm; perms.add(p); } catch (ClassNotFoundException ex) { - BootLogInstance.get() + BootLogInstance.get() .error("Permission class " + type + " not found"); } catch (InstantiationException ex) { @@ -186,7 +185,7 @@ BootLogInstance.get().error("Illegal access to permission class " + type); } catch (NoSuchMethodException ex) { - BootLogInstance.get() + BootLogInstance.get() .error("Constructor not found on permission class " + type + " in plugin " + id); } catch (InvocationTargetException ex) { Modified: trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java =================================================================== --- trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -20,7 +20,6 @@ package org.jnode.util; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; /** Modified: trunk/core/src/core/org/jnode/util/QueueProcessorThread.java =================================================================== --- trunk/core/src/core/org/jnode/util/QueueProcessorThread.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/util/QueueProcessorThread.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -20,7 +20,6 @@ package org.jnode.util; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; /** Modified: trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java =================================================================== --- trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm; import java.nio.ByteOrder; @@ -107,7 +107,7 @@ /** * {@inheritDoc} */ - public abstract TypeSizeInfo getTypeSizeInfo(); + public abstract TypeSizeInfo getTypeSizeInfo(); /** * Gets the stackreader for this architecture. @@ -122,8 +122,8 @@ /** * Gets all compilers for this architecture. * - * @return The architecture's compilers, sorted by optimization level, from - * least optimizing to most optimizing. + * @return The architecture's compilers, sorted by optimization level, from + * least optimizing to most optimizing. */ public abstract NativeCodeCompiler[] getCompilers(); @@ -131,9 +131,9 @@ * Gets all test compilers for this architecture. * This can be used to test new compilers in a running system. * - * @return The architecture's test compilers, sorted by optimization level, from - * least optimizing to most optimizing. If there are no configured test compilers, - * {@code null} will be returned. + * @return The architecture's test compilers, sorted by optimization level, from + * least optimizing to most optimizing. If there are no configured test compilers, + * {@code null} will be returned. */ public abstract NativeCodeCompiler[] getTestCompilers(); @@ -166,7 +166,7 @@ * * @param cpu */ - protected final void addProcessor(VmProcessor cpu) { + protected final void addProcessor(VmProcessor cpu) { ((VmImpl) VmUtils.getVm()).addProcessor(cpu); } @@ -227,10 +227,10 @@ /** * Page align a given address (represented as a Word) in a given region. * - * @param v an address value + * @param v an address value * @param region a {@link VirtualMemoryRegion}. - * @param up If true, the value will be rounded up, otherwise rounded down. - * @return the corresponding page aligned address represented as a Word. + * @param up If true, the value will be rounded up, otherwise rounded down. + * @return the corresponding page aligned address represented as a Word. */ public final Word pageAlign(int region, Word v, boolean up) { final int logPageSize = getLogPageSize(region); @@ -268,7 +268,10 @@ throws UninterruptiblePragma; /** - * {@inheritDoc} + * Gets the memory map of the current system. If no map has yet been created, + * it will be created by calling {@link #createMemoryMap()}. + * + * @return the architecture's memory map. */ public final MemoryMapEntry[] getMemoryMap() { final SecurityManager sm = System.getSecurityManager(); @@ -303,8 +306,9 @@ /** * Creates a multi-media support instance. The default implementation returns a - * generic support instance. This method may be overriden to provide an architecture + * generic support instance. This method may be overriden to provide an architecture * optimized {@link VmMultiMediaSupport} implementation. + * * @return a multi-media support instance. */ protected VmMultiMediaSupport createMultiMediaSupport() { Modified: trunk/core/src/core/org/jnode/vm/BootLogImpl.java =================================================================== --- trunk/core/src/core/org/jnode/vm/BootLogImpl.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/BootLogImpl.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm; import java.io.PrintStream; @@ -150,16 +150,16 @@ } } - static void initialize() { - Unsafe.debug("Initialize BootLog\n"); - try { - BootLogInstance.set(new BootLogImpl()); - } catch (NameAlreadyBoundException e) { + static void initialize() { + Unsafe.debug("Initialize BootLog\n"); + try { + BootLogInstance.set(new BootLogImpl()); + } catch (NameAlreadyBoundException e) { Unsafe.debug(e.toString()); Unsafe.debug("\n"); - } catch (NamingException e) { + } catch (NamingException e) { Unsafe.debug(e.toString()); Unsafe.debug("\n"); - } - } + } + } } Modified: trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java =================================================================== --- trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm; import org.jnode.annotation.MagicPermission; @@ -266,6 +266,6 @@ * @see org.jnode.vm.memmgr.HeapHelper#bootArchitecture(boolean) */ public final void bootArchitecture(boolean emptyMMap) { - ((BaseVmArchitecture) VmUtils.getVm().getArch()).boot(emptyMMap); + ((BaseVmArchitecture) VmUtils.getVm().getArch()).boot(emptyMMap); } } Modified: trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm; import org.jnode.annotation.MagicPermission; @@ -245,7 +245,7 @@ /** * Initialize this manager. */ - private static void initialize() { + private static void initialize() { Unsafe.debug("Initialize MemoryBlockManager\n"); startPtr = blockAlign(Unsafe.getMemoryStart().toWord(), true).toAddress(); endPtr = blockAlign(Unsafe.getMemoryEnd().toWord(), false).toAddress(); Modified: trunk/core/src/core/org/jnode/vm/VmImpl.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmImpl.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/VmImpl.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm; import java.lang.reflect.Constructor; @@ -119,7 +119,7 @@ * @throws InstantiationException */ public VmImpl(String version, BaseVmArchitecture arch, VmSharedStatics statics, - boolean debugMode, VmClassLoader loader, PluginRegistry pluginReg) + boolean debugMode, VmClassLoader loader, PluginRegistry pluginReg) throws InstantiationException { this.version = version; this.debugMode = debugMode; @@ -143,7 +143,8 @@ * @throws InstantiationException */ private static VmHeapManager createHeapManager(HeapHelper helper, - BaseVmArchitecture arch, VmClassLoader loader, PluginRegistry pluginReg) + BaseVmArchitecture arch, VmClassLoader loader, + PluginRegistry pluginReg) throws InstantiationException { if (pluginReg == null) { // Use in tests and asm constant construction @@ -387,7 +388,7 @@ this.scheduler = scheduler; } } - + /** * {@inheritDoc} */ @@ -395,8 +396,8 @@ return new BootableArrayList<VmProcessor>(processors); } - @Override - public void accept(VmThreadVisitor vmThreadVisitor) { - scheduler.visitAllThreads(vmThreadVisitor); - } + @Override + public void accept(VmThreadVisitor vmThreadVisitor) { + scheduler.visitAllThreads(vmThreadVisitor); + } } Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm; import java.io.IOException; @@ -120,16 +120,16 @@ * Initialize the Virtual Machine */ public static void initialize() { - if (!inited) { - // Initialize Naming - InitialNaming.setNameSpace(new DefaultNameSpace()); - - // Initialize BootLog - BootLogImpl.initialize(); - + if (!inited) { + // Initialize Naming + InitialNaming.setNameSpace(new DefaultNameSpace()); + + // Initialize BootLog + BootLogImpl.initialize(); + // Initialize resource manager final ResourceManager rm = ResourceManagerImpl.initialize(); - + /* Initialize the system classloader */ VmSystemClassLoader loader = (VmSystemClassLoader) (getVmClass(VmProcessor.current()).getLoader()); systemLoader = loader; @@ -206,7 +206,7 @@ throw new UnsupportedOperationException(); } }); - + // Trigger initialization of the global environment variables. System.getenv(); } @@ -239,7 +239,7 @@ } else if (VmIsolate.isRoot()) { return bootOutStream; } else { - return VmIOContext.getGlobalOutStream(); + return VmIOContext.getGlobalOutStream(); } } @@ -870,10 +870,10 @@ * @return the time of a system timer in nanoseconds. * @since 1.5 */ - public static long nanoTime() { + public static long nanoTime() { if (ghz == -1) { final long measureDuration = 1000; // in milliseconds - + long start = Unsafe.getCpuCycles(); long ms_start = currentTimeMillis(); long ms_end; @@ -892,15 +892,15 @@ ghz = (end - start) / (ms * 1000000L); if (ghz <= 0) { - ghz = 0; - } + ghz = 0; + } } - + if (ghz == 0) { //todo these are CPUs under 1GHz, improve this case return currentTimeMillis() * 1000000L; } - + return Unsafe.getCpuCycles() / ghz; } @@ -949,7 +949,7 @@ * Call the garbage collector */ public static void gc() { - VmUtils.getVm().getHeapManager().gc(); + VmUtils.getVm().getHeapManager().gc(); } static class SystemOutputStream extends OutputStream { @@ -1197,18 +1197,18 @@ } } - /** - * Wait for ms milliseconds in a busy waiting loop. - * This method is very CPU intensive, so be carefull. - * - * @param ms - */ - public static void loop(long ms) { - final long start = currentKernelMillis(); - while (true) { - if ((start + ms) <= currentKernelMillis()) { - break; - } - } - } + /** + * Wait for ms milliseconds in a busy waiting loop. + * This method is very CPU intensive, so be carefull. + * + * @param ms + */ + public static void loop(long ms) { + final long start = currentKernelMillis(); + while (true) { + if ((start + ms) <= currentKernelMillis()) { + break; + } + } + } } Modified: trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -23,7 +23,6 @@ import java.util.Comparator; import java.util.TreeMap; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.vm.JvmType; import org.jnode.vm.classmgr.VmByteCode; @@ -489,8 +488,8 @@ bb.setStartStack(tstack); } else if (!tstack.equals(bbTStack)) { if (debug) { - BootLogInstance.get().warn("TypeStack is different in " + method + ";" + tstack + " vs. " + bbTStack + " in " + - bb + " at address " + this.curAddress); + BootLogInstance.get().warn("TypeStack is different in " + method + ";" + tstack + " vs. " + + bbTStack + " in " + bb + " at address " + this.curAddress); } //throw new VerifyError("TypeStack is different; " + tstack + " vs. " + bbTStack + " in " + bb); } Modified: trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -22,7 +22,6 @@ import java.util.TreeMap; -import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.vm.JvmType; import org.jnode.vm.classmgr.VmByteCode; Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmByteCode.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmByteCode.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmByteCode.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -25,7 +25,6 @@ import java.util.Collections; import java.util.List; -import org.jnode.vm.VmImpl; import org.jnode.vm.facade.VmUtils; /** Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmType.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm.classmgr; import gnu.java.lang.VMClassHelper; @@ -1612,7 +1612,7 @@ // arrayClass.link(); } if (mmType == null) { - VmUtils.notifyClassResolved(this); + VmUtils.notifyClassResolved(this); } this.state |= VmTypeState.ST_LINKED; } @@ -2433,6 +2433,7 @@ */ private static final JNodePermission GETVMCLASS = new JNodePermission("getVmClass"); private static int FIELD_OFFSET = -1; + public static <V> VmType<V> fromClass(Class<V> clazz) { if (FIELD_OFFSET == -1) { FIELD_OFFSET = ((VmInstanceField) ClassClass.getDeclaredField("vmClass")).getOffset(); @@ -2441,7 +2442,7 @@ // final SecurityManager sm = System.getSecurityManager(); // if (sm != null) { //todo: misplaced securty check -> stack overflow in gnu.testlet. // //todo: TestSecurityManager.checkPermission - //todo secure this method + //todo secure this method // sm.checkPermission(GETVMCLASS); // } Modified: trunk/core/src/core/org/jnode/vm/compiler/CompiledMethod.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/CompiledMethod.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/compiler/CompiledMethod.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -21,7 +21,6 @@ package org.jnode.vm.compiler; import org.jnode.assembler.NativeStream; -import org.jnode.vm.VmImpl; import org.jnode.vm.classmgr.VmAddressMap; import org.jnode.vm.classmgr.VmMethod; import org.jnode.vm.facade.VmUtils; Modified: trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -26,7 +26,6 @@ import org.jnode.assembler.NativeStream; import org.jnode.assembler.ObjectResolver; import org.jnode.assembler.UnresolvedObjectRefException; -import org.jnode.vm.VmImpl; import org.jnode.vm.VmAddress; import org.jnode.vm.VmMagic; import org.jnode.annotation.MagicPermission; Modified: trunk/core/src/core/org/jnode/vm/facade/Vm.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/Vm.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/facade/Vm.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm.facade; import java.util.List; @@ -30,29 +30,28 @@ /** * Interface with the Virtual Machine. - * - * @author Fabien DUMINY (fduminy at jnode.org) * + * @author Fabien DUMINY (fduminy at jnode.org) */ public interface Vm { /** * @return Returns the statics. */ - VmSharedStatics getSharedStatics(); + VmSharedStatics getSharedStatics(); /** * @see org.jnode.vm.objects.Statistics#getStatistics() */ - Statistic[] getStatistics(); - + Statistic[] getStatistics(); + /** * Gets or creates a counter with a given name. * * @param name * @return The counter */ - Counter getCounter(String string); + Counter getCounter(String string); /** * Gets or creates a counter group with a given name. @@ -60,23 +59,23 @@ * @param name * @return The counter group */ - CounterGroup getCounterGroup(String name); + CounterGroup getCounterGroup(String name); /** * @return Returns the architecture. */ - VmArchitecture getArch(); + VmArchitecture getArch(); /** * @return Returns the heapManager. */ - VmHeapManager getHeapManager(); + VmHeapManager getHeapManager(); /** * @return Returns the bootstrap. */ - boolean isBootstrap(); - + boolean isBootstrap(); + /** * Gets the list of compiled methods. * @@ -89,14 +88,14 @@ * * @return Returns the version. */ - String getVersion(); + String getVersion(); /** * Does this VM run in debug mode. * * @return Returns the debugMode. */ - boolean isDebugMode(); + boolean isDebugMode(); /** * Returns the number of available processors currently available to the @@ -110,11 +109,10 @@ /** * @return a copy of the processors list */ - List<VmProcessor> getProcessors(); + List<VmProcessor> getProcessors(); - /** - * - * @param vmThreadVisitor - */ - void accept(VmThreadVisitor vmThreadVisitor); + /** + * @param vmThreadVisitor + */ + void accept(VmThreadVisitor vmThreadVisitor); } Modified: trunk/core/src/core/org/jnode/vm/facade/VmArchitecture.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/VmArchitecture.java 2010-10-02 13:42:51 UTC (rev 5758) +++ trunk/core/src/core/org/jnode/vm/facade/VmArchitecture.java 2010-12-27 18:41:44 UTC (rev 5759) @@ -17,20 +17,18 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.vm.facade; import java.nio.ByteOrder; -import org.jnode.vm.VirtualMemoryRegion; import org.vmmagic.unboxed.Address; import org.vmmagic.unboxed.Extent; /** * Interface with the system architecture. - * - * @author Fabien DUMINY (fduminy at jnode.org) * + * @author Fabien DUMINY (fduminy at jnode.org) */ public interface VmArchitecture { @@ -39,38 +37,37 @@ * * @return the architecture's ByteOrder */ - ByteOrder getByteOrder(); + ByteOrder getByteOrder(); /** * Gets the size in bytes of an object reference. * * @return the architecture's reference size in bytes; i.e. 4 or 8. */ - int getReferenceSize(); + int getReferenceSize(); /** * Gets the start address of the given space. - * - * @param space a {@link VirtualMemoryRegion}. + * + * @param space a {@link org.jnode.vm.VirtualMemoryRegion}. * @return the start address of the region */ - Address getStart(int space); + Address getStart(int space); /** * Gets the end address of the given space. * - * @param space a {@link VirtualMemoryRegion}. + * @param space a {@link org.jnode.vm.VirtualMemoryRegion}. * @return the end address of the region */ - Address getEnd(int space); + Address getEnd(int space); /** - * Gets the memory map of the current system. If no map has yet been created, - * it will be created by calling {@link #createMemoryMap()}. + * Gets the memory map of the current system. * * @return the architecture's memory map. */ - MemoryMapEntry[] getMemoryMap(); + MemoryMapEntry[] getMemoryMap(); /** * Map a region of the virtual memory space. Note that you cannot allocate @@ -83,15 +80,15 @@ * Address.max(), free pages are used instead. * @return true for success, false otherwise. */ - boolean mmap(int region, Address start, Extent size, Address physAddr); + boolean mmap(int region, Address start, Extent size, Address physAddr); /** * Gets the log base two of the size in bytes of an OS page in a given region * - * @param region a {@link VirtualMemoryRegion} value + * @param region a {@link org.jnode.vm.VirtualMemoryRegion} value * @return the log base two page size */ - byte getLogPageSize(int region); + byte getLogPageSize(int region); /** * Unmap a region of the virtual memory space. Note that you cannot allocate @@ -104,17 +101,17 @@ * aligned up on pagesize. * @return true for success, false otherwise. */ - boolean munmap(int region, Address start, Extent size); + boolean munmap(int region, Address start, Extent size); /** * Page align a given add... [truncated message content] |
From: <ls...@us...> - 2011-06-25 21:08:07
|
Revision: 5826 http://jnode.svn.sourceforge.net/jnode/?rev=5826&view=rev Author: lsantha Date: 2011-06-25 21:07:57 +0000 (Sat, 25 Jun 2011) Log Message: ----------- Improved remote debugging. Now standard Java debuggers can connect to JNode. Modified Paths: -------------- trunk/core/src/classpath/ext/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/NativeTransportFactory.java Added Paths: ----------- trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/JNodeSocketTransport.java trunk/core/src/emu/gnu/ trunk/core/src/emu/gnu/classpath/ trunk/core/src/emu/gnu/classpath/jdwp/ trunk/core/src/emu/gnu/classpath/jdwp/EmuVirtualMachine.java trunk/core/src/emu/gnu/classpath/jdwp/Main.java Removed Paths: ------------- trunk/core/src/classpath/vm/gnu/classpath/jdwp/JNodeSocketTransport.java Modified: trunk/core/src/classpath/ext/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java =================================================================== --- trunk/core/src/classpath/ext/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java 2011-06-24 08:53:44 UTC (rev 5825) +++ trunk/core/src/classpath/ext/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java 2011-06-25 21:07:57 UTC (rev 5826) @@ -273,7 +273,7 @@ ThreadGroup root = getRootThreadGroup(jdwpGroup); os.writeInt(1); // Just one top level group allowed? - idMan.getObjectId(root); + idMan.getObjectId(root).write(os); } private void executeDispose(ByteBuffer bb, DataOutputStream os) Deleted: trunk/core/src/classpath/vm/gnu/classpath/jdwp/JNodeSocketTransport.java =================================================================== --- trunk/core/src/classpath/vm/gnu/classpath/jdwp/JNodeSocketTransport.java 2011-06-24 08:53:44 UTC (rev 5825) +++ trunk/core/src/classpath/vm/gnu/classpath/jdwp/JNodeSocketTransport.java 2011-06-25 21:07:57 UTC (rev 5826) @@ -1,166 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package gnu.classpath.jdwp; - -import java.net.Socket; -import java.net.ServerSocket; -import java.util.HashMap; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import javax.net.ServerSocketFactory; -import javax.net.SocketFactory; -import gnu.classpath.jdwp.transport.ITransport; -import gnu.classpath.jdwp.transport.TransportException; - -/** - * - */ -public class JNodeSocketTransport implements ITransport { - - /** - * Name of this transport - */ - public static final String NAME = "dt_socket"; - - // Configure properties - private static final String _PROPERTY_ADDRESS = "address"; - private static final String _PROPERTY_SERVER = "server"; - - // Port number - private int port; - - // Host name - private String host; - - // Are we acting as a server? - private boolean server = false; - - // Socket - private Socket socket; - - /** - * Setup the connection configuration from the given properties - * - * @param properties the properties of the JDWP session - * @throws gnu.classpath.jdwp.transport.TransportException for any configury errors - */ - public void configure (HashMap properties) throws TransportException { - // Get address [form: "hostname:port"] - String p = (String) properties.get(_PROPERTY_ADDRESS); - if (p != null) { - String[] s = p.split(":"); - if (s.length == 2) { - host = s[0]; - port = Integer.parseInt(s[1]); - // @classpath-bugfix Michael Klaus (Mic...@gm...) - } else if (s.length == 1) { - port = Integer.parseInt(s[0]); - // @classpath-bugfix-end - } - } - - // Get server [form: "y" or "n"] - p = (String) properties.get(_PROPERTY_SERVER); - if (p != null) { - if (p.toLowerCase().equals("y")) - server = true; - } - } - - public static class ServerSocketHolder { - private static ServerSocket ss; - public static void close(){ - if(ss != null){ - try { - ss.close(); - } catch (Exception e){ - - } finally { - ss = null; - } - } - } - - static Socket getSocket(int port, int backlog) throws IOException{ - if(ss == null){ - ServerSocketFactory ssf = ServerSocketFactory.getDefault(); - ss = ssf.createServerSocket(port, backlog); - } - return ss.accept(); - } - } - - /** - * Initialize this socket connection. This includes - * connecting to the host (or listening for it). - * - * @throws TransportException if a transport-related error occurs - */ - public void initialize () throws TransportException { - try { - if (server) { - // Get a server socket - socket = ServerSocketHolder.getSocket(port, 1); - } else { - // Get a client socket (the factory will connect it) - SocketFactory sf = SocketFactory.getDefault(); - socket = sf.createSocket(host, port); - } - } - catch (IOException ioe) { - // This will grab UnknownHostException, too. - throw new TransportException(ioe); - } - } - - /** - * Shutdown the socket. This could cause SocketExceptions - * for anyone blocked on socket i/o - */ - public void shutdown () { - try { - socket.close(); - } catch (Throwable t) { - // We don't really care about errors at this point - } - } - - /** - * Returns an <code>InputStream</code> for the transport - * - * @throws IOException if an I/O error occurs creating the stream - * or the socket is not connected - */ - public InputStream getInputStream () throws IOException { - return socket.getInputStream(); - } - - /** - * Returns an <code>OutputStream</code> for the transport - * - * @throws IOException if an I/O error occurs creating the stream - * or the socket is not connected - */ - public OutputStream getOutputStream () throws IOException { - return socket.getOutputStream(); - } -} Modified: trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java =================================================================== --- trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java 2011-06-24 08:53:44 UTC (rev 5825) +++ trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java 2011-06-25 21:07:57 UTC (rev 5826) @@ -27,6 +27,7 @@ import gnu.classpath.jdwp.util.MethodResult; import gnu.classpath.jdwp.event.EventRequest; +import org.jnode.annotation.NoInline; import org.jnode.vm.facade.VmUtils; import org.jnode.vm.isolate.VmIsolate; import org.jnode.vm.classmgr.VmIsolatedStatics; @@ -41,23 +42,34 @@ * @author Levente S\u00e1ntha */ class NativeVMVirtualMachine { + @NoInline +// public static boolean debug() { +// return true; +// } + /** * @see gnu.classpath.jdwp.VMVirtualMachine#suspendThread(java.lang.Thread) */ private static void suspendThread(Thread arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.suspendThread()"); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#resumeThread(java.lang.Thread) */ private static void resumeThread(Thread arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.resumeThread()"); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getSuspendCount(java.lang.Thread) */ private static int getSuspendCount(Thread arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getSuspendCount()"); return 0; } /** @@ -65,12 +77,16 @@ */ private static int getAllLoadedClassesCount() { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getAllLoadedClassesCount()"); return 0; } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getAllLoadedClasses() */ private static Iterator getAllLoadedClasses() { +// if(debug()) + System.out.println("NativeVMVirtualMachine.getAllLoadedClasses()"); return new Iterator() { private VmStaticsIterator iter = new VmStaticsIterator(VmUtils.getVm().getSharedStatics()); private Iterator<VmIsolatedStatics> isolated = VmIsolate.staticsIterator(); @@ -102,6 +118,8 @@ */ private static int getClassStatus(Class arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getClassStatus()"); return 0; } /** @@ -109,6 +127,8 @@ */ private static VMMethod[] getAllClassMethods(Class arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getAllClassMethods()"); return null; } /** @@ -116,6 +136,8 @@ */ private static VMMethod getClassMethod(Class arg1, long arg2) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getClassMethod()"); return null; } /** @@ -123,6 +145,8 @@ */ private static ArrayList getFrames(Thread arg1, int arg2, int arg3) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getFrame()"); return null; } /** @@ -130,6 +154,8 @@ */ private static VMFrame getFrame(Thread arg1, ByteBuffer arg2) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getFrame()"); return null; } /** @@ -137,6 +163,8 @@ */ private static int getFrameCount(Thread arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getFrameCount()"); return 0; } /** @@ -144,6 +172,8 @@ */ private static int getThreadStatus(Thread arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getThreadStatus()"); return 0; } /** @@ -151,6 +181,8 @@ */ private static ArrayList getLoadRequests(ClassLoader arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getLoadRequest()"); return null; } /** @@ -158,6 +190,8 @@ */ private static MethodResult executeMethod(Object arg1, Thread arg2, Class arg3, Method arg4, Object[] arg5, boolean arg6) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.executeMethod()"); return null; } /** @@ -165,6 +199,8 @@ */ private static String getSourceFile(Class arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.getSourceFile()"); return null; } /** @@ -172,21 +208,30 @@ */ private static void registerEvent(EventRequest arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.registerEvent() " + arg1.getId() + " " + arg1.getEventKind() + + " " + arg1.getSuspendPolicy() + " " + arg1.getFilters()); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#unregisterEvent(gnu.classpath.jdwp.event.EventRequest) */ private static void unregisterEvent(EventRequest arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.unregisterEvent()"); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#clearEvents(byte) */ private static void clearEvents(byte arg1) { //todo implement it +// if(debug()) + System.out.println("NativeVMVirtualMachine.clearEvents()"); } public static void redefineClass(Class oldClass, byte[] classData){ +// if(debug()) + System.out.println("NativeVMVirtualMachine.redefineClass()"); VmType old_type = VmType.fromClass(oldClass); VmType new_type = ClassDecoder.defineClass(oldClass.getName(), ByteBuffer.wrap(classData), false, Copied: trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/JNodeSocketTransport.java (from rev 5819, trunk/core/src/classpath/vm/gnu/classpath/jdwp/JNodeSocketTransport.java) =================================================================== --- trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/JNodeSocketTransport.java (rev 0) +++ trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/JNodeSocketTransport.java 2011-06-25 21:07:57 UTC (rev 5826) @@ -0,0 +1,166 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package gnu.classpath.jdwp.transport; + +import java.net.Socket; +import java.net.ServerSocket; +import java.util.HashMap; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import javax.net.ServerSocketFactory; +import javax.net.SocketFactory; +import gnu.classpath.jdwp.transport.ITransport; +import gnu.classpath.jdwp.transport.TransportException; + +/** + * + */ +public class JNodeSocketTransport implements ITransport { + + /** + * Name of this transport + */ + public static final String NAME = "dt_socket"; + + // Configure properties + private static final String _PROPERTY_ADDRESS = "address"; + private static final String _PROPERTY_SERVER = "server"; + + // Port number + private int port; + + // Host name + private String host; + + // Are we acting as a server? + private boolean server = false; + + // Socket + private Socket socket; + + /** + * Setup the connection configuration from the given properties + * + * @param properties the properties of the JDWP session + * @throws gnu.classpath.jdwp.transport.TransportException for any configury errors + */ + public void configure (HashMap properties) throws TransportException { + // Get address [form: "hostname:port"] + String p = (String) properties.get(_PROPERTY_ADDRESS); + if (p != null) { + String[] s = p.split(":"); + if (s.length == 2) { + host = s[0]; + port = Integer.parseInt(s[1]); + // @classpath-bugfix Michael Klaus (Mic...@gm...) + } else if (s.length == 1) { + port = Integer.parseInt(s[0]); + // @classpath-bugfix-end + } + } + + // Get server [form: "y" or "n"] + p = (String) properties.get(_PROPERTY_SERVER); + if (p != null) { + if (p.toLowerCase().equals("y")) + server = true; + } + } + + public static class ServerSocketHolder { + private static ServerSocket ss; + public static void close(){ + if(ss != null){ + try { + ss.close(); + } catch (Exception e){ + + } finally { + ss = null; + } + } + } + + static Socket getSocket(int port, int backlog) throws IOException{ + if(ss == null){ + ServerSocketFactory ssf = ServerSocketFactory.getDefault(); + ss = ssf.createServerSocket(port, backlog); + } + return ss.accept(); + } + } + + /** + * Initialize this socket connection. This includes + * connecting to the host (or listening for it). + * + * @throws TransportException if a transport-related error occurs + */ + public void initialize () throws TransportException { + try { + if (server) { + // Get a server socket + socket = ServerSocketHolder.getSocket(port, 1); + } else { + // Get a client socket (the factory will connect it) + SocketFactory sf = SocketFactory.getDefault(); + socket = sf.createSocket(host, port); + } + } + catch (IOException ioe) { + // This will grab UnknownHostException, too. + throw new TransportException(ioe); + } + } + + /** + * Shutdown the socket. This could cause SocketExceptions + * for anyone blocked on socket i/o + */ + public void shutdown () { + try { + socket.close(); + } catch (Throwable t) { + // We don't really care about errors at this point + } + } + + /** + * Returns an <code>InputStream</code> for the transport + * + * @throws IOException if an I/O error occurs creating the stream + * or the socket is not connected + */ + public InputStream getInputStream () throws IOException { + return socket.getInputStream(); + } + + /** + * Returns an <code>OutputStream</code> for the transport + * + * @throws IOException if an I/O error occurs creating the stream + * or the socket is not connected + */ + public OutputStream getOutputStream () throws IOException { + return socket.getOutputStream(); + } +} Modified: trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/NativeTransportFactory.java =================================================================== --- trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/NativeTransportFactory.java 2011-06-24 08:53:44 UTC (rev 5825) +++ trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/NativeTransportFactory.java 2011-06-25 21:07:57 UTC (rev 5826) @@ -20,8 +20,6 @@ package gnu.classpath.jdwp.transport; -import gnu.classpath.jdwp.JNodeSocketTransport; - /** * */ Copied: trunk/core/src/emu/gnu/classpath/jdwp/EmuVirtualMachine.java (from rev 5819, trunk/core/src/classpath/ext/gnu/classpath/jdwp/VMVirtualMachine.java) =================================================================== --- trunk/core/src/emu/gnu/classpath/jdwp/EmuVirtualMachine.java (rev 0) +++ trunk/core/src/emu/gnu/classpath/jdwp/EmuVirtualMachine.java 2011-06-25 21:07:57 UTC (rev 5826) @@ -0,0 +1,404 @@ +/* VMVirtualMachine.java -- A reference implementation of a JDWP virtual + machine + + Copyright (C) 2005, 2006 Free Software Foundation + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.classpath.jdwp; + +import gnu.classpath.jdwp.event.ClassPrepareEvent; +import gnu.classpath.jdwp.event.EventRequest; +import gnu.classpath.jdwp.event.VmInitEvent; +import gnu.classpath.jdwp.exception.JdwpException; +import gnu.classpath.jdwp.util.MethodResult; +import java.lang.reflect.Method; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Iterator; + +/** + * A virtual machine according to JDWP. + * + * @author Keith Seitz <ke...@re...> + */ +public class EmuVirtualMachine +{ + /** + * Suspend a thread + * + * @param thread the thread to suspend + */ + public static void suspendThread (Thread thread) + throws JdwpException{ + System.out.println("suspendThread"); + } + + /** + * Suspend all threads + */ + public static void suspendAllThreads () + throws JdwpException + { + // Our JDWP thread group -- don't suspend any of those threads + Thread current = Thread.currentThread (); + ThreadGroup jdwpGroup = current.getThreadGroup (); + + // Find the root ThreadGroup + ThreadGroup group = jdwpGroup; + ThreadGroup parent = group.getParent (); + while (parent != null) + { + group = parent; + parent = group.getParent (); + } + + // Get all the threads in the system + int num = group.activeCount (); + Thread[] threads = new Thread[num]; + group.enumerate (threads); + + for (int i = 0; i < num; ++i) + { + Thread t = threads[i]; + if (t != null) + { + if (t.getThreadGroup () == jdwpGroup || t == current) + { + // Don't suspend the current thread or any JDWP thread + continue; + } + else + suspendThread (t); + } + } + + // Now suspend the current thread + suspendThread (current); + } + + /** + * Resume a thread. A thread must be resumed as many times + * as it has been suspended. + * + * @param thread the thread to resume + */ + public static void resumeThread (Thread thread) + throws JdwpException { + System.out.println("resumeThread"); + } + + /** + * Resume all threads. This simply decrements the thread's + * suspend count. It can not be used to force the application + * to run. + */ + public static void resumeAllThreads () + throws JdwpException + { + // Our JDWP thread group -- don't resume + Thread current = Thread.currentThread (); + ThreadGroup jdwpGroup = current.getThreadGroup (); + + // Find the root ThreadGroup + ThreadGroup group = jdwpGroup; + ThreadGroup parent = group.getParent (); + while (parent != null) + { + group = parent; + parent = group.getParent (); + } + + // Get all the threads in the system + int num = group.activeCount (); + Thread[] threads = new Thread[num]; + group.enumerate (threads); + + for (int i = 0; i < num; ++i) + { + Thread t = threads[i]; + if (t != null) + { + if (t.getThreadGroup () == jdwpGroup || t == current) + { + // Don't resume the current thread or any JDWP thread + continue; + } + else + resumeThread (t); + } + } + } + + /** + * Get the suspend count for a give thread + * + * @param thread the thread whose suspend count is desired + * @return the number of times the thread has been suspended + */ + public static int getSuspendCount (Thread thread) + throws JdwpException { + System.out.println("getSuspendCount"); + return 0; + } + + /** + * Returns a count of the number of loaded classes in the VM + */ + public static int getAllLoadedClassesCount () + throws JdwpException { + System.out.println("getAllLoadedClassesCount"); + return 0; + } + + /** + * Returns an iterator over all the loaded classes in the VM + */ + public static Iterator getAllLoadedClasses () + throws JdwpException { + System.out.println("getAllLoadedClasses"); + ArrayList a = new ArrayList(); + a.add(String.class); + a.add(Object.class); + a.add(Integer.class); + a.add(EmuVirtualMachine.class); + return a.iterator(); + } + + /** + * Returns the status of the given class + * + * @param clazz the class whose status is desired + * @return a flag containing the class's status + * @see gnu.classpath.jdwp.JdwpConstants.ClassStatus + */ + public static int getClassStatus (Class clazz) + throws JdwpException { + System.out.println("getClassStatus"); + return 0; + } + + /** + * Returns all of the methods defined in the given class. This + * includes all methods, constructors, and class initializers. + * + * @param klass the class whose methods are desired + * @return an array of virtual machine methods + */ + public static VMMethod[] getAllClassMethods (Class klass) + throws JdwpException { + System.out.println("getAllClassMethods"); + return new VMMethod[0]; + } + + /** + * A factory method for getting valid virtual machine methods + * which may be passed to/from the debugger. + * + * @param klass the class in which the method is defined + * @param id the ID of the desired method + * @return the desired internal representation of the method + * @throws gnu.classpath.jdwp.exception.InvalidMethodException if the method is not defined + * in the class + * @throws gnu.classpath.jdwp.exception.JdwpException for any other error + */ + public static VMMethod getClassMethod(Class klass, long id) + throws JdwpException { + System.out.println("getClassMethod"); + return null; + } + + /** + * Returns the thread's call stack + * + * @param thread thread for which to get call stack + * @param start index of first frame to return + * @param length number of frames to return (-1 for all frames) + * @return a list of frames + */ + public static ArrayList getFrames (Thread thread, int start, + int length) + throws JdwpException { + System.out.println("getFrames"); + return new ArrayList(); + } + + /** + * Returns the frame for a given thread with the frame ID in + * the buffer + * + * I don't like this. + * + * @param thread the frame's thread + * @param bb buffer containing the frame's ID + * @return the desired frame + */ + public static VMFrame getFrame (Thread thread, ByteBuffer bb) + throws JdwpException { + System.out.println("getFrame"); + return null; + } + + /** + * Returns the number of frames in the thread's stack + * + * @param thread the thread for which to get a frame count + * @return the number of frames in the thread's stack + */ + public static int getFrameCount (Thread thread) + throws JdwpException { + System.out.println("getFrameCount"); + return 0; + } + + + /** + * Returns the status of a thread + * + * @param thread the thread for which to get status + * @return integer status of the thread + * @see gnu.classpath.jdwp.JdwpConstants.ThreadStatus + */ + public static int getThreadStatus (Thread thread) + throws JdwpException { + System.out.println("getThreadStatus"); + return 0; + } + + /** + * Returns a list of all classes which this class loader has been + * requested to load + * + * @param cl the class loader + * @return a list of all visible classes + */ + public static ArrayList getLoadRequests (ClassLoader cl) + throws JdwpException { + System.out.println("getLoadRequests"); + return new ArrayList(); + } + + /** + * Executes a method in the virtual machine + * + * @param obj instance in which to invoke method (null for static) + * @param thread the thread in which to invoke the method + * @param clazz the class in which the method is defined + * @param method the method to invoke + * @param values arguments to pass to method + * @param nonVirtual "otherwise, normal virtual invoke + * (instance methods only) " + * @return a result object containing the results of the invocation + */ + public static MethodResult executeMethod (Object obj, Thread thread, + Class clazz, Method method, + Object[] values, + boolean nonVirtual) + throws JdwpException { + System.out.println("executeMethod"); + return null; + } + + /** + * "Returns the name of source file in which a reference type was declared" + * + * @param clazz the class for which to return a source file + * @return a string containing the source file name; "no path information + * for the file is included" + */ + public static String getSourceFile (Class clazz) + throws JdwpException { + System.out.println("getSourceFile"); + return null; + } + + /** + * Register a request from the debugger + * + * Virtual machines have two options. Either do nothing and allow + * the event manager to take care of the request (useful for broadcast-type + * events like class prepare/load/unload, thread start/end, etc.) + * or do some internal work to set up the event notification (useful for + * execution-related events like breakpoints, single-stepping, etc.). + */ + public static void registerEvent (EventRequest request) + throws JdwpException { + System.out.println("registerEvent " + request.getId() + " " + request.getEventKind() + " " + + request.getSuspendPolicy() + " " + request.getFilters()); + + if(request.getEventKind() == JdwpConstants.EventKind.VM_INIT) { + new Thread(){ + @Override + public void run() { + try { + Thread.sleep(1000); + Jdwp.notify(new VmInitEvent(Thread.currentThread())); + Jdwp.notify(new ClassPrepareEvent(Thread.currentThread(), Class.class, 0)); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + }.start(); + } + } + + /** + * Unregisters the given request + * + * @param request the request to unregister + */ + public static void unregisterEvent (EventRequest request) + throws JdwpException { + System.out.println("unregisterEvent"); + + } + + + /** + * Clear all events of the given kind + * + * @param kind the type of events to clear + */ + public static void clearEvents (byte kind) + throws JdwpException { + System.out.println("clearEvents"); + } + + public static void redefineClass(Class old_class, byte[] classData) { + System.out.println("redefineClass"); + } +} Added: trunk/core/src/emu/gnu/classpath/jdwp/Main.java =================================================================== --- trunk/core/src/emu/gnu/classpath/jdwp/Main.java (rev 0) +++ trunk/core/src/emu/gnu/classpath/jdwp/Main.java 2011-06-25 21:07:57 UTC (rev 5826) @@ -0,0 +1,59 @@ +package gnu.classpath.jdwp; + +import gnu.classpath.jdwp.transport.JNodeSocketTransport; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; + +/** + * User: lsantha + * Date: 6/25/11 5:13 PM + */ +public class Main { + private static final String str_quit = "Type 'q' to exit"; + + private static final int DEFAULT_PORT = 6789; + + private boolean up = true; + + public static void main(String[] args) throws Exception { + new Main().execute(); + } + + public void execute() throws Exception { + // FIXME - in the even of internal exceptions, JDWP writes to System.out. + final String ps = "transport=dt_socket,suspend=n,address=" + DEFAULT_PORT + ",server=y"; + Thread t = new Thread(new Runnable() { + public void run() { + while (up()) { + Jdwp jdwp = new Jdwp(); + jdwp.configure(ps); + jdwp.run(); + jdwp.waitToFinish(); + jdwp.shutdown(); + } + // workaround for the restricted capabilities of JDWP support in GNU Classpath. + JNodeSocketTransport.ServerSocketHolder.close(); + } + }); + t.start(); + + Reader in = new InputStreamReader(System.in); + PrintWriter out = new PrintWriter(System.out); + while (in.read() != 'q') { + out.println(str_quit); + } + // FIXME - this just stops the 'debug' command. The listener will keep running + // until the remote debugger disconnects. We should have a way to disconnect at + // this end. + down(); + } + + public synchronized boolean up() { + return up; + } + + public synchronized void down() { + up = false; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2012-12-27 15:09:05
|
Revision: 5943 http://jnode.svn.sourceforge.net/jnode/?rev=5943&view=rev Author: galatnm Date: 2012-12-27 15:08:56 +0000 (Thu, 27 Dec 2012) Log Message: ----------- CORE : Add unit tests for PluginDescriptorModel Modified Paths: -------------- trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginPrerequisiteModel.java Added Paths: ----------- trunk/core/src/test/org/jnode/plugin/ trunk/core/src/test/org/jnode/plugin/model/ trunk/core/src/test/org/jnode/plugin/model/PluginDescriptorModelTest.java Modified: trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java 2012-12-21 15:21:18 UTC (rev 5942) +++ trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java 2012-12-27 15:08:56 UTC (rev 5943) @@ -17,12 +17,13 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.plugin.model; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; + import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.ConfigurationElement; import org.jnode.plugin.PluginException; @@ -32,72 +33,76 @@ */ final class ConfigurationElementModel extends PluginModelObject implements ConfigurationElement { + /** Name of the current configuration element. */ private final String name; private final AttributeModel[] attributes; + /** Child elements of the current configuration element. */ private final ConfigurationElement[] elements; /** - * Create a new instance - * - * @param e + * Create new instance of configuration element model. + * + * @param plugin The model for plugin descriptor. + * @param element An XML element. + * @throws PluginException */ - public ConfigurationElementModel(PluginDescriptorModel plugin, XMLElement e) - throws PluginException { + public ConfigurationElementModel(PluginDescriptorModel plugin, XMLElement element) + throws PluginException { super(plugin); - name = e.getName(); + name = element.getName(); - final Set<String> aI = e.attributeNames(); - if (!aI.isEmpty()) { + final Set<String> attributeNames = element.attributeNames(); + if (!attributeNames.isEmpty()) { final ArrayList<AttributeModel> list = new ArrayList<AttributeModel>(); - for (String name : aI) { - final String value = e.getStringAttribute(name); + for (String name : attributeNames) { + final String value = element.getStringAttribute(name); list.add(new AttributeModel(name, value)); if (value == null) { throw new PluginException("Cannot find attribute value for attribute " + name); } - //System.out.println("name[" + name + "] value[" + value + "]"); } - attributes = (AttributeModel[]) list.toArray(new AttributeModel[list.size()]); + attributes = list.toArray(new AttributeModel[list.size()]); } else { attributes = null; } - final ArrayList<ConfigurationElementModel> list = new ArrayList<ConfigurationElementModel>(); - for (final XMLElement ce : e.getChildren()) { + final ArrayList<ConfigurationElementModel> list = + new ArrayList<ConfigurationElementModel>(); + for (final XMLElement ce : element.getChildren()) { list.add(new ConfigurationElementModel(plugin, ce)); } - elements = (ConfigurationElement[]) list.toArray(new ConfigurationElement[list.size()]); + elements = list.toArray(new ConfigurationElement[list.size()]); } /** * Gets the value of an attribute with a given name - * - * @param name - * @return The attribute value, or null if not found + * + * @param name Name of the element. + * @return The attribute value, or null if not found. */ + @Override public String getAttribute(String name) { if (attributes != null) { - final int max = attributes.length; - for (int i = 0; i < max; i++) { - if (attributes[i].getName().equals(name)) { - return attributes[i].getValue(); + for (AttributeModel attribute : attributes) + if (attribute.equals(name)) { + return attribute.getValue(); } - } } return null; } - /** * Gets the names of all attributes in this element. - * - * @return + * + * @return A set of attribute names. This set can be empty if no attributes + * found. */ + @Override public Set<String> attributeNames() { final HashSet<String> set = new HashSet<String>(); if (attributes != null) { - for (AttributeModel attr : attributes) { - set.add(attr.getName()); + for (AttributeModel attribute : attributes) { + set.add(attribute.getName()); } } return set; @@ -106,6 +111,7 @@ /** * Gets all child elements */ + @Override public ConfigurationElement[] getElements() { return elements; } @@ -113,14 +119,15 @@ /** * Gets the name of this element */ + @Override public String getName() { return name; } - /** * Resolve all references to (elements of) other plugin descriptors */ + @Override protected void resolve(PluginRegistryModel registry) { // Do nothing } @@ -128,14 +135,17 @@ /** * Remove all references to (elements of) other plugin descriptors */ + @Override protected void unresolve(PluginRegistryModel registry) { // Do nothing } + @Override public String toString() { StringBuilder tmp = new StringBuilder(name); for (AttributeModel attr : attributes) { - tmp.append(' ').append(attr.getName()).append("=\"").append(attr.getValue()).append('\"'); + tmp.append(' ').append(attr.getName()).append("=\"").append(attr.getValue()) + .append('\"'); } return tmp.toString(); } Modified: trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2012-12-21 15:21:18 UTC (rev 5942) +++ trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2012-12-27 15:08:56 UTC (rev 5943) @@ -111,25 +111,25 @@ /** * Create a new instance * - * @param e the root XMLElement for the XML plugin descriptor + * @param rootElement the root XMLElement for the XML plugin descriptor * @param jarFile the PluginJar object to associate with the descriptor. */ - PluginDescriptorModel(PluginJar jarFile, XMLElement e) + PluginDescriptorModel(PluginJar jarFile, XMLElement rootElement) throws PluginException { this.jarFile = jarFile; this.fragments = new BootableArrayList<FragmentDescriptorModel>(); - id = getAttribute(e, "id", true); - name = getAttribute(e, "name", true); - providerName = getAttribute(e, "provider-name", false); - providerUrl = getAttribute(e, "provider-url", false); - licenseName = getAttribute(e, "license-name", true); - licenseUrl = getAttribute(e, "license-url", false); - version = getAttribute(e, "version", true); - className = getAttribute(e, "class", false); - system = getBooleanAttribute(e, "system", false); - autoStart = getBooleanAttribute(e, "auto-start", false); + id = getAttribute(rootElement, "id", true); + name = getAttribute(rootElement, "name", true); + providerName = getAttribute(rootElement, "provider-name", false); + providerUrl = getAttribute(rootElement, "provider-url", false); + licenseName = getAttribute(rootElement, "license-name", true); + licenseUrl = getAttribute(rootElement, "license-url", false); + version = getAttribute(rootElement, "version", true); + className = getAttribute(rootElement, "class", false); + system = getBooleanAttribute(rootElement, "system", false); + autoStart = getBooleanAttribute(rootElement, "auto-start", false); priority = Math.min(MAX_PRIORITY, Math.max(MIN_PRIORITY, - getIntAttribute(e, "priority", DEFAULT_PRIORITY))); + getIntAttribute(rootElement, "priority", DEFAULT_PRIORITY))); // if (registry != null) { // registry.registerPlugin(this); @@ -140,9 +140,9 @@ final ArrayList<PluginPrerequisiteModel> reqList = new ArrayList<PluginPrerequisiteModel>(); RuntimeModel runtime = null; - initializeRequiresList(reqList, e); + initializeRequiresList(reqList, rootElement); - for (final XMLElement childE : e.getChildren()) { + for (final XMLElement childE : rootElement.getChildren()) { final String tag = childE.getName(); if (tag.equals("extension-point")) { final ExtensionPointModel ep = new ExtensionPointModel(this, Modified: trunk/core/src/core/org/jnode/plugin/model/PluginPrerequisiteModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginPrerequisiteModel.java 2012-12-21 15:21:18 UTC (rev 5942) +++ trunk/core/src/core/org/jnode/plugin/model/PluginPrerequisiteModel.java 2012-12-27 15:08:56 UTC (rev 5943) @@ -29,7 +29,7 @@ */ final class PluginPrerequisiteModel extends PluginModelObject implements PluginPrerequisite { - private final String plugin; + private final String pluginIdentifier; private final String version; /** @@ -42,7 +42,7 @@ public PluginPrerequisiteModel(PluginDescriptorModel plugin, XMLElement e) throws PluginException { super(plugin); - this.plugin = getAttribute(e, "plugin", true); + this.pluginIdentifier = getAttribute(e, "plugin", true); final String version = getAttribute(e, "version", false); if (version != null) { this.version = version; @@ -55,19 +55,19 @@ * Initialize this instance. * * @param plugin - * @param pluginId + * @param pluginIdentifier * @param pluginVersion */ public PluginPrerequisiteModel(PluginDescriptorModel plugin, - String pluginId, String pluginVersion) { + String pluginIdentifier, String pluginVersion) { super(plugin); - if (pluginId == null) { + if (pluginIdentifier == null) { throw new IllegalArgumentException("pluginId is null"); } if (pluginVersion == null) { throw new IllegalArgumentException("pluginVersion is null"); } - this.plugin = pluginId; + this.pluginIdentifier = pluginIdentifier; this.version = pluginVersion; } @@ -75,7 +75,7 @@ * Gets the identifier of the plugin that is required */ public String getPluginId() { - return plugin; + return pluginIdentifier; } @@ -97,9 +97,9 @@ */ protected void resolve(PluginRegistryModel registry) throws PluginException { - if (registry.getPluginDescriptor(plugin) == null) { + if (registry.getPluginDescriptor(pluginIdentifier) == null) { throw new PluginException( - "Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); + "Unknown plugin " + pluginIdentifier + " in import of " + getDeclaringPluginDescriptor().getId()); } } Added: trunk/core/src/test/org/jnode/plugin/model/PluginDescriptorModelTest.java =================================================================== --- trunk/core/src/test/org/jnode/plugin/model/PluginDescriptorModelTest.java (rev 0) +++ trunk/core/src/test/org/jnode/plugin/model/PluginDescriptorModelTest.java 2012-12-27 15:08:56 UTC (rev 5943) @@ -0,0 +1,110 @@ +package org.jnode.plugin.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import org.jnode.nanoxml.XMLElement; +import org.jnode.plugin.Extension; +import org.jnode.plugin.PluginException; +import org.jnode.plugin.PluginPrerequisite; +import org.jnode.plugin.PluginReference; +import org.junit.Before; +import org.junit.Test; + +public class PluginDescriptorModelTest { + + private PluginDescriptorModel model; + + @Before + public void setUp() throws PluginException { + XMLElement element = new XMLElement(); + element.parseString("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plugin SYSTEM \"jnode.dtd\"><plugin id=\"model1\" name=\"model1 name\" version=\"version\" provider-name=\"provider\" license-name=\"lgpl\"><requires><import plugin=\"plug1\"/><import plugin=\"plug2\"/></requires><runtime><library name=\"plugin.jar\"><export name=\"content.*\"/></library></runtime><extension point=\"extension\"><alias name=\"alias\" class=\"class\"/></extension></plugin>"); + model = new PluginDescriptorModel(element); + } + + @Test + public void testGetId() { + assertEquals("model1", model.getId()); + } + + @Test + public void testGetName() { + assertEquals("model1 name", model.getName()); + } + + @Test + public void testGetVersion() { + assertEquals("version", model.getVersion()); + } + + @Test + public void testGetProvider() { + assertEquals("provider", model.getProviderName()); + assertNull(model.getProviderUrl()); + } + + @Test + public void testGetLicence() { + assertEquals("lgpl", model.getLicenseName()); + assertNull(model.getLicenseUrl()); + } + + @Test + public void testGetPrerequisites() { + PluginPrerequisite[] prerequisites = model.getPrerequisites(); + assertEquals(2, prerequisites.length); + + } + + @Test + public void testDependencyFound() { + assertTrue(model.depends("plug1")); + } + + @Test + public void testDependencyNotFound() { + assertFalse(model.depends("plug3")); + } + + @Test + public void testGetExtension() { + Extension[] extensions = model.getExtensions(); + assertEquals(1, extensions.length); + } + + @Test + public void testGetRuntime() { + org.jnode.plugin.Runtime runtime = model.getRuntime(); + assertEquals(1, runtime.getLibraries().length); + } + + @Test + public void testHasCustomPluginClass() { + assertFalse(model.hasCustomPluginClass()); + } + + @Test + public void testIsAutoStart() { + assertFalse(model.isAutoStart()); + } + + @Test + public void testNoPriorityDefined() { + assertEquals(5, model.getPriority()); + } + + @Test + public void testToString() { + assertEquals("model1", model.toString()); + model.getPluginReference(); + } + + @Test + public void testGetPluginReference() { + PluginReference reference = model.getPluginReference(); + assertEquals("model1", reference.getId()); + assertEquals("version", reference.getVersion()); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2013-01-08 23:19:24
|
Revision: 5944 http://jnode.svn.sourceforge.net/jnode/?rev=5944&view=rev Author: lsantha Date: 2013-01-08 23:19:18 +0000 (Tue, 08 Jan 2013) Log Message: ----------- FIxed broken build. Modified Paths: -------------- trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java trunk/core/src/test/org/jnode/plugin/model/PluginDescriptorModelTest.java Modified: trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java 2012-12-27 15:08:56 UTC (rev 5943) +++ trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java 2013-01-08 23:19:18 UTC (rev 5944) @@ -8,13 +8,13 @@ * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but + * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., + * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ @@ -41,7 +41,7 @@ /** * Create new instance of configuration element model. - * + * * @param plugin The model for plugin descriptor. * @param element An XML element. * @throws PluginException @@ -76,7 +76,7 @@ /** * Gets the value of an attribute with a given name - * + * * @param name Name of the element. * @return The attribute value, or null if not found. */ @@ -84,7 +84,7 @@ public String getAttribute(String name) { if (attributes != null) { for (AttributeModel attribute : attributes) - if (attribute.equals(name)) { + if (attribute.getName().equals(name)) { return attribute.getValue(); } } @@ -93,7 +93,7 @@ /** * Gets the names of all attributes in this element. - * + * * @return A set of attribute names. This set can be empty if no attributes * found. */ Modified: trunk/core/src/test/org/jnode/plugin/model/PluginDescriptorModelTest.java =================================================================== --- trunk/core/src/test/org/jnode/plugin/model/PluginDescriptorModelTest.java 2012-12-27 15:08:56 UTC (rev 5943) +++ trunk/core/src/test/org/jnode/plugin/model/PluginDescriptorModelTest.java 2013-01-08 23:19:18 UTC (rev 5944) @@ -1,5 +1,6 @@ package org.jnode.plugin.model; - +//TODO FIX THIS TO NOT BREAK THE BUILD +/* import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; @@ -13,6 +14,7 @@ import org.junit.Before; import org.junit.Test; + public class PluginDescriptorModelTest { private PluginDescriptorModel model; @@ -108,3 +110,4 @@ assertEquals("version", reference.getVersion()); } } +*/ \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2013-02-17 20:50:39
|
Revision: 5956 http://jnode.svn.sourceforge.net/jnode/?rev=5956&view=rev Author: lsantha Date: 2013-02-17 20:50:10 +0000 (Sun, 17 Feb 2013) Log Message: ----------- Updated headers. Modified Paths: -------------- trunk/core/src/classlib/org/jnode/annotation/AllowedPackages.java trunk/core/src/classlib/org/jnode/annotation/CheckPermission.java trunk/core/src/classlib/org/jnode/annotation/DoPrivileged.java trunk/core/src/classlib/org/jnode/annotation/Inline.java trunk/core/src/classlib/org/jnode/annotation/Internal.java trunk/core/src/classlib/org/jnode/annotation/KernelSpace.java trunk/core/src/classlib/org/jnode/annotation/LoadStatics.java trunk/core/src/classlib/org/jnode/annotation/MagicPermission.java trunk/core/src/classlib/org/jnode/annotation/NoFieldAlignments.java trunk/core/src/classlib/org/jnode/annotation/NoInline.java trunk/core/src/classlib/org/jnode/annotation/NoReadBarrier.java trunk/core/src/classlib/org/jnode/annotation/NoWriteBarrier.java trunk/core/src/classlib/org/jnode/annotation/PrivilegedActionPragma.java trunk/core/src/classlib/org/jnode/annotation/SharedStatics.java trunk/core/src/classlib/org/jnode/annotation/Uninterruptible.java trunk/core/src/classlib/org/jnode/java/io/VMFileHandle.java trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java trunk/core/src/classlib/org/jnode/java/nio/VmChannel.java trunk/core/src/classpath/ext/java/nio/channels/LinkChannel.java trunk/core/src/classpath/ext/java/util/prefs/TransientPreferences.java trunk/core/src/classpath/ext/javax/cache/Cache.java trunk/core/src/classpath/ext/javax/cache/CacheEntry.java trunk/core/src/classpath/ext/javax/cache/CacheException.java trunk/core/src/classpath/ext/javax/cache/CacheFactory.java trunk/core/src/classpath/ext/javax/cache/CacheListener.java trunk/core/src/classpath/ext/javax/cache/CacheLoader.java trunk/core/src/classpath/ext/javax/cache/CacheManager.java trunk/core/src/classpath/ext/javax/cache/CacheStatistics.java trunk/core/src/classpath/ext/javax/cache/EvictionStrategy.java trunk/core/src/classpath/ext/javax/isolate/AbstractLinkMessageHandler.java trunk/core/src/classpath/ext/javax/isolate/ClosedLinkException.java trunk/core/src/classpath/ext/javax/isolate/Isolate.java trunk/core/src/classpath/ext/javax/isolate/IsolatePermission.java trunk/core/src/classpath/ext/javax/isolate/IsolateStartupException.java trunk/core/src/classpath/ext/javax/isolate/IsolateStatus.java trunk/core/src/classpath/ext/javax/isolate/Link.java trunk/core/src/classpath/ext/javax/isolate/LinkMessage.java trunk/core/src/classpath/ext/javax/isolate/LinkMessageDispatcher.java trunk/core/src/classpath/ext/javax/isolate/LinkMessageHandler.java trunk/core/src/classpath/ext/javax/isolate/StreamBindings.java trunk/core/src/classpath/vm/gnu/classpath/NativeSystemProperties.java trunk/core/src/classpath/vm/gnu/classpath/NativeVMStackWalker.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/JDIVirtualMachine.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMFrame.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMMethod.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/JNodeSocketTransport.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/NativeTransportFactory.java trunk/core/src/classpath/vm/gnu/java/security/action/GetEnvAction.java trunk/core/src/classpath/vm/gnu/java/security/action/GetPolicyAction.java trunk/core/src/classpath/vm/gnu/java/security/action/GetPropertiesAction.java trunk/core/src/classpath/vm/gnu/java/security/action/InvokeAction.java trunk/core/src/classpath/vm/gnu/java/security/action/SetPropertyAction.java trunk/core/src/classpath/vm/gnu/java/security/util/SimplePermissionCollection.java trunk/core/src/classpath/vm/java/awt/VMAwtAPI.java trunk/core/src/classpath/vm/java/awt/image/VMImageAPI.java trunk/core/src/classpath/vm/java/awt/image/VMImageUtils.java trunk/core/src/classpath/vm/java/lang/NativeClassLoader.java trunk/core/src/classpath/vm/java/lang/NativeSecurityManager.java trunk/core/src/classpath/vm/java/lang/NativeThread.java trunk/core/src/classpath/vm/java/lang/NativeVMClassLoader.java trunk/core/src/classpath/vm/java/lang/ThreadHelper.java trunk/core/src/classpath/vm/java/lang/VMRuntime.java trunk/core/src/classpath/vm/java/lang/VMSecurityManager.java trunk/core/src/classpath/vm/java/net/ExSocketOptions.java trunk/core/src/classpath/vm/java/net/VMInetAddress.java trunk/core/src/classpath/vm/java/net/VMNetAPI.java trunk/core/src/classpath/vm/java/net/VMNetDevice.java trunk/core/src/classpath/vm/java/net/VMNetUtils.java trunk/core/src/classpath/vm/java/net/VMNetworkInterface.java trunk/core/src/classpath/vm/java/nio/MemoryRawData.java trunk/core/src/classpath/vm/java/nio/NativeVMDirectByteBuffer.java trunk/core/src/classpath/vm/java/nio/channels/NativeVMChannels.java trunk/core/src/classpath/vm/java/security/NativeAccessControlContext.java trunk/core/src/classpath/vm/java/security/NativeAccessController.java trunk/core/src/classpath/vm/java/security/VMSecureRandom.java trunk/core/src/classpath/vm/javax/imageio/spi/NativeIIORegistry.java trunk/core/src/core/org/jnode/assembler/BootImageNativeStream.java trunk/core/src/core/org/jnode/assembler/Label.java trunk/core/src/core/org/jnode/assembler/NativeStream.java trunk/core/src/core/org/jnode/assembler/ObjectResolver.java trunk/core/src/core/org/jnode/assembler/UnresolvedObjectRefException.java trunk/core/src/core/org/jnode/assembler/x86/InvalidOpcodeException.java trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86Constants.java trunk/core/src/core/org/jnode/assembler/x86/X86Operation.java trunk/core/src/core/org/jnode/assembler/x86/X86Register.java trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86Utils.java trunk/core/src/core/org/jnode/boot/InitJarProcessor.java trunk/core/src/core/org/jnode/boot/Main.java trunk/core/src/core/org/jnode/boot/MemoryResourceInputStream.java trunk/core/src/core/org/jnode/boot/NoCloseInputStream.java trunk/core/src/core/org/jnode/bootlog/BootLog.java trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java trunk/core/src/core/org/jnode/debug/RemoteAppender.java trunk/core/src/core/org/jnode/debug/RemoteReceiver.java trunk/core/src/core/org/jnode/debug/UDPOutputStream.java trunk/core/src/core/org/jnode/debugger/DebugState.java trunk/core/src/core/org/jnode/debugger/Debugger.java trunk/core/src/core/org/jnode/debugger/DebuggerPlugin.java trunk/core/src/core/org/jnode/debugger/DebuggerUtils.java trunk/core/src/core/org/jnode/debugger/RootState.java trunk/core/src/core/org/jnode/debugger/ThreadListState.java trunk/core/src/core/org/jnode/debugger/ThreadState.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoder.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoderAdapter.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGException.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReader.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReaderSpi.java trunk/core/src/core/org/jnode/log4j/config/JNodeSystemAppender.java trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java trunk/core/src/core/org/jnode/log4j/config/UnsafeDebugAppender.java trunk/core/src/core/org/jnode/log4j/config/VirtualConsoleAppender.java trunk/core/src/core/org/jnode/naming/AbstractNameSpace.java trunk/core/src/core/org/jnode/naming/InitialNaming.java trunk/core/src/core/org/jnode/naming/NameSpace.java trunk/core/src/core/org/jnode/naming/NameSpaceListener.java trunk/core/src/core/org/jnode/permission/JNodePermission.java trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java trunk/core/src/core/org/jnode/plugin/ConfigurationElement.java trunk/core/src/core/org/jnode/plugin/Extension.java trunk/core/src/core/org/jnode/plugin/ExtensionPoint.java trunk/core/src/core/org/jnode/plugin/ExtensionPointListener.java trunk/core/src/core/org/jnode/plugin/FragmentDescriptor.java trunk/core/src/core/org/jnode/plugin/Library.java trunk/core/src/core/org/jnode/plugin/Plugin.java trunk/core/src/core/org/jnode/plugin/PluginClassLoader.java trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java trunk/core/src/core/org/jnode/plugin/PluginDescriptorListener.java trunk/core/src/core/org/jnode/plugin/PluginException.java trunk/core/src/core/org/jnode/plugin/PluginLoader.java trunk/core/src/core/org/jnode/plugin/PluginLoaderManager.java trunk/core/src/core/org/jnode/plugin/PluginManager.java trunk/core/src/core/org/jnode/plugin/PluginPrerequisite.java trunk/core/src/core/org/jnode/plugin/PluginReference.java trunk/core/src/core/org/jnode/plugin/PluginRegistry.java trunk/core/src/core/org/jnode/plugin/PluginSecurityConstants.java trunk/core/src/core/org/jnode/plugin/PluginUtils.java trunk/core/src/core/org/jnode/plugin/Runtime.java trunk/core/src/core/org/jnode/plugin/URLPluginLoader.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginLoaderManager.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java trunk/core/src/core/org/jnode/plugin/model/AbstractModelObject.java trunk/core/src/core/org/jnode/plugin/model/AttributeModel.java trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java trunk/core/src/core/org/jnode/plugin/model/EmptyPlugin.java trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java trunk/core/src/core/org/jnode/plugin/model/Factory.java trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginJar.java trunk/core/src/core/org/jnode/plugin/model/PluginModelObject.java trunk/core/src/core/org/jnode/plugin/model/PluginPrerequisiteModel.java trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginsClassLoader.java trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java trunk/core/src/core/org/jnode/protocol/plugin/Handler.java trunk/core/src/core/org/jnode/protocol/plugin/PluginURLConnection.java trunk/core/src/core/org/jnode/protocol/system/Handler.java trunk/core/src/core/org/jnode/protocol/system/SystemURLConnection.java trunk/core/src/core/org/jnode/security/JNodePolicy.java trunk/core/src/core/org/jnode/security/JNodeSecurityManager.java trunk/core/src/core/org/jnode/security/SecurityPlugin.java trunk/core/src/core/org/jnode/system/event/FocusEvent.java trunk/core/src/core/org/jnode/system/event/FocusListener.java trunk/core/src/core/org/jnode/system/event/SystemEvent.java trunk/core/src/core/org/jnode/system/repository/Repository.java trunk/core/src/core/org/jnode/system/repository/RepositoryPlugin.java trunk/core/src/core/org/jnode/system/repository/RepositoryPluginLoader.java trunk/core/src/core/org/jnode/system/repository/SystemRepository.java trunk/core/src/core/org/jnode/system/repository/SystemRepositoryPlugin.java trunk/core/src/core/org/jnode/system/repository/plugins/PluginLoaderPlugin.java trunk/core/src/core/org/jnode/system/repository/spi/SystemRepositoryProvider.java trunk/core/src/core/org/jnode/system/resource/DMAException.java trunk/core/src/core/org/jnode/system/resource/DMAManager.java trunk/core/src/core/org/jnode/system/resource/DMAResource.java trunk/core/src/core/org/jnode/system/resource/IOResource.java trunk/core/src/core/org/jnode/system/resource/IRQHandler.java trunk/core/src/core/org/jnode/system/resource/IRQResource.java trunk/core/src/core/org/jnode/system/resource/MemoryResource.java trunk/core/src/core/org/jnode/system/resource/MemoryScanner.java trunk/core/src/core/org/jnode/system/resource/MultiMediaMemoryResource.java trunk/core/src/core/org/jnode/system/resource/Resource.java trunk/core/src/core/org/jnode/system/resource/ResourceManager.java trunk/core/src/core/org/jnode/system/resource/ResourceNotFreeException.java trunk/core/src/core/org/jnode/system/resource/ResourceOwner.java trunk/core/src/core/org/jnode/system/resource/ResourcePermission.java trunk/core/src/core/org/jnode/system/resource/SimpleResourceOwner.java trunk/core/src/core/org/jnode/system/x86/DMA.java trunk/core/src/core/org/jnode/system/x86/DMAConstants.java trunk/core/src/core/org/jnode/system/x86/DMAPlugin.java trunk/core/src/core/org/jnode/system/x86/X86DMAChannel.java trunk/core/src/core/org/jnode/util/AccessControllerUtils.java trunk/core/src/core/org/jnode/util/BCDUtils.java trunk/core/src/core/org/jnode/util/BeanUtils.java trunk/core/src/core/org/jnode/util/BigEndian.java trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java trunk/core/src/core/org/jnode/util/BooleanUtils.java trunk/core/src/core/org/jnode/util/ByteBufferInputStream.java trunk/core/src/core/org/jnode/util/ByteBufferUtils.java trunk/core/src/core/org/jnode/util/ByteQueue.java trunk/core/src/core/org/jnode/util/ByteQueueProcessor.java trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java trunk/core/src/core/org/jnode/util/ChannelInputStream.java trunk/core/src/core/org/jnode/util/ChannelOutputStream.java trunk/core/src/core/org/jnode/util/Command.java trunk/core/src/core/org/jnode/util/ConsoleStream.java trunk/core/src/core/org/jnode/util/DecimalScaleFactor.java trunk/core/src/core/org/jnode/util/EmptyInputStream.java trunk/core/src/core/org/jnode/util/FileUtils.java trunk/core/src/core/org/jnode/util/IOUtils.java trunk/core/src/core/org/jnode/util/JarBuffer.java trunk/core/src/core/org/jnode/util/JarConstants.java trunk/core/src/core/org/jnode/util/LittleEndian.java trunk/core/src/core/org/jnode/util/NumberUtils.java trunk/core/src/core/org/jnode/util/ObjectArrayIterator.java trunk/core/src/core/org/jnode/util/ObjectUtils.java trunk/core/src/core/org/jnode/util/OsUtils.java trunk/core/src/core/org/jnode/util/PipeStream.java trunk/core/src/core/org/jnode/util/ProxyStream.java trunk/core/src/core/org/jnode/util/ProxyStreamException.java trunk/core/src/core/org/jnode/util/Queue.java trunk/core/src/core/org/jnode/util/QueueProcessor.java trunk/core/src/core/org/jnode/util/QueueProcessorThread.java trunk/core/src/core/org/jnode/util/ReaderInputStream.java trunk/core/src/core/org/jnode/util/ScaleFactor.java trunk/core/src/core/org/jnode/util/SizeUnit.java trunk/core/src/core/org/jnode/util/StopWatch.java trunk/core/src/core/org/jnode/util/SystemInputStream.java trunk/core/src/core/org/jnode/util/TimeUtils.java trunk/core/src/core/org/jnode/util/TimeoutException.java trunk/core/src/core/org/jnode/util/Token.java trunk/core/src/core/org/jnode/util/WriterOutputStream.java trunk/core/src/core/org/jnode/vm/AllocationBitmap.java trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java trunk/core/src/core/org/jnode/vm/BootLogImpl.java trunk/core/src/core/org/jnode/vm/CpuID.java trunk/core/src/core/org/jnode/vm/DefaultNameSpace.java trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java trunk/core/src/core/org/jnode/vm/IOContext.java trunk/core/src/core/org/jnode/vm/IOResourceImpl.java trunk/core/src/core/org/jnode/vm/InternString.java trunk/core/src/core/org/jnode/vm/JvmType.java trunk/core/src/core/org/jnode/vm/LoadCompileService.java trunk/core/src/core/org/jnode/vm/LoadCompileThread.java trunk/core/src/core/org/jnode/vm/MathSupport.java trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java trunk/core/src/core/org/jnode/vm/MemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/MemoryScannerImpl.java trunk/core/src/core/org/jnode/vm/MultiMediaMemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/RTCService.java trunk/core/src/core/org/jnode/vm/Region.java trunk/core/src/core/org/jnode/vm/ResourceLoader.java trunk/core/src/core/org/jnode/vm/ResourceManagerImpl.java trunk/core/src/core/org/jnode/vm/SoftByteCodes.java trunk/core/src/core/org/jnode/vm/Unsafe.java trunk/core/src/core/org/jnode/vm/VirtualMemoryRegion.java trunk/core/src/core/org/jnode/vm/VmAbstractClassLoader.java trunk/core/src/core/org/jnode/vm/VmAccessControlContext.java trunk/core/src/core/org/jnode/vm/VmAccessController.java trunk/core/src/core/org/jnode/vm/VmAddress.java trunk/core/src/core/org/jnode/vm/VmExit.java trunk/core/src/core/org/jnode/vm/VmIOContext.java trunk/core/src/core/org/jnode/vm/VmImpl.java trunk/core/src/core/org/jnode/vm/VmJavaClassLoader.java trunk/core/src/core/org/jnode/vm/VmJavaMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/core/org/jnode/vm/VmMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/VmProcess.java trunk/core/src/core/org/jnode/vm/VmProcessClassLoader.java trunk/core/src/core/org/jnode/vm/VmReflection.java trunk/core/src/core/org/jnode/vm/VmStackFrame.java trunk/core/src/core/org/jnode/vm/VmStackFrameEnumerator.java trunk/core/src/core/org/jnode/vm/VmStackReader.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeFlags.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeParser.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeViewer.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeVisitorSupport.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeWriter.java trunk/core/src/core/org/jnode/vm/bytecode/ControlFlowGraph.java trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/DelegatingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/bytecode/StackException.java trunk/core/src/core/org/jnode/vm/bytecode/TypeStack.java trunk/core/src/core/org/jnode/vm/classmgr/AbstractCode.java trunk/core/src/core/org/jnode/vm/classmgr/AbstractExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/CompiledCodeList.java trunk/core/src/core/org/jnode/vm/classmgr/IMTBuilder.java trunk/core/src/core/org/jnode/vm/classmgr/Mangler.java trunk/core/src/core/org/jnode/vm/classmgr/MethodPragmaFlags.java trunk/core/src/core/org/jnode/vm/classmgr/Modifier.java trunk/core/src/core/org/jnode/vm/classmgr/NotResolvedYetException.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectFlags.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.java trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java trunk/core/src/core/org/jnode/vm/classmgr/Signature.java trunk/core/src/core/org/jnode/vm/classmgr/TIBBuilder.java trunk/core/src/core/org/jnode/vm/classmgr/TIBLayout.java trunk/core/src/core/org/jnode/vm/classmgr/TypePragmaFlags.java trunk/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java trunk/core/src/core/org/jnode/vm/classmgr/VmArray.java trunk/core/src/core/org/jnode/vm/classmgr/VmArrayClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmByteCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmCP.java trunk/core/src/core/org/jnode/vm/classmgr/VmClassLoader.java trunk/core/src/core/org/jnode/vm/classmgr/VmClassType.java trunk/core/src/core/org/jnode/vm/classmgr/VmCompiledCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmCompiledExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstDouble.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstFieldRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstFloat.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstIMethodRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstInt.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstLong.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstMemberRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstMethodRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstString.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstantPool.java trunk/core/src/core/org/jnode/vm/classmgr/VmExceptions.java trunk/core/src/core/org/jnode/vm/classmgr/VmField.java trunk/core/src/core/org/jnode/vm/classmgr/VmImplementedInterface.java trunk/core/src/core/org/jnode/vm/classmgr/VmInstanceField.java trunk/core/src/core/org/jnode/vm/classmgr/VmInstanceMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmInterfaceClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmInterpretedExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/VmIsolatedStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmIsolatedStaticsEntry.java trunk/core/src/core/org/jnode/vm/classmgr/VmLineNumberMap.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariable.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariableTable.java trunk/core/src/core/org/jnode/vm/classmgr/VmMember.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethodCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmNormalClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmPrimitiveClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmResolvableConstObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmSharedStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmSharedStaticsEntry.java trunk/core/src/core/org/jnode/vm/classmgr/VmSpecialMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticField.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsAllocator.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsBase.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsIterator.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/classmgr/VmTypeState.java trunk/core/src/core/org/jnode/vm/classmgr/VmUTF8Convert.java trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java trunk/core/src/core/org/jnode/vm/compiler/CompileError.java trunk/core/src/core/org/jnode/vm/compiler/CompiledExceptionHandler.java trunk/core/src/core/org/jnode/vm/compiler/CompiledIMT.java trunk/core/src/core/org/jnode/vm/compiler/CompiledMethod.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeViewer.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/DelegatingCompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java trunk/core/src/core/org/jnode/vm/compiler/GCMapIterator.java trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java trunk/core/src/core/org/jnode/vm/compiler/IllegalModeException.java trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/ir/AddressingMode.java trunk/core/src/core/org/jnode/vm/compiler/ir/CodeGenerator.java trunk/core/src/core/org/jnode/vm/compiler/ir/Constant.java trunk/core/src/core/org/jnode/vm/compiler/ir/DoubleConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/FloatConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRGenerator.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/IntConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/LinearScanAllocator.java trunk/core/src/core/org/jnode/vm/compiler/ir/LiveRange.java trunk/core/src/core/org/jnode/vm/compiler/ir/LocalVariable.java trunk/core/src/core/org/jnode/vm/compiler/ir/Location.java trunk/core/src/core/org/jnode/vm/compiler/ir/LongConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/MethodArgument.java trunk/core/src/core/org/jnode/vm/compiler/ir/NativeTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/Operand.java trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java trunk/core/src/core/org/jnode/vm/compiler/ir/PrimitiveTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/ReferenceConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/RegisterLocation.java trunk/core/src/core/org/jnode/vm/compiler/ir/RegisterPool.java trunk/core/src/core/org/jnode/vm/compiler/ir/SSAStack.java trunk/core/src/core/org/jnode/vm/compiler/ir/StackLocation.java trunk/core/src/core/org/jnode/vm/compiler/ir/StackVariable.java trunk/core/src/core/org/jnode/vm/compiler/ir/Variable.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/AssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryOperation.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchCondition.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConstantRefAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/Quad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryOperation.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnconditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VarReturnQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VoidReturnQuad.java trunk/core/src/core/org/jnode/vm/facade/GCStatistics.java trunk/core/src/core/org/jnode/vm/facade/HeapStatistics.java trunk/core/src/core/org/jnode/vm/facade/MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/facade/NoObjectFilter.java trunk/core/src/core/org/jnode/vm/facade/ObjectFilter.java trunk/core/src/core/org/jnode/vm/facade/ObjectVisitor.java trunk/core/src/core/org/jnode/vm/facade/SimpleObjectFilter.java trunk/core/src/core/org/jnode/vm/facade/TypeSizeInfo.java trunk/core/src/core/org/jnode/vm/facade/Vm.java trunk/core/src/core/org/jnode/vm/facade/VmArchitecture.java trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java trunk/core/src/core/org/jnode/vm/facade/VmProcessor.java trunk/core/src/core/org/jnode/vm/facade/VmThread.java trunk/core/src/core/org/jnode/vm/facade/VmThreadVisitor.java trunk/core/src/core/org/jnode/vm/facade/VmUtils.java trunk/core/src/core/org/jnode/vm/facade/VmWriteBarrier.java trunk/core/src/core/org/jnode/vm/isolate/DataLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/IsolateLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/IsolateStatusImpl.java trunk/core/src/core/org/jnode/vm/isolate/IsolateThread.java trunk/core/src/core/org/jnode/vm/isolate/IsolateThreadFactory.java trunk/core/src/core/org/jnode/vm/isolate/LinkImpl.java trunk/core/src/core/org/jnode/vm/isolate/LinkLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/LinkMessageFactory.java trunk/core/src/core/org/jnode/vm/isolate/LinkMessageImpl.java trunk/core/src/core/org/jnode/vm/isolate/ObjectLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/StatusLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/StringLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolateLocal.java trunk/core/src/core/org/jnode/vm/isolate/VmLink.java trunk/core/src/core/org/jnode/vm/isolate/VmStreamBindings.java trunk/core/src/core/org/jnode/vm/memmgr/HeapHelper.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefGCStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultWriteBarrier.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerThread.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCMarkVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSetWhiteVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCStack.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSweepVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCThread.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCVerifyVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/HeapStatisticsVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmAbstractHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmBootHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmDefaultHeap.java trunk/core/src/core/org/jnode/vm/objects/BootableArrayList.java trunk/core/src/core/org/jnode/vm/objects/BootableHashMap.java trunk/core/src/core/org/jnode/vm/objects/BootableObject.java trunk/core/src/core/org/jnode/vm/objects/Counter.java trunk/core/src/core/org/jnode/vm/objects/CounterGroup.java trunk/core/src/core/org/jnode/vm/objects/Statistic.java trunk/core/src/core/org/jnode/vm/objects/Statistics.java trunk/core/src/core/org/jnode/vm/objects/SynchronizedCounter.java trunk/core/src/core/org/jnode/vm/objects/VmSystemObject.java trunk/core/src/core/org/jnode/vm/performance/PerformanceCounterEvent.java trunk/core/src/core/org/jnode/vm/performance/PerformanceCounters.java trunk/core/src/core/org/jnode/vm/performance/PresetEvent.java trunk/core/src/core/org/jnode/vm/scheduler/IRQManager.java trunk/core/src/core/org/jnode/vm/scheduler/IRQThread.java trunk/core/src/core/org/jnode/vm/scheduler/IdleThread.java trunk/core/src/core/org/jnode/vm/scheduler/KernelDebugger.java trunk/core/src/core/org/jnode/vm/scheduler/Monitor.java trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.java trunk/core/src/core/org/jnode/vm/scheduler/ProcessorLock.java trunk/core/src/core/org/jnode/vm/scheduler/SpinLock.java trunk/core/src/core/org/jnode/vm/scheduler/SystemThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java trunk/core/src/core/org/jnode/vm/scheduler/VmScheduler.java trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueue.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueueEntry.java trunk/core/src/core/org/jnode/vm/x86/GDT.java trunk/core/src/core/org/jnode/vm/x86/IOAPIC.java trunk/core/src/core/org/jnode/vm/x86/IOAPICRedirectionEntry.java trunk/core/src/core/org/jnode/vm/x86/LocalAPIC.java trunk/core/src/core/org/jnode/vm/x86/MMXMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/x86/MPBusEntry.java trunk/core/src/core/org/jnode/vm/x86/MPConfigTable.java trunk/core/src/core/org/jnode/vm/x86/MPEntry.java trunk/core/src/core/org/jnode/vm/x86/MPFloatingPointerStructure.java trunk/core/src/core/org/jnode/vm/x86/MPIOAPICEntry.java trunk/core/src/core/org/jnode/vm/x86/MPIOInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPLocalInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPProcessorEntry.java trunk/core/src/core/org/jnode/vm/x86/MSR.java trunk/core/src/core/org/jnode/vm/x86/PIC8259A.java trunk/core/src/core/org/jnode/vm/x86/TSS32.java trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture64.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor64.java trunk/core/src/core/org/jnode/vm/x86/VmX86StackReader.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java trunk/core/src/core/org/jnode/vm/x86/X86Cpu.java trunk/core/src/core/org/jnode/vm/x86/X86CpuID.java trunk/core/src/core/org/jnode/vm/x86/X86IRQManager.java trunk/core/src/core/org/jnode/vm/x86/X86MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/x86/X86Vendor.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompiledIMT.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerConstants.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86JumpTable.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RegisterVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RegisterVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86Level1BCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/X86CodeGenerator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/stub/EmptyGCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java trunk/core/src/core/org/jnode/vm/x86/performance/Athlon64PerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/DualMSRPerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/P4FamilyPerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/P6PerformanceCouters.java trunk/core/src/core/org/jnode/vm/x86/performance/Pentium4PerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/X86PerformanceCounters.java trunk/core/src/core/org/jnode/work/Work.java trunk/core/src/core/org/jnode/work/WorkManager.java trunk/core/src/core/org/jnode/work/WorkPlugin.java trunk/core/src/core/org/jnode/work/WorkUtils.java trunk/core/src/driver/org/jnode/driver/AbstractDeviceManager.java trunk/core/src/driver/org/jnode/driver/ApiNotFoundException.java trunk/core/src/driver/org/jnode/driver/Bus.java trunk/core/src/driver/org/jnode/driver/DefaultDeviceManager.java trunk/core/src/driver/org/jnode/driver/Device.java trunk/core/src/driver/org/jnode/driver/DeviceAPI.java trunk/core/src/driver/org/jnode/driver/DeviceAlreadyConnectedException.java trunk/core/src/driver/org/jnode/driver/DeviceAlreadyRegisteredException.java trunk/core/src/driver/org/jnode/driver/DeviceException.java trunk/core/src/driver/org/jnode/driver/DeviceFinder.java trunk/core/src/driver/org/jnode/driver/DeviceFinderPlugin.java trunk/core/src/driver/org/jnode/driver/DeviceInfoAPI.java trunk/core/src/driver/org/jnode/driver/DeviceListener.java trunk/core/src/driver/org/jnode/driver/DeviceManager.java trunk/core/src/driver/org/jnode/driver/DeviceManagerListener.java trunk/core/src/driver/org/jnode/driver/DeviceNotFoundException.java trunk/core/src/driver/org/jnode/driver/DeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/DeviceUtils.java trunk/core/src/driver/org/jnode/driver/Driver.java trunk/core/src/driver/org/jnode/driver/DriverException.java trunk/core/src/driver/org/jnode/driver/DriverPermission.java trunk/core/src/driver/org/jnode/driver/DriverPlugin.java trunk/core/src/driver/org/jnode/driver/InvalidDriverException.java trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireBus.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireDevice.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireDriver.java trunk/core/src/driver/org/jnode/driver/bus/pci/AGPCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/AbstractPCIDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java trunk/core/src/driver/org/jnode/driver/bus/pci/CompactHotSwapCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/DeviceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/pci/MSICapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBaseAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBus.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBusAPI.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIClassToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIConstants.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDescriptors.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDevice.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceConfig.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIException.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIFinder.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType0.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType1.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType2.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCI_IDs.java trunk/core/src/driver/org/jnode/driver/bus/pci/PMCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/SlotIDCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/VPDCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/VendorDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusBus.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDevice.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDriver.java trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMM.java trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMMDriver.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBus.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBusControler.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBusDevice.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractDeviceItem.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractHostControllerDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/ConfigurationDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/DeviceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/EndPointDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/InterfaceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/SetupPacket.java trunk/core/src/driver/org/jnode/driver/bus/usb/StringDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/StringDescriptorZero.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBBus.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBConfiguration.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBControlPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBDataPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBDevice.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBEndPoint.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBException.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHostControllerAPI.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHubAPI.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHubMonitor.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBInterface.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPacket.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPipeListener.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/HubDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/PortStatus.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBControlRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBDataRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/AbstractStructure.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/AbstractTreeStructure.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/FrameList.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/QueueHead.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/Schedule.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/TransferDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIControlPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIControlRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCICore.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDataPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDataRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIIO.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipeManager.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIRootHub.java trunk/core/src/driver/org/jnode/driver/character/ChannelAlreadyOwnedException.java trunk/core/src/driver/org/jnode/driver/character/CharacterDeviceAPI.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i440BXDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI_SMBusControler.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ISABridge.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_USBController.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82443BX_HostPCIBridge.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82443BX_PCIPCIBridge.java trunk/core/src/driver/org/jnode/driver/chipset/via/Via82C686.java trunk/core/src/driver/org/jnode/driver/chipset/via/Via8363_0.java trunk/core/src/driver/org/jnode/driver/chipset/via/ViaDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/chipset/via/ViaQuirks.java trunk/core/src/driver/org/jnode/driver/console/ActiveTextConsole.java trunk/core/src/driver/org/jnode/driver/console/CompletionInfo.java trunk/core/src/driver/org/jnode/driver/console/Console.java trunk/core/src/driver/org/jnode/driver/console/ConsoleEvent.java trunk/core/src/driver/org/jnode/driver/console/ConsoleException.java trunk/core/src/driver/org/jnode/driver/console/ConsoleListener.java trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/InputCompleter.java trunk/core/src/driver/org/jnode/driver/console/InputHistory.java trunk/core/src/driver/org/jnode/driver/console/KeyEventBindings.java trunk/core/src/driver/org/jnode/driver/console/ScrollableTextConsole.java trunk/core/src/driver/org/jnode/driver/console/TextConsole.java trunk/core/src/driver/org/jnode/driver/console/VirtualKey.java trunk/core/src/driver/org/jnode/driver/console/VirtualTextConsole.java trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsole.java trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/spi/ConsoleWriter.java trunk/core/src/driver/org/jnode/driver/console/textscreen/ConsoleKeyEventBindings.java trunk/core/src/driver/org/jnode/driver/console/textscreen/DefaultKeyboardHandler.java trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardHandler.java trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardReader.java trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardReaderAction.java trunk/core/src/driver/org/jnode/driver/console/textscreen/Line.java trunk/core/src/driver/org/jnode/driver/console/textscreen/ScrollableTextScreenConsole.java trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsolePlugin.java trunk/core/src/driver/org/jnode/driver/input/AbstractInputDriver.java trunk/core/src/driver/org/jnode/driver/input/AbstractKeyboardDriver.java trunk/core/src/driver/org/jnode/driver/input/AbstractKeyboardInterpreter.java trunk/core/src/driver/org/jnode/driver/input/AbstractPointerDriver.java trunk/core/src/driver/org/jnode/driver/input/DeadKeyException.java trunk/core/src/driver/org/jnode/driver/input/Key.java trunk/core/src/driver/org/jnode/driver/input/KeyboardAPI.java trunk/core/src/driver/org/jnode/driver/input/KeyboardAPIAdapter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardAdapter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardConstants.java trunk/core/src/driver/org/jnode/driver/input/KeyboardEvent.java trunk/core/src/driver/org/jnode/driver/input/KeyboardInputPlugin.java trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreterException.java trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java trunk/core/src/driver/org/jnode/driver/input/KeyboardListener.java trunk/core/src/driver/org/jnode/driver/input/Keys.java trunk/core/src/driver/org/jnode/driver/input/LogitechProtocol.java trunk/core/src/driver/org/jnode/driver/input/LogitechWheelMouseProtocol.java trunk/core/src/driver/org/jnode/driver/input/MissingKeyboardInterpreterClassException.java trunk/core/src/driver/org/jnode/driver/input/MouseInterpreter.java trunk/core/src/driver/org/jnode/driver/input/MouseProtocolHandler.java trunk/core/src/driver/org/jnode/driver/input/PointerAPI.java trunk/core/src/driver/org/jnode/driver/input/PointerAPIAdapter.java trunk/core/src/driver/org/jnode/driver/input/PointerEvent.java trunk/core/src/driver/org/jnode/driver/input/PointerInterpreter.java trunk/core/src/driver/org/jnode/driver/input/PointerListener.java trunk/core/src/driver/org/jnode/driver/input/SystemListener.java trunk/core/src/driver/org/jnode/driver/input/SystemTriggerAPI.java trunk/core/src/driver/org/jnode/driver/input/SystemTriggerListener.java trunk/core/src/driver/org/jnode/driver/input/UnsupportedKeyException.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_BE_fr.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_CH_fr.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_DE.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_DK.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_DV.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_ES.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_FR.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_FR_fr.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_GB_en.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_HU.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_HU_101.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_HU_hu.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_HU_hu_101.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_IT.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_IT_it.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_NO.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_RU.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_SE.java trunk/core/src/driver/org/jnode/driver/input/l10n/KeyboardInterpreter_US_en.java trunk/core/src/driver/org/jnode/driver/serial/SerialPortAPI.java trunk/core/src/driver/org/jnode/driver/serial/SerialPortDriver.java trunk/core/src/driver/org/jnode/driver/serial/SerialPortFinder.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiAPI.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiDriver.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiSystemTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/DifferentiatedSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/ExtendedSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/FirmwareAcpiControlStructure.java trunk/core/src/driver/org/jnode/driver/system/acpi/FixedAcpiDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/GenericAddress.java trunk/core/src/driver/org/jnode/driver/system/acpi/RSDP.java trunk/core/src/driver/org/jnode/driver/system/acpi/RootSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/SystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/Aml.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/AmlOpcode.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/NameString.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/ParseNode.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/Parser.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/AcpiInteger.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/AcpiNamedObject.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/AcpiObject.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/Buffer.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/ByteField.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/Device.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/NameSpace.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/Scope.java trunk/core/src/driver/org/jnode/driver/system/cmos/CMOSConstants.java trunk/core/src/driver/org/jnode/driver/system/cmos/CMOSService.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOS.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOSPlugin.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/RTC.java trunk/core/src/driver/org/jnode/driver/system/firmware/AcpiDevice.java trunk/core/src/driver/org/jnode/driver/system/firmware/AcpiRSDPInfo.java trunk/core/src/driver/org/jnode/driver/system/firmware/FirmwareAPI.java trunk/core/src/driver/org/jnode/driver/system/firmware/bios/BiosDriver.java trunk/core/src/driver/org/jnode/driver/system/firmware/bios/BiosFinder.java trunk/core/src/driver/org/jnode/driver/system/pnp/PnP.java trunk/core/src/driver/org/jnode/driver/system/ram/RAMControler.java trunk/core/src/driver/org/jnode/driver/system/ram/RAMModuleCollection.java trunk/core/src/driver/org/jnode/driver/system/ram/RAMModuleInfo.java trunk/core/src/driver/org/jnode/driver/textscreen/ScrollableTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/TextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/TextScreenManager.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcBufferTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcBufferTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcScrollableTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreen.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenManager.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenPlugin.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreenUtils.java trunk/core/src/driver/org/jnode/driver/virtual/VirtualDevice.java trunk/core/src/driver/org/jnode/driver/virtual/VirtualDeviceDriver.java trunk/core/src/driver/org/jnode/driver/virtual/VirtualDeviceFactory.java trunk/core/src/emu/org/jnode/emu/naming/BasicNameSpace.java trunk/core/src/emu/org/jnode/emu/plugin/model/DummyConfigurationElement.java trunk/core/src/emu/org/jnode/emu/plugin/model/DummyExtension.java trunk/core/src/emu/org/jnode/emu/plugin/model/DummyExtensionPoint.java trunk/core/src/emu/org/jnode/emu/plugin/model/DummyPluginDescriptor.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkGCStatistics.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm... [truncated message content] |
From: <ep...@us...> - 2013-11-12 15:20:02
|
Revision: 5995 http://sourceforge.net/p/jnode/svn/5995 Author: epr Date: 2013-11-12 15:19:59 +0000 (Tue, 12 Nov 2013) Log Message: ----------- Improved CPUID. Modified Paths: -------------- trunk/core/src/core/org/jnode/vm/Unsafe.java trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/X86CpuID.java trunk/core/src/native/x86/jnode.asm trunk/core/src/test/org/jnode/test/IRTest.java Added Paths: ----------- trunk/core/src/native/x86/unsafex86-cpuid.asm Removed Paths: ------------- trunk/core/src/native/x86/unsafe-cpuid.asm Modified: trunk/core/src/core/org/jnode/vm/Unsafe.java =================================================================== --- trunk/core/src/core/org/jnode/vm/Unsafe.java 2013-11-12 08:49:28 UTC (rev 5994) +++ trunk/core/src/core/org/jnode/vm/Unsafe.java 2013-11-12 15:19:59 UTC (rev 5995) @@ -699,19 +699,6 @@ } /** - * Read CPU identification data. - * <p/> - * If id is null, this method will return the length of the id array that is - * required to fit all data. If id is not null and long enough, it is filled - * with all identification data. - * - * @param id - * @return The required length of id. - */ - @Internal - public static native int getCPUID(int[] id); - - /** * List the current stacktrace on the kernel debug output. * * @throws UninterruptiblePragma Modified: trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java 2013-11-12 08:49:28 UTC (rev 5994) +++ trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java 2013-11-12 15:19:59 UTC (rev 5995) @@ -43,6 +43,7 @@ import org.jnode.vm.facade.VmUtils; import org.jnode.vm.objects.VmSystemObject; import org.jnode.vm.performance.PerformanceCounters; +import org.jnode.vm.x86.UnsafeX86; import org.vmmagic.unboxed.Address; import org.vmmagic.unboxed.ObjectReference; import org.vmmagic.unboxed.Word; @@ -574,10 +575,7 @@ */ public final CpuID getCPUID() { if (cpuId == null) { - final int length = Unsafe.getCPUID(null); - final int[] id = new int[length]; - Unsafe.getCPUID(id); - cpuId = loadCPUID(id); + cpuId = loadCPUID(); } return cpuId; } @@ -588,7 +586,7 @@ * @param id The identification returned by Unsafe.getCpuID * @return CpuID */ - protected abstract CpuID loadCPUID(int[] id); + protected abstract CpuID loadCPUID(); /** * Set the CPU id. Modified: trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java 2013-11-12 08:49:28 UTC (rev 5994) +++ trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java 2013-11-12 15:19:59 UTC (rev 5995) @@ -20,7 +20,9 @@ package org.jnode.vm.x86; +import org.jnode.annotation.Internal; import org.vmmagic.unboxed.Address; +import org.vmmagic.unboxed.Word; /** @@ -69,6 +71,16 @@ static final native Address getCR3(); /** + * Read CPU identification data. + * <p/> + * @param input The number to put in EAX + * @param result An array of length 4 (or longer) where eax, ebx, ecx, edx is stored into. + * @return 1 on success, 0 otherwise (result == null or result.length less than 4). + */ + @Internal + public static native int getCPUID(Word input, int[] result); + + /** * Gets the address of first entry in the multiboot mmap table. * * @return Modified: trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java 2013-11-12 08:49:28 UTC (rev 5994) +++ trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java 2013-11-12 15:19:59 UTC (rev 5995) @@ -174,8 +174,8 @@ * * @return CpuID */ - protected CpuID loadCPUID(int[] id) { - return new X86CpuID(id); + protected CpuID loadCPUID() { + return X86CpuID.loadFromCurrentCpu(); } /** Modified: trunk/core/src/core/org/jnode/vm/x86/X86CpuID.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/X86CpuID.java 2013-11-12 08:49:28 UTC (rev 5994) +++ trunk/core/src/core/org/jnode/vm/x86/X86CpuID.java 2013-11-12 15:19:59 UTC (rev 5995) @@ -22,6 +22,8 @@ import org.jnode.util.NumberUtils; import org.jnode.vm.CpuID; +import org.jnode.vm.Unsafe; +import org.vmmagic.unboxed.Word; /** * Class used to identify the current processor. @@ -60,9 +62,18 @@ public static final int FEAT_TM = (1 << 29); public static final int FEAT_PBE = (1 << 31); // Extended features - public static final long FEAT_EST = (1L << 39); - public static final long FEAT_TM2 = (1L << 40); - public static final long FEAT_CNXTID = (1L << 42); + public static final long FEAT_PNI = (1L << 32); // Prescott New Instructions (SSE3) + public static final long FEAT_PCLMULQDQ = (1L << 33); // PCLMULQDQ support + public static final long FEAT_DTES64 = (1L << 34); // 64-bit debug store (edx bit 21) + public static final long FEAT_MONITOR = (1L << 35); // MONITOR and MWAIT instructions (SSE3) + public static final long FEAT_DS_CPL = (1L << 36); // CPL qualified debug store + public static final long FEAT_VMX = (1L << 37); // Virtual Machine eXtensions + public static final long FEAT_SMX = (1L << 38); // Safer Mode Extensions (LaGrande) + public static final long FEAT_EST = (1L << 39); // Enhanced SpeedStep + public static final long FEAT_TM2 = (1L << 40); // Thermal Monitor 2 + public static final long FEAT_SSSE3 = (1L << 41); // Supplemental SSE3 instructions + public static final long FEAT_CNXTID = (1L << 42); // Context ID + public static final long FEAT_HYPERVISOR = (1L << 63); // Running on a hypervisor (always 0 on a real CPU, but also with some hypervisors) // Family codes public static final int FAM_486 = 0x04; @@ -83,6 +94,8 @@ private final int family; private final int features; private final long exFeatures; + private final String brand; + private String hypervisorVendor; /** * Create a cpu id that contains the data of a processor identified by the given processor id. @@ -123,14 +136,15 @@ id[1] = 0x756e6547; id[2] = 0x6c65746e; id[3] = 0x49656e69; - return new X86CpuID(id); + return new X86CpuID(id, "?"); } /** * Initialize this instance */ - X86CpuID(int[] data) { + X86CpuID(int[] data, String brand) { this.data = data; + this.brand = brand; final int eax = data[4]; this.steppingID = eax & 0xF; this.model = (eax >> 4) & 0xF; @@ -138,10 +152,79 @@ this.features = data[7]; this.exFeatures = features | (((long) data[6]) << 32); } + + /** + * Load a new CpuID from the current CPU. + * @return + */ + static X86CpuID loadFromCurrentCpu() { + + // Load low values (eax=0) + int[] regs = new int[4]; + UnsafeX86.getCPUID(Word.zero(), regs); + + final int count = regs[0] + 1; + int[] data = new int[count * 4]; + + int index = 0; + for (int i = 0; i < count; i++) { + UnsafeX86.getCPUID(Word.fromIntZeroExtend(i), regs); + data[index++] = regs[0]; + data[index++] = regs[1]; + data[index++] = regs[2]; + data[index++] = regs[3]; + } + + // Load extended functions (0x80000000) + String brand = "?"; + final Word extendedBase = Word.fromIntZeroExtend(0x80000000); + UnsafeX86.getCPUID(extendedBase, regs); + Word max = Word.fromIntZeroExtend(regs[0]); + if (max.GE(extendedBase.add(4))) { + // Load brand 0x80000002..0x80000004 + final StringBuilder buf = new StringBuilder(); + for (int i = 0; i < 3; i++) { + UnsafeX86.getCPUID(extendedBase.add(2 + i), regs); + intToString(buf, regs[0]); + intToString(buf, regs[1]); + intToString(buf, regs[2]); + intToString(buf, regs[3]); + } + brand = buf.toString().trim(); + } + + X86CpuID id = new X86CpuID(data, brand); + + // Load hypervisor data + if (id.hasHYPERVISOR()) { + UnsafeX86.getCPUID(Word.fromIntZeroExtend(0x40000001), regs); + if (regs[0] == 0x31237648) { + // Found 'Hv#1' Hypervisor vendor neutral identification + UnsafeX86.getCPUID(Word.fromIntZeroExtend(0x40000000), regs); + final StringBuilder buf = new StringBuilder(); + intToString(buf, regs[1]); // ebx + intToString(buf, regs[2]); // ecx + intToString(buf, regs[3]); // edx + id.hypervisorVendor = buf.toString().trim(); + } + } + + return id; + } + /** + * Processor vendor string + */ public String getName() { return getVendor(); } + + /** + * Processor brand string + */ + public String getBrand() { + return brand; + } /** * Gets the processor name. @@ -177,7 +260,7 @@ return getVendor().equals(X86Vendor.AMD.getId()); } - private final void intToString(StringBuilder buf, int value) { + private static final void intToString(StringBuilder buf, int value) { buf.append((char) (value & 0xFF)); buf.append((char) ((value >> 8) & 0xFF)); buf.append((char) ((value >> 16) & 0xFF)); @@ -404,6 +487,10 @@ public final boolean hasCNXTID() { return hasFeature(FEAT_CNXTID); } + + public final boolean hasHYPERVISOR() { + return hasFeature(FEAT_HYPERVISOR); + } /** * Convert all features to a human readable string. @@ -442,9 +529,18 @@ getFeatureString(buf, FEAT_TM, "TM"); getFeatureString(buf, FEAT_PBE, "PBE"); // Extended features + getFeatureString(buf, FEAT_PNI, "PNI"); + getFeatureString(buf, FEAT_PCLMULQDQ, "PCLMULQDQ"); + getFeatureString(buf, FEAT_DTES64, "DTES64"); + getFeatureString(buf, FEAT_MONITOR, "MONITOR"); + getFeatureString(buf, FEAT_DS_CPL, "DS_CPL"); + getFeatureString(buf, FEAT_VMX, "VMX"); + getFeatureString(buf, FEAT_SMX, "SMX"); getFeatureString(buf, FEAT_EST, "EST"); getFeatureString(buf, FEAT_TM2, "TM2"); + getFeatureString(buf, FEAT_SSSE3, "SSSE3"); getFeatureString(buf, FEAT_CNXTID, "CNXTID"); + getFeatureString(buf, FEAT_HYPERVISOR, "HYPERVISOR"); return buf.toString(); } @@ -473,23 +569,47 @@ */ public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("CPU:"); - sb.append(" name:"); + sb.append("CPUID"); + sb.append('\n'); + + sb.append(" name : "); sb.append(getName()); - sb.append(" family:"); + sb.append('\n'); + + sb.append(" brand : "); + sb.append(getBrand()); + sb.append('\n'); + + sb.append(" family : "); sb.append(getFamily()); - sb.append(" model:"); + sb.append('\n'); + + sb.append(" model : "); sb.append(getModel()); - sb.append(" step:"); + sb.append('\n'); + + sb.append(" step : "); sb.append(getSteppingID()); + sb.append('\n'); + if (hasFeature(FEAT_HTT)) { - sb.append(" #log.proc:"); - sb.append(getLogicalProcessors()); + sb.append(" #log.proc: "); + sb.append(getLogicalProcessors()); + sb.append('\n'); } - sb.append(" features:"); + if (hypervisorVendor != null) { + sb.append(" hyperv. : "); + sb.append(hypervisorVendor); + sb.append('\n'); + } + sb.append(" features : "); sb.append(getFeatureString()); - sb.append(" raw:"); + sb.append('\n'); + + sb.append(" raw : "); sb.append(NumberUtils.hex(data, 8)); + sb.append('\n'); + return sb.toString(); } } Modified: trunk/core/src/native/x86/jnode.asm =================================================================== --- trunk/core/src/native/x86/jnode.asm 2013-11-12 08:49:28 UTC (rev 5994) +++ trunk/core/src/native/x86/jnode.asm 2013-11-12 15:19:59 UTC (rev 5995) @@ -133,7 +133,7 @@ %include "unsafe.asm" %include "unsafe-binop.asm" %include "unsafe-setmulti.asm" -%include "unsafe-cpuid.asm" +%include "unsafex86-cpuid.asm" %include "unsafex86.asm" %include "unsafex86-mm.asm" %include "vm.asm" Deleted: trunk/core/src/native/x86/unsafe-cpuid.asm =================================================================== --- trunk/core/src/native/x86/unsafe-cpuid.asm 2013-11-12 08:49:28 UTC (rev 5994) +++ trunk/core/src/native/x86/unsafe-cpuid.asm 2013-11-12 15:19:59 UTC (rev 5995) @@ -1,66 +0,0 @@ -; ----------------------------------------------- -; $Id$ -; -; Native method implementation for org.jnode.vm.Unsafe -; of the CPU identification methods. -; -; Author : E. Prangsma -; ----------------------------------------------- - -; * Read CPU identification data. -; * -; * If id is null, this method will return the length of the id array -; * that is required to fit all data. -; * If id is not null and long enough, it is filled with all identification -; * data. -; * -; * @param id -; * @return The required length of id. -; public static native int getCPUID(int[] id); -GLABEL Q43org5jnode2vm6Unsafe23getCPUID2e285bI29I - mov AAX,[ASP+SLOT_SIZE] ; Get id - push ADI - push ABX - push ACX - push ADX - - mov ADI,AAX ; edi = id - xor eax,eax - cpuid ; eax contains maximum input value - lea ecx,[eax+1] ; Store maximum+1 for later - lea eax,[eax*4+4] ; Calculate id.length (4 registers * (maximum input value+1)) - - test ADI,ADI ; is id null? - je cpuid_ret - cmp eax,[ADI+VmArray_LENGTH_OFFSET*SLOT_SIZE] - ja cpuid_ret ; id is not large enough? - - lea ADI,[ADI+VmArray_DATA_OFFSET*SLOT_SIZE] ; Load &id[0] into edi - push AAX - pushf - cld - xor eax,eax -cpuid_loop: - push AAX - push ACX - cpuid - stosd ; store eax - mov eax,ebx - stosd ; store ebx - mov eax,ecx - stosd ; store ecx - mov eax,edx - stosd ; store edx - pop ACX - pop AAX - inc eax - loop cpuid_loop - popf - pop AAX - -cpuid_ret: - pop ADX - pop ACX - pop ABX - pop ADI - ret SLOT_SIZE Added: trunk/core/src/native/x86/unsafex86-cpuid.asm =================================================================== --- trunk/core/src/native/x86/unsafex86-cpuid.asm (rev 0) +++ trunk/core/src/native/x86/unsafex86-cpuid.asm 2013-11-12 15:19:59 UTC (rev 5995) @@ -0,0 +1,51 @@ +; ----------------------------------------------- +; $Id: unsafe-cpuid.asm 1036 2005-01-30 10:41:32Z epr $ +; +; Native method implementation for org.jnode.vm.x86.UnsafeX86 +; of the CPU identification methods. +; +; Author : E. Prangsma +; ----------------------------------------------- + +; * Read CPU identification data. +; * +; * @param input The number to put in EAX +; * @param result An array of length 4 (or longer) where eax, ebx, ecx, edx is stored into. +; * @return 1 on success, 0 otherwise (result == null or result.length less than 4). +; public static native int getCPUID(Word input, int[] result); +GLABEL Q53org5jnode2vm3x869UnsafeX8623getCPUID2e28Lorg2fvmmagic2funboxed2fWord3b5bI29I + push ADI + mov ADI,[ASP+(2*SLOT_SIZE)] ; Get result + mov AAX,[ASP+(3*SLOT_SIZE)] ; Get input + push ABX + push ACX + push ADX + + test ADI,ADI ; is id null? + je cpuid_invalid_arg + mov ebx,4 ; We need an array of length 4 (or more) + cmp ebx,[ADI+VmArray_LENGTH_OFFSET*SLOT_SIZE] + ja cpuid_invalid_arg; id is not large enough? + + lea ADI,[ADI+VmArray_DATA_OFFSET*SLOT_SIZE] ; Load &id[0] into edi + ; Execute CPUID + cpuid + mov [ADI+0],eax ; store eax + mov [ADI+4],ebx ; store ebx + mov [ADI+8],ecx ; store ecx + mov [ADI+12],edx ; store edx + ; Signal valid return + mov eax,1 ; Return 1 + jmp cpuid_ret + +cpuid_invalid_arg: + xor eax,eax ; Return 0 + +cpuid_ret: + pop ADX + pop ACX + pop ABX + pop ADI + ret SLOT_SIZE + + \ No newline at end of file Modified: trunk/core/src/test/org/jnode/test/IRTest.java =================================================================== --- trunk/core/src/test/org/jnode/test/IRTest.java 2013-11-12 08:49:28 UTC (rev 5994) +++ trunk/core/src/test/org/jnode/test/IRTest.java 2013-11-12 15:19:59 UTC (rev 5995) @@ -161,7 +161,7 @@ cfg.deconstrucSSA(); cfg.fixupAddresses(); - final Map<Variable, Variable<T>> liveVariables = new BootableHashMap<Variable, Variable<T>>(); + final Map<Variable<?>, Variable<T>> liveVariables = new BootableHashMap<Variable<?>, Variable<T>>(); for (IRBasicBlock<T> b : cfg) { System.out.println(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |