|
From: <ls...@us...> - 2008-03-08 10:16:13
|
Revision: 3826
http://jnode.svn.sourceforge.net/jnode/?rev=3826&view=rev
Author: lsantha
Date: 2008-03-08 02:16:07 -0800 (Sat, 08 Mar 2008)
Log Message:
-----------
OpenJDK integration.
Modified Paths:
--------------
trunk/core/src/classpath/java/java/awt/AWTEvent.java
trunk/core/src/classpath/java/java/awt/ColorPaintContext.java
trunk/core/src/classpath/java/java/awt/Component.java
trunk/core/src/classpath/java/java/awt/Container.java
trunk/core/src/classpath/java/java/awt/Dialog.java
trunk/core/src/classpath/java/java/awt/Event.java
trunk/core/src/classpath/java/java/awt/Font.java
trunk/core/src/classpath/java/java/awt/KeyboardFocusManager.java
Added Paths:
-----------
trunk/core/src/openjdk/java/java/awt/AttributeValue.java
trunk/core/src/openjdk/java/java/awt/Button.java
trunk/core/src/openjdk/java/java/awt/Canvas.java
trunk/core/src/openjdk/java/java/awt/Checkbox.java
trunk/core/src/openjdk/java/java/awt/Choice.java
trunk/core/src/openjdk/java/java/awt/Color.java
trunk/core/src/openjdk/java/java/awt/FileDialog.java
trunk/core/src/openjdk/java/java/awt/FontMetrics.java
trunk/core/src/openjdk/java/java/awt/GraphicsConfiguration.java
trunk/core/src/openjdk/java/java/awt/GraphicsDevice.java
trunk/core/src/openjdk/java/java/awt/GraphicsEnvironment.java
trunk/core/src/openjdk/java/java/awt/Label.java
trunk/core/src/openjdk/java/java/awt/List.java
trunk/core/src/openjdk/java/java/awt/MediaTracker.java
trunk/core/src/openjdk/java/java/awt/Panel.java
trunk/core/src/openjdk/java/java/awt/ScrollPane.java
trunk/core/src/openjdk/java/java/awt/Scrollbar.java
trunk/core/src/openjdk/java/java/awt/SystemColor.java
trunk/core/src/openjdk/java/java/awt/TextArea.java
trunk/core/src/openjdk/java/java/awt/TextComponent.java
trunk/core/src/openjdk/java/java/awt/TextField.java
trunk/core/src/openjdk/java/java/awt/package.html
trunk/core/src/openjdk/sun/sun/awt/ScrollPaneWheelScroller.java
trunk/core/src/openjdk/sun/sun/awt/SubRegionShowable.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/NativeColor.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/NativeLabel.java
trunk/core/src/openjdk/vm/java/awt/NativeScrollPane.java
trunk/core/src/openjdk/vm/java/awt/NativeScrollbar.java
trunk/core/src/openjdk/vm/java/awt/NativeTextArea.java
trunk/core/src/openjdk/vm/java/awt/NativeTextField.java
Removed Paths:
-------------
trunk/core/src/classpath/java/java/awt/AttributeValue.java
trunk/core/src/classpath/java/java/awt/Button.java
trunk/core/src/classpath/java/java/awt/Canvas.java
trunk/core/src/classpath/java/java/awt/Checkbox.java
trunk/core/src/classpath/java/java/awt/Choice.java
trunk/core/src/classpath/java/java/awt/Color.java
trunk/core/src/classpath/java/java/awt/FileDialog.java
trunk/core/src/classpath/java/java/awt/FontMetrics.java
trunk/core/src/classpath/java/java/awt/GraphicsConfiguration.java
trunk/core/src/classpath/java/java/awt/GraphicsDevice.java
trunk/core/src/classpath/java/java/awt/GraphicsEnvironment.java
trunk/core/src/classpath/java/java/awt/Label.java
trunk/core/src/classpath/java/java/awt/List.java
trunk/core/src/classpath/java/java/awt/MediaTracker.java
trunk/core/src/classpath/java/java/awt/Panel.java
trunk/core/src/classpath/java/java/awt/ScrollPane.java
trunk/core/src/classpath/java/java/awt/Scrollbar.java
trunk/core/src/classpath/java/java/awt/SystemColor.java
trunk/core/src/classpath/java/java/awt/TextArea.java
trunk/core/src/classpath/java/java/awt/TextComponent.java
trunk/core/src/classpath/java/java/awt/TextField.java
trunk/core/src/classpath/java/java/awt/package.html
Modified: trunk/core/src/classpath/java/java/awt/AWTEvent.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/AWTEvent.java 2008-03-05 16:35:46 UTC (rev 3825)
+++ trunk/core/src/classpath/java/java/awt/AWTEvent.java 2008-03-08 10:16:07 UTC (rev 3826)
@@ -41,6 +41,7 @@
import java.awt.event.*;
import java.util.EventObject;
+import java.lang.reflect.Field;
/**
* AWTEvent is the root event class for all AWT events in the JDK 1.1 event
@@ -64,6 +65,8 @@
*/
private static final long serialVersionUID = -1825314779160409405L;
+ transient boolean focusManagerIsDispatching = false;
+ transient boolean isPosted;
/**
* The ID of the event.
*
@@ -512,5 +515,56 @@
}
return null;
}
+ /**
+ * The pseudo event mask for enabling input methods.
+ * We're using one bit in the eventMask so we don't need
+ * a separate field inputMethodsEnabled.
+ */
+ final static long INPUT_METHODS_ENABLED_MASK = 0x1000;
+ /**
+ * Copies all private data from this event into that.
+ * Space is allocated for the copied data that will be
+ * freed when the that is finalized. Upon completion,
+ * this event is not changed.
+ */
+ void copyPrivateDataInto(AWTEvent that) {
+ that.bdata = this.bdata;
+ // Copy canAccessSystemClipboard value from this into that.
+ if (this instanceof InputEvent && that instanceof InputEvent) {
+ Field field = get_InputEvent_CanAccessSystemClipboard();
+ if (field != null) {
+ try {
+ boolean b = field.getBoolean(this);
+ field.setBoolean(that, b);
+ } catch(IllegalAccessException e) {
+ }
+ }
+ }
+ }
+
+ private static synchronized Field get_InputEvent_CanAccessSystemClipboard() {
+ if (inputEvent_CanAccessSystemClipboard_Field == null) {
+ inputEvent_CanAccessSystemClipboard_Field =
+ (Field)java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public Object run() {
+ Field field = null;
+ try {
+ field = InputEvent.class.
+ getDeclaredField("canAccessSystemClipboard");
+ field.setAccessible(true);
+ return field;
+ } catch (SecurityException e) {
+ } catch (NoSuchFieldException e) {
+ }
+ return null;
+ }
+ });
+ }
+
+ return inputEvent_CanAccessSystemClipboard_Field;
+ }
+ // security stuff
+ private static Field inputEvent_CanAccessSystemClipboard_Field = null;
} // class AWTEvent
Deleted: trunk/core/src/classpath/java/java/awt/AttributeValue.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/AttributeValue.java 2008-03-05 16:35:46 UTC (rev 3825)
+++ trunk/core/src/classpath/java/java/awt/AttributeValue.java 2008-03-08 10:16:07 UTC (rev 3826)
@@ -1,98 +0,0 @@
-/* AttributeValue.java -- parent of type-safe enums of attributes
- Copyright (C) 2002, 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.awt;
-
-/**
- * This class is undocumented by Sun, but it is the parent of several other
- * classes, all of which are type-safe enumerations. This takes care of
- * <code>equals</code>, <code>toString</code>, and <code>hashCode</code>, so
- * that you don't have to (although hashCode is commonly overridden).
- *
- * @author Eric Blake (eb...@em...)
- */
-class AttributeValue
-{
- /** The value of the enumeration. Package visible for speed. */
- final int value;
-
- /** The list of enumeration names for the given subclass. */
- private final String[] names;
-
- /**
- * Construct a type-safe enumeration element. For example,<br>
- * <pre>
- * class Foo extends AttributeValue
- * {
- * private static final String[] names = { "one", "two" }
- * public static final Foo ONE = new Foo(0);
- * public static final Foo TWO = new Foo(1);
- * private Foo(int value) { super(value, names); }
- * }
- * </pre>
- *
- * @param value the position of this enumeration element, consecutive from 0
- * @param names the constant list of enumeration names for the subclass
- */
- AttributeValue(int value, String[] names)
- {
- this.value = value;
- this.names = names;
- }
-
- /**
- * Returns the hashcode of this element. This is the index of the element
- * in the enumeration. Note that equals defaults to the == relation.
- *
- * @return the hashcode
- */
- public int hashCode()
- {
- return value;
- }
-
- /**
- * Returns the name of this enumeration element.
- *
- * @return the element name
- */
- public String toString()
- {
- return names[value];
- }
-} // class AttributeValue
Deleted: trunk/core/src/classpath/java/java/awt/Button.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/Button.java 2008-03-05 16:35:46 UTC (rev 3825)
+++ trunk/core/src/classpath/java/java/awt/Button.java 2008-03-08 10:16:07 UTC (rev 3826)
@@ -1,468 +0,0 @@
-/* Button.java -- AWT button widget
- Copyright (C) 1999, 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.awt;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.peer.ButtonPeer;
-import java.lang.reflect.Array;
-import java.util.EventListener;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleAction;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-import javax.accessibility.AccessibleValue;
-
-/**
- * This class provides a button widget for the AWT.
- *
- * @author Aaron M. Renn (ar...@ur...)
- * @author Tom Tromey (tr...@cy...)
- */
-public class Button extends Component
- implements java.io.Serializable, Accessible
-{
-
-/*
- * Static Variables
- */
-
-// FIXME: Need readObject/writeObject for serialization
-
-// Serialization version constant
-private static final long serialVersionUID = -8774683716313001058L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * @serial The action command name for this button.
- * This is package-private to avoid an accessor method.
- */
-String actionCommand;
-
-/**
- * @serial The label for this button.
- * This is package-private to avoid an accessor method.
- */
-String label;
-
-// List of ActionListeners for this class.
-private transient ActionListener action_listeners;
-
- /*
- * The number used to generate the name returned by getName.
- */
- private static transient long next_button_number;
-
- protected class AccessibleAWTButton extends AccessibleAWTComponent
- implements AccessibleAction, AccessibleValue
- {
- private static final long serialVersionUID = -5932203980244017102L;
-
- protected AccessibleAWTButton()
- {
- // Do nothing here.
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
- */
- public int getAccessibleActionCount()
- {
- // Only 1 action possible
- return 1;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
- */
- public String getAccessibleActionDescription(int i)
- {
- // JDK 1.4.2 returns the string "click" for action 0. However, the API
- // docs don't say what the string to be returned is, beyond being a
- // description of the action. So we return the same thing for
- // compatibility with 1.4.2.
- if (i == 0)
- return "click";
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
- */
- public boolean doAccessibleAction(int i)
- {
- if (i != 0)
- return false;
- processActionEvent(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand));
- return true;
- }
-
- public String getAccessibleName()
- {
- return label;
- }
-
- public AccessibleAction getAccessibleAction()
- {
- return this;
- }
-
- public AccessibleValue getAccessibleValue()
- {
- return this;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
- */
- public Number getCurrentAccessibleValue()
- {
- // Docs say return 1 if selected, but buttons can't be selected, right?
- return new Integer(0);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
- */
- public boolean setCurrentAccessibleValue(Number number)
- {
- // Since there's no selection with buttons, we're ignoring this.
- // TODO someone who knows shoulw check this.
- return false;
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
- */
- public Number getMinimumAccessibleValue()
- {
- return new Integer(0);
- }
-
- /* (non-Javadoc)
- * @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
- */
- public Number getMaximumAccessibleValue()
- {
- return new Integer(0);
- }
-
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.PUSH_BUTTON;
- }
- }
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Button</code> with no label.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true
- */
-public
-Button()
-{
- this("");
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Button</code> with the specified
- * label. The action command name is also initialized to this value.
- *
- * @param label The label to display on the button.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless()
- * returns true
- */
-public
-Button(String label)
-{
- this.label = label;
- actionCommand = label;
-
- if (GraphicsEnvironment.isHeadless ())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * Returns the label for this button.
- *
- * @return The label for this button.
- */
-public String
-getLabel()
-{
- return(label);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the label for this button to the specified value.
- *
- * @param label The new label for this button.
- */
-public synchronized void
-setLabel(String label)
-{
- this.label = label;
- actionCommand = label;
- if (peer != null)
- {
- ButtonPeer bp = (ButtonPeer) peer;
- bp.setLabel (label);
- }
-}
-
-/*************************************************************************/
-
-/**
- * Returns the action command name for this button.
- *
- * @return The action command name for this button.
- */
-public String
-getActionCommand()
-{
- return(actionCommand);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the action command name for this button to the specified value.
- *
- * @param actionCommand The new action command name.
- */
-public void
-setActionCommand(String actionCommand)
-{
- this.actionCommand = actionCommand == null ? label : actionCommand;
-}
-
-/*************************************************************************/
-
-/**
- * Adds a new entry to the list of listeners that will receive
- * action events from this button.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.add(action_listeners, listener);
-}
-
-/*************************************************************************/
-
-/**
- * Removes the specified listener from the list of listeners that will
- * receive action events from this button.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.remove(action_listeners, listener);
-}
-
- /**
- * Returns all added <code>ActionListener</code> objects.
- *
- * @return an array of listeners
- *
- * @since 1.4
- */
- public synchronized ActionListener[] getActionListeners()
- {
- return (ActionListener[])
- AWTEventMulticaster.getListeners(action_listeners,
- ActionListener.class);
- }
-
-/**
- * Returns all registered EventListers of the given listenerType.
- * listenerType must be a subclass of EventListener, or a
- * ClassClassException is thrown.
- *
- * @param listenerType the listener type to return
- *
- * @return an array of listeners
- *
- * @exception ClassCastException If listenerType doesn't specify a class or
- * interface that implements @see java.util.EventListener.
- *
- * @since 1.3
- */
- public <T extends EventListener> T[] getListeners(Class<T> listenerType)
- {
- if (listenerType == ActionListener.class)
- return (T[]) getActionListeners();
- return (T[]) Array.newInstance(listenerType, 0);
- }
-
-/*************************************************************************/
-
-/**
- * Notifies this button that it should create its native peer object.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createButton (this);
- super.addNotify();
-}
-
-/*************************************************************************/
-
-/**
- * Processes an event for this button. If the specified event is an
- * instance of <code>ActionEvent</code>, then the
- * <code>processActionEvent()</code> method is called to dispatch it
- * to any registered listeners. Otherwise, the superclass method
- * will be invoked. Note that this method will not be called at all
- * unless <code>ActionEvent</code>'s are enabled. This will be done
- * implicitly if any listeners are added.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ActionEvent)
- processActionEvent((ActionEvent)event);
- else
- super.processEvent(event);
-}
-
-/*************************************************************************/
-
-/**
- * This method dispatches an action event for this button to any
- * registered listeners.
- *
- * @param event The event to process.
- */
-protected void
-processActionEvent(ActionEvent event)
-{
- if (action_listeners != null)
- action_listeners.actionPerformed(event);
-}
-
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= ActionEvent.ACTION_LAST
- && e.id >= ActionEvent.ACTION_FIRST
- && (action_listeners != null
- || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this button.
- *
- * @return A debugging string for this button.
- */
-protected String
-paramString()
-{
- return getName () + "," + getX () + "," + getY () + ","
- + getWidth () + "x" + getHeight () + ",label=" + getLabel ();
-}
-
-/**
- * Gets the AccessibleContext associated with this <code>Button</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
-public AccessibleContext getAccessibleContext()
-{
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTButton();
- return accessibleContext;
-}
-
- /**
- * Generate a unique name for this button.
- *
- * @return A unique name for this button.
- */
- String generateName ()
- {
- return "button" + getUniqueLong ();
- }
-
- private static synchronized long getUniqueLong ()
- {
- return next_button_number++;
- }
-
-} // class Button
-
Deleted: trunk/core/src/classpath/java/java/awt/Canvas.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/Canvas.java 2008-03-05 16:35:46 UTC (rev 3825)
+++ trunk/core/src/classpath/java/java/awt/Canvas.java 2008-03-08 10:16:07 UTC (rev 3826)
@@ -1,366 +0,0 @@
-/* Canvas.java --
- Copyright (C) 1999, 2000, 2002, 2004 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.awt;
-
-import java.awt.image.BufferStrategy;
-import java.awt.peer.ComponentPeer;
-import java.io.Serializable;
-
-import javax.accessibility.Accessible;
-import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRole;
-
-/**
- * The <code>Canvas</code> component provides a blank rectangular
- * area, which the client application can use for drawing and for
- * capturing events. By overriding the <code>paint()</code> method,
- * the canvas can be used for anything from simple line drawings to
- * full-scale custom components.
- *
- * @author Original author unknown
- * @author Tom Tromey (tr...@re...)
- * @author Andrew John Hughes (gnu...@me...)
- * @since 1.0
- */
-
-public class Canvas
- extends Component
- implements Serializable, Accessible
-{
-
- /**
- * Compatible with Sun's JDK.
- */
- private static final long serialVersionUID = -2284879212465893870L;
-
- /**
- * The number used to generate the name returned by getName.
- */
- private static transient long next_canvas_number;
-
- /**
- * The graphics configuration associated with the canvas.
- */
- transient GraphicsConfiguration graphicsConfiguration;
-
- /**
- * The buffer strategy associated with this canvas.
- */
- transient BufferStrategy bufferStrategy;
-
- /**
- * Initializes a new instance of <code>Canvas</code>.
- */
- public Canvas()
- {
- }
-
- /**
- * Initializes a new instance of <code>Canvas</code>
- * with the supplied graphics configuration.
- *
- * @param graphicsConfiguration the graphics configuration to use
- * for this particular canvas.
- */
- public Canvas(GraphicsConfiguration graphicsConfiguration)
- {
- this.graphicsConfiguration = graphicsConfiguration;
- }
-
- GraphicsConfiguration getGraphicsConfigurationImpl()
- {
- if (graphicsConfiguration != null)
- return graphicsConfiguration;
- return super.getGraphicsConfigurationImpl();
- }
-
- /**
- * Creates the native peer for this object.
- */
- public void addNotify()
- {
- if (peer == null)
- peer = (ComponentPeer) getToolkit().createCanvas(this);
- super.addNotify();
- }
-
- /**
- * Repaints the canvas window. This method should be overridden by
- * a subclass to do something useful, as this method simply paints
- * the window with the background color.
- *
- * @param gfx the <code>Graphics</code> to use for painting
- */
- public void paint(Graphics gfx)
- {
- /* This implementation doesn't make much sense since the filling
- of background color is guaranteed for heavyweight components
- such as this. But there's no need to worry, since paint() is
- usually overridden anyway. */
- gfx.setColor(getBackground());
- Dimension size = getSize();
- gfx.fillRect(0, 0, size.width, size.height);
- }
-
- /**
- * This class provides accessibility support for the canvas.
- */
- protected class AccessibleAWTCanvas
- extends AccessibleAWTComponent
- {
- /**
- * For compatability with Sun's JDK
- */
- private static final long serialVersionUID = -6325592262103146699L;
-
- /**
- * Constructor for the accessible canvas.
- */
- protected AccessibleAWTCanvas()
- {
- }
-
- /**
- * Returns the accessible role for the canvas.
- *
- * @return an instance of <code>AccessibleRole</code>, describing
- * the role of the canvas.
- */
- public AccessibleRole getAccessibleRole()
- {
- return AccessibleRole.CANVAS;
- }
-
- }
-
- /**
- * Gets the AccessibleContext associated with this <code>Canvas</code>.
- * The context is created, if necessary.
- *
- * @return the associated context
- */
- public AccessibleContext getAccessibleContext()
- {
- /* Create the context if this is the first request */
- if (accessibleContext == null)
- accessibleContext = new AccessibleAWTCanvas();
- return accessibleContext;
- }
-
- /**
- * A BltBufferStrategy for canvases.
- */
- private class CanvasBltBufferStrategy extends BltB...
[truncated message content] |
|
From: <fd...@us...> - 2008-04-17 22:06:37
|
Revision: 3964
http://jnode.svn.sourceforge.net/jnode/?rev=3964&view=rev
Author: fduminy
Date: 2008-04-17 15:06:36 -0700 (Thu, 17 Apr 2008)
Log Message:
-----------
initial version of vbe/vesa driver
Modified Paths:
--------------
trunk/core/src/core/org/jnode/vm/Unsafe.java
trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java
trunk/core/src/native/x86/i386.h
trunk/core/src/native/x86/kernel.asm
trunk/core/src/native/x86/unsafe.asm
trunk/core/src/native/x86/unsafex86.asm
Added Paths:
-----------
trunk/core/src/native/x86/utils.h
Modified: trunk/core/src/core/org/jnode/vm/Unsafe.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/Unsafe.java 2008-04-17 22:00:46 UTC (rev 3963)
+++ trunk/core/src/core/org/jnode/vm/Unsafe.java 2008-04-17 22:06:36 UTC (rev 3964)
@@ -749,5 +749,7 @@
* @return nanosecond accurate time
*/
public static native long getCpuCycles();
-
+
+
+ public static native int callVbeFunction(Address codePtr, int function, Address bufferPtr);
}
Modified: trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java 2008-04-17 22:00:46 UTC (rev 3963)
+++ trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java 2008-04-17 22:06:36 UTC (rev 3964)
@@ -76,6 +76,11 @@
*/
static final native int getMultibootMMapLength();
+ public static final native Address getVbeInfos();
+ public static final native Address getVbeControlInfos();
+ public static final native Address getVbeModeInfos();
+ public static final native Address getMultibootInfos();
+
/**
* Merge 32-bit ARGB values at the given memory address.
* @param src The source address (points to 32-bit ARGB int's)
Modified: trunk/core/src/native/x86/i386.h
===================================================================
(Binary files differ)
Modified: trunk/core/src/native/x86/kernel.asm
===================================================================
--- trunk/core/src/native/x86/kernel.asm 2008-04-17 22:00:46 UTC (rev 3963)
+++ trunk/core/src/native/x86/kernel.asm 2008-04-17 22:06:36 UTC (rev 3964)
@@ -1,4 +1,3 @@
-; -----------------------------------------------
; $Id$
;
; Main kernel startup code
@@ -22,13 +21,20 @@
align 4
mb_header:
dd 0x1BADB002 ; Magic
- dd 0x00010003 ; Feature flags
- dd 0-0x1BADB002-0x00010003 ; Checksum
+ dd 0x00010007 ; Feature flags
+ dd 0-0x1BADB002-0x00010007 ; Checksum
dd mb_header ; header_addr
dd sys_start ; load_addr
dd 0 ; load_end_addr (patched up by BootImageBuilder)
dd 0 ; bss_end_addr
dd real_start ; entry_addr
+ dd 0 ; mode_type
+; dd 1024 ; width
+; dd 768 ; height
+; dd 32 ; depth
+ dd 0 ; width
+ dd 0 ; height
+ dd 0 ; depth
real_start:
mov esp,Lkernel_esp
@@ -42,6 +48,7 @@
multiboot_ok:
; Copy the multiboot info block
cld
+ mov [multiboot_infos], ebx
mov esi,ebx
mov edi,multiboot_info
mov ecx,MBI_SIZE
@@ -92,6 +99,34 @@
jb multiboot_mmap_copy
multiboot_mmap_done:
+ ; Copy vbe infos (if any)
+ test dword [multiboot_info+MBI_FLAGS],MBF_VBE
+ jz vbe_info_done
+ ; Get start address
+ mov esi,[multiboot_info+MBI_VBECTRLINFO]
+ ; Get destination address
+ mov edi,multiboot_vbe
+ ; Copy the VBE_ESIZE bytes
+ mov ecx,VBE_ESIZE
+ rep movsb
+
+ ; Get start address
+ mov esi,[multiboot_info+MBI_VBECTRLINFO]
+ ; Get destination address
+ mov edi,vbe_control_info
+ ; Copy the VBECTRLINFO_SIZE bytes
+ mov ecx,VBECTRLINFO_SIZE
+ rep movsb
+
+ ; Get start address
+ mov esi,[multiboot_info+MBI_VBEMODEINFO]
+ ; Get destination address
+ mov edi,vbe_mode_info
+ ; Copy the VBEMODEINFO_SIZE bytes
+ mov ecx,VBEMODEINFO_SIZE
+ rep movsb
+vbe_info_done:
+
; Initialize initial jarfile
mov esi,[multiboot_info+MBI_MODSCOUNT]
test esi,esi
@@ -278,3 +313,19 @@
multiboot_mmap:
dd 0 ; Entries
times (MBI_MMAP_MAX * MBMMAP_ESIZE) db 0
+
+multiboot_vbe:
+ dd 0 ; Entries
+ times (VBE_ESIZE) db 0
+
+vbe_control_info:
+ dd 0 ; Entries
+ times (VBECTRLINFO_SIZE) db 0
+
+vbe_mode_info:
+ dd 0 ; Entries
+ times (VBEMODEINFO_SIZE) db 0
+
+multiboot_infos:
+ dd 0
+
\ No newline at end of file
Modified: trunk/core/src/native/x86/unsafe.asm
===================================================================
--- trunk/core/src/native/x86/unsafe.asm 2008-04-17 22:00:46 UTC (rev 3963)
+++ trunk/core/src/native/x86/unsafe.asm 2008-04-17 22:06:36 UTC (rev 3964)
@@ -6,6 +6,8 @@
; Author : E. Prangsma
; -----------------------------------------------
+%include "utils.h"
+
extern VmThread_runThread
extern bootHeapStart
extern bootHeapEnd
@@ -44,39 +46,10 @@
push ADI
push ASI
push ACX
+
+ ; COPY_MEMORY srcMemPtr destMemPtr size
+ COPY_MEMORY [ABX+(4*SLOT_SIZE)], [ABX+(3*SLOT_SIZE)], [ABX+(2*SLOT_SIZE)]
- mov ASI,[ABX+(4*SLOT_SIZE)] ; srcMemPtr
- mov ADI,[ABX+(3*SLOT_SIZE)] ; destMemPtr
- mov ACX,[ABX+(2*SLOT_SIZE)] ; size
-
- ; Test the direction for copying
- cmp ASI,ADI
- jl copy_reverse
-
- ; Copy from left to right
- cld
-copy_bytes:
- test ACX,3 ; Test for size multiple of 4-byte
- jz copy_dwords
- dec ACX
- movsb ; Not yet multiple of 4, copy a single byte and test again
- jmp copy_bytes
-copy_dwords:
- shr ACX,2
- rep movsd
- jmp copy_done
-
-copy_reverse:
- ; Copy from right to left
- pushf
- cli
- std
- lea ASI,[ASI+ACX-1]
- lea ADI,[ADI+ACX-1]
- rep movsb
- popf
-
-copy_done:
pop ACX
pop ASI
pop ADI
@@ -361,3 +334,21 @@
rdtsc
ret
+
+; int callVbeFunction(Address codePtr, int function, Address bufferPtr)
+GLABEL Q43org5jnode2vm6Unsafe23callVbeFunction2e28Lorg2fvmmagic2funboxed2fAddress3bILorg2fvmmagic2funboxed2fAddress3b29I
+ push EDI
+ mov EAX,[ESP+(3*SLOT_SIZE)] ; function
+ mov EDI,[ESP+(2*SLOT_SIZE)] ; bufferPtr
+
+ ; move higher 16 bits of EDI to ES
+ mov EBX, EDI
+ shr EBX, 16
+ mov ES, EBX
+
+ ; keep only lower 16 bits of EDI
+ and EDI, 0x0000FFFF
+
+ call dword far [ESP+(4*SLOT_SIZE)] ; codePtr
+ pop EDI
+ ret SLOT_SIZE*3
\ No newline at end of file
Modified: trunk/core/src/native/x86/unsafex86.asm
===================================================================
--- trunk/core/src/native/x86/unsafex86.asm 2008-04-17 22:00:46 UTC (rev 3963)
+++ trunk/core/src/native/x86/unsafex86.asm 2008-04-17 22:06:36 UTC (rev 3964)
@@ -82,6 +82,26 @@
mov eax,[multiboot_mmap]
ret
+; Address getVbeInfos();
+GLABEL Q53org5jnode2vm3x869UnsafeX8623getVbeInfos2e2829Lorg2fvmmagic2funboxed2fAddress3b
+ mov AAX,multiboot_vbe
+ ret
+
+; Address getVbeControlInfos();
+GLABEL Q53org5jnode2vm3x869UnsafeX8623getVbeControlInfos2e2829Lorg2fvmmagic2funboxed2fAddress3b
+ mov AAX,vbe_control_info
+ ret
+
+; Address getVbeModeInfos();
+GLABEL Q53org5jnode2vm3x869UnsafeX8623getVbeModeInfos2e2829Lorg2fvmmagic2funboxed2fAddress3b
+ mov AAX,vbe_mode_info
+ ret
+
+; Address getMultibootInfos();
+GLABEL Q53org5jnode2vm3x869UnsafeX8623getMultibootInfos2e2829Lorg2fvmmagic2funboxed2fAddress3b
+ mov AAX,multiboot_infos
+ ret
+
; void setupBootCode(Address memory, int[] gdtBase, int[] tss);
GLABEL Q53org5jnode2vm3x869UnsafeX8623setupBootCode2e28Lorg2fvmmagic2funboxed2fAddress3b5bI5bI29V
push ABX
Added: trunk/core/src/native/x86/utils.h
===================================================================
--- trunk/core/src/native/x86/utils.h (rev 0)
+++ trunk/core/src/native/x86/utils.h 2008-04-17 22:06:36 UTC (rev 3964)
@@ -0,0 +1,43 @@
+; -----------------------------------------------
+; $Id: console.h 1661 2005-05-21 07:51:46Z epr $
+;
+; Kernel console macro's
+;
+; Author : E.Prangsma
+; -----------------------------------------------
+
+; Copy a memory block
+%macro COPY_MEMORY 3
+ mov ASI,%1 ; srcMemPtr
+ mov ADI,%2 ; destMemPtr
+ mov ACX,%3 ; size
+
+ ; Test the direction for copying
+ cmp ASI,ADI
+ jl copy_reverse
+
+ ; Copy from left to right
+ cld
+copy_bytes:
+ test ACX,3 ; Test for size multiple of 4-byte
+ jz copy_dwords
+ dec ACX
+ movsb ; Not yet multiple of 4, copy a single byte and test again
+ jmp copy_bytes
+copy_dwords:
+ shr ACX,2
+ rep movsd
+ jmp copy_done
+
+copy_reverse:
+ ; Copy from right to left
+ pushf
+ cli
+ std
+ lea ASI,[ASI+ACX-1]
+ lea ADI,[ADI+ACX-1]
+ rep movsb
+ popf
+
+copy_done:
+%endmacro
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fd...@us...> - 2008-04-20 18:16:06
|
Revision: 3984
http://jnode.svn.sourceforge.net/jnode/?rev=3984&view=rev
Author: fduminy
Date: 2008-04-20 11:16:02 -0700 (Sun, 20 Apr 2008)
Log Message:
-----------
added warning in doc/javadoc for Unsafe.callVbeFunction : method has bugs
Modified Paths:
--------------
trunk/core/src/core/org/jnode/vm/Unsafe.java
trunk/core/src/native/x86/unsafe.asm
Modified: trunk/core/src/core/org/jnode/vm/Unsafe.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/Unsafe.java 2008-04-20 18:09:00 UTC (rev 3983)
+++ trunk/core/src/core/org/jnode/vm/Unsafe.java 2008-04-20 18:16:02 UTC (rev 3984)
@@ -750,6 +750,14 @@
*/
public static native long getCpuCycles();
-
+
+ /**
+ * <b>DO NOT USE THAT METHOD</b> : it's bogus (especially for 64 bits CPU) and has not yet been tested
+ *
+ * @param codePtr
+ * @param function
+ * @param bufferPtr
+ * @return
+ */
public static native int callVbeFunction(Address codePtr, int function, Address bufferPtr);
}
Modified: trunk/core/src/native/x86/unsafe.asm
===================================================================
--- trunk/core/src/native/x86/unsafe.asm 2008-04-20 18:09:00 UTC (rev 3983)
+++ trunk/core/src/native/x86/unsafe.asm 2008-04-20 18:16:02 UTC (rev 3984)
@@ -335,7 +335,8 @@
ret
-; int callVbeFunction(Address codePtr, int function, Address bufferPtr)
+; int callVbeFunction(Address codePtr, int function, Address bufferPtr)
+; DO NOT USE THAT METHOD : it's bogus (especially for 64 bits CPU) and has not yet been tested
GLABEL Q43org5jnode2vm6Unsafe23callVbeFunction2e28Lorg2fvmmagic2funboxed2fAddress3bILorg2fvmmagic2funboxed2fAddress3b29I
push ADI
mov EAX,[ESP+(3*SLOT_SIZE)] ; function
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2008-05-22 09:16:36
|
Revision: 4113
http://jnode.svn.sourceforge.net/jnode/?rev=4113&view=rev
Author: lsantha
Date: 2008-05-22 02:16:34 -0700 (Thu, 22 May 2008)
Log Message:
-----------
Javadoc fixes.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/system/MemoryResource.java
trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java
Modified: trunk/core/src/core/org/jnode/system/MemoryResource.java
===================================================================
--- trunk/core/src/core/org/jnode/system/MemoryResource.java 2008-05-22 09:10:24 UTC (rev 4112)
+++ trunk/core/src/core/org/jnode/system/MemoryResource.java 2008-05-22 09:16:34 UTC (rev 4113)
@@ -39,7 +39,7 @@
/**
* Create a bytebuffer that has the same content as this resource.
- * @return
+ * @return the byte buffer
*/
public abstract ByteBuffer asByteBuffer();
@@ -563,7 +563,7 @@
*
* @param size Length of the returned resource in bytes.
* @param align Align of this boundary. Align must be a multiple of 2.
- * @return
+ * @return the child memory resource
*/
public abstract MemoryResource claimChildResource(Extent size, int align)
throws IndexOutOfBoundsException, ResourceNotFreeException;
@@ -578,7 +578,7 @@
*
* @param size Length of the returned resource in bytes.
* @param align Align of this boundary. Align must be a multiple of 2.
- * @return
+ * @return the child memory resource
*/
public MemoryResource claimChildResource(int size, int align)
throws IndexOutOfBoundsException, ResourceNotFreeException;
@@ -591,7 +591,7 @@
* @param offset Offset relative to the start of this resource.
* @param size Length of the returned resource in bytes.
* @param allowOverlaps If true, overlapping child resources will be allowed, otherwise overlapping child resources will resulut in a ResourceNotFreeException.
- * @return
+ * @return the child memory resource
*/
public abstract MemoryResource claimChildResource(Offset offset, Extent size, boolean allowOverlaps)
throws IndexOutOfBoundsException, ResourceNotFreeException;
@@ -604,7 +604,7 @@
* @param offset Offset relative to the start of this resource.
* @param size Length of the returned resource in bytes.
* @param allowOverlaps If true, overlapping child resources will be allowed, otherwise overlapping child resources will resulut in a ResourceNotFreeException.
- * @return
+ * @return the child memory resource
*/
public abstract MemoryResource claimChildResource(int offset, int size, boolean allowOverlaps)
throws IndexOutOfBoundsException, ResourceNotFreeException;
Modified: trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2008-05-22 09:10:24 UTC (rev 4112)
+++ trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2008-05-22 09:16:34 UTC (rev 4113)
@@ -32,13 +32,13 @@
/**
* Can this device be locked.
- * @return
+ * @return <code>true</code> if this device can be locked, <code>false</code> otherwise
*/
public boolean canLock();
/**
* Can this device be ejected.
- * @return
+ * @return <code>true</code> if this device can be ejected, <code>false</code> otherwise
*/
public boolean canEject();
@@ -58,7 +58,7 @@
/**
* Is this device locked.
- * @return
+ * @return <code>true</code> if this device is locked, <code>false</code> otherwise
*/
public boolean isLocked();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2008-05-22 10:26:54
|
Revision: 4116
http://jnode.svn.sourceforge.net/jnode/?rev=4116&view=rev
Author: lsantha
Date: 2008-05-22 03:26:53 -0700 (Thu, 22 May 2008)
Log Message:
-----------
Javadoc fixes.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java
trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java
Modified: trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java 2008-05-22 10:24:10 UTC (rev 4115)
+++ trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java 2008-05-22 10:26:53 UTC (rev 4116)
@@ -345,7 +345,6 @@
* Create a per processor data structure for use by the heap manager.
*
* @param cpu
- * @return
*/
public abstract Object createProcessorHeapData(VmProcessor cpu);
Modified: trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java
===================================================================
--- trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java 2008-05-22 10:24:10 UTC (rev 4115)
+++ trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java 2008-05-22 10:26:53 UTC (rev 4116)
@@ -347,7 +347,7 @@
* @param align
* @param offset
* @param allocator
- * @return
+ * @return the start address of the allocated memory region
*/
protected abstract Address alloc(int bytes, int align, int offset,
int allocator);
@@ -369,7 +369,6 @@
* @param bytes
* @param align
* @param allocator
- * @return
*/
protected abstract int checkAllocator(int bytes, int align, int allocator);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2008-05-31 12:36:24
|
Revision: 4163
http://jnode.svn.sourceforge.net/jnode/?rev=4163&view=rev
Author: lsantha
Date: 2008-05-31 05:36:22 -0700 (Sat, 31 May 2008)
Log Message:
-----------
Moved nanoxml to endrosed sources.
Added Paths:
-----------
trunk/core/src/endorsed/
trunk/core/src/endorsed/nanoxml/
trunk/core/src/endorsed/nanoxml/org/
trunk/core/src/endorsed/nanoxml/org/jnode/
trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/
trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLElement.java
trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLParseException.java
Added: trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLElement.java
===================================================================
--- trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLElement.java (rev 0)
+++ trunk/core/src/endorsed/nanoxml/org/jnode/nanoxml/XMLElement.java 2008-05-31 12:36:22 UTC (rev 4163)
@@ -0,0 +1,2861 @@
+/* XMLElement.java
+ *
+ * $Revision: 1950 $
+ * $Date: 2005-07-28 12:29:12 +0300 (Thu, 28 Jul 2005) $
+ * $Name$
+ *
+ * This file is part of NanoXML 2 Lite.
+ * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved.
+ *
+ * This software is provided 'as-is', without any express or implied warranty.
+ * In no event will the authors be held liable for any damages arising from the
+ * use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software in
+ * a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source distribution.
+ *****************************************************************************/
+
+
+package org.jnode.nanoxml;
+
+
+import java.io.ByteArrayOutputStream;
+import java.io.CharArrayReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
+
+/**
+ * XMLElement is a representation of an XML object. The object is able to parse
+ * XML code.
+ * <P><DL>
+ * <DT><B>Parsing XML Data</B></DT>
+ * <DD>
+ * You can parse XML data using the following code:
+ * <UL><CODE>
+ * XMLElement xml = new XMLElement();<BR>
+ * FileReader reader = new FileReader("filename.xml");<BR>
+ * xml.parseFromReader(reader);
+ * </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}.
+ * 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>
+ * <DL><DT><B>Retrieving Child Elements</B></DT>
+ * <DD>
+ * You can enumerate the children of an element using
+ * {@link #enumerateChildren() enumerateChildren}.
+ * 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:
+ * <UL><CODE>
+ * <title>The Title</title>
+ * </CODE></UL>
+ * you can retrieve that data using the method
+ * {@link #getContent() getContent}.
+ * </DD></DL>
+ * <DL><DT><B>Subclassing XMLElement</B></DT>
+ * <DD>
+ * When subclassing XMLElement, you need to override the method
+ * {@link #createAnotherElement() createAnotherElement}
+ * which has to return a new copy of the receiver.
+ * </DD></DL>
+ * <P>
+ *
+ * @see XMLParseException
+ *
+ * @author Marc De Scheemaecker
+ * <<A href="mailto:cyb...@ma...">cyb...@ma...</A>>
+ * @version $Name$, $Revision: 1950 $
+ */
+public class XMLElement
+{
+
+ /**
+ * Serialization serial version ID.
+ */
+ static final long serialVersionUID = 6685035139346394777L;
+
+
+ /**
+ * Major version of NanoXML. Classes with the same major and minor
+ * version are binary compatible. Classes with the same major version
+ * are source compatible. If the major version is different, you may
+ * need to modify the client source code.
+ *
+ * @see XMLElement#NANOXML_MINOR_VERSION
+ */
+ public static final int NANOXML_MAJOR_VERSION = 2;
+
+
+ /**
+ * Minor version of NanoXML. Classes with the same major and minor
+ * version are binary compatible. Classes with the same major version
+ * are source compatible. If the major version is different, you may
+ * need to modify the client source code.
+ *
+ * @see XMLElement#NANOXML_MAJOR_VERSION
+ */
+ public static final int NANOXML_MINOR_VERSION = 2;
+
+
+ /**
+ * The attributes given to the element.
+ *
+ * <dl><dt><b>Invariants:</b></dt><dd>
+ * <ul><li>The field can be empty.
+ * <li>The field is never <code>null</code>.
+ * <li>The keys and the values are strings.
+ * </ul></dd></dl>
+ */
+ private Map<String, String> attributes;
+
+
+ /**
+ * Child elements of the element.
+ *
+ * <dl><dt><b>Invariants:</b></dt><dd>
+ * <ul><li>The field can be empty.
+ * <li>The field is never <code>null</code>.
+ * <li>The elements are instances of <code>XMLElement</code>
+ * or a subclass of <code>XMLElement</code>.
+ * </ul></dd></dl>
+ */
+ private List<XMLElement> children;
+
+
+ /**
+ * The name of the element.
+ *
+ * <dl><dt><b>Invariants:</b></dt><dd>
+ * <ul><li>The field is <code>null</code> iff the element is not
+ * initialized by either parse or setName.
+ * <li>If the field is not <code>null</code>, it's not empty.
+ * <li>If the field is not <code>null</code>, it contains a valid
+ * XML identifier.
+ * </ul></dd></dl>
+ */
+ private String name;
+
+
+ /**
+ * The #PCDATA content of the object.
+ *
+ * <dl><dt><b>Invariants:</b></dt><dd>
+ * <ul><li>The field is <code>null</code> iff the element is not a
+ * #PCDATA element.
+ * <li>The field can be any string, including the empty string.
+ * </ul></dd></dl>
+ */
+ private String contents;
+
+
+ /**
+ * Conversion table for &...; entities. The keys are the entity names
+ * without the & and ; delimiters.
+ *
+ * <dl><dt><b>Invariants:</b></dt><dd>
+ * <ul><li>The field is never <code>null</code>.
+ * <li>The field always contains the following associations:
+ * "lt" => "<", "gt" => ">",
+ * "quot" => "\"", "apos" => "'",
+ * "amp" => "&"
+ * <li>The keys are strings
+ * <li>The values are char arrays
+ * </ul></dd></dl>
+ */
+ private Hashtable entities;
+
+
+ /**
+ * The line number where the element starts.
+ *
+ * <dl><dt><b>Invariants:</b></dt><dd>
+ * <ul><li><code>lineNr >= 0</code>
+ * </ul></dd></dl>
+ */
+ private int lineNr;
+
+
+ /**
+ * <code>true</code> if the case of the element and attribute names
+ * are case insensitive.
+ */
+ private boolean ignoreCase;
+
+
+ /**
+ * <code>true</code> if the leading and trailing whitespace of #PCDATA
+ * sections have to be ignored.
+ */
+ private boolean ignoreWhitespace;
+
+
+ /**
+ * Character read too much.
+ * This character provides push-back functionality to the input reader
+ * without having to use a PushbackReader.
+ * If there is no such character, this field is '\0'.
+ */
+ private char charReadTooMuch;
+
+
+ /**
+ * The reader provided by the caller of the parse method.
+ *
+ * <dl><dt><b>Invariants:</b></dt><dd>
+ * <ul><li>The field is not <code>null</code> while the parse method
+ * is running.
+ * </ul></dd></dl>
+ */
+ private Reader reader;
+
+
+ /**
+ * The current line number in the source content.
+ *
+ * <dl><dt><b>Invariants:</b></dt><dd>
+ * <ul><li>parserLineNr > 0 while the parse method is running.
+ * </ul></dd></dl>
+ */
+ private int parserLineNr;
+
+
+ /**
+ * Creates and initializes a new XML element.
+ * Calling the construction is equivalent to:
+ * <ul><code>new XMLElement(new Hashtable(), false, true)
+ * </code></ul>
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li>countChildren() => 0
+ * <li>enumerateChildren() => empty enumeration
+ * <li>enumeratePropertyNames() => empty enumeration
+ * <li>getChildren() => empty vector
+ * <li>getContent() => ""
+ * <li>getLineNr() => 0
+ * <li>getName() => null
+ * </ul></dd></dl>
+ *
+ * @see XMLElement#XMLElement(java.util.Hashtable)
+ * XMLElement(Hashtable)
+ * @see XMLElement#XMLElement(boolean)
+ * @see XMLElement#XMLElement(java.util.Hashtable,boolean)
+ * XMLElement(Hashtable, boolean)
+ */
+ public XMLElement()
+ {
+ this(new Hashtable(), false, true, true);
+ }
+
+
+ /**
+ * Creates and initializes a new XML element.
+ * Calling the construction is equivalent to:
+ * <ul><code>new XMLElement(entities, false, true)
+ * </code></ul>
+ *
+ * @param entities
+ * The entity conversion table.
+ *
+ * </dl><dl><dt><b>Preconditions:</b></dt><dd>
+ * <ul><li><code>entities != null</code>
+ * </ul></dd></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>getContent() => ""
+ * <li>getLineNr() => 0
+ * <li>getName() => null
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#XMLElement()
+ * @see XMLElement#XMLElement(boolean)
+ * @see XMLElement#XMLElement(java.util.Hashtable,boolean)
+ * XMLElement(Hashtable, boolean)
+ */
+ public XMLElement(Hashtable entities)
+ {
+ this(entities, false, true, true);
+ }
+
+
+ /**
+ * Creates and initializes a new XML element.
+ * Calling the construction is equivalent to:
+ * <ul><code>new XMLElement(new Hashtable(), skipLeadingWhitespace, true)
+ * </code></ul>
+ *
+ * @param skipLeadingWhitespace
+ * <code>true</code> if leading and trailing whitespace in PCDATA
+ * content has to be removed.
+ *
+ * </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>getContent() => ""
+ * <li>getLineNr() => 0
+ * <li>getName() => null
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#XMLElement()
+ * @see XMLElement#XMLElement(java.util.Hashtable)
+ * XMLElement(Hashtable)
+ * @see XMLElement#XMLElement(java.util.Hashtable,boolean)
+ * XMLElement(Hashtable, boolean)
+ */
+ public XMLElement(boolean skipLeadingWhitespace)
+ {
+ this(new Hashtable(), skipLeadingWhitespace, true, true);
+ }
+
+
+ /**
+ * Creates and initializes a new XML element.
+ * Calling the construction is equivalent to:
+ * <ul><code>new XMLElement(entities, skipLeadingWhitespace, true)
+ * </code></ul>
+ *
+ * @param entities
+ * The entity conversion table.
+ * @param skipLeadingWhitespace
+ * <code>true</code> if leading and trailing whitespace in PCDATA
+ * content has to be removed.
+ *
+ * </dl><dl><dt><b>Preconditions:</b></dt><dd>
+ * <ul><li><code>entities != null</code>
+ * </ul></dd></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>getContent() => ""
+ * <li>getLineNr() => 0
+ * <li>getName() => null
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#XMLElement()
+ * @see XMLElement#XMLElement(boolean)
+ * @see XMLElement#XMLElement(java.util.Hashtable)
+ * XMLElement(Hashtable)
+ */
+ public XMLElement(Hashtable entities,
+ boolean skipLeadingWhitespace)
+ {
+ this(entities, skipLeadingWhitespace, true, true);
+ }
+
+
+ /**
+ * Creates and initializes a new XML element.
+ *
+ * @param entities
+ * The entity conversion table.
+ * @param skipLeadingWhitespace
+ * <code>true</code> if leading and trailing whitespace in PCDATA
+ * content has to be removed.
+ * @param ignoreCase
+ * <code>true</code> if the case of element and attribute names have
+ * to be ignored.
+ *
+ * </dl><dl><dt><b>Preconditions:</b></dt><dd>
+ * <ul><li><code>entities != null</code>
+ * </ul></dd></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>getContent() => ""
+ * <li>getLineNr() => 0
+ * <li>getName() => null
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#XMLElement()
+ * @see XMLElement#XMLElement(boolean)
+ * @see XMLElement#XMLElement(java.util.Hashtable)
+ * XMLElement(Hashtable)
+ * @see XMLElement#XMLElement(java.util.Hashtable,boolean)
+ * XMLElement(Hashtable, boolean)
+ */
+ public XMLElement(Hashtable entities,
+ boolean skipLeadingWhitespace,
+ boolean ignoreCase)
+ {
+ this(entities, skipLeadingWhitespace, true, ignoreCase);
+ }
+
+
+ /**
+ * Creates and initializes a new XML element.
+ * <P>
+ * This constructor should <I>only</I> be called from
+ * {@link #createAnotherElement() createAnotherElement}
+ * to create child elements.
+ *
+ * @param entities
+ * The entity conversion table.
+ * @param skipLeadingWhitespace
+ * <code>true</code> if leading and trailing whitespace in PCDATA
+ * content has to be removed.
+ * @param fillBasicConversionTable
+ * <code>true</code> if the basic entities need to be added to
+ * the entity list.
+ * @param ignoreCase
+ * <code>true</code> if the case of element and attribute names have
+ * to be ignored.
+ *
+ * </dl><dl><dt><b>Preconditions:</b></dt><dd>
+ * <ul><li><code>entities != null</code>
+ * <li>if <code>fillBasicConversionTable == false</code>
+ * then <code>entities</code> contains at least the following
+ * entries: <code>amp</code>, <code>lt</code>, <code>gt</code>,
+ * <code>apos</code> and <code>quot</code>
+ * </ul></dd></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>getContent() => ""
+ * <li>getLineNr() => 0
+ * <li>getName() => null
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#createAnotherElement()
+ */
+ protected XMLElement(Hashtable entities,
+ boolean skipLeadingWhitespace,
+ boolean fillBasicConversionTable,
+ boolean ignoreCase)
+ {
+ this.ignoreWhitespace = skipLeadingWhitespace;
+ this.ignoreCase = ignoreCase;
+ this.name = null;
+ this.contents = "";
+ this.attributes = new HashMap<String, String>();
+ this.children = new ArrayList<XMLElement>();
+ this.entities = entities;
+ this.lineNr = 0;
+ Enumeration e = this.entities.keys();
+ while (e.hasMoreElements()) {
+ Object key = e.nextElement();
+ Object value = this.entities.get(key);
+ if (value instanceof String) {
+ value = ((String) value).toCharArray();
+ this.entities.put(key, value);
+ }
+ }
+ if (fillBasicConversionTable) {
+ this.entities.put("amp", new char[] { '&' });
+ this.entities.put("quot", new char[] { '"' });
+ this.entities.put("apos", new char[] { '\'' });
+ this.entities.put("lt", new char[] { '<' });
+ this.entities.put("gt", new char[] { '>' });
+ }
+ }
+
+
+ /**
+ * Adds a child element.
+ *
+ * @param child
+ * The child element to add.
+ *
+ * </dl><dl><dt><b>Preconditions:</b></dt><dd>
+ * <ul><li><code>child != null</code>
+ * <li><code>child.getName() != null</code>
+ * <li><code>child</code> does not have a parent element
+ * </ul></dd></dl>
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li>countChildren() => old.countChildren() + 1
+ * <li>enumerateChildren() => old.enumerateChildren() + child
+ * <li>getChildren() => old.enumerateChildren() + child
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#countChildren()
+ * @see XMLElement#enumerateChildren()
+ * @see XMLElement#getChildren()
+ * @see XMLElement#removeChild(XMLElement)
+ * removeChild(XMLElement)
+ */
+ public void addChild(XMLElement child)
+ {
+ this.children.add(child);
+ }
+
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * @param name
+ * The name of the attribute.
+ * @param value
+ * The value of the attribute.
+ *
+ * </dl><dl><dt><b>Preconditions:</b></dt><dd>
+ * <ul><li><code>name != null</code>
+ * <li><code>name</code> is a valid XML identifier
+ * <li><code>value != null</code>
+ * </ul></dd></dl>
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li>enumerateAttributeNames()
+ * => old.enumerateAttributeNames() + name
+ * <li>getAttribute(name) => value
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#setDoubleAttribute(String, double)
+ * setDoubleAttribute(String, double)
+ * @see XMLElement#setIntAttribute(String, int)
+ * setIntAttribute(String, int)
+ * @see XMLElement#enumerateAttributeNames()
+ * @see XMLElement#getAttribute(String)
+ * getAttribute(String)
+ * @see XMLElement#getAttribute(String, Object)
+ * getAttribute(String, Object)
+ * @see XMLElement#getAttribute(String,
+ * java.util.Hashtable,
+ * String, boolean)
+ * getAttribute(String, Hashtable, String, boolean)
+ * @see XMLElement#getStringAttribute(String)
+ * getStringAttribute(String)
+ * @see XMLElement#getStringAttribute(String,
+ * String)
+ * getStringAttribute(String, String)
+ * @see XMLElement#getStringAttribute(String,
+ * java.util.Hashtable,
+ * String, boolean)
+ * getStringAttribute(String, Hashtable, String, boolean)
+ */
+ public void setAttribute(String name,
+ Object value)
+ {
+ if (this.ignoreCase) {
+ name = name.toUpperCase();
+ }
+ this.attributes.put(name, value.toString());
+ }
+
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * @param name
+ * The name of the attribute.
+ * @param value
+ * The value of the attribute.
+ *
+ * @deprecated Use {@link #setAttribute(String, Object)
+ * setAttribute} instead.
+ */
+ public void addProperty(String name,
+ Object value)
+ {
+ this.setAttribute(name, value);
+ }
+
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * @param name
+ * The name of the attribute.
+ * @param value
+ * The value of the attribute.
+ *
+ * </dl><dl><dt><b>Preconditions:</b></dt><dd>
+ * <ul><li><code>name != null</code>
+ * <li><code>name</code> is a valid XML identifier
+ * </ul></dd></dl>
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li>enumerateAttributeNames()
+ * => old.enumerateAttributeNames() + name
+ * <li>getIntAttribute(name) => value
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#setDoubleAttribute(String, double)
+ * setDoubleAttribute(String, double)
+ * @see XMLElement#setAttribute(String, Object)
+ * setAttribute(String, Object)
+ * @see XMLElement#removeAttribute(String)
+ * removeAttribute(String)
+ * @see XMLElement#enumerateAttributeNames()
+ * @see XMLElement#getIntAttribute(String)
+ * getIntAttribute(String)
+ * @see XMLElement#getIntAttribute(String, int)
+ * getIntAttribute(String, int)
+ * @see XMLElement#getIntAttribute(String,
+ * java.util.Hashtable,
+ * String, boolean)
+ * getIntAttribute(String, Hashtable, String, boolean)
+ */
+ public void setIntAttribute(String name,
+ int value)
+ {
+ if (this.ignoreCase) {
+ name = name.toUpperCase();
+ }
+ this.attributes.put(name, Integer.toString(value));
+ }
+
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * @param name
+ * The name of the attribute.
+ * @param value
+ * The value of the attribute.
+ *
+ * @deprecated Use {@link #setIntAttribute(String, int)
+ * setIntAttribute} instead.
+ */
+ public void addProperty(String key,
+ int value)
+ {
+ this.setIntAttribute(key, value);
+ }
+
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * @param name
+ * The name of the attribute.
+ * @param value
+ * The value of the attribute.
+ *
+ * </dl><dl><dt><b>Preconditions:</b></dt><dd>
+ * <ul><li><code>name != null</code>
+ * <li><code>name</code> is a valid XML identifier
+ * </ul></dd></dl>
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li>enumerateAttributeNames()
+ * => old.enumerateAttributeNames() + name
+ * <li>getDoubleAttribute(name) => value
+ * </ul></dd></dl><dl>
+ *
+ * @see XMLElement#setIntAttribute(String, int)
+ * setIntAttribute(String, int)
+ * @see XMLElement#setAttribute(String, Object)
+ * setAttribute(String, Object)
+ * @see XMLElement#removeAttribute(String)
+ * removeAttribute(String)
+ * @see XMLElement#enumerateAttributeNames()
+ * @see XMLElement#getDoubleAttribute(String)
+ * getDoubleAttribute(String)
+ * @see XMLElement#getDoubleAttribute(String, double)
+ * getDoubleAttribute(String, double)
+ * @see XMLElement#getDoubleAttribute(String,
+ * java.util.Hashtable,
+ * String, boolean)
+ * getDoubleAttribute(String, Hashtable, String, boolean)
+ */
+ public void setDoubleAttribute(String name,
+ double value)
+ {
+ if (this.ignoreCase) {
+ name = name.toUpperCase();
+ }
+ this.attributes.put(name, Double.toString(value));
+ }
+
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * @param name
+ * The name of the attribute.
+ * @param value
+ * The value of the attribute.
+ *
+ * @deprecated Use {@link #setDoubleAttribute(String, double)
+ * setDoubleAttribute} instead.
+ */
+ public void addProperty(String name,
+ double value)
+ {
+ this.setDoubleAttribute(name, value);
+ }
+
+
+ /**
+ * Returns the number of child elements of the element.
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li><code>result >= 0</code>
+ * </ul></dd></dl>
+ *
+ * @see XMLElement#addChild(XMLElement)
+ * addChild(XMLElement)
+ * @see XMLElement#enumerateChildren()
+ * @see XMLElement#getChildren()
+ * @see XMLElement#removeChild(XMLElement)
+ * removeChild(XMLElement)
+ */
+ public int countChildren()
+ {
+ return this.children.size();
+ }
+
+
+ /**
+ * Enumerates the attribute names.
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li><code>result != null</code>
+ * </ul></dd></dl>
+ *
+ * @see XMLElement#setDoubleAttribute(String, double)
+ * setDoubleAttribute(String, double)
+ * @see XMLElement#setIntAttribute(String, int)
+ * setIntAttribute(String, int)
+ * @see XMLElement#setAttribute(String, Object)
+ * setAttribute(String, Object)
+ * @see XMLElement#removeAttribute(String)
+ * removeAttribute(String)
+ * @see XMLElement#getAttribute(String)
+ * getAttribute(String)
+ * @see XMLElement#getAttribute(String, Object)
+ * getAttribute(String, String)
+ * @see XMLElement#getAttribute(String,
+ * java.util.Hashtable,
+ * String, boolean)
+ * getAttribute(String, Hashtable, String, boolean)
+ * @see XMLElement#getStringAttribute(String)
+ * getStringAttribute(String)
+ * @see XMLElement#getStringAttribute(String,
+ * String)
+ * getStringAttribute(String, String)
+ * @see XMLElement#getStringAttribute(String,
+ * java.util.Hashtable,
+ * String, boolean)
+ * getStringAttribute(String, Hashtable, String, boolean)
+ * @see XMLElement#getIntAttribute(String)
+ * getIntAttribute(String)
+ * @see XMLElement#getIntAttribute(String, int)
+ * getIntAttribute(String, int)
+ * @see XMLElement#getIntAttribute(String,
+ * java.util.Hashtable,
+ * String, boolean)
+ * getIntAttribute(String, Hashtable, String, boolean)
+ * @see XMLElement#getDoubleAttribute(String)
+ * getDoubleAttribute(String)
+ * @see XMLElement#getDoubleAttribute(String, double)
+ * getDoubleAttribute(String, double)
+ * @see XMLElement#getDoubleAttribute(String,
+ * java.util.Hashtable,
+ * String, boolean)
+ * getDoubleAttribute(String, Hashtable, String, boolean)
+ * @see XMLElement#getBooleanAttribute(String,
+ * String,
+ * String, boolean)
+ * getBooleanAttribute(String, String, String, boolean)
+ */
+ public Set<String> attributeNames()
+ {
+ return Collections.unmodifiableSet(this.attributes.keySet());
+ }
+
+
+ /**
+ * Enumerates the child elements.
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li><code>result != null</code>
+ * </ul></dd></dl>
+ *
+ * @see XMLElement#addChild(XMLElement)
+ * addChild(XMLElement)
+ * @see XMLElement#countChildren()
+ * @see XMLElement#getChildren()
+ * @see XMLElement#removeChild(XMLElement)
+ * removeChild(XMLElement)
+ */
+ public Iterator<XMLElement> iteratorChildren()
+ {
+ return this.children.iterator();
+ }
+
+
+ /**
+ * Returns the child elements as a Vector. It is safe to modify this
+ * Vector.
+ *
+ * <dl><dt><b>Postconditions:</b></dt><dd>
+ * <ul><li><code>result != null</code>
+ * </ul></dd></dl>
+ *
+ * @see XMLElement#addChild(XMLElement)
+ * addChild(XMLElement)
+ * @see XMLElement#countChildren()
+ * @see XMLElement#enumerateChildren()
+ * @see XMLElement#removeChild(XMLElement)
+ * removeChild(XMLElement)
+ */
+ public List<X...
[truncated message content] |
|
From: <ls...@us...> - 2008-06-04 19:38:48
|
Revision: 4195
http://jnode.svn.sourceforge.net/jnode/?rev=4195&view=rev
Author: lsantha
Date: 2008-06-04 12:38:45 -0700 (Wed, 04 Jun 2008)
Log Message:
-----------
Code style fixes.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoder.java
trunk/core/src/core/org/jnode/system/event/SystemEvent.java
trunk/core/src/core/org/jnode/system/repository/plugins/PluginLoaderPlugin.java
trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java
trunk/core/src/core/org/jnode/util/ByteQueue.java
trunk/core/src/core/org/jnode/util/Counter.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/util/SystemInputStream.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/VmAbstractClassLoader.java
trunk/core/src/core/org/jnode/vm/VmMagic.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/VmAnnotation.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/VmType.java
trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java
trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java
trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.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/x86/VmX86Architecture32.java
trunk/core/src/core/org/jnode/vm/x86/X86IRQManager.java
trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java
trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerFPU.java
trunk/core/src/driver/org/jnode/driver/AbstractDeviceManager.java
trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java
trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMM.java
trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipe.java
trunk/core/src/driver/org/jnode/driver/console/textscreen/Line.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/KeyboardInterpreter.java
trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java
trunk/core/src/driver/org/jnode/driver/textscreen/x86/AbstractPcBufferTextScreen.java
trunk/core/src/test/org/jnode/test/AllTests.java
trunk/core/src/test/org/jnode/test/IfNullTest.java
trunk/core/src/test/org/jnode/test/InlineTestClass.java
trunk/core/src/test/org/jnode/test/X86StreamTest.java
trunk/core/src/test/org/jnode/test/framework/TestManager.java
trunk/core/src/test/org/jnode/test/security/TestSecurityManager.java
trunk/core/src/test/org/jnode/test/threads/ThreadingUtils.java
Modified: trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoder.java
===================================================================
--- trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoder.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoder.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -48,7 +48,7 @@
private int x = 0, y = 0, num = 0, yp = 0; // the begin point of MCU
private int IDCT_Source[] = new int[64];
- private final static int IDCT_P[] = {
+ private static final int IDCT_P[] = {
0, 5, 40, 16, 45, 2, 7, 42,
21, 56, 8, 61, 18, 47, 1, 4,
41, 23, 58, 13, 32, 24, 37, 10,
@@ -58,7 +58,7 @@
50, 55, 25, 36, 11, 62, 14, 35,
28, 49, 52, 27, 38, 30, 51, 54
};
- private final static int table[] = {
+ private static final int table[] = {
0, 1, 5, 6, 14, 15, 27, 28,
2, 4, 7, 13, 16, 26, 29, 42,
3, 8, 12, 17, 25, 30, 41, 43,
Modified: trunk/core/src/core/org/jnode/system/event/SystemEvent.java
===================================================================
--- trunk/core/src/core/org/jnode/system/event/SystemEvent.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/system/event/SystemEvent.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -60,21 +60,21 @@
/**
* @return int
*/
- final public int getId() {
+ public final int getId() {
return id;
}
/**
* @return long
*/
- final public long getTime() {
+ public final long getTime() {
return time;
}
/**
* Mark this event as being consumed.
*/
- final public void consume() {
+ public final void consume() {
consumed = true;
}
@@ -83,7 +83,7 @@
*
* @return boolean
*/
- final public boolean isConsumed() {
+ public final boolean isConsumed() {
return consumed;
}
}
Modified: trunk/core/src/core/org/jnode/system/repository/plugins/PluginLoaderPlugin.java
===================================================================
--- trunk/core/src/core/org/jnode/system/repository/plugins/PluginLoaderPlugin.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/system/repository/plugins/PluginLoaderPlugin.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -44,7 +44,7 @@
/**
* Empty array of providers
*/
- final static SystemRepositoryProvider[] EMPTY_ARR = new SystemRepositoryProvider[0];
+ static final SystemRepositoryProvider[] EMPTY_ARR = new SystemRepositoryProvider[0];
private PluginRegistry registry;
Modified: trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java
===================================================================
--- trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -22,8 +22,8 @@
public static final BinaryScaleFactor MIN = B;
public static final BinaryScaleFactor MAX = E;
- final private long multiplier;
- final private String unit;
+ private final long multiplier;
+ private final String unit;
private BinaryScaleFactor(long multiplier, String unit) {
this.multiplier = multiplier;
Modified: trunk/core/src/core/org/jnode/util/ByteQueue.java
===================================================================
--- trunk/core/src/core/org/jnode/util/ByteQueue.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/util/ByteQueue.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -30,7 +30,7 @@
*/
public class ByteQueue {
- final static int Q_SIZE = 10;
+ static final int Q_SIZE = 10;
private final byte[] data;
private final int size;
Modified: trunk/core/src/core/org/jnode/util/Counter.java
===================================================================
--- trunk/core/src/core/org/jnode/util/Counter.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/util/Counter.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -26,7 +26,7 @@
*/
public final class Counter extends Statistic implements Comparable<Counter> {
- private final static String is = "=";
+ private static final String is = "=";
private int counter = 0;
Modified: trunk/core/src/core/org/jnode/util/DecimalScaleFactor.java
===================================================================
--- trunk/core/src/core/org/jnode/util/DecimalScaleFactor.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/util/DecimalScaleFactor.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -22,8 +22,8 @@
public static final DecimalScaleFactor MIN = B;
public static final DecimalScaleFactor MAX = E;
- final private long multiplier;
- final private String unit;
+ private final long multiplier;
+ private final String unit;
private DecimalScaleFactor(long multiplier, String unit) {
this.multiplier = multiplier;
Modified: trunk/core/src/core/org/jnode/util/SizeUnit.java
===================================================================
--- trunk/core/src/core/org/jnode/util/SizeUnit.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/util/SizeUnit.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -22,8 +22,8 @@
public static final SizeUnit MIN = B;
public static final SizeUnit MAX = E;
- final private long multiplier;
- final private String unit;
+ private final long multiplier;
+ private final String unit;
private SizeUnit(long multiplier, String unit) {
this.multiplier = multiplier;
Modified: trunk/core/src/core/org/jnode/util/SystemInputStream.java
===================================================================
--- trunk/core/src/core/org/jnode/util/SystemInputStream.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/util/SystemInputStream.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -24,10 +24,10 @@
import java.io.IOException;
import java.io.InputStream;
-final public class SystemInputStream extends InputStream {
- final private static InputStream EMPTY = new EmptyInputStream();
+public final class SystemInputStream extends InputStream {
+ private static final InputStream EMPTY = new EmptyInputStream();
- final private class ThreadLocalInputStream extends InheritableThreadLocal {
+ private final class ThreadLocalInputStream extends InheritableThreadLocal {
public Object get() {
Object o = super.get();
if (o == EMPTY) {
@@ -48,13 +48,13 @@
private ThreadLocalInputStream systemInOwnerLocal;
- final private ThreadLocalInputStream localeIn = new ThreadLocalInputStream();
+ private final ThreadLocalInputStream localeIn = new ThreadLocalInputStream();
- final public InputStream getIn() {
+ public final InputStream getIn() {
return getLocalIn();
}
- final public void setIn(InputStream in) {
+ public final void setIn(InputStream in) {
if (in != this) {
localeIn.set(in);
}
@@ -63,11 +63,11 @@
/**
* TODO must be protected by the SecurityManager
*/
- final public void claimSystemIn() {
+ public final void claimSystemIn() {
setIn(systemIn);
}
- final public void releaseSystemIn() {
+ public final void releaseSystemIn() {
this.systemIn = EMPTY;
}
@@ -109,7 +109,7 @@
*
* @param readlimit The parameter passed to <code>in.mark(int)</code>
*/
- final public void mark(int readlimit) {
+ public final void mark(int readlimit) {
getLocalIn().mark(readlimit);
}
@@ -119,7 +119,7 @@
* @return <code>true</code> if mark/reset is supported, <code>false</code>
* otherwise
*/
- final public boolean markSupported() {
+ public final boolean markSupported() {
return getLocalIn().markSupported();
}
@@ -128,7 +128,7 @@
*
* @throws IOException If an error occurs
*/
- final public void reset() throws IOException {
+ public final void reset() throws IOException {
getLocalIn().reset();
}
@@ -138,7 +138,7 @@
* @return The value returned from <code>in.available()</code>
* @throws IOException If an error occurs
*/
- final public int available() throws IOException {
+ public final int available() throws IOException {
return getLocalIn().available();
}
@@ -149,7 +149,7 @@
* @return The value returned from <code>in.skip(long)</code>
* @throws IOException If an error occurs
*/
- final public long skip(long numBytes) throws IOException {
+ public final long skip(long numBytes) throws IOException {
return getLocalIn().skip(numBytes);
}
@@ -159,7 +159,7 @@
* @return The value returned from <code>in.read()</code>
* @throws IOException If an error occurs
*/
- final public int read() throws IOException {
+ public final int read() throws IOException {
return getLocalIn().read();
}
@@ -174,7 +174,7 @@
* @return The value retured from <code>in.read(byte[], int, int)</code>
* @throws IOException If an error occurs
*/
- final public int read(byte[] buf) throws IOException {
+ public final int read(byte[] buf) throws IOException {
return read(buf, 0, buf.length);
}
@@ -187,7 +187,7 @@
* @return The value retured from <code>in.read(byte[], int, int)</code>
* @throws IOException If an error occurs
*/
- final public int read(byte[] buf, int offset, int len) throws IOException {
+ public final int read(byte[] buf, int offset, int len) throws IOException {
return getLocalIn().read(buf, offset, len);
}
@@ -198,11 +198,11 @@
*
* @throws IOException If an error occurs
*/
- final public void close() throws IOException {
+ public final void close() throws IOException {
getLocalIn().close();
}
- final private InputStream getLocalIn() {
+ private InputStream getLocalIn() {
return (InputStream) localeIn.get();
}
}
Modified: trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -91,7 +91,7 @@
private static Word nextBlockNr;
/* Predictive Compilation */
- private final static boolean DBG = false;
+ private static final boolean DBG = false;
/**
* Allocate a new block of memory at blockSize large. The actual size is
@@ -245,7 +245,7 @@
/**
* Initialize this manager.
*/
- private final static void initialize() {
+ private static void initialize() {
Unsafe.debug("Initialize MemoryBlockManager\n");
startPtr = blockAlign(Unsafe.getMemoryStart().toWord(), true).toAddress();
Modified: trunk/core/src/core/org/jnode/vm/MemoryResourceImpl.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/MemoryResourceImpl.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/MemoryResourceImpl.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -730,7 +730,7 @@
*
* @param child
*/
- private synchronized final void removeChild(MemoryResourceImpl child) {
+ private synchronized void removeChild(MemoryResourceImpl child) {
this.children = (MemoryResourceImpl) remove(this.children, child);
}
Modified: trunk/core/src/core/org/jnode/vm/VmAbstractClassLoader.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmAbstractClassLoader.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/VmAbstractClassLoader.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -78,7 +78,7 @@
* @param createdType
* @return VmClass
*/
- public synchronized final VmType<?> defineClass(VmType<?> createdType) {
+ public final synchronized VmType<?> defineClass(VmType<?> createdType) {
if (createdType.getLoader() != this) {
throw new SecurityException("Created type not for this loader");
}
Modified: trunk/core/src/core/org/jnode/vm/VmMagic.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmMagic.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/VmMagic.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -174,7 +174,7 @@
* @return the processor executing the current thread
*/
@KernelSpace
- public final static VmProcessor currentProcessor() {
+ public static VmProcessor currentProcessor() {
return null;
}
@@ -184,7 +184,7 @@
* @param index
* @return the address of a shared static field
*/
- public final static Address getSharedStaticFieldAddress(int index) {
+ public static Address getSharedStaticFieldAddress(int index) {
return null;
}
@@ -194,7 +194,7 @@
* @param index
* @return the address of a isolated static field
*/
- public final static Address getIsolatedStaticFieldAddress(int index) {
+ public static Address getIsolatedStaticFieldAddress(int index) {
return null;
}
@@ -203,7 +203,7 @@
*
* @return true when running JNode, false when running any other VM.
*/
- public final static boolean isRunningJNode() {
+ public static boolean isRunningJNode() {
return false;
}
Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmSystem.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -205,7 +205,7 @@
});
}
- final static boolean isInitialized() {
+ static boolean isInitialized() {
return inited;
}
@@ -952,7 +952,7 @@
* @return the speed of the current processor in "JNodeMips"
*/
@Uninterruptible
- public final static float calculateJNodeMips() {
+ public static float calculateJNodeMips() {
final long millis = currentTimeMillis % 1000;
while (millis == (currentTimeMillis % 1000)) {
// Wait
Modified: trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -65,7 +65,7 @@
private transient URL classesURL;
- static private transient boolean verbose = false;
+ private static transient boolean verbose = false;
private transient boolean failOnNewLoad = false;
Modified: trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -1238,7 +1238,7 @@
return result;
}
- private transient static ThreadLocal utfConversionBuffer;
+ private static transient ThreadLocal utfConversionBuffer;
private static final char[] getUtfConversionBuffer(int utfLength) {
if (utfConversionBuffer == null) {
Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -37,7 +37,7 @@
/**
* An empty array of annotations
*/
- final static VmAnnotation[] EMPTY_ARR = new VmAnnotation[0];
+ static final VmAnnotation[] EMPTY_ARR = new VmAnnotation[0];
/**
* The descriptor of the annotation type
@@ -222,9 +222,9 @@
*
* @author Ewout Prangsma (ep...@us...)
*/
- final static class ElementValue extends VmSystemObject {
+ static final class ElementValue extends VmSystemObject {
- final static ElementValue[] EMPTY_ARR = new ElementValue[0];
+ static final ElementValue[] EMPTY_ARR = new ElementValue[0];
private final String name;
@@ -286,7 +286,7 @@
*
* @author Ewout Prangsma (ep...@us...)
*/
- final static class EnumValue {
+ static final class EnumValue {
private final String typeDescr;
private final String constName;
@@ -345,7 +345,7 @@
*
* @author Ewout Prangsma (ep...@us...)
*/
- final static class ClassInfo extends VmSystemObject {
+ static final class ClassInfo extends VmSystemObject {
private final String classDescr;
private transient Class value;
Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariable.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariable.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariable.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -34,7 +34,7 @@
/**
* Sharable empty array.
*/
- final static VmLocalVariable[] EMPTY = new VmLocalVariable[0];
+ static final VmLocalVariable[] EMPTY = new VmLocalVariable[0];
/**
* Start of the value value range.
Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariableTable.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariableTable.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariableTable.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -31,7 +31,7 @@
/**
* Empty table
*/
- final static VmLocalVariableTable EMPTY = new VmLocalVariableTable(VmLocalVariable.EMPTY);
+ static final VmLocalVariableTable EMPTY = new VmLocalVariableTable(VmLocalVariable.EMPTY);
/**
* Local variables
Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmType.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -339,7 +339,7 @@
* @throws ClassNotFoundException
*/
@SuppressWarnings("unchecked")
- public final static VmType[] initializeForBootImage(VmSystemClassLoader clc)
+ public static VmType[] initializeForBootImage(VmSystemClassLoader clc)
throws ClassNotFoundException {
ObjectClass = (VmNormalClass) clc.loadClass("java.lang.Object", false);
CloneableClass = (VmInterfaceClass) clc.loadClass(
@@ -568,7 +568,7 @@
*
* @return The class
*/
- public final static VmNormalClass<Object> getObjectClass() {
+ public static VmNormalClass<Object> getObjectClass() {
if (ObjectClass == null) {
Unsafe.die("ObjectClass == null");
}
@@ -581,7 +581,7 @@
* @param type
* @return VmClass
*/
- public final static VmNormalClass<?> getPrimitiveClass(char type) {
+ public static VmNormalClass<?> getPrimitiveClass(char type) {
switch (type) {
case 'Z':
return BooleanClass;
@@ -612,7 +612,7 @@
* @param type
* @return VmClass
*/
- public final static VmType getPrimitiveArrayClass(char type) {
+ public static VmType getPrimitiveArrayClass(char type) {
switch (type) {
case 'Z':
return BooleanArrayClass;
@@ -642,7 +642,7 @@
* @param type
* @return VmClass
*/
- public final static VmArrayClass getPrimitiveArrayClass(int type) {
+ public static VmArrayClass getPrimitiveArrayClass(int type) {
switch (type) {
case 4:
return BooleanArrayClass;
@@ -2194,7 +2194,7 @@
/**
* Invoke the static initializer of this class.
*/
- private synchronized final void doInitialize() {
+ private synchronized void doInitialize() {
if (!isInitialized()) {
if (!isInitializing()) {
final boolean sharedStatics = isSharedStatics();
Modified: trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -383,7 +383,7 @@
/**
* Gets the links passed to the start of the current isolate.
*/
- public final static Link[] getLinks() {
+ public static Link[] getLinks() {
final VmDataLink[] vmLinks = currentIsolate().dataLinks;
if ((vmLinks == null) || (vmLinks.length == 0)) {
Modified: trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -98,7 +98,7 @@
private int instanceCount;
private int objectSize = 0;
- private final static String usage = " memory usage=";
+ private static final String usage = " memory usage=";
public HeapCounter(String objectName, int objectSize) {
this.name = objectName;
Modified: trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -252,7 +252,7 @@
*
* @param k
*/
- final static void setupInflatedLock(Object k) {
+ static void setupInflatedLock(Object k) {
installInflatedLock(k);
}
@@ -383,7 +383,7 @@
*
* @param tid
*/
- final static void testThreadId(int tid) {
+ static void testThreadId(int tid) {
if ((tid & ~ObjectFlags.THREAD_ID_MASK) != 0) {
throw new InternalError("Invalid thread id " + tid);
}
Modified: trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -218,29 +218,29 @@
* </blockquote>
* </pre>
*/
- final static int CREATED = 0;
+ static final int CREATED = 0;
- final static int ASLEEP = 3;
+ static final int ASLEEP = 3;
- final static int DESTROYED = 5;
+ static final int DESTROYED = 5;
- final static int RUNNING = 1;
+ static final int RUNNING = 1;
- final static int STOPPED = 4;
+ static final int STOPPED = 4;
- final static int SUSPENDED = 2;
+ static final int SUSPENDED = 2;
- final static int WAITING_ENTER = 6;
+ static final int WAITING_ENTER = 6;
- final static int WAITING_NOTIFY = 7;
+ static final int WAITING_NOTIFY = 7;
- final static int WAITING_NOTIFY_TIMEOUT = 8;
+ static final int WAITING_NOTIFY_TIMEOUT = 8;
- final static int YIELDING = 9;
+ static final int YIELDING = 9;
- final static int MAXSTATE = YIELDING;
+ static final int MAXSTATE = YIELDING;
- final static String[] STATE_NAMES = {"CREATED", "RUNNING", "SUSPENDED",
+ static final String[] STATE_NAMES = {"CREATED", "RUNNING", "SUSPENDED",
"ASLEEP", "STOPPED", "DESTROYED", "WAITING_ENTER",
"WAITING_NOTIFY", "WAITING_NOTIFY_TIMEOUT", "YIELDING"};
Modified: trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueue.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueue.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueue.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -278,7 +278,7 @@
*
* @author Ewout Prangsma (ep...@us...)
*/
- final static class AllThreadsQueue extends VmThreadQueue {
+ static final class AllThreadsQueue extends VmThreadQueue {
/**
* Initialize this instance.
@@ -302,7 +302,7 @@
*
* @author Ewout Prangsma (ep...@us...)
*/
- final static class SleepQueue extends VmThreadQueue {
+ static final class SleepQueue extends VmThreadQueue {
/**
* Initialize this instance.
@@ -329,7 +329,7 @@
*
* @author Ewout Prangsma (ep...@us...)
*/
- final static class ScheduleQueue extends VmThreadQueue {
+ static final class ScheduleQueue extends VmThreadQueue {
/**
* Initialize this instance.
Modified: trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture32.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture32.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture32.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -113,7 +113,7 @@
/**
* Default page entry flags
*/
- private final static int PF_DEFAULT = PF_PRESENT | PF_WRITE | PF_USER | PF_PSE;
+ private static final int PF_DEFAULT = PF_PRESENT | PF_WRITE | PF_USER | PF_PSE;
/**
* Initialize this instance.
Modified: trunk/core/src/core/org/jnode/vm/x86/X86IRQManager.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/x86/X86IRQManager.java 2008-06-04 18:31:57 UTC (rev 4194)
+++ trunk/core/src/core/org/jnode/vm/x86/X86IRQManager.java 2008-06-04 19:38:45 UTC (rev 4195)
@@ -12,7 +12,7 @@
/**
* Number of IRQ vectors
*/
- final static int IRQ_COUNT = 16;
+ static final int IRQ_COUNT = 16;
/**
* Programmable interrupt controller
Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java 2008-06-04 18:31:57...
[truncated message content] |