From: <fd...@us...> - 2010-05-12 10:31:57
|
Revision: 5749 http://jnode.svn.sourceforge.net/jnode/?rev=5749&view=rev Author: fduminy Date: 2010-05-12 10:31:48 +0000 (Wed, 12 May 2010) Log Message: ----------- removed dependency cycle between org.jnode.vm <-> org.jnode.util by : - moving Statistic, Statistics, BootableHashMap, BootableArrayList, SynchronizedCounter, CounterGroup, Counter classes from org.jnode.util to org.jnode.vm.objects - moving method loop(ms) from org.jnode.util.TimeUtils to org.jnode.vm.VmSystem Signed-off-by: Fabien DUMINY <fab...@we...> Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java trunk/core/descriptors/org.jnode.vm.core.xml trunk/core/src/core/org/jnode/assembler/x86/X86Register.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginJar.java trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java trunk/core/src/core/org/jnode/util/TimeUtils.java trunk/core/src/core/org/jnode/vm/InternString.java trunk/core/src/core/org/jnode/vm/Vm.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/LinearScanAllocator.java trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java trunk/core/src/core/org/jnode/vm/compiler/ir/SSAStack.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/x86/LocalAPIC.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/X86RegisterPool.java trunk/core/src/openjdk/vm/java/lang/NativeString.java trunk/core/src/test/org/jnode/test/IRTest.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java trunk/net/src/net/org/jnode/net/NetworkLayer.java trunk/net/src/net/org/jnode/net/TransportLayer.java trunk/net/src/net/org/jnode/net/arp/ARPNetworkLayer.java trunk/net/src/net/org/jnode/net/arp/ARPStatistics.java trunk/net/src/net/org/jnode/net/ipv4/icmp/ICMPProtocol.java trunk/net/src/net/org/jnode/net/ipv4/icmp/ICMPStatistics.java trunk/net/src/net/org/jnode/net/ipv4/layer/IPv4NetworkLayer.java trunk/net/src/net/org/jnode/net/ipv4/layer/IPv4Statistics.java trunk/net/src/net/org/jnode/net/ipv4/raw/RAWProtocol.java trunk/net/src/net/org/jnode/net/ipv4/raw/RAWStatistics.java trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPProtocol.java trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPStatistics.java trunk/net/src/net/org/jnode/net/ipv4/udp/UDPProtocol.java trunk/net/src/net/org/jnode/net/ipv4/udp/UDPStatistics.java Added Paths: ----------- trunk/core/src/core/org/jnode/vm/objects/ trunk/core/src/core/org/jnode/vm/objects/BootableArrayList.java trunk/core/src/core/org/jnode/vm/objects/BootableHashMap.java trunk/core/src/core/org/jnode/vm/objects/Counter.java trunk/core/src/core/org/jnode/vm/objects/CounterGroup.java trunk/core/src/core/org/jnode/vm/objects/Statistic.java trunk/core/src/core/org/jnode/vm/objects/Statistics.java trunk/core/src/core/org/jnode/vm/objects/SynchronizedCounter.java Removed Paths: ------------- trunk/core/src/core/org/jnode/util/BootableArrayList.java trunk/core/src/core/org/jnode/util/BootableHashMap.java trunk/core/src/core/org/jnode/util/Counter.java trunk/core/src/core/org/jnode/util/CounterGroup.java trunk/core/src/core/org/jnode/util/Statistic.java trunk/core/src/core/org/jnode/util/Statistics.java trunk/core/src/core/org/jnode/util/SynchronizedCounter.java Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -54,7 +54,6 @@ import org.jnode.plugin.model.PluginDescriptorModel; import org.jnode.plugin.model.PluginJar; import org.jnode.plugin.model.PluginRegistryModel; -import org.jnode.util.BootableHashMap; import org.jnode.util.NumberUtils; import org.jnode.vm.JvmType; import org.jnode.vm.Unsafe; @@ -81,6 +80,7 @@ import org.jnode.vm.compiler.NativeCodeCompiler; import org.jnode.vm.memmgr.HeapHelper; import org.jnode.vm.memmgr.VmHeapManager; +import org.jnode.vm.objects.BootableHashMap; import org.jnode.vm.scheduler.VmProcessor; import org.vmmagic.unboxed.UnboxedObject; @@ -1381,6 +1381,7 @@ addCompileHighOptLevel("org.jnode.vm.classmgr"); addCompileHighOptLevel("org.jnode.vm.compiler"); addCompileHighOptLevel("org.jnode.vm.isolate"); + addCompileHighOptLevel("org.jnode.vm.objects"); addCompileHighOptLevel("org.jnode.vm.scheduler"); for (NativeCodeCompiler compiler : getArchitecture().getCompilers()) { for (String packageName : compiler.getCompilerPackages()) { Modified: trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -28,8 +28,8 @@ import org.jnode.net.TransportLayer; import org.jnode.net.util.NetUtils; import org.jnode.shell.AbstractCommand; -import org.jnode.util.Statistic; -import org.jnode.util.Statistics; +import org.jnode.vm.objects.Statistic; +import org.jnode.vm.objects.Statistics; /** * @author epr Modified: trunk/core/descriptors/org.jnode.vm.core.xml =================================================================== --- trunk/core/descriptors/org.jnode.vm.core.xml 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/descriptors/org.jnode.vm.core.xml 2010-05-12 10:31:48 UTC (rev 5749) @@ -25,6 +25,7 @@ <export name="org.jnode.vm.compiler.*"/> <export name="org.jnode.vm.isolate.*"/> <export name="org.jnode.vm.memmgr.*"/> + <export name="org.jnode.vm.objects.*"/> <export name="org.jnode.vm.performance.*"/> <export name="org.jnode.vm.scheduler.*"/> </library> Modified: trunk/core/src/core/org/jnode/assembler/x86/X86Register.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86Register.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/assembler/x86/X86Register.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -20,8 +20,8 @@ package org.jnode.assembler.x86; -import org.jnode.util.BootableHashMap; import org.jnode.vm.VmSystemObject; +import org.jnode.vm.objects.BootableHashMap; /** * Registers of the x86 architecture. Modified: trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -41,10 +41,10 @@ import org.jnode.plugin.PluginReference; import org.jnode.plugin.Runtime; import org.jnode.system.BootLog; -import org.jnode.util.BootableArrayList; import org.jnode.vm.VmSystem; import org.jnode.vm.classmgr.VmClassLoader; import org.jnode.vm.isolate.VmIsolateLocal; +import org.jnode.vm.objects.BootableArrayList; /** * Implementation of {@link org.jnode.plugin.PluginDescriptor}. Modified: trunk/core/src/core/org/jnode/plugin/model/PluginJar.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginJar.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/plugin/model/PluginJar.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -33,13 +33,13 @@ import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; -import org.jnode.util.BootableHashMap; import org.jnode.util.ByteBufferInputStream; import org.jnode.util.FileUtils; import org.jnode.util.JarBuffer; import org.jnode.vm.BootableObject; import org.jnode.vm.ResourceLoader; import org.jnode.vm.Vm; +import org.jnode.vm.objects.BootableHashMap; /** * @author Ewout Prangsma (ep...@us...) Modified: trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -43,9 +43,9 @@ import org.jnode.plugin.PluginReference; import org.jnode.plugin.PluginRegistry; import org.jnode.plugin.PluginSecurityConstants; -import org.jnode.util.BootableHashMap; import org.jnode.vm.VmSystemObject; import org.jnode.vm.isolate.VmIsolateLocal; +import org.jnode.vm.objects.BootableHashMap; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; Deleted: trunk/core/src/core/org/jnode/util/BootableArrayList.java =================================================================== --- trunk/core/src/core/org/jnode/util/BootableArrayList.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/util/BootableArrayList.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -1,358 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.util; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.RandomAccess; - -import org.jnode.vm.VmSystemObject; - -/** - * A BootableList is a List implementation that can be used in the - * build process of JNode. - * Using this class, instead of e.g. ArrayList, will avoid class incompatibilities - * between the JNode java.util implementation and Sun's implementation. - * - * @author epr - */ -public class BootableArrayList<T> extends VmSystemObject implements List<T>, RandomAccess { - - private ArrayList<T> listCache; - private T[] array; - private int hashCode; - private transient boolean locked; - - /** - * Constructs an empty list with an initial capacity of ten. - */ - public BootableArrayList() { - hashCode = super.hashCode(); - } - - /** - * Constructs a list containing the elements of the specified collection, - * in the order they are returned by the collection's iterator. - * - * @param c - */ - public BootableArrayList(Collection<? extends T> c) { - addAll(c); - } - - /** - * Constructs an empty list with an initial capacity of ten. - * - * @param initialCapacity - */ - public BootableArrayList(int initialCapacity) { - listCache = new ArrayList<T>(initialCapacity); - hashCode = listCache.hashCode(); - } - - /** - * Gets (an if needed reload) the arraylist. - * - * @return - */ - private final ArrayList<T> getListCache() { - if (locked) { - throw new RuntimeException("Cannot change a locked BootableArrayList"); - } - if (listCache == null) { - listCache = new ArrayList<T>(); - if (array != null) { - listCache.addAll(Arrays.asList(array)); - } - array = null; - } - return listCache; - } - - /** - * @param index - * @param o - * @see java.util.AbstractList#add(int, java.lang.Object) - */ - public void add(int index, T o) { - getListCache().add(index, o); - } - - /** - * @param o - * @return boolean - * @see java.util.AbstractList#add(java.lang.Object) - */ - public boolean add(T o) { - return getListCache().add(o); - } - - /** - * @param c - * @return boolean - * @see java.util.AbstractCollection#addAll(java.util.Collection) - */ - public boolean addAll(Collection<? extends T> c) { - return getListCache().addAll(c); - } - - /** - * @param index - * @param c - * @return boolean - * @see java.util.AbstractList#addAll(int, java.util.Collection) - */ - public boolean addAll(int index, Collection<? extends T> c) { - return getListCache().addAll(index, c); - } - - /** - * @see java.util.AbstractList#clear() - */ - public void clear() { - getListCache().clear(); - } - - /** - * @param o - * @return boolean - * @see java.util.AbstractCollection#contains(java.lang.Object) - */ - public boolean contains(Object o) { - return getListCache().contains(o); - } - - /** - * @param c - * @return boolean - * @see java.util.AbstractCollection#containsAll(java.util.Collection) - */ - public boolean containsAll(Collection c) { - return getListCache().containsAll(c); - } - - /** - * @param minCapacity - */ - public void ensureCapacity(int minCapacity) { - getListCache().ensureCapacity(minCapacity); - } - - /** - * @param obj - * @return boolean - * @see java.util.AbstractList#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return getListCache().equals(obj); - } - - /** - * @return int - * @see java.util.AbstractList#hashCode() - */ - public int hashCode() { - if (listCache != null) { - return getListCache().hashCode(); - } else { - return hashCode; - } - } - - /** - * @param o - * @return int - * @see java.util.AbstractList#indexOf(java.lang.Object) - */ - public int indexOf(Object o) { - return getListCache().indexOf(o); - } - - /** - * @return boolean - * @see java.util.AbstractCollection#isEmpty() - */ - public boolean isEmpty() { - return getListCache().isEmpty(); - } - - /** - * @return the iterator - * @see java.util.AbstractList#iterator() - */ - public Iterator<T> iterator() { - return getListCache().iterator(); - } - - /** - * @param o - * @return int - * @see java.util.AbstractList#lastIndexOf(java.lang.Object) - */ - public int lastIndexOf(Object o) { - return getListCache().lastIndexOf(o); - } - - /** - * @return the iterator - * @see java.util.AbstractList#listIterator() - */ - public ListIterator<T> listIterator() { - return getListCache().listIterator(); - } - - /** - * @param index - * @return the iterator - * @see java.util.AbstractList#listIterator(int) - */ - public ListIterator<T> listIterator(int index) { - return getListCache().listIterator(index); - } - - /** - * @param index - * @return object - * @see java.util.AbstractList#remove(int) - */ - public T remove(int index) { - return getListCache().remove(index); - } - - /** - * @param o - * @return boolean - * @see java.util.AbstractCollection#remove(java.lang.Object) - */ - public boolean remove(Object o) { - return getListCache().remove(o); - } - - /** - * @param c - * @return boolean - * @see java.util.AbstractCollection#removeAll(java.util.Collection) - */ - public boolean removeAll(Collection<?> c) { - return getListCache().removeAll(c); - } - - /** - * @param c - * @return boolean - * @see java.util.AbstractCollection#retainAll(java.util.Collection) - */ - public boolean retainAll(Collection c) { - return getListCache().retainAll(c); - } - - /** - * @param index - * @param o - * @return object - * @see java.util.AbstractList#set(int, java.lang.Object) - */ - public T set(int index, T o) { - return getListCache().set(index, o); - } - - /** - * @param fromIndex - * @param toIndex - * @return the sub list - * @see java.util.AbstractList#subList(int, int) - */ - public List<T> subList(int fromIndex, int toIndex) { - return getListCache().subList(fromIndex, toIndex); - } - - /** - * @return the array - * @see java.util.AbstractCollection#toArray() - */ - public Object[] toArray() { - return getListCache().toArray(); - } - - /** - * @param a - * @return the array - * @see java.util.AbstractCollection#toArray(java.lang.Object[]) - */ - public <E> E[] toArray(E[] a) { - return getListCache().toArray(a); - } - - /** - * @return String - * @see java.util.AbstractCollection#toString() - */ - public String toString() { - if (listCache != null) { - return getListCache().toString(); - } else { - return super.toString(); - } - } - - /** - * - */ - public void trimToSize() { - getListCache().trimToSize(); - } - - /** - * @param index - * @return The element at the given index - */ - public T get(int index) { - return getListCache().get(index); - } - - /** - * @return The number of elements in this list - */ - public int size() { - return getListCache().size(); - } - - /** - * @see org.jnode.vm.VmSystemObject#verifyBeforeEmit() - */ - @SuppressWarnings("unchecked") - public void verifyBeforeEmit() { - super.verifyBeforeEmit(); - if (listCache != null) { - array = (T[]) listCache.toArray(); - hashCode = listCache.hashCode(); - } else { - array = null; - } - listCache = null; - locked = true; - } - -} Deleted: trunk/core/src/core/org/jnode/util/BootableHashMap.java =================================================================== --- trunk/core/src/core/org/jnode/util/BootableHashMap.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/util/BootableHashMap.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -1,260 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.util; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.jnode.vm.VmSystemObject; - -/** - * @author epr - */ -public class BootableHashMap<K, V> extends VmSystemObject implements Map<K, V> { - - private HashMap<K, V> mapCache; - private Entry<K, V>[] entryArray; - private int hashCode; - private transient boolean locked; - - /** - * Constructs an empty HashMap. - * @see java.util.HashMap#HashMap() - */ - public BootableHashMap() { - this.hashCode = super.hashCode(); - } - - /** - * Constructs an empty HashMap. - * @see java.util.HashMap#HashMap(int) - * - * @param initialCapacity - */ - public BootableHashMap(int initialCapacity) { - mapCache = new HashMap<K, V>(initialCapacity); - this.hashCode = mapCache.hashCode(); - } - - /** - * @return int - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - if (mapCache != null) { - return getMapCache().hashCode(); - } else { - return hashCode; - } - } - - /** - * @return String - * @see java.lang.Object#toString() - */ - public String toString() { - if (mapCache != null) { - return getMapCache().toString(); - } else { - return super.toString(); - } - } - - /** - * @return The collection of values - */ - public Collection<V> values() { - return getMapCache().values(); - } - - /** - * @return The set of keys - */ - public Set<K> keySet() { - return getMapCache().keySet(); - } - - /** - * @param key - * @return The object for the given key, or null if the given key is not found. - */ - public V get(Object key) { - return getMapCache().get(key); - } - - /** - * - */ - public void clear() { - getMapCache().clear(); - } - - /** - * @return The number of elements - */ - public int size() { - return getMapCache().size(); - } - - /** - * @param key - * @param value - * @return Object - */ - public V put(K key, V value) { - return getMapCache().put(key, value); - } - - /** - * @param m - */ - public void putAll(Map<? extends K, ? extends V> m) { - getMapCache().putAll(m); - } - - /** - * @return The set of entries - */ - public Set<Map.Entry<K, V>> entrySet() { - return getMapCache().entrySet(); - } - - /** - * @param key - * @return True if the key is contained, false otherwise - */ - public boolean containsKey(Object key) { - return getMapCache().containsKey(key); - } - - /** - * @return True if this map is empty, false otherwise - */ - public boolean isEmpty() { - return getMapCache().isEmpty(); - } - - /** - * @param obj - * @return boolean - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return getMapCache().equals(obj); - } - - /** - * @param o - * @return Object - */ - public V remove(Object o) { - return getMapCache().remove(o); - } - - /** - * @param value - * @return True if the given value is contained, false otherwise - */ - public boolean containsValue(Object value) { - return getMapCache().containsValue(value); - } - - - static final class Entry<eK, eV> extends VmSystemObject { - private final eK key; - private final eV value; - - public Entry(Map.Entry<eK, eV> entry) { - this.key = entry.getKey(); - this.value = entry.getValue(); - } - - /** - * Gets the key - * - * @return Object - */ - public eK getKey() { - return key; - } - - /** - * Gets the value - * - * @return Object - */ - public eV getValue() { - return value; - } - } - - /** - * Gets the hashmap - * - * @return - */ - private final HashMap<K, V> getMapCache() { - if (locked) { - throw new RuntimeException("Cannot change a locked BootableHashMap"); - } - if (mapCache == null) { - if (entryArray != null) { - final int max = entryArray.length; - - mapCache = new HashMap<K, V>(max); - for (int i = 0; i < max; i++) { - final Entry<K, V> e = entryArray[i]; - mapCache.put(e.getKey(), e.getValue()); - } - - entryArray = null; - } else { - mapCache = new HashMap<K, V>(); - } - } - return mapCache; - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public void verifyBeforeEmit() { - super.verifyBeforeEmit(); - - if (mapCache != null) { - entryArray = new Entry[mapCache.size()]; - int index = 0; - for (Map.Entry<K, V> entry : mapCache.entrySet()) { - entryArray[index++] = new Entry<K, V>(entry); - } - hashCode = mapCache.hashCode(); - mapCache = null; - } - locked = true; - } - - public boolean isLocked() { - return locked; - } -} Deleted: trunk/core/src/core/org/jnode/util/Counter.java =================================================================== --- trunk/core/src/core/org/jnode/util/Counter.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/util/Counter.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -1,108 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.util; - -/** - * @author Ewout Prangsma (ep...@us...) - */ -public final class Counter extends Statistic implements Comparable<Counter> { - - private static final String is = "="; - - private int counter = 0; - - public Counter(String name) { - this(name, null, 0); - } - - public Counter(String name, String description) { - this(name, description, 0); - } - - public Counter(String name, int value) { - this(name, null, value); - } - - public Counter(String name, String description, int value) { - super(name, description); - this.counter = value; - } - - /** - * Gets the counter of this statistic - * - * @return the counter - */ - public int get() { - return counter; - } - - public Object getValue() { - return counter; - } - - /** - * Increment the counter of this statistic by 1. - */ - public void inc() { - counter++; - } - - /** - * Reset the counter to 0. - */ - public void reset() { - counter = 0; - } - - /** - * Add <i>increment</i> to the counter of this statistic. - */ - public void add(int increment) { - counter += increment; - } - - /** - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - public int compareTo(Counter o) { - if (o.counter < this.counter) { - return 1; - } else if (o.counter > this.counter) { - return -1; - } - return 0; - } - - /** - * Convert to a String representation - * - * @return String - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuilder sb = new StringBuilder(getName()); - sb.append(is); - sb.append(counter); - - return sb.toString(); - } -} Deleted: trunk/core/src/core/org/jnode/util/CounterGroup.java =================================================================== --- trunk/core/src/core/org/jnode/util/CounterGroup.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/util/CounterGroup.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -1,129 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.util; - -import java.util.Map; -import java.util.TreeMap; - -public class CounterGroup extends Statistic { - - /** - * All statistics - */ - private transient Map<String, Statistic> statistics; - - /** - * @param name - * @param description - */ - public CounterGroup(String name, String description) { - super(name, description); - } - - /** - * @param name - */ - public CounterGroup(String name) { - super(name); - } - - /** - * @see org.jnode.util.Statistic#getValue() - */ - @Override - public Object getValue() { - return statistics; - } - - /** - * @see org.jnode.util.Statistic#toString() - */ - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append(getName()); - sb.append(" {"); - if (statistics != null) { - for (Statistic s : statistics.values()) { - sb.append('\n'); - sb.append(s); - } - } - sb.append("}"); - return sb.toString(); - } - - /** - * Gets of create a counter with a given name. - * - * @param name - * @return The counter - */ - public final Counter getCounter(String name) { - Counter cnt = (Counter) getStatistic(name); - if (cnt == null) { - synchronized (this) { - cnt = (Counter) getStatistic(name); - if (cnt == null) { - cnt = new Counter(name, name); - addStatistic(name, cnt); - } - } - } - return cnt; - } - - /** - * Gets of create a counter group with a given name. - * - * @param name - * @return The counter group - */ - public final CounterGroup getCounterGroup(String name) { - CounterGroup cnt = (CounterGroup) getStatistic(name); - if (cnt == null) { - synchronized (this) { - cnt = (CounterGroup) getStatistic(name); - if (cnt == null) { - cnt = new CounterGroup(name, name); - addStatistic(name, cnt); - } - } - } - return cnt; - } - - private Statistic getStatistic(String name) { - if (statistics != null) { - return statistics.get(name); - } else { - return null; - } - } - - private void addStatistic(String name, Statistic stat) { - if (statistics == null) { - statistics = new TreeMap<String, Statistic>(); - } - statistics.put(name, stat); - } - -} Deleted: trunk/core/src/core/org/jnode/util/Statistic.java =================================================================== --- trunk/core/src/core/org/jnode/util/Statistic.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/util/Statistic.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -1,71 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.util; - -import org.jnode.vm.VmSystemObject; - -/** - * @author epr - */ -public abstract class Statistic extends VmSystemObject { - - private final String name; - private final String description; - - public Statistic(String name) { - this(name, null); - } - - public Statistic(String name, String description) { - this.name = name; - this.description = description; - } - - public abstract Object getValue(); - - /** - * Gets the name of this statistic - * - * @return The name - */ - public String getName() { - return name; - } - - /** - * Convert to a String representation - * - * @return String - * @see java.lang.Object#toString() - */ - public String toString() { - return name; - } - - /** - * Gets the description of this statistic - * - * @return The description - */ - public String getDescription() { - return description; - } -} Deleted: trunk/core/src/core/org/jnode/util/Statistics.java =================================================================== --- trunk/core/src/core/org/jnode/util/Statistics.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/util/Statistics.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -1,36 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.util; - - -/** - * @author epr - */ -public interface Statistics { - - /** - * Gets all statistics - * - * @return All statistics - */ - public Statistic[] getStatistics(); - -} Deleted: trunk/core/src/core/org/jnode/util/SynchronizedCounter.java =================================================================== --- trunk/core/src/core/org/jnode/util/SynchronizedCounter.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/util/SynchronizedCounter.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -1,66 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.util; - -/** - * @author Ewout Prangsma (ep...@us...) - */ -public final class SynchronizedCounter extends Statistic { - private int counter; - - public SynchronizedCounter(String name) { - super(name, null); - } - - public SynchronizedCounter(String name, String description) { - super(name, description); - } - - /** - * Gets the counter of this statistic - * - * @return the counter - */ - public int get() { - return counter; - } - - public Object getValue() { - return counter; - } - - /** - * Increment the counter of this statistic by 1. - */ - public synchronized void inc() { - counter++; - } - - /** - * Convert to a String representation - * - * @return String - * @see java.lang.Object#toString() - */ - public String toString() { - return getName() + "=" + counter; - } -} Modified: trunk/core/src/core/org/jnode/util/TimeUtils.java =================================================================== --- trunk/core/src/core/org/jnode/util/TimeUtils.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/util/TimeUtils.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -20,7 +20,6 @@ package org.jnode.util; -import org.jnode.vm.VmSystem; /** @@ -43,21 +42,6 @@ } /** - * Wait for ms milliseconds in a busy waiting loop. - * This method is very CPU intensive, so be carefull. - * - * @param ms - */ - public static void loop(long ms) { - final long start = VmSystem.currentKernelMillis(); - while (true) { - if ((start + ms) <= VmSystem.currentKernelMillis()) { - break; - } - } - } - - /** * Converts Gregorian date to milliseconds since 1970-01-01 00:00:00 . * * @param year the year Modified: trunk/core/src/core/org/jnode/vm/InternString.java =================================================================== --- trunk/core/src/core/org/jnode/vm/InternString.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/InternString.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -20,7 +20,7 @@ package org.jnode.vm; -import org.jnode.util.BootableHashMap; +import org.jnode.vm.objects.BootableHashMap; /** * Modified: trunk/core/src/core/org/jnode/vm/Vm.java =================================================================== --- trunk/core/src/core/org/jnode/vm/Vm.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/Vm.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -31,11 +31,6 @@ import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginRegistry; import org.jnode.system.ResourceManager; -import org.jnode.util.BootableArrayList; -import org.jnode.util.Counter; -import org.jnode.util.CounterGroup; -import org.jnode.util.Statistic; -import org.jnode.util.Statistics; import org.jnode.annotation.Inline; import org.jnode.annotation.Internal; import org.jnode.annotation.KernelSpace; @@ -48,6 +43,11 @@ import org.jnode.vm.classmgr.VmType; import org.jnode.vm.memmgr.HeapHelper; import org.jnode.vm.memmgr.VmHeapManager; +import org.jnode.vm.objects.BootableArrayList; +import org.jnode.vm.objects.Counter; +import org.jnode.vm.objects.CounterGroup; +import org.jnode.vm.objects.Statistic; +import org.jnode.vm.objects.Statistics; import org.jnode.vm.scheduler.VmProcessor; import org.jnode.vm.scheduler.VmScheduler; @@ -399,7 +399,7 @@ } /** - * @see org.jnode.util.Statistics#getStatistics() + * @see org.jnode.vm.objects.Statistics#getStatistics() */ public synchronized Statistic[] getStatistics() { if (statistics != null) { Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -1189,4 +1189,19 @@ throw new RuntimeException("IO Context cannot be reset"); } } + + /** + * Wait for ms milliseconds in a busy waiting loop. + * This method is very CPU intensive, so be carefull. + * + * @param ms + */ + public static void loop(long ms) { + final long start = currentKernelMillis(); + while (true) { + if ((start + ms) <= currentKernelMillis()) { + break; + } + } + } } Modified: trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -36,7 +36,6 @@ import java.util.TreeMap; import org.jnode.assembler.ObjectResolver; -import org.jnode.util.BootableArrayList; import org.jnode.util.ByteBufferInputStream; import org.jnode.annotation.PrivilegedActionPragma; import org.jnode.vm.classmgr.ClassDecoder; @@ -50,6 +49,7 @@ import org.jnode.vm.compiler.IMTCompiler; import org.jnode.vm.compiler.NativeCodeCompiler; import org.jnode.vm.isolate.VmIsolate; +import org.jnode.vm.objects.BootableArrayList; import org.jnode.vm.scheduler.VmProcessor; /** Modified: trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -20,8 +20,9 @@ package org.jnode.vm.bytecode; -import org.jnode.util.BootableArrayList; import org.jnode.vm.VmSystemObject; +import org.jnode.vm.objects.BootableArrayList; + import java.util.Set; import java.util.HashSet; Modified: trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -20,9 +20,9 @@ package org.jnode.vm.classmgr; -import org.jnode.util.BootableHashMap; import org.jnode.vm.VmSystemObject; import org.jnode.vm.InternString; +import org.jnode.vm.objects.BootableHashMap; /** * This class is used to maintain a mapping between a method signature (name+type) Modified: trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -21,8 +21,8 @@ package org.jnode.vm.compiler; import org.jnode.annotation.SharedStatics; -import org.jnode.util.BootableHashMap; import org.jnode.vm.classmgr.VmMethod; +import org.jnode.vm.objects.BootableHashMap; /** * @author Ewout Prangsma (ep...@us...) Modified: trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -20,7 +20,6 @@ package org.jnode.vm.compiler; -import org.jnode.util.Counter; import org.jnode.vm.JvmType; import org.jnode.vm.Vm; import org.jnode.vm.bytecode.BasicBlock; @@ -32,6 +31,7 @@ import org.jnode.vm.classmgr.VmMethod; import org.jnode.vm.classmgr.VmPrimitiveClass; import org.jnode.vm.classmgr.VmType; +import org.jnode.vm.objects.Counter; /** * @author Ewout Prangsma (ep...@us...) Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -22,10 +22,10 @@ import java.util.List; -import org.jnode.util.BootableArrayList; import org.jnode.vm.compiler.ir.quad.BranchQuad; import org.jnode.vm.compiler.ir.quad.PhiAssignQuad; import org.jnode.vm.compiler.ir.quad.Quad; +import org.jnode.vm.objects.BootableArrayList; /** * @author Madhu Siddalingaiah Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -23,7 +23,6 @@ import java.util.Iterator; import java.util.List; -import org.jnode.util.BootableArrayList; import org.jnode.util.ObjectArrayIterator; import org.jnode.vm.bytecode.BytecodeParser; import org.jnode.vm.classmgr.VmByteCode; @@ -31,6 +30,7 @@ import org.jnode.vm.compiler.ir.quad.PhiAssignQuad; import org.jnode.vm.compiler.ir.quad.Quad; import org.jnode.vm.compiler.ir.quad.VariableRefAssignQuad; +import org.jnode.vm.objects.BootableArrayList; /** * @author Madhu Siddalingaiah Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -33,13 +33,13 @@ import org.jnode.assembler.x86.X86Constants; import org.jnode.assembler.x86.X86Register; import org.jnode.assembler.x86.X86TextAssembler; -import org.jnode.util.BootableHashMap; import org.jnode.vm.VmSystemClassLoader; import org.jnode.vm.bytecode.BytecodeParser; import org.jnode.vm.classmgr.VmByteCode; import org.jnode.vm.classmgr.VmMethod; import org.jnode.vm.classmgr.VmType; import org.jnode.vm.compiler.ir.quad.Quad; +import org.jnode.vm.objects.BootableHashMap; import org.jnode.vm.x86.VmX86Architecture32; import org.jnode.vm.x86.X86CpuID; import org.jnode.vm.x86.compiler.l2.GenericX86CodeGenerator; Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/LinearScanAllocator.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/LinearScanAllocator.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/LinearScanAllocator.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -25,7 +25,7 @@ import java.util.Comparator; import java.util.List; -import org.jnode.util.BootableArrayList; +import org.jnode.vm.objects.BootableArrayList; /** * @author Madhu Siddalingaiah Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -22,7 +22,7 @@ import java.util.List; -import org.jnode.util.BootableArrayList; +import org.jnode.vm.objects.BootableArrayList; /** * @author Madhu Siddalingaiah Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/SSAStack.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/SSAStack.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/SSAStack.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -22,7 +22,7 @@ import java.util.List; -import org.jnode.util.BootableArrayList; +import org.jnode.vm.objects.BootableArrayList; /** * @author Madhu Siddalingaiah Modified: trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java =================================================================== --- trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2010-05-12 10:29:02 UTC (rev 5748) +++ trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -42,7 +42,6 @@ import javax.naming.NameNotFoundException; import org.jnode.naming.InitialNaming; import org.jnode.plugin.PluginManager; -import org.jnode.util.BootableHashMap; import org.jnode.vm.IOContext; import org.jnode.vm.ObjectVisitor; import org.jnode.vm.Unsafe; @@ -56,6 +55,7 @@ import org.jnode.annotation.SharedStatics; import org.jnode.vm.classmgr.VmIsolatedStatics; import org.jnode.vm.classmgr.VmType; +import org.jnode.vm.objects.BootableHashMap; import org.jnode.vm.scheduler.VmThread; /** Copied: trunk/core/src/core/org/jnode/vm/objects/BootableArrayList.java (from rev 5748, trunk/core/src/core/org/jnode/util/BootableArrayList.java) =================================================================== --- trunk/core/src/core/org/jnode/vm/objects/BootableArrayList.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/objects/BootableArrayList.java 2010-05-12 10:31:48 UTC (rev 5749) @@ -0,0 +1,358 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.vm.objects; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.RandomAccess; + +import org.jnode.vm.VmSystemObject; + +/** + * A BootableList is a List implementation that can be used in the + * build process of JNode. + * Using this class, instead of e.g. ArrayList, will avoid class incompatibilities + * between the JNode java.util implementation and Sun's implementation. + * + * @author epr + */ +public class BootableArrayList<T> extends VmSystemObject implements List<T>, RandomAccess { + + private ArrayList<T> listCache; + private T[] array; + private int hashCode; + private transient boolean locked; + + /** + * Constructs an empty list with an initial capacity of ten. + */ + public BootableArrayList() { + hashCode = super.hashCode(); + } + + /** + * Constructs a list containing the elements of the specified collection, + * in the order they are returned by the collection's iterator. + * + * @param c + */ + public BootableArrayList(Collection<? extends T> c) { + addAll(c); + } + + /** + * Constructs an empty list with an initial capacity of ten. + * + * @param initialCapacity + */ + public BootableArrayList(int initialCapacity) { + listCache = new ArrayList<T>(initialCapacity); + hashCode = listCache.hashCode(); + } + + /** + * Gets (an if needed reload) the arraylist. + * + * @return + */ + private final ArrayList<T> getListCache() { + if (locked) { + throw new RuntimeException("Cannot change a locked BootableArrayList"); + } + if (listCache == null) { + listCache = new ArrayList<T>(); + if (array != null) { + listCache.addAll(Arrays.asList(array)); + } + array = null; + } + return listCache; + } + + /** + * @param index + * @param o + * @see java.util.AbstractList#add(int, java.lang.Object) + */ + public void add(int index, T o) { + getListCache().add(index, o); + } + + /** + * @param o + * @return boolean + * @see java.util.AbstractList#add(java.lang.Object) + */ + public boolean add(T o) { + return getListCache().add(o); + } + + /** + * @param c + * @return boolean + * @see java.util.AbstractCollection#addAll(java.util.Collection) + */ + public boolean addAll(Collection<? extends T> c) { + return getListCache().addAll(c); + } + + /** + * @param index + * @param c + * @return boolean + * @see java.util.AbstractList#addAll(int, java.util.Collection) + */ + public boolean addAll(int index, Collection<? extends T> c) { + return getListCache().addAll(index, c); + } + + /** + * @see java.util.AbstractList#clear() + */ + public void clear() { + getListCache().clear(); + } + + /** + * @param o + * @return boolean + * @see java.util.AbstractCollection#contains(java.lang.Object) + */ + public boolean contains(Object o) { + return getListCache().contains(o); + } + + /** + * @param c + * @return boolean + * @see java.util.AbstractCollection#containsAll(java.util.Collection) + */ + public boolean containsAll(Collection c) { + return getListCache().containsAll(c); + } + + /** + * @param minCapacity + */ + public void ensureCapacity(int minCapacity) { + getListCache().ensureCapacity(minCapacity); + } + + /** + * @param obj + * @return boolean + * @see java.util.AbstractList#equals(java.lang.Object) + */ + public boolean equals(Object obj) { + return getListCache().equals(obj); + } + + /** + * @return int + * @see java.util.AbstractList#hashCode() + */ + public int hashCode() { + if (listCache != null) { + return getListCache().hashCode(); + } else { + return hashCode; + } + } + + /** + * @param o + * @return int + * @see java.util.AbstractList#indexOf(java.lang.Object) + */ + public int indexOf(Object o) { + return getListCache().indexOf(o); + } + + /** + * @return boolean + * @see java.util.AbstractCollection#isEmpty() + */ + public boolean isEmpty() { + return getListCache().isEmpty(); + } + + /** + * @return the iterator + * @see java.util.AbstractList#iterator() + */ + public Iterator<T> iterator() { + return getListCache().iterator(); + } + + /** + * @param o + * @return int + * @see java.util.AbstractList#lastIndexOf(java.lang.Object) + */ + public int lastIndexOf(Object o) { + return getListCache().lastIndexOf(o); + } + + /** + * @return the iterator + * @see java.util.AbstractList#listIterator() + */ + public ListIterator<T> listIterator() { + return getListCache().listIterator(); + } + + /** + * @param index + * @return the iterator + * @see java.util.AbstractList#listIterator(int) + */ + public ListIterator<T> listIterator(int index) { + return getListCache().listIterator(index); + } + + /** + * @param index + * @return object + * @see java.util.AbstractList#remove(int) + */ + public T remove(int index) { + return getListCache().remove(index); + } + + /** + * @param o + * @return boolean + * @see java.util.AbstractCollection#remove(java.lang.Object) + */ + public boolean remove(Object o) { + return getListCache().remove(o); + } + + /** + * @param c + * @return boolean + * @see java.util.AbstractCollection#removeAll(java.util.Collection) + */ + public boolean removeAll(Collection<?> c) { + return getListCache().removeAll(c); + } + + /** + * @param c + * @return boolean + * @see java.util.AbstractCollection#retainAll(java.util.Collection) + */ + public boolean retainAll(Collection c) { + return getListCache().retainAll(c); + } + + /** + * @param index + * @param o + * @return object + * @see java.util.AbstractList#set(int, java.lang.Object) + */ + public T set(int index, T o) { + return getListCache().set(index, o); + } + + /** + * @param fromIndex + * @param toIndex + * @return the sub list + * @see java.util.AbstractList#subList(int, int) + */ + public List<T> subList(int fromIndex, int toIndex) { + return getListCache().subList(fromIndex, toIndex); + } + + /** + * @return the array + * @see java.util.AbstractCollection#toArray() + */ + public Object[] toArray() { + return getListCache().toArray(); + } + + /** + * @param a + * @return the array + * @see java.util.AbstractCollection#toArray(java.lang.Object[]) + */ + public <E> E[] toArray(E[] a) { + return getListCache().toArray(a); + } + + /** + * @return String + * @see java.util.AbstractCollection#toString() + */ + public String toString() { + if (listCache != null) { + return getListCache().toString(); + } else { + return super.toString(); + } + } + + /** + * + */ + public void trimToSize() { + getListCache().trimToSize(); + } + + /** + * @param index + * @return The element at the given index + */ + public T get(int index) { + return getListCache().get(index); + } + + /** + * @return The number of elements in this list + */ + public int size() { + return getListCache().size(); + } + + /** + * @see org.jnode.vm.VmSystemObject#verifyBeforeEmit() + */ + @SuppressWarnings("unchecked") + public void verifyBeforeEmit() { + super.verifyBeforeEmit(); + if (listCache != null) { + array = (T[]) listCache.toArray(); + hashCode = listCache.hashCode(); + } else { + array = null; + } + listCache = null; + locked = true; + } + +} Copied: trunk/core/src/core/org/jnode/vm/objects/BootableHashMap.java (from rev 5748, trunk/core/src/core/org/jnode/util/BootableHashMap.java) =================================================================== --- trunk/core/src/core/org/jnode/vm/objects/BootableHashMap.java (rev 0) +++ trunk/core/sr... [truncated message content] |
From: <fd...@us...> - 2010-05-16 16:49:09
|
Revision: 5750 http://jnode.svn.sourceforge.net/jnode/?rev=5750&view=rev Author: fduminy Date: 2010-05-16 16:48:59 +0000 (Sun, 16 May 2010) Log Message: ----------- removed package/plugin dependency cycle org.jnode.vm <-> org.jnode.system by refactoring BootLog : - become an interface in its own plugin and doesn't depend on the (org.jnode.vm.)Unsafe class Signed-off-by: Fabien DUMINY <fab...@we...> Modified Paths: -------------- trunk/all/conf/system-plugin-list.xml trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java trunk/core/src/core/org/jnode/boot/InitJarProcessor.java trunk/core/src/core/org/jnode/boot/Main.java trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java trunk/core/src/core/org/jnode/plugin/Plugin.java trunk/core/src/core/org/jnode/plugin/PluginManager.java trunk/core/src/core/org/jnode/plugin/PluginUtils.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java trunk/core/src/core/org/jnode/security/JNodePolicy.java trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java trunk/core/src/core/org/jnode/util/QueueProcessorThread.java trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerThread.java trunk/core/src/core/org/jnode/vm/x86/MPConfigTable.java trunk/core/src/core/org/jnode/vm/x86/MPFloatingPointerStructure.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/work/WorkUtils.java trunk/core/src/driver/org/jnode/driver/AbstractDeviceManager.java trunk/core/src/driver/org/jnode/driver/DefaultDeviceManager.java trunk/core/src/driver/org/jnode/driver/Device.java trunk/core/src/driver/org/jnode/driver/Driver.java trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java trunk/core/src/driver/org/jnode/driver/console/textscreen/DefaultKeyboardHandler.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreen.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java trunk/core/src/mmtk-vm/org/mmtk/vm/Assert.java trunk/core/src/mmtk-vm/org/mmtk/vm/Options.java trunk/core/src/test/org/jnode/test/framework/TestRunnerPlugin.java trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java trunk/fs/src/test/org/jnode/test/support/MockObjectFactory.java trunk/net/src/net/org/jnode/net/util/AbstractDatagramSocketImpl.java Added Paths: ----------- trunk/core/descriptors/org.jnode.runtime.core.bootlog.xml trunk/core/src/core/org/jnode/bootlog/ trunk/core/src/core/org/jnode/bootlog/BootLog.java trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java trunk/core/src/core/org/jnode/bootlog/package.html trunk/core/src/core/org/jnode/vm/BootLogImpl.java Removed Paths: ------------- trunk/core/src/core/org/jnode/system/BootLog.java Property Changed: ---------------- trunk/core/src/test/org/jnode/test/framework/TestRunnerPlugin.java Modified: trunk/all/conf/system-plugin-list.xml =================================================================== --- trunk/all/conf/system-plugin-list.xml 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/all/conf/system-plugin-list.xml 2010-05-16 16:48:59 UTC (rev 5750) @@ -13,6 +13,7 @@ <plugin id="org.jnode.runtime"/> <plugin id="org.jnode.runtime.core"/> + <plugin id="org.jnode.runtime.core.bootlog"/> <plugin id="org.jnode.security"/> <plugin id="org.jnode.util"/> <plugin id="org.jnode.vm"/> Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -25,6 +25,7 @@ import java.io.FileWriter; import java.io.IOException; import java.io.OutputStreamWriter; +import java.io.PrintStream; import java.io.PrintWriter; import java.lang.reflect.Field; import java.net.URL; @@ -47,6 +48,8 @@ import org.jnode.assembler.UnresolvedObjectRefException; import org.jnode.assembler.NativeStream.ObjectRef; import org.jnode.assembler.x86.X86BinaryAssembler; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; import org.jnode.plugin.PluginRegistry; @@ -791,14 +794,84 @@ throws ClassNotFoundException; public final void execute() throws BuildException { - // Create the image - doExecute(); - // Remove all garbage objects - cleanup(); - System.gc(); - // Make sure that all finalizers are called, in order to remove tmp - // files. - Runtime.getRuntime().runFinalization(); + try { + BootLogInstance.set(new BootLog() { + @Override + public void warn(String msg) { + System.out.println(msg); + } + + @Override + public void warn(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void setDebugOut(PrintStream out) { + // ignore + } + + @Override + public void info(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void info(String msg) { + System.out.println(msg); + } + + @Override + public void fatal(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void fatal(String msg) { + System.out.println(msg); + } + + @Override + public void error(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void error(String msg) { + System.out.println(msg); + } + + @Override + public void debug(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void debug(String msg) { + System.out.println(msg); + } + }); + + // Create the image + doExecute(); + // Remove all garbage objects + cleanup(); + System.gc(); + // Make sure that all finalizers are called, in order to remove tmp + // files. + Runtime.getRuntime().runFinalization(); + } catch (BuildException be) { + be.printStackTrace(); + throw be; + } catch (Throwable t) { + t.printStackTrace(); + throw new BuildException(t); + } } /** @@ -1368,6 +1441,7 @@ addCompileHighOptLevel("org.jnode.assembler"); addCompileHighOptLevel("org.jnode.boot"); + addCompileHighOptLevel("org.jnode.bootlog"); addCompileHighOptLevel("org.jnode.naming"); addCompileHighOptLevel("org.jnode.plugin"); addCompileHighOptLevel("org.jnode.plugin.manager"); Modified: trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -26,11 +26,12 @@ import java.lang.reflect.Modifier; import java.util.HashMap; import java.util.Set; + import org.jnode.assembler.BootImageNativeStream; import org.jnode.assembler.Label; import org.jnode.assembler.NativeStream; import org.jnode.assembler.x86.X86BinaryAssembler; -import org.jnode.system.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.vm.BootableObject; import org.jnode.vm.VmSystemObject; import org.jnode.vm.classmgr.VmArrayClass; @@ -191,7 +192,7 @@ throw new BuildException(ex); } if (!fieldInfo.isExact()) { - BootLog.warn("Use of in-exact matching class (" + clsName + BootLogInstance.get().warn("Use of in-exact matching class (" + clsName + ") in bootimage at " + location); } legalInstanceClasses.add(clsName); @@ -460,7 +461,7 @@ + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { - BootLog + BootLogInstance.get() .warn("JNode class not found " + ex.getMessage()); value = null; Added: trunk/core/descriptors/org.jnode.runtime.core.bootlog.xml =================================================================== --- trunk/core/descriptors/org.jnode.runtime.core.bootlog.xml (rev 0) +++ trunk/core/descriptors/org.jnode.runtime.core.bootlog.xml 2010-05-16 16:48:59 UTC (rev 5750) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<plugin id="org.jnode.runtime.core.bootlog" + name="JNode boot log interface" + version="@VERSION@" + system="true" + license-name="lgpl" + provider-name="JNode.org"> + + <runtime> + <library name="jnode-core.jar"> + <export name="org.jnode.bootlog.*"/> + </library> + </runtime> + +</plugin> \ No newline at end of file Modified: trunk/core/src/core/org/jnode/boot/InitJarProcessor.java =================================================================== --- trunk/core/src/core/org/jnode/boot/InitJarProcessor.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/boot/InitJarProcessor.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -30,11 +30,12 @@ import java.util.jar.Attributes; import java.util.jar.Manifest; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; import org.jnode.plugin.PluginLoader; import org.jnode.plugin.PluginRegistry; -import org.jnode.system.BootLog; import org.jnode.system.MemoryResource; import org.jnode.util.JarBuffer; @@ -60,7 +61,7 @@ jbuf = new JarBuffer(initJarRes.asByteBuffer()); mf = jbuf.getManifest(); } catch (IOException ex) { - BootLog.error("Cannot instantiate initjar", ex); + BootLogInstance.get().error("Cannot instantiate initjar", ex); } } this.jbuf = jbuf; @@ -89,7 +90,7 @@ loader, "", "", false); //resolve=false descriptors.add(descr); } catch (PluginException ex) { - BootLog.error("Cannot load " + name, ex); + BootLogInstance.get().error("Cannot load " + name, ex); } } } Modified: trunk/core/src/core/org/jnode/boot/Main.java =================================================================== --- trunk/core/src/core/org/jnode/boot/Main.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/boot/Main.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -26,11 +26,11 @@ import org.jnode.annotation.LoadStatics; import org.jnode.annotation.SharedStatics; import org.jnode.annotation.Uninterruptible; +import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginManager; import org.jnode.plugin.PluginRegistry; import org.jnode.plugin.manager.DefaultPluginManager; -import org.jnode.system.BootLog; import org.jnode.vm.Unsafe; import org.jnode.vm.VmSystem; @@ -66,13 +66,13 @@ Unsafe.debug("VmSystem.initialize\n"); VmSystem.initialize(); - + // Load the plugins from the initjar - BootLog.info("Loading initjar plugins"); + BootLogInstance.get().info("Loading initjar plugins"); final InitJarProcessor proc = new InitJarProcessor(VmSystem.getInitJar()); List<PluginDescriptor> descriptors = proc.loadPlugins(pluginRegistry); - BootLog.info("Starting PluginManager"); + BootLogInstance.get().info("Starting PluginManager"); final PluginManager piMgr = new DefaultPluginManager(pluginRegistry); piMgr.startSystemPlugins(descriptors); @@ -82,7 +82,7 @@ if (mainClassName != null) { mainClass = loader.loadClass(mainClassName); } else { - BootLog.warn("No Main-Class found"); + BootLogInstance.get().warn("No Main-Class found"); mainClass = null; } final long end = VmSystem.currentKernelMillis(); @@ -98,12 +98,12 @@ if (insatnce instanceof Runnable) { ((Runnable) insatnce).run(); } else { - BootLog.warn("No valid Main-Class found"); + BootLogInstance.get().warn("No valid Main-Class found"); } } } } catch (Throwable ex) { - BootLog.error("Error in bootstrap", ex); + BootLogInstance.get().error("Error in bootstrap", ex); Unsafe.debugStackTrace(ex); sleepForever(); return -2; Added: trunk/core/src/core/org/jnode/bootlog/BootLog.java =================================================================== --- trunk/core/src/core/org/jnode/bootlog/BootLog.java (rev 0) +++ trunk/core/src/core/org/jnode/bootlog/BootLog.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -0,0 +1,119 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.bootlog; + +import java.io.PrintStream; + +/** + * Logging class used during bootstrap. + * + * @author Ewout Prangsma (ep...@us...) + * + */ +public interface BootLog { + public static final int DEBUG = 1; + public static final int INFO = 2; + public static final int WARN = 3; + public static final int ERROR = 4; + public static final int FATAL = 5; + + /** + * Log a debug message + * + * @param msg + */ + void debug(String msg); + + /** + * Log a debug message + * + * @param msg + * @param ex + */ + void debug(String msg, Throwable ex); + + /** + * Log an error message + * + * @param msg + */ + void error(String msg); + + /** + * Log an error message + * + * @param msg + * @param ex + */ + void error(String msg, Throwable ex); + + /** + * Log an fatal message + * + * @param msg + */ + void fatal(String msg); + + /** + * Log an fatal message + * + * @param msg + * @param ex + */ + void fatal(String msg, Throwable ex); + + /** + * Log an info message + * + * @param msg + */ + void info(String msg); + + /** + * Log an info message + * + * @param msg + * @param ex + */ + void info(String msg, Throwable ex); + + /** + * Log an warning message + * + * @param msg + * @param ex + */ + void warn(String msg, Throwable ex); + + /** + * Log an warning message + * + * @param msg + */ + void warn(String msg); + + /** + * Set the stream to use for debug logs. + * + * @param out + */ + void setDebugOut(PrintStream out); +} Added: trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java =================================================================== --- trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java (rev 0) +++ trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -0,0 +1,35 @@ +package org.jnode.bootlog; + + +/** + * Class holding the {@link BootLog} instance used by the system. + * <br/><h1>Implementation note :</h1> The reference to the actual instance of + * the BootLog can't be stored in the InitialNaming that use VmType, which is + * not fully initialized at build time (but BootLog is used). So, we are always + * holding the reference in that class. + * + * @author Fabien DUMINY + * + */ +public final class BootLogInstance { + private static BootLog BOOT_LOG_INSTANCE; + + private BootLogInstance () { + } + + /** + * Get the system's {@link BootLog}. + * @return the system's {@link BootLog}. + */ + public static BootLog get() { + return BOOT_LOG_INSTANCE; + } + + /** + * Set the system's {@link BootLog}. + * @param bootLog the system's {@link BootLog}. + */ + public static void set(BootLog bootLog) { + BOOT_LOG_INSTANCE = bootLog; + } +} Added: trunk/core/src/core/org/jnode/bootlog/package.html =================================================================== --- trunk/core/src/core/org/jnode/bootlog/package.html (rev 0) +++ trunk/core/src/core/org/jnode/bootlog/package.html 2010-05-16 16:48:59 UTC (rev 5750) @@ -0,0 +1,11 @@ +<html> +<head> + <title>org.jnode.plugin</title> +</head> +<body> + +This package contains the interface with boot time log. +It also contains the singleton instance implementing that interface. + +</body> +</html> \ No newline at end of file Modified: trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java =================================================================== --- trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -30,6 +30,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; +import org.jnode.bootlog.BootLogInstance; import org.jnode.driver.console.ActiveTextConsole; import org.jnode.driver.console.ConsoleManager; import org.jnode.driver.console.TextConsole; @@ -37,7 +38,6 @@ import org.jnode.plugin.Plugin; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; -import org.jnode.system.BootLog; import org.jnode.util.WriterOutputStream; /** @@ -79,7 +79,7 @@ final VirtualConsoleAppender debugApp = new VirtualConsoleAppender(new PatternLayout(LAYOUT), console, false); debugApp.setThreshold(Level.DEBUG); - BootLog.setDebugOut(new PrintStream(new WriterOutputStream(console.getOut(), false), true)); + BootLogInstance.get().setDebugOut(new PrintStream(new WriterOutputStream(console.getOut(), false), true)); TextConsole atc = new ActiveTextConsole(conMgr); final VirtualConsoleAppender infoApp = new VirtualConsoleAppender( Modified: trunk/core/src/core/org/jnode/plugin/Plugin.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/Plugin.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/plugin/Plugin.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -24,7 +24,8 @@ import java.security.PrivilegedAction; import java.util.prefs.Preferences; -import org.jnode.system.BootLog; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; /** @@ -101,7 +102,7 @@ } if (!started) { if (descriptor.hasCustomPluginClass()) { - BootLog.debug("Starting plugin: " + descriptor.getId()); + BootLogInstance.get().debug("Starting plugin: " + descriptor.getId()); } started = true; try { Modified: trunk/core/src/core/org/jnode/plugin/PluginManager.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginManager.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/plugin/PluginManager.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -22,7 +22,8 @@ import java.util.List; -import org.jnode.system.BootLog; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; /** * Interface of manager of all plugins in the system. @@ -75,10 +76,10 @@ try { plugin.start(); } catch (PluginException ex) { - BootLog.error("Error starting " + plugin.getDescriptor().getId()); + BootLogInstance.get().error("Error starting " + plugin.getDescriptor().getId()); throw ex; } catch (Throwable ex) { - BootLog.error("Error starting " + plugin.getDescriptor().getId()); + BootLogInstance.get().error("Error starting " + plugin.getDescriptor().getId()); throw new PluginException(ex); } } @@ -93,14 +94,14 @@ protected final void stopSinglePlugin(Plugin plugin) throws PluginException { try { if (plugin.isActive()) { - BootLog.info("Stopping " + plugin.getDescriptor().getId()); + BootLogInstance.get().info("Stopping " + plugin.getDescriptor().getId()); plugin.stop(); } } catch (PluginException ex) { - BootLog.error("Error stopping " + plugin.getDescriptor().getId()); + BootLogInstance.get().error("Error stopping " + plugin.getDescriptor().getId()); throw ex; } catch (Throwable ex) { - BootLog.error("Error stopping " + plugin.getDescriptor().getId()); + BootLogInstance.get().error("Error stopping " + plugin.getDescriptor().getId()); throw new PluginException(ex); } } Modified: trunk/core/src/core/org/jnode/plugin/PluginUtils.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginUtils.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/plugin/PluginUtils.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -24,7 +24,8 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; -import org.jnode.system.BootLog; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; /** * Plugin utility methods. @@ -72,22 +73,22 @@ String message = null; try { - BootLog.debug("messageKey=" + messageKey + ", trying with " + Locale.getDefault()); + BootLogInstance.get().debug("messageKey=" + messageKey + ", trying with " + Locale.getDefault()); bundle = ResourceBundle.getBundle(fullName, Locale.getDefault(), loader); } catch (MissingResourceException e) { try { - BootLog.debug("trying with " + Locale.ENGLISH); + BootLogInstance.get().debug("trying with " + Locale.ENGLISH); bundle = ResourceBundle.getBundle(fullName, Locale.ENGLISH, loader); } catch (MissingResourceException mre) { if (!cleanFallback) - BootLog.error("can't get message", mre); + BootLogInstance.get().error("can't get message", mre); } } - BootLog.debug("bundle=" + bundle); + BootLogInstance.get().debug("bundle=" + bundle); if (bundle != null) { try { - BootLog.debug("got bundle " + bundleName); + BootLogInstance.get().debug("got bundle " + bundleName); message = bundle.getString(messageKey); } catch (MissingResourceException mre) { if (!cleanFallback) @@ -96,7 +97,7 @@ } if (message == null && !cleanFallback) { - BootLog.error("can't get message from bundle " + bundleName + " with key " + messageKey); + BootLogInstance.get().error("can't get message from bundle " + bundleName + " with key " + messageKey); } return (message == null) ? (cleanFallback ? messageKey : ('?' + messageKey + '?')) : message; Modified: trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -35,6 +35,8 @@ import javax.naming.NamingException; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.naming.InitialNaming; import org.jnode.plugin.Plugin; import org.jnode.plugin.PluginDescriptor; @@ -45,7 +47,6 @@ import org.jnode.plugin.PluginRegistry; import org.jnode.plugin.model.PluginRegistryModel; import org.jnode.security.JNodePermission; -import org.jnode.system.BootLog; /** * @author epr @@ -128,7 +129,7 @@ // 2 loops, first start all system plugins, // then start all auto-start plugins for (int type = 0; type < 2; type++) { - BootLog.info("Starting " + ((type == 0) ? "system" : "auto-start") + " plugins"); + BootLogInstance.get().info("Starting " + ((type == 0) ? "system" : "auto-start") + " plugins"); for (PluginDescriptor descr : descrList) { try { final boolean start; @@ -145,7 +146,7 @@ startSinglePlugin(descr.getPlugin()); } } catch (Throwable ex) { - BootLog.error("Cannot start " + descr.getId(), ex); + BootLogInstance.get().error("Cannot start " + descr.getId(), ex); if (debug) { try { Thread.sleep(5000); @@ -159,7 +160,7 @@ // Wait a while until all plugins have finished their startup process if (!isStartPluginsFinished()) { - BootLog.info("Waiting for plugins to finished their startprocess"); + BootLogInstance.get().info("Waiting for plugins to finished their startprocess"); final long start = System.currentTimeMillis(); long now = start; int loop = 0; @@ -202,9 +203,9 @@ //empty } } - BootLog.info("Stopped all plugins"); + BootLogInstance.get().info("Stopped all plugins"); } catch (PluginException ex) { - BootLog.error("Cannot stop plugins", ex); + BootLogInstance.get().error("Cannot stop plugins", ex); } } @@ -216,7 +217,7 @@ */ public final void stopPlugin(PluginDescriptor d) throws PluginException { final String id = d.getId(); - //BootLog.info("__Stopping " + id); + //BootLogInstance.get().info("__Stopping " + id); for (PluginDescriptor descr : registry) { if (descr.depends(id)) { stopPlugin(descr); @@ -245,7 +246,7 @@ for (Iterator<PluginDescriptor> i = all.values().iterator(); i.hasNext();) { final PluginDescriptor descr = (PluginDescriptor) i.next(); if (!prerequisitesExist(descr, all)) { - BootLog.info("Skipping plugin " + descr.getId()); + BootLogInstance.get().info("Skipping plugin " + descr.getId()); all.remove(descr.getId()); systemSet.remove(descr.getId()); i = all.values().iterator(); @@ -351,7 +352,7 @@ final Plugin pi = descr.getPlugin(); if (pi.isActive()) { if (!pi.isStartFinished()) { - BootLog.error("Plugin " + descr.getId() + BootLogInstance.get().error("Plugin " + descr.getId() + " has not yet finished"); } } Modified: trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -24,10 +24,11 @@ import java.nio.ByteBuffer; import java.util.List; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.FragmentDescriptor; import org.jnode.plugin.PluginException; -import org.jnode.system.BootLog; import org.jnode.vm.ResourceLoader; /** @@ -143,7 +144,7 @@ if (plugin == null) { throw new PluginException("Plugin " + getPluginId() + " not found"); } - BootLog.info("Resolve " + getId()); + BootLogInstance.get().info("Resolve " + getId()); plugin.add(this); } @@ -155,7 +156,7 @@ plugin.remove(this); plugin = null; } - BootLog.info("Unresolve " + getId()); + BootLogInstance.get().info("Unresolve " + getId()); super.unresolve(registry); } Modified: trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -37,10 +37,11 @@ import java.util.List; import java.util.Set; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.PluginClassLoader; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; -import org.jnode.system.BootLog; import org.jnode.vm.ResourceLoader; import org.jnode.vm.classmgr.VmClassLoader; @@ -198,7 +199,7 @@ fragment.startPlugin(registry); } } catch (PluginException ex) { - BootLog.error("Error starting plugin", ex); + BootLogInstance.get().error("Error starting plugin", ex); } // Define package (if needed) @@ -297,7 +298,7 @@ fragment.startPlugin(registry); } } catch (PluginException ex) { - BootLog.error("Cannot start plugin", ex); + BootLogInstance.get().error("Cannot start plugin", ex); } } return url; @@ -331,7 +332,7 @@ startPlugin(); fragment.startPlugin(registry); } catch (PluginException ex) { - BootLog.error("Cannot start plugin", ex); + BootLogInstance.get().error("Cannot start plugin", ex); } System.err.println("adding " + url); if (!urls.contains(url)) @@ -347,7 +348,7 @@ try { startPlugin(); } catch (PluginException ex) { - BootLog.error("Cannot start plugin", ex); + BootLogInstance.get().error("Cannot start plugin", ex); } System.err.println("adding " + url); if (!urls.contains(url)) Modified: trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -30,6 +30,8 @@ import java.util.Iterator; import java.util.List; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.Extension; import org.jnode.plugin.ExtensionPoint; @@ -40,7 +42,6 @@ import org.jnode.plugin.PluginPrerequisite; import org.jnode.plugin.PluginReference; import org.jnode.plugin.Runtime; -import org.jnode.system.BootLog; import org.jnode.vm.VmSystem; import org.jnode.vm.classmgr.VmClassLoader; import org.jnode.vm.isolate.VmIsolateLocal; @@ -629,7 +630,7 @@ throw new SecurityException("Cannot overwrite the registry"); } if (!resolved) { - // BootLog.info("Resolve " + id); + // BootLogInstance.get().info("Resolve " + id); this.registry = registry; registry.registerPlugin(this); for (int i = 0; i < extensionPoints.length; i++) { @@ -664,7 +665,7 @@ } starting = true; } - // BootLog.info("Resolve on plugin " + getId()); + // BootLogInstance.get().info("Resolve on plugin " + getId()); try { AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() { public Object run() throws PluginException { @@ -672,20 +673,20 @@ final int reqMax = requires.length; for (int i = 0; i < reqMax; i++) { final String reqId = requires[i].getPluginId(); - // BootLog.info("Start dependency " + reqId); + // BootLogInstance.get().info("Start dependency " + reqId); final PluginDescriptorModel reqDescr = (PluginDescriptorModel) registry .getPluginDescriptor(reqId); reqDescr.startPlugin(registry); // Make sure that it is really started reqDescr.waitUntilStarted(); } - // BootLog.info("Start myself " + getId()); + // BootLogInstance.get().info("Start myself " + getId()); getPlugin().start(); return null; } }); } catch (PrivilegedActionException ex) { - BootLog.error("Error starting plugin", ex); + BootLogInstance.get().error("Error starting plugin", ex); /*try { Thread.sleep(10000); } catch (InterruptedException ex1) { Modified: trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java =================================================================== --- trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -27,6 +27,8 @@ import java.security.PrivilegedAction; import java.util.HashMap; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.ConfigurationElement; import org.jnode.plugin.Extension; import org.jnode.plugin.ExtensionPoint; @@ -34,7 +36,6 @@ import org.jnode.plugin.Plugin; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; -import org.jnode.system.BootLog; /** * Plugin that installs itself as an URL Handler Factory. @@ -68,7 +69,7 @@ try { setHandlerFactory(this); } catch (SecurityException ex) { - BootLog.error("Cannot set URL Handler Factory"); + BootLogInstance.get().error("Cannot set URL Handler Factory"); } } @@ -80,7 +81,7 @@ try { setHandlerFactory(null); } catch (SecurityException ex) { - BootLog.error("Cannot reset URL Handler Factory"); + BootLogInstance.get().error("Cannot reset URL Handler Factory"); } } @@ -93,9 +94,9 @@ try { return (URLStreamHandler) cls.newInstance(); } catch (InstantiationException ex) { - BootLog.error("Cannot instantiate " + cls.getName()); + BootLogInstance.get().error("Cannot instantiate " + cls.getName()); } catch (IllegalAccessException ex) { - BootLog.error("Illegal access to " + cls.getName()); + BootLogInstance.get().error("Illegal access to " + cls.getName()); } } return null; @@ -150,7 +151,7 @@ final Class<? extends URLStreamHandler> cls = cl.loadClass(className); handlerClasses.put(protocol, cls); } catch (ClassNotFoundException ex) { - BootLog.error("Cannot load protocol handler class " + className); + BootLogInstance.get().error("Cannot load protocol handler class " + className); } } } Modified: trunk/core/src/core/org/jnode/security/JNodePolicy.java =================================================================== --- trunk/core/src/core/org/jnode/security/JNodePolicy.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/security/JNodePolicy.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -36,10 +36,11 @@ import java.util.HashMap; import java.util.Map; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.plugin.ConfigurationElement; import org.jnode.plugin.Extension; import org.jnode.plugin.ExtensionPoint; -import org.jnode.system.BootLog; /** * Default policy implementation for JNode. @@ -99,7 +100,7 @@ .entrySet()) { final CodeSource cs = e.getKey(); if (cs.implies(codeSource)) { - // BootLog.info(cs + " -> " + codeSource); + // BootLogInstance.get().info(cs + " -> " + codeSource); final PermissionCollection pc = e.getValue(); for (Enumeration<?> ee = pc.elements(); ee.hasMoreElements();) { perms.add((Permission) ee.nextElement()); @@ -147,7 +148,7 @@ final CodeSource cs = new CodeSource(url, (Certificate[]) null); final Permissions perms = new Permissions(); codeSource2Permissions.put(cs, perms); - // BootLog.debug("Adding permissions for " + cs); + // BootLogInstance.get().debug("Adding permissions for " + cs); final ConfigurationElement[] elems = ext.getConfigurationElements(); final int count = elems.length; for (int i = 0; i < count; i++) { @@ -175,30 +176,30 @@ final Permission p = (Permission) perm; perms.add(p); } catch (ClassNotFoundException ex) { - BootLog + BootLogInstance.get() .error("Permission class " + type + " not found"); } catch (InstantiationException ex) { - BootLog.error("Cannot instantiate permission class " + BootLogInstance.get().error("Cannot instantiate permission class " + type); } catch (IllegalAccessException ex) { - BootLog.error("Illegal access to permission class " + BootLogInstance.get().error("Illegal access to permission class " + type); } catch (NoSuchMethodException ex) { - BootLog + BootLogInstance.get() .error("Constructor not found on permission class " + type + " in plugin " + id); } catch (InvocationTargetException ex) { - BootLog.error("Error constructing permission class " + BootLogInstance.get().error("Error constructing permission class " + type, ex); } catch (ClassCastException ex) { - BootLog.error("Permission class " + type + BootLogInstance.get().error("Permission class " + type + " not instance of Permission"); } } } } catch (MalformedURLException ex) { - BootLog.error("Cannot create plugin codesource", ex); + BootLogInstance.get().error("Cannot create plugin codesource", ex); } } } Deleted: trunk/core/src/core/org/jnode/system/BootLog.java =================================================================== --- trunk/core/src/core/org/jnode/system/BootLog.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/system/BootLog.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -1,180 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.system; - -import java.io.PrintStream; - -import org.jnode.vm.Unsafe; - -/** - * Logging class used during bootstrap. - * - * @author Ewout Prangsma (ep...@us...) - */ -public class BootLog { - - public static final int DEBUG = 1; - public static final int INFO = 2; - public static final int WARN = 3; - public static final int ERROR = 4; - public static final int FATAL = 5; - - private static PrintStream debugOut; - - /** - * Log a debug message - * - * @param msg - */ - public static void debug(String msg) { - final PrintStream out = (debugOut != null) ? debugOut : System.out; - log(DEBUG, out, msg, null); - } - - /** - * Log a debug message - * - * @param msg - * @param ex - */ - public static void debug(String msg, Throwable ex) { - final PrintStream out = (debugOut != null) ? debugOut : System.out; - log(DEBUG, out, msg, ex); - } - - /** - * Log an error message - * - * @param msg - */ - public static void error(String msg) { - log(ERROR, System.err, msg, null); - } - - /** - * Log an error message - * - * @param msg - * @param ex - */ - public static void error(String msg, Throwable ex) { - log(ERROR, System.err, msg, ex); - /*try { - Thread.sleep(2500); - } catch (InterruptedException ex2) { - // Ignore - }*/ - } - - /** - * Log an fatal message - * - * @param msg - */ - public static void fatal(String msg) { - log(FATAL, System.err, msg, null); - } - - /** - * Log an fatal message - * - * @param msg - * @param ex - */ - public static void fatal(String msg, Throwable ex) { - log(FATAL, System.err, msg, ex); - } - - /** - * Log an info message - * - * @param msg - */ - public static void info(String msg) { - log(INFO, System.out, msg, null); - } - - /** - * Log an info message - * - * @param msg - * @param ex - */ - public static void info(String msg, Throwable ex) { - log(INFO, System.out, msg, ex); - } - - /** - * Log an warning message - * - * @param msg - * @param ex - */ - public static void warn(String msg, Throwable ex) { - log(WARN, System.out, msg, ex); - } - - /** - * Log an warning message - * - * @param msg - */ - public static void warn(String msg) { - log(WARN, System.out, msg, null); - } - - /** - * Set the stream to use for debug logs. - * - * @param out - */ - public static void setDebugOut(PrintStream out) { - debugOut = out; - } - - /** - * Log an error message - * - * @param level - * @param ps - * @param msg - * @param ex - */ - private static void log(int level, PrintStream ps, String msg, Throwable ex) { - if (ps != null) { - if (msg != null) { - ps.println(msg); - } - if (ex != null) { - ex.printStackTrace(ps); - } - } else { - if (msg != null) { - Unsafe.debug(msg); - Unsafe.debug("\n"); - } - if (ex != null) { - Unsafe.debug(ex.toString()); - Unsafe.debug("\n"); - } - } - } -} Modified: trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java =================================================================== --- trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -20,7 +20,8 @@ package org.jnode.util; -import org.jnode.system.BootLog; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; /** * @author Ewout Prangsma (ep...@us...) @@ -76,7 +77,7 @@ * @param ex */ protected void handleException(Exception ex) { - BootLog.error("Exception in ByteQueueProcessor: " + getName(), ex); + BootLogInstance.get().error("Exception in ByteQueueProcessor: " + getName(), ex); } /** @@ -85,7 +86,7 @@ * @param ex */ protected void handleError(Error ex) { - BootLog.error("Error in ByteQueueProcessor: " + getName(), ex); + BootLogInstance.get().error("Error in ByteQueueProcessor: " + getName(), ex); } /** Modified: trunk/core/src/core/org/jnode/util/QueueProcessorThread.java =================================================================== --- trunk/core/src/core/org/jnode/util/QueueProcessorThread.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/util/QueueProcessorThread.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -20,7 +20,8 @@ package org.jnode.util; -import org.jnode.system.BootLog; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; /** * @author epr @@ -80,7 +81,7 @@ * @param ex */ protected void handleException(Exception ex) { - BootLog.error("Exception in QueueProcessor: " + getName(), ex); + BootLogInstance.get().error("Exception in QueueProcessor: " + getName(), ex); } /** @@ -89,7 +90,7 @@ * @param ex */ protected void handleError(Error ex) { - BootLog.error("Error in QueueProcessor: " + getName(), ex); + BootLogInstance.get().error("Error in QueueProcessor: " + getName(), ex); } /** Copied: trunk/core/src/core/org/jnode/vm/BootLogImpl.java (from rev 5749, trunk/core/src/core/org/jnode/system/BootLog.java) =================================================================== --- trunk/core/src/core/org/jnode/vm/BootLogImpl.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/BootLogImpl.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -0,0 +1,153 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.vm; + +import java.io.PrintStream; + +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; + +/** + * Logging class used during bootstrap. + * + * @author Ewout Prangsma (ep...@us...) + */ +class BootLogImpl implements BootLog, BootableObject { + + private PrintStream debugOut; + + /** + * {@inheritDoc} + */ + public void debug(String msg) { + final PrintStream out = (debugOut != null) ? debugOut : System.out; + log(DEBUG, out, msg, null); + } + + /** + * {@inheritDoc} + */ + public void debug(String msg, Throwable ex) { + final PrintStream out = (debugOut != null) ? debugOut : System.out; + log(DEBUG, out, msg, ex); + } + + /** + * {@inheritDoc} + */ + public void error(String msg) { + log(ERROR, System.err, msg, null); + } + + /** + * {@inheritDoc} + */ + public void error(String msg, Throwable ex) { + log(ERROR, System.err, msg, ex); + /*try { + Thread.sleep(2500); + } catch (InterruptedException ex2) { + // Ignore + }*/ + } + + /** + * {@inheritDoc} + */ + public void fatal(String msg) { + log(FATAL, System.err, msg, null); + } + + /** + * {@inheritDoc} + */ + public void fatal(String msg, Throwable ex) { + log(FATAL, System.err, msg, ex); + } + + /** + * {@inheritDoc} + */ + public void info(String msg) { + log(INFO, System.out, msg, null); + } + + /** + * {@inheritDoc} + */ + public void info(String msg, Throwable ex) { + log(INFO, System.out, msg, ex); + } + + /** + * {@inheritDoc} + */ + public void warn(String msg, Throwable ex) { + log(WARN, System.out, msg, ex); + } + + /** + * {@inheritDoc} + */ + public void warn(String msg) { + log(WARN, System.out, msg, null); + } + + /** + * {@inheritDoc} + */ + public void setDebugOut(PrintStream out) { + debugOut = out; + } + + /** + * Log an error message + * + * @param level + * @param ps + * @param msg + * @param ex + */ + private void log(int level, PrintStream ps, String msg, Throwable ex) { + if (ps != null) { + if (msg != null) { + ps.println(msg); + } + if (ex != null) { + ex.printStackTrace(ps); + } + } else { + if (msg != null) { + Unsafe.debug(msg); + Unsafe.debug("\n"); + } + if (ex != null) { + Unsafe.debug(ex.toString()); + Unsafe.debug("\n"); + } + } + } + + static void initialize() { + Unsafe.debug("Initialize BootLog\n"); + BootLogInstance.set(new BootLogImpl()); + } +} Modified: trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -23,6 +23,7 @@ import org.jnode.annotation.MagicPermission; import org.jnode.annotation.SharedStatics; import org.jnode.annotation.Uninterruptible; +import org.jnode.bootlog.BootLogInstance; import org.jnode.vm.scheduler.VmProcessor; import org.jnode.vm.scheduler.VmThread; import org.vmmagic.unboxed.Address; @@ -244,9 +245,8 @@ /** * Initialize this manager. */ - private static void initialize() { + private static void initialize() { Unsafe.debug("Initialize MemoryBlockManager\n"); - startPtr = blockAlign(Unsafe.getMemoryStart().toWord(), true).toAddress(); endPtr = blockAlign(Unsafe.getMemoryEnd().toWord(), false).toAddress(); Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -33,21 +33,21 @@ import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; +import org.jnode.annotation.Internal; +import org.jnode.annotation.KernelSpace; +import org.jnode.annotation.MagicPermission; +import org.jnode.annotation.PrivilegedActionPragma; +import org.jnode.annotation.SharedStatics; +import org.jnode.annotation.Uninterruptible; +import org.jnode.bootlog.BootLogInstance; import org.jnode.naming.InitialNaming; import org.jnode.plugin.PluginManager; import org.jnode.security.JNodePermission; -import org.jnode.system.BootLog; import org.jnode.system.MemoryResource; import org.jnode.system.ResourceManager; import org.jnode.system.ResourceNotFreeException; import org.jnode.system.ResourceOwner; import org.jnode.system.SimpleResourceOwner; -import org.jnode.annotation.Internal; -import org.jnode.annotation.KernelSpace; -import org.jnode.annotation.MagicPermission; -import org.jnode.annotation.PrivilegedActionPragma; -import org.jnode.annotation.SharedStatics; -import org.jnode.annotation.Uninterruptible; import org.jnode.vm.classmgr.AbstractExceptionHandler; import org.jnode.vm.classmgr.VmArray; import org.jnode.vm.classmgr.VmByteCode; @@ -118,11 +118,13 @@ * Initialize the Virtual Machine */ public static void initialize() { - if (!inited) { - + if (!inited) { + // Initialize BootLog + BootLogImpl.initialize(); + // Initialize resource manager final ResourceManager rm = ResourceManagerImpl.initialize(); - + /* Initialize the system classloader */ VmSystemClassLoader loader = (VmSystemClassLoader) (getVmClass(VmProcessor.current()).getLoader()); systemLoader = loader; @@ -249,16 +251,16 @@ final Extent size = end.toWord().sub(start.toWord()).toExtent(); if (size.toWord().isZero()) { // No initial jarfile - BootLog.info("No initial jarfile found"); + BootLogInstance.get().info("No initial jarfile found"); return null; } else { - BootLog.info("Found initial jarfile of " + size.toInt() + "b"); + BootLogInstance.get().info("Found initial jarfile of " + size.toInt() + "b"); try { final ResourceOwner owner = new SimpleResourceOwner("System"); return rm.claimMemoryResource(owner, start, size, ResourceManager.MEMMODE_NORMAL); } catch (ResourceNotFreeException ex) { - BootLog.error("Cannot claim initjar resource", ex); + BootLogInstance.get().error("Cannot claim initjar resource", ex); return null; } } @@ -566,7 +568,7 @@ final VmType exClass = VmMagic.getObjectType(ex); final VmMethod method = reader.getMethod(frame); if (method == null) { - Unsafe.debug("Unknown method"); + Unsafe.debug("Unknown method in class " + ex.getClass().getName()); return null; } @@ -831,7 +833,7 @@ } } } catch (Exception ex) { - BootLog.error("Error getting rtcIncrement ", ex); + BootLogInstance.get().error("Error getting rtcIncrement ", ex); rtcIncrement = 1; } } Modified: trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -323,7 +323,7 @@ throw new ClassNotFoundException(name); } - // BootLog.debug("load class" + name); + // BootLogInstance.get().debug("load class" + name); if (name.indexOf('/') >= 0) { //throw new IllegalArgumentException("name contains '/'"); Modified: trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java 2010-05-12 10:31:48 UTC (rev 5749) +++ trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java 2010-05-16 16:48:59 UTC (rev 5750) @@ -23,7 +23,8 @@ import java.util.Comparator; import java.util.TreeMap; -import org.jnode.system.BootLog; +import org.jnode.bootlog.BootLog; +import org.jnode.bootlog.BootLogInstance; import org.jnode.vm.JvmType; import org.jnode.vm.classmgr.VmByteCode; import org.jnode.vm.classmgr.VmConstClass; @@ -380,7 +381,7 @@ */ public void visit_ireturn() { if (debug) { - BootLog.debug("ireturn at " + curAddress + "; " + tstack); + BootLogInstance.get().debug("ireturn at " + curAddress + "; " + tstack); } tstack.pop(JvmType.INT); endBB(false); @@ -435,34 +436,34 @@ */ public void startInstruction(int address) { if (debug) { - BootLog.debug("#" + address + "\t" + tstack); + BootLogInstance.get().debug("#" + address + "\t" + tstack); } curAddress = address; super.startInstruction(address); opcodeFlags[address] |= F_START_OF_INSTRUCTION; if (nextIsStartOfBB) { - if (debug) BootLog.debug("\tnextIsStartOfBB\t" + nextFollowsTypeStack); + if (debug) BootLogInstance.get().debug("\tnextIsStartOfBB\t" + nextFollowsTypeStack); startBB(address, nextFollowsTypeStack, this.tstack); nextIsStartOfBB =... [truncated message content] |
From: <fd...@us...> - 2010-05-16 16:50:14
|
Revision: 5751 http://jnode.svn.sourceforge.net/jnode/?rev=5751&view=rev Author: fduminy Date: 2010-05-16 16:50:07 +0000 (Sun, 16 May 2010) Log Message: ----------- - removed dependency cycle between org.jnode.naming and org.jnode.vm by moving DefaultNameSpace to org.jnode.vm - BootLogInstance is now using InitialNaming to store the instance Signed-off-by: Fabien DUMINY <fab...@we...> Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java trunk/core/src/core/org/jnode/naming/InitialNaming.java trunk/core/src/core/org/jnode/vm/BootLogImpl.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/emu/org/jnode/emu/naming/BasicNameSpace.java trunk/fs/src/test/org/jnode/test/fs/driver/stubs/StubNameSpace.java Added Paths: ----------- trunk/core/src/core/org/jnode/vm/DefaultNameSpace.java Removed Paths: ------------- trunk/core/src/core/org/jnode/naming/DefaultNameSpace.java Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-16 16:48:59 UTC (rev 5750) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -50,6 +50,8 @@ import org.jnode.assembler.x86.X86BinaryAssembler; import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; +import org.jnode.emu.naming.BasicNameSpace; +import org.jnode.naming.InitialNaming; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; import org.jnode.plugin.PluginRegistry; @@ -795,7 +797,8 @@ public final void execute() throws BuildException { try { - BootLogInstance.set(new BootLog() { + InitialNaming.setNameSpace(new BasicNameSpace()); + BootLogInstance.set(new BootLog() { @Override public void warn(String msg) { System.out.println(msg); Modified: trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java =================================================================== --- trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java 2010-05-16 16:48:59 UTC (rev 5750) +++ trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -1,19 +1,19 @@ package org.jnode.bootlog; +import javax.naming.NameAlreadyBoundException; +import javax.naming.NameNotFoundException; +import javax.naming.NamingException; +import org.jnode.naming.InitialNaming; + + /** - * Class holding the {@link BootLog} instance used by the system. - * <br/><h1>Implementation note :</h1> The reference to the actual instance of - * the BootLog can't be stored in the InitialNaming that use VmType, which is - * not fully initialized at build time (but BootLog is used). So, we are always - * holding the reference in that class. + * Class holding the {@link BootLog} instance used by the system. * * @author Fabien DUMINY * */ public final class BootLogInstance { - private static BootLog BOOT_LOG_INSTANCE; - private BootLogInstance () { } @@ -22,14 +22,20 @@ * @return the system's {@link BootLog}. */ public static BootLog get() { - return BOOT_LOG_INSTANCE; + try { + return InitialNaming.lookup(BootLog.class); + } catch (NameNotFoundException e) { + throw new Error("unable to find a BootLog instance", e); + } } /** * Set the system's {@link BootLog}. * @param bootLog the system's {@link BootLog}. + * @throws NamingException + * @throws NameAlreadyBoundException */ - public static void set(BootLog bootLog) { - BOOT_LOG_INSTANCE = bootLog; + public static void set(BootLog bootLog) throws NameAlreadyBoundException, NamingException { + InitialNaming.bind(BootLog.class, bootLog); } } Deleted: trunk/core/src/core/org/jnode/naming/DefaultNameSpace.java =================================================================== --- trunk/core/src/core/org/jnode/naming/DefaultNameSpace.java 2010-05-16 16:48:59 UTC (rev 5750) +++ trunk/core/src/core/org/jnode/naming/DefaultNameSpace.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -1,118 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.naming; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.naming.NameAlreadyBoundException; -import javax.naming.NameNotFoundException; -import javax.naming.NamingException; - -import org.jnode.annotation.PrivilegedActionPragma; -import org.jnode.vm.classmgr.VmType; - -public class DefaultNameSpace extends AbstractNameSpace { - - /** - * All bound names+services - */ - protected final Map<VmType<?>, Object> namespace = new HashMap<VmType<?>, Object>(); - - /** - * Bind a given service in the namespace under a given name. - * - * @param name - * @param service - * @throws NameAlreadyBoundException if the name already exists within this namespace - */ - @PrivilegedActionPragma - public <T> void bind(Class<T> name, T service) throws NamingException, - NameAlreadyBoundException { - if (name == null) { - throw new IllegalArgumentException("name == null"); - } - synchronized (namespace) { - if (namespace.containsKey(VmType.fromClass(name))) { - throw new NameAlreadyBoundException(name.getName()); - } - namespace.put(VmType.fromClass(name), service); - } - - // notify listeners - fireServiceBound(name, service); - } - - /** - * Unbind a service with a given name from the namespace. If the name does - * not exist in this namespace, this method returns without an error. - * - * @param name - */ - @PrivilegedActionPragma - public void unbind(Class<?> name) { - final Object service; - synchronized (namespace) { - service = namespace.remove(VmType.fromClass((Class<?>) name)); - } - - // notify listeners - fireServiceUnbound(name, service); - } - - /** - * Lookup a service with a given name. - * - * @param name - * @throws NameNotFoundException if the name was not found in this namespace - */ - @PrivilegedActionPragma - public <T> T lookup(Class<T> name) throws NameNotFoundException { - final Object result = namespace.get(VmType.fromClass(name)); - if (result == null) { -// if (!VmIsolate.isRoot()) { -// System.out.println("Looking for " + name.getVmClass().hashCode()); -// for (VmType<?> type : namespace.keySet()) { -// System.out.println(" found " + type.hashCode() + " " + (type == name.getVmClass())); -// } -// } - throw new NameNotFoundException(name.getName()); - } - return name.cast(result); - } - - /** - * Gets a set containing all names (Class) of the bound services. - */ - public Set<Class<?>> nameSet() { - final HashSet<VmType<?>> types; - synchronized (namespace) { - types = new HashSet<VmType<?>>(namespace.keySet()); - } - final Set<Class<?>> result = new HashSet<Class<?>>(types.size()); - for (VmType<?> type : types) { - result.add(type.asClass()); - } - return result; - } -} Modified: trunk/core/src/core/org/jnode/naming/InitialNaming.java =================================================================== --- trunk/core/src/core/org/jnode/naming/InitialNaming.java 2010-05-16 16:48:59 UTC (rev 5750) +++ trunk/core/src/core/org/jnode/naming/InitialNaming.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -45,7 +45,7 @@ /** * All bound names+services */ - private static NameSpace namespace; + private static NameSpace NAME_SPACE; /** * Add a {@link NameSpaceListener} to the NameSpace @@ -54,7 +54,7 @@ * @param l */ public static <T> void addNameSpaceListener(Class<T> name, NameSpaceListener<T> l) { - getNameSpace().addNameSpaceListener(name, l); + NAME_SPACE.addNameSpaceListener(name, l); } /** @@ -64,7 +64,7 @@ * @param l */ public static <T> void removeNameSpaceListener(Class<T> name, NameSpaceListener<T> l) { - getNameSpace().removeNameSpaceListener(name, l); + NAME_SPACE.removeNameSpaceListener(name, l); } /** @@ -73,11 +73,11 @@ * @param namespace */ public static void setNameSpace(NameSpace namespace) { - if (InitialNaming.namespace != null) { + if (NAME_SPACE != null) { throw new SecurityException( "namespace can't be modified after first initialization"); } - InitialNaming.namespace = namespace; + NAME_SPACE = namespace; } /** @@ -89,7 +89,7 @@ */ public static <T, E extends T> void bind(Class<T> name, E service) throws NamingException, NameAlreadyBoundException { - getNameSpace().bind(name, service); + NAME_SPACE.bind(name, service); } /** @@ -99,7 +99,7 @@ * @param name */ public static void unbind(Class<?> name) { - getNameSpace().unbind(name); + NAME_SPACE.unbind(name); } /** @@ -109,25 +109,13 @@ * @throws NameNotFoundException if the name was not found in this namespace */ public static <T> T lookup(Class<T> name) throws NameNotFoundException { - return getNameSpace().lookup(name); + return NAME_SPACE.lookup(name); } /** * Gets a set containing all names (Class) of the bound services. */ public static Set<Class<?>> nameSet() { - return getNameSpace().nameSet(); + return NAME_SPACE.nameSet(); } - - /** - * Get the actual {@link NameSpace} and use a default one - * if none was yet defined. - * @return - */ - private static NameSpace getNameSpace() { - if (namespace == null) { - namespace = new DefaultNameSpace(); - } - return namespace; - } } Modified: trunk/core/src/core/org/jnode/vm/BootLogImpl.java =================================================================== --- trunk/core/src/core/org/jnode/vm/BootLogImpl.java 2010-05-16 16:48:59 UTC (rev 5750) +++ trunk/core/src/core/org/jnode/vm/BootLogImpl.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -22,6 +22,9 @@ import java.io.PrintStream; +import javax.naming.NameAlreadyBoundException; +import javax.naming.NamingException; + import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; @@ -148,6 +151,14 @@ static void initialize() { Unsafe.debug("Initialize BootLog\n"); - BootLogInstance.set(new BootLogImpl()); + try { + BootLogInstance.set(new BootLogImpl()); + } catch (NameAlreadyBoundException e) { + Unsafe.debug(e.toString()); + Unsafe.debug("\n"); + } catch (NamingException e) { + Unsafe.debug(e.toString()); + Unsafe.debug("\n"); + } } } Copied: trunk/core/src/core/org/jnode/vm/DefaultNameSpace.java (from rev 5750, trunk/core/src/core/org/jnode/naming/DefaultNameSpace.java) =================================================================== --- trunk/core/src/core/org/jnode/vm/DefaultNameSpace.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/DefaultNameSpace.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -0,0 +1,119 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.vm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import javax.naming.NameAlreadyBoundException; +import javax.naming.NameNotFoundException; +import javax.naming.NamingException; + +import org.jnode.annotation.PrivilegedActionPragma; +import org.jnode.naming.AbstractNameSpace; +import org.jnode.vm.classmgr.VmType; + +class DefaultNameSpace extends AbstractNameSpace { + + /** + * All bound names+services + */ + protected final Map<VmType<?>, Object> namespace = new HashMap<VmType<?>, Object>(); + + /** + * Bind a given service in the namespace under a given name. + * + * @param name + * @param service + * @throws NameAlreadyBoundException if the name already exists within this namespace + */ + @PrivilegedActionPragma + public <T> void bind(Class<T> name, T service) throws NamingException, + NameAlreadyBoundException { + if (name == null) { + throw new IllegalArgumentException("name == null"); + } + synchronized (namespace) { + if (namespace.containsKey(VmType.fromClass(name))) { + throw new NameAlreadyBoundException(name.getName()); + } + namespace.put(VmType.fromClass(name), service); + } + + // notify listeners + fireServiceBound(name, service); + } + + /** + * Unbind a service with a given name from the namespace. If the name does + * not exist in this namespace, this method returns without an error. + * + * @param name + */ + @PrivilegedActionPragma + public void unbind(Class<?> name) { + final Object service; + synchronized (namespace) { + service = namespace.remove(VmType.fromClass((Class<?>) name)); + } + + // notify listeners + fireServiceUnbound(name, service); + } + + /** + * Lookup a service with a given name. + * + * @param name + * @throws NameNotFoundException if the name was not found in this namespace + */ + @PrivilegedActionPragma + public <T> T lookup(Class<T> name) throws NameNotFoundException { + final Object result = namespace.get(VmType.fromClass(name)); + if (result == null) { +// if (!VmIsolate.isRoot()) { +// System.out.println("Looking for " + name.getVmClass().hashCode()); +// for (VmType<?> type : namespace.keySet()) { +// System.out.println(" found " + type.hashCode() + " " + (type == name.getVmClass())); +// } +// } + throw new NameNotFoundException(name.getName()); + } + return name.cast(result); + } + + /** + * Gets a set containing all names (Class) of the bound services. + */ + public Set<Class<?>> nameSet() { + final HashSet<VmType<?>> types; + synchronized (namespace) { + types = new HashSet<VmType<?>>(namespace.keySet()); + } + final Set<Class<?>> result = new HashSet<Class<?>>(types.size()); + for (VmType<?> type : types) { + result.add(type.asClass()); + } + return result; + } +} Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-05-16 16:48:59 UTC (rev 5750) +++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -119,7 +119,10 @@ */ public static void initialize() { if (!inited) { - // Initialize BootLog + // Initialize Naming + InitialNaming.setNameSpace(new DefaultNameSpace()); + + // Initialize BootLog BootLogImpl.initialize(); // Initialize resource manager Modified: trunk/core/src/emu/org/jnode/emu/naming/BasicNameSpace.java =================================================================== --- trunk/core/src/emu/org/jnode/emu/naming/BasicNameSpace.java 2010-05-16 16:48:59 UTC (rev 5750) +++ trunk/core/src/emu/org/jnode/emu/naming/BasicNameSpace.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -36,7 +36,7 @@ * * @author cr...@jn... */ -public final class BasicNameSpace extends AbstractNameSpace { +public class BasicNameSpace extends AbstractNameSpace { protected final Map<Class<?>, Object> namespace = new HashMap<Class<?>, Object>(); public <T> void bind(Class<T> name, T service) Modified: trunk/fs/src/test/org/jnode/test/fs/driver/stubs/StubNameSpace.java =================================================================== --- trunk/fs/src/test/org/jnode/test/fs/driver/stubs/StubNameSpace.java 2010-05-16 16:48:59 UTC (rev 5750) +++ trunk/fs/src/test/org/jnode/test/fs/driver/stubs/StubNameSpace.java 2010-05-16 16:50:07 UTC (rev 5751) @@ -24,10 +24,10 @@ import javax.naming.NameNotFoundException; import javax.naming.NamingException; import org.apache.log4j.Logger; -import org.jnode.naming.DefaultNameSpace; +import org.jnode.emu.naming.BasicNameSpace; import org.jnode.test.support.MockUtils; -public class StubNameSpace extends DefaultNameSpace { +public class StubNameSpace extends BasicNameSpace { private static final Logger log = Logger.getLogger(StubNameSpace.class); public StubNameSpace() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2010-05-16 16:52:05
|
Revision: 5752 http://jnode.svn.sourceforge.net/jnode/?rev=5752&view=rev Author: fduminy Date: 2010-05-16 16:51:58 +0000 (Sun, 16 May 2010) Log Message: ----------- removed package/plugin dependency cycle org.jnode.security <-> org.jnode.plugin by moving JNodePermission class to its own package/plugin (org.jnode.permission) Signed-off-by: Fabien DUMINY <fab...@we...> Modified Paths: -------------- trunk/all/conf/system-plugin-list.xml trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/cli/descriptors/org.jnode.command.dev.ant.xml trunk/cli/descriptors/org.jnode.command.system.xml trunk/core/descriptors/com.sun.tools.javac.xml trunk/core/descriptors/org.apache.tools.ant.xml trunk/core/descriptors/org.classpath.ext.security.xml trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml trunk/core/descriptors/org.classpath.tools.xml trunk/core/descriptors/org.jnode.debugger.xml trunk/core/descriptors/org.jnode.driver.bus.pci.xml trunk/core/descriptors/org.jnode.driver.system.acpi.xml trunk/core/descriptors/org.jnode.driver.xml trunk/core/descriptors/org.jnode.system.repository.xml trunk/core/descriptors/sun.tools.xml trunk/core/src/classpath/vm/java/lang/NativeClassLoader.java trunk/core/src/classpath/vm/java/lang/ThreadHelper.java trunk/core/src/core/org/jnode/plugin/PluginLoader.java trunk/core/src/core/org/jnode/plugin/PluginSecurityConstants.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java trunk/core/src/core/org/jnode/vm/Unsafe.java trunk/core/src/core/org/jnode/vm/VmArchitecture.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/fs/descriptors/org.jnode.fs.command.xml trunk/fs/descriptors/org.jnode.fs.jifs.command.xml trunk/fs/descriptors/org.jnode.fs.jifs.def.xml trunk/fs/descriptors/org.jnode.fs.jifs.xml trunk/net/descriptors/org.jnode.net.ipv4.xml trunk/shell/descriptors/js.xml trunk/shell/descriptors/org.beanshell.xml trunk/shell/descriptors/org.jnode.shell.bjorne.xml trunk/shell/descriptors/org.jnode.shell.command.bsh.xml trunk/shell/descriptors/org.jnode.test.shell.xml Added Paths: ----------- trunk/core/descriptors/org.jnode.permission.xml trunk/core/src/core/org/jnode/permission/ trunk/core/src/core/org/jnode/permission/JNodePermission.java Removed Paths: ------------- trunk/core/src/core/org/jnode/security/JNodePermission.java Modified: trunk/all/conf/system-plugin-list.xml =================================================================== --- trunk/all/conf/system-plugin-list.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/all/conf/system-plugin-list.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -11,6 +11,7 @@ <plugin id="rt"/> <plugin id="rt.vm"/> + <plugin id="org.jnode.permission"/> <plugin id="org.jnode.runtime"/> <plugin id="org.jnode.runtime.core"/> <plugin id="org.jnode.runtime.core.bootlog"/> Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -1446,6 +1446,7 @@ addCompileHighOptLevel("org.jnode.boot"); addCompileHighOptLevel("org.jnode.bootlog"); addCompileHighOptLevel("org.jnode.naming"); + addCompileHighOptLevel("org.jnode.permission"); addCompileHighOptLevel("org.jnode.plugin"); addCompileHighOptLevel("org.jnode.plugin.manager"); addCompileHighOptLevel("org.jnode.plugin.model"); Modified: trunk/cli/descriptors/org.jnode.command.dev.ant.xml =================================================================== --- trunk/cli/descriptors/org.jnode.command.dev.ant.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/cli/descriptors/org.jnode.command.dev.ant.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -29,7 +29,7 @@ <permission class="java.lang.RuntimePermission" name="createClassLoader" actions="*" /> <permission class="java.lang.RuntimePermission" name="setIO" actions="*" /> <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" /> - <permission class="org.jnode.security.JNodePermission" name="getVmClass" actions="*" /> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass" actions="*" /> <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> </extension> Modified: trunk/cli/descriptors/org.jnode.command.system.xml =================================================================== --- trunk/cli/descriptors/org.jnode.command.system.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/cli/descriptors/org.jnode.command.system.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -304,13 +304,13 @@ <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read,write"/> - <permission class="org.jnode.security.JNodePermission" name="createPluginLoader"/> - <permission class="org.jnode.security.JNodePermission" name="loadPlugin"/> - <permission class="org.jnode.security.JNodePermission" name="unloadPlugin"/> - <permission class="org.jnode.security.JNodePermission" name="stopPlugin"/> - <permission class="org.jnode.security.JNodePermission" name="halt"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="createPluginLoader"/> + <permission class="org.jnode.permission.JNodePermission" name="loadPlugin"/> + <permission class="org.jnode.permission.JNodePermission" name="unloadPlugin"/> + <permission class="org.jnode.permission.JNodePermission" name="stopPlugin"/> + <permission class="org.jnode.permission.JNodePermission" name="halt"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> <permission class="java.lang.reflect.ReflectPermission" name="suppressAccessChecks"/> </extension> Modified: trunk/core/descriptors/com.sun.tools.javac.xml =================================================================== --- trunk/core/descriptors/com.sun.tools.javac.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/com.sun.tools.javac.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -64,8 +64,8 @@ <permission class="java.lang.RuntimePermission" name="createClassLoader"/> <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> <permission class="java.net.SocketPermission" name="*" actions="resolve"/> <permission class="java.net.SocketPermission" name="*:0-" actions="connect,resolve"/> <permission class="java.lang.RuntimePermission" name="writeFileDescriptor"/> Modified: trunk/core/descriptors/org.apache.tools.ant.xml =================================================================== --- trunk/core/descriptors/org.apache.tools.ant.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.apache.tools.ant.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -36,7 +36,7 @@ <permission class="java.lang.RuntimePermission" name="setIO" actions="*" /> <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" /> <permission class="java.lang.RuntimePermission" name="createClassLoader" actions="*" /> - <permission class="org.jnode.security.JNodePermission" name="getVmClass" actions="*" /> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass" actions="*" /> <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> </extension> </plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.classpath.ext.security.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.security.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.classpath.ext.security.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -62,8 +62,8 @@ <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read,write"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> <permission class="java.net.SocketPermission" name="*" actions="resolve"/> <permission class="java.net.SocketPermission" name="*:0-" actions="connect,resolve"/> <permission class="java.lang.RuntimePermission" name="writeFileDescriptor"/> Modified: trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -98,8 +98,8 @@ <permission class="java.lang.RuntimePermission" name="createClassLoader"/> <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> <permission class="java.net.SocketPermission" name="*" actions="resolve"/> <permission class="java.net.SocketPermission" name="*:0-" actions="connect,resolve"/> <permission class="java.lang.RuntimePermission" name="writeFileDescriptor"/> Modified: trunk/core/descriptors/org.classpath.tools.xml =================================================================== --- trunk/core/descriptors/org.classpath.tools.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.classpath.tools.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -36,8 +36,8 @@ <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read,write"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> <permission class="java.net.SocketPermission" name="*" actions="resolve"/> <permission class="java.net.SocketPermission" name="*:0-" actions="connect,resolve"/> <permission class="java.lang.RuntimePermission" name="writeFileDescriptor"/> Modified: trunk/core/descriptors/org.jnode.debugger.xml =================================================================== --- trunk/core/descriptors/org.jnode.debugger.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.jnode.debugger.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -22,7 +22,7 @@ <extension point="org.jnode.security.permissions"> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> <permission class="org.jnode.driver.DriverPermission" name="setPreferredListener"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> </extension> </plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.jnode.driver.bus.pci.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.pci.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.jnode.driver.bus.pci.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -24,7 +24,7 @@ <extension point="org.jnode.security.permissions"> <permission class="org.jnode.system.ResourcePermission" name="ioports"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> </extension> </plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.jnode.driver.system.acpi.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.system.acpi.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.jnode.driver.system.acpi.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -25,7 +25,7 @@ </extension> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.security.JNodePermission" name="getMemoryMap"/> + <permission class="org.jnode.permission.JNodePermission" name="getMemoryMap"/> </extension> </plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.jnode.driver.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.jnode.driver.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -26,7 +26,7 @@ <extension point="org.jnode.security.permissions"> <permission class="java.lang.RuntimePermission" name="getClassLoader"/> <permission class="java.util.PropertyPermission" name="jnode.cmdline" actions="read"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> </extension> </plugin> \ No newline at end of file Added: trunk/core/descriptors/org.jnode.permission.xml =================================================================== --- trunk/core/descriptors/org.jnode.permission.xml (rev 0) +++ trunk/core/descriptors/org.jnode.permission.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<plugin id="org.jnode.permission" + name="JNode specific permissions" + version="@VERSION@" + system="true" + provider-name="JNode.org" + license-name="lgpl"> + + <runtime> + <library name="jnode-core.jar"> + <export name="org.jnode.permission.*"/> + </library> + </runtime> +</plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.jnode.system.repository.xml =================================================================== --- trunk/core/descriptors/org.jnode.system.repository.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/org.jnode.system.repository.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -18,7 +18,7 @@ </runtime> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.security.JNodePermission" name="createPluginLoader"/> + <permission class="org.jnode.permission.JNodePermission" name="createPluginLoader"/> </extension> </plugin> \ No newline at end of file Modified: trunk/core/descriptors/sun.tools.xml =================================================================== --- trunk/core/descriptors/sun.tools.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/descriptors/sun.tools.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -44,8 +44,8 @@ <permission class="java.lang.RuntimePermission" name="setContextClassLoader"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read,write"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> <permission class="java.net.SocketPermission" name="*" actions="resolve"/> <permission class="java.net.SocketPermission" name="*:0-" actions="connect,resolve"/> <permission class="java.lang.RuntimePermission" name="writeFileDescriptor"/> Modified: trunk/core/src/classpath/vm/java/lang/NativeClassLoader.java =================================================================== --- trunk/core/src/classpath/vm/java/lang/NativeClassLoader.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/classpath/vm/java/lang/NativeClassLoader.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -24,11 +24,12 @@ import java.security.ProtectionDomain; import java.io.InputStream; import java.io.IOException; + +import org.jnode.permission.JNodePermission; import org.jnode.vm.classmgr.VmClassLoader; import org.jnode.vm.classmgr.VmType; import org.jnode.vm.VmJavaClassLoader; import org.jnode.vm.VmSystem; -import org.jnode.security.JNodePermission; /** * Modified: trunk/core/src/classpath/vm/java/lang/ThreadHelper.java =================================================================== --- trunk/core/src/classpath/vm/java/lang/ThreadHelper.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/classpath/vm/java/lang/ThreadHelper.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -20,10 +20,10 @@ package java.lang; +import org.jnode.permission.JNodePermission; import org.jnode.vm.scheduler.VmThread; import org.jnode.annotation.KernelSpace; import org.jnode.annotation.Internal; -import org.jnode.security.JNodePermission; /** * Copied: trunk/core/src/core/org/jnode/permission/JNodePermission.java (from rev 5751, trunk/core/src/core/org/jnode/security/JNodePermission.java) =================================================================== --- trunk/core/src/core/org/jnode/permission/JNodePermission.java (rev 0) +++ trunk/core/src/core/org/jnode/permission/JNodePermission.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -0,0 +1,52 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.permission; + +import java.security.BasicPermission; + +/** + * JNode specific permission. + * <p/> + * Known permission names: + * <ul> + * <li>getVmClass + * <li>getVmThread + * </ul> + * + * @author Ewout Prangsma (ep...@us...) + */ +public class JNodePermission extends BasicPermission { + + /** + * @param name + */ + public JNodePermission(String name) { + super(name); + } + + /** + * @param name + * @param actions + */ + public JNodePermission(String name, String actions) { + super(name, actions); + } +} Modified: trunk/core/src/core/org/jnode/plugin/PluginLoader.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginLoader.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/core/org/jnode/plugin/PluginLoader.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -22,7 +22,7 @@ import java.nio.ByteBuffer; -import org.jnode.security.JNodePermission; +import org.jnode.permission.JNodePermission; /** Modified: trunk/core/src/core/org/jnode/plugin/PluginSecurityConstants.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginSecurityConstants.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/core/org/jnode/plugin/PluginSecurityConstants.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -20,7 +20,7 @@ package org.jnode.plugin; -import org.jnode.security.JNodePermission; +import org.jnode.permission.JNodePermission; /** * @author epr Modified: trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -38,6 +38,7 @@ import org.jnode.bootlog.BootLog; import org.jnode.bootlog.BootLogInstance; import org.jnode.naming.InitialNaming; +import org.jnode.permission.JNodePermission; import org.jnode.plugin.Plugin; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; @@ -46,7 +47,6 @@ import org.jnode.plugin.PluginPrerequisite; import org.jnode.plugin.PluginRegistry; import org.jnode.plugin.model.PluginRegistryModel; -import org.jnode.security.JNodePermission; /** * @author epr Deleted: trunk/core/src/core/org/jnode/security/JNodePermission.java =================================================================== --- trunk/core/src/core/org/jnode/security/JNodePermission.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/core/org/jnode/security/JNodePermission.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -1,52 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.security; - -import java.security.BasicPermission; - -/** - * JNode specific permission. - * <p/> - * Known permission names: - * <ul> - * <li>getVmClass - * <li>getVmThread - * </ul> - * - * @author Ewout Prangsma (ep...@us...) - */ -public class JNodePermission extends BasicPermission { - - /** - * @param name - */ - public JNodePermission(String name) { - super(name); - } - - /** - * @param name - * @param actions - */ - public JNodePermission(String name, String actions) { - super(name, actions); - } -} Modified: trunk/core/src/core/org/jnode/vm/Unsafe.java =================================================================== --- trunk/core/src/core/org/jnode/vm/Unsafe.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/core/org/jnode/vm/Unsafe.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -24,11 +24,11 @@ import java.io.StringWriter; import org.jnode.assembler.ObjectResolver; -import org.jnode.security.JNodePermission; import org.jnode.annotation.Inline; import org.jnode.annotation.Internal; import org.jnode.annotation.KernelSpace; import org.jnode.annotation.MagicPermission; +import org.jnode.permission.JNodePermission; import org.jnode.vm.classmgr.VmMethod; import org.jnode.vm.classmgr.VmType; import org.jnode.vm.scheduler.VmProcessor; Modified: trunk/core/src/core/org/jnode/vm/VmArchitecture.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmArchitecture.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/core/org/jnode/vm/VmArchitecture.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -22,7 +22,7 @@ import java.nio.ByteOrder; -import org.jnode.security.JNodePermission; +import org.jnode.permission.JNodePermission; import org.jnode.system.ResourceManager; import org.jnode.annotation.Internal; import org.jnode.annotation.KernelSpace; Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -41,8 +41,8 @@ import org.jnode.annotation.Uninterruptible; import org.jnode.bootlog.BootLogInstance; import org.jnode.naming.InitialNaming; +import org.jnode.permission.JNodePermission; import org.jnode.plugin.PluginManager; -import org.jnode.security.JNodePermission; import org.jnode.system.MemoryResource; import org.jnode.system.ResourceManager; import org.jnode.system.ResourceNotFreeException; Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmType.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmType.java 2010-05-16 16:51:58 UTC (rev 5752) @@ -31,6 +31,7 @@ import java.util.HashSet; import org.jnode.assembler.NativeStream; +import org.jnode.permission.JNodePermission; import org.jnode.vm.JvmType; import org.jnode.vm.LoadCompileService; import org.jnode.vm.Unsafe; @@ -50,7 +51,6 @@ import org.jnode.vm.compiler.CompiledIMT; import org.jnode.vm.compiler.NativeCodeCompiler; import org.jnode.vm.isolate.VmIsolateLocal; -import org.jnode.security.JNodePermission; import org.vmmagic.unboxed.Address; import org.vmmagic.unboxed.ObjectReference; Modified: trunk/fs/descriptors/org.jnode.fs.command.xml =================================================================== --- trunk/fs/descriptors/org.jnode.fs.command.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/fs/descriptors/org.jnode.fs.command.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -47,7 +47,7 @@ <permission class="java.net.NetPermission" name="specifyStreamHandler"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> <permission class="java.lang.RuntimePermission" name="exitVM"/> - <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> </extension> </plugin> Modified: trunk/fs/descriptors/org.jnode.fs.jifs.command.xml =================================================================== --- trunk/fs/descriptors/org.jnode.fs.jifs.command.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/fs/descriptors/org.jnode.fs.jifs.command.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -30,8 +30,8 @@ </extension> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.security.JNodePermission" name="stopPlugin"/> - <permission class="org.jnode.security.JNodePermission" name="startPlugin"/> + <permission class="org.jnode.permission.JNodePermission" name="stopPlugin"/> + <permission class="org.jnode.permission.JNodePermission" name="startPlugin"/> </extension> </plugin> \ No newline at end of file Modified: trunk/fs/descriptors/org.jnode.fs.jifs.def.xml =================================================================== --- trunk/fs/descriptors/org.jnode.fs.jifs.def.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/fs/descriptors/org.jnode.fs.jifs.def.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -24,7 +24,7 @@ <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> <permission class="java.lang.RuntimePermission" name="getProtectionDomain"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> </extension> </plugin> \ No newline at end of file Modified: trunk/fs/descriptors/org.jnode.fs.jifs.xml =================================================================== --- trunk/fs/descriptors/org.jnode.fs.jifs.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/fs/descriptors/org.jnode.fs.jifs.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -30,7 +30,7 @@ <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> <permission class="java.lang.RuntimePermission" name="getProtectionDomain"/> <permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/> - <permission class="org.jnode.security.JNodePermission" name="getVmThread"/> + <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> </extension> </plugin> \ No newline at end of file Modified: trunk/net/descriptors/org.jnode.net.ipv4.xml =================================================================== --- trunk/net/descriptors/org.jnode.net.ipv4.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/net/descriptors/org.jnode.net.ipv4.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -40,7 +40,7 @@ <permission class="org.jnode.net.NetPermission" name="*"/> <!-- dhcp --> - <permission class="org.jnode.security.JNodePermission" name="createPluginLoader"/> + <permission class="org.jnode.permission.JNodePermission" name="createPluginLoader"/> <!-- DNS --> <permission class="java.lang.RuntimePermission" name="selectorProvider"/> Modified: trunk/shell/descriptors/js.xml =================================================================== --- trunk/shell/descriptors/js.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/shell/descriptors/js.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -24,7 +24,7 @@ <permission class="java.lang.RuntimePermission" name="createClassLoader" actions="*" /> <permission class="java.lang.RuntimePermission" name="setIO" actions="*" /> <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" /> - <permission class="org.jnode.security.JNodePermission" name="getVmClass" actions="*" /> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass" actions="*" /> <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> </extension> </plugin> \ No newline at end of file Modified: trunk/shell/descriptors/org.beanshell.xml =================================================================== --- trunk/shell/descriptors/org.beanshell.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/shell/descriptors/org.beanshell.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -20,7 +20,7 @@ <permission class="java.lang.RuntimePermission" name="createClassLoader" actions="*" /> <permission class="java.lang.RuntimePermission" name="setIO" actions="*" /> <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" /> - <permission class="org.jnode.security.JNodePermission" name="getVmClass" actions="*" /> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass" actions="*" /> <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> </extension> </plugin> \ No newline at end of file Modified: trunk/shell/descriptors/org.jnode.shell.bjorne.xml =================================================================== --- trunk/shell/descriptors/org.jnode.shell.bjorne.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/shell/descriptors/org.jnode.shell.bjorne.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -27,7 +27,7 @@ <permission class="java.lang.RuntimePermission" name="modifyThread"/> <permission class="java.lang.RuntimePermission" name="setIO"/> <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" /> - <permission class="org.jnode.security.JNodePermission" name="getVmClass" actions="*" /> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass" actions="*" /> <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> <permission class="java.lang.reflect.ReflectPermission" name="suppressAccessChecks"/> </extension> Modified: trunk/shell/descriptors/org.jnode.shell.command.bsh.xml =================================================================== --- trunk/shell/descriptors/org.jnode.shell.command.bsh.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/shell/descriptors/org.jnode.shell.command.bsh.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -38,7 +38,7 @@ <permission class="java.lang.RuntimePermission" name="createClassLoader" actions="*" /> <permission class="java.lang.RuntimePermission" name="setIO" actions="*" /> <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" /> - <permission class="org.jnode.security.JNodePermission" name="getVmClass" actions="*" /> + <permission class="org.jnode.permission.JNodePermission" name="getVmClass" actions="*" /> <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> </extension> Modified: trunk/shell/descriptors/org.jnode.test.shell.xml =================================================================== --- trunk/shell/descriptors/org.jnode.test.shell.xml 2010-05-16 16:50:07 UTC (rev 5751) +++ trunk/shell/descriptors/org.jnode.test.shell.xml 2010-05-16 16:51:58 UTC (rev 5752) @@ -41,7 +41,7 @@ <permission class="java.lang.RuntimePermission" name="setIO"/> <permission class="java.lang.RuntimePermission" name="exitVM"/> <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> - <permission class="org.jnode.security.JNodePermission" name="loadPlugin"/> + <permission class="org.jnode.permission.JNodePermission" name="loadPlugin"/> <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read"/> <permission class="java.io.FilePermission" name="/jnode/tmp/test" actions="read,write,delete"/> <permission class="java.io.FilePermission" name="/jnode/tmp/test/-" actions="read,write,delete"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2010-05-16 17:00:47
|
Revision: 5753 http://jnode.svn.sourceforge.net/jnode/?rev=5753&view=rev Author: fduminy Date: 2010-05-16 17:00:38 +0000 (Sun, 16 May 2010) Log Message: ----------- - moved (resource related) classes from org.jnode.system to org.jnode.system.resource - these classes are in their own plugin (that breaks the plugin dependency cycle org.jnode.vm.core -> org.jnode.runtime.core -> org.jnode.plugin -> org.jnode.vm.core) Signed-off-by: Fabien DUMINY <fab...@we...> Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/core/descriptors/org.jnode.driver.bus.pci.xml trunk/core/descriptors/org.jnode.driver.bus.usb.uhci.xml trunk/core/descriptors/org.jnode.driver.chipset.i440BX.xml trunk/core/descriptors/org.jnode.driver.serial.xml trunk/core/descriptors/org.jnode.driver.system.cmos.xml trunk/core/descriptors/org.jnode.driver.system.firmware.bios.xml trunk/core/descriptors/org.jnode.runtime.core.xml trunk/core/src/classpath/vm/java/nio/MemoryRawData.java trunk/core/src/classpath/vm/java/nio/NativeVMDirectByteBuffer.java trunk/core/src/core/org/jnode/boot/InitJarProcessor.java trunk/core/src/core/org/jnode/boot/MemoryResourceInputStream.java trunk/core/src/core/org/jnode/system/package.html trunk/core/src/core/org/jnode/system/x86/DMA.java trunk/core/src/core/org/jnode/system/x86/DMAPlugin.java trunk/core/src/core/org/jnode/system/x86/X86DMAChannel.java trunk/core/src/core/org/jnode/vm/IOResourceImpl.java trunk/core/src/core/org/jnode/vm/MemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/MemoryScannerImpl.java trunk/core/src/core/org/jnode/vm/MultiMediaMemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/Region.java trunk/core/src/core/org/jnode/vm/ResourceManagerImpl.java trunk/core/src/core/org/jnode/vm/Vm.java trunk/core/src/core/org/jnode/vm/VmArchitecture.java trunk/core/src/core/org/jnode/vm/VmMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/scheduler/IRQManager.java trunk/core/src/core/org/jnode/vm/scheduler/IRQThread.java trunk/core/src/core/org/jnode/vm/x86/IOAPIC.java trunk/core/src/core/org/jnode/vm/x86/LocalAPIC.java trunk/core/src/core/org/jnode/vm/x86/MPBusEntry.java trunk/core/src/core/org/jnode/vm/x86/MPConfigTable.java trunk/core/src/core/org/jnode/vm/x86/MPEntry.java trunk/core/src/core/org/jnode/vm/x86/MPFloatingPointerStructure.java trunk/core/src/core/org/jnode/vm/x86/MPIOAPICEntry.java trunk/core/src/core/org/jnode/vm/x86/MPIOInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPLocalInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPProcessorEntry.java trunk/core/src/core/org/jnode/vm/x86/PIC8259A.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor64.java trunk/core/src/driver/org/jnode/driver/Device.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/AbstractStructure.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/AbstractTreeStructure.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/FrameList.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/QueueHead.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/Schedule.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/TransferDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIControlPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCICore.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDataPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIIO.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipeManager.java trunk/core/src/driver/org/jnode/driver/chipset/i440BX/i82371AB_ACPI_SMBusControler.java trunk/core/src/driver/org/jnode/driver/serial/SerialPortDriver.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiDriver.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiSystemTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/DifferentiatedSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/ExtendedSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/FirmwareAcpiControlStructure.java trunk/core/src/driver/org/jnode/driver/system/acpi/FixedAcpiDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/RSDP.java trunk/core/src/driver/org/jnode/driver/system/acpi/RootSystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/SystemDescriptionTable.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOS.java trunk/core/src/driver/org/jnode/driver/system/cmos/def/CMOSPlugin.java trunk/core/src/driver/org/jnode/driver/system/firmware/bios/BiosDriver.java trunk/core/src/driver/org/jnode/driver/textscreen/x86/PcTextScreen.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java trunk/core/src/test/org/jnode/test/CMOSTest.java trunk/fs/descriptors/org.jnode.driver.block.floppy.xml trunk/fs/descriptors/org.jnode.driver.bus.ide.xml trunk/fs/src/driver/org/jnode/driver/block/floppy/DefaultFDC.java trunk/fs/src/driver/org/jnode/driver/block/floppy/FDC.java trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyControllerDriver.java trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyReadSectorCommand.java trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyWriteSectorCommand.java trunk/fs/src/driver/org/jnode/driver/block/floppy/support/DefaultFloppyDeviceFactory.java trunk/fs/src/driver/org/jnode/driver/block/floppy/support/FloppyDeviceFactory.java trunk/fs/src/driver/org/jnode/driver/bus/ide/DefaultIDEControllerDriver.java trunk/fs/src/driver/org/jnode/driver/bus/ide/DefaultIDEDeviceFactory.java trunk/fs/src/driver/org/jnode/driver/bus/ide/DefaultIDEIO.java trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEDeviceFactory.java trunk/fs/src/test/org/jnode/test/fs/driver/context/IDEDiskDriverContext.java trunk/fs/src/test/org/jnode/test/fs/driver/factories/MockFloppyDeviceFactory.java trunk/fs/src/test/org/jnode/test/support/MockObjectFactory.java trunk/gui/descriptors/org.jnode.driver.ps2.xml trunk/gui/descriptors/org.jnode.driver.sound.speaker.pc.xml trunk/gui/descriptors/org.jnode.driver.video.ati.mach64.xml trunk/gui/descriptors/org.jnode.driver.video.ati.radeon.xml trunk/gui/descriptors/org.jnode.driver.video.cirrus.xml trunk/gui/descriptors/org.jnode.driver.video.vesa.xml trunk/gui/descriptors/org.jnode.driver.video.vga.xml trunk/gui/descriptors/org.jnode.driver.video.vmware.xml trunk/gui/src/awt/org/jnode/awt/image/AbstractMemoryImageConsumer.java trunk/gui/src/awt/org/jnode/awt/image/ImageConsumerByte.java trunk/gui/src/awt/org/jnode/awt/image/ImageConsumerInt.java trunk/gui/src/awt/org/jnode/awt/util/AbstractBitmapGraphics.java trunk/gui/src/awt/org/jnode/awt/util/BitmapGraphics.java trunk/gui/src/awt/org/jnode/awt/util/BitmapGraphics16bpp.java trunk/gui/src/awt/org/jnode/awt/util/BitmapGraphics24bpp.java trunk/gui/src/awt/org/jnode/awt/util/BitmapGraphics32bpp.java trunk/gui/src/awt/org/jnode/awt/util/BitmapGraphics8bpp.java trunk/gui/src/driver/org/jnode/driver/ps2/PS2Bus.java trunk/gui/src/driver/org/jnode/driver/ps2/PS2KeyboardDriver.java trunk/gui/src/driver/org/jnode/driver/ps2/PS2PointerDriver.java trunk/gui/src/driver/org/jnode/driver/sound/speaker/pc/PCSpeakerDriver.java trunk/gui/src/driver/org/jnode/driver/video/ati/mach64/Mach64Core.java trunk/gui/src/driver/org/jnode/driver/video/ati/mach64/Mach64Driver.java trunk/gui/src/driver/org/jnode/driver/video/ati/mach64/Mach64Surface.java trunk/gui/src/driver/org/jnode/driver/video/ati/mach64/Mach64VgaIO.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/FBInfo.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/FPIBlock.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/FPITimingBlock.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/PLLInfo.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/RadeonCore.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/RadeonDriver.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/RadeonHardwareCursor.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/RadeonSurface.java trunk/gui/src/driver/org/jnode/driver/video/ati/radeon/RadeonVgaIO.java trunk/gui/src/driver/org/jnode/driver/video/cirrus/CirrusCore.java trunk/gui/src/driver/org/jnode/driver/video/cirrus/CirrusDriver.java trunk/gui/src/driver/org/jnode/driver/video/cirrus/CirrusMMIO.java trunk/gui/src/driver/org/jnode/driver/video/nvidia/NVidiaCore.java trunk/gui/src/driver/org/jnode/driver/video/nvidia/NVidiaDriver.java trunk/gui/src/driver/org/jnode/driver/video/nvidia/NVidiaVgaIO.java trunk/gui/src/driver/org/jnode/driver/video/vesa/VESACommand.java trunk/gui/src/driver/org/jnode/driver/video/vesa/VESACore.java trunk/gui/src/driver/org/jnode/driver/video/vesa/VESADriver.java trunk/gui/src/driver/org/jnode/driver/video/vga/StandardVGA.java trunk/gui/src/driver/org/jnode/driver/video/vga/StandardVGAIO.java trunk/gui/src/driver/org/jnode/driver/video/vga/VGADriver.java trunk/gui/src/driver/org/jnode/driver/video/vga/VGASurface.java trunk/gui/src/driver/org/jnode/driver/video/vgahw/VgaIO.java trunk/gui/src/driver/org/jnode/driver/video/vgahw/VgaState.java trunk/gui/src/driver/org/jnode/driver/video/vmware/VMWareCore.java trunk/gui/src/driver/org/jnode/driver/video/vmware/VMWareDriver.java trunk/net/descriptors/org.jnode.driver.net.3c90x.xml trunk/net/descriptors/org.jnode.driver.net.bcm570x.xml trunk/net/descriptors/org.jnode.driver.net.eepro100.xml trunk/net/descriptors/org.jnode.driver.net.lance.xml trunk/net/descriptors/org.jnode.driver.net.ne2k-pci.xml trunk/net/descriptors/org.jnode.driver.net.prism2.xml trunk/net/descriptors/org.jnode.driver.net.rtl8139.xml trunk/net/descriptors/org.jnode.driver.net.via_rhine.xml trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xCore.java trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xDriver.java trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xRxRing.java trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xTxBuffer.java trunk/net/src/driver/org/jnode/driver/net/bcm570x/BCM570xCore.java trunk/net/src/driver/org/jnode/driver/net/bcm570x/BCM570xDriver.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Buffer.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Driver.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Registers.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100RxFD.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Stats.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100TxFD.java trunk/net/src/driver/org/jnode/driver/net/ethernet/spi/BasicEthernetDriver.java trunk/net/src/driver/org/jnode/driver/net/lance/BufferManager.java trunk/net/src/driver/org/jnode/driver/net/lance/DWordIOAccess.java trunk/net/src/driver/org/jnode/driver/net/lance/Descriptor.java trunk/net/src/driver/org/jnode/driver/net/lance/DescriptorRing.java trunk/net/src/driver/org/jnode/driver/net/lance/IOAccess.java trunk/net/src/driver/org/jnode/driver/net/lance/InitializationBlock32Bit.java trunk/net/src/driver/org/jnode/driver/net/lance/LanceCore.java trunk/net/src/driver/org/jnode/driver/net/lance/LanceDriver.java trunk/net/src/driver/org/jnode/driver/net/lance/RxDescriptor.java trunk/net/src/driver/org/jnode/driver/net/lance/RxDescriptorRing.java trunk/net/src/driver/org/jnode/driver/net/lance/TxDescriptor.java trunk/net/src/driver/org/jnode/driver/net/lance/TxDescriptorRing.java trunk/net/src/driver/org/jnode/driver/net/lance/WordIOAccess.java trunk/net/src/driver/org/jnode/driver/net/ne2000/Ne2000Core.java trunk/net/src/driver/org/jnode/driver/net/ne2000/Ne2000Driver.java trunk/net/src/driver/org/jnode/driver/net/ne2000/pci/Ne2000PCI.java trunk/net/src/driver/org/jnode/driver/net/ne2000/pci/Ne2000PCIDriver.java trunk/net/src/driver/org/jnode/driver/net/prism2/Prism2Core.java trunk/net/src/driver/org/jnode/driver/net/prism2/Prism2Driver.java trunk/net/src/driver/org/jnode/driver/net/prism2/Prism2IO.java trunk/net/src/driver/org/jnode/driver/net/rtl8139/RTL8139Core.java trunk/net/src/driver/org/jnode/driver/net/rtl8139/RTL8139Driver.java trunk/net/src/driver/org/jnode/driver/net/rtl8139/RTL8139RxRing.java trunk/net/src/driver/org/jnode/driver/net/rtl8139/RTL8139TxBuffer.java trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineCore.java trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineDesc.java trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineDriver.java trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineRing.java trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineRxRing.java trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineTxRing.java trunk/net/src/driver/org/jnode/driver/net/wireless/spi/WirelessEthernetDriver.java Added Paths: ----------- trunk/core/descriptors/org.jnode.runtime.core.resource.xml trunk/core/src/core/org/jnode/system/resource/ trunk/core/src/core/org/jnode/system/resource/DMAException.java trunk/core/src/core/org/jnode/system/resource/DMAManager.java trunk/core/src/core/org/jnode/system/resource/DMAResource.java trunk/core/src/core/org/jnode/system/resource/IOResource.java trunk/core/src/core/org/jnode/system/resource/IRQHandler.java trunk/core/src/core/org/jnode/system/resource/IRQResource.java trunk/core/src/core/org/jnode/system/resource/MemoryResource.java trunk/core/src/core/org/jnode/system/resource/MemoryScanner.java trunk/core/src/core/org/jnode/system/resource/MultiMediaMemoryResource.java trunk/core/src/core/org/jnode/system/resource/Resource.java trunk/core/src/core/org/jnode/system/resource/ResourceManager.java trunk/core/src/core/org/jnode/system/resource/ResourceNotFreeException.java trunk/core/src/core/org/jnode/system/resource/ResourceOwner.java trunk/core/src/core/org/jnode/system/resource/ResourcePermission.java trunk/core/src/core/org/jnode/system/resource/SimpleResourceOwner.java trunk/core/src/core/org/jnode/system/resource/package.html Removed Paths: ------------- trunk/core/src/core/org/jnode/system/DMAException.java trunk/core/src/core/org/jnode/system/DMAManager.java trunk/core/src/core/org/jnode/system/DMAResource.java trunk/core/src/core/org/jnode/system/IOResource.java trunk/core/src/core/org/jnode/system/IRQHandler.java trunk/core/src/core/org/jnode/system/IRQResource.java trunk/core/src/core/org/jnode/system/MemoryResource.java trunk/core/src/core/org/jnode/system/MemoryScanner.java trunk/core/src/core/org/jnode/system/MultiMediaMemoryResource.java trunk/core/src/core/org/jnode/system/Resource.java trunk/core/src/core/org/jnode/system/ResourceManager.java trunk/core/src/core/org/jnode/system/ResourceNotFreeException.java trunk/core/src/core/org/jnode/system/ResourceOwner.java trunk/core/src/core/org/jnode/system/ResourcePermission.java trunk/core/src/core/org/jnode/system/SimpleResourceOwner.java Property Changed: ---------------- trunk/gui/descriptors/org.jnode.driver.video.vesa.xml trunk/gui/src/driver/org/jnode/driver/video/vesa/VESADriver.java Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1451,7 +1451,7 @@ addCompileHighOptLevel("org.jnode.plugin.manager"); addCompileHighOptLevel("org.jnode.plugin.model"); addCompileHighOptLevel("org.jnode.security"); - addCompileHighOptLevel("org.jnode.system"); + addCompileHighOptLevel("org.jnode.system.resource"); addCompileHighOptLevel("org.jnode.system.event"); addCompileHighOptLevel("org.jnode.util"); addCompileHighOptLevel("org.jnode.vm"); Modified: trunk/core/descriptors/org.jnode.driver.bus.pci.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.pci.xml 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/descriptors/org.jnode.driver.bus.pci.xml 2010-05-16 17:00:38 UTC (rev 5753) @@ -23,7 +23,7 @@ </extension> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.system.ResourcePermission" name="ioports"/> + <permission class="org.jnode.system.resource.ResourcePermission" name="ioports"/> <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> </extension> Modified: trunk/core/descriptors/org.jnode.driver.bus.usb.uhci.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.usb.uhci.xml 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/descriptors/org.jnode.driver.bus.usb.uhci.xml 2010-05-16 17:00:38 UTC (rev 5753) @@ -25,7 +25,7 @@ </extension> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.system.ResourcePermission" name="ioports"/> + <permission class="org.jnode.system.resource.ResourcePermission" name="ioports"/> </extension> </plugin> Modified: trunk/core/descriptors/org.jnode.driver.chipset.i440BX.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.chipset.i440BX.xml 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/descriptors/org.jnode.driver.chipset.i440BX.xml 2010-05-16 17:00:38 UTC (rev 5753) @@ -23,7 +23,7 @@ </extension> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.system.ResourcePermission" name="ioports"/> + <permission class="org.jnode.system.resource.ResourcePermission" name="ioports"/> </extension> </plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.jnode.driver.serial.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.serial.xml 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/descriptors/org.jnode.driver.serial.xml 2010-05-16 17:00:38 UTC (rev 5753) @@ -22,7 +22,7 @@ </extension> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.system.ResourcePermission" name="ioports"/> + <permission class="org.jnode.system.resource.ResourcePermission" name="ioports"/> </extension> </plugin> Modified: trunk/core/descriptors/org.jnode.driver.system.cmos.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.system.cmos.xml 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/descriptors/org.jnode.driver.system.cmos.xml 2010-05-16 17:00:38 UTC (rev 5753) @@ -20,7 +20,7 @@ </runtime> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.system.ResourcePermission" name="ioports"/> + <permission class="org.jnode.system.resource.ResourcePermission" name="ioports"/> </extension> </plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.jnode.driver.system.firmware.bios.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.system.firmware.bios.xml 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/descriptors/org.jnode.driver.system.firmware.bios.xml 2010-05-16 17:00:38 UTC (rev 5753) @@ -22,7 +22,7 @@ </extension> <extension point="org.jnode.security.permissions"> - <permission class="org.jnode.system.ResourcePermission" name="memoryScanner"/> + <permission class="org.jnode.system.resource.ResourcePermission" name="memoryScanner"/> </extension> </plugin> \ No newline at end of file Added: trunk/core/descriptors/org.jnode.runtime.core.resource.xml =================================================================== --- trunk/core/descriptors/org.jnode.runtime.core.resource.xml (rev 0) +++ trunk/core/descriptors/org.jnode.runtime.core.resource.xml 2010-05-16 17:00:38 UTC (rev 5753) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<plugin id="org.jnode.runtime.core.resource" + name="JNode core resource interfaces" + version="@VERSION@" + system="true" + license-name="lgpl" + provider-name="JNode.org"> + + <runtime> + <library name="jnode-core.jar"> + <export name="org.jnode.system.resource.*"/> + </library> + </runtime> + +</plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.jnode.runtime.core.xml =================================================================== --- trunk/core/descriptors/org.jnode.runtime.core.xml 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/descriptors/org.jnode.runtime.core.xml 2010-05-16 17:00:38 UTC (rev 5753) @@ -24,7 +24,6 @@ <export name="org.jnode.plugin.model.*"/> <export name="org.jnode.protocol.plugin.*"/> <export name="org.jnode.protocol.system.*"/> - <export name="org.jnode.system.*"/> <export name="org.jnode.system.event.*"/> </library> </runtime> Modified: trunk/core/src/classpath/vm/java/nio/MemoryRawData.java =================================================================== --- trunk/core/src/classpath/vm/java/nio/MemoryRawData.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/classpath/vm/java/nio/MemoryRawData.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -21,11 +21,12 @@ package java.nio; import gnu.classpath.Pointer; -import org.jnode.system.MemoryResource; -import org.jnode.system.ResourceManager; -import org.jnode.system.ResourceOwner; -import org.jnode.system.SimpleResourceOwner; -import org.jnode.system.ResourceNotFreeException; + +import org.jnode.system.resource.MemoryResource; +import org.jnode.system.resource.ResourceManager; +import org.jnode.system.resource.ResourceNotFreeException; +import org.jnode.system.resource.ResourceOwner; +import org.jnode.system.resource.SimpleResourceOwner; import org.jnode.naming.InitialNaming; import org.vmmagic.unboxed.Address; import javax.naming.NameNotFoundException; Modified: trunk/core/src/classpath/vm/java/nio/NativeVMDirectByteBuffer.java =================================================================== --- trunk/core/src/classpath/vm/java/nio/NativeVMDirectByteBuffer.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/classpath/vm/java/nio/NativeVMDirectByteBuffer.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -21,8 +21,9 @@ package java.nio; import gnu.classpath.Pointer; -import org.jnode.system.MemoryResource; -import org.jnode.system.ResourceNotFreeException; + +import org.jnode.system.resource.MemoryResource; +import org.jnode.system.resource.ResourceNotFreeException; import org.vmmagic.unboxed.Offset; import org.vmmagic.unboxed.Extent; Modified: trunk/core/src/core/org/jnode/boot/InitJarProcessor.java =================================================================== --- trunk/core/src/core/org/jnode/boot/InitJarProcessor.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/boot/InitJarProcessor.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -36,7 +36,7 @@ import org.jnode.plugin.PluginException; import org.jnode.plugin.PluginLoader; import org.jnode.plugin.PluginRegistry; -import org.jnode.system.MemoryResource; +import org.jnode.system.resource.MemoryResource; import org.jnode.util.JarBuffer; /** Modified: trunk/core/src/core/org/jnode/boot/MemoryResourceInputStream.java =================================================================== --- trunk/core/src/core/org/jnode/boot/MemoryResourceInputStream.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/boot/MemoryResourceInputStream.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -23,7 +23,7 @@ import java.io.IOException; import java.io.InputStream; -import org.jnode.system.MemoryResource; +import org.jnode.system.resource.MemoryResource; import org.jnode.annotation.MagicPermission; Deleted: trunk/core/src/core/org/jnode/system/DMAException.java =================================================================== --- trunk/core/src/core/org/jnode/system/DMAException.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/system/DMAException.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1,58 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.system; - -/** - * Direct Memory Access Exception. - * - * @author Ewout Prangsma (ep...@us...) - */ -public class DMAException extends Exception { - - /** - * - */ - public DMAException() { - super(); - } - - /** - * @param message - * @param cause - */ - public DMAException(String message, Throwable cause) { - super(message, cause); - } - - /** - * @param cause - */ - public DMAException(Throwable cause) { - super(cause); - } - - /** - * @param s - */ - public DMAException(String s) { - super(s); - } -} Deleted: trunk/core/src/core/org/jnode/system/DMAManager.java =================================================================== --- trunk/core/src/core/org/jnode/system/DMAManager.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/system/DMAManager.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1,49 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.system; - - -/** - * Interface of Manager or Direct Memory Access resources. - * - * @author Ewout Prangsma (ep...@us...) - */ -public interface DMAManager { - - /** - * Name used to bind this service into the Initial Namespace - */ - public static final Class<DMAManager> NAME = DMAManager.class; //"system/DMAService"; - - /** - * Claim a DMA channel identified by the given number. - * - * @param owner - * @param dmanr - * @return The claimed resource - * @throws IllegalArgumentException Invalid dmanr - * @throws ResourceNotFreeException Requested DMA channel is in use - */ - public DMAResource claimDMAChannel(ResourceOwner owner, int dmanr) - throws IllegalArgumentException, ResourceNotFreeException; - - -} Deleted: trunk/core/src/core/org/jnode/system/DMAResource.java =================================================================== --- trunk/core/src/core/org/jnode/system/DMAResource.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/system/DMAResource.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1,69 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.system; - - -/** - * Direct Memory Access resource. - * - * @author Ewout Prangsma (ep...@us...) - */ -public interface DMAResource extends Resource { - - /** - * I/O to memory - */ - public static final int MODE_READ = 1; - /** - * Memory to I/O - */ - public static final int MODE_WRITE = 2; - - /** - * Prepare this channel for a data transfer. - * - * @param address - * @param length - * @param mode - * @throws IllegalArgumentException - * @throws DMAException - */ - public void setup(MemoryResource address, int length, int mode) - throws IllegalArgumentException, DMAException; - - /** - * Enable the datatransfer of this channel. This may only be called - * after a succesful call to setup. - * - * @throws DMAException - */ - public void enable() - throws DMAException; - - /** - * Gets the remaining length for this channel - * - * @return The remaining length - * @throws DMAException - */ - public int getLength() - throws DMAException; -} Deleted: trunk/core/src/core/org/jnode/system/IOResource.java =================================================================== --- trunk/core/src/core/org/jnode/system/IOResource.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/system/IOResource.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1,97 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.system; - -import org.jnode.annotation.KernelSpace; -import org.jnode.annotation.Uninterruptible; - -/** - * I/O port resource. - * - * @author Ewout Prangsma (ep...@us...) - */ -public interface IOResource extends Resource { - - /** - * Returns the length. - * - * @return int - */ - public abstract int getLength(); - - /** - * Returns the startPort. - * - * @return int - */ - public abstract int getStartPort(); - - /** - * Get the value of a 8-bit I/O port. - * - * @param portNr Absolute port number (not relative to startPort) - * @return The port value - */ - public abstract int inPortByte(int portNr); - - - /** - * Get the value of a 16-bit I/O port. - * - * @param portNr Absolute port number (not relative to startPort) - * @return The port value - */ - public abstract int inPortWord(int portNr); - - /** - * Get the value of a 32-bit I/O port. - * - * @param portNr Absolute port number (not relative to startPort) - * @return The port value - */ - public abstract int inPortDword(int portNr); - - /** - * Set the value of a 8-bit I/O port. - * - * @param portNr Absolute port number (not relative to startPort) - * @param value - */ - @KernelSpace - @Uninterruptible - public abstract void outPortByte(int portNr, int value); - - /** - * Set the value of a 16-bit I/O port. - * - * @param portNr Absolute port number (not relative to startPort) - * @param value - */ - public abstract void outPortWord(int portNr, int value); - - /** - * Set the value of a 32-bit I/O port. - * - * @param portNr Absolute port number (not relative to startPort) - * @param value - */ - public abstract void outPortDword(int portNr, int value); -} Deleted: trunk/core/src/core/org/jnode/system/IRQHandler.java =================================================================== --- trunk/core/src/core/org/jnode/system/IRQHandler.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/system/IRQHandler.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1,41 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.system; - -/** - * Hardware Interrupt Handler interface. - * <p/> - * An interrupt handler is called from the kernel with interrupts disabled. So keep and handling - * here as short as possible! - * - * @author Ewout Prangsma (ep...@us...) - */ -public interface IRQHandler { - - /** - * Handle a given hardware interrupt. This method is called from the kernel with interrupts - * disabled. So keep and handling here as short as possible! - * - * @param irq - */ - public void handleInterrupt(int irq); - -} Deleted: trunk/core/src/core/org/jnode/system/IRQResource.java =================================================================== --- trunk/core/src/core/org/jnode/system/IRQResource.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/system/IRQResource.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1,44 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.system; - -/** - * Hardware Interrupt resource. - * - * @author Ewout Prangsma (ep...@us...) - */ -public interface IRQResource extends Resource { - - /** - * Gets the IRQ number of this resource - * - * @return the IRQ number - */ - public int getIRQ(); - - /** - * Is this a shared interrupt? - * - * @return boolean - */ - public boolean isShared(); - -} Deleted: trunk/core/src/core/org/jnode/system/MemoryResource.java =================================================================== --- trunk/core/src/core/org/jnode/system/MemoryResource.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/system/MemoryResource.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1,686 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.system; - -import java.nio.ByteBuffer; - -import org.jnode.annotation.KernelSpace; -import org.jnode.annotation.Uninterruptible; -import org.vmmagic.unboxed.Address; -import org.vmmagic.unboxed.Extent; -import org.vmmagic.unboxed.Offset; - - -/** - * Block of memory resource. - * - * @author Ewout Prangsma (ep...@us...) - */ -public interface MemoryResource extends Resource { - - /** - * Create a bytebuffer that has the same content as this resource. - * - * @return the byte buffer - */ - public abstract ByteBuffer asByteBuffer(); - - /** - * Gets a 8-bit signed byte at the given memory address - * - * @param memPtr - * @return byte - */ - public abstract byte getByte(int memPtr); - - /** - * Gets multiple 8-bit signed bytes from the given memory address - * - * @param memPtr - * @param dst - * @param dstOfs - * @param length - */ - public abstract void getBytes(int memPtr, byte[] dst, int dstOfs, int length); - - /** - * Gets a 16-bit signed short at the given memory address - * - * @param memPtr - * @return short - */ - public abstract short getShort(int memPtr); - - /** - * Gets multiple 16-bit signed bytes from the given memory address - * - * @param memPtr - * @param dst - * @param dstOfs - * @param length - */ - public abstract void getShorts(int memPtr, short[] dst, int dstOfs, int length); - - /** - * Gets a 16-bit unsigned char at the given memory address - * - * @param memPtr - * @return char - */ - public abstract char getChar(int memPtr); - - /** - * Gets multiple 16-bit unsigned chars from the given memory address - * - * @param memPtr - * @param dst - * @param dstOfs - * @param length - */ - public abstract void getChars(int memPtr, char[] dst, int dstOfs, int length); - - /** - * Gets a 32-bit signed int at the given memory address - * - * @param memPtr - * @return int - */ - @KernelSpace - @Uninterruptible - public abstract int getInt(int memPtr); - - /** - * Gets multiple 32-bit signed ints from the given memory address - * - * @param memPtr - * @param dst - * @param dstOfs - * @param length - */ - public abstract void getInts(int memPtr, int[] dst, int dstOfs, int length); - - /** - * Gets a 64-bit signed long at the given memory address - * - * @param memPtr - * @return long - */ - public abstract long getLong(int memPtr); - - /** - * Gets multiple 64-bit signed longs from the given memory address - * - * @param memPtr - * @param dst - * @param dstOfs - * @param length - */ - public abstract void getLongs(int memPtr, long[] dst, int dstOfs, int length); - - /** - * Gets a float at the given memory address - * - * @param memPtr - * @return float - */ - public abstract float getFloat(int memPtr); - - /** - * Gets multiple 32-bit floats from the given memory address - * - * @param memPtr - * @param dst - * @param dstOfs - * @param length - */ - public abstract void getFloats(int memPtr, float[] dst, int dstOfs, int length); - - /** - * Gets a double at the given memory address - * - * @param memPtr - * @return double - */ - public abstract double getDouble(int memPtr); - - /** - * Gets multiple 64-bit doubles from the given memory address - * - * @param memPtr - * @param dst - * @param dstOfs - * @param length - */ - public abstract void getDoubles(int memPtr, double[] dst, int dstOfs, int length); - - /** - * Gets a object reference at the given memory address - * - * @param memPtr - * @return Object - */ - public abstract Object getObject(int memPtr); - - /** - * Sets a byte at a given memory address - * - * @param memPtr - * @param value - */ - public abstract void setByte(int memPtr, byte value); - - /** - * Sets a byte at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setByte(int memPtr, byte value, int count); - - /** - * Perform a bitwise AND of the byte at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void andByte(int memPtr, byte value, int count); - - /** - * Perform a bitwise OR of the byte at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void orByte(int memPtr, byte value, int count); - - /** - * Perform a bitwise XOR of the byte at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void xorByte(int memPtr, byte value, int count); - - /** - * Sets multiple 8-bit signed bytes at the given memory address - * - * @param src - * @param srcOfs - * @param dstPtr - * @param length - */ - public abstract void setBytes(byte[] src, int srcOfs, int dstPtr, int length); - - /** - * Sets a char at a given memory address - * - * @param memPtr - * @param value - */ - public abstract void setChar(int memPtr, char value); - - /** - * Sets a char at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setChar(int memPtr, char value, int count); - - /** - * Perform a bitwise AND of the char at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void andChar(int memPtr, char value, int count); - - /** - * Perform a bitwise OR of the char at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void orChar(int memPtr, char value, int count); - - /** - * Perform a bitwise XOR of the char at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void xorChar(int memPtr, char value, int count); - - /** - * Sets multiple 16-bit unsigned chars at the given memory address - * - * @param src - * @param srcOfs - * @param dstPtr - * @param length - */ - public abstract void setChars(char[] src, int srcOfs, int dstPtr, int length); - - /** - * Sets a short at a given memory address - * - * @param memPtr - * @param value - */ - public abstract void setShort(int memPtr, short value); - - /** - * Sets a short at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setShort(int memPtr, short value, int count); - - /** - * Perform a bitwise AND of the short at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void andShort(int memPtr, short value, int count); - - /** - * Perform a bitwise OR of the short at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void orShort(int memPtr, short value, int count); - - /** - * Perform a bitwise XOR of the short at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void xorShort(int memPtr, short value, int count); - - /** - * Sets multiple 16-bit signed shorts at the given memory address - * - * @param src - * @param srcOfs - * @param dstPtr - * @param length - */ - public abstract void setShorts(short[] src, int srcOfs, int dstPtr, int length); - - /** - * Sets an int at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setInt24(int memPtr, int value, int count); - - /** - * Perform a bitwise AND of the int at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * @param memPtr - * @param value - * @param count - */ - //public abstract void andInt24(int memPtr, int value, int count); - - /** - * Perform a bitwise OR of the int at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * @param memPtr - * @param value - * @param count - */ - //public abstract void orInt24(int memPtr, int value, int count); - - /** - * Perform a bitwise XOR of the int at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void xorInt24(int memPtr, int value, int count); - - /** - * Sets an int at a given memory address - * - * @param memPtr - * @param value - */ - @KernelSpace - @Uninterruptible - public abstract void setInt(int memPtr, int value); - - /** - * Sets an int at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setInt(int memPtr, int value, int count); - - /** - * Perform a bitwise AND of the int at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void andInt(int memPtr, int value, int count); - - /** - * Perform a bitwise OR of the int at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void orInt(int memPtr, int value, int count); - - /** - * Perform a bitwise XOR of the int at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void xorInt(int memPtr, int value, int count); - - /** - * Sets multiple 32-bit signed ints at the given memory address - * - * @param src - * @param srcOfs - * @param dstPtr - * @param length - */ - public abstract void setInts(int[] src, int srcOfs, int dstPtr, int length); - - /** - * Sets a float at a given memory address - * - * @param memPtr - * @param value - */ - public abstract void setFloat(int memPtr, float value); - - /** - * Sets a float at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setFloat(int memPtr, float value, int count); - - /** - * Sets multiple 32-bit floats at the given memory address - * - * @param src - * @param srcOfs - * @param dstPtr - * @param length - */ - public abstract void setFloats(float[] src, int srcOfs, int dstPtr, int length); - - /** - * Sets a long at a given memory address - * - * @param memPtr - * @param value - */ - public abstract void setLong(int memPtr, long value); - - /** - * Sets a long at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setLong(int memPtr, long value, int count); - - /** - * Perform a bitwise AND of the long at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void andLong(int memPtr, long value, int count); - - /** - * Perform a bitwise OR of the long at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void orLong(int memPtr, long value, int count); - - /** - * Perform a bitwise XOR of the long at the given address and the given value. - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void xorLong(int memPtr, long value, int count); - - /** - * Sets multiple 64-bit signed longs at the given memory address - * - * @param src - * @param srcOfs - * @param dstPtr - * @param length - */ - public abstract void setLongs(long[] src, int srcOfs, int dstPtr, int length); - - /** - * Sets a double at a given memory address - * - * @param memPtr - * @param value - */ - public abstract void setDouble(int memPtr, double value); - - /** - * Sets a double at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setDouble(int memPtr, double value, int count); - - /** - * Sets multiple 64-bit doubles at the given memory address - * - * @param src - * @param srcOfs - * @param dstPtr - * @param length - */ - public abstract void setDoubles(double[] src, int srcOfs, int dstPtr, int length); - - /** - * Sets a Object at a given memory address - * - * @param memPtr - * @param value - */ - public abstract void setObject(int memPtr, Object value); - - /** - * Sets a Object at a given memory address - * While count is greater then 1, the address is incremented and the process repeats. - * - * @param memPtr - * @param value - * @param count - */ - public abstract void setObject(int memPtr, Object value, int count); - - /** - * Fill the memory at the given memory address with size times 0 bytes. - * <p/> - * memPtr must be VmObject.SLOT_SIZE aligned - * <p/> - * size % VmObject.SLOT_SIZE must be 0 - * - * @param memPtr - * @param size - */ - public abstract void clear(int memPtr, int size); - - public abstract void copy(int srcMemPtr, int destMemPtr, int size); - - /** - * Returns the size of this buffer in bytes. - * - * @return int - */ - public abstract Extent getSize(); - - /** - * Gets the address of the first byte of this buffer - * - * @return The address of the first byte of this buffer - */ - public abstract Address getAddress(); - - /** - * Get a memory resource for a portion of this memory resources. - * The first area of this memory resource that fits the given size - * and it not claimed by any child resource is returned. - * If not large enought area if found, a ResourceNotFreeException is thrown. - * A child resource is always releases when the parent is released. - * A child resource can be released without releasing the parent. - * - * @param size Length of the returned resource in bytes. - * @param align Align of this boundary. Align must be a multiple of 2. - * @return the child memory resource - */ - public abstract MemoryResource claimChildResource(Extent size, int align) - throws IndexOutOfBoundsException, ResourceNotFreeException; - - /** - * Get a memory resource for a portion of this memory resources. - * The first area of this memory resource that fits the given size - * and it not claimed by any child resource is returned. - * If not large enought area if found, a ResourceNotFreeException is thrown. - * A child resource is always releases when the parent is released. - * A child resource can be released without releasing the parent. - * - * @param size Length of the returned resource in bytes. - * @param align Align of this boundary. Align must be a multiple of 2. - * @return the child memory resource - */ - public MemoryResource claimChildResource(int size, int align) - throws IndexOutOfBoundsException, ResourceNotFreeException; - - /** - * Get a memory resource for a portion of this memory resources. - * A child resource is always releases when the parent is released. - * A child resource can be released without releasing the parent. - * - * @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 the child memory resource - */ - public abstract MemoryResource claimChildResource(Offset offset, Extent size, boolean allowOverlaps) - throws IndexOutOfBoundsException, ResourceNotFreeException; - - /** - * Get a memory resource for a portion of this memory resources. - * A child resource is always releases when the parent is released. - * A child resource can be released without releasing the parent. - * - * @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 the child memory resource - */ - public abstract MemoryResource claimChildResource(int offset, int size, boolean allowOverlaps) - throws IndexOutOfBoundsException, ResourceNotFreeException; - - - /** - * Gets a multi media memory resource wrapping this given memory resource. - * - * @return The created instance. This will never be null. - */ - public abstract MultiMediaMemoryResource asMultiMediaMemoryResource(); - - /** - * Gets the offset relative to my parent. - * If this resource has no parent, the address of this buffer is returned. - */ - public abstract Offset getOffset(); -} - Deleted: trunk/core/src/core/org/jnode/system/MemoryScanner.java =================================================================== --- trunk/core/src/core/org/jnode/system/MemoryScanner.java 2010-05-16 16:51:58 UTC (rev 5752) +++ trunk/core/src/core/org/jnode/system/MemoryScanner.java 2010-05-16 17:00:38 UTC (rev 5753) @@ -1,161 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ... [truncated message content] |
From: <fd...@us...> - 2010-05-16 17:01:17
|
Revision: 5754 http://jnode.svn.sourceforge.net/jnode/?rev=5754&view=rev Author: fduminy Date: 2010-05-16 17:01:11 +0000 (Sun, 16 May 2010) Log Message: ----------- extracted org.jnode.plugin packages from org.jnode.runtime.core by adding 2 new plugins : - org.jnode.plugin for the API - org.jnode.plugin.impl for its implementation Signed-off-by: Fabien DUMINY <fab...@we...> Modified Paths: -------------- trunk/all/conf/system-plugin-list.xml trunk/core/descriptors/org.jnode.runtime.core.xml Added Paths: ----------- trunk/core/descriptors/org.jnode.plugin.impl.xml trunk/core/descriptors/org.jnode.plugin.xml Modified: trunk/all/conf/system-plugin-list.xml =================================================================== --- trunk/all/conf/system-plugin-list.xml 2010-05-16 17:00:38 UTC (rev 5753) +++ trunk/all/conf/system-plugin-list.xml 2010-05-16 17:01:11 UTC (rev 5754) @@ -12,9 +12,12 @@ <plugin id="rt.vm"/> <plugin id="org.jnode.permission"/> + <plugin id="org.jnode.plugin"/> + <plugin id="org.jnode.plugin.impl"/> <plugin id="org.jnode.runtime"/> <plugin id="org.jnode.runtime.core"/> <plugin id="org.jnode.runtime.core.bootlog"/> + <plugin id="org.jnode.runtime.core.resource"/> <plugin id="org.jnode.security"/> <plugin id="org.jnode.util"/> <plugin id="org.jnode.vm"/> Copied: trunk/core/descriptors/org.jnode.plugin.impl.xml (from rev 5753, trunk/core/descriptors/org.jnode.runtime.core.xml) =================================================================== --- trunk/core/descriptors/org.jnode.plugin.impl.xml (rev 0) +++ trunk/core/descriptors/org.jnode.plugin.impl.xml 2010-05-16 17:01:11 UTC (rev 5754) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<plugin id="org.jnode.plugin.impl" + name="implementation of JNode plugin framework" + version="@VERSION@" + system="true" + license-name="lgpl" + provider-name="JNode.org"> + + <requires> + <import plugin="nanoxml"/> + <import plugin="org.jnode.plugin"/> + <import plugin="org.jnode.security"/> + <import plugin="org.jnode.util"/> + <import plugin="org.jnode.vm"/> + </requires> + + <runtime> + <library name="jnode-core.jar"> + <export name="org.jnode.plugin.manager.*"/> + <export name="org.jnode.plugin.model.*"/> + </library> + </runtime> + +</plugin> \ No newline at end of file Added: trunk/core/descriptors/org.jnode.plugin.xml =================================================================== --- trunk/core/descriptors/org.jnode.plugin.xml (rev 0) +++ trunk/core/descriptors/org.jnode.plugin.xml 2010-05-16 17:01:11 UTC (rev 5754) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<plugin id="org.jnode.plugin" + name="API of JNode plugin framework" + version="@VERSION@" + system="true" + license-name="lgpl" + provider-name="JNode.org"> + + <requires> + <import plugin="org.jnode.vm.core"/> + </requires> + + <runtime> + <library name="jnode-core.jar"> + <export name="org.jnode.plugin.*"/> + </library> + </runtime> + +</plugin> \ No newline at end of file Modified: trunk/core/descriptors/org.jnode.runtime.core.xml =================================================================== --- trunk/core/descriptors/org.jnode.runtime.core.xml 2010-05-16 17:00:38 UTC (rev 5753) +++ trunk/core/descriptors/org.jnode.runtime.core.xml 2010-05-16 17:01:11 UTC (rev 5754) @@ -10,6 +10,8 @@ <requires> <import plugin="nanoxml"/> + <import plugin="org.jnode.plugin"/> + <import plugin="org.jnode.plugin.impl"/> <import plugin="org.jnode.util"/> <import plugin="org.jnode.security"/> <import plugin="org.jnode.vm"/> @@ -19,9 +21,6 @@ <library name="jnode-core.jar"> <export name="org.jnode.boot.*"/> <export name="org.jnode.naming.*"/> - <export name="org.jnode.plugin.*"/> - <export name="org.jnode.plugin.manager.*"/> - <export name="org.jnode.plugin.model.*"/> <export name="org.jnode.protocol.plugin.*"/> <export name="org.jnode.protocol.system.*"/> <export name="org.jnode.system.event.*"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2010-07-11 14:27:47
|
Revision: 5756 http://jnode.svn.sourceforge.net/jnode/?rev=5756&view=rev Author: fduminy Date: 2010-07-11 14:27:38 +0000 (Sun, 11 Jul 2010) Log Message: ----------- Merge git://gitorious.org/~fduminy/jnode/maven into HEAD Conflicts: builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java builder/src/builder/org/jnode/build/ObjectEmitter.java core/src/classpath/vm/java/lang/ThreadHelper.java core/src/core/org/jnode/assembler/x86/X86Register.java core/src/core/org/jnode/plugin/model/PluginJar.java core/src/core/org/jnode/plugin/model/PluginRegistryModel.java core/src/core/org/jnode/system/IRQResource.java core/src/core/org/jnode/system/resource/IRQResource.java core/src/core/org/jnode/vm/BaseVmArchitecture.java core/src/core/org/jnode/vm/BootLogImpl.java core/src/core/org/jnode/vm/InternString.java core/src/core/org/jnode/vm/MemoryBlockManager.java core/src/core/org/jnode/vm/Unsafe.java core/src/core/org/jnode/vm/VmImpl.java core/src/core/org/jnode/vm/bytecode/BasicBlock.java core/src/core/org/jnode/vm/classmgr/ClassDecoder.java core/src/core/org/jnode/vm/classmgr/SelectorMap.java core/src/core/org/jnode/vm/classmgr/VmType.java core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java core/src/core/org/jnode/vm/isolate/VmIsolate.java core/src/core/org/jnode/vm/objects/VmSystemObject.java core/src/core/org/jnode/vm/scheduler/IRQManager.java core/src/core/org/jnode/vm/x86/VmX86Architecture.java core/src/core/org/jnode/vm/x86/VmX86Processor.java core/src/core/org/jnode/vm/x86/VmX86Processor32.java core/src/core/org/jnode/vm/x86/VmX86Processor64.java core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java core/src/mmtk-vm/org/mmtk/vm/Assert.java Modified Paths: -------------- trunk/builder/src/builder/org/jnode/ant/taskdefs/NativeCheckTask.java trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java trunk/builder/src/builder/org/jnode/build/x86/AsmConstBuilder.java trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java trunk/cli/src/commands/org/jnode/command/system/GcCommand.java trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java trunk/cli/src/commands/org/jnode/command/system/VmInfoCommand.java trunk/core/descriptors/org.jnode.vm.core.xml trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java trunk/core/src/classpath/vm/java/lang/ThreadHelper.java trunk/core/src/classpath/vm/java/lang/VMRuntime.java trunk/core/src/classpath/vm/java/lang/VMSystem.java trunk/core/src/core/org/jnode/assembler/ObjectResolver.java trunk/core/src/core/org/jnode/assembler/x86/X86Register.java trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java trunk/core/src/core/org/jnode/plugin/PluginClassLoader.java trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java trunk/core/src/core/org/jnode/plugin/model/AbstractModelObject.java trunk/core/src/core/org/jnode/plugin/model/AttributeModel.java trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java trunk/core/src/core/org/jnode/plugin/model/PluginJar.java trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java trunk/core/src/core/org/jnode/vm/AllocationBitmap.java trunk/core/src/core/org/jnode/vm/BootLogImpl.java trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java trunk/core/src/core/org/jnode/vm/InternString.java trunk/core/src/core/org/jnode/vm/LoadCompileService.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/SoftByteCodes.java trunk/core/src/core/org/jnode/vm/Unsafe.java trunk/core/src/core/org/jnode/vm/VmAddress.java trunk/core/src/core/org/jnode/vm/VmJavaClassLoader.java trunk/core/src/core/org/jnode/vm/VmReflection.java trunk/core/src/core/org/jnode/vm/VmStackFrame.java trunk/core/src/core/org/jnode/vm/VmStackReader.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java trunk/core/src/core/org/jnode/vm/classmgr/AbstractCode.java trunk/core/src/core/org/jnode/vm/classmgr/AbstractExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/CompiledCodeList.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.java trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java trunk/core/src/core/org/jnode/vm/classmgr/Signature.java trunk/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java trunk/core/src/core/org/jnode/vm/classmgr/VmArray.java trunk/core/src/core/org/jnode/vm/classmgr/VmByteCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmCP.java trunk/core/src/core/org/jnode/vm/classmgr/VmClassLoader.java trunk/core/src/core/org/jnode/vm/classmgr/VmClassType.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmExceptions.java trunk/core/src/core/org/jnode/vm/classmgr/VmField.java trunk/core/src/core/org/jnode/vm/classmgr/VmImplementedInterface.java trunk/core/src/core/org/jnode/vm/classmgr/VmIsolatedStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmLineNumberMap.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariable.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariableTable.java trunk/core/src/core/org/jnode/vm/classmgr/VmMember.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethodCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmSharedStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsBase.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/compiler/CompiledIMT.java trunk/core/src/core/org/jnode/vm/compiler/CompiledMethod.java trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolateLocal.java trunk/core/src/core/org/jnode/vm/memmgr/HeapHelper.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefGCStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultWriteBarrier.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCMarkVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSetWhiteVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCStack.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSweepVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCVerifyVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/HeapStatisticsVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmAbstractHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmBootHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmDefaultHeap.java trunk/core/src/core/org/jnode/vm/objects/BootableArrayList.java trunk/core/src/core/org/jnode/vm/objects/BootableHashMap.java trunk/core/src/core/org/jnode/vm/objects/Statistic.java trunk/core/src/core/org/jnode/vm/scheduler/IRQManager.java trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.java trunk/core/src/core/org/jnode/vm/scheduler/SpinLock.java trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java trunk/core/src/core/org/jnode/vm/scheduler/VmScheduler.java trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueue.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueueEntry.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture64.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor64.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java trunk/core/src/core/org/jnode/vm/x86/X86MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86StackFrame.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiDriver.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkGCStatistics.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/genrc/HeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/ms/HeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/nogc/HeapManager.java trunk/core/src/mmtk-vm/org/mmtk/vm/Assert.java trunk/core/src/mmtk-vm/org/mmtk/vm/Memory.java trunk/core/src/mmtk-vm/org/mmtk/vm/Scanning.java trunk/core/src/mmtk-vm/org/mmtk/vm/Strings.java trunk/core/src/mmtk-vm/org/mmtk/vm/VMConstants.java trunk/core/src/openjdk/vm/java/lang/NativeRuntime.java trunk/core/src/openjdk/vm/java/lang/reflect/NativeArray.java trunk/core/src/openjdk/vm/sun/management/NativeThreadImpl.java trunk/core/src/openjdk/vm/sun/management/NativeVMManagementImpl.java trunk/core/src/openjdk/vm/sun/misc/NativeUnsafe.java trunk/core/src/test/org/jnode/test/ResolverTest.java trunk/core/src/test/org/jnode/test/core/CompilerTest.java trunk/core/src/test/org/jnode/test/core/IMTCompilerTest.java trunk/core/src/test/org/jnode/test/core/StackView.java trunk/core/src/vmmagic/org/vmmagic/unboxed/MagicUtils.java trunk/gui/src/awt/org/jnode/awt/font/renderer/SummedAreaTable.java trunk/gui/src/awt/org/jnode/awt/font/spi/AbstractTextRenderer.java trunk/gui/src/awt/org/jnode/awt/util/BasicSurfaceGraphics.java trunk/gui/src/desktop/org/jnode/desktop/Desktop.java trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java trunk/gui/src/driver/org/jnode/driver/video/vga/VGADriver.java Added Paths: ----------- trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java trunk/core/src/core/org/jnode/vm/VmImpl.java trunk/core/src/core/org/jnode/vm/classmgr/Mangler.java trunk/core/src/core/org/jnode/vm/facade/ trunk/core/src/core/org/jnode/vm/facade/GCStatistics.java trunk/core/src/core/org/jnode/vm/facade/HeapStatistics.java trunk/core/src/core/org/jnode/vm/facade/MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/facade/ObjectVisitor.java trunk/core/src/core/org/jnode/vm/facade/TypeSizeInfo.java trunk/core/src/core/org/jnode/vm/facade/Vm.java trunk/core/src/core/org/jnode/vm/facade/VmArchitecture.java trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java trunk/core/src/core/org/jnode/vm/facade/VmProcessor.java trunk/core/src/core/org/jnode/vm/facade/VmThread.java trunk/core/src/core/org/jnode/vm/facade/VmThreadVisitor.java trunk/core/src/core/org/jnode/vm/facade/VmUtils.java trunk/core/src/core/org/jnode/vm/facade/VmWriteBarrier.java trunk/core/src/core/org/jnode/vm/objects/BootableObject.java trunk/core/src/core/org/jnode/vm/objects/VmSystemObject.java Removed Paths: ------------- trunk/core/src/core/org/jnode/vm/BootableObject.java trunk/core/src/core/org/jnode/vm/MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/ObjectVisitor.java trunk/core/src/core/org/jnode/vm/Vm.java trunk/core/src/core/org/jnode/vm/VmArchitecture.java trunk/core/src/core/org/jnode/vm/VmSystemObject.java trunk/core/src/core/org/jnode/vm/VmUtils.java trunk/core/src/core/org/jnode/vm/classmgr/TypeSizeInfo.java trunk/core/src/core/org/jnode/vm/memmgr/GCStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/HeapStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/VmWriteBarrier.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadVisitor.java Property Changed: ---------------- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RefItem.java Modified: trunk/builder/src/builder/org/jnode/ant/taskdefs/NativeCheckTask.java =================================================================== --- trunk/builder/src/builder/org/jnode/ant/taskdefs/NativeCheckTask.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/builder/src/builder/org/jnode/ant/taskdefs/NativeCheckTask.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -30,8 +30,9 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; + import org.apache.tools.ant.BuildException; -import org.jnode.vm.VmUtils; +import org.jnode.vm.facade.VmUtils; import org.objectweb.asm.Attribute; import org.objectweb.asm.ClassAdapter; import org.objectweb.asm.ClassReader; Modified: trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -30,13 +30,15 @@ import java.net.URL; import java.util.ArrayList; import java.util.Date; -import org.jnode.vm.Vm; -import org.jnode.vm.VmArchitecture; + +import org.jnode.vm.BaseVmArchitecture; +import org.jnode.vm.VmImpl; import org.jnode.vm.VmSystemClassLoader; import org.jnode.vm.classmgr.VmField; import org.jnode.vm.classmgr.VmInstanceField; import org.jnode.vm.classmgr.VmNormalClass; import org.jnode.vm.classmgr.VmType; +import org.jnode.vm.facade.Vm; /** * TODO describe the class. @@ -75,14 +77,14 @@ private void doExecute() throws BuildException, ClassNotFoundException, IllegalAccessException, IOException, InstantiationException { - final VmArchitecture arch = getArchitecture(); + final BaseVmArchitecture arch = getArchitecture(); String[] urls = classesURL.split(","); URL[] urla = new URL[urls.length]; for (int i = 0; i < urls.length; i++) urla[i] = new URL(urls[i].trim()); final VmSystemClassLoader cl = new VmSystemClassLoader(urla, arch); - final Vm vm = new Vm("?", arch, cl.getSharedStatics(), false, cl, null); + final Vm vm = new VmImpl("?", arch, cl.getSharedStatics(), false, cl, null); vm.toString(); // Just to avoid compiler warnings VmType.initializeForBootImage(cl); long lastModified = 0; @@ -249,5 +251,5 @@ this.classesURL = classesURL; } - protected abstract VmArchitecture getArchitecture(); + protected abstract BaseVmArchitecture getArchitecture(); } Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -60,13 +60,12 @@ import org.jnode.plugin.model.PluginJar; import org.jnode.plugin.model.PluginRegistryModel; import org.jnode.util.NumberUtils; +import org.jnode.vm.BaseVmArchitecture; import org.jnode.vm.JvmType; import org.jnode.vm.Unsafe; import org.jnode.vm.VirtualMemoryRegion; -import org.jnode.vm.Vm; -import org.jnode.vm.VmArchitecture; +import org.jnode.vm.VmImpl; import org.jnode.vm.VmSystemClassLoader; -import org.jnode.vm.VmSystemObject; import org.jnode.vm.bytecode.BytecodeParser; import org.jnode.vm.classmgr.Modifier; import org.jnode.vm.classmgr.ObjectLayout; @@ -83,9 +82,13 @@ import org.jnode.vm.classmgr.VmStatics; import org.jnode.vm.classmgr.VmType; import org.jnode.vm.compiler.NativeCodeCompiler; +import org.jnode.vm.facade.Vm; +import org.jnode.vm.facade.VmArchitecture; +import org.jnode.vm.facade.VmUtils; import org.jnode.vm.memmgr.HeapHelper; import org.jnode.vm.memmgr.VmHeapManager; import org.jnode.vm.objects.BootableHashMap; +import org.jnode.vm.objects.VmSystemObject; import org.jnode.vm.scheduler.VmProcessor; import org.vmmagic.unboxed.UnboxedObject; @@ -206,7 +209,7 @@ * @param arch * @throws ClassNotFoundException */ - private final void compileClasses(NativeStream os, VmArchitecture arch) + private final void compileClasses(NativeStream os, BaseVmArchitecture arch) throws ClassNotFoundException { final NativeCodeCompiler[] compilers = arch.getCompilers(); final int optLevel = compilers.length - 1; @@ -389,7 +392,7 @@ * @return The processor * @throws BuildException */ - protected abstract VmProcessor createProcessor(Vm vm, VmSharedStatics statics, + protected abstract VmProcessor createProcessor(VmImpl vm, VmSharedStatics statics, VmIsolatedStatics isolatedStatics) throws BuildException; private final void doExecute() throws BuildException { @@ -448,7 +451,7 @@ final Map<String, byte[]> resources = loadSystemResource(piRegistry); /* Now create the processor */ - final VmArchitecture arch = getArchitecture(); + final BaseVmArchitecture arch = getArchitecture(); final NativeStream os = createNativeStream(); clsMgr = new VmSystemClassLoader(null/*classesURL*/, arch, new BuildObjectResolver(os, this)); @@ -468,9 +471,9 @@ } // Create the VM - final Vm vm = new Vm(version, arch, clsMgr.getSharedStatics(), debug, clsMgr, piRegistry); + final VmImpl vm = new VmImpl(version, arch, clsMgr.getSharedStatics(), debug, clsMgr, piRegistry); blockedObjects.add(vm); - blockedObjects.add(Vm.getCompiledMethods()); + blockedObjects.add(VmUtils.getVm().getCompiledMethods()); final VmProcessor proc = createProcessor(vm, clsMgr.getSharedStatics(), clsMgr.getIsolatedStatics()); @@ -504,14 +507,14 @@ loadClass(VmType[].class); loadClass(Vm.class); loadClass(VirtualMemoryRegion.class).link(); - Vm.getHeapManager().loadClasses(clsMgr); + vm.getHeapManager().loadClasses(clsMgr); loadClass(VmHeapManager.class); loadClass(VmSharedStatics.class); loadClass(VmIsolatedStatics.class); - loadClass(Vm.getHeapManager().getClass()); + loadClass(VmUtils.getVm().getHeapManager().getClass()); loadClass(HeapHelper.class); loadClass("org.jnode.vm.HeapHelperImpl"); - loadClass(Vm.getCompiledMethods().getClass()); + loadClass(VmUtils.getVm().getCompiledMethods().getClass()); loadClass(VmCompiledCode[].class); loadSystemClasses(resources.keySet()); @@ -558,8 +561,8 @@ // Emit the compiled method list log("Emit compiled methods", Project.MSG_VERBOSE); - blockedObjects.remove(Vm.getCompiledMethods()); - final int compiledMethods = Vm.getCompiledMethods().size(); + blockedObjects.remove(VmUtils.getVm().getCompiledMethods()); + final int compiledMethods = VmUtils.getVm().getCompiledMethods().size(); emitObjects(os, arch, blockedObjects, false); // Twice, this is intended! emitObjects(os, arch, blockedObjects, false); @@ -595,7 +598,7 @@ // Verify no methods have been compiled after we wrote the // CompiledCodeList. - if (Vm.getCompiledMethods().size() != compiledMethods) { + if (VmUtils.getVm().getCompiledMethods().size() != compiledMethods) { throw new BuildException( "Method have been compiled after CompiledCodeList was written."); } @@ -638,7 +641,7 @@ clsMgr.getSharedStatics().dumpStatistics(out); log("Isolated statics"); clsMgr.getIsolatedStatics().dumpStatistics(out); - vm.dumpStatistics(out); + VmUtils.dumpStatistics(out); logStatistics(os); @@ -670,7 +673,7 @@ * @param blockObjects * @throws BuildException */ - private final void emitObjects(NativeStream os, VmArchitecture arch, + private final void emitObjects(NativeStream os, BaseVmArchitecture arch, Set<Object> blockObjects, boolean skipCopyStatics) throws BuildException { log("Emitting objects", Project.MSG_DEBUG); @@ -883,7 +886,7 @@ * @return The target architecture * @throws BuildException */ - protected abstract VmArchitecture getArchitecture() throws BuildException; + protected abstract BaseVmArchitecture getArchitecture() throws BuildException; /** * Gets the internal class loader. @@ -1458,6 +1461,7 @@ addCompileHighOptLevel("org.jnode.vm.bytecode"); addCompileHighOptLevel("org.jnode.vm.classmgr"); addCompileHighOptLevel("org.jnode.vm.compiler"); + addCompileHighOptLevel("org.jnode.vm.facade"); addCompileHighOptLevel("org.jnode.vm.isolate"); addCompileHighOptLevel("org.jnode.vm.objects"); addCompileHighOptLevel("org.jnode.vm.scheduler"); Modified: trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -32,8 +32,6 @@ import org.jnode.assembler.NativeStream; import org.jnode.assembler.x86.X86BinaryAssembler; import org.jnode.bootlog.BootLogInstance; -import org.jnode.vm.BootableObject; -import org.jnode.vm.VmSystemObject; import org.jnode.vm.classmgr.VmArrayClass; import org.jnode.vm.classmgr.VmClassLoader; import org.jnode.vm.classmgr.VmClassType; @@ -41,6 +39,8 @@ import org.jnode.vm.classmgr.VmInstanceField; import org.jnode.vm.classmgr.VmNormalClass; import org.jnode.vm.classmgr.VmType; +import org.jnode.vm.objects.BootableObject; +import org.jnode.vm.objects.VmSystemObject; import org.vmmagic.unboxed.UnboxedObject; public class ObjectEmitter { Modified: trunk/builder/src/builder/org/jnode/build/x86/AsmConstBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/x86/AsmConstBuilder.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/builder/src/builder/org/jnode/build/x86/AsmConstBuilder.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -21,7 +21,7 @@ package org.jnode.build.x86; import org.jnode.build.AbstractAsmConstBuilder; -import org.jnode.vm.VmArchitecture; +import org.jnode.vm.BaseVmArchitecture; import org.jnode.vm.x86.VmX86Architecture32; import org.jnode.vm.x86.VmX86Architecture64; @@ -32,9 +32,9 @@ private int bits = 32; - private VmArchitecture arch; + private BaseVmArchitecture arch; - protected VmArchitecture getArchitecture() { + protected BaseVmArchitecture getArchitecture() { if (arch == null) { switch (bits) { case 32: Modified: trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -43,11 +43,10 @@ import org.jnode.linker.ElfLinker; import org.jnode.plugin.PluginRegistry; import org.jnode.util.NumberUtils; +import org.jnode.vm.BaseVmArchitecture; import org.jnode.vm.SoftByteCodes; -import org.jnode.vm.Vm; -import org.jnode.vm.VmArchitecture; +import org.jnode.vm.VmImpl; import org.jnode.vm.VmSystem; -import org.jnode.vm.VmSystemObject; import org.jnode.vm.classmgr.ObjectLayout; import org.jnode.vm.classmgr.VmArray; import org.jnode.vm.classmgr.VmClassType; @@ -58,6 +57,9 @@ import org.jnode.vm.classmgr.VmSharedStatics; import org.jnode.vm.classmgr.VmStaticField; import org.jnode.vm.classmgr.VmType; +import org.jnode.vm.facade.Vm; +import org.jnode.vm.facade.VmUtils; +import org.jnode.vm.objects.VmSystemObject; import org.jnode.vm.scheduler.MonitorManager; import org.jnode.vm.scheduler.VmProcessor; import org.jnode.vm.scheduler.VmScheduler; @@ -155,7 +157,7 @@ * @return The processor * @throws BuildException */ - protected VmProcessor createProcessor(Vm vm, VmSharedStatics statics, VmIsolatedStatics isolatedStatics) + protected VmProcessor createProcessor(VmImpl vm, VmSharedStatics statics, VmIsolatedStatics isolatedStatics) throws BuildException { this.sharedStatics = statics; VmScheduler scheduler = new VmScheduler(getArchitecture()); @@ -185,7 +187,7 @@ * @return The target architecture * @throws BuildException */ - protected final VmArchitecture getArchitecture() throws BuildException { + protected final BaseVmArchitecture getArchitecture() throws BuildException { if (arch == null) { switch (bits) { case 32: @@ -483,8 +485,8 @@ protected void initVm(X86BinaryAssembler os, Vm vm) throws BuildException, ClassNotFoundException { os.setObjectRef(new Label("$$Initialize Vm")); - VmType<?> vmClass = loadClass(Vm.class); - VmStaticField vmField = (VmStaticField) vmClass.getField("instance"); + VmType<?> vmClass = loadClass(VmUtils.class); + VmStaticField vmField = (VmStaticField) vmClass.getField("VM_INSTANCE"); final GPR abx = os.isCode32() ? (GPR) X86Register.EBX : X86Register.RBX; final GPR adi = os.isCode32() ? (GPR) X86Register.EDI : X86Register.RDI; Modified: trunk/cli/src/commands/org/jnode/command/system/GcCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/GcCommand.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/cli/src/commands/org/jnode/command/system/GcCommand.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -27,8 +27,9 @@ import org.jnode.shell.syntax.EnumArgument; import org.jnode.shell.syntax.FlagArgument; import org.jnode.util.NumberUtils; -import org.jnode.vm.Vm; -import org.jnode.vm.memmgr.GCStatistics; +import org.jnode.vm.VmImpl; +import org.jnode.vm.facade.GCStatistics; +import org.jnode.vm.facade.VmUtils; import org.jnode.vm.memmgr.VmHeapManager; /** @@ -100,12 +101,12 @@ public void execute() throws Exception { final PrintWriter out = getOutput().getPrintWriter(); if (argSet.isSet()) { - Vm.getHeapManager().setHeapFlags(getFlags()); + VmUtils.getVm().getHeapManager().setHeapFlags(getFlags()); } else if (argClear.isSet()) { - int flags = Vm.getHeapManager().getHeapFlags() ^ getFlags(); - Vm.getHeapManager().setHeapFlags(flags); + int flags = VmUtils.getVm().getHeapManager().getHeapFlags() ^ getFlags(); + VmUtils.getVm().getHeapManager().setHeapFlags(flags); } else if (argShow.isSet()) { - showFlags(Vm.getHeapManager().getHeapFlags(), out); + showFlags(VmUtils.getVm().getHeapManager().getHeapFlags(), out); } else { final Runtime rt = Runtime.getRuntime(); out.format(fmt_out, str_mem_size, NumberUtils.toBinaryByte(rt.totalMemory())); @@ -114,7 +115,7 @@ out.println(str_start); long start = System.currentTimeMillis(); rt.gc(); - GCStatistics stats = Vm.getHeapManager().getStatistics(); + GCStatistics stats = VmUtils.getVm().getHeapManager().getStatistics(); Thread.yield(); long end = System.currentTimeMillis(); Modified: trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -27,8 +27,9 @@ import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.IntegerArgument; import org.jnode.shell.syntax.LongArgument; -import org.jnode.vm.Vm; -import org.jnode.vm.memmgr.HeapStatistics; +import org.jnode.vm.VmImpl; +import org.jnode.vm.facade.HeapStatistics; +import org.jnode.vm.facade.VmUtils; /** * @author Martin Husted Hartvig (ha...@jn...) @@ -61,7 +62,7 @@ public void execute() throws Exception { PrintWriter out = getOutput().getPrintWriter(); out.println(str_on_heap); - final HeapStatistics stats = Vm.getHeapManager().getHeapStatistics(); + final HeapStatistics stats = VmUtils.getVm().getHeapManager().getHeapStatistics(); if (argMinInstanceCount.isSet()) { stats.setMinimumInstanceCount(argMinInstanceCount.getValue()); Modified: trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -46,7 +46,7 @@ import org.jnode.shell.syntax.StringArgument; import org.jnode.shell.syntax.SyntaxMultiplicityException; import org.jnode.shell.syntax.URLArgument; -import org.jnode.vm.Vm; +import org.jnode.vm.facade.VmUtils; /** * @author epr @@ -120,7 +120,7 @@ private void doRun() throws NameNotFoundException, SyntaxMultiplicityException, PluginException, MalformedURLException { mgr = InitialNaming.lookup(PluginManager.NAME); - final String version = argVersion.isSet() ? argVersion.getValue() : Vm.getVm().getVersion(); + final String version = argVersion.isSet() ? argVersion.getValue() : VmUtils.getVm().getVersion(); final String pluginId = argPluginID.getValue(); if (argLoaderUrl.isSet()) { addPluginLoader(argLoaderUrl.getValue()); Modified: trunk/cli/src/commands/org/jnode/command/system/VmInfoCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/VmInfoCommand.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/cli/src/commands/org/jnode/command/system/VmInfoCommand.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -26,8 +26,8 @@ import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FlagArgument; -import org.jnode.vm.Vm; -import org.jnode.vm.scheduler.VmProcessor; +import org.jnode.vm.facade.VmProcessor; +import org.jnode.vm.facade.VmUtils; /** * @author Ewout Prangsma (ep...@us...) @@ -55,13 +55,13 @@ @Override public void execute() { - final Vm vm = Vm.getVm(); + final org.jnode.vm.facade.Vm vm = VmUtils.getVm(); if (vm != null && !vm.isBootstrap()) { PrintWriter out = getOutput().getPrintWriter(); out.format(fmt_vm, vm.getVersion()); - vm.dumpStatistics(out); + VmUtils.dumpStatistics(out); vm.getSharedStatics().dumpStatistics(out); - Vm.getHeapManager().dumpStatistics(out); + VmUtils.getVm().getHeapManager().dumpStatistics(out); final SecurityManager sm = System.getSecurityManager(); out.format(fmt_sm, sm); List<VmProcessor> processors = vm.getProcessors(); @@ -70,7 +70,7 @@ cpu.dumpStatistics(out); } if (argReset.isSet()) { - vm.resetCounters(); + VmUtils.resetCounters(); } } } Modified: trunk/core/descriptors/org.jnode.vm.core.xml =================================================================== --- trunk/core/descriptors/org.jnode.vm.core.xml 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/descriptors/org.jnode.vm.core.xml 2010-07-11 14:27:38 UTC (rev 5756) @@ -23,6 +23,7 @@ <export name="org.jnode.vm.bytecode.*"/> <export name="org.jnode.vm.classmgr.*"/> <export name="org.jnode.vm.compiler.*"/> + <export name="org.jnode.vm.facade.*"/> <export name="org.jnode.vm.isolate.*"/> <export name="org.jnode.vm.memmgr.*"/> <export name="org.jnode.vm.objects.*"/> Modified: trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java =================================================================== --- trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -26,7 +26,8 @@ import java.lang.reflect.Method; import gnu.classpath.jdwp.util.MethodResult; import gnu.classpath.jdwp.event.EventRequest; -import org.jnode.vm.Vm; + +import org.jnode.vm.facade.VmUtils; import org.jnode.vm.isolate.VmIsolate; import org.jnode.vm.classmgr.VmIsolatedStatics; import org.jnode.vm.classmgr.VmStaticsIterator; @@ -71,7 +72,7 @@ */ private static Iterator getAllLoadedClasses() { return new Iterator() { - private VmStaticsIterator iter = new VmStaticsIterator(Vm.getVm().getSharedStatics()); + private VmStaticsIterator iter = new VmStaticsIterator(VmUtils.getVm().getSharedStatics()); private Iterator<VmIsolatedStatics> isolated = VmIsolate.staticsIterator(); public boolean hasNext() { Modified: trunk/core/src/classpath/vm/java/lang/ThreadHelper.java =================================================================== --- trunk/core/src/classpath/vm/java/lang/ThreadHelper.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/classpath/vm/java/lang/ThreadHelper.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -20,10 +20,10 @@ package java.lang; +import org.jnode.annotation.Internal; +import org.jnode.annotation.KernelSpace; import org.jnode.permission.JNodePermission; import org.jnode.vm.scheduler.VmThread; -import org.jnode.annotation.KernelSpace; -import org.jnode.annotation.Internal; /** * Modified: trunk/core/src/classpath/vm/java/lang/VMRuntime.java =================================================================== --- trunk/core/src/classpath/vm/java/lang/VMRuntime.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/classpath/vm/java/lang/VMRuntime.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -23,10 +23,10 @@ import java.io.File; import java.io.IOException; -import org.jnode.vm.Vm; import org.jnode.vm.VmProcess; import org.jnode.vm.VmSystem; import org.jnode.vm.VmExit; +import org.jnode.vm.facade.VmUtils; import org.jnode.vm.isolate.VmIsolate; import javax.isolate.Isolate; @@ -52,7 +52,7 @@ * @return the number of processors available, at least 1 */ static int availableProcessors() { - return Vm.getVm().availableProcessors(); + return VmUtils.getVm().availableProcessors(); } /** Modified: trunk/core/src/classpath/vm/java/lang/VMSystem.java =================================================================== --- trunk/core/src/classpath/vm/java/lang/VMSystem.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/classpath/vm/java/lang/VMSystem.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -44,8 +44,9 @@ import java.util.ArrayList; import org.jnode.util.SystemInputStream; -import org.jnode.vm.Vm; +import org.jnode.vm.VmImpl; import org.jnode.vm.VmSystem; +import org.jnode.vm.facade.VmUtils; /** * VMSystem is a package-private helper class for System that the VM must @@ -112,7 +113,7 @@ * @return true if the system is big-endian. */ static boolean isWordsBigEndian() { - return (Vm.getArch().getByteOrder() == ByteOrder.BIG_ENDIAN); + return (VmUtils.getVm().getArch().getByteOrder() == ByteOrder.BIG_ENDIAN); } /** Modified: trunk/core/src/core/org/jnode/assembler/ObjectResolver.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/ObjectResolver.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/assembler/ObjectResolver.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -20,7 +20,7 @@ package org.jnode.assembler; -import org.jnode.vm.VmSystemObject; +import org.jnode.vm.objects.VmSystemObject; /** * @author epr Modified: trunk/core/src/core/org/jnode/assembler/x86/X86Register.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86Register.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/assembler/x86/X86Register.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -20,8 +20,8 @@ package org.jnode.assembler.x86; -import org.jnode.vm.VmSystemObject; import org.jnode.vm.objects.BootableHashMap; +import org.jnode.vm.objects.VmSystemObject; /** * Registers of the x86 architecture. Modified: trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -85,11 +85,16 @@ // copy each plugin's resource to the plugin root directory final PluginDescriptor desc = AutoUnzipPlugin.this.getDescriptor(); - final PluginClassLoader cl = (PluginClassLoader) desc.getPluginClassLoader(); + final ClassLoader cl = desc.getPluginClassLoader(); final String pluginRoot = pluginRootFile.getAbsolutePath() + "/"; final byte[] buffer = new byte[10240]; - for (String resName : cl.getResources()) { + if (!(cl instanceof PluginClassLoader)) { + System.err.println("Plugin's ClassLoader doesn't implements PluginClassLoader"); + return; + } + + for (String resName : ((PluginClassLoader) cl).getResources()) { final InputStream input = cl.getResourceAsStream(resName); try { Modified: trunk/core/src/core/org/jnode/plugin/PluginClassLoader.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginClassLoader.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/PluginClassLoader.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -23,53 +23,31 @@ import java.util.Collection; import java.util.Set; -import org.jnode.vm.classmgr.VmClassLoader; - /** + * Interface for plugin {@link ClassLoader}s. They should of course also + * inherit from {@link ClassLoader}. * @author Ewout Prangsma (ep...@us...) */ -public abstract class PluginClassLoader extends ClassLoader { +public interface PluginClassLoader { /** - * Default ctor - */ - public PluginClassLoader() { - // No code here - } - - /** - * Wrap this classloader around the given vmClassLoader. - * Requires special permission. - * - * @param parent - * @param vmClassLoader - */ - protected PluginClassLoader(ClassLoader parent, VmClassLoader vmClassLoader) { - super(parent, vmClassLoader); - } - - /** * Gets the descriptor of the plugin in which this element was declared. * * @return The descriptor */ - public abstract PluginDescriptor getDeclaringPluginDescriptor(); + PluginDescriptor getDeclaringPluginDescriptor(); /** * Gets the names of the classes contained in this plugin. * * @return the set of contained classnames */ - public abstract Set<String> getClassNames(); + Set<String> getClassNames(); /** * Gets the names of the resources contained in this plugin. * * @return the set of contained resources */ - public abstract Collection<String> getResources(); - - public String toString() { - return getClass().getName() + "(" + getDeclaringPluginDescriptor().getId() + ")"; - } + Collection<String> getResources(); } Modified: trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -197,6 +197,8 @@ /** * Gets the classloader of this plugin descriptor. + * It's <strong>not mandatory</strong> but the returned {@link ClassLoader} usually + * implements {@link PluginClassLoader}. * * @return ClassLoader */ Modified: trunk/core/src/core/org/jnode/plugin/model/AbstractModelObject.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/AbstractModelObject.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/model/AbstractModelObject.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -22,7 +22,7 @@ import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.PluginException; -import org.jnode.vm.VmSystemObject; +import org.jnode.vm.objects.VmSystemObject; /** * @author epr Modified: trunk/core/src/core/org/jnode/plugin/model/AttributeModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/AttributeModel.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/model/AttributeModel.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -20,7 +20,7 @@ package org.jnode.plugin.model; -import org.jnode.vm.BootableObject; +import org.jnode.vm.objects.BootableObject; /** * @author epr Modified: trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -220,7 +220,7 @@ } /** - * @see org.jnode.vm.VmSystemObject#verifyBeforeEmit() + * @see org.jnode.vm.objects.VmSystemObject#verifyBeforeEmit() */ public void verifyBeforeEmit() { super.verifyBeforeEmit(); Modified: trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -48,7 +48,7 @@ /** * @author Ewout Prangsma (ep...@us...) */ -final class PluginClassLoaderImpl extends PluginClassLoader { +final class PluginClassLoaderImpl extends ClassLoader implements PluginClassLoader { /** * The registry @@ -85,9 +85,14 @@ } /** - * Initialize this instance. - * + * Wrap this {@link ClassLoader} around the given vmClassLoader. + * Requires special permission. + * + * @param vmClassLoader + * @param registry + * @param descr * @param jar + * @param prerequisiteLoaders */ protected PluginClassLoaderImpl(VmClassLoader vmClassLoader, PluginRegistryModel registry, PluginDescriptorModel descr, PluginJar jar, @@ -100,7 +105,7 @@ } /** - * Gets the names of the classes contained in this plugin + * Gets the names of the classes contained in this plugin. * * @return */ @@ -393,4 +398,8 @@ public PluginDescriptor getDeclaringPluginDescriptor() { return descriptor; } + + public String toString() { + return getClass().getName() + "(" + getDeclaringPluginDescriptor().getId() + ")"; + } } Modified: trunk/core/src/core/org/jnode/plugin/model/PluginJar.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginJar.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/model/PluginJar.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -36,10 +36,11 @@ import org.jnode.util.ByteBufferInputStream; import org.jnode.util.FileUtils; import org.jnode.util.JarBuffer; -import org.jnode.vm.BootableObject; import org.jnode.vm.ResourceLoader; -import org.jnode.vm.Vm; +import org.jnode.vm.VmImpl; +import org.jnode.vm.facade.VmUtils; import org.jnode.vm.objects.BootableHashMap; +import org.jnode.vm.objects.BootableObject; /** * @author Ewout Prangsma (ep...@us...) @@ -84,7 +85,7 @@ URL pluginUrl) throws PluginException { try { //get a reference to the plugin jar data - if (Vm.isWritingImage()) { + if (VmUtils.isWritingImage()) { //buildtime initBuffer = pluginIs.array(); } else { Modified: trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -43,9 +43,9 @@ import org.jnode.plugin.PluginReference; import org.jnode.plugin.PluginRegistry; import org.jnode.plugin.PluginSecurityConstants; -import org.jnode.vm.VmSystemObject; import org.jnode.vm.isolate.VmIsolateLocal; import org.jnode.vm.objects.BootableHashMap; +import org.jnode.vm.objects.VmSystemObject; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; Modified: trunk/core/src/core/org/jnode/vm/AllocationBitmap.java =================================================================== --- trunk/core/src/core/org/jnode/vm/AllocationBitmap.java 2010-05-16 17:01:30 UTC (rev 5755) +++ trunk/core/src/core/org/jnode/vm/AllocationBitmap.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -22,6 +22,7 @@ import org.jnode.annotation.MagicPermission; import org.jnode.annotation.Uninterruptible; +import org.jnode.vm.facade.VmUtils; import org.jnode.vm.scheduler.VmThread; import org.vmmagic.unboxed.Address; import org.vmmagic.unboxed.Extent; @@ -91,7 +92,7 @@ */ public final void initialize(Address start, Word bits) { // Size of the lock (we only use an int) - final Extent lockSize = Extent.fromIntZeroExtend(Vm.getArch() + final Extent lockSize = Extent.fromIntZeroExtend(VmUtils.getVm().getArch() .getReferenceSize()); // Create a lock and actual bitmap Copied: trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java (from rev 5755, trunk/core/src/core/org/jnode/vm/VmArchitecture.java) =================================================================== --- trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java 2010-07-11 14:27:38 UTC (rev 5756) @@ -0,0 +1,313 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.vm; + +import java.nio.ByteOrder; + +import org.jnode.annotation.Internal; +import org.jnode.annotation.KernelSpace; +import org.jnode.annotation.MagicPermission; +import org.jnode.permission.JNodePermission; +import org.jnode.system.resource.ResourceManager; +import org.jnode.vm.classmgr.VmIsolatedStatics; +import org.jnode.vm.classmgr.VmSharedStatics; +import org.jnode.vm.compiler.IMTCompiler; +import org.jnode.vm.compiler.NativeCodeCompiler; +import org.jnode.vm.facade.MemoryMapEntry; +import org.jnode.vm.facade.TypeSizeInfo; +import org.jnode.vm.facade.VmUtils; +import org.jnode.vm.objects.VmSystemObject; +import org.jnode.vm.scheduler.IRQManager; +import org.jnode.vm.scheduler.VmProcessor; +import org.jnode.vm.scheduler.VmScheduler; +import org.vmmagic.pragma.UninterruptiblePragma; +import org.vmmagic.unboxed.Address; +import org.vmmagic.unboxed.Extent; +import org.vmmagic.unboxed.Word; + +/** + * Class describing a specific system architecture. + * + * @author Ewout Prangsma (ep...@us...) + */ +@MagicPermission +public abstract class BaseVmArchitecture extends VmSystemObject implements org.jnode.vm.facade.VmArchitecture { + + private final JNodePermission MMAP_PERM = new JNodePermission("getMemoryMap"); + private transient MemoryMapEntry[] memoryMap; + private transient VmMultiMediaSupport multiMediaSupport; + private final int referenceSize; + private final VmStackReader stackReader; + + protected BaseVmArchitecture(int referenceSize, VmStackReader stackReader) { + this.referenceSize = referenceSize; + this.stackReader = stackReader; + } + + /** + * {@inheritDoc} + */ + public abstract String getName(); + + /** + * Gets the full name of this architecture, including operating mode. + * + * @return the architecture's full name + */ + public abstract String getFullName(); + + /** + * {@inheritDoc} + */ + public abstract ByteOrder getByteOrder(); + + /** + * {@inheritDoc} + */ + @KernelSpace + public final int getReferenceSize() { + return referenceSize; + } + + /** + * {@inheritDoc} + */ + public abstract byte getLogPageSize(int region) + throws UninterruptiblePragma; + + /** + * Gets the size in bytes of an OS page in a given region + * + * @param region a {@link VirtualMemoryRegion} value + * @return the page size + */ + public final Extent getPageSize(int region) + throws UninterruptiblePragma { + return Extent.fromIntZeroExtend(1 << getLogPageSize(region)); + } + + /** + * {@inheritDoc} + */ + public abstract TypeSizeInfo getTypeSizeInfo(); + + /** + * Gets the stackreader for this architecture. + * + * @return the architecture's stack reader + */ + @KernelSpace + public final VmStackReader getStackReader() { + return stackReader; + } + + /** + * Gets all compilers for this architecture. + * + * @return The architecture's compilers, sorted by optimization level, from + * least optimizing to most optimizing. + */ + public abstract NativeCodeCompiler[] getCompilers(); + + /** + * Gets all test compilers for this architecture. + * This can be used to test new compilers in a running system. + * + * @return The architecture's test compilers, sorted by optimization level, from + * least optimizing to most optimizing. If there are no configured test compilers, + * {@code null} will be returned. + */ + public abstract NativeCodeCompiler[] getTestCompilers(); + + /** + * Gets the compiler of IMT's. + * + * @return the IMT compiler + */ + public abstract IMTCompiler getIMTCompiler(); + + /** + * Called early on in the boot process (before the initialization of + * the memory manager) to initialize any architecture specific variables. + * Do not allocate memory here. + * + * @param emptyMmap If true, all page mappings in the AVAILABLE region + * are removed. + */ + protected abstract void boot(boolean emptyMmap); + + /** + * Find and start all processors in the system. + * All all discovered processors to the given list. + * The bootstrap processor is already on the given list. + */ + protected abstract void initializeProcessors(ResourceManager rm); + + /** + * Call this method to register a processor found in {@link #initializeProcessors(ResourceManager)}. + * + * @param cpu + */ + protected final void addProcessor(VmProcessor cpu) { + ((VmImpl) VmUtils.getVm()).addProcessor(cpu); + } + + /** + * Create a processor instance for this architecture. + * + * @return The processor + */ + protected abstract VmProcessor createProcessor(int id, VmSharedStatics sharedStatics, + VmIsolatedStatics isolatedStatics, VmScheduler scheduler); + + /** + * Create the IRQ manager for this architecture. + * + * @return the IRQManager + */ + @Internal + public abstract IRQManager createIRQManager(VmProcessor processor); + + /** + * {@inheritDoc} + */ + public Address getStart(int space) { + switch (space) { + case VirtualMemoryRegion.BOOTIMAGE: + return Unsafe.getKernelStart(); + case VirtualMemoryRegion.INITJAR: + return Unsafe.getInitJarStart(); + default: + throw new IllegalArgumentException("Unknown space " + space); + } + } + + /** + * {@inheritDoc} + */ + public Address getEnd(int space) { + switch (space) { + case VirtualMemoryRegion.BOOTIMAGE: + return Unsafe.getBootHeapEnd(); + case VirtualMemoryRegion.INITJAR: + return Unsafe.getInitJarEnd(); + default: + throw new IllegalArgumentException("Unknown space " + space); + } + } + + /** + * Gets the physical address of the first whole page available for use + * by the memory manager. + * + * @return a physical address aligned on the appropriate page boundary + */ + protected final Word getFirstAvailableHeapPage() { + return pageAlign(VirtualMemoryRegion.HEAP, Unsafe.getMemoryStart().toWord(), true); + } + + /** + * Page align a given address (represented as a Word) in a given region. + * + * @param v an address value + * @param region a {@link VirtualMemoryRegion}. + * @param up If true, the value will be rounded up, otherwise rounded down. + * @return the corresponding page aligned address represented as a Word. + */ + public final Word pageAlign(int region, Word v, boolean up) { + final int logPageSize = getLogPageSize(region); + if (up) { + v = v.add((1 << logPageSize) - 1); + } + return v.rshl(logPageSize).lsh(logPageSize); + } + + /** + * {@inheritDoc} + */ + public final Address pageAlign(int region, Address v, boolean up) { + return pageAlign(region, v.toWord(), up).toAddress(); + } + + /** + * {@inheritDoc} + */ + public abstract boolean mmap(int region, Address start, Extent size, Address physAddr) + throws UninterruptiblePragma; + + /** + * Unmap a region of the virtual memory space. Note that you cannot allocate + * memory in this memory, because it is used very early in the boot process. + * + * @param region Memory region + * @param start The start of the virtual memory region to unmap. This value is + * aligned down on pagesize. + * @param size The size of the virtual memory region to unmap. This value is + * aligned up on pagesize. + * @return true for success, false otherwise. + */ + public abstract boolean munmap(int region, Address start, Extent size) + throws UninterruptiblePragma; + + /** + * {@inheritDoc} + */ + public final MemoryMapEntry[] getMemoryMap() { + final SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.check... [truncated message content] |
From: <cr...@us...> - 2010-10-02 09:48:16
|
Revision: 5757 http://jnode.svn.sourceforge.net/jnode/?rev=5757&view=rev Author: crawley Date: 2010-10-02 09:48:09 +0000 (Sat, 02 Oct 2010) Log Message: ----------- Move the lists of classes/packages that need to be optimized by the boot image builder to config files. Modified Paths: -------------- trunk/all/build-x86.xml trunk/all/build.xml trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java Added Paths: ----------- trunk/all/conf/core-classes.txt trunk/all/conf/x86-classes.txt Modified: trunk/all/build-x86.xml =================================================================== --- trunk/all/build-x86.xml 2010-07-11 14:27:38 UTC (rev 5756) +++ trunk/all/build-x86.xml 2010-10-02 09:48:09 UTC (rev 5757) @@ -182,8 +182,10 @@ listfile="${build.bootimage.dir}/bootimage.lst" debugfile="${build.bootimage.dir}/bootimage.debug" kernelfile="${build.native.dir}/output/jnode.o" - pluginList="${system-plugin-list}" + pluginList="${system-plugin-list}" pluginDir="${plugins.dir}" + coreClassListFile="${jnode-core-class-list}" + archClassListFile="${jnode-x86-class-list}" targetArch="x86" memMgrPluginId="${jnode.memmgr.plugin.id}" cpu="${cpu}" Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2010-07-11 14:27:38 UTC (rev 5756) +++ trunk/all/build.xml 2010-10-02 09:48:09 UTC (rev 5757) @@ -102,6 +102,11 @@ <property name="jnode-x86.iso" value="${cdroms.dir}/jnode-x86.iso"/> <property name="jnode-x86-lite.iso" value="${cdroms.dir}/jnode-x86-lite.iso"/> <property name="jnode-x86_64-lite.iso" value="${cdroms.dir}/jnode-x86_64-lite.iso"/> + + <!-- list of classes and packages that should to be compiled to native code + in the boot image. --> + <property name="jnode-core-class-list" value="${root.dir}/all/conf/core-classes.txt"/> + <property name="jnode-x86-class-list" value="${root.dir}/all/conf/x86-classes.txt"/> <path id="cp"> <pathelement location="${classlib.jar}"/> Added: trunk/all/conf/core-classes.txt =================================================================== --- trunk/all/conf/core-classes.txt (rev 0) +++ trunk/all/conf/core-classes.txt 2010-10-02 09:48:09 UTC (rev 5757) @@ -0,0 +1,191 @@ +# The classes and packages listed in this file will be compiled to optimized native code by +# the boot image builder. Entries can be a package name, a fully qualified class +# name or a fully qualified classname with a trailing wildcard in the classname part. + +java.io.Data* +java.io.String* +java.io.ByteArray* +java.io.CharArray* +java.io.Print* +java.io.Reader +java.io.Input* +java.io.Buffered* +java.io.Writer +java.io.Output* +java.io.Filter* +java.io.IOException +java.io.ObjectStreamField +java.io.ObjectStreamClass + +java.lang +java.lang.ref +//java.lang.reflect //<- produces inconsistent bootimage + +java.net.URL + +java.nio.Buffer +java.nio.ByteBuffer* +java.nio.DirectByteBuffer* +java.nio.ByteOrder +java.nio.Char* +java.nio.charset.spi +java.nio.charset + +java.security.ProtectionDomain +java.security.AccessController +java.security.AccessControlContext +java.security.AccessControlException +java.security.Permission +java.security.PrivilegedAction +java.security.PrivilegedActionException +java.security.PrivilegedExceptionAction +java.security.PermissionCollection +java.security.CodeSource +java.security.Policy +java.security.AllPermission +java.security.Permissions +java.security.Security +java.security.SecurityPermission +java.security.BasicPermission + +java.util.Collection* +java.util.Map* +java.util.List* +java.util.Set* +java.util.Iterator* +java.util.Array* +java.util.Abstract* +java.util.Hash* +java.util.TreeMap* +java.util.TreeSet* +java.util.Linked* +java.util.Vector* +java.util.Locale* +java.util.WeakHashMap* +java.util.Properties* +java.util.Dictionary* +java.util.StringTokenizer* +java.util.Property* +java.util.Enum* + +java.util.jar +java.util.zip + +gnu.classpath + +org.jnode.assembler +org.jnode.boot +org.jnode.bootlog +org.jnode.naming +org.jnode.permission +org.jnode.plugin +org.jnode.plugin.manager +org.jnode.plugin.model +org.jnode.security +org.jnode.system.resource +org.jnode.system.event +org.jnode.util +org.jnode.vm +org.jnode.vm.bytecode +org.jnode.vm.classmgr +org.jnode.vm.compiler +org.jnode.vm.facade +org.jnode.vm.isolate +org.jnode.vm.objects +org.jnode.vm.scheduler + +org.jnode.vm.memmgr +org.jnode.vm.memmgr.def + +//org.jnode.vm.memmgr.mmtk +//org.jnode.vm.memmgr.mmtk.genrc +//org.jnode.vm.memmgr.mmtk.nogc +//org.jnode.vm.memmgr.mmtk.ms + +//todo review for boot image size reduction +//sun.misc +//sun.reflect <-- // this kills jnode while booting, maybe Reflection static{...} +//sun.reflect.annotation +//sun.reflect.generics +//sun.reflect.generics.factory +//sun.reflect.generics.parser +//sun.reflect.generics.reflectiveObjects +//sun.reflect.generics.repository +//sun.reflect.generics.scope +//sun.reflect.generics.tree +//sun.reflect.generics.visitor +//sun.reflect.misc +sun.misc.VM +sun.nio +sun.nio.cs.US_ASCII +sun.nio.cs.ISO_8859_1* +sun.nio.cs.Surrogate* +sun.nio.cs.StreamEncoder +sun.nio.cs.SingleByteDecoder +sun.nio.cs.SingleByteEncoder +sun.nio.cs.FastCharsetProvider +sun.nio.cs.StandardCharsets +sun.nio.cs.HistoricallyNamedCharset +sun.nio.cs.StreamDecoder +sun.nio.cs.ThreadLocalCoders +sun.nio.cs.Unicode* +sun.nio.cs.UTF* + +// org.mmtk.plan +// org.mmtk.policy +// org.mmtk.utility +// org.mmtk.utility.alloc +// org.mmtk.utility.deque +// org.mmtk.utility.gcspy +// org.mmtk.utility.gcspy.drivers +// org.mmtk.utility.heap +// org.mmtk.utility.options +// org.mmtk.utility.scan +// org.mmtk.utility.statistics +// org.mmtk.vm +// org.mmtk.vm.gcspy +// +// java.awt +// java.awt.event +// java.awt.peer +// java.awt.font +// java.awt.geom +// +// gnu.javax.swing.text.html.parser +// gnu.javax.swing.text.html.parser.models +// gnu.javax.swing.text.html.parser.support +// gnu.javax.swing.text.html.parser.support.low +// +// javax.swing +// javax.swing.border +// javax.swing.event +// javax.swing.plaf +// javax.swing.plaf.basic +// javax.swing.plaf.metal +// javax.swing.text +// javax.swing.text.html +// javax.swing.text.html.parser +// javax.swing.text.rtf +// javax.swing.table +// javax.swing.tree +// javax.swing.colorchooser +// javax.swing.filechooser +// javax.swing.undo +// +// org.jnode.awt +// org.jnode.awt.swingpeers +// +// gnu.java.locale +// +// javax.net +// javax.net.ssl +// +// javax.security +// javax.security.auth +// javax.security.auth.callback +// javax.security.auth.login +// javax.security.auth.spi +// javax.security.cert +// javax.security.sasl +// +// org.ietf.jgss Added: trunk/all/conf/x86-classes.txt =================================================================== --- trunk/all/conf/x86-classes.txt (rev 0) +++ trunk/all/conf/x86-classes.txt 2010-10-02 09:48:09 UTC (rev 5757) @@ -0,0 +1,10 @@ +# The classes and packages listed in this file will be compiled to optimized native code by +# the boot image builder. Entries can be a package name, a fully qualified class +# name or a fully qualified classname with a trailing wildcard in the classname part. +# +# This file supplements core-classes.txt with classes / packages that are specific +# to the x86 architecture + +org.jnode.assembler.x86 +org.jnode.system.x86 +org.jnode.vm.x86 Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-07-11 14:27:38 UTC (rev 5756) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-10-02 09:48:09 UTC (rev 5757) @@ -20,8 +20,10 @@ package org.jnode.build; +import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; +import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStreamWriter; @@ -36,6 +38,7 @@ import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedMap; @@ -83,7 +86,6 @@ import org.jnode.vm.classmgr.VmType; import org.jnode.vm.compiler.NativeCodeCompiler; import org.jnode.vm.facade.Vm; -import org.jnode.vm.facade.VmArchitecture; import org.jnode.vm.facade.VmUtils; import org.jnode.vm.memmgr.HeapHelper; import org.jnode.vm.memmgr.VmHeapManager; @@ -119,7 +121,7 @@ private static final String zero16 = zero8 + zero8; /** - * Set of jbects that should not yet be emitted. + * Set of objects that should not yet be emitted. */ private final Set<Object> blockedObjects = new HashSet<Object>(); @@ -147,6 +149,8 @@ private File listFile; + private File coreClassListFile; + private int totalHighMethods; private int totalHighMethodSize; @@ -1372,204 +1376,63 @@ public void setListFile(File listFile) { this.listFile = listFile; } + + /** + * Sets the core class list file. + * + * @param coreClassListFile The coreClassListFile to set + */ + public void setCoreClassListFile(File coreClassListFile) { + this.coreClassListFile = coreClassListFile; + } protected void setupCompileHighOptLevelPackages() { - addCompileHighOptLevel("java.io.Data*"); - addCompileHighOptLevel("java.io.String*"); - addCompileHighOptLevel("java.io.ByteArray*"); - addCompileHighOptLevel("java.io.CharArray*"); - addCompileHighOptLevel("java.io.Print*"); - addCompileHighOptLevel("java.io.Reader"); - addCompileHighOptLevel("java.io.Input*"); - addCompileHighOptLevel("java.io.Buffered*"); - addCompileHighOptLevel("java.io.Writer"); - addCompileHighOptLevel("java.io.Output*"); - addCompileHighOptLevel("java.io.Filter*"); - addCompileHighOptLevel("java.io.IOException"); - addCompileHighOptLevel("java.io.ObjectStreamField"); - addCompileHighOptLevel("java.io.ObjectStreamClass"); - - addCompileHighOptLevel("java.lang"); - addCompileHighOptLevel("java.lang.ref"); -// addCompileHighOptLevel("java.lang.reflect"); //<- produces inconsistent bootimage - - addCompileHighOptLevel("java.net.URL"); - - addCompileHighOptLevel("java.nio.Buffer"); - addCompileHighOptLevel("java.nio.ByteBuffer*"); - addCompileHighOptLevel("java.nio.DirectByteBuffer*"); - addCompileHighOptLevel("java.nio.ByteOrder"); - addCompileHighOptLevel("java.nio.Char*"); - addCompileHighOptLevel("java.nio.charset.spi"); - addCompileHighOptLevel("java.nio.charset"); - - addCompileHighOptLevel("java.security.ProtectionDomain"); - addCompileHighOptLevel("java.security.AccessController"); - addCompileHighOptLevel("java.security.AccessControlContext"); - addCompileHighOptLevel("java.security.AccessControlException"); - addCompileHighOptLevel("java.security.Permission"); - addCompileHighOptLevel("java.security.PrivilegedAction"); - addCompileHighOptLevel("java.security.PrivilegedActionException"); - addCompileHighOptLevel("java.security.PrivilegedExceptionAction"); - addCompileHighOptLevel("java.security.PermissionCollection"); - addCompileHighOptLevel("java.security.CodeSource"); - addCompileHighOptLevel("java.security.Policy"); - addCompileHighOptLevel("java.security.AllPermission"); - addCompileHighOptLevel("java.security.Permissions"); - addCompileHighOptLevel("java.security.Security"); - addCompileHighOptLevel("java.security.SecurityPermission"); - addCompileHighOptLevel("java.security.BasicPermission"); - - addCompileHighOptLevel("java.util.Collection*"); - addCompileHighOptLevel("java.util.Map*"); - addCompileHighOptLevel("java.util.List*"); - addCompileHighOptLevel("java.util.Set*"); - addCompileHighOptLevel("java.util.Iterator*"); - addCompileHighOptLevel("java.util.Array*"); - addCompileHighOptLevel("java.util.Abstract*"); - addCompileHighOptLevel("java.util.Hash*"); - addCompileHighOptLevel("java.util.TreeMap*"); - addCompileHighOptLevel("java.util.TreeSet*"); - addCompileHighOptLevel("java.util.Linked*"); - addCompileHighOptLevel("java.util.Vector*"); - addCompileHighOptLevel("java.util.Locale*"); - addCompileHighOptLevel("java.util.WeakHashMap*"); - addCompileHighOptLevel("java.util.Properties*"); - addCompileHighOptLevel("java.util.Dictionary*"); - addCompileHighOptLevel("java.util.StringTokenizer*"); - addCompileHighOptLevel("java.util.Property*"); - addCompileHighOptLevel("java.util.Enum*"); - - addCompileHighOptLevel("java.util.jar"); - addCompileHighOptLevel("java.util.zip"); - - addCompileHighOptLevel("gnu.classpath"); - - addCompileHighOptLevel("org.jnode.assembler"); - addCompileHighOptLevel("org.jnode.boot"); - addCompileHighOptLevel("org.jnode.bootlog"); - addCompileHighOptLevel("org.jnode.naming"); - addCompileHighOptLevel("org.jnode.permission"); - addCompileHighOptLevel("org.jnode.plugin"); - addCompileHighOptLevel("org.jnode.plugin.manager"); - addCompileHighOptLevel("org.jnode.plugin.model"); - addCompileHighOptLevel("org.jnode.security"); - addCompileHighOptLevel("org.jnode.system.resource"); - addCompileHighOptLevel("org.jnode.system.event"); - addCompileHighOptLevel("org.jnode.util"); - addCompileHighOptLevel("org.jnode.vm"); - addCompileHighOptLevel("org.jnode.vm.bytecode"); - addCompileHighOptLevel("org.jnode.vm.classmgr"); - addCompileHighOptLevel("org.jnode.vm.compiler"); - addCompileHighOptLevel("org.jnode.vm.facade"); - addCompileHighOptLevel("org.jnode.vm.isolate"); - addCompileHighOptLevel("org.jnode.vm.objects"); - addCompileHighOptLevel("org.jnode.vm.scheduler"); + addCompileHighOptLevel(loadClassList(coreClassListFile)); for (NativeCodeCompiler compiler : getArchitecture().getCompilers()) { for (String packageName : compiler.getCompilerPackages()) { addCompileHighOptLevel(packageName); } } - - addCompileHighOptLevel("org.jnode.vm.memmgr"); - addCompileHighOptLevel("org.jnode.vm.memmgr.def"); -// addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk"); -// addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.genrc"); -// addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.nogc"); -// addCompileHighOptLevel("org.jnode.vm.memmgr.mmtk.ms"); - - //todo review for boot image size reduction -// addCompileHighOptLevel("sun.misc"); -// addCompileHighOptLevel("sun.reflect"); <-- // this kills jnode while booting, maybe Reflection static{...} -// addCompileHighOptLevel("sun.reflect.annotation"); -// addCompileHighOptLevel("sun.reflect.generics"); -// addCompileHighOptLevel("sun.reflect.generics.factory"); -// addCompileHighOptLevel("sun.reflect.generics.parser"); -// addCompileHighOptLevel("sun.reflect.generics.reflectiveObjects"); -// addCompileHighOptLevel("sun.reflect.generics.repository"); -// addCompileHighOptLevel("sun.reflect.generics.scope"); -// addCompileHighOptLevel("sun.reflect.generics.tree"); -// addCompileHighOptLevel("sun.reflect.generics.visitor"); -// addCompileHighOptLevel("sun.reflect.misc"); - addCompileHighOptLevel("sun.misc.VM"); - addCompileHighOptLevel("sun.nio"); - addCompileHighOptLevel("sun.nio.cs.US_ASCII"); - addCompileHighOptLevel("sun.nio.cs.ISO_8859_1*"); - addCompileHighOptLevel("sun.nio.cs.Surrogate*"); - addCompileHighOptLevel("sun.nio.cs.StreamEncoder"); - addCompileHighOptLevel("sun.nio.cs.SingleByteDecoder"); - addCompileHighOptLevel("sun.nio.cs.SingleByteEncoder"); - addCompileHighOptLevel("sun.nio.cs.FastCharsetProvider"); - addCompileHighOptLevel("sun.nio.cs.StandardCharsets"); - addCompileHighOptLevel("sun.nio.cs.HistoricallyNamedCharset"); - addCompileHighOptLevel("sun.nio.cs.StreamDecoder"); - addCompileHighOptLevel("sun.nio.cs.ThreadLocalCoders"); - addCompileHighOptLevel("sun.nio.cs.Unicode*"); - addCompileHighOptLevel("sun.nio.cs.UTF*"); - - if (false) { - addCompileHighOptLevel("org.mmtk.plan"); - addCompileHighOptLevel("org.mmtk.policy"); - addCompileHighOptLevel("org.mmtk.utility"); - addCompileHighOptLevel("org.mmtk.utility.alloc"); - addCompileHighOptLevel("org.mmtk.utility.deque"); - addCompileHighOptLevel("org.mmtk.utility.gcspy"); - addCompileHighOptLevel("org.mmtk.utility.gcspy.drivers"); - addCompileHighOptLevel("org.mmtk.utility.heap"); - addCompileHighOptLevel("org.mmtk.utility.options"); - addCompileHighOptLevel("org.mmtk.utility.scan"); - addCompileHighOptLevel("org.mmtk.utility.statistics"); - addCompileHighOptLevel("org.mmtk.vm"); - addCompileHighOptLevel("org.mmtk.vm.gcspy"); - - addCompileHighOptLevel("java.awt"); - addCompileHighOptLevel("java.awt.event"); - addCompileHighOptLevel("java.awt.peer"); - addCompileHighOptLevel("java.awt.font"); - addCompileHighOptLevel("java.awt.geom"); - - addCompileHighOptLevel("gnu.javax.swing.text.html.parser"); - addCompileHighOptLevel("gnu.javax.swing.text.html.parser.models"); - addCompileHighOptLevel("gnu.javax.swing.text.html.parser.support"); - addCompileHighOptLevel("gnu.javax.swing.text.html.parser.support.low"); - - addCompileHighOptLevel("javax.swing"); - addCompileHighOptLevel("javax.swing.border"); - addCompileHighOptLevel("javax.swing.event"); - addCompileHighOptLevel("javax.swing.plaf"); - addCompileHighOptLevel("javax.swing.plaf.basic"); - addCompileHighOptLevel("javax.swing.plaf.metal"); - addCompileHighOptLevel("javax.swing.text"); - addCompileHighOptLevel("javax.swing.text.html"); - addCompileHighOptLevel("javax.swing.text.html.parser"); - addCompileHighOptLevel("javax.swing.text.rtf"); - addCompileHighOptLevel("javax.swing.table"); - addCompileHighOptLevel("javax.swing.tree"); - addCompileHighOptLevel("javax.swing.colorchooser"); - addCompileHighOptLevel("javax.swing.filechooser"); - addCompileHighOptLevel("javax.swing.undo"); - - addCompileHighOptLevel("org.jnode.awt"); - addCompileHighOptLevel("org.jnode.awt.swingpeers"); - - addCompileHighOptLevel("gnu.java.locale"); - - addCompileHighOptLevel("javax.net"); - addCompileHighOptLevel("javax.net.ssl"); - - addCompileHighOptLevel("javax.security"); - addCompileHighOptLevel("javax.security.auth"); - addCompileHighOptLevel("javax.security.auth.callback"); - addCompileHighOptLevel("javax.security.auth.login"); - addCompileHighOptLevel("javax.security.auth.spi"); - addCompileHighOptLevel("javax.security.cert"); - addCompileHighOptLevel("javax.security.sasl"); - - addCompileHighOptLevel("org.ietf.jgss"); - - } } + + protected void addCompileHighOptLevel(List<String> classNames) { + for (String className : classNames) { + addCompileHighOptLevel(className); + } + } + protected List<String> loadClassList(File file) { + ArrayList<String> classNames = new ArrayList<String>(); + FileReader fr; + try { + fr = new FileReader(file); + } catch (IOException ex) { + throw new BuildException("Cannot open '" + file + "'", ex); + } + try { + BufferedReader br = new BufferedReader(fr); + String line; + while ((line = br.readLine()) != null) { + line = line.trim(); + if (line.isEmpty() || line.startsWith("#") || line.startsWith("/")) { + continue; + } + classNames.add(line); + } + } catch (IOException ex) { + throw new BuildException("Error reading '" + file + "'", ex); + } finally { + try { + fr.close(); + } catch (IOException ex) { + // ignore + } + } + return classNames; + } + + + /** * Create a set of the names of those classes that can be safely * instantiated during the boot process (and written as instance to the boot Modified: trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-07-11 14:27:38 UTC (rev 5756) +++ trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-10-02 09:48:09 UTC (rev 5757) @@ -20,6 +20,7 @@ package org.jnode.build.x86; +import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.HashMap; @@ -83,6 +84,8 @@ public static final int INITIAL_OBJREFS_CAPACITY = 750000; public static final int INITIAL_SIZE = 64 * 1024 * 1024; + + private File archClassListFile; private VmX86Processor processor; @@ -690,13 +693,13 @@ } /** + * Include x86 class files. + * * @see org.jnode.build.AbstractBootImageBuilder#setupCompileHighOptLevelPackages() */ protected void setupCompileHighOptLevelPackages() { super.setupCompileHighOptLevelPackages(); - addCompileHighOptLevel("org.jnode.assembler.x86"); - addCompileHighOptLevel("org.jnode.system.x86"); - addCompileHighOptLevel("org.jnode.vm.x86"); + addCompileHighOptLevel(loadClassList(archClassListFile)); } /** @@ -764,4 +767,22 @@ throw new BuildException(e); } } + + /** + * Gets the architecture specific class list file. + * + * @return The archClassListFile to set + */ + public File getArchClassListFile() { + return archClassListFile; + } + + /** + * Sets the architecture specific class list file. + * + * @param archClassListFile The archClassListFile to set + */ + public void setArchClassListFile(File archClassListFile) { + this.archClassListFile = archClassListFile; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-12-27 18:44:22
|
Revision: 5760 http://jnode.svn.sourceforge.net/jnode/?rev=5760&view=rev Author: lsantha Date: 2010-12-27 18:44:14 +0000 (Mon, 27 Dec 2010) Log Message: ----------- Checkstyle fixes. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java trunk/cli/src/commands/org/jnode/command/system/GcCommand.java trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660FileSystem.java trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java trunk/fs/src/test/org/jnode/test/support/MockObjectFactory.java trunk/gui/src/awt/org/jnode/awt/util/BasicSurfaceGraphics.java trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java trunk/gui/src/driver/org/jnode/driver/video/vga/VGADriver.java Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.build; import java.io.BufferedReader; @@ -611,7 +611,7 @@ emitStaticInitializerCalls(os, bootClasses, clInitCaller); // This is the end of the image - X86BinaryAssembler.ObjectInfo dummyObjectAtEnd = + X86BinaryAssembler.ObjectInfo dummyObjectAtEnd = os.startObject(loadClass(VmMethodCode.class)); pageAlign(os); dummyObjectAtEnd.markEnd(); @@ -756,7 +756,7 @@ } if (!ref.isResolved()) { throw new RuntimeException("Unresolved reference to object " + ((obj == null) ? - "null" : obj.getClass() .getName())); + "null" : obj.getClass().getName())); } } } @@ -803,85 +803,85 @@ throws ClassNotFoundException; public final void execute() throws BuildException { - try { - InitialNaming.setNameSpace(new BasicNameSpace()); - BootLogInstance.set(new BootLog() { - @Override - public void warn(String msg) { - System.out.println(msg); - } - - @Override - public void warn(String msg, Throwable ex) { - System.out.println(msg); - ex.printStackTrace(System.out); - } - - @Override - public void setDebugOut(PrintStream out) { - // ignore - } - - @Override - public void info(String msg, Throwable ex) { - System.out.println(msg); - ex.printStackTrace(System.out); - } - - @Override - public void info(String msg) { - System.out.println(msg); - } - - @Override - public void fatal(String msg, Throwable ex) { - System.out.println(msg); - ex.printStackTrace(System.out); - } - - @Override - public void fatal(String msg) { - System.out.println(msg); - } - - @Override - public void error(String msg, Throwable ex) { - System.out.println(msg); - ex.printStackTrace(System.out); - } - - @Override - public void error(String msg) { - System.out.println(msg); - } - - @Override - public void debug(String msg, Throwable ex) { - System.out.println(msg); - ex.printStackTrace(System.out); - } - - @Override - public void debug(String msg) { - System.out.println(msg); - } - }); - - // Create the image - doExecute(); - // Remove all garbage objects - cleanup(); - System.gc(); - // Make sure that all finalizers are called, in order to remove tmp - // files. - Runtime.getRuntime().runFinalization(); - } catch (BuildException be) { - be.printStackTrace(); - throw be; - } catch (Throwable t) { - t.printStackTrace(); - throw new BuildException(t); - } + try { + InitialNaming.setNameSpace(new BasicNameSpace()); + BootLogInstance.set(new BootLog() { + @Override + public void warn(String msg) { + System.out.println(msg); + } + + @Override + public void warn(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void setDebugOut(PrintStream out) { + // ignore + } + + @Override + public void info(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void info(String msg) { + System.out.println(msg); + } + + @Override + public void fatal(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void fatal(String msg) { + System.out.println(msg); + } + + @Override + public void error(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void error(String msg) { + System.out.println(msg); + } + + @Override + public void debug(String msg, Throwable ex) { + System.out.println(msg); + ex.printStackTrace(System.out); + } + + @Override + public void debug(String msg) { + System.out.println(msg); + } + }); + + // Create the image + doExecute(); + // Remove all garbage objects + cleanup(); + System.gc(); + // Make sure that all finalizers are called, in order to remove tmp + // files. + Runtime.getRuntime().runFinalization(); + } catch (BuildException be) { + be.printStackTrace(); + throw be; + } catch (Throwable t) { + t.printStackTrace(); + throw new BuildException(t); + } } /** @@ -997,7 +997,7 @@ protected boolean isCompileHighOptLevel(VmType<?> vmClass) { return vmClass.isArray() || isCompileHighOptLevel(vmClass.getName()); } - + private boolean isCompileHighOptLevel(String name) { if (compileHighOptLevelPackages.contains(name)) { return true; @@ -1020,9 +1020,8 @@ return false; } - - + /** * Link all undefined symbols from the kernel native code. * @@ -1112,8 +1111,8 @@ eName.length() - ".class".length()).replace('/', '.'); final int lastDotIdx = cName.lastIndexOf('.'); final String pkg = (lastDotIdx > 0) ? cName.substring(0, lastDotIdx) : ""; - if (isCompileHighOptLevel(cName) || - preloadPackages.contains(cName) || preloadPackages.contains(pkg)) { + if (isCompileHighOptLevel(cName) || + preloadPackages.contains(cName) || preloadPackages.contains(pkg)) { loadClass(cName, true); } } @@ -1351,7 +1350,7 @@ public void setListFile(File listFile) { this.listFile = listFile; } - + /** * Sets the core class list file. * @@ -1362,52 +1361,51 @@ } protected void setupCompileHighOptLevelPackages() { - addCompileHighOptLevel(loadClassList(coreClassListFile)); + addCompileHighOptLevel(loadClassList(coreClassListFile)); for (NativeCodeCompiler compiler : getArchitecture().getCompilers()) { for (String packageName : compiler.getCompilerPackages()) { addCompileHighOptLevel(packageName); } } } - + protected void addCompileHighOptLevel(List<String> classNames) { - for (String className : classNames) { - addCompileHighOptLevel(className); - } + for (String className : classNames) { + addCompileHighOptLevel(className); + } } - protected List<String> loadClassList(File file) { - ArrayList<String> classNames = new ArrayList<String>(); - FileReader fr; - try { - fr = new FileReader(file); - } catch (IOException ex) { - throw new BuildException("Cannot open '" + file + "'", ex); - } - try { - BufferedReader br = new BufferedReader(fr); - String line; - while ((line = br.readLine()) != null) { - line = line.trim(); - if (line.isEmpty() || line.startsWith("#") || line.startsWith("/")) { - continue; - } - classNames.add(line); - } - } catch (IOException ex) { - throw new BuildException("Error reading '" + file + "'", ex); - } finally { - try { - fr.close(); - } catch (IOException ex) { - // ignore - } - } - return classNames; - } - - + protected List<String> loadClassList(File file) { + ArrayList<String> classNames = new ArrayList<String>(); + FileReader fr; + try { + fr = new FileReader(file); + } catch (IOException ex) { + throw new BuildException("Cannot open '" + file + "'", ex); + } + try { + BufferedReader br = new BufferedReader(fr); + String line; + while ((line = br.readLine()) != null) { + line = line.trim(); + if (line.isEmpty() || line.startsWith("#") || line.startsWith("/")) { + continue; + } + classNames.add(line); + } + } catch (IOException ex) { + throw new BuildException("Error reading '" + file + "'", ex); + } finally { + try { + fr.close(); + } catch (IOException ex) { + // ignore + } + } + return classNames; + } + /** * Create a set of the names of those classes that can be safely * instantiated during the boot process (and written as instance to the boot Modified: trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.build; import java.io.PrintWriter; @@ -334,7 +334,7 @@ /** * Allocate and write and object of a given type. - * + * * @param cls * @param obj * @param vmType @@ -461,7 +461,7 @@ + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { - BootLogInstance.get() + BootLogInstance.get() .warn("JNode class not found " + ex.getMessage()); value = null; Modified: trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.build.x86; import java.io.File; @@ -84,7 +84,7 @@ public static final int INITIAL_OBJREFS_CAPACITY = 750000; public static final int INITIAL_SIZE = 64 * 1024 * 1024; - + private File archClassListFile; private VmX86Processor processor; @@ -351,9 +351,9 @@ refJava = os .getObjectRef(vmSystemClass .getMethod( - "findThrowableHandler", - "(Ljava/lang/Throwable;Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;)" + - "Lorg/vmmagic/unboxed/Address;")); + "findThrowableHandler", + "(Ljava/lang/Throwable;Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;)" + + "Lorg/vmmagic/unboxed/Address;")); os.getObjectRef(vmFindThrowableHandler).link(refJava); // Link Luser_esp @@ -694,7 +694,7 @@ /** * Include x86 class files. - * + * * @see org.jnode.build.AbstractBootImageBuilder#setupCompileHighOptLevelPackages() */ protected void setupCompileHighOptLevelPackages() { @@ -773,16 +773,16 @@ * * @return The archClassListFile to set */ - public File getArchClassListFile() { - return archClassListFile; - } + public File getArchClassListFile() { + return archClassListFile; + } - /** + /** * Sets the architecture specific class list file. * * @param archClassListFile The archClassListFile to set */ - public void setArchClassListFile(File archClassListFile) { - this.archClassListFile = archClassListFile; - } + public void setArchClassListFile(File archClassListFile) { + this.archClassListFile = archClassListFile; + } } Modified: trunk/cli/src/commands/org/jnode/command/system/GcCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/GcCommand.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/cli/src/commands/org/jnode/command/system/GcCommand.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.command.system; import java.io.PrintWriter; @@ -27,7 +27,6 @@ import org.jnode.shell.syntax.EnumArgument; import org.jnode.shell.syntax.FlagArgument; import org.jnode.util.NumberUtils; -import org.jnode.vm.VmImpl; import org.jnode.vm.facade.GCStatistics; import org.jnode.vm.facade.VmUtils; import org.jnode.vm.memmgr.VmHeapManager; @@ -37,7 +36,7 @@ * @author cr...@jn... */ public class GcCommand extends AbstractCommand { - + private static final String help_debug_flags = "the heap debug flags"; private static final String help_set = "set these debug flags"; private static final String help_clear = "clear these debug flags"; @@ -51,11 +50,11 @@ private static final String str_start = "Starting gc"; private static final String str_no_flags = "No heap debug flags set"; private static final String fmt_flags = "Heap debug flags: %s"; - + private enum HeapFlag { - TRACE_BASIC(VmHeapManager.TRACE_BASIC), - TRACE_ALLOC(VmHeapManager.TRACE_ALLOC), - TRACE_TRIGGER(VmHeapManager.TRACE_TRIGGER), + TRACE_BASIC(VmHeapManager.TRACE_BASIC), + TRACE_ALLOC(VmHeapManager.TRACE_ALLOC), + TRACE_TRIGGER(VmHeapManager.TRACE_TRIGGER), TRACE_OOM(VmHeapManager.TRACE_OOM), TRACE_AD_HOC(VmHeapManager.TRACE_AD_HOC), all(-1); // All flags @@ -71,12 +70,13 @@ public HeapDebugFlagArgument() { super("debugFlag", Argument.OPTIONAL | Argument.MULTIPLE, HeapFlag.class, help_debug_flags); } + @Override protected String argumentKind() { return "debug flag"; } } - + private final HeapDebugFlagArgument argDebugFlags; private final FlagArgument argSet; private final FlagArgument argClear; @@ -85,9 +85,9 @@ public GcCommand() { super(help_super); argDebugFlags = new HeapDebugFlagArgument(); - argSet = new FlagArgument("set", Argument.OPTIONAL, help_set); - argClear = new FlagArgument("clear", Argument.OPTIONAL, help_clear); - argShow = new FlagArgument("show", Argument.OPTIONAL, help_show); + argSet = new FlagArgument("set", Argument.OPTIONAL, help_set); + argClear = new FlagArgument("clear", Argument.OPTIONAL, help_clear); + argShow = new FlagArgument("show", Argument.OPTIONAL, help_show); registerArguments(argDebugFlags, argClear, argSet, argShow); } @@ -101,7 +101,7 @@ public void execute() throws Exception { final PrintWriter out = getOutput().getPrintWriter(); if (argSet.isSet()) { - VmUtils.getVm().getHeapManager().setHeapFlags(getFlags()); + VmUtils.getVm().getHeapManager().setHeapFlags(getFlags()); } else if (argClear.isSet()) { int flags = VmUtils.getVm().getHeapManager().getHeapFlags() ^ getFlags(); VmUtils.getVm().getHeapManager().setHeapFlags(flags); @@ -118,14 +118,14 @@ GCStatistics stats = VmUtils.getVm().getHeapManager().getStatistics(); Thread.yield(); long end = System.currentTimeMillis(); - + out.format(fmt_out, str_mem_size, NumberUtils.toBinaryByte(rt.totalMemory())); out.format(fmt_out, str_mem_free, NumberUtils.toBinaryByte(rt.freeMemory())); out.format(fmt_out, str_time, (end - start) + "ms"); out.format(fmt_out, str_stats, stats.toString()); } } - + private void showFlags(int flags, PrintWriter out) { StringBuilder sb = new StringBuilder(); for (int flagBitMask = 1; flagBitMask != 0; flagBitMask = flagBitMask << 1) { Modified: trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -27,7 +27,6 @@ import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.IntegerArgument; import org.jnode.shell.syntax.LongArgument; -import org.jnode.vm.VmImpl; import org.jnode.vm.facade.HeapStatistics; import org.jnode.vm.facade.VmUtils; Modified: trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.driver.block.ide.disk; import java.io.IOException; @@ -68,18 +68,18 @@ * My logger */ private static final Logger log = Logger.getLogger(IDEDiskDriver.class); - + /** * Number of addressable sectors */ private long maxSector; - + /** Has LBA support? */ //private boolean lba; - + /** Has DMA support? */ //private boolean dma; - + /** * Support 48-bit addressing? */ @@ -124,7 +124,7 @@ int i = 0; for (IBMPartitionTableEntry pte : pt) { if (pte == null) { - BootLogInstance.get().warn("PartitionTableEntry #" + i + " is null"); + BootLogInstance.get().warn("PartitionTableEntry #" + i + " is null"); } else if (pte.isValid()) { if (pte.isExtended()) { // Create partition devices for the extended partition @@ -299,9 +299,10 @@ * @param partIndex the first partition index to use * @return the next partition index * @throws DeviceAlreadyRegisteredException + * * @throws DriverException */ - private int registerExtendedPartition(DeviceManager devMan, IDEDevice dev, int partIndex) + private int registerExtendedPartition(DeviceManager devMan, IDEDevice dev, int partIndex) throws DeviceAlreadyRegisteredException, DriverException { //now we should have an filled vector in the pt final List<IBMPartitionTableEntry> extendedPartitions = pt.getExtendedPartitions(); Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660FileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660FileSystem.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660FileSystem.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -43,7 +43,7 @@ * @see org.jnode.fs.FileSystem#getDevice() */ public ISO9660FileSystem(Device device, boolean readOnly, ISO9660FileSystemType type) - throws FileSystemException { + throws FileSystemException { super(device, readOnly, type); try { @@ -84,7 +84,7 @@ } /** - * + * */ protected FSFile createFile(FSEntry entry) throws IOException { // TODO Auto-generated method stub @@ -92,7 +92,7 @@ } /** - * + * */ protected FSDirectory createDirectory(FSEntry entry) throws IOException { // TODO Auto-generated method stub @@ -100,7 +100,7 @@ } /** - * + * */ protected ISO9660Entry createRootEntry() throws IOException { // TODO Auto-generated method stub Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Volume.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -43,7 +43,7 @@ /** * Initialize this instance. - * + * * @param api * @throws IOException */ @@ -65,26 +65,26 @@ done = true; break; case VolumeDescriptorType.BOOTRECORD: - BootLogInstance.get().debug("Found boot record"); + BootLogInstance.get().debug("Found boot record"); break; case VolumeDescriptorType.PRIMARY_DESCRIPTOR: - BootLogInstance.get().debug("Found primary descriptor"); + BootLogInstance.get().debug("Found primary descriptor"); pVD = new PrimaryVolumeDescriptor(this, buffer); // pVD.dump(System.out); break; case VolumeDescriptorType.SUPPLEMENTARY_DESCRIPTOR: - BootLogInstance.get().debug("Found supplementatory descriptor"); + BootLogInstance.get().debug("Found supplementatory descriptor"); final SupplementaryVolumeDescriptor d = - new SupplementaryVolumeDescriptor(this, buffer); + new SupplementaryVolumeDescriptor(this, buffer); if (d.isEncodingKnown()) { sVD = d; } break; case VolumeDescriptorType.PARTITION_DESCRIPTOR: - BootLogInstance.get().debug("Found partition descriptor"); + BootLogInstance.get().debug("Found partition descriptor"); break; default: - BootLogInstance.get().debug("Found unknown descriptor with type " + type); + BootLogInstance.get().debug("Found unknown descriptor with type " + type); } } if (pVD == null) { @@ -96,7 +96,7 @@ /** * Read a block of data from this volume. - * + * * @param startLBN * @param offset * @param buffer Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/fs/src/fs/org/jnode/fs/iso9660/SupplementaryVolumeDescriptor.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -45,7 +45,7 @@ * @param buffer */ public SupplementaryVolumeDescriptor(ISO9660Volume volume, byte[] buffer) - throws UnsupportedEncodingException { + throws UnsupportedEncodingException { super(volume, buffer); this.flags = getUInt8(buffer, 8); this.escapeSequences = getDChars(buffer, 89, 121 - 89); @@ -115,7 +115,7 @@ /** * Gets a derived encoding name from the given escape sequences. - * + * * @param escapeSequences * @return the encoding name */ @@ -137,7 +137,7 @@ /** * Is the used encoding known to this system. - * + * * @return {@code true} if the encoding known, otherwise {@code false}. */ public final boolean isEncodingKnown() { Modified: trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -51,165 +51,165 @@ * @author cr...@jn... */ public class FdiskCommand extends AbstractCommand { - // FIXME ... this is a dangerous command and it needs some extra checking to help - // avoid catastrophic errors. At the very least, it needs a mode that shows the - // user what would happen but does nothing. + // FIXME ... this is a dangerous command and it needs some extra checking to help + // avoid catastrophic errors. At the very least, it needs a mode that shows the + // user what would happen but does nothing. private final FlagArgument FLAG_INIT_MBR = - new FlagArgument("initMBR", Argument.OPTIONAL, - "if set, init the device's Master Boot Record"); + new FlagArgument("initMBR", Argument.OPTIONAL, + "if set, init the device's Master Boot Record"); private final FlagArgument FLAG_DELETE = - new FlagArgument("delete", Argument.OPTIONAL, "if set, delete a partition"); + new FlagArgument("delete", Argument.OPTIONAL, "if set, delete a partition"); private final FlagArgument FLAG_BOOTABLE = - new FlagArgument("bootable", Argument.OPTIONAL, - "if set, toggle the partition's bootable flag"); + new FlagArgument("bootable", Argument.OPTIONAL, + "if set, toggle the partition's bootable flag"); private final FlagArgument FLAG_MODIFY = - new FlagArgument("modify", Argument.OPTIONAL, "if set, modify or create a partition"); + new FlagArgument("modify", Argument.OPTIONAL, "if set, modify or create a partition"); private final IntegerArgument ARG_PARTITION = - new IntegerArgument("partition", Argument.OPTIONAL, "Target partition number (0..3)"); + new IntegerArgument("partition", Argument.OPTIONAL, "Target partition number (0..3)"); private final LongArgument ARG_START = - new LongArgument("start", Argument.OPTIONAL, "Partition start sector"); + new LongArgument("start", Argument.OPTIONAL, "Partition start sector"); private final LongArgument ARG_SECTORS = - new LongArgument("sectors", Argument.OPTIONAL, "Partition size in sectors"); + new LongArgument("sectors", Argument.OPTIONAL, "Partition size in sectors"); private final SizeArgument ARG_BYTES = - new SizeArgument("bytes", Argument.OPTIONAL, "Partition size in bytes (300K, 45M, etc)"); + new SizeArgument("bytes", Argument.OPTIONAL, "Partition size in bytes (300K, 45M, etc)"); private final IBMPartitionTypeArgument ARG_TYPE = - new IBMPartitionTypeArgument("type", Argument.OPTIONAL, "IBM partition type code"); + new IBMPartitionTypeArgument("type", Argument.OPTIONAL, "IBM partition type code"); private final DeviceArgument ARG_DEVICE = - new DeviceArgument("deviceId", Argument.OPTIONAL, "Target device", BlockDeviceAPI.class); + new DeviceArgument("deviceId", Argument.OPTIONAL, "Target device", BlockDeviceAPI.class); - public FdiskCommand() { - super("perform disk partition management tasks"); + public FdiskCommand() { + super("perform disk partition management tasks"); registerArguments(FLAG_BOOTABLE, FLAG_DELETE, FLAG_INIT_MBR, FLAG_MODIFY, ARG_DEVICE, - ARG_PARTITION, ARG_START, ARG_SECTORS, ARG_BYTES, ARG_TYPE); - } + ARG_PARTITION, ARG_START, ARG_SECTORS, ARG_BYTES, ARG_TYPE); + } - public static void main(String[] args) throws Exception { - new FdiskCommand().execute(args); - } + public static void main(String[] args) throws Exception { + new FdiskCommand().execute(args); + } - public void execute() throws Exception { - final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME); - PrintWriter out = getOutput().getPrintWriter(); - PrintWriter err = getError().getPrintWriter(); - if (!ARG_DEVICE.isSet()) { - // Show all devices. - listAvailableDevices(dm, out); - return; - } + public void execute() throws Exception { + final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME); + PrintWriter out = getOutput().getPrintWriter(); + PrintWriter err = getError().getPrintWriter(); + if (!ARG_DEVICE.isSet()) { + // Show all devices. + listAvailableDevices(dm, out); + return; + } - Device dev = ARG_DEVICE.getValue(); - // FIXME PartitionHelper assumes that the device is an IDE device !?! - if (!(dev instanceof IDEDevice)) { - err.println(dev.getId() + " is not an IDE device"); - exit(1); - } - final PartitionHelper helper = new PartitionHelper(dev.getId(), out); - try{ - helper.checkMBR(); - } catch (IOException ioex){ - out.println(ioex.getMessage()); - out.println("Create a new MBR with a valid partition table."); - helper.initMbr(); - helper.write(); - } + Device dev = ARG_DEVICE.getValue(); + // FIXME PartitionHelper assumes that the device is an IDE device !?! + if (!(dev instanceof IDEDevice)) { + err.println(dev.getId() + " is not an IDE device"); + exit(1); + } + final PartitionHelper helper = new PartitionHelper(dev.getId(), out); + try { + helper.checkMBR(); + } catch (IOException ioex) { + out.println(ioex.getMessage()); + out.println("Create a new MBR with a valid partition table."); + helper.initMbr(); + helper.write(); + } - if (FLAG_BOOTABLE.isSet()) { - helper.toggleBootable(getPartitionNumber(helper)); - helper.write(); - } else if (FLAG_DELETE.isSet()) { - helper.deletePartition(getPartitionNumber(helper)); - helper.write(); - } else if (FLAG_MODIFY.isSet()) { - modifyPartition(helper, getPartitionNumber(helper), out); - helper.write(); - } else if (FLAG_INIT_MBR.isSet()) { - helper.initMbr(); - helper.write(); - } else { - printPartitionTable(helper, out); - } - } + if (FLAG_BOOTABLE.isSet()) { + helper.toggleBootable(getPartitionNumber(helper)); + helper.write(); + } else if (FLAG_DELETE.isSet()) { + helper.deletePartition(getPartitionNumber(helper)); + helper.write(); + } else if (FLAG_MODIFY.isSet()) { + modifyPartition(helper, getPartitionNumber(helper), out); + helper.write(); + } else if (FLAG_INIT_MBR.isSet()) { + helper.initMbr(); + helper.write(); + } else { + printPartitionTable(helper, out); + } + } - private int getPartitionNumber(PartitionHelper helper) { - int partNumber = ARG_PARTITION.getValue(); - if (partNumber >= helper.getNbPartitions() || partNumber < 0) { - throw new IllegalArgumentException("Partition number is invalid"); - } - return partNumber; - } + private int getPartitionNumber(PartitionHelper helper) { + int partNumber = ARG_PARTITION.getValue(); + if (partNumber >= helper.getNbPartitions() || partNumber < 0) { + throw new IllegalArgumentException("Partition number is invalid"); + } + return partNumber; + } private void modifyPartition(PartitionHelper helper, int id, PrintWriter out) throws IOException { - long start = ARG_START.getValue(); - long size = ARG_SECTORS.isSet() ? ARG_SECTORS.getValue() : ARG_BYTES.getValue(); - IBMPartitionTypes type = ARG_TYPE.getValue(); + long start = ARG_START.getValue(); + long size = ARG_SECTORS.isSet() ? ARG_SECTORS.getValue() : ARG_BYTES.getValue(); + IBMPartitionTypes type = ARG_TYPE.getValue(); out.println("Init " + id + " with start = " + start + ", size = " + size + ", fs = " + - Integer.toHexString(type.getCode())); + Integer.toHexString(type.getCode())); boolean sizeUnit = ARG_BYTES.isSet() ? PartitionHelper.BYTES : PartitionHelper.SECTORS; - helper.modifyPartition(id, false, start, size, sizeUnit, type); - } + helper.modifyPartition(id, false, start, size, sizeUnit, type); + } - private void printPartitionTable(PartitionHelper helper, PrintWriter out) - throws DeviceNotFoundException, ApiNotFoundException, IOException { - IDEDevice ideDev = helper.getDevice(); - IDEDriveDescriptor descriptor = ideDev.getDescriptor(); - int sectorSize = IDEConstants.SECTOR_SIZE; - if (ideDev != null) { - out.println("IDE Disk : " + ideDev.getId() + ": " + - descriptor.getSectorsIn28bitAddressing() * 512 + " bytes"); - } - out.println("Device Boot Start End Blocks System"); - IBMPartitionTable partitionTable = helper.getPartitionTable(); - int i = 0; - for(IBMPartitionTableEntry entry : partitionTable){ - IBMPartitionTypes si = entry.getSystemIndicator(); - if (!entry.isEmpty()) { - long sectors = entry.getNrSectors(); + private void printPartitionTable(PartitionHelper helper, PrintWriter out) + throws DeviceNotFoundException, ApiNotFoundException, IOException { + IDEDevice ideDev = helper.getDevice(); + IDEDriveDescriptor descriptor = ideDev.getDescriptor(); + int sectorSize = IDEConstants.SECTOR_SIZE; + if (ideDev != null) { + out.println("IDE Disk : " + ideDev.getId() + ": " + + descriptor.getSectorsIn28bitAddressing() * 512 + " bytes"); + } + out.println("Device Boot Start End Blocks System"); + IBMPartitionTable partitionTable = helper.getPartitionTable(); + int i = 0; + for (IBMPartitionTableEntry entry : partitionTable) { + IBMPartitionTypes si = entry.getSystemIndicator(); + if (!entry.isEmpty()) { + long sectors = entry.getNrSectors(); out.println("ID " + i + " " + (entry.getBootIndicator() ? "Boot" : "No") + " " + - entry.getStartLba() + " " + (entry.getStartLba() + sectors) + " " + - entry.getNbrBlocks(sectorSize) + (entry.isOdd()?"":"+") + " " + si); - } - if (entry.isExtended()) { + entry.getStartLba() + " " + (entry.getStartLba() + sectors) + " " + + entry.getNbrBlocks(sectorSize) + (entry.isOdd() ? "" : "+") + " " + si); + } + if (entry.isExtended()) { final List<IBMPartitionTableEntry> exPartitions = - partitionTable.getExtendedPartitions(); - int j = 0; - for (IBMPartitionTableEntry exEntry : exPartitions) { - si = exEntry.getSystemIndicator(); - // FIXME ... this needs work + partitionTable.getExtendedPartitions(); + int j = 0; + for (IBMPartitionTableEntry exEntry : exPartitions) { + si = exEntry.getSystemIndicator(); + // FIXME ... this needs work out.println("ID " + i + " " + (exEntry.getBootIndicator() ? "Boot" : "No") + - " " + exEntry.getStartLba() + " " + "-----" + " " + "-----" + - " " + si); - j++; - } - } - i++; - } - } + " " + exEntry.getStartLba() + " " + "-----" + " " + "-----" + + " " + si); + j++; + } + } + i++; + } + } - private void listAvailableDevices(DeviceManager dm, PrintWriter out) { - final Collection<Device> allDevices = dm.getDevicesByAPI(BlockDeviceAPI.class); - for (Device dev : allDevices) { - out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]"); - if (dev instanceof IDEDevice) { - IDEDevice ideDevice = (IDEDevice) dev; - IDEDriveDescriptor desc = ideDevice.getDescriptor(); - if (desc.isDisk()) { + private void listAvailableDevices(DeviceManager dm, PrintWriter out) { + final Collection<Device> allDevices = dm.getDevicesByAPI(BlockDeviceAPI.class); + for (Device dev : allDevices) { + out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]"); + if (dev instanceof IDEDevice) { + IDEDevice ideDevice = (IDEDevice) dev; + IDEDriveDescriptor desc = ideDevice.getDescriptor(); + if (desc.isDisk()) { out.println(" IDE Disk : " + ideDevice.getId() + "(" + desc.getModel() + - " " + desc.getSectorsIn28bitAddressing() * IDEConstants.SECTOR_SIZE + - ")"); - } - } - } - } + " " + desc.getSectorsIn28bitAddressing() * IDEConstants.SECTOR_SIZE + + ")"); + } + } + } + } } Modified: trunk/fs/src/test/org/jnode/test/support/MockObjectFactory.java =================================================================== --- trunk/fs/src/test/org/jnode/test/support/MockObjectFactory.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/fs/src/test/org/jnode/test/support/MockObjectFactory.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.test.support; import javax.naming.NameAlreadyBoundException; @@ -68,7 +68,7 @@ final MockObjectTestCase mockTestCase = (MockObjectTestCase) testCase; MockInitializer initializer = new MockInitializer() { public void init(Mock mockDesc) { - BootLogInstance.get().debug("devSize=" + deviceSize); + BootLogInstance.get().debug("devSize=" + deviceSize); Boolean bSupp48bitsAddr = Boolean.valueOf(supp48bitsAddr); mockDesc.expects(mockTestCase.atLeastOnce()). method("supports48bitAddressing"). Modified: trunk/gui/src/awt/org/jnode/awt/util/BasicSurfaceGraphics.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/util/BasicSurfaceGraphics.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/gui/src/awt/org/jnode/awt/util/BasicSurfaceGraphics.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.awt.util; import java.awt.Color; @@ -433,6 +433,7 @@ } } */ + /** * Draws as much of the specified image as is currently available. * The image is drawn with its top-left corner at @@ -1136,55 +1137,55 @@ } } } else { - // TODO implement special case of a custom ColorModel not based on jdk concrete classes - return raster; + // TODO implement special case of a custom ColorModel not based on jdk concrete classes + return raster; } - } else if (dst_model instanceof IndexColorModel) { - // remark : the VGA driver is using an IndexColorModel - - final Object srcElements = createArray(model); - final Object dstElements = createArray(dst_model); - - for (int y = 0; y < h; y++) { - for (int x = 0; x < w; x++) { - // get and convert source pixel to rgb - raster.getDataElements(x, y, srcElements); - int rgb = model.getRGB(srcElements); - - // convert rgb to destination model - dst_model.getDataElements(rgb, dstElements); - - // set destination pixel - dst_raster.setDataElements(x, y, dstElements); - } - } + } else if (dst_model instanceof IndexColorModel) { + // remark : the VGA driver is using an IndexColorModel + + final Object srcElements = createArray(model); + final Object dstElements = createArray(dst_model); + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + // get and convert source pixel to rgb + raster.getDataElements(x, y, srcElements); + int rgb = model.getRGB(srcElements); + + // convert rgb to destination model + dst_model.getDataElements(rgb, dstElements); + + // set destination pixel + dst_raster.setDataElements(x, y, dstElements); + } + } } return dst_raster; } - + private Object createArray(ColorModel model) { - final int transferType = model.getTransferType(); - final int size = model.getNumComponents(); - switch (transferType) { - case DataBuffer.TYPE_BYTE: - return new byte[size]; - - case DataBuffer.TYPE_USHORT: - case DataBuffer.TYPE_SHORT: - return new short[size]; - - case DataBuffer.TYPE_INT: - return new int[size]; - - case DataBuffer.TYPE_FLOAT: - return new float[size]; - - case DataBuffer.TYPE_DOUBLE: - return new double[size]; - - default: - throw new IllegalArgumentException("Unknown transfer type : " + transferType); - } + final int transferType = model.getTransferType(); + final int size = model.getNumComponents(); + switch (transferType) { + case DataBuffer.TYPE_BYTE: + return new byte[size]; + + case DataBuffer.TYPE_USHORT: + case DataBuffer.TYPE_SHORT: + return new short[size]; + + case DataBuffer.TYPE_INT: + return new int[size]; + + case DataBuffer.TYPE_FLOAT: + return new float[size]; + + case DataBuffer.TYPE_DOUBLE: + return new double[size]; + + default: + throw new IllegalArgumentException("Unknown transfer type : " + transferType); + } } } Modified: trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/gui/src/driver/org/jnode/driver/video/vga/VGABitmapGraphics.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.driver.video.vga; import java.awt.Rectangle; @@ -41,7 +41,7 @@ * @param bytesPerLine */ public VGABitmapGraphics(StandardVGA vga, StandardVGAIO vgaIO, int width, int height, - int offset, int bytesPerLine) { + int offset, int bytesPerLine) { super(vga.getVgaMem(), width, height, offset, bytesPerLine); this.vgaIO = vgaIO; } @@ -51,16 +51,16 @@ } protected void doDrawImage(Raster src, int srcX, int srcY, int dstX, int dstY, int width, - int height) { + int height) { vgaIO.setGRAF(1, 0); vgaIO.setGRAF(8, 0xFF); // round up the result of width/8 int pWidth = width >> 3; // (width >> 3) == (width / 8) if ((width & 7) != 0) { // (width & 7) == (width % 8) - pWidth++; + pWidth++; } - + final byte[] plane0 = new byte[pWidth]; final byte[] plane1 = new byte[pWidth]; final byte[] plane2 = new byte[pWidth]; @@ -71,7 +71,7 @@ src.getDataElements(srcX, srcY + row, width, 1, buf); for (int col = 0; col < width; col++) { final int bit = getBit(dstX + col); - final int pixel = buf[col]; + final int pixel = buf[col]; final int i = (col >> 3); if ((pixel & 0x01) != 0) { plane0[i] |= bit; @@ -117,8 +117,8 @@ } protected void doDrawImage(Raster src, int srcX, int srcY, int dstX, int dstY, int width, - int height, int bgColor) { - //TODO use bgColor parameter + int height, int bgColor) { + //TODO use bgColor parameter doDrawImage(src, srcX, srcY, dstX, dstY, width, height); } @@ -145,14 +145,14 @@ } protected void doDrawPixels(int x, int y, int count, int color, int mode) { - //TODO (do)DrawLine/(do)doDrawPixels appear to be duplicates at higher level => remove one - doDrawLine(x, y, count, color, mode); + //TODO (do)DrawLine/(do)doDrawPixels appear to be duplicates at higher level => remove one + doDrawLine(x, y, count, color, mode); } protected void doDrawAlphaRaster(Raster raster, int srcX, int srcY, int dstX, int dstY, - int width, int height, int color) { - //TODO should we support alpha with only a fixed set of 16 colors ? - doDrawImage(raster, srcX, srcY, dstX, dstY, width, height, color); + int width, int height, int color) { + //TODO should we support alpha with only a fixed set of 16 colors ? + doDrawImage(raster, srcX, srcY, dstX, dstY, width, height, color); } public int doGetPixel(int x, int y) { @@ -161,15 +161,15 @@ } public int[] doGetPixels(Rectangle r) { - final int[] result = new int[r.width * r.height]; - final int xmax = r.x + r.width; - final int ymax = r.y + r.height; - int i = 0; - for (int y = r.y; y < ymax; y++) { - for (int x = r.x; x < xmax; x++) { - result[i++] = doGetPixel(x, y); - } - } + final int[] result = new int[r.width * r.height]; + final int xmax = r.x + r.width; + final int ymax = r.y + r.height; + int i = 0; + for (int y = r.y; y < ymax; y++) { + for (int x = r.x; x < xmax; x++) { + result[i++] = doGetPixel(x, y); + } + } return result; } @@ -180,10 +180,10 @@ @Override protected int getOffset(int x, int y) { - return y * 80 + (x >> 3); + return y * 80 + (x >> 3); } - + private int getBit(int x) { - return 0x80 >> (x & 7); + return 0x80 >> (x & 7); } } Modified: trunk/gui/src/driver/org/jnode/driver/video/vga/VGADriver.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/video/vga/VGADriver.java 2010-12-27 18:41:44 UTC (rev 5759) +++ trunk/gui/src/driver/org/jnode/driver/video/vga/VGADriver.java 2010-12-27 18:44:14 UTC (rev 5760) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.driver.video.vga; import java.awt.image.DataBuffer; @@ -40,13 +40,13 @@ * @author epr */ public class VGADriver extends AbstractFrameBufferDriver implements VgaConstants { - private static final int NB_COLORS = 16; - + private static final int NB_COLORS = 16; + static final IndexColorModel COLOR_MODEL = new IndexColorModel(4, NB_COLORS, REDS, GREENS, BLUES) { // Typically overridden public SampleModel createCompatibleSampleModel(int w, int h) { // return new VGASampleModel(w, h); - return new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, w, h, new int[] {0xFF}); + return new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, w, h, new int[]{0xFF}); } /** @@ -70,7 +70,7 @@ * <li>Arrange the components in the output array</li> * <p/> * </ol> - * + * * @param rgb The color to be converted to dataElements. A pixel in sRGB * color space, encoded in default 0xAARRGGBB format, assumed * not alpha premultiplied. @@ -84,11 +84,11 @@ public Object getDataElements(int rgb, Object pixel) { final int r2 = (0x00FF0000 & rgb) >> 16; final int g2 = (0x0000FF00 & rgb) >> 8; - final int b2 = (0x000000FF & rgb); + final int b2 = (0x000000FF & rgb); final byte[] p = (pixel == null) ? new byte[1] : (byte[]) pixel; - + rgb = (0x00FFFFFF & rgb); // remove alpha component - + int min_i = 0; int min_rgb = Integer.MAX_VALUE; for (int i = 0; i < NB_COLORS; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-12-27 21:02:44
|
Revision: 5762 http://jnode.svn.sourceforge.net/jnode/?rev=5762&view=rev Author: lsantha Date: 2010-12-27 21:02:37 +0000 (Mon, 27 Dec 2010) Log Message: ----------- Javadoc fixes. Modified Paths: -------------- trunk/all/build.xml trunk/builder/src/builder/org/jnode/linker/Elf.java trunk/core/src/core/org/jnode/vm/VmMagic.java Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2010-12-27 18:48:53 UTC (rev 5761) +++ trunk/all/build.xml 2010-12-27 21:02:37 UTC (rev 5762) @@ -727,6 +727,7 @@ <pathelement location="${root.dir}/core/src/openjdk/vm"/> <pathelement location="${root.dir}/core/src/core"/> <pathelement location="${root.dir}/core/src/driver"/> + <pathelement location="${root.dir}/core/src/emu"/> <pathelement location="${root.dir}/core/src/mmtk-vm"/> <pathelement location="${root.dir}/core/src/endorsed/nanoxml"/> <pathelement location="${root.dir}/core/src/test"/> Modified: trunk/builder/src/builder/org/jnode/linker/Elf.java =================================================================== --- trunk/builder/src/builder/org/jnode/linker/Elf.java 2010-12-27 18:48:53 UTC (rev 5761) +++ trunk/builder/src/builder/org/jnode/linker/Elf.java 2010-12-27 21:02:37 UTC (rev 5762) @@ -282,7 +282,7 @@ /** * Does this elf file contain 32-bit objects. * - * @return + * @return true is the file contains 32-bit objects */ public boolean isClass32() { return (e_ident[EI_CLASS] == ELFCLASS32); @@ -291,7 +291,7 @@ /** * Does this elf file contain 64-bit objects. * - * @return + * @return true is the file contains 64-bit objects */ public boolean isClass64() { return (e_ident[EI_CLASS] == ELFCLASS64); @@ -300,7 +300,7 @@ /** * Gets the entry point address. * - * @return + * @return the address */ public long getEntry() { return e_entry; Modified: trunk/core/src/core/org/jnode/vm/VmMagic.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmMagic.java 2010-12-27 18:48:53 UTC (rev 5761) +++ trunk/core/src/core/org/jnode/vm/VmMagic.java 2010-12-27 21:02:37 UTC (rev 5762) @@ -34,11 +34,12 @@ * bodies are not used. * <p/> * Methods in this class can also be called from inside JNode. + * <p/> + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes and + * {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * to get the list of "magic" methods. * * @author Ewout Prangsma (ep...@us...) - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} - * to get the list of "magic" methods */ @MagicPermission public final class VmMagic { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-01-03 10:19:18
|
Revision: 5763 http://jnode.svn.sourceforge.net/jnode/?rev=5763&view=rev Author: lsantha Date: 2011-01-03 10:19:11 +0000 (Mon, 03 Jan 2011) Log Message: ----------- Javadoc fixes. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/linker/LoadUtil.java trunk/builder/src/builder/org/jnode/linker/StoreUtil.java trunk/builder/src/configure/org/jnode/configure/PatternType.java trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java trunk/core/src/core/org/jnode/vm/facade/Vm.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java trunk/core/src/vmmagic/org/vmmagic/unboxed/AddressArray.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java trunk/core/src/vmmagic/org/vmmagic/unboxed/ExtentArray.java trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReferenceArray.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java trunk/core/src/vmmagic/org/vmmagic/unboxed/OffsetArray.java trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java trunk/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java trunk/fs/src/driver/org/jnode/driver/block/floppy/DefaultFDC.java trunk/fs/src/driver/org/jnode/driver/block/floppy/FDC.java trunk/gui/src/driver/org/jnode/driver/ps2/PS2Bus.java trunk/gui/src/driver/org/jnode/driver/ps2/PS2ByteChannel.java trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xCore.java trunk/net/src/driver/org/jnode/driver/net/lance/LanceCore.java trunk/net/src/driver/org/jnode/driver/net/ne2000/Ne2000Core.java Modified: trunk/builder/src/builder/org/jnode/linker/LoadUtil.java =================================================================== --- trunk/builder/src/builder/org/jnode/linker/LoadUtil.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/builder/src/builder/org/jnode/linker/LoadUtil.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -193,7 +193,7 @@ /** * Load a program address. * - * @param out + * @param in * @param e_ident * @return * @throws IOException @@ -210,7 +210,7 @@ /** * Load a program address. * - * @param out + * @param in * @param e_ident * @return * @throws IOException @@ -227,7 +227,7 @@ /** * Load a file offset. * - * @param out + * @param in * @param e_ident * @return * @throws IOException @@ -244,7 +244,7 @@ /** * Load a file offset. * - * @param out + * @param in * @param e_ident * @return * @throws IOException @@ -261,7 +261,7 @@ /** * Load an Xword. * - * @param out + * @param in * @param e_ident * @return * @throws IOException @@ -278,7 +278,7 @@ /** * Load an Xword. * - * @param out + * @param in * @param e_ident * @return * @throws IOException Modified: trunk/builder/src/builder/org/jnode/linker/StoreUtil.java =================================================================== --- trunk/builder/src/builder/org/jnode/linker/StoreUtil.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/builder/src/builder/org/jnode/linker/StoreUtil.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -136,7 +136,7 @@ * * @param out * @param e_ident - * @param address + * @param off * @return * @throws IOException */ @@ -154,7 +154,7 @@ * * @param out * @param e_ident - * @param address + * @param xword * @return * @throws IOException */ Modified: trunk/builder/src/configure/org/jnode/configure/PatternType.java =================================================================== --- trunk/builder/src/configure/org/jnode/configure/PatternType.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/builder/src/configure/org/jnode/configure/PatternType.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -29,7 +29,7 @@ * This class represents a property type defined by a regex. The constructor * allows you to provide an "emptyToken" value. If provided, this value defines * a special token that will be mapped to the empty string by the - * {@link fromToken} method. + * {@link #fromValue(String)} method. * * @author cr...@jn... */ Modified: trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java =================================================================== --- trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/classlib/org/jnode/java/io/VMFileSystemAPI.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -29,7 +29,8 @@ * filesystem services. * The file paths given to the various methods are absolute and canonical. * - * @modif add mkDir mkFile Yves Galante (yve...@jm...) 01.04.2004 + * Modified: add mkDir mkFile Yves Galante (yve...@jm...) 01.04.2004 + * * @author epr */ public interface VMFileSystemAPI { Modified: trunk/core/src/core/org/jnode/vm/facade/Vm.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/Vm.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/core/org/jnode/vm/facade/Vm.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -51,7 +51,7 @@ * @param name * @return The counter */ - Counter getCounter(String string); + Counter getCounter(String name); /** * Gets or creates a counter group with a given name. Modified: trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -468,7 +468,7 @@ } /** - * @see org.jnode.vm.memmgr.VmHeapManager#createProcessorHeapData(org.jnode.vm.scheduler.VmProcessor) + * @see org.jnode.vm.memmgr.VmHeapManager#createProcessorHeapData(org.jnode.vm.facade.VmProcessor) */ public Object createProcessorHeapData(VmProcessor cpu) { // No need here, so return null. Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Address.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -24,8 +24,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/AddressArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/AddressArray.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/AddressArray.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -17,8 +17,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Extent.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -17,8 +17,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/ExtentArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/ExtentArray.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/ExtentArray.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -17,8 +17,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReference.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -27,8 +27,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReferenceArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReferenceArray.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/ObjectReferenceArray.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -17,8 +17,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Offset.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -18,8 +18,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/OffsetArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/OffsetArray.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/OffsetArray.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -17,8 +17,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Daniel Frampton */ Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/Word.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -21,8 +21,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * and see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Ewout Prangsma (ep...@us...) * @author Daniel Frampton Modified: trunk/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java =================================================================== --- trunk/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/core/src/vmmagic/org/vmmagic/unboxed/WordArray.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -17,8 +17,8 @@ * <u>JNode specific notes</u> : This class contains some "magic" * methods that are interpreted by the VM itself, instead of being executed * as normal java methods. <b>The actual method bodies are never used</b>. - * @see {@link org.jnode.classmgr.VmType VmType} to get the list of "magic" classes - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} + * See {@link org.jnode.vm.classmgr.VmType VmType} to get the list of "magic" classes + * see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod MagicMethod} * to get the list of "magic" methods * @author Daniel Frampton */ Modified: trunk/fs/src/driver/org/jnode/driver/block/floppy/DefaultFDC.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/floppy/DefaultFDC.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/fs/src/driver/org/jnode/driver/block/floppy/DefaultFDC.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -493,7 +493,7 @@ /** * @param irq - * @see org.jnode.system.IRQHandler#handleInterrupt(int) + * @see org.jnode.system.resource.IRQHandler#handleInterrupt(int) */ public void handleInterrupt(int irq) { final FloppyCommand cmd = currentCommand; Modified: trunk/fs/src/driver/org/jnode/driver/block/floppy/FDC.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/floppy/FDC.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/fs/src/driver/org/jnode/driver/block/floppy/FDC.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -82,7 +82,7 @@ /** * @param irq - * @see org.jnode.system.IRQHandler#handleInterrupt(int) + * @see org.jnode.system.resource.IRQHandler#handleInterrupt(int) */ public void handleInterrupt(int irq); Modified: trunk/gui/src/driver/org/jnode/driver/ps2/PS2Bus.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/ps2/PS2Bus.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/gui/src/driver/org/jnode/driver/ps2/PS2Bus.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -107,7 +107,7 @@ /** * Handles a PS/2 interrupt * - * @see org.jnode.system.IRQHandler#handleInterrupt(int) + * @see org.jnode.system.resource.IRQHandler#handleInterrupt(int) */ public final synchronized void handleInterrupt(int irq) { processQueues(); Modified: trunk/gui/src/driver/org/jnode/driver/ps2/PS2ByteChannel.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/ps2/PS2ByteChannel.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/gui/src/driver/org/jnode/driver/ps2/PS2ByteChannel.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -41,7 +41,7 @@ } /** - * @see org.jnode.system.IRQHandler#handleInterrupt(int) + * @see org.jnode.system.resource.IRQHandler#handleInterrupt(int) */ public void handleScancode(int b) { queue.enQueue((byte) b); Modified: trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xCore.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xCore.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xCore.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -321,7 +321,7 @@ } /** - * @see org.jnode.system.IRQHandler#handleInterrupt(int) + * @see org.jnode.system.resource.IRQHandler#handleInterrupt(int) */ public synchronized void handleInterrupt(int irq) { Modified: trunk/net/src/driver/org/jnode/driver/net/lance/LanceCore.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/lance/LanceCore.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/net/src/driver/org/jnode/driver/net/lance/LanceCore.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -283,7 +283,7 @@ } /** - * @see org.jnode.system.IRQHandler#handleInterrupt(int) + * @see org.jnode.system.resource.IRQHandler#handleInterrupt(int) */ public void handleInterrupt(int irq) { while ((io.getCSR(0) & CSR0_INTR) != 0) { Modified: trunk/net/src/driver/org/jnode/driver/net/ne2000/Ne2000Core.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/ne2000/Ne2000Core.java 2010-12-27 21:02:37 UTC (rev 5762) +++ trunk/net/src/driver/org/jnode/driver/net/ne2000/Ne2000Core.java 2011-01-03 10:19:11 UTC (rev 5763) @@ -287,7 +287,7 @@ } /** - * @see org.jnode.system.IRQHandler#handleInterrupt(int) + * @see org.jnode.system.resource.IRQHandler#handleInterrupt(int) */ public synchronized void handleInterrupt(int irq) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-01-03 10:44:38
|
Revision: 5764 http://jnode.svn.sourceforge.net/jnode/?rev=5764&view=rev Author: lsantha Date: 2011-01-03 10:44:31 +0000 (Mon, 03 Jan 2011) Log Message: ----------- Javadoc fixes. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/linker/LoadUtil.java trunk/builder/src/builder/org/jnode/linker/Section.java trunk/builder/src/builder/org/jnode/linker/StoreUtil.java trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java Modified: trunk/builder/src/builder/org/jnode/linker/LoadUtil.java =================================================================== --- trunk/builder/src/builder/org/jnode/linker/LoadUtil.java 2011-01-03 10:19:11 UTC (rev 5763) +++ trunk/builder/src/builder/org/jnode/linker/LoadUtil.java 2011-01-03 10:44:31 UTC (rev 5764) @@ -195,7 +195,7 @@ * * @param in * @param e_ident - * @return + * @return the address * @throws IOException */ public static long loadAddr(RandomAccessFile in, byte[] e_ident) @@ -212,7 +212,7 @@ * * @param in * @param e_ident - * @return + * @return the address * @throws IOException */ public static long loadAddr(InputStream in, byte[] e_ident) @@ -229,7 +229,7 @@ * * @param in * @param e_ident - * @return + * @return the offset * @throws IOException */ public static long loadOff(RandomAccessFile in, byte[] e_ident) @@ -246,7 +246,7 @@ * * @param in * @param e_ident - * @return + * @return the offset * @throws IOException */ public static long loadOff(InputStream in, byte[] e_ident) @@ -263,7 +263,7 @@ * * @param in * @param e_ident - * @return + * @return the xword * @throws IOException */ public static long loadXword(RandomAccessFile in, byte[] e_ident) @@ -275,12 +275,12 @@ } } - /** + /** Sc * Load an Xword. * * @param in * @param e_ident - * @return + * @return the xword * @throws IOException */ public static long loadXword(InputStream in, byte[] e_ident) Modified: trunk/builder/src/builder/org/jnode/linker/Section.java =================================================================== --- trunk/builder/src/builder/org/jnode/linker/Section.java 2011-01-03 10:19:11 UTC (rev 5763) +++ trunk/builder/src/builder/org/jnode/linker/Section.java 2011-01-03 10:44:31 UTC (rev 5764) @@ -181,7 +181,7 @@ /** * Gets the name of this section. * - * @return + * @return the name of this section */ public String getName() { return elf.getSHString(sh_name); Modified: trunk/builder/src/builder/org/jnode/linker/StoreUtil.java =================================================================== --- trunk/builder/src/builder/org/jnode/linker/StoreUtil.java 2011-01-03 10:19:11 UTC (rev 5763) +++ trunk/builder/src/builder/org/jnode/linker/StoreUtil.java 2011-01-03 10:44:31 UTC (rev 5764) @@ -119,7 +119,7 @@ * @param out * @param e_ident * @param address - * @return + * @return the number of bytes stored * @throws IOException */ public static int storeAddr(OutputStream out, byte[] e_ident, @@ -137,7 +137,7 @@ * @param out * @param e_ident * @param off - * @return + * @return the number of bytes stored * @throws IOException */ public static int storeOff(OutputStream out, byte[] e_ident, @@ -155,7 +155,7 @@ * @param out * @param e_ident * @param xword - * @return + * @return the number of bytes stored * @throws IOException */ public static int storeXword(OutputStream out, byte[] e_ident, Modified: trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java 2011-01-03 10:19:11 UTC (rev 5763) +++ trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java 2011-01-03 10:44:31 UTC (rev 5764) @@ -45,7 +45,7 @@ * @param resolver * @param imt * @param imtCollisions - * @return + * @return the CompiledIMT instance */ public abstract CompiledIMT compile(ObjectResolver resolver, Object[] imt, boolean[] imtCollisions); } Modified: trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java 2011-01-03 10:19:11 UTC (rev 5763) +++ trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java 2011-01-03 10:44:31 UTC (rev 5764) @@ -92,14 +92,14 @@ /** * Get this heap's statistics. * - * @return + * @return the heap statistics */ HeapStatistics getHeapStatistics(); /** * Get this heap GC's statistics. * - * @return + * @return the heap GC statistics */ GCStatistics getStatistics(); Modified: trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java 2011-01-03 10:19:11 UTC (rev 5763) +++ trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java 2011-01-03 10:44:31 UTC (rev 5764) @@ -82,7 +82,7 @@ } /** - * @see org.jnode.vm.scheduler.VmThread#accept(org.jnode.vm.facade.ObjectVisitor, org.jnode.vm.memmgr.VmHeapManager) + * @see org.jnode.vm.scheduler.VmThread#accept(org.jnode.vm.facade.ObjectVisitor, org.jnode.vm.facade.VmHeapManager) */ public boolean accept(ObjectVisitor visitor, VmHeapManager heapManager) { if (!super.accept(visitor, heapManager)) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2011-01-03 10:19:11 UTC (rev 5763) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2011-01-03 10:44:31 UTC (rev 5764) @@ -34,7 +34,7 @@ * Convert a method code into an X86 condition code. * * @param mcode - * @return + * @return the x86 condition code */ protected final int methodToCC(MagicMethod mcode) { switch (mcode) { @@ -65,10 +65,10 @@ } /** - * Convert a method code into an X86 condition code. + * Convert a method code into an x86 shift code. * * @param mcode - * @return + * @return the x86 shift code */ protected final int methodToShift(MagicMethod mcode) { switch (mcode) { Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2011-01-03 10:19:11 UTC (rev 5763) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2011-01-03 10:44:31 UTC (rev 5764) @@ -160,7 +160,7 @@ * @param parentId * @param nodeId * @param nodeType - * @return + * @return the new node instance */ public LeafRecord createNode(String filename, CatalogNodeId parentId, CatalogNodeId nodeId, int nodeType) throws IOException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-03-06 21:00:22
|
Revision: 5808 http://jnode.svn.sourceforge.net/jnode/?rev=5808&view=rev Author: lsantha Date: 2011-03-06 21:00:15 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Following up class library changes. Modified Paths: -------------- trunk/all/conf/core-classes.txt trunk/core/descriptors/org.classpath.core.xml Modified: trunk/all/conf/core-classes.txt =================================================================== --- trunk/all/conf/core-classes.txt 2011-03-06 20:51:14 UTC (rev 5807) +++ trunk/all/conf/core-classes.txt 2011-03-06 21:00:15 UTC (rev 5808) @@ -116,6 +116,7 @@ //sun.reflect.generics.visitor //sun.reflect.misc sun.misc.VM +sun.net.ApplicationProxy sun.nio sun.nio.cs.US_ASCII sun.nio.cs.ISO_8859_1* Modified: trunk/core/descriptors/org.classpath.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.xml 2011-03-06 20:51:14 UTC (rev 5807) +++ trunk/core/descriptors/org.classpath.core.xml 2011-03-06 21:00:15 UTC (rev 5808) @@ -53,6 +53,7 @@ <export name="sun.misc.ServiceConfigurationError"/> <export name="sun.misc.VM"/> + <export name="sun.net.ApplicationProxy*"/> <export name="sun.nio.cs.*"/> <export name="sun.text.*"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-31 13:43:50
|
Revision: 5839 http://jnode.svn.sourceforge.net/jnode/?rev=5839&view=rev Author: lsantha Date: 2011-07-31 13:43:44 +0000 (Sun, 31 Jul 2011) Log Message: ----------- Added support for loading the removable media into a removable device. Modified Paths: -------------- trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java Modified: trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2011-07-31 13:42:10 UTC (rev 5838) +++ trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2011-07-31 13:43:44 UTC (rev 5839) @@ -73,4 +73,12 @@ */ public void eject() throws IOException; + + /** + * Eject this device. + * + * @throws IOException + */ + public void load() + throws IOException; } Modified: trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java 2011-07-31 13:42:10 UTC (rev 5838) +++ trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java 2011-07-31 13:43:44 UTC (rev 5839) @@ -290,6 +290,11 @@ throw new IOException("Unsupported operation"); } + @Override + public void load() throws IOException { + throw new IOException("Unsupported operation"); + } + /** * Test if the disk has been changed and/or the format of the loaded floppy * is known. If the floppy has been changed or the format of the floppy is Modified: trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java 2011-07-31 13:42:10 UTC (rev 5838) +++ trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java 2011-07-31 13:43:44 UTC (rev 5839) @@ -239,6 +239,31 @@ } /** + * Load this device. + * + * @throws IOException + */ + public void load() throws IOException { + if (locked) { + throw new IOException("Device is locked"); + } + final SCSIDevice dev = (SCSIDevice) getDevice(); + try { + MMCUtils.startStopUnit(dev, CDBStartStopUnit.Action.LOAD, false); + } catch (SCSIException ex) { + final IOException ioe = new IOException(); + ioe.initCause(ex); + throw ioe; + } catch (TimeoutException ex) { + final IOException ioe = new IOException(); + ioe.initCause(ex); + throw ioe; + } catch (InterruptedException ex) { + throw new InterruptedIOException(); + } + } + + /** * Process the changed flag. * * @throws IOException Modified: trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java 2011-07-31 13:42:10 UTC (rev 5838) +++ trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java 2011-07-31 13:43:44 UTC (rev 5839) @@ -217,4 +217,9 @@ // TODO Auto-generated method stub } + + @Override + public void load() throws IOException { + //To change body of implemented methods use File | Settings | File Templates. + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2011-08-11 11:42:19
|
Revision: 5845 http://jnode.svn.sourceforge.net/jnode/?rev=5845&view=rev Author: galatnm Date: 2011-08-11 11:42:10 +0000 (Thu, 11 Aug 2011) Log Message: ----------- FS : clean up HFS+ code. Modified Paths: -------------- trunk/JNode.ipr trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java trunk/fs/src/fs/org/jnode/fs/ext2/Superblock.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystemType.java trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java Added Paths: ----------- trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java Removed Paths: ------------- trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java Modified: trunk/JNode.ipr =================================================================== --- trunk/JNode.ipr 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/JNode.ipr 2011-08-11 11:42:10 UTC (rev 5845) @@ -17,11 +17,11 @@ <component name="CheckStyle-IDEA"> <option name="configuration"> <map> - <entry key="active-configuration" value="FILE:$PROJECT_DIR$/all/jnode_checks.xml:JNode" /> + <entry key="active-configuration" value="FILE:/home/flesire/developement/sources/jnode/jnode.orig/all/jnode_checks.xml:JNode" /> <entry key="check-test-classes" value="true" /> <entry key="config-file" value="$PROJECT_DIR$/all/jnode_checks.xml" /> <entry key="location-0" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules." /> - <entry key="location-1" value="FILE:$PROJECT_DIR$/all/jnode_checks.xml:JNode" /> + <entry key="location-1" value="FILE:/home/flesire/developement/sources/jnode/jnode.orig/all/jnode_checks.xml:JNode" /> <entry key="thirdparty-classpath" value="" /> </map> </option> @@ -214,12 +214,13 @@ </component> <component name="IdProvider" IDEtalkID="435AAC2234C36B0F2257FA7F02C447FB" /> <component name="InspectionProjectProfileManager"> - <list size="5"> + <list size="6"> <item index="0" class="java.lang.String" itemvalue="SERVER PROBLEM" /> - <item index="1" class="java.lang.String" itemvalue="INFO" /> - <item index="2" class="java.lang.String" itemvalue="TYPO" /> - <item index="3" class="java.lang.String" itemvalue="WARNING" /> - <item index="4" class="java.lang.String" itemvalue="ERROR" /> + <item index="1" class="java.lang.String" itemvalue="WEAK WARNING" /> + <item index="2" class="java.lang.String" itemvalue="INFO" /> + <item index="3" class="java.lang.String" itemvalue="TYPO" /> + <item index="4" class="java.lang.String" itemvalue="WARNING" /> + <item index="5" class="java.lang.String" itemvalue="ERROR" /> </list> </component> <component name="JavacSettings"> Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -45,32 +45,13 @@ log.setLevel(Level.DEBUG); } - /** - * @see org.jnode.fs.FSFile#getLength() - */ + @Override public long getLength() { //log.debug("getLength(): "+iNode.getSize()); return iNode.getSize(); } - private long getLengthInBlocks() { - return iNode.getSizeInBlocks(); - } - - private void rereadInode() throws IOException { - int iNodeNr = iNode.getINodeNr(); - try { - iNode = ((Ext2FileSystem) getFileSystem()).getINode(iNodeNr); - } catch (FileSystemException ex) { - final IOException ioe = new IOException(); - ioe.initCause(ex); - throw ioe; - } - } - - /** - * @see org.jnode.fs.FSFile#setLength(long) - */ + @Override public void setLength(long length) throws IOException { if (!canWrite()) throw new ReadOnlyFileSystemException("FileSystem or File is readonly"); @@ -163,9 +144,9 @@ } // synchronized(inode) } - /** - * @see org.jnode.fs.FSFile#read(long, ByteBuffer) - */ + + + @Override public void read(long fileOffset, ByteBuffer destBuf) throws IOException { final int len = destBuf.remaining(); final int off = 0; @@ -174,8 +155,7 @@ final byte[] dest = destBA.toArray(); //synchronize to the inode cache to make sure that the inode does not - // get - //flushed between reading it and locking it + // get flushed between reading it and locking it synchronized (((Ext2FileSystem) getFileSystem()).getInodeCache()) { //reread the inode before synchronizing to it to make sure //all threads use the same instance @@ -228,13 +208,7 @@ destBA.refreshByteBuffer(); } - /** - * Write into the file. fileOffset is between 0 and getLength() (see the - * methods write(byte[], int, int), setPosition(long), setLength(long) in - * org.jnode.fs.service.def.FileHandleImpl) - * - * @see org.jnode.fs.FSFile#write(long, ByteBuffer) - */ + @Override public void write(long fileOffset, ByteBuffer srcBuf) throws IOException { final int len = srcBuf.remaining(); final int off = 0; @@ -331,11 +305,7 @@ } } - /** - * Flush any cached data to the disk. - * - * @throws IOException - */ + @Override public void flush() throws IOException { log.debug("Ext2File.flush()"); iNode.update(); @@ -343,4 +313,19 @@ //been allocated or deallocated iNode.getExt2FileSystem().updateFS(); } + + private long getLengthInBlocks() { + return iNode.getSizeInBlocks(); + } + + private void rereadInode() throws IOException { + int iNodeNr = iNode.getINodeNr(); + try { + iNode = ((Ext2FileSystem) getFileSystem()).getINode(iNodeNr); + } catch (FileSystemException ex) { + final IOException ioe = new IOException(); + ioe.initCause(ex); + throw ioe; + } + } } Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -91,7 +91,7 @@ // skip the first 1024 bytes (bootsector) and read the superblock // TODO: the superblock should read itself getApi().read(1024, data); - // superblock = new Superblock(data, this); + // superblock = new SuperBlock(data, this); superblock = new Superblock(); superblock.read(data.array(), this); Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Superblock.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Superblock.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Superblock.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -157,7 +157,7 @@ setPreallocBlocks(8); setPreallocDirBlocks(0); - log.debug("Superblock.create(): getBlockSize(): " + getBlockSize()); + log.debug("SuperBlock.create(): getBlockSize(): " + getBlockSize()); } /** @@ -693,7 +693,7 @@ } /** - * @return the Superblock's dirty flag + * @return the SuperBlock's dirty flag */ public boolean isDirty() { return dirty; Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -29,6 +29,7 @@ import org.apache.log4j.Logger; import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; +import org.jnode.fs.FileSystem; import org.jnode.fs.ReadOnlyFileSystemException; import org.jnode.fs.hfsplus.catalog.Catalog; import org.jnode.fs.hfsplus.catalog.CatalogFile; @@ -38,26 +39,29 @@ import org.jnode.fs.hfsplus.tree.LeafRecord; import org.jnode.fs.spi.FSEntryTable; -public class HfsPlusDirectory extends HfsPlusEntry implements FSDirectory { +public class HfsPlusDirectory implements FSDirectory { private static final Logger log = Logger.getLogger(HfsPlusDirectory.class); + /** The directory entry */ + private HfsPlusEntry entry; + /** Table of entries of our parent */ private FSEntryTable entries; + /** The catalog directory record */ private CatalogFolder folder; - public HfsPlusDirectory(HfsPlusFileSystem fs, HfsPlusDirectory parent, String name, - LeafRecord record) { - super(fs, parent, name, record); - this.folder = new CatalogFolder(record.getData()); + public HfsPlusDirectory(HfsPlusEntry entry) { + this.entry = entry; + this.folder = new CatalogFolder(entry.getData()); this.entries = FSEntryTable.EMPTY_TABLE; } @Override public FSEntry addDirectory(String name) throws IOException { log.debug("<<< BEGIN addDirectory " + name + " >>>"); - if (fs.isReadOnly()) { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } @@ -73,7 +77,7 @@ @Override public FSEntry addFile(String name) throws IOException { log.debug("<<< BEGIN addFile " + name + " >>>"); - if (fs.isReadOnly()) { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } if (getEntry(name) != null) { @@ -86,10 +90,11 @@ return newEntry; } - private final FSEntry createFileEntry(final String name) throws IOException { + private FSEntry createFileEntry(final String name) throws IOException { + //TODO implements this method. /* * if (fs.isReadOnly()) { throw new ReadOnlyFileSystemException(); } - * Catalog catalog = fs.getCatalog(); Superblock volumeHeader = + * Catalog catalog = fs.getCatalog(); SuperBlock volumeHeader = * ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); LeafRecord * fileRecord = catalog.createNode(name, this.folder .getFolderId(), new * CatalogNodeId(volumeHeader.getNextCatalogId()), @@ -107,14 +112,14 @@ @Override public void flush() throws IOException { log.debug("<<< BEGIN flush >>>"); - if (fs.isReadOnly()) { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } boolean flushEntries = isEntriesLoaded() && entries.isDirty(); - if (isDirty() || flushEntries) { + if (entry.isDirty() || flushEntries) { writeEntries(entries); // entries.resetDirty(); - resetDirty(); + entry.resetDirty(); } log.debug("<<< END flush >>>"); } @@ -137,13 +142,12 @@ @Override public void remove(String name) throws IOException { - if (fs.isReadOnly()) { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } if (entries.remove(name) >= 0) { - setDirty(); + entry.setDirty(); flush(); - return; } else { throw new FileNotFoundException(name); } @@ -160,7 +164,7 @@ if (!isEntriesLoaded()) { log.debug("checkEntriesLoaded : loading"); try { - if (rights.canRead()) { + if (entry.getAccessRights().canRead()) { entries = readEntries(); log.debug("Load " + entries.size() + " entrie(s)."); } else { @@ -169,7 +173,7 @@ entries = FSEntryTable.EMPTY_TABLE; log.debug("checkEntriesLoaded : can't read, using EMPTY_TABLE"); } - resetDirty(); + entry.resetDirty(); } catch (IOException e) { log.fatal("unable to read directory entries", e); // the next time, we will call checkEntriesLoaded() @@ -185,16 +189,16 @@ * * @return if the entries are already loaded from the device */ - private final boolean isEntriesLoaded() { + private boolean isEntriesLoaded() { return (entries != FSEntryTable.EMPTY_TABLE); } /** * - * @return + * @return read all entries link to the current directory in the file system. * @throws IOException */ - private final FSEntryTable readEntries() throws IOException { + private FSEntryTable readEntries() throws IOException { List<FSEntry> pathList = new LinkedList<FSEntry>(); HfsPlusFileSystem fs = (HfsPlusFileSystem) getFileSystem(); if (fs.getVolumeHeader().getFolderCount() > 0) { @@ -203,7 +207,7 @@ if (rec.getType() == CatalogFolder.RECORD_TYPE_FOLDER || rec.getType() == CatalogFile.RECORD_TYPE_FILE) { String name = ((CatalogKey) rec.getKey()).getNodeName().getUnicodeString(); - HfsPlusEntry e = new HfsPlusDirectory(fs, this, name, rec); + HfsPlusEntry e = new HfsPlusEntry(fs, this, name, rec); pathList.add(e); } } @@ -217,23 +221,23 @@ /** * - * @param name - * @return - * @throws IOException + * @param name The name of the entry. + * @return Return the newly created entry. + * @throws IOException if problem occurs during catalog node creation or if system is read-only. */ - private final FSEntry createDirectoryEntry(final String name) throws IOException { - if (fs.isReadOnly()) { + private FSEntry createDirectoryEntry(final String name) throws IOException { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } - Catalog catalog = fs.getCatalog(); - Superblock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); + Catalog catalog = ((HfsPlusFileSystem)getFileSystem()).getCatalog(); + SuperBlock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); LeafRecord folderRecord = catalog.createNode(name, this.folder.getFolderId(), new CatalogNodeId(volumeHeader.getNextCatalogId()), CatalogFolder.RECORD_TYPE_FOLDER_THREAD); folder.setValence(folder.getValence() + 1); - HfsPlusEntry newEntry = new HfsPlusDirectory(fs, this, name, folderRecord); + HfsPlusEntry newEntry = new HfsPlusEntry((HfsPlusFileSystem)getFileSystem(), this, name, folderRecord); newEntry.setDirty(); volumeHeader.setFolderCount(volumeHeader.getFolderCount() + 1); log.debug("New volume header :\n" + volumeHeader.toString()); @@ -247,14 +251,22 @@ * @param newEntry * @throws IOException */ - private final void setFreeEntry(FSEntry newEntry) throws IOException { + private void setFreeEntry(FSEntry newEntry) throws IOException { checkEntriesLoaded(); if (entries.setFreeEntry(newEntry) >= 0) { log.debug("setFreeEntry: free entry found !"); - setDirty(); + entry.setDirty(); flush(); - return; } } + @Override + public boolean isValid() { + return entry.isValid(); + } + + @Override + public FileSystem<?> getFileSystem() { + return entry.getFileSystem(); + } } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -26,6 +26,7 @@ import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; import org.jnode.fs.FSFile; +import org.jnode.fs.FSObject; import org.jnode.fs.FileSystem; import org.jnode.fs.hfsplus.catalog.CatalogFile; import org.jnode.fs.hfsplus.catalog.CatalogFolder; @@ -87,7 +88,7 @@ if (!isDirectory()) { throw new IOException("It is not a Directory"); } - return (HfsPlusDirectory) this; + return new HfsPlusDirectory(this); } @Override @@ -95,7 +96,7 @@ if (!isFile()) { throw new IOException("It is not a file"); } - return (HfsPlusFile) this; + return new HfsPlusFile(this); } @Override @@ -164,4 +165,8 @@ return valid; } + public byte[] getData(){ + return this.record.getData(); + } + } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -24,17 +24,19 @@ import java.nio.ByteBuffer; import org.jnode.fs.FSFile; +import org.jnode.fs.FileSystem; import org.jnode.fs.hfsplus.catalog.CatalogFile; import org.jnode.fs.hfsplus.extent.ExtentDescriptor; import org.jnode.fs.hfsplus.tree.LeafRecord; -public class HfsPlusFile extends HfsPlusEntry implements FSFile { +public class HfsPlusFile implements FSFile { + private HfsPlusEntry entry; + private CatalogFile file; - public HfsPlusFile(HfsPlusFileSystem fs, HfsPlusDirectory parent, String name, LeafRecord record) { - super(fs, parent, name, record); - this.file = new CatalogFile(record.getData()); + public HfsPlusFile(HfsPlusEntry entry) { + this.file = new CatalogFile(entry.getData()); } @Override @@ -48,11 +50,16 @@ } @Override + public void setLength(final long length) throws IOException { + // TODO Auto-generated method stub + } + + @Override public final void read(final long fileOffset, final ByteBuffer dest) throws IOException { HfsPlusFileSystem fs = (HfsPlusFileSystem) getFileSystem(); for (ExtentDescriptor d : file.getDatas().getExtents()) { if (!d.isEmpty()) { - long firstOffset = d.getStartOffset(fs.getVolumeHeader().getBlockSize()); + long firstOffset = (long) d.getStartOffset(fs.getVolumeHeader().getBlockSize()); fs.getApi().read(firstOffset, dest); } } @@ -64,9 +71,14 @@ } - public void setLength(final long length) throws IOException { - // TODO Auto-generated method stub + @Override + public boolean isValid() { + return entry.isValid(); } + @Override + public FileSystem<?> getFileSystem() { + return entry.getFileSystem(); + } } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -37,7 +37,7 @@ private final Logger log = Logger.getLogger(getClass()); /** HFS volume header */ - private Superblock volumeHeader; + private SuperBlock volumeHeader; /** Catalog special file for this instance */ private Catalog catalog; @@ -55,22 +55,22 @@ } /** - * + * * @throws FileSystemException */ public final void read() throws FileSystemException { - volumeHeader = new Superblock(this, false); + volumeHeader = new SuperBlock(this, false); log.debug(volumeHeader.toString()); - if (!volumeHeader.isAttribute(Superblock.HFSPLUS_VOL_UNMNT_BIT)) { + if (!volumeHeader.isAttribute(SuperBlock.HFSPLUS_VOL_UNMNT_BIT)) { log.info(getDevice().getId() + " Filesystem has not been cleanly unmounted, mounting it readonly"); setReadOnly(true); } - if (volumeHeader.isAttribute(Superblock.HFSPLUS_VOL_SOFTLOCK_BIT)) { + if (volumeHeader.isAttribute(SuperBlock.HFSPLUS_VOL_SOFTLOCK_BIT)) { log.info(getDevice().getId() + " Filesystem is marked locked, mounting it readonly"); setReadOnly(true); } - if (volumeHeader.isAttribute(Superblock.HFSPLUS_VOL_JOURNALED_BIT)) { + if (volumeHeader.isAttribute(SuperBlock.HFSPLUS_VOL_JOURNALED_BIT)) { log .info(getDevice().getId() + " Filesystem is journaled, write access is not supported. Mounting it readonly"); @@ -98,35 +98,20 @@ log.info("Create root entry."); LeafRecord record = catalog.getRecord(CatalogNodeId.HFSPLUS_POR_CNID); if (record != null) { - return new HfsPlusDirectory(this, null, "/", record); + return new HfsPlusEntry(this, null, "/", record); } log.error("Root entry : No record found."); return null; } - /* - * (non-Javadoc) - * - * @see org.jnode.fs.FileSystem#getFreeSpace() - */ public final long getFreeSpace() { return volumeHeader.getFreeBlocks() * volumeHeader.getBlockSize(); } - /* - * (non-Javadoc) - * - * @see org.jnode.fs.FileSystem#getTotalSpace() - */ public final long getTotalSpace() { return volumeHeader.getTotalBlocks() * volumeHeader.getBlockSize(); } - /* - * (non-Javadoc) - * - * @see org.jnode.fs.FileSystem#getUsableSpace() - */ public final long getUsableSpace() { return -1; } @@ -135,7 +120,7 @@ return catalog; } - public final Superblock getVolumeHeader() { + public final SuperBlock getVolumeHeader() { return volumeHeader; } @@ -147,7 +132,7 @@ * @throws FileSystemException */ public void create(HFSPlusParams params) throws FileSystemException { - volumeHeader = new Superblock(this, true); + volumeHeader = new SuperBlock(this, true); try { params.initializeDefaultsValues(this); volumeHeader.create(params); Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystemType.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystemType.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystemType.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -63,7 +63,7 @@ return false; } int magicNumber = BigEndian.getInt16(magic.array(), 0); - return (magicNumber == Superblock.HFSPLUS_SUPER_MAGIC); + return (magicNumber == SuperBlock.HFSPLUS_SUPER_MAGIC); } } Copied: trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java (from rev 5844, trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java) =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java (rev 0) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -0,0 +1,475 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.fs.hfsplus; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Calendar; +import java.util.Date; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.jnode.fs.FileSystemException; +import org.jnode.fs.hfsplus.catalog.CatalogNodeId; +import org.jnode.fs.hfsplus.extent.ExtentDescriptor; +import org.jnode.util.BigEndian; +import org.jnode.util.NumberUtils; + +/** + * HFS+ volume header definition. + * + * @author Fabien Lesire + * + */ +public class SuperBlock extends HfsPlusObject { + + public static final int HFSPLUS_SUPER_MAGIC = 0x482b; + + public static final int HFSPLUS_MIN_VERSION = 0x0004; /* HFS+ */ + public static final int HFSPLUS_CURRENT_VERSION = 5; /* HFSX */ + + /* HFS+ volume attributes */ + public static final int HFSPLUS_VOL_UNMNT_BIT = 8; + public static final int HFSPLUS_VOL_SPARE_BLK_BIT = 9; + public static final int HFSPLUS_VOL_NOCACHE_BIT = 10; + public static final int HFSPLUS_VOL_INCNSTNT_BIT = 11; + public static final int HFSPLUS_VOL_NODEID_REUSED_BIT = 12; + public static final int HFSPLUS_VOL_JOURNALED_BIT = 13; + public static final int HFSPLUS_VOL_SOFTLOCK_BIT = 15; + + private final Logger log = Logger.getLogger(getClass()); + + /** Volume header data length */ + public static final int SUPERBLOCK_LENGTH = 1024; + + /** Data bytes array that contains volume header information */ + private byte[] data; + + /** + * Create the volume header and load information for the file system passed + * as parameter. + * + * @param fs The file system contains HFS+ partition. + * + * @throws FileSystemException If magic number (0X482B) is incorrect or not + * available. + */ + public SuperBlock(final HfsPlusFileSystem fs, boolean create) throws FileSystemException { + super(fs); + log.setLevel(Level.INFO); + data = new byte[SUPERBLOCK_LENGTH]; + try { + if (!create) { + log.info("load HFS+ volume header."); + // skip the first 1024 bytes (boot sector) and read the volume + // header. + ByteBuffer b = ByteBuffer.allocate(SUPERBLOCK_LENGTH); + fs.getApi().read(1024, b); + data = new byte[SUPERBLOCK_LENGTH]; + System.arraycopy(b.array(), 0, data, 0, SUPERBLOCK_LENGTH); + if (getMagic() != HFSPLUS_SUPER_MAGIC) { + throw new FileSystemException("Not hfs+ volume header (" + getMagic() + + ": bad magic)"); + } + + } + } catch (IOException e) { + throw new FileSystemException(e); + } + } + + /** + * Create a new volume header. + * + * @param params File system format parameters. + * @throws IOException + */ + public void create(HFSPlusParams params) throws IOException { + log.info("Create new HFS+ volume header (" + params.getVolumeName() + + ") with block size of " + params.getBlockSize() + " bytes."); + int burnedBlocksBeforeVH = 0; + int burnedBlocksAfterAltVH = 0; + /* + * Volume header is located at sector 2. Block before this position must + * be invalidated. + */ + int blockSize = params.getBlockSize(); + if (blockSize == 512) { + burnedBlocksBeforeVH = 2; + burnedBlocksAfterAltVH = 1; + } else if (blockSize == 1024) { + burnedBlocksBeforeVH = 1; + } + // Populate volume header. + this.setMagic(HFSPLUS_SUPER_MAGIC); + this.setVersion(HFSPLUS_MIN_VERSION); + // Set attributes. + this.setAttribute(HFSPLUS_VOL_UNMNT_BIT); + this.setLastMountedVersion(0x446534a); + Calendar now = Calendar.getInstance(); + now.setTime(new Date()); + int macDate = HfsUtils.getNow(); + this.setCreateDate(macDate); + this.setModifyDate(macDate); + this.setCheckedDate(macDate); + // --- + this.setBlockSize(blockSize); + this.setTotalBlocks((int) params.getBlockCount()); + this.setFreeBlocks((int) params.getBlockCount()); + this.setRsrcClumpSize(params.getResourceClumpSize()); + this.setDataClumpSize(params.getDataClumpSize()); + this.setNextCatalogId(CatalogNodeId.HFSPLUS_FIRSTUSER_CNID.getId()); + // Allocation file creation + log.info("Init allocation file."); + long allocationClumpSize = getClumpSize(params.getBlockCount()); + long bitmapBlocks = allocationClumpSize / blockSize; + long blockUsed = 2 + burnedBlocksBeforeVH + burnedBlocksAfterAltVH + bitmapBlocks; + int startBlock = 1 + burnedBlocksBeforeVH; + int blockCount = (int) bitmapBlocks; + HfsPlusForkData forkdata = + new HfsPlusForkData(allocationClumpSize, (int) allocationClumpSize, + (int) bitmapBlocks); + ExtentDescriptor desc = new ExtentDescriptor(startBlock, blockCount); + forkdata.addDescriptor(0, desc); + forkdata.write(data, 112); + // Journal creation + int nextBlock = 0; + if (params.isJournaled()) { + this.setFileCount(2); + this.setAttribute(HFSPLUS_VOL_JOURNALED_BIT); + this.setNextCatalogId(this.getNextCatalogId() + 2); + this.setJournalInfoBlock(desc.getNext()); + blockUsed = blockUsed + 1 + (params.getJournalSize() / blockSize); + } else { + this.setJournalInfoBlock(0); + nextBlock = desc.getNext(); + } + // Extent B-Tree initialization + log.info("Init extent file."); + forkdata = + new HfsPlusForkData(params.getExtentClumpSize(), params.getExtentClumpSize(), + (params.getExtentClumpSize() / blockSize)); + desc = new ExtentDescriptor(nextBlock, forkdata.getTotalBlocks()); + forkdata.addDescriptor(0, desc); + forkdata.write(data, 192); + blockUsed += forkdata.getTotalBlocks(); + nextBlock = desc.getNext(); + // Catalog B-Tree initialization + log.info("Init catalog file."); + int totalBlocks = params.getCatalogClumpSize() / blockSize; + forkdata = + new HfsPlusForkData(params.getCatalogClumpSize(), params.getCatalogClumpSize(), + totalBlocks); + desc = new ExtentDescriptor(nextBlock, totalBlocks); + forkdata.addDescriptor(0, desc); + forkdata.write(data, 272); + blockUsed += totalBlocks; + + this.setFreeBlocks(this.getFreeBlocks() - (int) blockUsed); + this.setNextAllocation((int) blockUsed - 1 - burnedBlocksAfterAltVH + 10 * + (this.getCatalogFile().getClumpSize() / this.getBlockSize())); + } + + /** + * Calculate the number of blocks needed for bitmap. + * + * @param totalBlocks Total of blocks found in the device. + * @return the number of blocks. + * @throws IOException + */ + private long getClumpSize(long totalBlocks) throws IOException { + long clumpSize; + long minClumpSize = totalBlocks >> 3; + if ((totalBlocks & 7) == 0) { + ++minClumpSize; + } + clumpSize = minClumpSize; + return clumpSize; + } + + // Getters/setters + + public final int getMagic() { + return BigEndian.getInt16(data, 0); + } + + public final void setMagic(final int value) { + BigEndian.setInt16(data, 0, value); + } + + // + public final int getVersion() { + return BigEndian.getInt16(data, 2); + } + + public final void setVersion(final int value) { + BigEndian.setInt16(data, 2, value); + } + + // + public final int getAttributes() { + + return BigEndian.getInt32(data, 4); + } + + public final void setAttribute(final int attributeMaskBit) { + BigEndian.setInt32(data, 4, getAttributes() | (1 << attributeMaskBit)); + } + + // + public final int getLastMountedVersion() { + return BigEndian.getInt32(data, 8); + } + + public final void setLastMountedVersion(final int value) { + BigEndian.setInt32(data, 8, value); + } + + // + public final int getJournalInfoBlock() { + return BigEndian.getInt32(data, 12); + } + + public final void setJournalInfoBlock(final int value) { + BigEndian.setInt32(data, 12, value); + } + + // + public final long getCreateDate() { + return BigEndian.getUInt32(data, 16); + } + + public final void setCreateDate(final int value) { + BigEndian.setInt32(data, 16, value); + } + + public final long getModifyDate() { + return BigEndian.getUInt32(data, 20); + } + + public final void setModifyDate(final int value) { + BigEndian.setInt32(data, 20, value); + } + + public final long getBackupDate() { + return BigEndian.getUInt32(data, 24); + } + + public final void setBackupDate(final int value) { + BigEndian.setInt32(data, 24, value); + } + + public final long getCheckedDate() { + return BigEndian.getUInt32(data, 28); + } + + public final void setCheckedDate(final int value) { + BigEndian.setInt32(data, 28, value); + } + + // + public final int getFileCount() { + return BigEndian.getInt32(data, 32); + } + + public final void setFileCount(final int value) { + BigEndian.setInt32(data, 32, value); + } + + // + public final int getFolderCount() { + return BigEndian.getInt32(data, 36); + } + + public final void setFolderCount(final int value) { + BigEndian.setInt32(data, 36, value); + } + + // + public final int getBlockSize() { + return BigEndian.getInt32(data, 40); + } + + public final void setBlockSize(final int value) { + BigEndian.setInt32(data, 40, value); + } + + // + public final int getTotalBlocks() { + return BigEndian.getInt32(data, 44); + } + + public final void setTotalBlocks(final int value) { + BigEndian.setInt32(data, 44, value); + } + + // + public final int getFreeBlocks() { + return BigEndian.getInt32(data, 48); + } + + public final void setFreeBlocks(final int value) { + BigEndian.setInt32(data, 48, value); + } + + // + public final int getNextAllocation() { + return BigEndian.getInt32(data, 52); + } + + public final void setNextAllocation(final int value) { + BigEndian.setInt32(data, 52, value); + } + + public final long getRsrcClumpSize() { + return BigEndian.getInt32(data, 56); + } + + public final void setRsrcClumpSize(final int value) { + BigEndian.setInt32(data, 56, value); + } + + public final int getDataClumpSize() { + return BigEndian.getInt32(data, 60); + } + + public final void setDataClumpSize(final int value) { + BigEndian.setInt32(data, 60, value); + } + + public final int getNextCatalogId() { + return BigEndian.getInt32(data, 64); + } + + public final void setNextCatalogId(final int value) { + BigEndian.setInt32(data, 64, value); + } + + public final int getWriteCount() { + return BigEndian.getInt32(data, 68); + } + + public final void setWriteCount(final int value) { + BigEndian.setInt32(data, 68, value); + } + + public final long getEncodingsBmp() { + return BigEndian.getInt64(data, 72); + } + + public final void setEncodingsBmp(final long value) { + BigEndian.setInt64(data, 72, value); + } + + public final byte[] getFinderInfo() { + byte[] result = new byte[32]; + System.arraycopy(data, 80, result, 0, 32); + return result; + } + + public final HfsPlusForkData getAllocationFile() { + return new HfsPlusForkData(data, 112); + } + + public final HfsPlusForkData getExtentsFile() { + return new HfsPlusForkData(data, 192); + } + + public final HfsPlusForkData getCatalogFile() { + return new HfsPlusForkData(data, 272); + } + + public final HfsPlusForkData getAttributesFile() { + return new HfsPlusForkData(data, 352); + } + + public final HfsPlusForkData getStartupFile() { + return new HfsPlusForkData(data, 432); + } + + /** + * Get string representation of attribute. + * + * @return the string representation + */ + public final String getAttributesAsString() { + return ((isAttribute(HFSPLUS_VOL_UNMNT_BIT)) ? " kHFSVolumeUnmountedBit" : "") + + ((isAttribute(HFSPLUS_VOL_INCNSTNT_BIT)) ? " kHFSBootVolumeInconsistentBit" : "") + + ((isAttribute(HFSPLUS_VOL_JOURNALED_BIT)) ? " kHFSVolumeJournaledBit" : ""); + } + + /** + * Check if the corresponding attribute corresponding is set. + * + * @param maskBit Bit position of the attribute. See constants. + * + * @return {@code true} if attribute is set. + */ + public final boolean isAttribute(final int maskBit) { + return (((getAttributes() >> maskBit) & 0x1) != 0); + } + + public byte[] getBytes() { + return data; + } + + public void update() throws IOException { + fs.getApi().write(1024, ByteBuffer.wrap(data)); + } + + public final String toString() { + StringBuffer buffer = new StringBuffer(); + buffer.append("Magic: 0x").append(NumberUtils.hex(getMagic(), 4)).append("\n"); + buffer.append("Version: ").append(getVersion()).append("\n").append("\n"); + buffer.append("Attributes: ").append(getAttributesAsString()).append(" (").append( + getAttributes()).append(")").append("\n").append("\n"); + buffer.append("Create date: ").append( + HfsUtils.printDate(getCreateDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); + buffer.append("Modify date: ").append( + HfsUtils.printDate(getModifyDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); + buffer.append("Backup date: ").append( + HfsUtils.printDate(getBackupDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); + buffer.append("Checked date: ").append( + HfsUtils.printDate(getCheckedDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n") + .append("\n"); + buffer.append("File count: ").append(getFileCount()).append("\n"); + buffer.append("Folder count: ").append(getFolderCount()).append("\n").append("\n"); + buffer.append("Block size: ").append(getBlockSize()).append("\n"); + buffer.append("Total blocks: ").append(getTotalBlocks()).append("\n"); + buffer.append("Free blocks: ").append(getFreeBlocks()).append("\n").append("\n"); + buffer.append("Next catalog ID: ").append(getNextCatalogId()).append("\n"); + buffer.append("Write count: ").append(getWriteCount()).append("\n"); + buffer.append("Encoding bmp: ").append(getEncodingsBmp()).append("\n"); + buffer.append("Finder Infos: ").append(getFinderInfo()).append("\n").append("\n"); + buffer.append("Journal block: ").append(getJournalInfoBlock()).append("\n").append("\n"); + buffer.append("Allocation file").append("\n"); + buffer.append(getAllocationFile().toString()).append("\n"); + buffer.append("Extents file").append("\n"); + buffer.append(getExtentsFile().toString()).append("\n"); + buffer.append("Catalog file").append("\n"); + buffer.append(getCatalogFile().toString()).append("\n"); + buffer.append("Attributes file").append("\n"); + buffer.append(getAttributesFile().toString()).append("\n"); + buffer.append("Startup file").append("\n"); + buffer.append(getStartupFile().toString()).append("\n"); + return buffer.toString(); + } +} Property changes on: trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java ___________________________________________________________________ Added: svn:executable + * Deleted: trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -1,478 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.fs.hfsplus; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.Calendar; -import java.util.Date; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.jnode.fs.FileSystemException; -import org.jnode.fs.hfsplus.catalog.CatalogNodeId; -import org.jnode.fs.hfsplus.extent.ExtentDescriptor; -import org.jnode.util.BigEndian; -import org.jnode.util.NumberUtils; - -/** - * HFS+ volume header definition. - * - * @author Fabien Lesire - * - */ -public class Superblock extends HfsPlusObject { - - public static final int HFSPLUS_SUPER_MAGIC = 0x482b; - - public static final int HFSPLUS_MIN_VERSION = 0x0004; /* HFS+ */ - public static final int HFSPLUS_CURRENT_VERSION = 5; /* HFSX */ - - /* HFS+ volume attributes */ - public static final int HFSPLUS_VOL_UNMNT_BIT = 8; - public static final int HFSPLUS_VOL_SPARE_BLK_BIT = 9; - public static final int HFSPLUS_VOL_NOCACHE_BIT = 10; - public static final int HFSPLUS_VOL_INCNSTNT_BIT = 11; - public static final int HFSPLUS_VOL_NODEID_REUSED_BIT = 12; - public static final int HFSPLUS_VOL_JOURNALED_BIT = 13; - public static final int HFSPLUS_VOL_SOFTLOCK_BIT = 15; - - private final Logger log = Logger.getLogger(getClass()); - - /** Volume header data length */ - public static final int SUPERBLOCK_LENGTH = 1024; - - /** Data bytes array that contains volume header information */ - private byte[] data; - - /** - * Create the volume header and load information for the file system passed - * as parameter. - * - * @param fs The file system contains HFS+ partition. - * - * @throws FileSystemException If magic number (0X482B) is incorrect or not - * available. - */ - public Superblock(final HfsPlusFileSystem fs, boolean create) throws FileSystemException { - super(fs); - log.setLevel(Level.INFO); - data = new byte[SUPERBLOCK_LENGTH]; - try { - if (!create) { - log.info("load HFS+ volume header."); - // skip the first 1024 bytes (boot sector) and read the volume - // header. - ByteBuffer b = ByteBuffer.allocate(SUPERBLOCK_LENGTH); - fs.getApi().read(1024, b); - data = new byte[SUPERBLOCK_LENGTH]; - System.arraycopy(b.array(), 0, data, 0, SUPERBLOCK_LENGTH); - if (getMagic() != HFSPLUS_SUPER_MAGIC) { - throw new FileSystemException("Not hfs+ volume header (" + getMagic() + - ": bad magic)"); - } - - } - } catch (IOException e) { - throw new FileSystemException(e); - } - } - - /** - * Create a new volume header. - * - * @param params - * - * @throws IOException - * @throws ApiNotFoundException - * @throws FileSystemException - */ - public void create(HFSPlusParams params) throws IOException { - log.info("Create new HFS+ volume header (" + params.getVolumeName() + - ") with block size of " + params.getBlockSize() + " bytes."); - int burnedBlocksBeforeVH = 0; - int burnedBlocksAfterAltVH = 0; - /* - * Volume header is located at sector 2. Block before this position must - * be invalidated. - */ - int blockSize = params.getBlockSize(); - if (blockSize == 512) { - burnedBlocksBeforeVH = 2; - burnedBlocksAfterAltVH = 1; - } else if (blockSize == 1024) { - burnedBlocksBeforeVH = 1; - } - // Populate volume header. - this.setMagic(HFSPLUS_SUPER_MAGIC); - this.setVersion(HFSPLUS_MIN_VERSION); - // Set attributes. - this.setAttribute(HFSPLUS_VOL_UNMNT_BIT); - this.setLastMountedVersion(0x446534a); - Calendar now = Calendar.getInstance(); - now.setTime(new Date()); - int macDate = HfsUtils.getNow(); - this.setCreateDate(macDate); - this.setModifyDate(macDate); - this.setCheckedDate(macDate); - // --- - this.setBlockSize(blockSize); - this.setTotalBlocks((int) params.getBlockCount()); - this.setFreeBlocks((int) params.getBlockCount()); - this.setRsrcClumpSize(params.getResourceClumpSize()); - this.setDataClumpSize(params.getDataClumpSize()); - this.setNextCatalogId(CatalogNodeId.HFSPLUS_FIRSTUSER_CNID.getId()); - // Allocation file creation - log.info("Init allocation file."); - long allocationClumpSize = getClumpSize(params.getBlockCount()); - long bitmapBlocks = allocationClumpSize / blockSize; - long blockUsed = 2 + burnedBlocksBeforeVH + burnedBlocksAfterAltVH + bitmapBlocks; - int startBlock = 1 + burnedBlocksBeforeVH; - int blockCount = (int) bitmapBlocks; - HfsPlusForkData forkdata = - new HfsPlusForkData(allocationClumpSize, (int) allocationClumpSize, - (int) bitmapBlocks); - ExtentDescriptor desc = new ExtentDescriptor(startBlock, blockCount); - forkdata.addDescriptor(0, desc); - forkdata.write(data, 112); - // Journal creation - int nextBlock = 0; - if (params.isJournaled()) { - this.setFileCount(2); - this.setAttribute(HFSPLUS_VOL_JOURNALED_BIT); - this.setNextCatalogId(this.getNextCatalogId() + 2); - this.setJournalInfoBlock(desc.getNext()); - blockUsed = blockUsed + 1 + (params.getJournalSize() / blockSize); - } else { - this.setJournalInfoBlock(0); - nextBlock = desc.getNext(); - } - // Extent B-Tree initialization - log.info("Init extent file."); - forkdata = - new HfsPlusForkData(params.getExtentClumpSize(), params.getExtentClumpSize(), - (params.getExtentClumpSize() / blockSize)); - desc = new ExtentDescriptor(nextBlock, forkdata.getTotalBlocks()); - forkdata.addDescriptor(0, desc); - forkdata.write(data, 192); - blockUsed += forkdata.getTotalBlocks(); - nextBlock = desc.getNext(); - // Catalog B-Tree initialization - log.info("Init catalog file."); - int totalBlocks = params.getCatalogClumpSize() / blockSize; - forkdata = - new HfsPlusForkData(params.getCatalogClumpSize(), params.getCatalogClumpSize(), - totalBlocks); - desc = new ExtentDescriptor(nextBlock, totalBlocks); - forkdata.addDescriptor(0, desc); - forkdata.write(data, 272); - blockUsed += totalBlocks; - - this.setFreeBlocks(this.getFreeBlocks() - (int) blockUsed); - this.setNextAllocation((int) blockUsed - 1 - burnedBlocksAfterAltVH + 10 * - (this.getCatalogFile().getClumpSize() / this.getBlockSize())); - } - - /** - * Calculate the number of blocks needed for bitmap. - * - * @param totalBlocks Total of blocks found in the device. - * @return the number of blocks. - * @throws IOException - */ - private long getClumpSize(long totalBlocks) throws IOException { - long clumpSize; - long minClumpSize = totalBlocks >> 3; - if ((totalBlocks & 7) == 0) { - ++minClumpSize; - } - clumpSize = minClumpSize; - return clumpSize; - } - - // Getters/setters - - public final int getMagic() { - return BigEndian.getInt16(data, 0); - } - - public final void setMagic(final int value) { - BigEndian.setInt16(data, 0, value); - } - - // - public final int getVersion() { - return BigEndian.getInt16(data, 2); - } - - public final void setVersion(final int value) { - BigEndian.setInt16(data, 2, value); - } - - // - public final int getAttributes() { - - return BigEndian.getInt32(data, 4); - } - - public final void setAttribute(final int attributeMaskBit) { - BigEndian.setInt32(data, 4, getAttributes() | (1 << attributeMaskBit)); - } - - // - public final int getLastMountedVersion() { - return BigEndian.getInt32(data, 8); - } - - public final void setLastMountedVersion(final int value) { - BigEndian.setInt32(data, 8, value); - } - - // - public final int getJournalInfoBlock() { - return BigEndian.getInt32(data, 12); - } - - public final void setJournalInfoBlock(final int value) { - BigEndian.setInt32(data, 12, value); - } - - // - public final long getCreateDate() { - return BigEndian.getUInt32(data, 16); - } - - public final void setCreateDate(final int value) { - BigEndian.setInt32(data, 16, value); - } - - public final long getModifyDate() { - return BigEndian.getUInt32(data, 20); - } - - public final void setModifyDate(final int value) { - BigEndian.setInt32(data, 20, value); - } - - public final long getBackupDate() { - return BigEndian.getUInt32(data, 24); - } - - public final void setBackupDate(final int value) { - BigEndian.setInt32(data, 24, value); - } - - public final long getCheckedDate() { - return BigEndian.getUInt32(data, 28); - } - - public final void setCheckedDate(final int value) { - BigEndian.setInt32(data, 28, value); - } - - // - public final int getFileCount() { - return BigEndian.getInt32(data, 32); - } - - public final void setFileCount(final int value) { - BigEndian.setInt32(data, 32, value); - } - - // - public final int getFolderCount() { - return BigEndian.getInt32(data, 36); - } - - public final void setFolderCount(final int value) { - BigEndian.setInt32(data, 36, value); - } - - // - public final int getBlockSize() { - return BigEndian.getInt32(data, 40); - } - - public final void setBlockSize(final int value) { - BigEndian.setInt32(data, 40, value); - } - - // - public final int getTotalBlocks() { - return BigEndian.getInt32(data, 44); - } - - public final void setTotalBlocks(final int value) { - BigEndian.setInt32(data, 44, value); - } - - // - public final int getFreeBlocks() { - return BigEndian.getInt32(data, 48); - } - - public final void setFreeBlocks(final int value) { - BigEndian.setInt32(data, 48, value); - } - - // - public final int getNextAllocation() { - return BigEndian.getInt32(data, 52); - } - - public final void setNextAllocation(final int value) { - BigEndian.setInt32(data, 52, value); - } - - public final long getRsrcClumpSize() { - return BigEndian.getInt32(data, 56); - } - - public final void setRsrcClumpSize(final int value) { - BigEndian.setInt32(data, 56, value); - } - - public final int getDataClumpSize() { - return BigEndian.getInt32(data, 60); - } - - public final void setDataClumpSize(final int value) { - BigEndian.setInt32(data, 60, value); - } - - public final int getNextCatalogId() { - return BigEndian.getInt32(data, 64); - } - - public final void setNextCatalogId(final int value) { - BigEndian.setInt32(data, 64, value); - } - - public final int getWriteCount() { - return BigEndian.getInt32(data, 68); - } - - public final void setWriteCount(final int value) { - BigEndian.setInt32(data, 68, value); - } - - public final long getEncodingsBmp() { - return BigEndian.getInt64(data, 72); - } - - public final void setEncodingsBmp(final long value) { - BigEndian.setInt64(data, 72, value); - } - - public final byte[] getFinderInfo() { - byte[] result = new byte[32]; - System.arraycopy(data, 80, result, 0, 32); - return result; - } - - public final HfsPlusForkData getAllocationFile() { - return new HfsPlusForkData(data, 112); - } - - public final HfsPlusForkData getExtentsFile() { - return new HfsPlusForkData(data, 192); - } - - public final HfsPlusForkData getCatalogFile() { - return new HfsPlusForkData(data, 272); - } - - public final HfsPlusForkData getAttributesFile() { - return new HfsPlusForkData(data, 352); - } - - public final HfsPlusForkData getStartupFile() { - return new HfsPlusForkData(data, 432); - } - - /** - * Get string representation of attribute. - * - * @return the string representation - */ - public final String getAttributesAsString() { - return ((isAttribute(HFSPLUS_VOL_UNMNT_BIT)) ? " kHFSVolumeUnmountedBit" : "") + - ((isAttribute(HFSPLUS_VOL_INCNSTNT_BIT)) ? " kHFSBootVolumeInconsistentBit" : "") + - ((isAttribute(HFSPLUS_VOL_JOURNALED_BIT)) ? " kHFSVolumeJournaledBit" : ""); - } - - /** - * Check if the corresponding attribute corresponding is set. - * - * @param maskBit Bit position of the attribute. See constants. - * - * @return {@code true} if attribute is set. - */ - public final boolean isAttribute(final int maskBit) { - return (((getAttributes() >> maskBit) & 0x1) != 0); - } - - public byte[] getBytes() { - return data; - } - - public void update() throws IOException { - fs.getApi().write(1024, ByteBuffer.wrap(data)); - } - - public final String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("Magic: 0x").append(NumberUtils.hex(getMagic(), 4)).append("\n"); - buffer.append("Version: ").append(getVersion()).append("\n").append("\n"); - buffer.append("Attributes: ").append(getAttributesAsString()).append(" (").append( - getAttributes()).append(")").append("\n").append("\n"); - buffer.append("Create date: ").append( - HfsUtils.printDate(getCreateDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); - buffer.append("Modify date: ").append( - HfsUtils.printDate(getModifyDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); - buffer.append("Backup date: ").append( - HfsUtils.printDate(getBackupDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); - buffer.append("Checked date: ").append( - HfsUtils.printDate(getCheckedDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n") - .append("\n"); - buffer.append("File count: ").append(getFileCount()).append("\n"); - buffer.append("Folder count: ").append(getFolderCount()).append("\n").append("\n"); - buffer.append("Block size: ").append(getBlockSize()).append("\n"); - buffer.append("Total blocks: ").append(getTotalBlocks()).append("\n"); - buffer.append("Free blocks: ").append(getFreeBlocks()).append("\n").append("\n"); - buffer.append("Next catalog ID: ").append(getNextCatalogId()).append("\n"); - buffer.append("Write count: ").append(getWriteCount()).append("\n"); - buffer.append("Encoding bmp: ").append(getEncodingsBmp()).append("\n"); - buffer.append("Finder Infos: ").append(getFinderInfo()).append("\n").append("\n"); - buffer.append("Journal block: ").append(getJournalInfoBlock()).append("\n").append("\n"); - buffer.append("Allocation file").append("\n"); - buffer.append(getAllocationFile().toString()).append("\n"); - buffer.append("Extents file").append("\n"); - buffer.append(getExtentsFile().toString()).append("\n"); - buffer.append("Catalog file").append("\n"); - buffer.append(getCatalogFile().toString()).append("\n"); - buffer.append("Attributes file").append("\n"); - buffer.append(getAttributesFile().toString()).append("\n"); - buffer.append("Startup file").append("\n"); - buffer.append(getStartupFile().toString()).append("\n"); - return buffer.toString(); - } -} Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -29,7 +29,7 @@ import org.jnode.fs.hfsplus.HFSPlusParams; import org.jnode.fs.hfsplus.HfsPlusFileSystem; import org.jnode.fs.hfsplus.HfsUnicodeString; -import org.jnode.fs.hfsplus.Superblock; +import org.jnode.fs.hfsplus.SuperBlock; import org.jnode.fs.hfsplus.extent.ExtentDescriptor; import org.jnode.fs.hfsplus.tree.BTHeaderRecord; import org.jnode.fs.hfsplus.tree.IndexRecord; @@ -65,7 +65,7 @@ public Catalog(final HfsPlusFileSystem fs) throws IOException { log.info("Load B-Tree catalog file."); this.fs = fs; - Superblock sb = fs.getVolumeHeader(); + SuperBlock sb = fs.getVolumeHeader(); ExtentDescriptor firstExtent = sb.getCatalogFile().getExtent(0); catalogHeaderNodeOffset = firstExtent.getStartOffset(sb.getBlockSize()); if (!firstExtent.isEmpty()) { @@ -149,7 +149,7 @@ * @throws IOException */ public void update() throws IOException { - Superblock vh = fs.getVolumeHeader(); + SuperBlock vh = fs.getVolumeHeader(); int offset = vh.getCatalogFile().getExtent(0).getStartOffset(vh.getBlockSize()); fs.getApi().write(offset, this.getBytes()); } Modified: trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -47,6 +47,8 @@ */ public abstract long getLength(); + public abstract void setLength(long length) throws IOException; + /** * Read some data from the file * Modified: trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java =================================================================== --- trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/test/org... [truncated message content] |
From: <ls...@us...> - 2011-08-16 21:16:07
|
Revision: 5850 http://jnode.svn.sourceforge.net/jnode/?rev=5850&view=rev Author: lsantha Date: 2011-08-16 21:16:00 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Checkstyle fixes. Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java Modified: trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -88,7 +88,7 @@ // standard API. grp.list(); } else { - if(!argVerbose.isSet() && !argName.isSet()) { + if (!argVerbose.isSet() && !argName.isSet()) { showDefaultInfo(grp); } else { // Show the threads in the ThreadGroup tree. @@ -107,7 +107,7 @@ findThreads(grp, threadSet); PrintWriter out = getOutput().getPrintWriter(); - for(final Thread thread : threadSet) { + for (final Thread thread : threadSet) { VmThread vmThread = AccessController.doPrivileged(new PrivilegedAction<VmThread>() { public VmThread run() { return ThreadHelper.getVmThread(thread); Modified: trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -40,8 +40,6 @@ import org.jnode.driver.DriverException; import org.jnode.driver.block.BlockDeviceAPI; import org.jnode.driver.block.BlockDeviceAPIHelper; -import org.jnode.driver.block.PartitionableBlockAlignmentSupport; -import org.jnode.driver.block.PartitionableBlockDeviceAPI; import org.jnode.driver.bus.ide.IDEBus; import org.jnode.driver.bus.ide.IDEConstants; import org.jnode.driver.bus.ide.IDEDevice; Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -229,7 +229,7 @@ if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } - Catalog catalog = ((HfsPlusFileSystem)getFileSystem()).getCatalog(); + Catalog catalog = ((HfsPlusFileSystem) getFileSystem()).getCatalog(); SuperBlock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); LeafRecord folderRecord = catalog.createNode(name, this.folder.getFolderId(), @@ -237,7 +237,7 @@ CatalogFolder.RECORD_TYPE_FOLDER_THREAD); folder.setValence(folder.getValence() + 1); - HfsPlusEntry newEntry = new HfsPlusEntry((HfsPlusFileSystem)getFileSystem(), this, name, folderRecord); + HfsPlusEntry newEntry = new HfsPlusEntry((HfsPlusFileSystem) getFileSystem(), this, name, folderRecord); newEntry.setDirty(); volumeHeader.setFolderCount(volumeHeader.getFolderCount() + 1); log.debug("New volume header :\n" + volumeHeader.toString()); Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -26,7 +26,6 @@ import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; import org.jnode.fs.FSFile; -import org.jnode.fs.FSObject; import org.jnode.fs.FileSystem; import org.jnode.fs.hfsplus.catalog.CatalogFile; import org.jnode.fs.hfsplus.catalog.CatalogFolder; @@ -165,7 +164,7 @@ return valid; } - public byte[] getData(){ + public byte[] getData() { return this.record.getData(); } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -27,7 +27,6 @@ import org.jnode.fs.FileSystem; import org.jnode.fs.hfsplus.catalog.CatalogFile; import org.jnode.fs.hfsplus.extent.ExtentDescriptor; -import org.jnode.fs.hfsplus.tree.LeafRecord; public class HfsPlusFile implements FSFile { @@ -74,7 +73,7 @@ @Override public boolean isValid() { - return entry.isValid(); + return entry.isValid(); } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2011-08-24 18:27:31
|
Revision: 5861 http://jnode.svn.sourceforge.net/jnode/?rev=5861&view=rev Author: fduminy Date: 2011-08-24 18:27:24 +0000 (Wed, 24 Aug 2011) Log Message: ----------- added class name filter to OnHeapCommand Signed-off-by: Fabien DUMINY <fd...@jn...> Modified Paths: -------------- trunk/cli/descriptors/org.jnode.command.system.xml trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java trunk/core/src/core/org/jnode/vm/facade/HeapStatistics.java trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java Added Paths: ----------- trunk/core/src/core/org/jnode/vm/facade/NoObjectFilter.java trunk/core/src/core/org/jnode/vm/facade/ObjectFilter.java trunk/core/src/core/org/jnode/vm/facade/SimpleObjectFilter.java Modified: trunk/cli/descriptors/org.jnode.command.system.xml =================================================================== --- trunk/cli/descriptors/org.jnode.command.system.xml 2011-08-24 18:26:16 UTC (rev 5860) +++ trunk/cli/descriptors/org.jnode.command.system.xml 2011-08-24 18:27:24 UTC (rev 5861) @@ -220,6 +220,7 @@ <optionSet> <option argLabel="minCount" longName="minCount"/> <option argLabel="minTotalSize" longName="minTotalSize"/> + <option argLabel="className" longName="className"/> </optionSet> </syntax> <syntax alias="page"> Modified: trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2011-08-24 18:26:16 UTC (rev 5860) +++ trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -27,7 +27,10 @@ import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.IntegerArgument; import org.jnode.shell.syntax.LongArgument; +import org.jnode.shell.syntax.StringArgument; import org.jnode.vm.facade.HeapStatistics; +import org.jnode.vm.facade.ObjectFilter; +import org.jnode.vm.facade.SimpleObjectFilter; import org.jnode.vm.facade.VmUtils; /** @@ -37,17 +40,20 @@ private static final String help_inst = "the minimum instance count to show"; private static final String help_size = "the minimum total size to show"; + private static final String HELP_CLASSNAME = "the classname filter"; private static final String help_super = "Show the number of instances on the heap with memory usage"; private static final String str_on_heap = "On Heap:"; private final IntegerArgument argMinInstanceCount; private final LongArgument argMinTotalSize; + private final StringArgument className; public OnHeapCommand() { super(help_super); argMinInstanceCount = new IntegerArgument("minCount", Argument.OPTIONAL, 1, Integer.MAX_VALUE, help_inst); argMinTotalSize = new LongArgument("minTotalSize", Argument.OPTIONAL, 1L, Long.MAX_VALUE, help_size); - registerArguments(argMinInstanceCount, argMinTotalSize); + className = new StringArgument("className", Argument.OPTIONAL | Argument.MULTIPLE, HELP_CLASSNAME); + registerArguments(argMinInstanceCount, argMinTotalSize, className); } public static void main(String[] args) throws Exception { @@ -61,8 +67,16 @@ public void execute() throws Exception { PrintWriter out = getOutput().getPrintWriter(); out.println(str_on_heap); - final HeapStatistics stats = VmUtils.getVm().getHeapManager().getHeapStatistics(); + ObjectFilter filter = null; + if (className.isSet()) { + SimpleObjectFilter f = new SimpleObjectFilter(); + f.setClassName(className.getValues()); + filter = f; + } + + final HeapStatistics stats = VmUtils.getVm().getHeapManager().getHeapStatistics(filter); + if (argMinInstanceCount.isSet()) { stats.setMinimumInstanceCount(argMinInstanceCount.getValue()); } Modified: trunk/core/src/core/org/jnode/vm/facade/HeapStatistics.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/HeapStatistics.java 2011-08-24 18:26:16 UTC (rev 5860) +++ trunk/core/src/core/org/jnode/vm/facade/HeapStatistics.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -46,6 +46,14 @@ void setMinimumTotalSize(long bytes); /** + * Sets the object filter. If the filter accept the object, + * then it will be added to statistics. + * @param objectFilter + * + */ + void setObjectFilter(ObjectFilter objectFilter); + + /** * Write the statistical data to an {@link Appendable}. * * @param a Added: trunk/core/src/core/org/jnode/vm/facade/NoObjectFilter.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/NoObjectFilter.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/facade/NoObjectFilter.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -0,0 +1,24 @@ +package org.jnode.vm.facade; + +/** + * An {@link ObjectFilter} that accepts all objects. + * Call {@link NoObjectFilter#INSTANCE} to get the singleton. + * + * @author Fabien DUMINY (fd...@jn...) + * + */ +public class NoObjectFilter implements ObjectFilter { + public static final NoObjectFilter INSTANCE = new NoObjectFilter(); + + private NoObjectFilter() { + } + + /** + * {@inheritDoc} + * <br>This implementation always returns true. + */ + @Override + public final boolean accept(String className) { + return true; + } +} Added: trunk/core/src/core/org/jnode/vm/facade/ObjectFilter.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/ObjectFilter.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/facade/ObjectFilter.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -0,0 +1,16 @@ +package org.jnode.vm.facade; + +/** + * This interface is used to filter objects founds on heap. + * + * @author Fabien DUMINY (fd...@jn...) + * + */ +public interface ObjectFilter { + /** + * Does this filter accept the provided class ? + * @param className The class of the object. + * @return true if the filter accept the provided class. + */ + boolean accept(String className); +} Added: trunk/core/src/core/org/jnode/vm/facade/SimpleObjectFilter.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/SimpleObjectFilter.java (rev 0) +++ trunk/core/src/core/org/jnode/vm/facade/SimpleObjectFilter.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -0,0 +1,42 @@ +package org.jnode.vm.facade; + + +/** + * An {@link ObjectFilter} that accepts objects whose class name contains + * the string given by {@link #className}. + * + * @author Fabien DUMINY (fd...@jn...) + * + */ +public class SimpleObjectFilter implements ObjectFilter { + private String[] className = null; + + /** + * Sets the className filter. Any class whose full name contains a value + * from <code>classNameFilter</code> array will be accepted. Other classes + * will be ignored and no statistics will be computed and displayed for + * them. + * @param className + */ + public void setClassName(String[] className) { + this.className = ((className != null) && (className.length > 0)) ? className : null; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean accept(String className) { + if (className == null) { + return true; + } + + for (String f : this.className) { + if (className.contains(f)) { + return true; + } + } + + return false; + } +} Modified: trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java 2011-08-24 18:26:16 UTC (rev 5860) +++ trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -91,10 +91,10 @@ /** * Get this heap's statistics. - * + * @param objectFilter The optional filter to apply to objects found on heap. * @return the heap statistics */ - HeapStatistics getHeapStatistics(); + HeapStatistics getHeapStatistics(ObjectFilter objectFilter); /** * Get this heap GC's statistics. Modified: trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java 2011-08-24 18:26:16 UTC (rev 5860) +++ trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -35,6 +35,7 @@ import org.jnode.vm.classmgr.VmType; import org.jnode.vm.facade.GCStatistics; import org.jnode.vm.facade.HeapStatistics; +import org.jnode.vm.facade.ObjectFilter; import org.jnode.vm.facade.VmProcessor; import org.jnode.vm.facade.VmWriteBarrier; import org.jnode.vm.objects.VmSystemObject; @@ -321,7 +322,7 @@ /** * {@inheritDoc} */ - public abstract HeapStatistics getHeapStatistics(); + public abstract HeapStatistics getHeapStatistics(ObjectFilter objectFilter); /** * {@inheritDoc} Modified: trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java =================================================================== --- trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java 2011-08-24 18:26:16 UTC (rev 5860) +++ trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -25,6 +25,8 @@ import org.jnode.util.NumberUtils; import org.jnode.vm.facade.HeapStatistics; +import org.jnode.vm.facade.NoObjectFilter; +import org.jnode.vm.facade.ObjectFilter; import org.jnode.vm.objects.VmSystemObject; /** @@ -35,25 +37,28 @@ private int minInstanceCount = 0; private long minTotalSize = 0; + private ObjectFilter objectFilter = NoObjectFilter.INSTANCE; private final TreeMap<String, HeapCounter> countData = new TreeMap<String, HeapCounter>(); private static final char newline = '\n'; public boolean contains(String classname) { - return countData.containsKey(classname); + // If we don't accept this class, we pretend to have it already to (maybe) avoid unnecessary work + // and memory allocation (we also hope to avoid a call to add(String, int)). + return !objectFilter.accept(classname) || countData.containsKey(classname); } public void add(String className, int size) { - HeapCounter count = (HeapCounter) countData.get(className); - - if (count == null) { - count = new HeapCounter(className, size); - countData.put(className, count); - } - - count.inc(); - - count = null; + if (objectFilter.accept(className)) { + HeapCounter count = (HeapCounter) countData.get(className); + + if (count == null) { + count = new HeapCounter(className, size); + countData.put(className, count); + } + + count.inc(); + } } /** @@ -75,22 +80,34 @@ public void setMinimumTotalSize(long bytes) { this.minTotalSize = bytes; } - + /** * {@inheritDoc} + */ + @Override + public void setObjectFilter(ObjectFilter objectFilter) { + this.objectFilter = (objectFilter == null) ? NoObjectFilter.INSTANCE : objectFilter; + } + + /** + * {@inheritDoc} * @throws IOException */ public void writeTo(Appendable a) throws IOException { boolean first = true; - for (HeapCounter c : countData.values()) { - if ((c.getInstanceCount() >= minInstanceCount) && (c.getTotalSize() >= minTotalSize)) { - if (first) { - first = false; - } else { - a.append(newline); + if (countData.isEmpty()) { + a.append("No object is matching criteria"); + } else { + for (HeapCounter c : countData.values()) { + if ((c.getInstanceCount() >= minInstanceCount) && (c.getTotalSize() >= minTotalSize)) { + if (first) { + first = false; + } else { + a.append(newline); + } + c.append(a); } - c.append(a); } } a.append(newline); Modified: trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java 2011-08-24 18:26:16 UTC (rev 5860) +++ trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -35,6 +35,7 @@ import org.jnode.vm.classmgr.VmType; import org.jnode.vm.facade.GCStatistics; import org.jnode.vm.facade.HeapStatistics; +import org.jnode.vm.facade.ObjectFilter; import org.jnode.vm.facade.ObjectVisitor; import org.jnode.vm.facade.VmProcessor; import org.jnode.vm.memmgr.HeapHelper; @@ -447,8 +448,12 @@ return gcManager.getStatistics(); } - public HeapStatistics getHeapStatistics() { + /** + * {@inheritDoc} + */ + public HeapStatistics getHeapStatistics(ObjectFilter objectFilter) { final DefHeapStatistics heapStatistics = new DefHeapStatistics(); + heapStatistics.setObjectFilter(objectFilter); final HeapStatisticsVisitor heapStatisticsVisitor = new HeapStatisticsVisitor( heapStatistics); 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 2011-08-24 18:26:16 UTC (rev 5860) +++ trunk/core/src/mmtk-vm/org/jnode/vm/memmgr/mmtk/BaseMmtkHeapManager.java 2011-08-24 18:27:24 UTC (rev 5861) @@ -40,6 +40,7 @@ import org.jnode.vm.classmgr.VmNormalClass; import org.jnode.vm.classmgr.VmType; import org.jnode.vm.facade.HeapStatistics; +import org.jnode.vm.facade.ObjectFilter; import org.jnode.vm.facade.VmArchitecture; import org.jnode.vm.facade.VmProcessor; import org.jnode.vm.facade.VmUtils; @@ -179,7 +180,10 @@ return BasePlan.freeMemory().toLong(); } - public HeapStatistics getHeapStatistics() { + /** + * {@inheritDoc} + */ + public HeapStatistics getHeapStatistics(ObjectFilter objectFilter) { return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2011-08-24 18:28:11
|
Revision: 5862 http://jnode.svn.sourceforge.net/jnode/?rev=5862&view=rev Author: fduminy Date: 2011-08-24 18:28:04 +0000 (Wed, 24 Aug 2011) Log Message: ----------- applied coding rules Signed-off-by: Fabien DUMINY <fd...@jn...> Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java Modified: trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2011-08-24 18:27:24 UTC (rev 5861) +++ trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2011-08-24 18:28:04 UTC (rev 5862) @@ -38,20 +38,20 @@ */ public class OnHeapCommand extends AbstractCommand { - private static final String help_inst = "the minimum instance count to show"; - private static final String help_size = "the minimum total size to show"; + private static final String HELP_INST = "the minimum instance count to show"; + private static final String HELP_SIZE = "the minimum total size to show"; private static final String HELP_CLASSNAME = "the classname filter"; - private static final String help_super = "Show the number of instances on the heap with memory usage"; - private static final String str_on_heap = "On Heap:"; + private static final String HELP_SUPER = "Show the number of instances on the heap with memory usage"; + private static final String STR_ON_HEAP = "On Heap:"; private final IntegerArgument argMinInstanceCount; private final LongArgument argMinTotalSize; private final StringArgument className; public OnHeapCommand() { - super(help_super); - argMinInstanceCount = new IntegerArgument("minCount", Argument.OPTIONAL, 1, Integer.MAX_VALUE, help_inst); - argMinTotalSize = new LongArgument("minTotalSize", Argument.OPTIONAL, 1L, Long.MAX_VALUE, help_size); + super(HELP_SUPER); + argMinInstanceCount = new IntegerArgument("minCount", Argument.OPTIONAL, 1, Integer.MAX_VALUE, HELP_INST); + argMinTotalSize = new LongArgument("minTotalSize", Argument.OPTIONAL, 1L, Long.MAX_VALUE, HELP_SIZE); className = new StringArgument("className", Argument.OPTIONAL | Argument.MULTIPLE, HELP_CLASSNAME); registerArguments(argMinInstanceCount, argMinTotalSize, className); } @@ -66,7 +66,7 @@ @Override public void execute() throws Exception { PrintWriter out = getOutput().getPrintWriter(); - out.println(str_on_heap); + out.println(STR_ON_HEAP); ObjectFilter filter = null; if (className.isSet()) { Modified: trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java =================================================================== --- trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java 2011-08-24 18:27:24 UTC (rev 5861) +++ trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java 2011-08-24 18:28:04 UTC (rev 5862) @@ -40,8 +40,10 @@ private ObjectFilter objectFilter = NoObjectFilter.INSTANCE; private final TreeMap<String, HeapCounter> countData = new TreeMap<String, HeapCounter>(); - private static final char newline = '\n'; - + private static final char NEWLINE = '\n'; + private static final String USAGE = " memory usage="; + private static final String NO_MATCHING_OBJECT = "No object is matching criteria"; + public boolean contains(String classname) { // If we don't accept this class, we pretend to have it already to (maybe) avoid unnecessary work // and memory allocation (we also hope to avoid a call to add(String, int)). @@ -97,20 +99,20 @@ boolean first = true; if (countData.isEmpty()) { - a.append("No object is matching criteria"); + a.append(NO_MATCHING_OBJECT); } else { for (HeapCounter c : countData.values()) { if ((c.getInstanceCount() >= minInstanceCount) && (c.getTotalSize() >= minTotalSize)) { if (first) { first = false; } else { - a.append(newline); + a.append(NEWLINE); } c.append(a); } } } - a.append(newline); + a.append(NEWLINE); } /** @@ -133,8 +135,6 @@ private int instanceCount; private int objectSize = 0; - private static final String usage = " memory usage="; - public HeapCounter(String objectName, int objectSize) { this.name = objectName; this.objectSize = objectSize; @@ -163,7 +163,7 @@ a.append(Integer.toString(instanceCount)); if (objectSize != 0) { - a.append(usage); + a.append(USAGE); long size = getTotalSize(); if (size >= 1024) { a.append(NumberUtils.toBinaryByte(size)).append(" ("); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2011-12-22 15:30:45
|
Revision: 5881 http://jnode.svn.sourceforge.net/jnode/?rev=5881&view=rev Author: galatnm Date: 2011-12-22 15:30:32 +0000 (Thu, 22 Dec 2011) Log Message: ----------- build files clean up. Modified Paths: -------------- trunk/all/build.xml trunk/builder/build.xml Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2011-12-15 21:22:44 UTC (rev 5880) +++ trunk/all/build.xml 2011-12-22 15:30:32 UTC (rev 5881) @@ -1,541 +1,540 @@ <project name="JNode" default="help" basedir="."> - <property name="root.dir" value="${basedir}/.."/> - + <property name="root.dir" value="${basedir}/.."/> + <!-- if task is used from this --> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> + <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> <!-- before including jnode.xml, we must set this property --> - <condition property="memoryMaximumSize" value="1512m" else="768m"> - <os arch="amd64"/> - </condition> - <echo message="Setting memoryMaximumSize to ${memoryMaximumSize}"/> - - <!-- Include antlib --> - <typedef file="${root.dir}/all/lib/jnode.xml"/> + <condition property="memoryMaximumSize" value="1512m" else="768m"> + <os arch="amd64"/> + </condition> + <echo message="Setting memoryMaximumSize to ${memoryMaximumSize}"/> - <!-- JNode version --> - <property name="jnode-ver" value="0.2.9-dev"/> + <!-- Include antlib --> + <typedef file="${root.dir}/all/lib/jnode.xml"/> - <!-- Java target and source version --> - <property name="java.target" value="1.6"/> - <property name="java.source" value="1.6"/> - <property name="java.encoding" value="US-ASCII"/> + <!-- JNode version --> + <property name="jnode-ver" value="0.2.9-dev"/> - <property name="build.dir" value="${basedir}/build"/> - <property name="reports.dir" value="${build.dir}/reports"/> - <property name="cdroms.dir" value="${build.dir}/cdroms"/> - <property name="descriptors.dir" value="${build.dir}/descriptors"/> - <property name="plugins.dir" value="${build.dir}/plugins"/> - <property name="initjars.dir" value="${build.dir}/initjars"/> - <property name="save.dir" value="${basedir}/save"/> - <property name="backup.dir" value="${build.dir}/backup"/> + <!-- Java target and source version --> + <property name="java.target" value="1.6"/> + <property name="java.source" value="1.6"/> + <property name="java.encoding" value="US-ASCII"/> - <property name="jnode-builder.jar" value="${build.dir}/descriptors/jnode-builder.jar"/> - <property name="jnode-configure.jar" value="${build.dir}/descriptors/jnode-configure.jar"/> - <property name="jnode-core.jar" value="${root.dir}/core/build/classes"/> - <property name="jnode-distr.jar" value="${root.dir}/distr/build/classes"/> - <property name="jnode-fs.jar" value="${root.dir}/fs/build/classes"/> - <property name="jnode-gui.jar" value="${root.dir}/gui/build/classes"/> - <property name="thinlet.jar" value="${root.dir}/gui/build/classes"/> - <property name="jnode-textui.jar" value="${root.dir}/textui/build/classes"/> - <property name="jnode-net.jar" value="${root.dir}/net/build/classes"/> - <property name="jnode-shell.jar" value="${root.dir}/shell/build/classes"/> - <property name="jnode-cli.jar" value="${root.dir}/cli/build/classes"/> - <property name="jnode-fonts.jar" value="${build.dir}/descriptors/jnode-fonts.jar"/> - <property name="jnode-images.jar" value="${build.dir}/descriptors/jnode-images.jar"/> + <property name="build.dir" value="${basedir}/build"/> + <property name="reports.dir" value="${build.dir}/reports"/> + <property name="cdroms.dir" value="${build.dir}/cdroms"/> + <property name="descriptors.dir" value="${build.dir}/descriptors"/> + <property name="plugins.dir" value="${build.dir}/plugins"/> + <property name="initjars.dir" value="${build.dir}/initjars"/> + <property name="save.dir" value="${basedir}/save"/> + <property name="backup.dir" value="${build.dir}/backup"/> - <property name="jnode-mmtk-genrc.jar" value="${root.dir}/core/build/classes-plan/org.jnode.vm.memmgr.mmtk.genrc"/> + <property name="jnode-builder.jar" value="${build.dir}/descriptors/jnode-builder.jar"/> + <property name="jnode-configure.jar" value="${build.dir}/descriptors/jnode-configure.jar"/> + <property name="jnode-core.jar" value="${root.dir}/core/build/classes"/> + <property name="jnode-distr.jar" value="${root.dir}/distr/build/classes"/> + <property name="jnode-fs.jar" value="${root.dir}/fs/build/classes"/> + <property name="jnode-gui.jar" value="${root.dir}/gui/build/classes"/> + <property name="thinlet.jar" value="${root.dir}/gui/build/classes"/> + <property name="jnode-textui.jar" value="${root.dir}/textui/build/classes"/> + <property name="jnode-net.jar" value="${root.dir}/net/build/classes"/> + <property name="jnode-shell.jar" value="${root.dir}/shell/build/classes"/> + <property name="jnode-cli.jar" value="${root.dir}/cli/build/classes"/> + <property name="jnode-fonts.jar" value="${build.dir}/descriptors/jnode-fonts.jar"/> + <property name="jnode-images.jar" value="${build.dir}/descriptors/jnode-images.jar"/> + + <property name="jnode-mmtk-genrc.jar" value="${root.dir}/core/build/classes-plan/org.jnode.vm.memmgr.mmtk.genrc"/> <property name="jnode-mmtk-ms.jar" value="${root.dir}/core/build/classes-plan/org.jnode.vm.memmgr.mmtk.ms"/> <property name="jnode-mmtk-nogc.jar" value="${root.dir}/core/build/classes-plan/org.jnode.vm.memmgr.mmtk.nogc"/> - <property name="classlib.jar" value="${root.dir}/all/lib/classlib.jar"/> - <property name="classlib-src.jar" value="${root.dir}/all/lib/classlib-src.jar"/> - <property name="ant.jar" value="${root.dir}/core/lib/ant.jar"/> - <property name="ant-launcher.jar" value="${root.dir}/core/lib/ant-launcher.jar"/> - <property name="commons-net.jar" value="${root.dir}/core/lib/commons-net-1.1.0.jar"/> - <property name="dnsjava.jar" value="${root.dir}/net/lib/dnsjava-1.6.6.jar"/> - <property name="jsch.jar" value="${root.dir}/net/lib/jsch-0.1.24.jar"/> - <property name="junit.jar" value="${root.dir}/core/lib/junit-4.5.jar"/> - <property name="mmtk.jar" value="${root.dir}/core/lib/mmtk/mmtk.jar"/> + <property name="classlib.jar" value="${root.dir}/all/lib/classlib.jar"/> + <property name="classlib-src.jar" value="${root.dir}/all/lib/classlib-src.jar"/> + <property name="ant.jar" value="${root.dir}/core/lib/ant.jar"/> + <property name="ant-launcher.jar" value="${root.dir}/core/lib/ant-launcher.jar"/> + <property name="commons-net.jar" value="${root.dir}/core/lib/commons-net-1.1.0.jar"/> + <property name="dnsjava.jar" value="${root.dir}/net/lib/dnsjava-1.6.6.jar"/> + <property name="jsch.jar" value="${root.dir}/net/lib/jsch-0.1.24.jar"/> + <property name="junit.jar" value="${root.dir}/core/lib/junit-4.5.jar"/> + <property name="mmtk.jar" value="${root.dir}/core/lib/mmtk/mmtk.jar"/> <property name="mauve.jar" value="${root.dir}/core/lib/mauve.jar"/> - <property name="edtftpj.jar" value="${root.dir}/fs/lib/edtftpj-1.5.2.jar"/> - <property name="jcifs.jar" value="${root.dir}/fs/lib/jcifs-1.2.6.jar"/> - <property name="ejc.jar" value="${root.dir}/core/lib/ejc-3.1.1.jar"/> + <property name="edtftpj.jar" value="${root.dir}/fs/lib/edtftpj-1.5.2.jar"/> + <property name="jcifs.jar" value="${root.dir}/fs/lib/jcifs-1.2.6.jar"/> + <property name="ejc.jar" value="${root.dir}/core/lib/ejc-3.1.1.jar"/> <property name="oncrpc.jar" value="${root.dir}/net/lib/oncrpc.jar"/> <property name="telnetd.jar" value="${root.dir}/distr/lib/telnetd.jar" /> <property name="commons-logging.jar" value="${root.dir}/distr/lib/commons-logging.jar" /> <property name="jawk.jar" value="${root.dir}/distr/lib/jawk-1.02.jar"/> <property name="jetty.jar" value="${root.dir}/distr/lib/jetty-6.1.5.jar" /> <property name="jetty-util.jar" value="${root.dir}/distr/lib/jetty-util-6.1.5.jar" /> - <property name="jsp.jar" value="${root.dir}/distr/lib/jsp-2.1.jar" /> - <property name="jsp-api.jar" value="${root.dir}/distr/lib/jsp-api-2.1.jar" /> - <property name="servlet.jar" value="${root.dir}/distr/lib/servlet-api-2.5-6.1.5.jar" /> - <property name="derby.jar" value="${root.dir}/distr/lib/derby.jar" /> - <property name="derbynet.jar" value="${root.dir}/distr/lib/derbynet.jar" /> - <property name="derbytools.jar" value="${root.dir}/distr/lib/derbytools.jar" /> - <property name="nanoxml-java.jar" value="${root.dir}/shell/lib/nanoxml-2.2.3.jar" /> + <property name="jsp.jar" value="${root.dir}/distr/lib/jsp-2.1.jar" /> + <property name="jsp-api.jar" value="${root.dir}/distr/lib/jsp-api-2.1.jar" /> + <property name="servlet.jar" value="${root.dir}/distr/lib/servlet-api-2.5-6.1.5.jar" /> + <property name="derby.jar" value="${root.dir}/distr/lib/derby.jar" /> + <property name="derbynet.jar" value="${root.dir}/distr/lib/derbynet.jar" /> + <property name="derbytools.jar" value="${root.dir}/distr/lib/derbytools.jar" /> + <property name="nanoxml-java.jar" value="${root.dir}/shell/lib/nanoxml-2.2.3.jar" /> - <property name="iso9660.jar" value="${root.dir}/builder/lib/iso9660.jar" /> - <property name="sabre.jar" value="${root.dir}/builder/lib/sabre.jar" /> + <property name="iso9660.jar" value="${root.dir}/builder/lib/iso9660.jar" /> + <property name="sabre.jar" value="${root.dir}/builder/lib/sabre.jar" /> - <!-- libraries needed to run tests --> - <property name="jmock-cglib.jar" value="${root.dir}/core/lib/jmock-cglib-1.0.1.jar"/> - <property name="jmock.jar" value="${root.dir}/core/lib/jmock-1.0.1.jar"/> - <property name="cglib.jar" value="${root.dir}/core/lib/cglib-2.1.jar"/> - <property name="asm.jar" value="${root.dir}/core/lib/asm-1.5.3.jar"/> + <!-- libraries needed to run tests --> + <property name="jmock-cglib.jar" value="${root.dir}/core/lib/jmock-cglib-1.0.1.jar"/> + <property name="jmock.jar" value="${root.dir}/core/lib/jmock-1.0.1.jar"/> + <property name="cglib.jar" value="${root.dir}/core/lib/cglib-2.1.jar"/> + <property name="asm.jar" value="${root.dir}/core/lib/asm-1.5.3.jar"/> <property name="asm-attrs.jar" value="${root.dir}/core/lib/asm-attrs-1.5.3.jar"/> <property name="asm-util.jar" value="${root.dir}/core/lib/asm-util-1.5.3.jar"/> - - <property name="log4j.jar" value="${root.dir}/core/lib/log4j-1.2.8.jar"/> - <property name="beanshell.jar" value="${root.dir}/shell/lib/bsh-2.0b5.jar"/> - <property name="js.jar" value="${root.dir}/shell/lib/rhino1.6r5-jsr223.jar"/> - <!-- libraries needed to check plugin dependencies --> - <property name="bcel-5.1.jar" value="${root.dir}/builder/lib/bcel-5.1.jar" /> + <property name="log4j.jar" value="${root.dir}/core/lib/log4j-1.2.8.jar"/> + <property name="beanshell.jar" value="${root.dir}/shell/lib/bsh-2.0b5.jar"/> + <property name="js.jar" value="${root.dir}/shell/lib/rhino1.6r5-jsr223.jar"/> - <!-- lists of plugins to use while booting --> - <property name="default-plugin-list" value="${root.dir}/all/conf/default-plugin-list.xml"/> - <property name="full-plugin-list" value="${root.dir}/all/conf/full-plugin-list.xml"/> - <property name="install-plugin-list" value="${root.dir}/all/conf/install-plugin-list.xml"/> - <property name="system-plugin-list" value="${root.dir}/all/conf/system-plugin-list.xml"/> - <property name="sources.dist.tar.gz" value="${build.dir}/jnodesources-${jnode-ver}.tar.gz"/> - <property name="jnode-x86.iso" value="${cdroms.dir}/jnode-x86.iso"/> - <property name="jnode-x86-lite.iso" value="${cdroms.dir}/jnode-x86-lite.iso"/> - <property name="jnode-x86_64-lite.iso" value="${cdroms.dir}/jnode-x86_64-lite.iso"/> - + <!-- libraries needed to check plugin dependencies --> + <property name="bcel-5.1.jar" value="${root.dir}/builder/lib/bcel-5.1.jar" /> + + <!-- lists of plugins to use while booting --> + <property name="default-plugin-list" value="${root.dir}/all/conf/default-plugin-list.xml"/> + <property name="full-plugin-list" value="${root.dir}/all/conf/full-plugin-list.xml"/> + <property name="install-plugin-list" value="${root.dir}/all/conf/install-plugin-list.xml"/> + <property name="system-plugin-list" value="${root.dir}/all/conf/system-plugin-list.xml"/> + <property name="sources.dist.tar.gz" value="${build.dir}/jnodesources-${jnode-ver}.tar.gz"/> + <property name="jnode-x86.iso" value="${cdroms.dir}/jnode-x86.iso"/> + <property name="jnode-x86-lite.iso" value="${cdroms.dir}/jnode-x86-lite.iso"/> + <property name="jnode-x86_64-lite.iso" value="${cdroms.dir}/jnode-x86_64-lite.iso"/> + <!-- list of classes and packages that should to be compiled to native code in the boot image. --> <property name="jnode-core-class-list" value="${root.dir}/all/conf/core-classes.txt"/> <property name="jnode-x86-class-list" value="${root.dir}/all/conf/x86-classes.txt"/> - <path id="cp"> - <pathelement location="${classlib.jar}"/> - <pathelement location="${mmtk.jar}"/> - <pathelement location="${ant.jar}"/> - <pathelement location="${junit.jar}"/> - <pathelement location="${jmock.jar}"/> - <pathelement location="${jmock-cglib.jar}"/> - <pathelement location="${asm.jar}"/> - <pathelement location="${asm-attrs.jar}"/> - <pathelement location="${asm-util.jar}"/> - <pathelement location="${cglib.jar}"/> - <pathelement location="${log4j.jar}"/> - <pathelement location="${root.dir}/all/conf"/> - <pathelement location="${beanshell.jar}"/> - <pathelement location="${js.jar}"/> - <pathelement location="${oncrpc.jar}"/> - <pathelement location="${edtftpj.jar}"/> - <pathelement location="${jcifs.jar}"/> - <pathelement location="${commons-net.jar}"/> - <pathelement location="${dnsjava.jar}"/> - <pathelement location="${mauve.jar}"/> - <pathelement location="${derby.jar}"/> - <pathelement location="${derbynet.jar}"/> - <pathelement location="${derbytools.jar}"/> - <pathelement location="${iso9660.jar}"/> - <pathelement location="${sabre.jar}"/> - </path> + <path id="cp"> + <pathelement location="${classlib.jar}"/> + <pathelement location="${mmtk.jar}"/> + <pathelement location="${ant.jar}"/> + <pathelement location="${junit.jar}"/> + <pathelement location="${jmock.jar}"/> + <pathelement location="${jmock-cglib.jar}"/> + <pathelement location="${asm.jar}"/> + <pathelement location="${asm-attrs.jar}"/> + <pathelement location="${asm-util.jar}"/> + <pathelement location="${cglib.jar}"/> + <pathelement location="${log4j.jar}"/> + <pathelement location="${root.dir}/all/conf"/> + <pathelement location="${beanshell.jar}"/> + <pathelement location="${js.jar}"/> + <pathelement location="${oncrpc.jar}"/> + <pathelement location="${edtftpj.jar}"/> + <pathelement location="${jcifs.jar}"/> + <pathelement location="${commons-net.jar}"/> + <pathelement location="${dnsjava.jar}"/> + <pathelement location="${mauve.jar}"/> + <pathelement location="${derby.jar}"/> + <pathelement location="${derbynet.jar}"/> + <pathelement location="${derbytools.jar}"/> + <pathelement location="${iso9660.jar}"/> + <pathelement location="${sabre.jar}"/> + </path> - <path id="cp-jnode"> - <pathelement location="${jnode-builder.jar}"/> - <pathelement location="${jnode-core.jar}"/> - <pathelement location="${jnode-distr.jar}"/> - <pathelement location="${jnode-fs.jar}"/> - <pathelement location="${jnode-shell.jar}"/> - <pathelement location="${jnode-net.jar}"/> - <pathelement location="${jnode-gui.jar}"/> - <pathelement location="${jnode-cli.jar}"/> - <pathelement location="${thinlet.jar}"/> - <pathelement location="${jnode-textui.jar}"/> - <pathelement location="${bcel-5.1.jar}"/> - <path refid="cp"/> - </path> - + <path id="cp-jnode"> + <pathelement location="${jnode-builder.jar}"/> + <pathelement location="${jnode-core.jar}"/> + <pathelement location="${jnode-distr.jar}"/> + <pathelement location="${jnode-fs.jar}"/> + <pathelement location="${jnode-shell.jar}"/> + <pathelement location="${jnode-net.jar}"/> + <pathelement location="${jnode-gui.jar}"/> + <pathelement location="${jnode-cli.jar}"/> + <pathelement location="${thinlet.jar}"/> + <pathelement location="${jnode-textui.jar}"/> + <pathelement location="${bcel-5.1.jar}"/> + <path refid="cp"/> + </path> + <path id="cp-test"> - <pathelement location="${root.dir}/core/build/classes"/> - <pathelement location="${root.dir}/distr/build/classes"/> - <pathelement location="${root.dir}/fs/build/classes"/> - <pathelement location="${root.dir}/shell/build/classes"/> - <pathelement location="${root.dir}/net/build/classes"/> - <pathelement location="${root.dir}/gui/build/classes"/> - <pathelement location="${root.dir}/cli/build/classes"/> - <pathelement location="${root.dir}/textui/build/classes"/> - <pathelement location="${root.dir}/shell/lib/nanoxml-2.2.3.jar"/> - <path refid="cp"/> - </path> + <pathelement location="${root.dir}/core/build/classes"/> + <pathelement location="${root.dir}/distr/build/classes"/> + <pathelement location="${root.dir}/fs/build/classes"/> + <pathelement location="${root.dir}/shell/build/classes"/> + <pathelement location="${root.dir}/net/build/classes"/> + <pathelement location="${root.dir}/gui/build/classes"/> + <pathelement location="${root.dir}/cli/build/classes"/> + <pathelement location="${root.dir}/textui/build/classes"/> + <pathelement location="${root.dir}/shell/lib/nanoxml-2.2.3.jar"/> + <path refid="cp"/> + </path> - <filterset id="descriptors-filter"> - <filter token="PROVIDER" value="JNode.org"/> - <filter token="VERSION" value="${jnode-ver}"/> - </filterset> + <filterset id="descriptors-filter"> + <filter token="PROVIDER" value="JNode.org"/> + <filter token="VERSION" value="${jnode-ver}"/> + </filterset> - <patternset id="exts"> - <include name="**/*.dat"/> - <include name="**/*.ids"/> - <include name="**/*.properties"/> - <include name="**/*.xml"/> - </patternset> + <patternset id="exts"> + <include name="**/*.dat"/> + <include name="**/*.ids"/> + <include name="**/*.properties"/> + <include name="**/*.xml"/> + </patternset> - <target name="prepare"> - <!-- Fail on a Windows platform if there are spaces in the root dir's pathname. It will + <target name="prepare"> + <!-- Fail on a Windows platform if there are spaces in the root dir's pathname. It will lead to mkisofs dying with a misleading error message. bluebit / crawley 2008-05-03 --> - <fail message="Cannot build JNode from a directory with spaces in the pathname."> - <condition> - <and> - <os family="windows"/> - <contains string="${root.dir}" substring=" " casesensitive="false" /> - </and> - </condition> - </fail> - - <fail message="Java Runtime version 1.6 needed. Your version is: ${java.runtime.version}"> - <condition> - <not> - <contains string="${java.runtime.version}" substring="1.6" casesensitive="false"/> - </not> - </condition> - </fail> + <fail message="Cannot build JNode from a directory with spaces in the pathname."> + <condition> + <and> + <os family="windows"/> + <contains string="${root.dir}" substring=" " casesensitive="false" /> + </and> + </condition> + </fail> - <!-- Initialize all project directories --> - <property file="${root.dir}/jnode.properties"/> - <!-- Set overwritable properties --> - <property name="jnode.memmgr.plugin.id" value="org.jnode.vm.memmgr.def"/> - <property name="compilerarg" value="-nowarn"/> + <fail message="Java Runtime version 1.6 needed. Your version is: ${java.runtime.version}"> + <condition> + <not> + <contains string="${java.runtime.version}" substring="1.6" casesensitive="false"/> + </not> + </condition> + </fail> - <!-- Derive properties --> - <property name="jnode-mmtk.jar" value="${root.dir}/core/build/classes-plan/${jnode.memmgr.plugin.id}"/> + <!-- Initialize all project directories --> + <property file="${root.dir}/jnode.properties"/> + <!-- Set overwritable properties --> + <property name="jnode.memmgr.plugin.id" value="org.jnode.vm.memmgr.def"/> + <property name="compilerarg" value="-nowarn"/> - <!-- Initialize timestamp --> - <tstamp/> - - <property name="hotswap.class.tstamp.pattern" value="MM/dd/yyyy kk:mm:ss.SSS"/> - <tstamp> - <format property="hotswap.class.tstamp" pattern="${hotswap.class.tstamp.pattern}" /> - </tstamp> + <!-- Derive properties --> + <property name="jnode-mmtk.jar" value="${root.dir}/core/build/classes-plan/${jnode.memmgr.plugin.id}"/> + <!-- Initialize timestamp --> + <tstamp/> - <!-- Update default excludes --> - <defaultexcludes add="**/_svn"/> - <defaultexcludes add="**/_svn/**"/> - - <!-- Create basic build directories --> - <mkdir dir="${build.dir}"/> - <mkdir dir="${reports.dir}"/> - <mkdir dir="${save.dir}"/> - <mkdir dir="${cdroms.dir}"/> - <mkdir dir="${descriptors.dir}"/> - <mkdir dir="${plugins.dir}"/> - <mkdir dir="${initjars.dir}"/> - <property file="${root.dir}/all/lib/ftp.properties"/> - <!-- check for classlib update --> - <if> - <or> - <not> - <uptodate srcfile="${root.dir}/all/lib/ftp.properties" targetfile="${root.dir}/all/lib/classlib.pack.gz"/> - </not> - <not> - <uptodate srcfile="${root.dir}/all/lib/ftp.properties" targetfile="${root.dir}/all/lib/classlib-src.jar.bz2"/> - </not> - </or> - <then> - <!-- check if classlib update should be done locally or from the FTP server --> - <if> - <isset property="jnode.local.classlib"/> - <then> - <fail message="classlib is out of date, run copy or quickdeploy in classlib project"> - <condition> - <or> - <not> - <uptodate srcfile="${root.dir}/all/lib/ftp.properties" + <property name="hotswap.class.tstamp.pattern" value="MM/dd/yyyy kk:mm:ss.SSS"/> + <tstamp> + <format property="hotswap.class.tstamp" pattern="${hotswap.class.tstamp.pattern}" /> + </tstamp> + + + <!-- Update default excludes --> + <defaultexcludes add="**/_svn"/> + <defaultexcludes add="**/_svn/**"/> + + <!-- Create basic build directories --> + <mkdir dir="${build.dir}"/> + <mkdir dir="${reports.dir}"/> + <mkdir dir="${save.dir}"/> + <mkdir dir="${cdroms.dir}"/> + <mkdir dir="${descriptors.dir}"/> + <mkdir dir="${plugins.dir}"/> + <mkdir dir="${initjars.dir}"/> + <property file="${root.dir}/all/lib/ftp.properties"/> + <!-- check for classlib update --> + <if> + <or> + <not> + <uptodate srcfile="${root.dir}/all/lib/ftp.properties" targetfile="${root.dir}/all/lib/classlib.pack.gz"/> + </not> + <not> + <uptodate srcfile="${root.dir}/all/lib/ftp.properties" targetfile="${root.dir}/all/lib/classlib-src.jar.bz2"/> + </not> + </or> + <then> + <!-- check if classlib update should be done locally or from the FTP server --> + <if> + <isset property="jnode.local.classlib"/> + <then> + <fail message="classlib is out of date, run copy or quickdeploy in classlib project"> + <condition> + <or> + <not> + <uptodate srcfile="${root.dir}/all/lib/ftp.properties" targetfile="${root.dir}/all/lib/classlib.jar"/> - </not> - <not> - <uptodate srcfile="${root.dir}/all/lib/ftp.properties" + </not> + <not> + <uptodate srcfile="${root.dir}/all/lib/ftp.properties" targetfile="${root.dir}/all/lib/classlib-src.jar"/> - </not> - </or> - </condition> - </fail> - </then> - <else> - <!-- classlib update from the FTP server --> - <delete file="${root.dir}/all/lib/classlib.pack.gz"/> - <delete file="${root.dir}/all/lib/classlib-src.jar.bz2"/> - <get src="${classlib.url}/classlib.pack.gz" dest="${root.dir}/all/lib/classlib.pack.gz"/> - <get src="${classlib.url}/classlib-src.jar.bz2" dest="${root.dir}/all/lib/classlib-src.jar.bz2"/> - <!-- verify checksum for downloaded files --> - <if> - <not> - <checksum algorithm="MD5" file="${root.dir}/all/lib/classlib.pack.gz" property="${classlib.md5}"/> - </not> - <then> - <delete file="${root.dir}/all/lib/classlib.pack.gz"/> - <fail message="checksum failed for classlib.pack.gz"/> - </then> - </if> - <if> - <not> - <checksum algorithm="MD5" file="${root.dir}/all/lib/classlib-src.jar.bz2" property="${classlib-src.md5}"/> - </not> - <then> - <delete file="${root.dir}/all/lib/classlib-src.jar.bz2"/> - <fail message="checksum failed for classlib-src.jar.bz2"/> - </then> - </if> - </else> - </if> - </then> - </if> - <if> - <or> - <not> - <available file="${classlib.jar}" /> - </not> - <uptodate srcfile="${classlib.jar}" targetfile="${root.dir}/all/lib/classlib.pack.gz"/> - </or> - <then> - <delete file="${classlib.jar}"/> - <echo message="Creating ${classlib.jar}"/> - <exec executable="${java.home}/bin/unpack200"> - <arg file="${root.dir}/all/lib/classlib.pack.gz"/> - <arg file="${classlib.jar}"/> - </exec> - </then> - </if> - <if> - <or> - <not> - <available file="${classlib-src.jar}" /> - </not> - <uptodate srcfile="${classlib-src.jar}" targetfile="${root.dir}/all/lib/classlib-src.jar.bz2"/> - </or> - <then> - <delete file="${classlib-src.jar}"/> - <echo message="Creating ${classlib-src.jar}"/> - <bunzip2 src="${root.dir}/all/lib/classlib-src.jar.bz2" dest="${classlib-src.jar}"/> - </then> - </if> - <property name="classlib.stamp" value="${root.dir}/all/build/classlib.stamp" /> - </target> + </not> + </or> + </condition> + </fail> + </then> + <else> + <!-- classlib update from the FTP server --> + <delete file="${root.dir}/all/lib/classlib.pack.gz"/> + <delete file="${root.dir}/all/lib/classlib-src.jar.bz2"/> + <get src="${classlib.url}/classlib.pack.gz" dest="${root.dir}/all/lib/classlib.pack.gz"/> + <get src="${classlib.url}/classlib-src.jar.bz2" dest="${root.dir}/all/lib/classlib-src.jar.bz2"/> + <!-- verify checksum for downloaded files --> + <if> + <not> + <checksum algorithm="MD5" file="${root.dir}/all/lib/classlib.pack.gz" property="${classlib.md5}"/> + </not> + <then> + <delete file="${root.dir}/all/lib/classlib.pack.gz"/> + <fail message="checksum failed for classlib.pack.gz"/> + </then> + </if> + <if> + <not> + <checksum algorithm="MD5" file="${root.dir}/all/lib/classlib-src.jar.bz2" property="${classlib-src.md5}"/> + </not> + <then> + <delete file="${root.dir}/all/lib/classlib-src.jar.bz2"/> + <fail message="checksum failed for classlib-src.jar.bz2"/> + </then> + </if> + </else> + </if> + </then> + </if> + <if> + <or> + <not> + <available file="${classlib.jar}" /> + </not> + <uptodate srcfile="${classlib.jar}" targetfile="${root.dir}/all/lib/classlib.pack.gz"/> + </or> + <then> + <delete file="${classlib.jar}"/> + <echo message="Creating ${classlib.jar}"/> + <exec executable="${java.home}/bin/unpack200"> + <arg file="${root.dir}/all/lib/classlib.pack.gz"/> + <arg file="${classlib.jar}"/> + </exec> + </then> + </if> + <if> + <or> + <not> + <available file="${classlib-src.jar}" /> + </not> + <uptodate srcfile="${classlib-src.jar}" targetfile="${root.dir}/all/lib/classlib-src.jar.bz2"/> + </or> + <then> + <delete file="${classlib-src.jar}"/> + <echo message="Creating ${classlib-src.jar}"/> + <bunzip2 src="${root.dir}/all/lib/classlib-src.jar.bz2" dest="${classlib-src.jar}"/> + </then> + </if> + <property name="classlib.stamp" value="${root.dir}/all/build/classlib.stamp" /> + </target> - <!-- Call the assemble target of all subprojects --> - <target name="assemble-projects" depends="prepare"> - <!-- pre compile tasks needed for compilation --> - <ant target="pre-compile" dir="${root.dir}/builder" inheritall="on" inheritrefs="on" /> - <jnode.antall target="assemble"/> - </target> + <!-- Call the assemble target of all subprojects --> + <target name="assemble-projects" depends="prepare"> + <!-- pre compile tasks needed for compilation --> + <ant target="pre-compile" dir="${root.dir}/builder" inheritall="on" inheritrefs="on" /> + <jnode.antall target="assemble"/> + </target> - <!-- Assemble all plugins --> - <target name="assemble-plugins" depends="assemble-projects,openjdk-annotate"> - <!-- Now assemble all plugins --> - <taskdef name="plugin" classname="org.jnode.build.PluginTask" classpathref="cp-jnode"/> - <if> - <or> - <not> - <available file="${classlib.stamp}" /> - </not> - <uptodate srcfile="${classlib.stamp}" targetfile="${classlib.jar}"/> - </or> - <then> - <!-- Now assemble all plugins --> - <plugin todir="${plugins.dir}" tmpdir="${build.dir}/tmp/plugins" pluginDir="${descriptors.dir}"> - <packager userApplicationsDir="${user.applications.dir}" pathRefId="cp"/> + <!-- Assemble all plugins --> + <target name="assemble-plugins" depends="assemble-projects,openjdk-annotate"> + <!-- Now assemble all plugins --> + <taskdef name="plugin" classname="org.jnode.build.PluginTask" classpathref="cp-jnode"/> + <if> + <or> + <not> + <available file="${classlib.stamp}" /> + </not> + <uptodate srcfile="${classlib.stamp}" targetfile="${classlib.jar}"/> + </or> + <then> + <!-- Now assemble all plugins --> + <plugin todir="${plugins.dir}" tmpdir="${build.dir}/tmp/plugins" pluginDir="${descriptors.dir}"> + <packager userApplicationsDir="${user.applications.dir}" pathRefId="cp"/> - <libalias name="jnode-core.jar" alias="${jnode-core.jar}"/> - <libalias name="jnode-distr.jar" alias="${jnode-distr.jar}"/> - <libalias name="jnode-fs.jar" alias="${jnode-fs.jar}"/> - <libalias name="jnode-gui.jar" alias="${jnode-gui.jar}"/> - <libalias name="jnode-textui.jar" alias="${jnode-textui.jar}"/> - <libalias name="jnode-net.jar" alias="${jnode-net.jar}"/> - <libalias name="jnode-shell.jar" alias="${jnode-shell.jar}"/> + <libalias name="jnode-core.jar" alias="${jnode-core.jar}"/> + <libalias name="jnode-distr.jar" alias="${jnode-distr.jar}"/> + <libalias name="jnode-fs.jar" alias="${jnode-fs.jar}"/> + <libalias name="jnode-gui.jar" alias="${jnode-gui.jar}"/> + <libalias name="jnode-textui.jar" alias="${jnode-textui.jar}"/> + <libalias name="jnode-net.jar" alias="${jnode-net.jar}"/> + <libalias name="jnode-shell.jar" alias="${jnode-shell.jar}"/> - <libalias name="jnode-mmtk-genrc.jar" alias="${jnode-mmtk-genrc.jar}"/> - <libalias name="jnode-mmtk-ms.jar" alias="${jnode-mmtk-ms.jar}"/> - <libalias name="jnode-mmtk-nogc.jar" alias="${jnode-mmtk-nogc.jar}"/> + <libalias name="jnode-mmtk-genrc.jar" alias="${jnode-mmtk-genrc.jar}"/> + <libalias name="jnode-mmtk-ms.jar" alias="${jnode-mmtk-ms.jar}"/> + <libalias name="jnode-mmtk-nogc.jar" alias="${jnode-mmtk-nogc.jar}"/> - <libalias name="mmtk.jar" alias="${mmtk.jar}"/> + <libalias name="mmtk.jar" alias="${mmtk.jar}"/> - <libalias name="commons-net-1.1.0.jar" alias="${commons-net.jar}"/> - <libalias name="dnsjava-1.6.6.jar" alias="${dnsjava.jar}"/> - <libalias name="jsch-0.1.24.jar" alias="${jsch.jar}"/> - <libalias name="log4j.jar" alias="${log4j.jar}"/> - <libalias name="beanshell.jar" alias="${beanshell.jar}"/> - <libalias name="nanoxml-java.jar" alias="${nanoxml-java.jar}"/> - <libalias name="js.jar" alias="${js.jar}"/> - <libalias name="thinlet.jar" alias="${thinlet.jar}"/> + <libalias name="commons-net-1.1.0.jar" alias="${commons-net.jar}"/> + <libalias name="dnsjava-1.6.6.jar" alias="${dnsjava.jar}"/> + <libalias name="jsch-0.1.24.jar" alias="${jsch.jar}"/> + <libalias name="log4j.jar" alias="${log4j.jar}"/> + <libalias name="beanshell.jar" alias="${beanshell.jar}"/> + <libalias name="nanoxml-java.jar" alias="${nanoxml-java.jar}"/> + <libalias name="js.jar" alias="${js.jar}"/> + <libalias name="thinlet.jar" alias="${thinlet.jar}"/> - <libalias name="junit.jar" alias="${junit.jar}"/> - <libalias name="jmock-1.0.1.jar" alias="${jmock.jar}"/> - <libalias name="jmock-cglib-1.0.1.jar" alias="${jmock-cglib.jar}"/> - <libalias name="asm.jar" alias="${asm.jar}"/> - <libalias name="asm-attrs.jar" alias="${asm-attrs.jar}"/> - <libalias name="asm-util.jar" alias="${asm-util.jar}"/> - <libalias name="cglib.jar" alias="${cglib.jar}"/> - <libalias name="mauve.jar" alias="${mauve.jar}"/> + <libalias name="junit.jar" alias="${junit.jar}"/> + <libalias name="jmock-1.0.1.jar" alias="${jmock.jar}"/> + <libalias name="jmock-cglib-1.0.1.jar" alias="${jmock-cglib.jar}"/> + <libalias name="asm.jar" alias="${asm.jar}"/> + <libalias name="asm-attrs.jar" alias="${asm-attrs.jar}"/> + <libalias name="asm-util.jar" alias="${asm-util.jar}"/> + <libalias name="cglib.jar" alias="${cglib.jar}"/> + <libalias name="mauve.jar" alias="${mauve.jar}"/> - <libalias name="ant.jar" alias="${ant.jar}"/> - <libalias name="ant-launcher.jar" alias="${ant-launcher.jar}"/> - <libalias name="edtftpj.jar" alias="${edtftpj.jar}"/> - <libalias name="jcifs.jar" alias="${jcifs.jar}"/> - <libalias name="ejc.jar" alias="${ejc.jar}"/> - <libalias name="oncrpc.jar" alias="${oncrpc.jar}"/> - <libalias name="telnetd.jar" alias="${telnetd.jar}"/> - <libalias name="commons-logging.jar" alias="${commons-logging.jar}"/> - <libalias name="jawk.jar" alias="${jawk.jar}"/> - <libalias name="jetty.jar" alias="${jetty.jar}"/> - <libalias name="jetty-util.jar" alias="${jetty-util.jar}"/> - <libalias name="jsp.jar" alias="${jsp.jar}"/> - <libalias name="jsp-api.jar" alias="${jsp-api.jar}"/> - <libalias name="servlet.jar" alias="${servlet.jar}"/> - <libalias name="derby.jar" alias="${derby.jar}"/> - <libalias name="derbynet.jar" alias="${derbynet.jar}"/> - <libalias name="derbytools.jar" alias="${derbytools.jar}"/> - <libalias name="classlib.jar" alias="${classlib.jar}"/> + <libalias name="ant.jar" alias="${ant.jar}"/> + <libalias name="ant-launcher.jar" alias="${ant-launcher.jar}"/> + <libalias name="edtftpj.jar" alias="${edtftpj.jar}"/> + <libalias name="jcifs.jar" alias="${jcifs.jar}"/> + <libalias name="ejc.jar" alias="${ejc.jar}"/> + <libalias name="oncrpc.jar" alias="${oncrpc.jar}"/> + <libalias name="telnetd.jar" alias="${telnetd.jar}"/> + <libalias name="commons-logging.jar" alias="${commons-logging.jar}"/> + <libalias name="jawk.jar" alias="${jawk.jar}"/> + <libalias name="jetty.jar" alias="${jetty.jar}"/> + <libalias name="jetty-util.jar" alias="${jetty-util.jar}"/> + <libalias name="jsp.jar" alias="${jsp.jar}"/> + <libalias name="jsp-api.jar" alias="${jsp-api.jar}"/> + <libalias name="servlet.jar" alias="${servlet.jar}"/> + <libalias name="derby.jar" alias="${derby.jar}"/> + <libalias name="derbynet.jar" alias="${derbynet.jar}"/> + <libalias name="derbytools.jar" alias="${derbytools.jar}"/> + <libalias name="classlib.jar" alias="${classlib.jar}"/> - <descriptors dir="${descriptors.dir}/"> - <include name="org.classpath.core.xml"/> - <include name="org.classpath.ext.awt.xml"/> - <include name="org.classpath.ext.corba.xml"/> - <include name="org.classpath.ext.core.xml"/> - <include name="org.classpath.ext.imageio.xml"/> - <include name="org.classpath.ext.management.xml"/> - <include name="org.classpath.ext.print.xml"/> - <include name="org.classpath.ext.security.xml"/> - <include name="org.classpath.ext.sql.xml"/> - <include name="org.classpath.ext.xml"/> - <include name="org.classpath.ext.xml.ws.tools.xml"/> - <include name="org.classpath.ext.xml.ws.xml"/> - <include name="org.classpath.ext.xml.xml"/> - <include name="org.classpath.tools.xml"/> - <include name="com.sun.tools.javac.xml"/> - <include name="com.sun.tools.jdi.xml"/> - <include name="javax.ext.tools.xml"/> - <include name="sun.tools.xml"/> - </descriptors> - </plugin> + <descriptors dir="${descriptors.dir}/"> + <include name="org.classpath.core.xml"/> + <include name="org.classpath.ext.awt.xml"/> + <include name="org.classpath.ext.corba.xml"/> + <include name="org.classpath.ext.core.xml"/> + <include name="org.classpath.ext.imageio.xml"/> + <include name="org.classpath.ext.management.xml"/> + <include name="org.classpath.ext.print.xml"/> + <include name="org.classpath.ext.security.xml"/> + <include name="org.classpath.ext.sql.xml"/> + <include name="org.classpath.ext.xml"/> + <include name="org.classpath.ext.xml.ws.tools.xml"/> + <include name="org.classpath.ext.xml.ws.xml"/> + <include name="org.classpath.ext.xml.xml"/> + <include name="org.classpath.tools.xml"/> + <include name="com.sun.tools.javac.xml"/> + <include name="com.sun.tools.jdi.xml"/> + <include name="javax.ext.tools.xml"/> + <include name="sun.tools.xml"/> + </descriptors> + </plugin> - <touch file="${classlib.stamp}"/> - </then> - </if> + <touch file="${classlib.stamp}"/> + </then> + </if> - <plugin todir="${plugins.dir}" tmpdir="${build.dir}/tmp/plugins" pluginDir="${descriptors.dir}"> - <packager userApplicationsDir="${user.applications.dir}" pathRefId="cp"/> - - <libalias name="jnode-core.jar" alias="${jnode-core.jar}"/> - <libalias name="jnode-distr.jar" alias="${jnode-distr.jar}"/> - <libalias name="jnode-fs.jar" alias="${jnode-fs.jar}"/> - <libalias name="jnode-gui.jar" alias="${jnode-gui.jar}"/> - <libalias name="jnode-textui.jar" alias="${jnode-textui.jar}"/> - <libalias name="jnode-net.jar" alias="${jnode-net.jar}"/> - <libalias name="jnode-shell.jar" alias="${jnode-shell.jar}"/> - <libalias name="jnode-cli.jar" alias="${jnode-cli.jar}"/> + <plugin todir="${plugins.dir}" tmpdir="${build.dir}/tmp/plugins" pluginDir="${descriptors.dir}"> + <packager userApplicationsDir="${user.applications.dir}" pathRefId="cp"/> - <libalias name="jnode-mmtk-genrc.jar" alias="${jnode-mmtk-genrc.jar}"/> - <libalias name="jnode-mmtk-ms.jar" alias="${jnode-mmtk-ms.jar}"/> - <libalias name="jnode-mmtk-nogc.jar" alias="${jnode-mmtk-nogc.jar}"/> + <libalias name="jnode-core.jar" alias="${jnode-core.jar}"/> + <libalias name="jnode-distr.jar" alias="${jnode-distr.jar}"/> + <libalias name="jnode-fs.jar" alias="${jnode-fs.jar}"/> + <libalias name="jnode-gui.jar" alias="${jnode-gui.jar}"/> + <libalias name="jnode-textui.jar" alias="${jnode-textui.jar}"/> + <libalias name="jnode-net.jar" alias="${jnode-net.jar}"/> + <libalias name="jnode-shell.jar" alias="${jnode-shell.jar}"/> + <libalias name="jnode-cli.jar" alias="${jnode-cli.jar}"/> - <libalias name="mmtk.jar" alias="${mmtk.jar}"/> + <libalias name="jnode-mmtk-genrc.jar" alias="${jnode-mmtk-genrc.jar}"/> + <libalias name="jnode-mmtk-ms.jar" alias="${jnode-mmtk-ms.jar}"/> + <libalias name="jnode-mmtk-nogc.jar" alias="${jnode-mmtk-nogc.jar}"/> - <libalias name="commons-net-1.1.0.jar" alias="${commons-net.jar}"/> - <libalias name="dnsjava-1.6.6.jar" alias="${dnsjava.jar}"/> - <libalias name="jsch-0.1.24.jar" alias="${jsch.jar}"/> - <libalias name="log4j.jar" alias="${log4j.jar}"/> - <libalias name="beanshell.jar" alias="${beanshell.jar}"/> - <libalias name="nanoxml-java.jar" alias="${nanoxml-java.jar}"/> - <libalias name="js.jar" alias="${js.jar}"/> - <libalias name="thinlet.jar" alias="${thinlet.jar}"/> + <libalias name="mmtk.jar" alias="${mmtk.jar}"/> - <libalias name="junit.jar" alias="${junit.jar}"/> - <libalias name="jmock-1.0.1.jar" alias="${jmock.jar}"/> - <libalias name="jmock-cglib-1.0.1.jar" alias="${jmock-cglib.jar}"/> - <libalias name="asm.jar" alias="${asm.jar}"/> - <libalias name="asm-attrs.jar" alias="${asm-attrs.jar}"/> - <libalias name="asm-util.jar" alias="${asm-util.jar}"/> - <libalias name="cglib.jar" alias="${cglib.jar}"/> - <libalias name="mauve.jar" alias="${mauve.jar}"/> + <libalias name="commons-net-1.1.0.jar" alias="${commons-net.jar}"/> + <libalias name="dnsjava-1.6.6.jar" alias="${dnsjava.jar}"/> + <libalias name="jsch-0.1.24.jar" alias="${jsch.jar}"/> + <libalias name="log4j.jar" alias="${log4j.jar}"/> + <libalias name="beanshell.jar" alias="${beanshell.jar}"/> + <libalias name="nanoxml-java.jar" alias="${nanoxml-java.jar}"/> + <libalias name="js.jar" alias="${js.jar}"/> + <libalias name="thinlet.jar" alias="${thinlet.jar}"/> - <libalias name="ant.jar" alias="${ant.jar}"/> - <libalias name="ant-launcher.jar" alias="${ant-launcher.jar}"/> - <libalias name="edtftpj.jar" alias="${edtftpj.jar}"/> - <libalias name="jcifs.jar" alias="${jcifs.jar}"/> - <libalias name="ejc.jar" alias="${ejc.jar}"/> - <libalias name="oncrpc.jar" alias="${oncrpc.jar}"/> - <libalias name="telnetd.jar" alias="${telnetd.jar}"/> - <libalias name="commons-logging.jar" alias="${commons-logging.jar}"/> - <libalias name="jawk.jar" alias="${jawk.jar}"/> - <libalias name="jetty.jar" alias="${jetty.jar}"/> - <libalias name="jetty-util.jar" alias="${jetty-util.jar}"/> - <libalias name="jsp.jar" alias="${jsp.jar}"/> - <libalias name="jsp-api.jar" alias="${jsp-api.jar}"/> - <libalias name="servlet.jar" alias="${servlet.jar}"/> - <libalias name="derby.jar" alias="${derby.jar}"/> - <libalias name="derbynet.jar" alias="${derbynet.jar}"/> - <libalias name="derbytools.jar" alias="${derbytools.jar}"/> + <libalias name="junit.jar" alias="${junit.jar}"/> + <libalias name="jmock-1.0.1.jar" alias="${jmock.jar}"/> + <libalias name="jmock-cglib-1.0.1.jar" alias="${jmock-cglib.jar}"/> + <libalias name="asm.jar" alias="${asm.jar}"/> + <libalias name="asm-attrs.jar" alias="${asm-attrs.jar}"/> + <libalias name="asm-util.jar" alias="${asm-util.jar}"/> + <libalias name="cglib.jar" alias="${cglib.jar}"/> + <libalias name="mauve.jar" alias="${mauve.jar}"/> - <descriptors dir="${descriptors.dir}/"> - <include name="*.xml"/> - <exclude name="*plugin-list.xml"/> - <exclude name="com.sun.tools.javac.xml"/> - <exclude name="com.sun.tools.jdi.xml"/> - <exclude name="javax.ext.tools.xml"/> - <exclude name="sun.tools.xml"/> - <exclude name="org.classpath.core.xml"/> - <exclude name="org.classpath.core.xml"/> - <exclude name="org.classpath.ext.awt.xml"/> - <exclude name="org.classpath.ext.corba.xml"/> - <exclude name="org.classpath.ext.core.xml"/> - <exclude name="org.classpath.ext.imageio.xml"/> - <exclude name="org.classpath.ext.management.xml"/> - <exclude name="org.classpath.ext.print.xml"/> - <exclude name="org.classpath.ext.security.xml"/> - <exclude name="org.classpath.ext.sql.xml"/> - <exclude name="org.classpath.ext.xml"/> - <exclude name="org.classpath.ext.xml.ws.tools.xml"/> - <exclude name="org.classpath.ext.xml.ws.xml"/> - <exclude name="org.classpath.ext.xml.xml"/> - <exclude name="org.classpath.tools.xml"/> - </descriptors> - </plugin> - </target> + <libalias name="ant.jar" alias="${ant.jar}"/> + <libalias name="ant-launcher.jar" alias="${ant-launcher.jar}"/> + <libalias name="edtftpj.jar" alias="${edtftpj.jar}"/> + <libalias name="jcifs.jar" alias="${jcifs.jar}"/> + <libalias name="ejc.jar" alias="${ejc.jar}"/> + <libalias name="oncrpc.jar" alias="${oncrpc.jar}"/> + <libalias name="telnetd.jar" alias="${telnetd.jar}"/> + <libalias name="commons-logging.jar" alias="${commons-logging.jar}"/> + <libalias name="jawk.jar" alias="${jawk.jar}"/> + <libalias name="jetty.jar" alias="${jetty.jar}"/> + <libalias name="jetty-util.jar" alias="${jetty-util.jar}"/> + <libalias name="jsp.jar" alias="${jsp.jar}"/> + <libalias name="jsp-api.jar" alias="${jsp-api.jar}"/> + <libalias name="servlet.jar" alias="${servlet.jar}"/> + <libalias name="derby.jar" alias="${derby.jar}"/> + <libalias name="derbynet.jar" alias="${derbynet.jar}"/> + <libalias name="derbytools.jar" alias="${derbytools.jar}"/> - <!-- Assemble all default initjars --> - <target name="assemble-default-initjars" depends="assemble-plugins" unless="no.default.initjars"> - <!-- Build all default initjar's --> - <taskdef name="initjars" classname="org.jnode.build.InitJarsBuilder" classpathref="cp-jnode"/> - <initjars destdir="${initjars.dir}" + <descriptors dir="${descriptors.dir}/"> + <include name="*.xml"/> + <exclude name="*plugin-list.xml"/> + <exclude name="com.sun.tools.javac.xml"/> + <exclude name="com.sun.tools.jdi.xml"/> + <exclude name="javax.ext.tools.xml"/> + <exclude name="sun.tools.xml"/> + <exclude name="org.classpath.core.xml"/> + <exclude name="org.classpath.core.xml"/> + <exclude name="org.classpath.ext.awt.xml"/> + <exclude name="org.classpath.ext.corba.xml"/> + <exclude name="org.classpath.ext.core.xml"/> + <exclude name="org.classpath.ext.imageio.xml"/> + <exclude name="org.classpath.ext.management.xml"/> + <exclude name="org.classpath.ext.print.xml"/> + <exclude name="org.classpath.ext.security.xml"/> + <exclude name="org.classpath.ext.sql.xml"/> + <exclude name="org.classpath.ext.xml"/> + <exclude name="org.classpath.ext.xml.ws.tools.xml"/> + <exclude name="org.classpath.ext.xml.ws.xml"/> + <exclude name="org.classpath.ext.xml.xml"/> + <exclude name="org.classpath.tools.xml"/> + </descriptors> + </plugin> + </target> + + <!-- Assemble all default initjars --> + <target name="assemble-default-initjars" depends="assemble-plugins" unless="no.default.initjars"> + <!-- Build all default initjar's --> + <taskdef name="initjars" classname="org.jnode.build.InitJarsBuilder" classpathref="cp-jnode"/> + <initjars destdir="${initjars.dir}" pluginDir="${plugins.dir}" systemPluginList="${root.dir}/all/conf/system-plugin-list.xml"> - <insert userApplicationsDir="${user.applications.dir}"/> + <insert userApplicationsDir="${user.applications.dir}"/> - <fileset dir="${root.dir}/all/conf"> - <exclude name="system-plugin-list.xml"/> - <include name="*plugin-list.xml"/> - </fileset> - </initjars> - </target> + <fileset dir="${root.dir}/all/conf"> + <exclude name="system-plugin-list.xml"/> + <include name="*plugin-list.xml"/> + </fileset> + </initjars> + </target> - <!-- Assemble all custom initjars --> - <target name="assemble-custom-initjars" depends="assemble-plugins" if="custom.plugin-list.dir"> - <!-- Build all custom initjar's --> - <taskdef name="initjars" classname="org.jnode.build.InitJarsBuilder" classpathref="cp-jnode"/> - <initjars destdir="${initjars.dir}" + <!-- Assemble all custom initjars --> + <target name="assemble-custom-initjars" depends="assemble-plugins" if="custom.plugin-list.dir"> + <!-- Build all custom initjar's --> + <taskdef name="initjars" classname="org.jnode.build.InitJarsBuilder" classpathref="cp-jnode"/> + <initjars destdir="${initjars.dir}" pluginDir="${plugins.dir}" systemPluginList="${root.dir}/all/conf/system-plugin-list.xml"> - <insert userApplicationsDir="${user.applications.dir}"/> - <fileset dir="${custom.plugin-list.dir}"> - <include name="*plugin-list.xml"/> - </fileset> - </initjars> - </target> + <insert userApplicationsDir="${user.applications.dir}"/> + <fileset dir="${custom.plugin-list.dir}"> + <include name="*plugin-list.xml"/> + </fileset> + </initjars> + </target> - <!-- Assemble all subprojects, plugins and initjars --> - <target name="assemble" depends="assemble-default-initjars, assemble-custom-initjars"> - </target> + <target name="assemble" depends="assemble-default-initjars, assemble-custom-initjars" description="Assemble all subprojects, plugins and initjars."> + </target> - <!-- Give help on possible targets --> - <target name="help" description="help on the important targets"> - <echo> + + <target name="help" description="Display detailed usage information."> + <echo> Welcome to the JNode build system. You can use this build system to perform various tasks, @@ -554,11 +553,7 @@ 32-bit architecture. cd-x86_64-lite Build the JNode bootable CD-ROM for the X86 64-bit architecture. -<!-- -create-patch Create a patch file containing the differences - between the local sources and the cvs HEAD - branch. ---> + boot-files-winNT Build the JNode boot files for windows NT/2K/XP used together with NTLDR @@ -574,77 +569,71 @@ clean Remove all intermediate build results. </echo> - </target> + </target> - <!-- Macro used to call the x86 build script --> - <macrodef name="x86-build"> - <attribute name="bits"/> - <attribute name="target" default="all"/> - <sequential> - <ant antfile="build-x86.xml" inheritall="on" inheritrefs="on" target="@{target}"> - <property name="jnode.bits" value="@{bits}"/> - </ant> - </sequential> - </macrodef> + <macrodef name="x86-build" description="Call the x86 build script."> + <attribute name="bits"/> + <attribute name="target" default="all"/> + <sequential> + <ant antfile="build-x86.xml" inheritall="on" inheritrefs="on" target="@{target}"> + <property name="jnode.bits" value="@{bits}"/> + </ant> + </sequential> + </macrodef> - <!-- Create the X86 32-bit boot image --> - <target name="x86" depends="assemble"> - <x86-build bits="32"/> - </target> + <target name="x86" depends="assemble" description="Create the X86 32-bit boot image"> + <x86-build bits="32"/> + </target> - <!-- Create the X86 64-bit boot image--> - <target name="x86_64" depends="assemble"> - <x86-build bits="64"/> - </target> + <target name="x86_64" depends="assemble" description="Create the X86 64-bit boot image"> + <x86-build bits="64"/> + </target> - <!-- Create the JOP boot image --> - <target name="jop" depends="assemble"> - <ant antfile="build-jop.xml" inheritall="on" inheritrefs="on"/> - </target> + <target name="jop" depends="assemble" description="Create the JOP boot image"> + <ant antfile="build-jop.xml" inheritall="on" inheritrefs="on"/> + </target> - <!-- Build the boot files for windows NT/2K/XP (with NTLDR) --> - <target name="boot-files-winNT" depends="assemble"> - <x86-build bits="32" target="boot-files-winNT"/> - </target> + <target name="boot-files-winNT" depends="assemble" description="Build the boot files for windows NT/2K/XP (with NTLDR)"> + <x86-build bits="32" target="boot-files-winNT"/> + </target> - <!-- Create a bootable CDROM image containing all x86 bootable images and the sources --> - <target name="cd-x86" depends="assemble" description="create a bootable JNode CD image with sources included"> - <tar destfile="${sources.dist.tar.gz}" compression="gzip" basedir="${root.dir}" excludes="*/build/**"/> - <x86-build bits="32" target="java-image"/> - <!-- TODO enable this when 64 bit support is working --> - <!--x86-build bits="64" target="java-image"/--> - <property name="jnode.bits" value="32" /> - <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom"/> - </target> + <!-- Create a bootable CDROM image containing all x86 bootable images and the sources --> + <target name="cd-x86" depends="assemble" description="Create a bootable JNode CD image with sources included"> + <tar destfile="${sources.dist.tar.gz}" compression="gzip" basedir="${root.dir}" excludes="*/build/**"/> + <x86-build bits="32" target="java-image"/> + <!-- TODO enable this when 64 bit support is working --> + <!--x86-build bits="64" target="java-image"/--> + <property name="jnode.bits" value="32" /> + <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom"/> + </target> - <!-- Create a bootable CDROM image for x86 32-bits --> - <target name="cd-x86-lite" depends="assemble" description="create a bootable JNode CD image"> - <x86-build bits="32" target="java-image"/> - <property name="jnode.bits" value="32" /> - <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom-lite"/> - </target> + <!-- Create a bootable CDROM image for x86 32-bits --> + <target name="cd-x86-lite" depends="assemble" description="Create a bootable JNode CD image"> + <x86-build bits="32" target="java-image"/> + <property name="jnode.bits" value="32" /> + <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom-lite"/> + </target> - <!-- Create a bootable CDROM image for x86 64-bits --> - <target name="cd-x86_64-lite" depends="assemble"> - <x86-build bits="64" target="java-image"/> - <property name="jnode.bits" value="64" /> - <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom_64-lite"/> - </target> + <target name="cd-x86_64-lite" depends="assemble" description="Create a bootable CDROM image for x86 64-bits"> + <x86-build bits="64" target="java-image"/> + <property name="jnode.bits" value="64" /> + <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom_64-lite"/> + </target> - <!-- Upload a distribution --> - <target name="upload"> - <property name="upload.dir" value="${build.dir}/upload"/> - <mkdir dir="${upload.dir}"/> - <gzip src="${jnode-x86.iso}" destfile="${upload.dir}/jnode-x86-${jnode-ver}.iso.gz"/> - <copy todir="${upload.dir}" file="${sources.dist.tar.gz}"/> - <checksum algorithm="MD5" forceoverwrite="true"> - <fileset dir="${upload.dir}"> - <include name="jnode-x86-${jnode-ver}.iso.gz" /> - <include name="jnodesources-${jnode-ver}.tar.gz" /> - </fileset> - </checksum> - <echo message="FTP upload disabled. Uploadables are in: ${upload.dir}"/> - <!-- + <!-- Upload a distribution --> + <target name="upload"> + <property name="upload.dir" value="${build.dir}/upload"/> + <mkdir dir="${upload.dir}"/> + <gzip src="${jnode-x86.iso}" destfile="${upload.dir}/jnode-x86-${jnode-ver}.iso.gz"/> + <copy todir="${upload.dir}" file="${sources.dist.tar.gz}"/> + <checksum algorithm="MD5" forceoverwrite="true"> + <fileset dir="${upload.dir}"> + <include name="jnode-x86-${jnode-ver}.iso.gz" /> + <include name="jnodesources-${jnode-ver}.tar.gz" /> + </fileset> + </checksum> + <echo message="FTP upload disabled. Uploadables are in: ${upload.dir}"/> + <!-- TODO find a way to automatically upload the files jsch based scp with sftp fails with an error to sourceforge FTP uploads are abandone by sourceforge @@ -652,108 +641,107 @@ <fileset dir="${upload.dir}"/> </ftp> --> - </target> - + </target> + <!-- Save virtualization etc state across 'clean' --> <target name="save"> - <copy file="${cdroms.dir}/JNode.nvram" todir="${save.dir}" failonerror="no"/> + <copy file="${cdroms.dir}/JNode.nvram" todir="${save.dir}" failonerror="no"/> </target> - <!-- Clean everything files --> - <target name="clean" depends="save" description="clean the complete build output"> - <jnode.antall target="clean"/> - <delete dir="${build.dir}" quiet="on"/> - </target> - + <!-- Clean everything files --> + <target name="clean" depends="save" description="clean the complete build output"> + <jnode.antall target="clean"/> + <delete dir="${build.dir}" quiet="on"/> + </target> + <path id="cp-javadoc"> - <path refid="cp"/> + <path refid="cp"/> <pathelement location="${bcel-5.1.jar}"/> <pathelement location="${nanoxml-java.jar}"/> </path> - <!-- Generate only the basic api javadoc files --> - <target name="javadoc-small" description="generate documentation of the basic JNode APIs"> - <jnode.javadoc destdir="${build.dir}/javadoc/small"> - <sourcepath> - <pathelement location="${root.dir}/core/src/classlib"/> - <pathelement location="${root.dir}/core/src/classpath/ext"/> - <pathelement location="${root.dir}/core/src/classpath/vm"/> - <pathelement location="${root.dir... [truncated message content] |
From: <ga...@us...> - 2012-03-27 15:16:51
|
Revision: 5893 http://jnode.svn.sourceforge.net/jnode/?rev=5893&view=rev Author: galatnm Date: 2012-03-27 15:16:35 +0000 (Tue, 27 Mar 2012) Log Message: ----------- Various clean up for performance. Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java trunk/cli/src/commands/org/jnode/command/system/PageCommand.java trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java trunk/core/src/core/org/jnode/debugger/ThreadState.java trunk/core/src/core/org/jnode/log4j/config/VirtualConsoleAppender.java trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java trunk/core/src/core/org/jnode/plugin/PluginLoader.java trunk/core/src/core/org/jnode/plugin/PluginUtils.java trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java trunk/core/src/core/org/jnode/util/DecimalScaleFactor.java trunk/core/src/core/org/jnode/util/JarBuffer.java trunk/core/src/core/org/jnode/util/NumberUtils.java trunk/core/src/core/org/jnode/vm/IOResourceImpl.java trunk/core/src/core/org/jnode/vm/VmStackFrame.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeParser.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeViewer.java trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/Signature.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstMemberRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmField.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariableTable.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeViewer.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java trunk/core/src/core/org/jnode/vm/compiler/ir/LiveRange.java trunk/core/src/core/org/jnode/vm/compiler/ir/NativeTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java trunk/core/src/core/org/jnode/vm/isolate/IsolateStatusImpl.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefGCStatistics.java trunk/core/src/core/org/jnode/vm/objects/CounterGroup.java trunk/core/src/core/org/jnode/vm/objects/SynchronizedCounter.java trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java trunk/core/src/core/org/jnode/vm/x86/GDT.java trunk/core/src/core/org/jnode/vm/x86/IOAPIC.java trunk/core/src/core/org/jnode/vm/x86/MPInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86RegisterPool.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireDevice.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBaseAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDescriptors.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDevice.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType0.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/VendorDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDevice.java trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMM.java trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMMDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/ConfigurationDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/DeviceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/EndPointDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/InterfaceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBConfiguration.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBInterface.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/QueueHead.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/Schedule.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/TransferDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIControlRequest.java trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java trunk/core/src/driver/org/jnode/driver/input/Key.java trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java trunk/core/src/driver/org/jnode/driver/input/Keys.java trunk/core/src/driver/org/jnode/driver/input/PointerEvent.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiDriver.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiSystemTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/AcpiTable.java trunk/core/src/driver/org/jnode/driver/system/acpi/GenericAddress.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/ParseNode.java trunk/core/src/driver/org/jnode/driver/system/acpi/aml/Parser.java trunk/core/src/driver/org/jnode/driver/system/acpi/vm/Device.java trunk/net/src/driver/org/jnode/driver/net/_3c90x/_3c90xCore.java trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineRing.java Modified: trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java 2012-03-26 12:56:18 UTC (rev 5892) +++ trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java 2012-03-27 15:16:35 UTC (rev 5893) @@ -29,7 +29,6 @@ import java.lang.reflect.Modifier; import java.net.MalformedURLException; import java.net.URL; - import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.ClassNameArgument; @@ -143,17 +142,21 @@ } } - private URL findResource(String name, String[] dirs) + private URL findResource(String name, String[] dirs) throws MalformedURLException { - for (int i = 0; i < dirs.length; i++) { - File d = new File(dirs[i]); - if (d.isDirectory()) { - return findResource(name, d.list()); - } else if (d.getName().equals(name)) { - return d.toURI().toURL(); + findResource: + while (true) { + for (int i = 0; i < dirs.length; i++) { + File d = new File(dirs[i]); + if (d.isDirectory()) { + dirs = d.list(); + continue findResource; + } else if (d.getName().equals(name)) { + return d.toURI().toURL(); + } } + return null; } - return null; } private byte[] loadClassData(String name) throws ClassNotFoundException { Modified: trunk/cli/src/commands/org/jnode/command/system/PageCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/PageCommand.java 2012-03-26 12:56:18 UTC (rev 5892) +++ trunk/cli/src/commands/org/jnode/command/system/PageCommand.java 2012-03-27 15:16:35 UTC (rev 5893) @@ -33,9 +33,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; - import javax.naming.NameNotFoundException; - import org.jnode.driver.console.ConsoleManager; import org.jnode.driver.console.TextConsole; import org.jnode.driver.console.textscreen.TextScreenConsoleManager; @@ -498,25 +496,28 @@ /** * Prepare lines for output by painting them to our private buffer in the forward * direction starting at a given line number and (rendered) subline number. - * + * * @param startLineNo */ private ScreenBuffer prepare(int startLineNo, int startSublineNo) { - ScreenBuffer buffer = new ScreenBuffer(true); - int lineNo = startLineNo; - boolean more; - do { - String line = lineStore.getLine(lineNo); - if (line == null) { - break; + while (true) { + ScreenBuffer buffer = new ScreenBuffer(true); + int lineNo = startLineNo; + boolean more; + do { + String line = lineStore.getLine(lineNo); + if (line == null) { + break; + } + more = prepareLine(line, lineNo, buffer); + lineNo++; + } while (more); + if (buffer.adjust(startLineNo, startSublineNo) || startLineNo == 0) { + return buffer; + } else { + startLineNo -= 1; + startSublineNo = LAST_SUBLINE; } - more = prepareLine(line, lineNo, buffer); - lineNo++; - } while (more); - if (buffer.adjust(startLineNo, startSublineNo) || startLineNo == 0) { - return buffer; - } else { - return prepare(startLineNo - 1, LAST_SUBLINE); } } Modified: trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2012-03-26 12:56:18 UTC (rev 5892) +++ trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2012-03-27 15:16:35 UTC (rev 5893) @@ -20,20 +20,12 @@ package org.jnode.assembler.x86; -import static org.jnode.assembler.x86.X86Register.CS; -import static org.jnode.assembler.x86.X86Register.DS; -import static org.jnode.assembler.x86.X86Register.ES; -import static org.jnode.assembler.x86.X86Register.FS; -import static org.jnode.assembler.x86.X86Register.GS; -import static org.jnode.assembler.x86.X86Register.SS; - import java.io.IOException; import java.io.OutputStream; import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; - import org.jnode.assembler.BootImageNativeStream; import org.jnode.assembler.Label; import org.jnode.assembler.NativeStream; @@ -52,6 +44,13 @@ import org.jnode.vm.classmgr.VmType; import org.jnode.vm.x86.X86CpuID; +import static org.jnode.assembler.x86.X86Register.CS; +import static org.jnode.assembler.x86.X86Register.DS; +import static org.jnode.assembler.x86.X86Register.ES; +import static org.jnode.assembler.x86.X86Register.FS; +import static org.jnode.assembler.x86.X86Register.GS; +import static org.jnode.assembler.x86.X86Register.SS; + /** * Implementation of AbstractX86Stream. * @@ -247,12 +246,12 @@ */ public void setOffset(int offset) { if (this.dataOffset != -1) { - if ("".equals(getObject().toString())) { + if (getObject().toString().isEmpty()) { return; } throw new RuntimeException( "Offset is already set. Duplicate labels? (" - + getObject() + ")"); + + getObject() + ')'); } if (offset < 0) { throw new IllegalArgumentException("Offset: " + offset); @@ -292,7 +291,7 @@ // System.out.println("offset " + offset); final int distance = offset - addr - 1; //get8(addr); if (!X86Utils.isByte(distance)) { - throw new IllegalArgumentException("Jump out of byte-range (" + distance + ")"); + throw new IllegalArgumentException("Jump out of byte-range (" + distance + ')'); } if (isRelJump() && (distance == 0)) { // JMP @@ -2219,7 +2218,7 @@ write8(distance); } else { throw new UnresolvedObjectRefException("Label " + label - + " is out of range (distance " + distance + ")"); + + " is out of range (distance " + distance + ')'); } } catch (UnresolvedObjectRefException x) { throw new RuntimeException(x); @@ -2478,7 +2477,7 @@ write8(distance); } else { throw new UnresolvedObjectRefException("Label " + label - + " is out of range (distance " + distance + ")"); + + " is out of range (distance " + distance + ')'); } } else { throw new UnresolvedObjectRefException("Label " + label Modified: trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2012-03-26 12:56:18 UTC (rev 5892) +++ trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java 2012-03-27 15:16:35 UTC (rev 5893) @@ -25,7 +25,6 @@ import java.io.PrintWriter; import java.io.Writer; import java.util.Collection; - import org.jnode.assembler.Label; import org.jnode.assembler.NativeStream; import org.jnode.assembler.ObjectResolver; @@ -308,7 +307,7 @@ } public ObjectRef setObjectRef(Object label) { - println(label(label) + ":"); + println(label(label) + ':'); return new ObjectRefImpl(label); } @@ -364,11 +363,11 @@ * @param imm32 */ public void writeADC(GPR dstReg, int imm32) { - println("\tadc " + dstReg + "," + imm32); + println("\tadc " + dstReg + ',' + imm32); } public void writeADC(int operandSize, GPR dstReg, int dstDisp, int imm32) { - println("\tadc " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tadc " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "]," + imm32); } @@ -383,7 +382,7 @@ * @param srcReg */ public void writeADC(GPR dstReg, GPR srcReg) { - println("\tadc " + dstReg + "," + srcReg); + println("\tadc " + dstReg + ',' + srcReg); } /** @@ -394,7 +393,7 @@ * @param srcDisp */ public void writeADC(GPR dstReg, GPR srcReg, int srcDisp) { - println("\tadc " + dstReg + ",[" + srcReg + disp(srcDisp) + "]"); + println("\tadc " + dstReg + ",[" + srcReg + disp(srcDisp) + ']'); } // LS @@ -407,7 +406,7 @@ } public void writeADD(int operandSize, int dstDisp, int imm32) { - println("\tadd " + size(operandSize) + "[" + disp(dstDisp) + println("\tadd " + size(operandSize) + '[' + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -419,17 +418,17 @@ * @param imm32 */ public void writeADD(int operandSize, GPR dstReg, int dstDisp, int imm32) { - println("\tadd " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tadd " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } public void writeADD(int operandSize, SR dstReg, int dstDisp, int imm32) { - println("\tadd " + size(operandSize) + "[" + dstReg + ":0x" + println("\tadd " + size(operandSize) + '[' + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } public void writeADD_MEM(X86Register.GPR reg, int memPtr32) { - println("\tadd " + reg + ",[0x" + NumberUtils.hex(memPtr32) + "]"); + println("\tadd " + reg + ",[0x" + NumberUtils.hex(memPtr32) + ']'); } public void writeADD(GPR dstReg, int dstDisp, GPR srcReg) { @@ -437,7 +436,7 @@ } public void writeADD(GPR dstReg, GPR srcReg) { - println("\tadd " + dstReg + "," + srcReg); + println("\tadd " + dstReg + ',' + srcReg); } /** @@ -448,7 +447,7 @@ * @param srcDisp */ public void writeADD(GPR dstReg, GPR srcReg, int srcDisp) { - println("\tadd " + dstReg + ",[" + srcReg + disp(srcDisp) + "]"); + println("\tadd " + dstReg + ",[" + srcReg + disp(srcDisp) + ']'); } public void writeAND(GPR reg, int imm32) { @@ -456,7 +455,7 @@ } public void writeAND(int operandSize, int dstDisp, int imm32) { - println("\tand " + size(operandSize) + "[" + disp(dstDisp) + println("\tand " + size(operandSize) + '[' + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -466,7 +465,7 @@ * @param imm32 */ public void writeAND(int operandSize, GPR dstReg, int dstDisp, int imm32) { - println("\tand " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tand " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -481,12 +480,12 @@ * @param imm32 */ public void writeAND(int operandSize, X86Register.SR dstReg, int dstDisp, int imm32) { - println("\tand " + size(operandSize) + "[" + dstReg + ":0x" + NumberUtils.hex(dstDisp) + println("\tand " + size(operandSize) + '[' + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } public void writeAND(GPR dstReg, GPR srcReg) { - println("\tand " + dstReg + "," + srcReg); + println("\tand " + dstReg + ',' + srcReg); } /** @@ -495,31 +494,31 @@ * @param srcDisp */ public void writeAND(GPR dstReg, GPR srcReg, int srcDisp) { - println("\tand " + dstReg + ",[" + srcReg + disp(srcDisp) + "]"); + println("\tand " + dstReg + ",[" + srcReg + disp(srcDisp) + ']'); } public void writeArithSSEDOp(int operation, XMM dst, GPR src, int srcDisp) { final String op = getSSEOperationName(operation); - println("\t" + op + "D" + dst + ", qword [" + src + disp(srcDisp) + "]"); + println('\t' + op + 'D' + dst + ", qword [" + src + disp(srcDisp) + ']'); } public void writeArithSSEDOp(int operation, XMM dst, XMM src) { final String op = getSSEOperationName(operation); - println("\t" + op + "D" + dst + ", " + src); + println('\t' + op + 'D' + dst + ", " + src); } public void writeArithSSESOp(int operation, XMM dst, GPR src, int srcDisp) { final String op = getSSEOperationName(operation); - println("\t" + op + "S" + dst + ", dword [" + src + disp(srcDisp) + "]"); + println('\t' + op + 'S' + dst + ", dword [" + src + disp(srcDisp) + ']'); } public void writeArithSSESOp(int operation, XMM dst, XMM src) { final String op = getSSEOperationName(operation); - println("\t" + op + "S" + dst + ", " + src); + println('\t' + op + 'S' + dst + ", " + src); } public void writeBOUND(GPR lReg, GPR rReg, int rDisp) { - println("\tbound " + lReg + ",[" + rReg + disp(rDisp) + "]"); + println("\tbound " + lReg + ",[" + rReg + disp(rDisp) + ']'); } public void writeBreakPoint() { @@ -540,7 +539,7 @@ * @param rawAddress If true, tablePtr is a raw address */ public void writeCALL(Object tablePtr, int offset, boolean rawAddress) { - println("\tcall [" + tablePtr + disp(offset) + "]"); + println("\tcall [" + tablePtr + disp(offset) + ']'); } public void writeCALL(GPR reg) { @@ -554,16 +553,16 @@ * @param offset */ public void writeCALL(GPR reg, int offset) { - println("\tcall [" + reg + disp(offset) + "]"); + println("\tcall [" + reg + disp(offset) + ']'); } public void writeCALL(GPR regBase, GPR regIndex, int scale, int disp) { - println("\tcall [" + regBase + "+" + regIndex + "*" + scale - + disp(disp) + "]"); + println("\tcall [" + regBase + '+' + regIndex + '*' + scale + + disp(disp) + ']'); } public void writeCALL(GPR regIndex, int scale, int disp) { - println("\tcall [" + regIndex + "*" + scale + disp(disp) + "]"); + println("\tcall [" + regIndex + '*' + scale + disp(disp) + ']'); } public void writeCDQ(int operandSize) { @@ -611,7 +610,7 @@ * @param src */ public void writeCMOVcc(int ccOpcode, GPR dst, GPR src) { - println("\tCMOV" + ccName(ccOpcode) + " " + dst + "," + src); + println("\tCMOV" + ccName(ccOpcode) + ' ' + dst + ',' + src); } /** @@ -622,8 +621,8 @@ * @param srcDisp */ public void writeCMOVcc(int ccOpcode, GPR dst, GPR src, int srcDisp) { - println("\tCMOV" + ccName(ccOpcode) + " " + dst + ",[" + src - + disp(srcDisp) + "]"); + println("\tCMOV" + ccName(ccOpcode) + ' ' + dst + ",[" + src + + disp(srcDisp) + ']'); } /** @@ -638,7 +637,7 @@ } public void writeCMP(GPR reg1, GPR reg2) { - println("\tcmp " + reg1 + "," + reg2); + println("\tcmp " + reg1 + ',' + reg2); } /** @@ -649,7 +648,7 @@ * @param disp */ public void writeCMP(GPR reg1, SR reg2, int disp) { - println("\tcmp " + reg1 + ",[" + reg2 + ":0x" + NumberUtils.hex(disp) + "]"); + println("\tcmp " + reg1 + ",[" + reg2 + ":0x" + NumberUtils.hex(disp) + ']'); } /** @@ -660,7 +659,7 @@ * @param disp */ public void writeCMP(GPR reg1, GPR reg2, int disp) { - println("\tcmp " + reg1 + ",[" + reg2 + disp(disp) + "]"); + println("\tcmp " + reg1 + ",[" + reg2 + disp(disp) + ']'); } public void writeCMP_Const(GPR reg, int imm32) { @@ -675,7 +674,7 @@ * @param imm32 */ public void writeCMP_Const(int operandSize, GPR reg, int disp, int imm32) { - println("\tcmp " + size(operandSize) + "[" + reg + disp(disp) + "],0x" + println("\tcmp " + size(operandSize) + '[' + reg + disp(disp) + "],0x" + NumberUtils.hex(imm32)); } @@ -688,7 +687,7 @@ * @param imm32 */ public void writeCMP_Const(int operandSize, X86Register.SR dstReg, int dstDisp, int imm32) { - println("\tcmp " + size(operandSize) + "[" + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "],0x" + println("\tcmp " + size(operandSize) + '[' + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -702,7 +701,7 @@ } public void writeCMP_MEM(int operandSize, int memPtr, int imm32) { - println("\tcmp " + size(operandSize) + "[" + memPtr + "],0x" + println("\tcmp " + size(operandSize) + '[' + memPtr + "],0x" + NumberUtils.hex(imm32)); } @@ -713,7 +712,7 @@ * @param memPtr */ public void writeCMP_MEM(GPR reg, int memPtr) { - println("\tcmp " + reg + ", [" + memPtr + "]"); + println("\tcmp " + reg + ", [" + memPtr + ']'); } public void writeCMPXCHG_EAX(GPR dstReg, int dstDisp, GPR srcReg, @@ -730,8 +729,8 @@ } public void writeDEC(int operandSize, GPR dstReg, int dstDisp) { - println("\tdec " + size(operandSize) + "[" + dstReg + disp(dstDisp) - + "]"); + println("\tdec " + size(operandSize) + '[' + dstReg + disp(dstDisp) + + ']'); } public void writeDIV_EAX(GPR srcReg) { @@ -744,11 +743,11 @@ } public void writeFADD32(GPR srcReg, int srcDisp) { - println("\tfadd dword [" + srcReg + disp(srcDisp) + "]"); + println("\tfadd dword [" + srcReg + disp(srcDisp) + ']'); } public void writeFADD64(GPR srcReg, int srcDisp) { - println("\tfadd qword [" + srcReg + disp(srcDisp) + "]"); + println("\tfadd qword [" + srcReg + disp(srcDisp) + ']'); } public void writeFADDP(X86Register fpuReg) { @@ -760,11 +759,11 @@ } public void writeFDIV32(GPR srcReg, int srcDisp) { - println("\tfdiv dword [" + srcReg + disp(srcDisp) + "]"); + println("\tfdiv dword [" + srcReg + disp(srcDisp) + ']'); } public void writeFDIV64(GPR srcReg, int srcDisp) { - println("\tfdiv qword [" + srcReg + disp(srcDisp) + "]"); + println("\tfdiv qword [" + srcReg + disp(srcDisp) + ']'); } public void writeFDIVP(X86Register fpuReg) { @@ -776,51 +775,51 @@ } public void writeFILD32(GPR dstReg, int dstDisp) { - println("\tfild dword [" + dstReg + disp(dstDisp) + "]"); + println("\tfild dword [" + dstReg + disp(dstDisp) + ']'); } public void writeFILD64(GPR dstReg, int dstDisp) { - println("\tfild qword [" + dstReg + disp(dstDisp) + "]"); + println("\tfild qword [" + dstReg + disp(dstDisp) + ']'); } public void writeFISTP32(GPR dstReg, int dstDisp) { - println("\tfistp dword [" + dstReg + disp(dstDisp) + "]"); + println("\tfistp dword [" + dstReg + disp(dstDisp) + ']'); } public void writeFISTP64(GPR dstReg, int dstDisp) { - println("\tfistp qword [" + dstReg + disp(dstDisp) + "]"); + println("\tfistp qword [" + dstReg + disp(dstDisp) + ']'); } public void writeFLD32(GPR srcReg, int srcDisp) { - println("\tfld dword [" + srcReg + disp(srcDisp) + "]"); + println("\tfld dword [" + srcReg + disp(srcDisp) + ']'); } public void writeFLD32(GPR srcBaseReg, GPR srcIndexReg, int srcScale, int srcDisp) { println("\tfld dword [" + srcBaseReg + '+' + srcIndexReg + '*' - + srcScale + disp(srcDisp) + "]"); + + srcScale + disp(srcDisp) + ']'); } public void writeFLD64(GPR srcReg, int srcDisp) { - println("\tfld qword [" + srcReg + disp(srcDisp) + "]"); + println("\tfld qword [" + srcReg + disp(srcDisp) + ']'); } public void writeFLD64(GPR srcBaseReg, GPR srcIndexReg, int srcScale, int srcDisp) { println("\tfld qword [" + srcBaseReg + '+' + srcIndexReg + '*' - + srcScale + disp(srcDisp) + "]"); + + srcScale + disp(srcDisp) + ']'); } public void writeFLDCW(GPR srcReg, int srcDisp) { - println("\tfldcw word [" + srcReg + disp(srcDisp) + "]"); + println("\tfldcw word [" + srcReg + disp(srcDisp) + ']'); } public void writeFMUL32(GPR srcReg, int srcDisp) { - println("\tfmul dword [" + srcReg + disp(srcDisp) + "]"); + println("\tfmul dword [" + srcReg + disp(srcDisp) + ']'); } public void writeFMUL64(GPR srcReg, int srcDisp) { - println("\tfmul qword [" + srcReg + disp(srcDisp) + "]"); + println("\tfmul qword [" + srcReg + disp(srcDisp) + ']'); } public void writeFMULP(X86Register fpuReg) { @@ -832,7 +831,7 @@ } public void writeFNSAVE(GPR srcReg, int srcDisp) { - println("\tfnsave [" + srcReg + disp(srcDisp) + "]"); + println("\tfnsave [" + srcReg + disp(srcDisp) + ']'); } public void writeFNSTSW_AX() { @@ -844,11 +843,11 @@ } public void writeFRSTOR(GPR srcReg, int srcDisp) { - println("\tfrstor [" + srcReg + disp(srcDisp) + "]"); + println("\tfrstor [" + srcReg + disp(srcDisp) + ']'); } public void writeFSTCW(GPR srcReg, int srcDisp) { - println("\tfstcw word [" + srcReg + disp(srcDisp) + "]"); + println("\tfstcw word [" + srcReg + disp(srcDisp) + ']'); } public void writeFSTP(X86Register fpuReg) { @@ -856,19 +855,19 @@ } public void writeFSTP32(GPR dstReg, int dstDisp) { - println("\tfstp dword [" + dstReg + disp(dstDisp) + "]"); + println("\tfstp dword [" + dstReg + disp(dstDisp) + ']'); } public void writeFSTP64(GPR dstReg, int dstDisp) { - println("\tfstp qword [" + dstReg + disp(dstDisp) + "]"); + println("\tfstp qword [" + dstReg + disp(dstDisp) + ']'); } public void writeFSUB32(GPR srcReg, int srcDisp) { - println("\tfsub32 dword [" + srcReg + disp(srcDisp) + "]"); + println("\tfsub32 dword [" + srcReg + disp(srcDisp) + ']'); } public void writeFSUB64(GPR srcReg, int srcDisp) { - println("\tfsub64 qword [" + srcReg + disp(srcDisp) + "]"); + println("\tfsub64 qword [" + srcReg + disp(srcDisp) + ']'); } public void writeFSUBP(X86Register fpuReg) { @@ -884,11 +883,11 @@ } public void writeFXRSTOR(GPR srcReg, int srcDisp) { - println("\tfxrstor [" + srcReg + disp(srcDisp) + "]"); + println("\tfxrstor [" + srcReg + disp(srcDisp) + ']'); } public void writeFXSAVE(GPR srcReg, int srcDisp) { - println("\tfxsave [" + srcReg + disp(srcDisp) + "]"); + println("\tfxsave [" + srcReg + disp(srcDisp) + ']'); } public void writeHLT() { @@ -900,12 +899,12 @@ } public void writeIDIV_EAX(int operandSize, GPR srcReg, int srcDisp) { - println("\tidiv " + size(operandSize) + "[" + srcReg + disp(srcDisp) - + "]"); + println("\tidiv " + size(operandSize) + '[' + srcReg + disp(srcDisp) + + ']'); } public void writeIMUL(GPR dstReg, GPR srcReg) { - println("\timul " + dstReg + "," + srcReg); + println("\timul " + dstReg + ',' + srcReg); } /** @@ -914,7 +913,7 @@ * @param srcDisp */ public void writeIMUL(GPR dstReg, GPR srcReg, int srcDisp) { - println("\timul " + dstReg + ",[" + srcReg + disp(srcDisp) + "]"); + println("\timul " + dstReg + ",[" + srcReg + disp(srcDisp) + ']'); } /** @@ -923,7 +922,7 @@ * @param imm32 */ public void writeIMUL_3(GPR dstReg, GPR srcReg, int imm32) { - println("\timul " + dstReg + "," + srcReg + ",0x" + println("\timul " + dstReg + ',' + srcReg + ",0x" + NumberUtils.hex(imm32)); } @@ -945,11 +944,11 @@ public void writeIN(int operandSize) { if (operandSize == X86Constants.BITS8) { - println("\tin " + X86Register.AL + "," + X86Register.DX); + println("\tin " + X86Register.AL + ',' + X86Register.DX); } else if (operandSize == X86Constants.BITS16) { - println("\tin " + X86Register.AX + "," + X86Register.DX); + println("\tin " + X86Register.AX + ',' + X86Register.DX); } else if (operandSize == X86Constants.BITS32) { - println("\tin " + X86Register.EAX + "," + X86Register.DX); + println("\tin " + X86Register.EAX + ',' + X86Register.DX); } else { throw new IllegalArgumentException("Invalid operand size for IN: " + operandSize); } @@ -957,11 +956,11 @@ public void writeIN(int operandSize, int imm8) { if (operandSize == X86Constants.BITS8) { - println("\tin " + X86Register.AL + "," + imm8); + println("\tin " + X86Register.AL + ',' + imm8); } else if (operandSize == X86Constants.BITS16) { - println("\tin " + X86Register.AX + "," + imm8); + println("\tin " + X86Register.AX + ',' + imm8); } else if (operandSize == X86Constants.BITS32) { - println("\tin " + X86Register.EAX + "," + imm8); + println("\tin " + X86Register.EAX + ',' + imm8); } else { throw new IllegalArgumentException("Invalid operand size for IN: " + operandSize); } @@ -972,7 +971,7 @@ } public void writeINC(int operandSize, X86Register.SR dstReg, int disp) { - println("\tinc " + size(operandSize) + "[" + dstReg + ":0x" + NumberUtils.hex(disp) + "]"); + println("\tinc " + size(operandSize) + '[' + dstReg + ":0x" + NumberUtils.hex(disp) + ']'); } /** @@ -981,11 +980,11 @@ * @param dstReg */ public void writeINC(int operandSize, GPR dstReg, int disp) { - println("\tinc " + size(operandSize) + "[" + dstReg + disp(disp) + "]"); + println("\tinc " + size(operandSize) + '[' + dstReg + disp(disp) + ']'); } public void writeINC(int operandSize, GPR dstReg, GPR dstIdxReg, int scale, int disp) { - println("\tinc [" + dstReg + disp(disp) + "+" + dstIdxReg + "*" + scale + "]"); + println("\tinc [" + dstReg + disp(disp) + '+' + dstIdxReg + '*' + scale + ']'); } /** @@ -994,7 +993,7 @@ * @param dstDisp */ public void writeINC(int operandSize, int dstDisp) { - println("\tinc " + size(operandSize) + "[" + dstDisp + "]"); + println("\tinc " + size(operandSize) + '[' + dstDisp + ']'); } public void writeINT(int vector) { @@ -1006,7 +1005,7 @@ } public void writeJCC(Label label, int jumpOpcode) { - println("\tj" + ccName(jumpOpcode) + " " + label(label)); + println("\tj" + ccName(jumpOpcode) + ' ' + label(label)); } public void writeJECXZ(Label label) { @@ -1048,7 +1047,7 @@ * @param offsetReg */ public void writeJMP(Object tablePtr, GPR offsetReg) { - println("\tjmp [" + tablePtr + "+" + offsetReg + "]"); + println("\tjmp [" + tablePtr + '+' + offsetReg + ']'); } public void writeJMP(GPR reg32) { @@ -1061,33 +1060,33 @@ * @param reg32 */ public final void writeJMP(GPR reg32, int disp) { - println("\tjmp [" + reg32 + disp(disp) + "]"); + println("\tjmp [" + reg32 + disp(disp) + ']'); } public void writeLDMXCSR(GPR srcReg, int disp) { - println("\tldmxcsr dword [" + srcReg + disp(disp) + "]"); + println("\tldmxcsr dword [" + srcReg + disp(disp) + ']'); } public void writeLEA(GPR dstReg, GPR srcReg, int disp) { - println("\tlea " + dstReg + ",[" + srcReg + disp(disp) + "]"); + println("\tlea " + dstReg + ",[" + srcReg + disp(disp) + ']'); } public void writeLEA(X86Register.GPR dstReg, X86Register.GPR srcIdxReg, int scale, int disp) { - println("\tlea " + dstReg + ",[" + srcIdxReg + "*" + scale + disp(disp) + "]"); + println("\tlea " + dstReg + ",[" + srcIdxReg + '*' + scale + disp(disp) + ']'); } public void writeLGDT(int disp) { - println("\tlgdt [" + disp(disp) + "]"); + println("\tlgdt [" + disp(disp) + ']'); } public void writeLIDT(int disp) { - println("\tlidt [" + disp(disp) + "]"); + println("\tlidt [" + disp(disp) + ']'); } public void writeLEA(GPR dstReg, GPR srcReg, GPR srcIdxReg, int scale, int disp) { - println("\tlea " + dstReg + ",[" + srcReg + disp(disp) + "+" - + srcIdxReg + "*" + scale + "]"); + println("\tlea " + dstReg + ",[" + srcReg + disp(disp) + '+' + + srcIdxReg + '*' + scale + ']'); } public void writeLMSW(GPR srcReg) { @@ -1111,7 +1110,7 @@ } public void writeMOV(int operandSize, GPR dstReg, int dstDisp, GPR srcReg) { - println("\tmov " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tmov " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "]," + srcReg); } @@ -1121,44 +1120,44 @@ * @param srcReg */ public void writeMOV(X86Register.SR dstReg, int dstDisp, X86Register.GPR srcReg) { - println("\tmov " + "[" + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "]," + srcReg); + println("\tmov " + '[' + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "]," + srcReg); } public void writeMOV(CRX dstReg, GPR srcReg) { - println("\tmov " + dstReg + "," + size(BITS32) + " " + srcReg); + println("\tmov " + dstReg + ',' + size(BITS32) + ' ' + srcReg); } public void writeMOV(GPR dstReg, CRX srcReg) { - println("\tmov " + dstReg + "," + size(BITS32) + " " + srcReg); + println("\tmov " + dstReg + ',' + size(BITS32) + ' ' + srcReg); } public void writeMOV(SR dstReg, GPR srcReg) { - println("\tmov " + dstReg + "," + size(BITS16) + " " + srcReg); + println("\tmov " + dstReg + ',' + size(BITS16) + ' ' + srcReg); } public void writeMOV(GPR dstReg, SR srcReg) { - println("\tmov " + dstReg + "," + size(BITS16) + " " + srcReg); + println("\tmov " + dstReg + ',' + size(BITS16) + ' ' + srcReg); } public void writeMOV(int operandSize, GPR dstReg, GPR srcReg) { - println("\tmov " + dstReg + "," + size(operandSize) + " " + srcReg); + println("\tmov " + dstReg + ',' + size(operandSize) + ' ' + srcReg); } public void writeMOV(int operandSize, GPR dstReg, GPR srcReg, int srcDisp) { - println("\tmov " + dstReg + "," + size(operandSize) + "[" + srcReg - + disp(srcDisp) + "]"); + println("\tmov " + dstReg + ',' + size(operandSize) + '[' + srcReg + + disp(srcDisp) + ']'); } public void writeMOV(int operandSize, GPR dstReg, GPR dstIdxReg, int scale, int dstDisp, GPR srcReg) { - println("\tmov " + size(operandSize) + "[" + dstReg + disp(dstDisp) - + "+" + dstIdxReg + "*" + scale + "]," + srcReg); + println("\tmov " + size(operandSize) + '[' + dstReg + disp(dstDisp) + + '+' + dstIdxReg + '*' + scale + "]," + srcReg); } public void writeMOV(int operandSize, GPR dstReg, GPR srcReg, GPR srcIdxReg, int scale, int srcDisp) { - println("\tmov " + dstReg + "," + size(operandSize) + "[" + srcReg - + disp(srcDisp) + "+" + srcIdxReg + "*" + scale + "]"); + println("\tmov " + dstReg + ',' + size(operandSize) + '[' + srcReg + + disp(srcDisp) + '+' + srcIdxReg + '*' + scale + ']'); } /** @@ -1169,11 +1168,11 @@ * @param srcDisp */ public void writeMOV(X86Register.GPR dstReg, X86Register.SR srcReg, int srcDisp) { - println("\tmov " + dstReg + ",[" + srcReg + ":0x" + NumberUtils.hex(srcDisp) + "]"); + println("\tmov " + dstReg + ",[" + srcReg + ":0x" + NumberUtils.hex(srcDisp) + ']'); } public void writeMOV(GPR dstReg, int srcDisp) { - println("\tmov " + dstReg + ",[" + disp(srcDisp) + "]"); + println("\tmov " + dstReg + ",[" + disp(srcDisp) + ']'); } public void writeMOV(int dstDisp, X86Register.GPR srcReg) { @@ -1181,7 +1180,7 @@ } public void writeMOV_Const(int operandSize, int dstDisp, int imm32) { - println("\tmov " + size(operandSize) + "[" + disp(dstDisp) + println("\tmov " + size(operandSize) + '[' + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1205,7 +1204,7 @@ * @param imm32 */ public void writeMOV_Const(int operandSize, X86Register.SR dstReg, int dstDisp, int imm32) { - println("\tmov " + size(operandSize) + "[" + dstReg + ":0x" + NumberUtils.hex(dstDisp) + println("\tmov " + size(operandSize) + '[' + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1218,12 +1217,12 @@ */ public void writeMOV_Const(int operandSize, GPR dstReg, int dstDisp, int imm32) { - println("\tmov " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tmov " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } public void writeMOV_Const(GPR dstReg, Object label) { - println("\tmov " + dstReg + "," + label); + println("\tmov " + dstReg + ',' + label); } /** @@ -1235,28 +1234,28 @@ */ public void writeMOV_Const(int operandSize, GPR dstReg, GPR dstIdxReg, int scale, int dstDisp, int imm32) { - println("\tmov " + size(operandSize) + "[" + dstReg + "+" + dstIdxReg - + "*" + scale + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); + println("\tmov " + size(operandSize) + '[' + dstReg + '+' + dstIdxReg + + '*' + scale + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } public void writeMOVD(int operandSize, X86Register.MMX mmx, X86Register.GPR reg, int disp) { - println("\tmovd " + mmx + "," + size(operandSize) + "[" + reg + disp(disp) + "]"); + println("\tmovd " + mmx + ',' + size(operandSize) + '[' + reg + disp(disp) + ']'); } public void writeMOVD(int operandSize, X86Register.GPR dstReg, int dstDisp, X86Register.MMX srcMmx) { - println("\tmovd " + size(operandSize) + "[" + dstReg + disp(dstDisp) + "]," + srcMmx); + println("\tmovd " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "]," + srcMmx); } public void writeMOVQ(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tmovd " + dstMmx + "," + srcMmx); + println("\tmovd " + dstMmx + ',' + srcMmx); } public void writeMOVQ(int operandSize, X86Register.MMX dstMmx, X86Register.GPR srcGpr, int srcDisp) { - println("\tmovq " + dstMmx + "," + size(operandSize) + "[" + srcGpr + disp(srcDisp) + "]"); + println("\tmovq " + dstMmx + ',' + size(operandSize) + '[' + srcGpr + disp(srcDisp) + ']'); } public void writeMOVQ(int operandSize, X86Register.MMX dstMmx, int srcDisp) { - println("\tmovq " + dstMmx + "," + size(operandSize) + "[" + disp(srcDisp) + "]"); + println("\tmovq " + dstMmx + ',' + size(operandSize) + '[' + disp(srcDisp) + ']'); } public void writeMOVSB() { @@ -1272,11 +1271,11 @@ } public void writeMOVSD(XMM dst, GPR src, int srcDisp) { - println("\tmovsd " + dst + ",qword [" + src + disp(srcDisp) + "]"); + println("\tmovsd " + dst + ",qword [" + src + disp(srcDisp) + ']'); } public void writeMOVSD(XMM dst, XMM src) { - println("\tmovsd " + dst + "," + src); + println("\tmovsd " + dst + ',' + src); } public void writeMOVSS(GPR dst, int dstDisp, XMM src) { @@ -1284,20 +1283,20 @@ } public void writeMOVSS(XMM dst, GPR src, int srcDisp) { - println("\tmovss " + dst + ",dword [" + src + disp(srcDisp) + "]"); + println("\tmovss " + dst + ",dword [" + src + disp(srcDisp) + ']'); } public void writeMOVSS(XMM dst, XMM src) { - println("\tmovss " + dst + "," + src); + println("\tmovss " + dst + ',' + src); } public void writeMOVSX(GPR dstReg, GPR srcReg, int srcSize) { - println("\tmovsx " + dstReg + "," + size(srcSize) + " " + srcReg); + println("\tmovsx " + dstReg + ',' + size(srcSize) + ' ' + srcReg); } public void writeMOVSX(GPR dstReg, GPR srcReg, int srcDisp, int srcSize) { - println("\tmovsx " + dstReg + "," + size(srcSize) + " " + "[" + srcReg - + disp(srcDisp) + "]"); + println("\tmovsx " + dstReg + ',' + size(srcSize) + ' ' + '[' + srcReg + + disp(srcDisp) + ']'); } /** @@ -1312,7 +1311,7 @@ if (!code64) { throw new InvalidOpcodeException(); } - println("\tmovsxd " + dstReg + "," + srcReg); + println("\tmovsxd " + dstReg + ',' + srcReg); } public void writeMOVSW() { @@ -1320,12 +1319,12 @@ } public void writeMOVZX(GPR dstReg, GPR srcReg, int srcSize) { - println("\tmovzx " + dstReg + "," + size(srcSize) + " " + srcReg); + println("\tmovzx " + dstReg + ',' + size(srcSize) + ' ' + srcReg); } public void writeMOVZX(GPR dstReg, GPR srcReg, int srcDisp, int srcSize) { - println("\tmovzx " + dstReg + "," + size(srcSize) + " " + "[" + srcReg - + disp(srcDisp) + "]"); + println("\tmovzx " + dstReg + ',' + size(srcSize) + ' ' + '[' + srcReg + + disp(srcDisp) + ']'); } public void writeMUL_EAX(GPR srcReg) { @@ -1337,8 +1336,8 @@ } public void writeNEG(int operandSize, GPR dstReg, int dstDisp) { - println("\tneg " + size(operandSize) + "[" + dstReg + disp(dstDisp) - + "]"); + println("\tneg " + size(operandSize) + '[' + dstReg + disp(dstDisp) + + ']'); } public void writeNOP() { @@ -1350,8 +1349,8 @@ } public void writeNOT(int operandSize, GPR dstReg, int dstDisp) { - println("\tnot " + size(operandSize) + "[" + dstReg + disp(dstDisp) - + "]"); + println("\tnot " + size(operandSize) + '[' + dstReg + disp(dstDisp) + + ']'); } // LS @@ -1369,7 +1368,7 @@ * @param imm32 */ public void writeOR(int operandSize, GPR dstReg, int dstDisp, int imm32) { - println("\tor " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tor " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1384,7 +1383,7 @@ * @param imm32 */ public void writeOR(int operandSize, X86Register.SR dstReg, int dstDisp, int imm32) { - println("\tor " + size(operandSize) + "[" + dstReg + ":0x" + NumberUtils.hex(dstDisp) + println("\tor " + size(operandSize) + '[' + dstReg + ":0x" + NumberUtils.hex(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1394,12 +1393,12 @@ * @param imm32 */ public void writeOR(int operandSize, int dstDisp, int imm32) { - println("\tor " + size(operandSize) + "[" + disp(dstDisp) + println("\tor " + size(operandSize) + '[' + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } public void writeOR(GPR dstReg, GPR srcReg) { - println("\tor " + dstReg + "," + srcReg); + println("\tor " + dstReg + ',' + srcReg); } /** @@ -1408,16 +1407,16 @@ * @param srcDisp */ public void writeOR(GPR dstReg, GPR srcReg, int srcDisp) { - println("\tor " + dstReg + ",[" + srcReg + disp(srcDisp) + "]"); + println("\tor " + dstReg + ",[" + srcReg + disp(srcDisp) + ']'); } public void writeOUT(int operandSize) { if (operandSize == X86Constants.BITS8) { - println("\tout " + X86Register.DX + "," + X86Register.AL); + println("\tout " + X86Register.DX + ',' + X86Register.AL); } else if (operandSize == X86Constants.BITS16) { - println("\tout " + X86Register.DX + "," + X86Register.AX); + println("\tout " + X86Register.DX + ',' + X86Register.AX); } else if (operandSize == X86Constants.BITS32) { - println("\tout " + X86Register.DX + "," + X86Register.EAX); + println("\tout " + X86Register.DX + ',' + X86Register.EAX); } else { throw new IllegalArgumentException("Invalid operand size for OUT: " + operandSize); } @@ -1425,34 +1424,34 @@ public void writeOUT(int operandSize, int imm8) { if (operandSize == X86Constants.BITS8) { - println("\tout " + imm8 + "," + X86Register.AL); + println("\tout " + imm8 + ',' + X86Register.AL); } else if (operandSize == X86Constants.BITS16) { - println("\tout " + imm8 + "," + X86Register.AX); + println("\tout " + imm8 + ',' + X86Register.AX); } else if (operandSize == X86Constants.BITS32) { - println("\tout " + imm8 + "," + X86Register.EAX); + println("\tout " + imm8 + ',' + X86Register.EAX); } else { throw new IllegalArgumentException("Invalid operand size for OUT: " + operandSize); } } public void writePACKUSWB(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tpackuswb " + dstMmx + "," + srcMmx); + println("\tpackuswb " + dstMmx + ',' + srcMmx); } public void writePADDW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tpaddw " + dstMmx + "," + srcMmx); + println("\tpaddw " + dstMmx + ',' + srcMmx); } public void writePAND(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tpand " + dstMmx + "," + srcMmx); + println("\tpand " + dstMmx + ',' + srcMmx); } public void writePCMPGTW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tpcmpgtw " + dstMmx + "," + srcMmx); + println("\tpcmpgtw " + dstMmx + ',' + srcMmx); } public void writePMULLW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tpmullw " + dstMmx + "," + srcMmx); + println("\tpmullw " + dstMmx + ',' + srcMmx); } public void writePOP(GPR dstReg) { @@ -1464,7 +1463,7 @@ } public void writePOP(GPR dstReg, int dstDisp) { - println("\tpop [" + dstReg + disp(dstDisp) + "]"); + println("\tpop [" + dstReg + disp(dstDisp) + ']'); } public void writePOPA() { @@ -1494,7 +1493,7 @@ } public void writePSHUFW(X86Register.MMX dstMmx, X86Register.MMX srcMmx, int imm8) { - println("\tpshufw " + dstMmx + "," + srcMmx + ",0x" + NumberUtils.hex(imm8)); + println("\tpshufw " + dstMmx + ',' + srcMmx + ",0x" + NumberUtils.hex(imm8)); } public void writePSRLW(X86Register.MMX mmx, int imm8) { @@ -1502,11 +1501,11 @@ } public void writePSUBW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tpsubw " + dstMmx + "," + srcMmx); + println("\tpsubw " + dstMmx + ',' + srcMmx); } public void writePUNPCKLBW(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tpsunpcklbw " + dstMmx + "," + srcMmx); + println("\tpsunpcklbw " + dstMmx + ',' + srcMmx); } /** @@ -1534,14 +1533,14 @@ * @return The offset of the start of the instruction. */ public int writePUSH(GPR srcReg, int srcDisp) { - return println("\tpush [" + srcReg + disp(srcDisp) + "]"); + return println("\tpush [" + srcReg + disp(srcDisp) + ']'); } /** * @return The offset of the start of the instruction. */ public int writePUSH(SR srcReg, int srcDisp) { - return println("\tpush [" + srcReg + ":" + srcDisp + "]"); + return println("\tpush [" + srcReg + ':' + srcDisp + ']'); } /** @@ -1549,8 +1548,8 @@ */ public int writePUSH(GPR srcBaseReg, GPR srcIndexReg, int srcScale, int srcDisp) { - return println("\tpush [" + srcBaseReg + disp(srcDisp) + "+" - + srcIndexReg + "*" + srcScale + "]"); + return println("\tpush [" + srcBaseReg + disp(srcDisp) + '+' + + srcIndexReg + '*' + srcScale + ']'); } // PR @@ -1570,7 +1569,7 @@ } public void writePXOR(X86Register.MMX dstMmx, X86Register.MMX srcMmx) { - println("\tpxor " + dstMmx + "," + srcMmx); + println("\tpxor " + dstMmx + ',' + srcMmx); } public void writeRDTSC() { @@ -1599,7 +1598,7 @@ } public void writeSAL(GPR dstReg, int imm8) { - println("\tsal " + dstReg + "," + imm8); + println("\tsal " + dstReg + ',' + imm8); } /** @@ -1608,7 +1607,7 @@ * @param imm8 */ public void writeSAL(int operandSize, GPR srcReg, int srcDisp, int imm8) { - println("\tsal " + size(operandSize) + "[" + srcReg + disp(srcDisp) + println("\tsal " + size(operandSize) + '[' + srcReg + disp(srcDisp) + "]," + imm8); } @@ -1621,12 +1620,12 @@ * @param srcDisp */ public void writeSAL_CL(int operandSize, GPR srcReg, int srcDisp) { - println("\tsal " + size(operandSize) + "[" + srcReg + disp(srcDisp) + println("\tsal " + size(operandSize) + '[' + srcReg + disp(srcDisp) + "],cl"); } public void writeSAR(GPR dstReg, int imm8) { - println("\tsar " + dstReg + "," + imm8); + println("\tsar " + dstReg + ',' + imm8); } /** @@ -1635,7 +1634,7 @@ * @param imm8 */ public void writeSAR(int operandSize, GPR srcReg, int srcDisp, int imm8) { - println("\tsar " + size(operandSize) + "[" + srcReg + disp(srcDisp) + println("\tsar " + size(operandSize) + '[' + srcReg + disp(srcDisp) + "]," + imm8); } @@ -1648,7 +1647,7 @@ * @param srcDisp */ public void writeSAR_CL(int operandSize, GPR srcReg, int srcDisp) { - println("\tsar " + size(operandSize) + "[" + srcReg + disp(srcDisp) + println("\tsar " + size(operandSize) + '[' + srcReg + disp(srcDisp) + "],cl"); } @@ -1663,7 +1662,7 @@ } public void writeSBB(int operandSize, GPR dstReg, int dstDisp, int imm32) { - println("\tsbb " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tsbb " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1672,7 +1671,7 @@ } public void writeSBB(GPR dstReg, GPR srcReg) { - println("\tsbb " + dstReg + "," + srcReg); + println("\tsbb " + dstReg + ',' + srcReg); } /** @@ -1681,7 +1680,7 @@ * @param srcDisp */ public void writeSBB(GPR dstReg, GPR srcReg, int srcDisp) { - println("\tsbb " + dstReg + ",[" + srcReg + disp(srcDisp) + "]"); + println("\tsbb " + dstReg + ",[" + srcReg + disp(srcDisp) + ']'); } /** @@ -1691,15 +1690,15 @@ * @param cc */ public void writeSETCC(GPR dstReg, int cc) { - println("\tset" + ccName(cc) + " " + dstReg); + println("\tset" + ccName(cc) + ' ' + dstReg); } public void writeSHL(GPR dstReg, int imm8) { - println("\tshl " + dstReg + "," + imm8); + println("\tshl " + dstReg + ',' + imm8); } public void writeSHL(int operandSize, GPR dstReg, int dstDisp, int imm8) { - println("\tshl " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tshl " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "]," + imm8); } @@ -1708,16 +1707,16 @@ } public void writeSHL_CL(int operandSize, GPR dstReg, int dstDisp) { - println("\tshl " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tshl " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "],CL"); } public void writeSHLD_CL(GPR dstReg, GPR srcReg) { - println("\tshld " + dstReg + "," + srcReg + ",cl"); + println("\tshld " + dstReg + ',' + srcReg + ",cl"); } public void writeSHR(GPR dstReg, int imm8) { - println("\tshr " + dstReg + "," + imm8); + println("\tshr " + dstReg + ',' + imm8); } /** @@ -1726,7 +1725,7 @@ * @param imm8 */ public void writeSHR(int operandSize, GPR srcReg, int srcDisp, int imm8) { - println("\tshr " + size(operandSize) + "[" + srcReg + disp(srcDisp) + println("\tshr " + size(operandSize) + '[' + srcReg + disp(srcDisp) + "]," + imm8); } @@ -1739,12 +1738,12 @@ * @param srcDisp */ public void writeSHR_CL(int operandSize, GPR srcReg, int srcDisp) { - println("\tshr " + size(operandSize) + "[" + srcReg + disp(srcDisp) + println("\tshr " + size(operandSize) + '[' + srcReg + disp(srcDisp) + "],cl"); } public void writeSHRD_CL(GPR dstReg, GPR srcReg) { - println("\tshrd " + dstReg + "," + srcReg + ",cl"); + println("\tshrd " + dstReg + ',' + srcReg + ",cl"); } public void writeSTD() { @@ -1756,7 +1755,7 @@ } public void writeSTMXCSR(GPR srcReg, int disp) { - println("\tstmxcsr dword [" + srcReg + disp(disp) + "]"); + println("\tstmxcsr dword [" + srcReg + disp(disp) + ']'); } public void writeSTOSB() { @@ -1778,7 +1777,7 @@ * @param imm32 */ public final void writeSUB(GPR reg, int imm32) { - println("\tsub " + reg + "," + imm32); + println("\tsub " + reg + ',' + imm32); } /** @@ -1795,7 +1794,7 @@ * @param imm32 */ public void writeSUB(int operandSize, GPR dstReg, int dstDisp, int imm32) { - println("\tsub " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\tsub " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1804,7 +1803,7 @@ } public void writeSUB(GPR dstReg, GPR srcReg) { - println("\tsub " + dstReg + "," + srcReg); + println("\tsub " + dstReg + ',' + srcReg); } @@ -1814,7 +1813,7 @@ * @param srcDisp */ public void writeSUB(GPR dstReg, GPR srcReg, int srcDisp) { - println("\tsub " + dstReg + ", [" + srcReg + disp(srcDisp) + "]"); + println("\tsub " + dstReg + ", [" + srcReg + disp(srcDisp) + ']'); } public void writeTEST(GPR reg, int imm32) { @@ -1829,7 +1828,7 @@ * @param imm32 */ public void writeTEST(int operandSize, GPR reg, int disp, int imm32) { - println("\ttest " + size(operandSize) + "[" + reg + disp(disp) + "],0x" + println("\ttest " + size(operandSize) + '[' + reg + disp(disp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1840,7 +1839,7 @@ * @param imm32 */ public void writeTEST(int operandSize, SR reg, int disp, int imm32) { - println("\ttest " + size(operandSize) + "[" + reg + ":0x" + println("\ttest " + size(operandSize) + '[' + reg + ":0x" + NumberUtils.hex(disp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1851,7 +1850,7 @@ * @param reg2 */ public void writeTEST(GPR reg1, GPR reg2) { - println("\ttest " + reg1 + "," + reg2); + println("\ttest " + reg1 + ',' + reg2); } public void writeTEST_AL(int value) { @@ -1868,7 +1867,7 @@ } public void writeTEST(int operandSize, int destDisp, int imm32) { - println("\ttest " + size(operandSize) + "[" + disp(destDisp) + "],0x" + NumberUtils.hex(imm32)); + println("\ttest " + size(operandSize) + '[' + disp(destDisp) + "],0x" + NumberUtils.hex(imm32)); } public void writeTo(OutputStream os) throws IOException { @@ -1913,7 +1912,7 @@ * @param imm32 */ public void writeXOR(int operandSize, GPR dstReg, int dstDisp, int imm32) { - println("\txor " + size(operandSize) + "[" + dstReg + disp(dstDisp) + println("\txor " + size(operandSize) + '[' + dstReg + disp(dstDisp) + "],0x" + NumberUtils.hex(imm32)); } @@ -1922,7 +1921,7 @@ } public void writeXOR(GPR dstReg, GPR srcReg) { - println("\txor " + dstReg + "," + srcReg); + println("\txor " + dstReg + ',' + srcReg); } /** @@ -1931,7 +1930,7 @@ * @param srcDisp */ public void writeXOR(GPR dstReg, GPR srcReg, int srcDisp) { - println("\txor " + dstReg + ", [" + srcReg + disp(srcDisp) + "]"); + println("\txor " + dstReg + ", [" + srcReg + disp(srcDisp) + ']'); } public void writeObjectRef(Object object) { Modified: trunk/core/src/core/org/jnode/debugger/ThreadState.java =================================================================== --- trunk/core/src/core/org/jnode/debugger/ThreadState.java 2012-03-26 12:56:18 UTC (rev 5892) +++ trunk/core/src/core/org/jnode/debugger/ThreadState.java 2012-03-27 15:16:35 UTC (rev 5893) @@ -22,7 +22,6 @@ import java.io.PrintStream; import java.util.Map; - import org.jnode.driver.input.KeyboardEvent; impor... [truncated message content] |
From: <ga...@us...> - 2012-03-28 14:03:45
|
Revision: 5894 http://jnode.svn.sourceforge.net/jnode/?rev=5894&view=rev Author: galatnm Date: 2012-03-28 14:03:32 +0000 (Wed, 28 Mar 2012) Log Message: ----------- Various clean up for performance. Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/archive/TarCommand.java trunk/cli/src/commands/org/jnode/command/archive/ZipCommand.java trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java trunk/cli/src/commands/org/jnode/command/common/ExprCommand.java trunk/cli/src/commands/org/jnode/command/common/TimeCommand.java trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java trunk/cli/src/commands/org/jnode/command/file/CpCommand.java trunk/cli/src/commands/org/jnode/command/file/CutCommand.java trunk/cli/src/commands/org/jnode/command/file/DirCommand.java trunk/cli/src/commands/org/jnode/command/file/DuCommand.java trunk/cli/src/commands/org/jnode/command/file/FindCommand.java trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java trunk/cli/src/commands/org/jnode/command/file/HexdumpCommand.java trunk/cli/src/commands/org/jnode/command/file/SortCommand.java trunk/cli/src/commands/org/jnode/command/file/WcCommand.java trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java trunk/cli/src/commands/org/jnode/command/net/RpcInfoCommand.java trunk/cli/src/commands/org/jnode/command/system/BindKeysCommand.java trunk/cli/src/commands/org/jnode/command/system/ClasspathCommand.java trunk/cli/src/commands/org/jnode/command/system/IsolateCommand.java trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java trunk/cli/src/commands/org/jnode/command/system/Log4jCommand.java trunk/cli/src/commands/org/jnode/command/system/LsIRQCommand.java trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Buffer.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Flags.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Registers.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Stats.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100TxFD.java trunk/net/src/driver/org/jnode/driver/net/prism2/Prism2Core.java trunk/net/src/driver/org/jnode/driver/net/spi/AbstractNetDriver.java trunk/net/src/driver/org/jnode/driver/net/usb/bluetooth/UsbBluetoothDriver.java trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineCore.java trunk/net/src/net/org/jnode/net/SocketBuffer.java trunk/net/src/net/org/jnode/net/arp/ARPCacheEntry.java trunk/net/src/net/org/jnode/net/arp/ARPHeader.java trunk/net/src/net/org/jnode/net/arp/ARPNetworkLayer.java trunk/net/src/net/org/jnode/net/ipv4/IPv4ControlBlock.java trunk/net/src/net/org/jnode/net/ipv4/IPv4FragmentList.java trunk/net/src/net/org/jnode/net/ipv4/bootp/BOOTPServer.java trunk/net/src/net/org/jnode/net/ipv4/config/impl/Route.java trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPControlBlock.java trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPDataBuffer.java trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPHeader.java trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPOutChannel.java trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPProtocol.java trunk/net/src/net/org/jnode/net/ipv4/tftp/TFTPClient.java trunk/net/src/net/org/jnode/net/ipv4/tftp/TFTPServer.java trunk/net/src/net/org/jnode/net/ipv4/udp/UDPProtocol.java trunk/net/src/net/org/jnode/net/nfs/nfs2/NFS2Client.java trunk/net/src/net/org/jnode/net/nfs/nfs2/mount/Mount1Client.java trunk/net/src/net/org/jnode/protocol/nfs/nfs2/NFS2OutputStream.java Removed Paths: ------------- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Utils.java Modified: trunk/cli/src/commands/org/jnode/command/archive/TarCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/archive/TarCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/archive/TarCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -21,19 +21,19 @@ package org.jnode.command.archive; import java.io.File; +import java.io.IOException; import java.io.InputStream; -import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collections; import java.util.TreeMap; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; +import org.apache.tools.bzip2.CBZip2InputStream; +import org.apache.tools.bzip2.CBZip2OutputStream; import org.apache.tools.tar.TarEntry; import org.apache.tools.tar.TarInputStream; import org.apache.tools.tar.TarOutputStream; -import org.apache.tools.bzip2.CBZip2InputStream; -import org.apache.tools.bzip2.CBZip2OutputStream; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FileArgument; import org.jnode.shell.syntax.FlagArgument; @@ -524,7 +524,7 @@ ArrayList<File> list = new ArrayList<File>(); for (File file : files) { if (entries.containsKey(file.getPath())) { - etime = entries.get(file.getPath()).longValue(); + etime = entries.get(file.getPath()); ftime = file.lastModified(); if (etime >= ftime) { continue; Modified: trunk/cli/src/commands/org/jnode/command/archive/ZipCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/archive/ZipCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/archive/ZipCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -21,9 +21,10 @@ package org.jnode.command.archive; import java.util.ArrayList; +import java.util.Collections; import org.jnode.shell.syntax.Argument; -import org.jnode.shell.syntax.FlagArgument; import org.jnode.shell.syntax.FileArgument; +import org.jnode.shell.syntax.FlagArgument; import org.jnode.shell.syntax.StringArgument; /** @@ -104,15 +105,11 @@ } if (Exclude.isSet()) { excludes = new ArrayList<String>(Exclude.getValues().length); - for (String pattern : Exclude.getValues()) { - excludes.add(pattern); - } + Collections.addAll(excludes, Exclude.getValues()); } if (Include.isSet()) { includes = new ArrayList<String>(Include.getValues().length); - for (String pattern : Include.getValues()) { - includes.add(pattern); - } + Collections.addAll(includes, Include.getValues()); } super.execute("zip"); } Modified: trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -21,13 +21,13 @@ package org.jnode.command.argument; import java.util.Arrays; - import org.jnode.command.util.NumberRange; -//import org.jnode.driver.console.CompletionInfo; import org.jnode.shell.CommandLine.Token; -import org.jnode.shell.syntax.CommandSyntaxException; import org.jnode.shell.syntax.Argument; +import org.jnode.shell.syntax.CommandSyntaxException; +//import org.jnode.driver.console.CompletionInfo; + /** * Captures a list of multiple number ranges. * @@ -93,9 +93,7 @@ i++; } } - for (int i = 0; i < (ranges.length - 1); i++) { - values.add(ranges[i]); - } + values.addAll(Arrays.asList(ranges).subList(0, ranges.length - 1)); return ranges[ranges.length - 1]; } Modified: trunk/cli/src/commands/org/jnode/command/common/ExprCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/common/ExprCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/common/ExprCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Set; - import org.jnode.shell.AbstractCommand; @@ -319,7 +318,7 @@ private int asInteger(Object obj) throws ExprException { if (obj instanceof Integer) { - return ((Integer) obj).intValue(); + return (Integer) obj; } else { try { return Integer.parseInt(obj.toString()); Modified: trunk/cli/src/commands/org/jnode/command/common/TimeCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/common/TimeCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/common/TimeCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -63,7 +63,7 @@ StringBuilder sb = new StringBuilder(Alias.getValue()); for (String arg : Args.getValues()) { - sb.append(" "); + sb.append(' '); sb.append(arg); } Modified: trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -24,7 +24,6 @@ import java.io.PrintWriter; import java.util.HashMap; import java.util.Stack; - import org.jnode.shell.AbstractCommand; import org.jnode.shell.CommandLine; import org.jnode.shell.syntax.CommandSyntaxException; @@ -144,7 +143,7 @@ if (obj instanceof Boolean) { res = obj == Boolean.TRUE; } else if (obj instanceof Long) { - res = ((Long) obj).longValue() != 0; + res = (Long) obj != 0; } else { res = obj.toString().length() > 0; } @@ -329,7 +328,7 @@ } else if (option.equals("--version")) { err.println("JNode test 0.0"); } else { - throw new CommandSyntaxException("unknown option '" + option + "'"); + throw new CommandSyntaxException("unknown option '" + option + '\''); } } } @@ -343,7 +342,7 @@ } private void pushOperand(long value) { - operandStack.push(new Long(value)); + operandStack.push(value); } private Object popOperand() throws CommandSyntaxException { @@ -355,13 +354,13 @@ private long toNumber(Object obj) throws CommandSyntaxException { if (obj instanceof Long) { - return ((Long) obj).longValue(); + return (Long) obj; } else if (obj instanceof String) { try { return Long.parseLong((String) obj); } catch (NumberFormatException ex) { throw new CommandSyntaxException( - "operand is not a number: '" + obj.toString() + "'"); + "operand is not a number: '" + obj.toString() + '\''); } } else { throw new CommandSyntaxException("subexpression is not an INTEGER"); Modified: trunk/cli/src/commands/org/jnode/command/file/CpCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/CpCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/CpCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -28,7 +28,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; - import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FileArgument; @@ -370,7 +369,7 @@ if (line.charAt(0) == 'y' || line.charAt(0) == 'Y') { return true; } else if (line.charAt(0) == 'n' || line.charAt(0) == 'N') { - return vskip("'" + target + "'"); + return vskip("'" + target + '\''); } } out.print(STR_ASK_AGAIN); Modified: trunk/cli/src/commands/org/jnode/command/file/CutCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/CutCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/CutCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -26,7 +26,6 @@ import java.io.IOException; import java.io.PrintWriter; import java.util.List; - import org.jnode.command.argument.NumberListArgument; import org.jnode.command.util.IOUtils; import org.jnode.command.util.NumberRange; @@ -157,7 +156,7 @@ boolean first; int limit, start, end; for (String line : lines) { - if (line.indexOf(inDelim) == -1) { + if (!line.contains(inDelim)) { if (!suppress) { out.write(line); out.newLine(); Modified: trunk/cli/src/commands/org/jnode/command/file/DirCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/DirCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/DirCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -28,7 +28,6 @@ import java.util.Arrays; import java.util.Comparator; import java.util.Date; - import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FileArgument; @@ -121,7 +120,7 @@ for (int j = 0; j < LEFT_MARGIN + SEPARATOR_SIZE; j++) sb.append(' '); sb.append(dateFormat.format(lastModified)); sb.append(SEPARATOR); - sb.append("["); + sb.append('['); sb.append(f.getName()); sb.append(']'); } Modified: trunk/cli/src/commands/org/jnode/command/file/DuCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/DuCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/DuCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -24,9 +24,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.util.Stack; - import javax.naming.NameNotFoundException; - import org.apache.log4j.Logger; import org.jnode.command.util.AbstractDirectoryWalker; import org.jnode.driver.Device; @@ -240,22 +238,22 @@ private void printFileSize(final File filename, final long size) { if (argAll.isSet()) { - out.println(sizeToString(size) + "\t" + filename); + out.println(sizeToString(size) + '\t' + filename); } } private void printDirSize(final File filename, final long dirSizeOnly, final long subDirSize) { if (!argSum.isSet()) { if (argSeperateDirs.isSet()) { - out.println(sizeToString(dirSizeOnly) + "\t" + filename); + out.println(sizeToString(dirSizeOnly) + '\t' + filename); } else { - out.println(sizeToString(dirSizeOnly + subDirSize) + "\t" + filename); + out.println(sizeToString(dirSizeOnly + subDirSize) + '\t' + filename); } } } private void printSize(final String filename, final long size) { - out.println(sizeToString(size) + "\t" + filename); + out.println(sizeToString(size) + '\t' + filename); } private void log(String message) { Modified: trunk/cli/src/commands/org/jnode/command/file/FindCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/FindCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/FindCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -26,7 +26,6 @@ import java.io.PrintWriter; import java.util.regex.Matcher; import java.util.regex.Pattern; - import org.jnode.command.util.AbstractDirectoryWalker; import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; @@ -47,7 +46,7 @@ @Override protected void handleRestrictedFile(File file) throws IOException { - err.println("Permission denied for \"" + file + "\""); + err.println("Permission denied for \"" + file + '"'); } @Override Modified: trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -21,22 +21,26 @@ package org.jnode.command.file; import java.io.BufferedReader; +import java.io.Closeable; import java.io.File; import java.io.FileFilter; -import java.io.InputStream; +import java.io.Flushable; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.io.LineNumberReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Reader; - -import java.util.regex.Matcher; +import java.io.Writer; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Deque; +import java.util.List; import java.util.regex.MatchResult; +import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import java.util.ArrayList; -import java.util.List; - import org.apache.log4j.Logger; import org.jnode.command.util.AbstractDirectoryWalker; import org.jnode.command.util.AbstractDirectoryWalker.PathnamePatternFilter; @@ -48,13 +52,6 @@ import org.jnode.shell.syntax.IntegerArgument; import org.jnode.shell.syntax.StringArgument; -import java.io.Closeable; -import java.io.Flushable; -import java.io.Writer; -import java.io.InputStreamReader; -import java.util.ArrayDeque; -import java.util.Deque; - /** * TODO implement Fixed/Basic/Ext matchers * TODO implement --color (if/when possible) @@ -680,20 +677,20 @@ if ((prefix & PREFIX_FILE) != 0) { sb.append(name); if ((prefix & (PREFIX_LINE | PREFIX_BYTE)) == 0) { - sb.append("\t"); + sb.append('\t'); } sb.append(fieldSep); } if ((prefix & PREFIX_LINE) != 0) { sb.append(padNumber(lineCount, 4)); if ((prefix & PREFIX_BYTE) == 0) { - sb.append("\t"); + sb.append('\t'); } sb.append(fieldSep); } if ((prefix & PREFIX_BYTE) != 0) { sb.append(padNumber(byteCount, 9)); - sb.append("\t"); + sb.append('\t'); sb.append(fieldSep); } } else { @@ -756,7 +753,7 @@ } private String padNumber(int n, int size) { - return String.format("%" + size + "d", n); + return String.format("%" + size + 'd', n); } /** Modified: trunk/cli/src/commands/org/jnode/command/file/HexdumpCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/HexdumpCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/HexdumpCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -27,7 +27,6 @@ import java.io.InputStream; import java.io.PrintWriter; import java.net.URL; - import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FileArgument; @@ -112,10 +111,10 @@ sb.append(" "); } if ((i + 1) < rowlen) { - sb.append(" "); + sb.append(' '); } if ((i + 1) == rowlen / 2) { - sb.append(" "); + sb.append(' '); } } @@ -127,14 +126,14 @@ if ((c >= ' ') && (c < (char) 0x7f)) { sb.append(c); } else { - sb.append("."); + sb.append('.'); } } else { - sb.append(" "); + sb.append(' '); } } - sb.append("|"); + sb.append('|'); left -= sz; ofs += sz; Modified: trunk/cli/src/commands/org/jnode/command/file/SortCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/SortCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/SortCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -21,15 +21,14 @@ package org.jnode.command.file; import java.io.File; +import java.io.IOException; import java.io.PrintWriter; -import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; -import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.LinkedList; import java.util.List; -import java.util.LinkedList; - import org.jnode.command.util.IOUtils; import org.jnode.shell.AbstractCommand; import org.jnode.shell.CommandLine; @@ -39,6 +38,7 @@ import org.jnode.shell.syntax.FlagArgument; import org.jnode.shell.syntax.IntegerArgument; import org.jnode.shell.syntax.StringArgument; + import static org.jnode.shell.syntax.Argument.EXISTING; import static org.jnode.shell.syntax.Argument.MULTIPLE; import static org.jnode.shell.syntax.Argument.NONEXISTENT; @@ -106,7 +106,7 @@ protected FieldRange doAccept(CommandLine.Token token, int flags) throws CommandSyntaxException { String text = token.text; FieldRange range = new FieldRange(); - int i = text.indexOf(","); + int i = text.indexOf(','); if (i == -1) { range.start = parseField(text, false); range.end = new Field(); @@ -165,7 +165,7 @@ i--; } text = text.substring(0, i + 1); - i = text.indexOf("."); + i = text.indexOf('.'); if (i == 0) { throw new CommandSyntaxException("Field offset cannot be empty"); } Modified: trunk/cli/src/commands/org/jnode/command/file/WcCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/WcCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/file/WcCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -28,7 +28,6 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; - import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FileArgument; @@ -126,13 +125,13 @@ private void checkFile(File file) { if (!file.exists()) { - getError().getPrintWriter().println(STR_ERROR_NOT_EXIST + " " + file.getAbsolutePath()); + getError().getPrintWriter().println(STR_ERROR_NOT_EXIST + ' ' + file.getAbsolutePath()); exit(1); } else if (file.isDirectory()) { - getError().getPrintWriter().println(STR_ERROR_DIR + " " + file.getAbsolutePath()); + getError().getPrintWriter().println(STR_ERROR_DIR + ' ' + file.getAbsolutePath()); exit(1); } else if (!file.canRead()) { - getError().getPrintWriter().println(STR_ERROR_CANT_READ + " " + file.getAbsolutePath()); + getError().getPrintWriter().println(STR_ERROR_CANT_READ + ' ' + file.getAbsolutePath()); exit(1); } } @@ -191,7 +190,7 @@ printLine(printWriter, paddingSize, wc.getLinesCount(), wc.getWordsCount(), wc.getCharsCount(), wc .getBytesRead(), wc.getMaxCharsInLine()); if (wc.getFileName() != null) { - printWriter.print(" " + wc.getFileName()); + printWriter.print(' ' + wc.getFileName()); } printWriter.println(); } @@ -199,7 +198,7 @@ if (listWc.size() > 1) { printLine(printWriter, paddingSize, totalLinesCount, totalWordsCount, totalCharsCount, totalBytesRead, maxCharsInLine); - printWriter.println(" " + STR_TOTAL); + printWriter.println(' ' + STR_TOTAL); } printWriter.flush(); } @@ -253,10 +252,10 @@ sValue.append(value); while (sValue.length() < paddingSize) { - sValue.insert(0, " "); + sValue.insert(0, ' '); } if (!first) { - sValue.insert(0, " "); + sValue.insert(0, ' '); } printWriter.print(sValue); } Modified: trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -21,7 +21,6 @@ package org.jnode.command.net; import java.io.PrintWriter; - import org.jnode.driver.net.NetworkException; import org.jnode.net.NetworkLayer; import org.jnode.net.NetworkLayerManager; @@ -83,7 +82,7 @@ int width = 0; for (int i = 0; i < list.length; i++) { final Statistic st = list[i]; - String msg = st.getName() + " " + st.getValue(); + String msg = st.getName() + ' ' + st.getValue(); if (i + 1 < list.length) { msg = msg + ", "; } Modified: trunk/cli/src/commands/org/jnode/command/net/RpcInfoCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/net/RpcInfoCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/net/RpcInfoCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -24,7 +24,6 @@ import java.io.PrintWriter; import java.net.InetAddress; import java.net.UnknownHostException; - import org.acplt.oncrpc.OncRpcException; import org.acplt.oncrpc.OncRpcPortmapClient; import org.acplt.oncrpc.OncRpcProtocols; @@ -87,11 +86,10 @@ out.printf(fmt_list_serv, str_program, str_version, str_protocol, str_port, str_name); out.println(); - for (int i = 0; i < servers.length; i++) { - OncRpcServerIdent server = servers[i]; - out.printf(fmt_list_serv, server.program, server.version, - server.protocol == 6 ? str_tcp : str_udp, - server.port, getName(server.program)); + for (OncRpcServerIdent server : servers) { + out.printf(fmt_list_serv, server.program, server.version, + server.protocol == 6 ? str_tcp : str_udp, + server.port, getName(server.program)); out.println(); } } catch (OncRpcException e) { Modified: trunk/cli/src/commands/org/jnode/command/system/BindKeysCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/BindKeysCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/system/BindKeysCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -29,7 +29,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - import org.jnode.driver.console.Console; import org.jnode.driver.console.KeyEventBindings; import org.jnode.driver.console.TextConsole; @@ -37,8 +36,8 @@ import org.jnode.driver.console.textscreen.ConsoleKeyEventBindings; import org.jnode.driver.console.textscreen.KeyboardReaderAction; import org.jnode.shell.AbstractCommand; +import org.jnode.shell.CommandLine.Token; import org.jnode.shell.ShellUtils; -import org.jnode.shell.CommandLine.Token; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.CommandSyntaxException; import org.jnode.shell.syntax.EnumArgument; @@ -84,7 +83,7 @@ field.getName().startsWith("VK_")) { try { Integer vk = (Integer) field.get(null); - String name = constCase(KeyEvent.getKeyText(vk.intValue())); + String name = constCase(KeyEvent.getKeyText(vk)); VK_NAME_MAP.put(name, vk); VK_MAP.put(vk, name); } catch (IllegalAccessException ex) { @@ -432,7 +431,11 @@ } else if (ch < '\177') { sb.append('\'').append(ch).append('\''); } else { - sb.append('\'').append(ch).append("' (0x" + Integer.toHexString(ch)).append(')'); + sb.append('\''); + sb.append(ch); + sb.append("' (0x"); + sb.append(Integer.toHexString(ch)); + sb.append(')'); } return sb.toString(); } Modified: trunk/cli/src/commands/org/jnode/command/system/ClasspathCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/ClasspathCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/system/ClasspathCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -21,11 +21,12 @@ package org.jnode.command.system; import java.io.PrintWriter; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLClassLoader; import java.security.AccessController; import java.security.PrivilegedAction; - import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FlagArgument; @@ -77,16 +78,24 @@ clearClassPath(); if (urls != null) { for (URL url : urls) { - addToClassPath(url); + try { + addToClassPath(url); + } catch (URISyntaxException e) { + e.printStackTrace(); + } } } } - private void addToClassPath(URL url) { + private void addToClassPath(URL url) throws URISyntaxException { URL[] urls = getClassLoader().getURLs(); + if (urls != null) { + URI uri = url.toURI(); + URI classLoaderUri; for (URL u : urls) { - if (u.equals(url)) { + classLoaderUri = u.toURI(); + if (classLoaderUri.equals(uri)) { return; } } Modified: trunk/cli/src/commands/org/jnode/command/system/IsolateCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/IsolateCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/system/IsolateCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -21,7 +21,6 @@ package org.jnode.command.system; import java.io.PrintWriter; - import org.jnode.shell.AbstractCommand; import org.jnode.vm.isolate.VmIsolate; @@ -38,14 +37,14 @@ out.println(str_header); VmIsolate root = VmIsolate.getRoot(); if (root != null) { - out.println(format(String.valueOf(root.getId()), 8, false) + " " + - format("0", 8, false) + " " + + out.println(format(String.valueOf(root.getId()), 8, false) + ' ' + + format("0", 8, false) + ' ' + format(String.valueOf(root.getState()), 8, true)); } for (VmIsolate iso : VmIsolate.getVmIsolates()) { - out.println(format(String.valueOf(iso.getId()), 8, false) + " " + - format(String.valueOf(iso.getCreator().getId()), 8, false) + " " + - format(String.valueOf(iso.getState()), 8, true) + " " + + out.println(format(String.valueOf(iso.getId()), 8, false) + ' ' + + format(String.valueOf(iso.getCreator().getId()), 8, false) + ' ' + + format(String.valueOf(iso.getState()), 8, true) + ' ' + iso.getMainClassName()); } } Modified: trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -162,8 +162,8 @@ private byte[] loadClassData(String name) throws ClassNotFoundException { String fn = name.replace('.', '/'); File f = null; - for (int i = 0; i < dirs.length; i++) { - f = new File(dirs[i] + fn + ".class"); + for (String dir : dirs) { + f = new File(dir + fn + ".class"); if (f.exists()) { break; } Modified: trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -25,7 +25,6 @@ import java.util.Comparator; import java.util.Locale; import java.util.TreeSet; - import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.CountryArgument; @@ -112,8 +111,8 @@ } private String formatLocale(Locale l) { - return (l.getDisplayName() + " : " + l.getLanguage() + - " " + l.getCountry() + " " + l.getVariant()); + return (l.getDisplayName() + " : " + l.getLanguage() + + ' ' + l.getCountry() + ' ' + l.getVariant()); } /** Modified: trunk/cli/src/commands/org/jnode/command/system/Log4jCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/Log4jCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/system/Log4jCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -27,7 +27,6 @@ import java.net.URL; import java.util.Enumeration; import java.util.Properties; - import org.apache.log4j.Level; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; @@ -111,7 +110,7 @@ while (en.hasMoreElements()) { Logger logger = (Logger) en.nextElement(); String level = (logger.getLevel() == null) ? - ("(" + logger.getEffectiveLevel().toString() + ")") : + ('(' + logger.getEffectiveLevel().toString() + ')') : logger.getLevel().toString(); getOutput().getPrintWriter().println(logger.getName() + ": " + level); } Modified: trunk/cli/src/commands/org/jnode/command/system/LsIRQCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/LsIRQCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/system/LsIRQCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -45,7 +45,7 @@ final IRQManager irqMgr = proc.getIRQManager(); final int max = irqMgr.getNumIRQs(); for (int i = 0; i < max; i++) { - getOutput().getPrintWriter().println("IRQ" + i + "\t" + irqMgr.getIrqCount(i) + "\t" + getOutput().getPrintWriter().println("IRQ" + i + '\t' + irqMgr.getIrqCount(i) + '\t' + irqMgr.getHandlerInfo(i)); } } Modified: trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -29,9 +29,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; - import javax.naming.NameNotFoundException; - import org.jnode.naming.InitialNaming; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; @@ -140,7 +138,7 @@ private void addPluginLoader(URL url) throws PluginException, MalformedURLException { final String ext = url.toExternalForm(); if (!ext.endsWith("/")) { - url = new URL(ext + "/"); + url = new URL(ext + '/'); } mgr.getLoaderManager().addPluginLoader(new URLPluginLoader(url)); out.format(fmt_add_loader, url); @@ -171,7 +169,7 @@ } private void listPlugins() throws PluginException { - final ArrayList<String> rows = new ArrayList<String>(); + final List<String> rows = new ArrayList<String>(); for (PluginDescriptor descr : mgr.getRegistry()) { String row = String.format(fmt_list, descr.getId(), Modified: trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Buffer.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Buffer.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Buffer.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -82,7 +82,7 @@ /* Base = 0 */ regs.setReg32(SCBPointer, 0); regs.setReg16(SCBCmd, SCBMaskAll | RxAddrLoad); - EEPRO100Utils.waitForCmdDone(regs); + regs.waitForCmdDone(); log.debug("Set RX base addr."); rxPacket = new EEPRO100RxFD(rm); rxPacket.setStatus(0x0001); @@ -96,7 +96,7 @@ rxPacket.initialize(); regs.setReg32(SCBPointer, rxPacket.getBufferAddress()); regs.setReg16(SCBCmd, SCBMaskAll | RxStart); - EEPRO100Utils.waitForCmdDone(regs); + regs.waitForCmdDone(); log.debug("Started rx process."); // Start the receiver. rxPacket.setStatus(0); @@ -111,7 +111,7 @@ * */ public final void initSingleTxRing() { - EEPRO100Utils.waitForCmdDone(regs); + regs.waitForCmdDone(); log.debug("Set TX base addr."); txFD = new EEPRO100TxFD(rm); txFD.setCommand(CmdIASetup); @@ -134,7 +134,7 @@ regs.setReg16(SCBStatus, status & IntrAllNormal); log.debug("transmitting status = " + NumberUtils.hex(status) + ", cmd=" + - NumberUtils.hex(regs.getReg16(SCBStatus)) + "\n"); + NumberUtils.hex(regs.getReg16(SCBStatus)) + '\n'); txFD.setStatus(0); txFD.setCommand(CmdSuspend | CmdTx | CmdTxFlex); @@ -146,7 +146,7 @@ regs.setReg16(SCBPointer, txFD.getBufferAddress()); regs.setReg16(SCBCmd, SCBMaskAll | CUStart); - EEPRO100Utils.waitForCmdDone(regs); + regs.waitForCmdDone(); s1 = regs.getReg16(SCBStatus); // TODO wait 10 ms for transmiting; @@ -173,7 +173,7 @@ regs.setReg16(SCBPointer, rxPacket.getStatus()); regs.setReg16(SCBCmd, SCBMaskAll | RxStart); - EEPRO100Utils.waitForCmdDone(regs); + regs.waitForCmdDone(); log.debug("Got a packet: Len=" + NumberUtils.hex(rxPacket.getCount())); @@ -204,7 +204,7 @@ txRing[txEntry].setCount(getTxThreshold()); // EEPRO100TxFD lastCmd0 = lastCmd; lastCmd = txRing[txEntry]; - EEPRO100Utils.waitForCmdDone(regs); + regs.waitForCmdDone(); regs.setReg8(SCBCmd, CUResume); } Modified: trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -468,7 +468,7 @@ int status; if ((buffers.getCurRx() - buffers.getDirtyRx()) > 15) { - log.debug("curRx > dirtyRx " + buffers.getCurRx() + " " + buffers.getDirtyRx()); + log.debug("curRx > dirtyRx " + buffers.getCurRx() + ' ' + buffers.getDirtyRx()); } do { Modified: trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Flags.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Flags.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Flags.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -45,6 +45,7 @@ /* (non-Javadoc) * @see org.jnode.driver.net.ethernet.Flags#getName() */ + @Override public String getName() { return this.name; } Modified: trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Registers.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Registers.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Registers.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -20,13 +20,17 @@ package org.jnode.driver.net.eepro100; +import org.apache.log4j.Logger; import org.jnode.system.resource.IOResource; +import org.jnode.util.NumberUtils; /** * @author flesire */ -public class EEPRO100Registers { +public class EEPRO100Registers implements EEPRO100Constants { + protected static final Logger log = Logger.getLogger(EEPRO100Registers.class); + /** * Start of IO address space */ @@ -53,7 +57,7 @@ * @param value */ - public final void setReg8(int reg, int value) { + public void setReg8(int reg, int value) { io.outPortByte(iobase + reg, value); } @@ -64,7 +68,7 @@ * @param value */ - public final void setReg16(int reg, int value) { + public void setReg16(int reg, int value) { io.outPortWord(iobase + reg, value); } @@ -75,7 +79,7 @@ * @param value */ - public final void setReg32(int reg, int value) { + public void setReg32(int reg, int value) { io.outPortDword(iobase + reg, value); } @@ -84,7 +88,7 @@ * * @param reg */ - public final int getReg16(int reg) { + public int getReg16(int reg) { return io.inPortWord(iobase + reg); } @@ -107,4 +111,23 @@ return io.inPortByte(iobase + reg); } + /** + * Wait for the command unit to accept a command. + */ + public void waitForCmdDone() { + int wait = 0; + int delayed_cmd; + do { + if (getReg8(SCBCmd) == 0) + return; + } while (++wait <= 100); + delayed_cmd = getReg8(SCBCmd); + do { + if (getReg8(SCBCmd) == 0) + break; + } while (++wait <= 10000); + log.debug("Command " + NumberUtils.hex(delayed_cmd) + " was not immediately accepted, " + + wait + " ticks!"); + } + } Modified: trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Stats.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Stats.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Stats.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -97,7 +97,7 @@ rx_fifo_errors += mem.getInt(52); rx_length_errors += mem.getInt(60); mem.setInt(64, 0); - EEPRO100Utils.waitForCmdDone(regs); + regs.waitForCmdDone(); regs.setReg8(SCBCmd, CUDumpStats); } } Modified: trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100TxFD.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100TxFD.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100TxFD.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -156,16 +156,16 @@ StringBuilder str = new StringBuilder(); str.append("Status : "); str.append(NumberUtils.hex(this.getStatus())); - str.append("\n"); + str.append('\n'); str.append("Command : "); str.append(NumberUtils.hex(this.getCommand())); - str.append("\n"); + str.append('\n'); str.append("Link : "); str.append(NumberUtils.hex(this.getLink())); - str.append("\n"); + str.append('\n'); str.append("Count : "); str.append(NumberUtils.hex(this.getCount())); - str.append("\n"); + str.append('\n'); return str.toString(); } } Deleted: trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Utils.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Utils.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Utils.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -1,55 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.driver.net.eepro100; - -import org.apache.log4j.Logger; -import org.jnode.util.NumberUtils; - -/** - * @author flesire - */ -public class EEPRO100Utils implements EEPRO100Constants { - /** - * Logger - */ - protected static final Logger log = Logger.getLogger(EEPRO100Utils.class); - - /** - * Wait for the command unit to accept a command. - * - * @param regs - */ - static final void waitForCmdDone(EEPRO100Registers regs) { - int wait = 0; - int delayed_cmd; - do { - if (regs.getReg8(SCBCmd) == 0) - return; - } while (++wait <= 100); - delayed_cmd = regs.getReg8(SCBCmd); - do { - if (regs.getReg8(SCBCmd) == 0) - break; - } while (++wait <= 10000); - log.debug("Command " + NumberUtils.hex(delayed_cmd) + " was not immediately accepted, " + - wait + " ticks!"); - } -} Modified: trunk/net/src/driver/org/jnode/driver/net/prism2/Prism2Core.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/prism2/Prism2Core.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/prism2/Prism2Core.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -20,30 +20,7 @@ package org.jnode.driver.net.prism2; -import static org.jnode.driver.net.prism2.Prism2Constants.Command.ACCESS; -import static org.jnode.driver.net.prism2.Prism2Constants.Command.ALLOC; -import static org.jnode.driver.net.prism2.Prism2Constants.Command.DISABLE; -import static org.jnode.driver.net.prism2.Prism2Constants.Command.ENABLE; -import static org.jnode.driver.net.prism2.Prism2Constants.Command.INIT; -import static org.jnode.driver.net.prism2.Prism2Constants.Command.TX; -import static org.jnode.driver.net.prism2.Prism2Constants.LinkStatus.CONNECTED; -import static org.jnode.driver.net.prism2.Prism2Constants.LinkStatus.NOTCONNECTED; -import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CNFAUTHENTICATION; -import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CNFMAXDATALEN; -import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CNFOWNMACADDR; -import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CNFPORTTYPE; -import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CURRENTBSSID; -import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CURRENTSSID; -import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.TXRATECNTL; -import static org.jnode.driver.net.prism2.Prism2Constants.Register.ALLOCFID; -import static org.jnode.driver.net.prism2.Prism2Constants.Register.EVACK; -import static org.jnode.driver.net.prism2.Prism2Constants.Register.EVSTAT; -import static org.jnode.driver.net.prism2.Prism2Constants.Register.INFOFID; -import static org.jnode.driver.net.prism2.Prism2Constants.Register.INTEN; -import static org.jnode.driver.net.prism2.Prism2Constants.Register.RXFID; - import javax.naming.NameNotFoundException; - import org.jnode.driver.Device; import org.jnode.driver.DriverException; import org.jnode.driver.bus.pci.PCIBaseAddress; @@ -73,6 +50,28 @@ import org.vmmagic.unboxed.Extent; import org.vmmagic.unboxed.MagicUtils; +import static org.jnode.driver.net.prism2.Prism2Constants.Command.ACCESS; +import static org.jnode.driver.net.prism2.Prism2Constants.Command.ALLOC; +import static org.jnode.driver.net.prism2.Prism2Constants.Command.DISABLE; +import static org.jnode.driver.net.prism2.Prism2Constants.Command.ENABLE; +import static org.jnode.driver.net.prism2.Prism2Constants.Command.INIT; +import static org.jnode.driver.net.prism2.Prism2Constants.Command.TX; +import static org.jnode.driver.net.prism2.Prism2Constants.LinkStatus.CONNECTED; +import static org.jnode.driver.net.prism2.Prism2Constants.LinkStatus.NOTCONNECTED; +import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CNFAUTHENTICATION; +import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CNFMAXDATALEN; +import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CNFOWNMACADDR; +import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CNFPORTTYPE; +import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CURRENTBSSID; +import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.CURRENTSSID; +import static org.jnode.driver.net.prism2.Prism2Constants.RecordID.TXRATECNTL; +import static org.jnode.driver.net.prism2.Prism2Constants.Register.ALLOCFID; +import static org.jnode.driver.net.prism2.Prism2Constants.Register.EVACK; +import static org.jnode.driver.net.prism2.Prism2Constants.Register.EVSTAT; +import static org.jnode.driver.net.prism2.Prism2Constants.Register.INFOFID; +import static org.jnode.driver.net.prism2.Prism2Constants.Register.INTEN; +import static org.jnode.driver.net.prism2.Prism2Constants.Register.RXFID; + /** * @author Ewout Prangsma (ep...@us...) */ @@ -317,7 +316,7 @@ // Validate the record length if ((Prism2Record.getRecordLength(hdr, 0) - 1) * 2 != len) { - throw new DriverException("Mismatch in record length. " + len + "/" + throw new DriverException("Mismatch in record length. " + len + '/' + Prism2Record.getRecordLength(hdr, 0)); } @@ -394,7 +393,7 @@ final byte[] macAddr = new byte[CNFOWNMACADDR.getRecordLength()]; getConfig(CNFOWNMACADDR, macAddr, 0, CNFOWNMACADDR.getRecordLength()); this.hwAddress = new EthernetAddress(macAddr, 0); - log.info("MAC-address for " + flags.getName() + " " + hwAddress); + log.info("MAC-address for " + flags.getName() + ' ' + hwAddress); // Set maximum data length setConfig16(CNFMAXDATALEN, WLAN_DATA_MAXLEN); Modified: trunk/net/src/driver/org/jnode/driver/net/spi/AbstractNetDriver.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/spi/AbstractNetDriver.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/spi/AbstractNetDriver.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -22,9 +22,7 @@ import java.io.PrintWriter; import java.util.HashMap; - import javax.naming.NameNotFoundException; - import org.apache.log4j.Logger; import org.jnode.driver.Device; import org.jnode.driver.DeviceAlreadyRegisteredException; @@ -101,9 +99,9 @@ if (renameToDevicePrefixOnly()) { dm.rename(device, getDevicePrefix(), true); } else { - final String prefix = getDevicePrefix() + "-"; + final String prefix = getDevicePrefix() + '-'; if (!device.getId().startsWith(prefix)) { - dm.rename(device, getDevicePrefix() + "-" + device.getId(), false); + dm.rename(device, getDevicePrefix() + '-' + device.getId(), false); } } } catch (DeviceAlreadyRegisteredException ex) { @@ -263,7 +261,7 @@ if (!protocolAddresses.isEmpty()) { out.println("Protocol addresses:"); for (int protId : protocolAddresses.keySet()) { - out.println(" 0x" + NumberUtils.hex(protId, 4) + " " + out.println(" 0x" + NumberUtils.hex(protId, 4) + ' ' + getProtocolAddressInfo(protId)); } } Modified: trunk/net/src/driver/org/jnode/driver/net/usb/bluetooth/UsbBluetoothDriver.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/usb/bluetooth/UsbBluetoothDriver.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/usb/bluetooth/UsbBluetoothDriver.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -130,7 +130,7 @@ StringBuilder buffer = new StringBuilder(); buffer.append("Data received : "); for (byte aData : data) { - buffer.append(NumberUtils.hex(data[0], 2)).append(" "); + buffer.append(NumberUtils.hex(data[0], 2)).append(' '); } log.debug(buffer.toString()); } Modified: trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineCore.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineCore.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/driver/org/jnode/driver/net/via_rhine/ViaRhineCore.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -32,6 +32,19 @@ import org.jnode.driver.bus.pci.PCIHeaderType0; import org.jnode.driver.net.ethernet.spi.Flags; import org.jnode.driver.net.spi.AbstractDeviceCore; +import org.jnode.naming.InitialNaming; +import org.jnode.net.HardwareAddress; +import org.jnode.net.SocketBuffer; +import org.jnode.net.ethernet.EthernetAddress; +import org.jnode.system.resource.IOResource; +import org.jnode.system.resource.IRQHandler; +import org.jnode.system.resource.IRQResource; +import org.jnode.system.resource.ResourceManager; +import org.jnode.system.resource.ResourceNotFreeException; +import org.jnode.system.resource.ResourceOwner; +import org.jnode.util.NumberUtils; +import org.jnode.util.TimeoutException; + import static org.jnode.driver.net.via_rhine.ViaRhineConstants.CFGD_CFDX; import static org.jnode.driver.net.via_rhine.ViaRhineConstants.CR1_SFRST; import static org.jnode.driver.net.via_rhine.ViaRhineConstants.CR1_TDMD1; @@ -83,19 +96,7 @@ import static org.jnode.driver.net.via_rhine.ViaRhineConstants.dwCurrentRxDescAddr; import static org.jnode.driver.net.via_rhine.ViaRhineConstants.dwCurrentTxDescAddr; import static org.jnode.driver.net.via_rhine.ViaRhineConstants.wMIIDATA; -import org.jnode.naming.InitialNaming; -import org.jnode.net.HardwareAddress; -import org.jnode.net.SocketBuffer; -import org.jnode.net.ethernet.EthernetAddress; import static org.jnode.net.ethernet.EthernetConstants.ETH_ALEN; -import org.jnode.system.resource.IOResource; -import org.jnode.system.resource.IRQHandler; -import org.jnode.system.resource.IRQResource; -import org.jnode.system.resource.ResourceManager; -import org.jnode.system.resource.ResourceNotFreeException; -import org.jnode.system.resource.ResourceOwner; -import org.jnode.util.NumberUtils; -import org.jnode.util.TimeoutException; /** * @author Levente S\u00e1ntha @@ -225,7 +226,7 @@ log.debug("New packet"); log.debug(packet.getLinkLayerHeader().getSourceAddress()); log.debug(packet.getLinkLayerHeader().getDestinationAddress()); - log.debug("\n" + hexDump(packet.toByteArray()) + "\n"); + log.debug('\n' + hexDump(packet.toByteArray()) + '\n'); rxRing.currentDesc().setOwnBit(); rxRing.next(); } @@ -676,7 +677,7 @@ // hwAddress.writeTo(buf, 6); txRing.currentDesc().setOwnBit(); txRing.currentDesc().setPacket(buf); - log.debug("\n" + hexDump(buf.toByteArray()) + "\n"); + log.debug('\n' + hexDump(buf.toByteArray()) + '\n'); int CR1bak = getReg8(byCR1); @@ -763,9 +764,9 @@ else sb.append(" "); if ((i + 1) < rowlen) - sb.append(" "); + sb.append(' '); if ((i + 1) == rowlen / 2) - sb.append(" "); + sb.append(' '); } sb.append(" |"); @@ -776,12 +777,12 @@ if ((c >= ' ') && (c < (char) 0x7f)) sb.append(c); else - sb.append("."); + sb.append('.'); } else - sb.append(" "); + sb.append(' '); } - sb.append("|"); + sb.append('|'); left -= sz; ofs += sz; Modified: trunk/net/src/net/org/jnode/net/SocketBuffer.java =================================================================== --- trunk/net/src/net/org/jnode/net/SocketBuffer.java 2012-03-27 15:16:35 UTC (rev 5893) +++ trunk/net/src/net/org/jnode/net/SocketBuffer.java 2012-03-28 14:03:32 UTC (rev 5894) @@ -171,9 +171,7 @@ size += count; } else { setSize(size + count); - for (int i = size - 1; i >= count; i--) { - data[start + i] = data[start + i - count]; - } + System.arraycopy(data, start + count - count, data, start + count, size - 1 - count); } for (int i = 0; i < count; i++) { data[st... [truncated message content] |
From: <ga...@us...> - 2012-04-19 12:57:22
|
Revision: 5896 http://jnode.svn.sourceforge.net/jnode/?rev=5896&view=rev Author: galatnm Date: 2012-04-19 12:57:10 +0000 (Thu, 19 Apr 2012) Log Message: ----------- Network code clean-up. Modified Paths: -------------- trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java trunk/core/src/core/org/jnode/vm/VmStackReader.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java trunk/core/src/core/org/jnode/vm/classmgr/Signature.java trunk/core/src/core/org/jnode/vm/classmgr/TIBBuilder.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/NativeTest.java trunk/core/src/core/org/jnode/vm/facade/VmUtils.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java trunk/net/src/net/org/jnode/net/NetworkLayerHeader.java trunk/net/src/net/org/jnode/net/arp/ARPHeader.java trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPHeader.java Modified: trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -21,7 +21,6 @@ package org.jnode.plugin.manager; import gnu.java.security.action.GetPropertyAction; - import java.security.AccessController; import java.util.ArrayList; import java.util.Collections; @@ -32,9 +31,7 @@ import java.util.List; import java.util.Map; import java.util.Set; - import javax.naming.NamingException; - import org.jnode.bootlog.BootLogInstance; import org.jnode.naming.InitialNaming; import org.jnode.permission.JNodePermission; @@ -294,8 +291,7 @@ } } final PluginPrerequisite[] prereq = descr.getPrerequisites(); - for (int i = 0; i < prereq.length; i++) { - final PluginPrerequisite pr = prereq[i]; + for (final PluginPrerequisite pr : prereq) { if (!nameSet.contains(pr.getPluginId())) { //Syslog.debug("Not in set: " + pr.getPluginId()); return false; @@ -312,8 +308,7 @@ */ private boolean prerequisitesExist(PluginDescriptor descr, Map<String, PluginDescriptor> all) { final PluginPrerequisite[] prereq = descr.getPrerequisites(); - for (int i = 0; i < prereq.length; i++) { - final PluginPrerequisite pr = prereq[i]; + for (final PluginPrerequisite pr : prereq) { if (!all.containsKey(pr.getPluginId())) { return false; } Modified: trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.ConfigurationElement; @@ -64,8 +63,7 @@ } final ArrayList<ConfigurationElementModel> list = new ArrayList<ConfigurationElementModel>(); - for (Iterator<?> i = e.getChildren().iterator(); i.hasNext();) { - final XMLElement ce = (XMLElement) i.next(); + for (final XMLElement ce : e.getChildren()) { list.add(new ConfigurationElementModel(plugin, ce)); } elements = (ConfigurationElement[]) list.toArray(new ConfigurationElement[list.size()]); Modified: trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -21,7 +21,6 @@ package org.jnode.plugin.model; import java.util.ArrayList; -import java.util.Iterator; import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.ConfigurationElement; import org.jnode.plugin.Extension; @@ -49,8 +48,7 @@ id = getAttribute(e, "id", false); final ArrayList<ConfigurationElementModel> list = new ArrayList<ConfigurationElementModel>(); - for (Iterator<?> i = e.getChildren().iterator(); i.hasNext();) { - final XMLElement ce = (XMLElement) i.next(); + for (final XMLElement ce : e.getChildren()) { list.add(new ConfigurationElementModel(plugin, ce)); } elements = (ConfigurationElement[]) list.toArray(new ConfigurationElement[list.size()]); Modified: trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -21,7 +21,6 @@ package org.jnode.plugin.model; import java.util.ArrayList; -import java.util.Iterator; import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.Library; import org.jnode.plugin.PluginException; @@ -44,8 +43,7 @@ type = getAttribute(e, "type", false); final ArrayList<String> list = new ArrayList<String>(); - for (Iterator<?> i = e.getChildren().iterator(); i.hasNext();) { - final XMLElement exE = (XMLElement) i.next(); + for (final XMLElement exE : e.getChildren()) { if (exE.getName().equals("export")) { list.add(getAttribute(exE, "name", true)); } Modified: trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -27,7 +27,6 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import org.jnode.bootlog.BootLogInstance; import org.jnode.nanoxml.XMLElement; @@ -143,8 +142,7 @@ initializeRequiresList(reqList, e); - for (Iterator<?> ci = e.getChildren().iterator(); ci.hasNext();) { - final XMLElement childE = (XMLElement) ci.next(); + for (final XMLElement childE : e.getChildren()) { final String tag = childE.getName(); if (tag.equals("extension-point")) { final ExtensionPointModel ep = new ExtensionPointModel(this, @@ -154,9 +152,7 @@ // registry.registerExtensionPoint(ep); // } } else if (tag.equals("requires")) { - for (Iterator<?> i = childE.getChildren().iterator(); i - .hasNext();) { - final XMLElement impE = (XMLElement) i.next(); + for (final XMLElement impE : childE.getChildren()) { if (impE.getName().equals("import")) { reqList.add(new PluginPrerequisiteModel(this, impE)); } else { @@ -631,18 +627,18 @@ // BootLogInstance.get().info("Resolve " + id); this.registry = registry; registry.registerPlugin(this); - for (int i = 0; i < extensionPoints.length; i++) { - extensionPoints[i].resolve(registry); + for (ExtensionPointModel extensionPoint : extensionPoints) { + extensionPoint.resolve(registry); } - for (int i = 0; i < requires.length; i++) { - requires[i].resolve(registry); + for (PluginPrerequisiteModel require : requires) { + require.resolve(registry); } if (runtime != null) { runtime.resolve(registry); } resolved = true; - for (int i = 0; i < extensions.length; i++) { - extensions[i].resolve(registry); + for (ExtensionModel extension : extensions) { + extension.resolve(registry); } } } @@ -742,14 +738,14 @@ if (runtime != null) { runtime.unresolve(registry); } - for (int i = 0; i < requires.length; i++) { - requires[i].unresolve(registry); + for (PluginPrerequisiteModel require : requires) { + require.unresolve(registry); } - for (int i = 0; i < extensionPoints.length; i++) { - extensionPoints[i].unresolve(registry); + for (ExtensionPointModel extensionPoint : extensionPoints) { + extensionPoint.unresolve(registry); } - for (int i = 0; i < extensions.length; i++) { - extensions[i].unresolve(registry); + for (ExtensionModel extension : extensions) { + extension.unresolve(registry); } registry.unregisterPlugin(this); resolved = false; Modified: trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -128,9 +128,8 @@ * Resolve all plugin descriptors. */ public void resolveDescriptors() throws PluginException { - for (Iterator<PluginDescriptor> i = descriptorMap.values().iterator(); i.hasNext();) { - final PluginDescriptorModel descr = (PluginDescriptorModel) i - .next(); + for (PluginDescriptor pluginDescriptor : descriptorMap.values()) { + final PluginDescriptorModel descr = (PluginDescriptorModel) pluginDescriptor; descr.resolve(this); } } Modified: trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -21,7 +21,6 @@ package org.jnode.plugin.model; import java.util.ArrayList; -import java.util.Iterator; import org.jnode.nanoxml.XMLElement; import org.jnode.plugin.Library; import org.jnode.plugin.PluginException; @@ -41,8 +40,7 @@ super(plugin); final ArrayList<LibraryModel> list = new ArrayList<LibraryModel>(); - for (Iterator<?> i = e.getChildren().iterator(); i.hasNext();) { - final XMLElement lE = (XMLElement) i.next(); + for (final XMLElement lE : e.getChildren()) { if (lE.getName().equals("library")) { list.add(new LibraryModel(plugin, lE)); } @@ -65,8 +63,8 @@ * @throws PluginException */ protected void resolve(PluginRegistryModel registry) throws PluginException { - for (int i = 0; i < libraries.length; i++) { - libraries[i].resolve(registry); + for (LibraryModel library : libraries) { + library.resolve(registry); } } @@ -76,8 +74,8 @@ * @throws PluginException */ protected void unresolve(PluginRegistryModel registry) throws PluginException { - for (int i = 0; i < libraries.length; i++) { - libraries[i].unresolve(registry); + for (LibraryModel library : libraries) { + library.unresolve(registry); } } } Modified: trunk/core/src/core/org/jnode/vm/VmStackReader.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmStackReader.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/VmStackReader.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -238,8 +238,8 @@ Unsafe.debug("Debug stacktrace:<no stack trace>\n"); } else { Unsafe.debug("Debug stacktrace: "); - for (int i = 0; i < frames.length; i++) { - final VmStackFrame s = (VmStackFrame) frames[i]; + for (VmStackFrame frame : frames) { + final VmStackFrame s = (VmStackFrame) frame; Unsafe.debug(s.getMethod().getDeclaringClass().getName()); Unsafe.debug("::"); Unsafe.debug(s.getMethod().getName()); Modified: trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -296,9 +296,9 @@ */ public void visit_tableswitch(int defValue, int lowValue, int highValue, int[] addresses) { tstack.pop(JvmType.INT); - for (int i = 0; i < addresses.length; i++) { - addBranch(addresses[i], true); - condYieldPoint(addresses[i]); + for (int address : addresses) { + addBranch(address, true); + condYieldPoint(address); } addBranch(defValue, false); condYieldPoint(defValue); @@ -312,9 +312,9 @@ */ public void visit_lookupswitch(int defValue, int[] matchValues, int[] addresses) { tstack.pop(JvmType.INT); - for (int i = 0; i < addresses.length; i++) { - addBranch(addresses[i], true); - condYieldPoint(addresses[i]); + for (int address : addresses) { + addBranch(address, true); + condYieldPoint(address); } addBranch(defValue, false); condYieldPoint(defValue); Modified: trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -21,7 +21,6 @@ package org.jnode.vm.bytecode; import java.util.TreeMap; - import org.jnode.bootlog.BootLogInstance; import org.jnode.vm.JvmType; import org.jnode.vm.classmgr.VmByteCode; @@ -334,9 +333,9 @@ * @see BytecodeVisitor#visit_tableswitch(int, int, int, int[]) */ public void visit_tableswitch(int defValue, int lowValue, int highValue, int[] addresses) { - for (int i = 0; i < addresses.length; i++) { - addBranch(addresses[i], true); - condYieldPoint(addresses[i]); + for (int address : addresses) { + addBranch(address, true); + condYieldPoint(address); } addBranch(defValue, false); condYieldPoint(defValue); @@ -349,9 +348,9 @@ * @see BytecodeVisitor#visit_lookupswitch(int, int[], int[]) */ public void visit_lookupswitch(int defValue, int[] matchValues, int[] addresses) { - for (int i = 0; i < addresses.length; i++) { - addBranch(addresses[i], true); - condYieldPoint(addresses[i]); + for (int address : addresses) { + addBranch(address, true); + condYieldPoint(address); } addBranch(defValue, false); condYieldPoint(defValue); Modified: trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -1271,9 +1271,9 @@ final int tag = data.get() & 0xFF; switch (tag) { case 'B': - return Byte.valueOf((byte) cp.getInt(data.getChar())); + return (byte) cp.getInt(data.getChar()); case 'C': - return Character.valueOf((char) cp.getInt(data.getChar())); + return (char) cp.getInt(data.getChar()); case 'D': return cp.getDouble(data.getChar()); case 'F': @@ -1283,9 +1283,9 @@ case 'J': return cp.getLong(data.getChar()); case 'S': - return Short.valueOf((short) cp.getInt(data.getChar())); + return (short) cp.getInt(data.getChar()); case 'Z': - return Boolean.valueOf(cp.getInt(data.getChar()) != 0); + return cp.getInt(data.getChar()) != 0; case 's': return cp.getAny(data.getChar()); case 'e': // enum Modified: trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -46,7 +46,7 @@ final String id = InternString.internString(name + '#' + signature); final Integer selector = (Integer) map.get(id); if (selector != null) { - return selector.intValue(); + return selector; } else { return getNew(id); } @@ -62,7 +62,7 @@ private synchronized int getNew(String id) { Integer selector = (Integer) map.get(id); if (selector != null) { - return selector.intValue(); + return selector; } else { final int sel = ++lastSelector; map.put(id, sel); Modified: trunk/core/src/core/org/jnode/vm/classmgr/Signature.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/Signature.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/classmgr/Signature.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -330,8 +330,8 @@ StringBuilder b = new StringBuilder(); b.append('('); if (argTypes != null) { - for (int i = 0; i < argTypes.length; i++) { - b.append(toSignature(argTypes[i])); + for (Class argType : argTypes) { + b.append(toSignature(argType)); } } b.append(')'); @@ -393,8 +393,8 @@ StringBuilder b = new StringBuilder(); b.append('('); if (argTypes != null) { - for (int i = 0; i < argTypes.length; i++) { - b.append(toSignature(argTypes[i])); + for (VmType argType : argTypes) { + b.append(toSignature(argType)); } } b.append(')'); Modified: trunk/core/src/core/org/jnode/vm/classmgr/TIBBuilder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/TIBBuilder.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/classmgr/TIBBuilder.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -20,9 +20,9 @@ package org.jnode.vm.classmgr; +import gnu.java.lang.VMClassHelper; import java.util.ArrayList; import java.util.HashMap; -import gnu.java.lang.VMClassHelper; /** * @author epr @@ -137,7 +137,7 @@ // skip index 0 final Object idx = nameSignature2Index.get(getNameSignature(name, signature)); if (idx != null) { - return ((Integer) idx).intValue(); + return (Integer) idx; } else { return -1; } Modified: trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -27,9 +27,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; - import org.jnode.vm.objects.VmSystemObject; - import sun.reflect.annotation.AnnotationParser; /** @@ -114,8 +112,8 @@ } - for (int i = 0; i < values.length; i++) { - vmap.put(values[i].name, values[i].value); + for (ElementValue value1 : values) { + vmap.put(value1.name, value1.value); } Set<Map.Entry> set = vmap.entrySet(); Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -25,7 +25,6 @@ import java.util.Comparator; import java.util.HashMap; import java.util.Map; - import org.jnode.vm.bytecode.BytecodeFlags; import org.jnode.vm.bytecode.BytecodeVisitorSupport; import org.jnode.vm.classmgr.VmByteCode; @@ -212,18 +211,18 @@ } public void visit_tableswitch(int defValue, int lowValue, int highValue, int[] addresses) { - for (int i = 0; i < addresses.length; i++) { + for (int address : addresses) { // Next block could be successor, e.g. switch could fall through - addBranch(addresses[i], CONDITIONAL_BRANCH); + addBranch(address, CONDITIONAL_BRANCH); } // Same for default case addBranch(defValue, CONDITIONAL_BRANCH); } public void visit_lookupswitch(int defValue, int[] matchValues, int[] addresses) { - for (int i = 0; i < addresses.length; i++) { + for (int address : addresses) { // Next block could be successor, e.g. switch could fall through - addBranch(addresses[i], CONDITIONAL_BRANCH); + addBranch(address, CONDITIONAL_BRANCH); } // Same for default case addBranch(defValue, CONDITIONAL_BRANCH); @@ -278,7 +277,7 @@ private final void addBranch(int target, byte flags) { IRBasicBlock pred = this.currentBlock; IRBasicBlock succ = startBB(target); - branchTargets.put(new Integer(getInstructionAddress()), new Integer(target)); + branchTargets.put(getInstructionAddress(), target); endBB(flags); } Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -250,8 +250,7 @@ public void deconstrucSSA() { final List<PhiAssignQuad<T>> phiQuads = new BootableArrayList<PhiAssignQuad<T>>(); - for (int i = 0; i < bblocks.length; i += 1) { - IRBasicBlock<T> b = bblocks[i]; + for (IRBasicBlock<T> b : bblocks) { for (Quad<T> q : b.getQuads()) { if (q instanceof PhiAssignQuad) { phiQuads.add((PhiAssignQuad<T>) q); @@ -261,8 +260,7 @@ } } int n = phiQuads.size(); - for (int i = 0; i < n; i += 1) { - PhiAssignQuad<T> paq = phiQuads.get(i); + for (PhiAssignQuad<T> paq : phiQuads) { Variable<T> lhs = paq.getLHS(); IRBasicBlock<T> firstBlock = null; VariableRefAssignQuad<T> firstPhiMove = null; @@ -411,9 +409,9 @@ sb.append(bb.toString()); sb.append(":\n predecessors:"); final List<IRBasicBlock<T>> pred = bb.getPredecessors(); - for (int i = 0; i < pred.size(); i += 1) { + for (IRBasicBlock<T> aPred : pred) { sb.append("\n "); - sb.append(pred.get(i).toString()); + sb.append(aPred.toString()); } sb.append("\n successors:"); for (IRBasicBlock<T> succ : bb.getSuccessors()) { Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -27,7 +27,6 @@ import java.net.MalformedURLException; import java.util.Collection; import java.util.Map; - import org.jnode.assembler.x86.X86Assembler; import org.jnode.assembler.x86.X86BinaryAssembler; import org.jnode.assembler.x86.X86Constants; @@ -263,8 +262,8 @@ System.out.print(" "); Variable[] vars = quad.getBasicBlock().getVariables(); System.out.print("["); - for (int j = 0; j < vars.length; j += 1) { - System.out.print(vars[j]); + for (Variable var : vars) { + System.out.print(var); System.out.print(","); } System.out.print("] "); Modified: trunk/core/src/core/org/jnode/vm/compiler/ir/NativeTest.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/ir/NativeTest.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/compiler/ir/NativeTest.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -243,8 +243,8 @@ System.out.print(" "); Variable[] vars = quad.getBasicBlock().getVariables(); System.out.print("["); - for (int j = 0; j < vars.length; j += 1) { - System.out.print(vars[j]); + for (Variable var : vars) { + System.out.print(var); System.out.print(","); } System.out.print("] "); Modified: trunk/core/src/core/org/jnode/vm/facade/VmUtils.java =================================================================== --- trunk/core/src/core/org/jnode/vm/facade/VmUtils.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/facade/VmUtils.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -21,9 +21,7 @@ package org.jnode.vm.facade; import gnu.java.lang.VMClassHelper; - import java.io.PrintWriter; - import org.jnode.annotation.Inline; import org.jnode.annotation.KernelSpace; import org.jnode.annotation.NoInline; @@ -69,7 +67,7 @@ allowNatives |= className.equals("org.jnode.vm." + architectureName + ".Unsafe" + architectureName.toUpperCase()); */ - allowNatives |= className.indexOf("org.jnode.vm.") > -1 && className.indexOf(".Unsafe") > -1; + allowNatives |= className.contains("org.jnode.vm.") && className.contains(".Unsafe"); return allowNatives; } @@ -188,8 +186,8 @@ */ public static void dumpStatistics(PrintWriter out) { final Statistic[] stats = VM_INSTANCE.getStatistics(); - for (int i = 0; i < stats.length; i++) { - out.println(stats[i]); + for (Statistic stat : stats) { + out.println(stat); } } @@ -198,8 +196,7 @@ */ public static void resetCounters() { final Statistic[] stats = VM_INSTANCE.getStatistics(); - for (int i = 0; i < stats.length; i++) { - final Statistic s = stats[i]; + for (final Statistic s : stats) { if (s instanceof Counter) { ((Counter) s).reset(); } Modified: trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java =================================================================== --- trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -508,7 +508,7 @@ this.exitCode = status; } - if (vmThread.getName().indexOf("-AWT-stopper") > -1) { + if (vmThread.getName().contains("-AWT-stopper")) { doExit(); } else { disposeAppContext(true); @@ -1008,8 +1008,7 @@ StackTraceElement[] trace = ex.getStackTrace(); if (trace != null) { Unsafe.debug("getStackTrace() != null\n"); - for (int i = 0; i < trace.length; i++) { - StackTraceElement element = trace[i]; + for (StackTraceElement element : trace) { Unsafe.debug(element.getClassName()); Unsafe.debug('#'); Unsafe.debug(element.getMethodName()); Modified: trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -22,7 +22,6 @@ import java.nio.ByteOrder; import java.util.HashMap; - import org.jnode.annotation.Internal; import org.jnode.annotation.MagicPermission; import org.jnode.assembler.x86.X86Constants; @@ -30,8 +29,8 @@ import org.jnode.system.resource.ResourceManager; import org.jnode.system.resource.ResourceNotFreeException; import org.jnode.system.resource.ResourceOwner; -import org.jnode.vm.Unsafe; import org.jnode.vm.BaseVmArchitecture; +import org.jnode.vm.Unsafe; import org.jnode.vm.VmMagic; import org.jnode.vm.VmMultiMediaSupport; import org.jnode.vm.VmSystem; @@ -247,7 +246,7 @@ bootCpu.setBootProcessor(true); final String cmdLine = VmSystem.getCmdLine(); - if (cmdLine.indexOf("mp=no") >= 0) { + if (cmdLine.contains("mp=no")) { return; } // Modified: trunk/net/src/net/org/jnode/net/NetworkLayerHeader.java =================================================================== --- trunk/net/src/net/org/jnode/net/NetworkLayerHeader.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/net/src/net/org/jnode/net/NetworkLayerHeader.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -37,4 +37,6 @@ * Gets the source address of the packet described in this header */ public ProtocolAddress getDestinationAddress(); + + public int getDataLength(); } Modified: trunk/net/src/net/org/jnode/net/arp/ARPHeader.java =================================================================== --- trunk/net/src/net/org/jnode/net/arp/ARPHeader.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/net/src/net/org/jnode/net/arp/ARPHeader.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -33,6 +33,8 @@ * @author epr */ public class ARPHeader implements NetworkLayerHeader { + + private final static int ARP_DATA_LENGTH = 28; private HardwareAddress srcHWAddress; private ProtocolAddress srcPAddress; @@ -143,6 +145,10 @@ return targetPAddress; } + public int getDataLength() { + return ARP_DATA_LENGTH; + } + /** * Gets the hardware type */ Modified: trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPHeader.java =================================================================== --- trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPHeader.java 2012-03-28 14:33:09 UTC (rev 5895) +++ trunk/net/src/net/org/jnode/net/ipv4/tcp/TCPHeader.java 2012-04-19 12:57:10 UTC (rev 5896) @@ -109,10 +109,6 @@ phdr.set16(10, tcpLength + headerLength); phdr.append(skbuf); - /* - * final int ccs1 = IPv4Utils.calcChecksum(phdr, 0, 12); final int - * ccs2 = IPv4Utils.calcChecksum(skbuf, 0, udpLength, ccs1); - */ final int ccs2 = IPv4Utils.calcChecksum(phdr, 0, headerLength + tcpLength + 12); this.checksumOk = (ccs2 == 0); if (!checksumOk) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2012-04-27 06:53:45
|
Revision: 5898 http://jnode.svn.sourceforge.net/jnode/?rev=5898&view=rev Author: galatnm Date: 2012-04-27 06:53:38 +0000 (Fri, 27 Apr 2012) Log Message: ----------- Add basic unit tests for FileSystemManager. Modified Paths: -------------- trunk/JNode.ipr trunk/fs/.classpath Added Paths: ----------- trunk/fs/src/test/org/jnode/fs/service/ trunk/fs/src/test/org/jnode/fs/service/def/ trunk/fs/src/test/org/jnode/fs/service/def/FileSystemManagerTest.java Modified: trunk/JNode.ipr =================================================================== --- trunk/JNode.ipr 2012-04-19 15:52:49 UTC (rev 5897) +++ trunk/JNode.ipr 2012-04-27 06:53:38 UTC (rev 5898) @@ -186,6 +186,7 @@ <component name="CopyrightManager" default=""> <module2copyright /> </component> + <component name="CppTools.Loader" reportImplicitCastToBool="false" reportNameReferencedOnce="false" warnedAboutFileOutOfSourceRoot="true" version="3" compilerSelect="AUTO" /> <component name="DependenciesAnalyzeManager"> <option name="myForwardDirection" value="false" /> </component> @@ -364,6 +365,99 @@ </item> </group> </component> + <component name="ProjectCodeStyleSettingsManager"> + <option name="PER_PROJECT_SETTINGS"> + <value> + <option name="JAVA_INDENT_OPTIONS"> + <value> + <option name="INDENT_SIZE" value="4" /> + <option name="CONTINUATION_INDENT_SIZE" value="4" /> + <option name="TAB_SIZE" value="4" /> + <option name="USE_TAB_CHARACTER" value="false" /> + <option name="SMART_TABS" value="false" /> + <option name="LABEL_INDENT_SIZE" value="-4" /> + <option name="LABEL_INDENT_ABSOLUTE" value="false" /> + <option name="USE_RELATIVE_INDENTS" value="false" /> + </value> + </option> + <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="100" /> + <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="100" /> + <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> + <value /> + </option> + <option name="IMPORT_LAYOUT_TABLE"> + <value> + <package name="" withSubpackages="true" static="false" /> + <emptyLine /> + <package name="javax" withSubpackages="false" static="false" /> + <package name="java" withSubpackages="false" static="false" /> + <emptyLine /> + <package name="" withSubpackages="true" static="true" /> + </value> + </option> + <option name="CALL_PARAMETERS_WRAP" value="1" /> + <option name="METHOD_PARAMETERS_WRAP" value="1" /> + <option name="THROWS_LIST_WRAP" value="1" /> + <option name="EXTENDS_KEYWORD_WRAP" value="1" /> + <option name="THROWS_KEYWORD_WRAP" value="1" /> + <option name="METHOD_CALL_CHAIN_WRAP" value="1" /> + <option name="BINARY_OPERATION_WRAP" value="1" /> + <option name="TERNARY_OPERATION_WRAP" value="1" /> + <option name="ARRAY_INITIALIZER_WRAP" value="1" /> + <option name="ASSIGNMENT_WRAP" value="1" /> + <XML> + <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" /> + </XML> + <ADDITIONAL_INDENT_OPTIONS fileType="gsp"> + <option name="INDENT_SIZE" value="2" /> + </ADDITIONAL_INDENT_OPTIONS> + <ADDITIONAL_INDENT_OPTIONS fileType="scala"> + <option name="INDENT_SIZE" value="2" /> + <option name="TAB_SIZE" value="2" /> + </ADDITIONAL_INDENT_OPTIONS> + <ADDITIONAL_INDENT_OPTIONS fileType="sql"> + <option name="INDENT_SIZE" value="2" /> + </ADDITIONAL_INDENT_OPTIONS> + <ADDITIONAL_INDENT_OPTIONS fileType="yml"> + <option name="INDENT_SIZE" value="2" /> + </ADDITIONAL_INDENT_OPTIONS> + <codeStyleSettings language="Groovy"> + <option name="CALL_PARAMETERS_WRAP" value="1" /> + <option name="METHOD_PARAMETERS_WRAP" value="1" /> + <option name="THROWS_LIST_WRAP" value="1" /> + <option name="EXTENDS_KEYWORD_WRAP" value="1" /> + <option name="THROWS_KEYWORD_WRAP" value="1" /> + <option name="METHOD_CALL_CHAIN_WRAP" value="1" /> + <option name="BINARY_OPERATION_WRAP" value="1" /> + <option name="TERNARY_OPERATION_WRAP" value="1" /> + <option name="ARRAY_INITIALIZER_WRAP" value="1" /> + <option name="ASSIGNMENT_WRAP" value="1" /> + <option name="PARENT_SETTINGS_INSTALLED" value="true" /> + <indentOptions> + <option name="INDENT_SIZE" value="2" /> + </indentOptions> + </codeStyleSettings> + <codeStyleSettings language="JAVA"> + <option name="CALL_PARAMETERS_WRAP" value="1" /> + <option name="METHOD_PARAMETERS_WRAP" value="1" /> + <option name="THROWS_LIST_WRAP" value="1" /> + <option name="EXTENDS_KEYWORD_WRAP" value="1" /> + <option name="THROWS_KEYWORD_WRAP" value="1" /> + <option name="METHOD_CALL_CHAIN_WRAP" value="1" /> + <option name="BINARY_OPERATION_WRAP" value="1" /> + <option name="TERNARY_OPERATION_WRAP" value="1" /> + <option name="ARRAY_INITIALIZER_WRAP" value="1" /> + <option name="ASSIGNMENT_WRAP" value="1" /> + <option name="PARENT_SETTINGS_INSTALLED" value="true" /> + <indentOptions> + <option name="CONTINUATION_INDENT_SIZE" value="4" /> + <option name="LABEL_INDENT_SIZE" value="-4" /> + </indentOptions> + </codeStyleSettings> + </value> + </option> + <option name="USE_PER_PROJECT_SETTINGS" value="true" /> + </component> <component name="ProjectDetails"> <option name="projectName" value="JNode" /> </component> @@ -389,7 +483,7 @@ <component name="ProjectResources"> <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype> </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6 - jnode" project-jdk-type="JavaSDK" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK" /> <component name="ResourceManagerContainer"> <option name="myResourceBundles"> <value> @@ -403,20 +497,6 @@ <entry key="$PROJECT_DIR$"> <value> <SvnBranchConfiguration> - <option name="branchMap"> - <map> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/branches"> - <value> - <list /> - </value> - </entry> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/tags"> - <value> - <list /> - </value> - </entry> - </map> - </option> <option name="branchUrls"> <list> <option value="https://jnode.svn.sourceforge.net/svnroot/jnode/branches" /> @@ -430,25 +510,6 @@ <entry key="$PROJECT_DIR$/distr"> <value> <SvnBranchConfiguration> - <option name="branchMap"> - <map> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/branches"> - <value> - <list /> - </value> - </entry> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/classlib6"> - <value> - <list /> - </value> - </entry> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/tags"> - <value> - <list /> - </value> - </entry> - </map> - </option> <option name="branchUrls"> <list> <option value="https://jnode.svn.sourceforge.net/svnroot/jnode/branches" /> @@ -463,25 +524,6 @@ <entry key="$PROJECT_DIR$/gui"> <value> <SvnBranchConfiguration> - <option name="branchMap"> - <map> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/branches"> - <value> - <list /> - </value> - </entry> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/classlib6"> - <value> - <list /> - </value> - </entry> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/tags"> - <value> - <list /> - </value> - </entry> - </map> - </option> <option name="branchUrls"> <list> <option value="https://jnode.svn.sourceforge.net/svnroot/jnode/branches" /> @@ -496,25 +538,6 @@ <entry key="$PROJECT_DIR$/net"> <value> <SvnBranchConfiguration> - <option name="branchMap"> - <map> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/branches"> - <value> - <list /> - </value> - </entry> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/classlib6"> - <value> - <list /> - </value> - </entry> - <entry key="https://jnode.svn.sourceforge.net/svnroot/jnode/tags"> - <value> - <list /> - </value> - </entry> - </map> - </option> <option name="branchUrls"> <list> <option value="https://jnode.svn.sourceforge.net/svnroot/jnode/branches" /> Modified: trunk/fs/.classpath =================================================================== --- trunk/fs/.classpath 2012-04-19 15:52:49 UTC (rev 5897) +++ trunk/fs/.classpath 2012-04-27 06:53:38 UTC (rev 5898) @@ -17,5 +17,6 @@ <classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/> <classpathentry kind="lib" path="/core/lib/junit-4.5.jar"/> <classpathentry kind="lib" path="/all/lib/classlib.jar" sourcepath="/all/lib/classlib-src.jar"/> + <classpathentry kind="lib" path="/core/lib/mockito-all-1.8.5.jar"/> <classpathentry kind="output" path="build/classes"/> </classpath> Added: trunk/fs/src/test/org/jnode/fs/service/def/FileSystemManagerTest.java =================================================================== --- trunk/fs/src/test/org/jnode/fs/service/def/FileSystemManagerTest.java (rev 0) +++ trunk/fs/src/test/org/jnode/fs/service/def/FileSystemManagerTest.java 2012-04-27 06:53:38 UTC (rev 5898) @@ -0,0 +1,58 @@ +package org.jnode.fs.service.def; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.Collection; + +import org.jnode.driver.Device; +import org.jnode.fs.FileSystem; +import org.junit.Before; +import org.junit.Test; + +public class FileSystemManagerTest { + + private FileSystemManager fsm; + private FileSystem<?> fs; + private Device device; + + @Before + public void setUp() throws Exception { + fsm = new FileSystemManager(); + device = mock(Device.class); + fs = mock(FileSystem.class); + when(fs.getDevice()).thenReturn(device); + } + + @Test + public void testUnregisterFileSystem() throws Exception { + fsm.registerFileSystem(fs); + FileSystem<?> result = fsm.unregisterFileSystem(device); + assertNotNull(result); + } + + @Test + public void testGetFileSystem() throws Exception { + fsm.registerFileSystem(fs); + FileSystem<?> result = fsm.getFileSystem(device); + assertNotNull(result); + } + + @Test + public void testFileSystems() throws Exception { + fsm.registerFileSystem(fs); + Collection<FileSystem<?>> result = fsm.fileSystems(); + assertNotNull(result); + assertEquals(1,result.size()); + + fsm.unregisterFileSystem(device); + + result = fsm.fileSystems(); + assertNotNull(result); + assertEquals(0,result.size()); + } + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2012-06-04 09:06:11
|
Revision: 5899 http://jnode.svn.sourceforge.net/jnode/?rev=5899&view=rev Author: galatnm Date: 2012-06-04 09:05:31 +0000 (Mon, 04 Jun 2012) Log Message: ----------- Update headers. Modified Paths: -------------- trunk/all/template/header.txt trunk/builder/src/builder/org/jnode/ant/taskdefs/AnnotateTask.java trunk/builder/src/builder/org/jnode/ant/taskdefs/Asm.java trunk/builder/src/builder/org/jnode/ant/taskdefs/FileSetTask.java trunk/builder/src/builder/org/jnode/ant/taskdefs/HeaderTask.java trunk/builder/src/builder/org/jnode/ant/taskdefs/Hotswap.java trunk/builder/src/builder/org/jnode/ant/taskdefs/Native2AsciiTask.java trunk/builder/src/builder/org/jnode/ant/taskdefs/NativeCheckTask.java trunk/builder/src/builder/org/jnode/ant/taskdefs/TemplateTask.java trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/BaseDirs.java trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/Flags.java trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/PackageDirectory.java trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/SourceFile.java trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/TargetedFileSet.java trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java trunk/builder/src/builder/org/jnode/build/AbstractPluginTask.java trunk/builder/src/builder/org/jnode/build/AbstractPluginsTask.java trunk/builder/src/builder/org/jnode/build/AddressFinder.java trunk/builder/src/builder/org/jnode/build/AsmSourceInfo.java trunk/builder/src/builder/org/jnode/build/BootDiskBuilder.java trunk/builder/src/builder/org/jnode/build/BootFloppyBuilder.java trunk/builder/src/builder/org/jnode/build/BuildException.java trunk/builder/src/builder/org/jnode/build/BuildObjectResolver.java trunk/builder/src/builder/org/jnode/build/FieldInfo.java trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java trunk/builder/src/builder/org/jnode/build/InitJarsBuilder.java trunk/builder/src/builder/org/jnode/build/JNodeClassNotFoundException.java trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java trunk/builder/src/builder/org/jnode/build/PluginList.java trunk/builder/src/builder/org/jnode/build/PluginTask.java trunk/builder/src/builder/org/jnode/build/VMwareBuilderTask.java trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java trunk/builder/src/builder/org/jnode/build/documentation/DotBuilder.java trunk/builder/src/builder/org/jnode/build/documentation/LicenseEntry.java trunk/builder/src/builder/org/jnode/build/documentation/PackageData.java trunk/builder/src/builder/org/jnode/build/documentation/PluginData.java trunk/builder/src/builder/org/jnode/build/documentation/PluginDocumentationTask.java trunk/builder/src/builder/org/jnode/build/documentation/ToolbarEntry.java trunk/builder/src/builder/org/jnode/build/natives/NativeStubGenerator.java trunk/builder/src/builder/org/jnode/build/packager/MainFinder.java trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java trunk/builder/src/builder/org/jnode/build/packager/PluginBuilder.java trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java trunk/builder/src/builder/org/jnode/build/packager/ScriptBuilder.java trunk/builder/src/builder/org/jnode/build/x86/AsmConstBuilder.java trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java trunk/builder/src/builder/org/jnode/build/x86/Disasm.java trunk/builder/src/builder/org/jnode/jnasm/JNAsm.java trunk/builder/src/builder/org/jnode/jnasm/assembler/Address.java trunk/builder/src/builder/org/jnode/jnasm/assembler/Assembler.java trunk/builder/src/builder/org/jnode/jnasm/assembler/AssemblerModule.java trunk/builder/src/builder/org/jnode/jnasm/assembler/HardwareSupport.java trunk/builder/src/builder/org/jnode/jnasm/assembler/Identifier.java trunk/builder/src/builder/org/jnode/jnasm/assembler/Instruction.java trunk/builder/src/builder/org/jnode/jnasm/assembler/InstructionUtils.java trunk/builder/src/builder/org/jnode/jnasm/assembler/PseudoInstructions.java trunk/builder/src/builder/org/jnode/jnasm/assembler/Register.java trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/AbstractX86Module.java trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/MMX.java trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Support.java trunk/builder/src/builder/org/jnode/jnasm/preprocessor/FileResolver.java trunk/builder/src/builder/org/jnode/jnasm/preprocessor/Macro.java trunk/builder/src/builder/org/jnode/jnasm/preprocessor/Preprocessor.java trunk/builder/src/builder/org/jnode/linker/Elf.java trunk/builder/src/builder/org/jnode/linker/ElfLinker.java trunk/builder/src/builder/org/jnode/linker/LoadUtil.java trunk/builder/src/builder/org/jnode/linker/Reloc.java trunk/builder/src/builder/org/jnode/linker/Reloca.java trunk/builder/src/builder/org/jnode/linker/Section.java trunk/builder/src/builder/org/jnode/linker/StoreUtil.java trunk/builder/src/builder/org/jnode/linker/StrTab.java trunk/builder/src/builder/org/jnode/linker/Symbol.java trunk/builder/src/builder/org/jnode/pluginlist/Main.java trunk/builder/src/builder/org/jnode/pluginlist/Plugin.java trunk/builder/src/builder/org/jnode/pluginlist/PluginList.java trunk/builder/src/builder/org/jnode/pluginlist/PluginListEditor.java trunk/builder/src/builder/org/jnode/pluginlist/PluginListModel.java trunk/builder/src/builder/org/jnode/pluginlist/PluginNode.java trunk/builder/src/builder/org/jnode/pluginlist/PluginRepository.java trunk/builder/src/builder/org/jnode/pluginlist/PluginTreePane.java trunk/builder/src/builder/org/jnode/pluginlist/Project.java trunk/builder/src/builder/org/jnode/pluginlist/ProjectNode.java trunk/builder/src/builder/org/jnode/pluginlist/RootNode.java trunk/builder/src/builder/org/jnode/pluginlist/Syncable.java trunk/cli/src/commands/org/jnode/command/archive/ArchiveCommand.java trunk/cli/src/commands/org/jnode/command/archive/BUnzipCommand.java trunk/cli/src/commands/org/jnode/command/archive/BZCatCommand.java trunk/cli/src/commands/org/jnode/command/archive/BZip.java trunk/cli/src/commands/org/jnode/command/archive/BZipCommand.java trunk/cli/src/commands/org/jnode/command/archive/GUnzipCommand.java trunk/cli/src/commands/org/jnode/command/archive/GZip.java trunk/cli/src/commands/org/jnode/command/archive/GZipCommand.java trunk/cli/src/commands/org/jnode/command/archive/TarCommand.java trunk/cli/src/commands/org/jnode/command/archive/UnzipCommand.java trunk/cli/src/commands/org/jnode/command/archive/ZCatCommand.java trunk/cli/src/commands/org/jnode/command/archive/Zip.java trunk/cli/src/commands/org/jnode/command/archive/ZipCommand.java trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java trunk/cli/src/commands/org/jnode/command/common/BasenameCommand.java trunk/cli/src/commands/org/jnode/command/common/DateCommand.java trunk/cli/src/commands/org/jnode/command/common/DirnameCommand.java trunk/cli/src/commands/org/jnode/command/common/EchoCommand.java trunk/cli/src/commands/org/jnode/command/common/EnvCommand.java trunk/cli/src/commands/org/jnode/command/common/ExitCommand.java trunk/cli/src/commands/org/jnode/command/common/ExprCommand.java trunk/cli/src/commands/org/jnode/command/common/FalseCommand.java trunk/cli/src/commands/org/jnode/command/common/HelpCommand.java trunk/cli/src/commands/org/jnode/command/common/HistoryCommand.java trunk/cli/src/commands/org/jnode/command/common/SleepCommand.java trunk/cli/src/commands/org/jnode/command/common/TimeCommand.java trunk/cli/src/commands/org/jnode/command/common/TrueCommand.java trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java trunk/cli/src/commands/org/jnode/command/common/UptimeCommand.java trunk/cli/src/commands/org/jnode/command/dev/CompileCommand.java trunk/cli/src/commands/org/jnode/command/dev/DebugCommand.java trunk/cli/src/commands/org/jnode/command/dev/DisassembleCommand.java trunk/cli/src/commands/org/jnode/command/dev/RemoteOutputCommand.java trunk/cli/src/commands/org/jnode/command/dev/ant/AntCommand.java trunk/cli/src/commands/org/jnode/command/file/CatCommand.java trunk/cli/src/commands/org/jnode/command/file/CdCommand.java trunk/cli/src/commands/org/jnode/command/file/CmpCommand.java trunk/cli/src/commands/org/jnode/command/file/CpCommand.java trunk/cli/src/commands/org/jnode/command/file/CutCommand.java trunk/cli/src/commands/org/jnode/command/file/DFCommand.java trunk/cli/src/commands/org/jnode/command/file/DeleteCommand.java trunk/cli/src/commands/org/jnode/command/file/DirCommand.java trunk/cli/src/commands/org/jnode/command/file/DuCommand.java trunk/cli/src/commands/org/jnode/command/file/FindCommand.java trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java trunk/cli/src/commands/org/jnode/command/file/HeadCommand.java trunk/cli/src/commands/org/jnode/command/file/HexdumpCommand.java trunk/cli/src/commands/org/jnode/command/file/Md5SumCommand.java trunk/cli/src/commands/org/jnode/command/file/MkdirCommand.java trunk/cli/src/commands/org/jnode/command/file/PasteCommand.java trunk/cli/src/commands/org/jnode/command/file/PwdCommand.java trunk/cli/src/commands/org/jnode/command/file/SortCommand.java trunk/cli/src/commands/org/jnode/command/file/TailCommand.java trunk/cli/src/commands/org/jnode/command/file/TeeCommand.java trunk/cli/src/commands/org/jnode/command/file/TouchCommand.java trunk/cli/src/commands/org/jnode/command/file/WcCommand.java trunk/cli/src/commands/org/jnode/command/net/ArpCommand.java trunk/cli/src/commands/org/jnode/command/net/BootpCommand.java trunk/cli/src/commands/org/jnode/command/net/DhcpCommand.java trunk/cli/src/commands/org/jnode/command/net/IfconfigCommand.java trunk/cli/src/commands/org/jnode/command/net/NetstatCommand.java trunk/cli/src/commands/org/jnode/command/net/PingCommand.java trunk/cli/src/commands/org/jnode/command/net/ResolverCommand.java trunk/cli/src/commands/org/jnode/command/net/RouteCommand.java trunk/cli/src/commands/org/jnode/command/net/RpcInfoCommand.java trunk/cli/src/commands/org/jnode/command/net/TcpInoutCommand.java trunk/cli/src/commands/org/jnode/command/net/TftpCommand.java trunk/cli/src/commands/org/jnode/command/net/WLanCtlCommand.java trunk/cli/src/commands/org/jnode/command/net/WgetCommand.java trunk/cli/src/commands/org/jnode/command/system/AliasCommand.java trunk/cli/src/commands/org/jnode/command/system/BindKeysCommand.java trunk/cli/src/commands/org/jnode/command/system/ClassCommand.java trunk/cli/src/commands/org/jnode/command/system/ClasspathCommand.java trunk/cli/src/commands/org/jnode/command/system/CpuIDCommand.java trunk/cli/src/commands/org/jnode/command/system/GcCommand.java trunk/cli/src/commands/org/jnode/command/system/HaltCommand.java trunk/cli/src/commands/org/jnode/command/system/IsolateCommand.java trunk/cli/src/commands/org/jnode/command/system/JavaCommand.java trunk/cli/src/commands/org/jnode/command/system/KdbCommand.java trunk/cli/src/commands/org/jnode/command/system/KillCommand.java trunk/cli/src/commands/org/jnode/command/system/LoadkeysCommand.java trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java trunk/cli/src/commands/org/jnode/command/system/Log4jCommand.java trunk/cli/src/commands/org/jnode/command/system/LsIRQCommand.java trunk/cli/src/commands/org/jnode/command/system/MemoryCommand.java trunk/cli/src/commands/org/jnode/command/system/NamespaceCommand.java trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java trunk/cli/src/commands/org/jnode/command/system/PageCommand.java trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java trunk/cli/src/commands/org/jnode/command/system/PrintEnvCommand.java trunk/cli/src/commands/org/jnode/command/system/RebootCommand.java trunk/cli/src/commands/org/jnode/command/system/RunCommand.java trunk/cli/src/commands/org/jnode/command/system/SetCommand.java trunk/cli/src/commands/org/jnode/command/system/SyntaxCommand.java trunk/cli/src/commands/org/jnode/command/system/TerminateCommand.java trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java trunk/cli/src/commands/org/jnode/command/system/VmInfoCommand.java trunk/cli/src/commands/org/jnode/command/util/AbstractDirectoryWalker.java trunk/cli/src/commands/org/jnode/command/util/IOUtils.java trunk/cli/src/commands/org/jnode/command/util/NumberRange.java trunk/core/src/classpath/ext/java/nio/channels/LinkChannel.java trunk/core/src/classpath/ext/java/util/prefs/TransientPreferences.java trunk/core/src/classpath/ext/javax/cache/Cache.java trunk/core/src/classpath/ext/javax/cache/CacheEntry.java trunk/core/src/classpath/ext/javax/cache/CacheException.java trunk/core/src/classpath/ext/javax/cache/CacheFactory.java trunk/core/src/classpath/ext/javax/cache/CacheListener.java trunk/core/src/classpath/ext/javax/cache/CacheLoader.java trunk/core/src/classpath/ext/javax/cache/CacheManager.java trunk/core/src/classpath/ext/javax/cache/CacheStatistics.java trunk/core/src/classpath/ext/javax/cache/EvictionStrategy.java trunk/core/src/classpath/ext/javax/isolate/AbstractLinkMessageHandler.java trunk/core/src/classpath/ext/javax/isolate/ClosedLinkException.java trunk/core/src/classpath/ext/javax/isolate/Isolate.java trunk/core/src/classpath/ext/javax/isolate/IsolatePermission.java trunk/core/src/classpath/ext/javax/isolate/IsolateStartupException.java trunk/core/src/classpath/ext/javax/isolate/IsolateStatus.java trunk/core/src/classpath/ext/javax/isolate/Link.java trunk/core/src/classpath/ext/javax/isolate/LinkMessage.java trunk/core/src/classpath/ext/javax/isolate/LinkMessageDispatcher.java trunk/core/src/classpath/ext/javax/isolate/LinkMessageHandler.java trunk/core/src/classpath/ext/javax/isolate/StreamBindings.java trunk/core/src/classpath/vm/gnu/classpath/NativeSystemProperties.java trunk/core/src/classpath/vm/gnu/classpath/NativeVMStackWalker.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/JDIVirtualMachine.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMFrame.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMMethod.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/JNodeSocketTransport.java trunk/core/src/classpath/vm/gnu/classpath/jdwp/transport/NativeTransportFactory.java trunk/core/src/classpath/vm/gnu/java/security/action/GetEnvAction.java trunk/core/src/classpath/vm/gnu/java/security/action/GetPolicyAction.java trunk/core/src/classpath/vm/gnu/java/security/action/GetPropertiesAction.java trunk/core/src/classpath/vm/gnu/java/security/action/InvokeAction.java trunk/core/src/classpath/vm/gnu/java/security/action/SetPropertyAction.java trunk/core/src/classpath/vm/gnu/java/security/util/SimplePermissionCollection.java trunk/core/src/classpath/vm/java/awt/VMAwtAPI.java trunk/core/src/classpath/vm/java/awt/image/VMImageAPI.java trunk/core/src/classpath/vm/java/awt/image/VMImageUtils.java trunk/core/src/classpath/vm/java/lang/NativeClassLoader.java trunk/core/src/classpath/vm/java/lang/NativeSecurityManager.java trunk/core/src/classpath/vm/java/lang/NativeThread.java trunk/core/src/classpath/vm/java/lang/NativeVMClassLoader.java trunk/core/src/classpath/vm/java/lang/ThreadHelper.java trunk/core/src/classpath/vm/java/lang/VMRuntime.java trunk/core/src/classpath/vm/java/lang/VMSecurityManager.java trunk/core/src/classpath/vm/java/net/ExSocketOptions.java trunk/core/src/classpath/vm/java/net/VMInetAddress.java trunk/core/src/classpath/vm/java/net/VMNetAPI.java trunk/core/src/classpath/vm/java/net/VMNetDevice.java trunk/core/src/classpath/vm/java/net/VMNetUtils.java trunk/core/src/classpath/vm/java/net/VMNetworkInterface.java trunk/core/src/classpath/vm/java/nio/MemoryRawData.java trunk/core/src/classpath/vm/java/nio/NativeVMDirectByteBuffer.java trunk/core/src/classpath/vm/java/nio/channels/NativeVMChannels.java trunk/core/src/classpath/vm/java/security/NativeAccessControlContext.java trunk/core/src/classpath/vm/java/security/NativeAccessController.java trunk/core/src/classpath/vm/java/security/VMSecureRandom.java trunk/core/src/classpath/vm/javax/imageio/spi/NativeIIORegistry.java trunk/core/src/core/org/jnode/assembler/BootImageNativeStream.java trunk/core/src/core/org/jnode/assembler/Label.java trunk/core/src/core/org/jnode/assembler/NativeStream.java trunk/core/src/core/org/jnode/assembler/ObjectResolver.java trunk/core/src/core/org/jnode/assembler/UnresolvedObjectRefException.java trunk/core/src/core/org/jnode/assembler/x86/InvalidOpcodeException.java trunk/core/src/core/org/jnode/assembler/x86/X86Assembler.java trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86Constants.java trunk/core/src/core/org/jnode/assembler/x86/X86Operation.java trunk/core/src/core/org/jnode/assembler/x86/X86Register.java trunk/core/src/core/org/jnode/assembler/x86/X86TextAssembler.java trunk/core/src/core/org/jnode/assembler/x86/X86Utils.java trunk/core/src/core/org/jnode/boot/InitJarProcessor.java trunk/core/src/core/org/jnode/boot/Main.java trunk/core/src/core/org/jnode/boot/MemoryResourceInputStream.java trunk/core/src/core/org/jnode/boot/NoCloseInputStream.java trunk/core/src/core/org/jnode/bootlog/BootLog.java trunk/core/src/core/org/jnode/bootlog/BootLogInstance.java trunk/core/src/core/org/jnode/debug/RemoteAppender.java trunk/core/src/core/org/jnode/debug/RemoteReceiver.java trunk/core/src/core/org/jnode/debug/UDPOutputStream.java trunk/core/src/core/org/jnode/debugger/DebugState.java trunk/core/src/core/org/jnode/debugger/Debugger.java trunk/core/src/core/org/jnode/debugger/DebuggerPlugin.java trunk/core/src/core/org/jnode/debugger/DebuggerUtils.java trunk/core/src/core/org/jnode/debugger/RootState.java trunk/core/src/core/org/jnode/debugger/ThreadListState.java trunk/core/src/core/org/jnode/debugger/ThreadState.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoder.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGDecoderAdapter.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGException.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReader.java trunk/core/src/core/org/jnode/imageio/jpeg/JPEGImageReaderSpi.java trunk/core/src/core/org/jnode/log4j/config/JNodeSystemAppender.java trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java trunk/core/src/core/org/jnode/log4j/config/UnsafeDebugAppender.java trunk/core/src/core/org/jnode/log4j/config/VirtualConsoleAppender.java trunk/core/src/core/org/jnode/naming/AbstractNameSpace.java trunk/core/src/core/org/jnode/naming/InitialNaming.java trunk/core/src/core/org/jnode/naming/NameSpace.java trunk/core/src/core/org/jnode/naming/NameSpaceListener.java trunk/core/src/core/org/jnode/permission/JNodePermission.java trunk/core/src/core/org/jnode/plugin/AutoUnzipPlugin.java trunk/core/src/core/org/jnode/plugin/ConfigurationElement.java trunk/core/src/core/org/jnode/plugin/Extension.java trunk/core/src/core/org/jnode/plugin/ExtensionPoint.java trunk/core/src/core/org/jnode/plugin/ExtensionPointListener.java trunk/core/src/core/org/jnode/plugin/FragmentDescriptor.java trunk/core/src/core/org/jnode/plugin/Library.java trunk/core/src/core/org/jnode/plugin/Plugin.java trunk/core/src/core/org/jnode/plugin/PluginClassLoader.java trunk/core/src/core/org/jnode/plugin/PluginDescriptor.java trunk/core/src/core/org/jnode/plugin/PluginDescriptorListener.java trunk/core/src/core/org/jnode/plugin/PluginException.java trunk/core/src/core/org/jnode/plugin/PluginLoader.java trunk/core/src/core/org/jnode/plugin/PluginLoaderManager.java trunk/core/src/core/org/jnode/plugin/PluginManager.java trunk/core/src/core/org/jnode/plugin/PluginPrerequisite.java trunk/core/src/core/org/jnode/plugin/PluginReference.java trunk/core/src/core/org/jnode/plugin/PluginRegistry.java trunk/core/src/core/org/jnode/plugin/PluginSecurityConstants.java trunk/core/src/core/org/jnode/plugin/PluginUtils.java trunk/core/src/core/org/jnode/plugin/Runtime.java trunk/core/src/core/org/jnode/plugin/URLPluginLoader.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginLoaderManager.java trunk/core/src/core/org/jnode/plugin/manager/DefaultPluginManager.java trunk/core/src/core/org/jnode/plugin/model/AbstractModelObject.java trunk/core/src/core/org/jnode/plugin/model/AttributeModel.java trunk/core/src/core/org/jnode/plugin/model/ConfigurationElementModel.java trunk/core/src/core/org/jnode/plugin/model/EmptyPlugin.java trunk/core/src/core/org/jnode/plugin/model/ExtensionModel.java trunk/core/src/core/org/jnode/plugin/model/ExtensionPointModel.java trunk/core/src/core/org/jnode/plugin/model/Factory.java trunk/core/src/core/org/jnode/plugin/model/FragmentDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/LibraryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginClassLoaderImpl.java trunk/core/src/core/org/jnode/plugin/model/PluginDescriptorModel.java trunk/core/src/core/org/jnode/plugin/model/PluginJar.java trunk/core/src/core/org/jnode/plugin/model/PluginModelObject.java trunk/core/src/core/org/jnode/plugin/model/PluginPrerequisiteModel.java trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java trunk/core/src/core/org/jnode/plugin/model/PluginsClassLoader.java trunk/core/src/core/org/jnode/plugin/model/RuntimeModel.java trunk/core/src/core/org/jnode/protocol/ProtocolHandlerFactoryPlugin.java trunk/core/src/core/org/jnode/protocol/plugin/Handler.java trunk/core/src/core/org/jnode/protocol/plugin/PluginURLConnection.java trunk/core/src/core/org/jnode/protocol/system/Handler.java trunk/core/src/core/org/jnode/protocol/system/SystemURLConnection.java trunk/core/src/core/org/jnode/security/JNodePolicy.java trunk/core/src/core/org/jnode/security/JNodeSecurityManager.java trunk/core/src/core/org/jnode/security/SecurityPlugin.java trunk/core/src/core/org/jnode/system/event/FocusEvent.java trunk/core/src/core/org/jnode/system/event/FocusListener.java trunk/core/src/core/org/jnode/system/event/SystemEvent.java trunk/core/src/core/org/jnode/system/repository/Repository.java trunk/core/src/core/org/jnode/system/repository/RepositoryPlugin.java trunk/core/src/core/org/jnode/system/repository/RepositoryPluginLoader.java trunk/core/src/core/org/jnode/system/repository/SystemRepository.java trunk/core/src/core/org/jnode/system/repository/SystemRepositoryPlugin.java trunk/core/src/core/org/jnode/system/repository/plugins/PluginLoaderPlugin.java trunk/core/src/core/org/jnode/system/repository/spi/SystemRepositoryProvider.java trunk/core/src/core/org/jnode/system/resource/DMAException.java trunk/core/src/core/org/jnode/system/resource/DMAManager.java trunk/core/src/core/org/jnode/system/resource/DMAResource.java trunk/core/src/core/org/jnode/system/resource/IOResource.java trunk/core/src/core/org/jnode/system/resource/IRQHandler.java trunk/core/src/core/org/jnode/system/resource/IRQResource.java trunk/core/src/core/org/jnode/system/resource/MemoryResource.java trunk/core/src/core/org/jnode/system/resource/MemoryScanner.java trunk/core/src/core/org/jnode/system/resource/MultiMediaMemoryResource.java trunk/core/src/core/org/jnode/system/resource/Resource.java trunk/core/src/core/org/jnode/system/resource/ResourceManager.java trunk/core/src/core/org/jnode/system/resource/ResourceNotFreeException.java trunk/core/src/core/org/jnode/system/resource/ResourceOwner.java trunk/core/src/core/org/jnode/system/resource/ResourcePermission.java trunk/core/src/core/org/jnode/system/resource/SimpleResourceOwner.java trunk/core/src/core/org/jnode/system/x86/DMA.java trunk/core/src/core/org/jnode/system/x86/DMAConstants.java trunk/core/src/core/org/jnode/system/x86/DMAPlugin.java trunk/core/src/core/org/jnode/system/x86/X86DMAChannel.java trunk/core/src/core/org/jnode/util/AccessControllerUtils.java trunk/core/src/core/org/jnode/util/BCDUtils.java trunk/core/src/core/org/jnode/util/BeanUtils.java trunk/core/src/core/org/jnode/util/BigEndian.java trunk/core/src/core/org/jnode/util/BinaryScaleFactor.java trunk/core/src/core/org/jnode/util/BooleanUtils.java trunk/core/src/core/org/jnode/util/ByteBufferInputStream.java trunk/core/src/core/org/jnode/util/ByteBufferUtils.java trunk/core/src/core/org/jnode/util/ByteQueue.java trunk/core/src/core/org/jnode/util/ByteQueueProcessor.java trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java trunk/core/src/core/org/jnode/util/ChannelInputStream.java trunk/core/src/core/org/jnode/util/ChannelOutputStream.java trunk/core/src/core/org/jnode/util/Command.java trunk/core/src/core/org/jnode/util/ConsoleStream.java trunk/core/src/core/org/jnode/util/DecimalScaleFactor.java trunk/core/src/core/org/jnode/util/EmptyInputStream.java trunk/core/src/core/org/jnode/util/FileUtils.java trunk/core/src/core/org/jnode/util/IOUtils.java trunk/core/src/core/org/jnode/util/JarBuffer.java trunk/core/src/core/org/jnode/util/JarConstants.java trunk/core/src/core/org/jnode/util/LittleEndian.java trunk/core/src/core/org/jnode/util/NumberUtils.java trunk/core/src/core/org/jnode/util/ObjectArrayIterator.java trunk/core/src/core/org/jnode/util/ObjectUtils.java trunk/core/src/core/org/jnode/util/OsUtils.java trunk/core/src/core/org/jnode/util/PipeStream.java trunk/core/src/core/org/jnode/util/ProxyStream.java trunk/core/src/core/org/jnode/util/ProxyStreamException.java trunk/core/src/core/org/jnode/util/Queue.java trunk/core/src/core/org/jnode/util/QueueProcessor.java trunk/core/src/core/org/jnode/util/QueueProcessorThread.java trunk/core/src/core/org/jnode/util/ReaderInputStream.java trunk/core/src/core/org/jnode/util/ScaleFactor.java trunk/core/src/core/org/jnode/util/SizeUnit.java trunk/core/src/core/org/jnode/util/StopWatch.java trunk/core/src/core/org/jnode/util/SystemInputStream.java trunk/core/src/core/org/jnode/util/TimeUtils.java trunk/core/src/core/org/jnode/util/TimeoutException.java trunk/core/src/core/org/jnode/util/Token.java trunk/core/src/core/org/jnode/util/WriterOutputStream.java trunk/core/src/core/org/jnode/vm/AllocationBitmap.java trunk/core/src/core/org/jnode/vm/BaseVmArchitecture.java trunk/core/src/core/org/jnode/vm/BootLogImpl.java trunk/core/src/core/org/jnode/vm/CpuID.java trunk/core/src/core/org/jnode/vm/DefaultNameSpace.java trunk/core/src/core/org/jnode/vm/HeapHelperImpl.java trunk/core/src/core/org/jnode/vm/IOContext.java trunk/core/src/core/org/jnode/vm/IOResourceImpl.java trunk/core/src/core/org/jnode/vm/InternString.java trunk/core/src/core/org/jnode/vm/JvmType.java trunk/core/src/core/org/jnode/vm/LoadCompileService.java trunk/core/src/core/org/jnode/vm/LoadCompileThread.java trunk/core/src/core/org/jnode/vm/MathSupport.java trunk/core/src/core/org/jnode/vm/MemoryBlockManager.java trunk/core/src/core/org/jnode/vm/MemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/MemoryScannerImpl.java trunk/core/src/core/org/jnode/vm/MultiMediaMemoryResourceImpl.java trunk/core/src/core/org/jnode/vm/RTCService.java trunk/core/src/core/org/jnode/vm/Region.java trunk/core/src/core/org/jnode/vm/ResourceLoader.java trunk/core/src/core/org/jnode/vm/ResourceManagerImpl.java trunk/core/src/core/org/jnode/vm/SoftByteCodes.java trunk/core/src/core/org/jnode/vm/Unsafe.java trunk/core/src/core/org/jnode/vm/VirtualMemoryRegion.java trunk/core/src/core/org/jnode/vm/VmAbstractClassLoader.java trunk/core/src/core/org/jnode/vm/VmAccessControlContext.java trunk/core/src/core/org/jnode/vm/VmAccessController.java trunk/core/src/core/org/jnode/vm/VmAddress.java trunk/core/src/core/org/jnode/vm/VmExit.java trunk/core/src/core/org/jnode/vm/VmIOContext.java trunk/core/src/core/org/jnode/vm/VmImpl.java trunk/core/src/core/org/jnode/vm/VmJavaClassLoader.java trunk/core/src/core/org/jnode/vm/VmJavaMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/core/org/jnode/vm/VmMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/VmProcess.java trunk/core/src/core/org/jnode/vm/VmProcessClassLoader.java trunk/core/src/core/org/jnode/vm/VmReflection.java trunk/core/src/core/org/jnode/vm/VmStackFrame.java trunk/core/src/core/org/jnode/vm/VmStackFrameEnumerator.java trunk/core/src/core/org/jnode/vm/VmStackReader.java trunk/core/src/core/org/jnode/vm/VmSystem.java trunk/core/src/core/org/jnode/vm/VmSystemClassLoader.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlock.java trunk/core/src/core/org/jnode/vm/bytecode/BasicBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeFlags.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeParser.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeViewer.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeVisitorSupport.java trunk/core/src/core/org/jnode/vm/bytecode/BytecodeWriter.java trunk/core/src/core/org/jnode/vm/bytecode/ControlFlowGraph.java trunk/core/src/core/org/jnode/vm/bytecode/DeadBlockFinder.java trunk/core/src/core/org/jnode/vm/bytecode/DelegatingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/bytecode/StackException.java trunk/core/src/core/org/jnode/vm/bytecode/TypeStack.java trunk/core/src/core/org/jnode/vm/classmgr/AbstractCode.java trunk/core/src/core/org/jnode/vm/classmgr/AbstractExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/ClassDecoder.java trunk/core/src/core/org/jnode/vm/classmgr/CompiledCodeList.java trunk/core/src/core/org/jnode/vm/classmgr/IMTBuilder.java trunk/core/src/core/org/jnode/vm/classmgr/Mangler.java trunk/core/src/core/org/jnode/vm/classmgr/MethodPragmaFlags.java trunk/core/src/core/org/jnode/vm/classmgr/Modifier.java trunk/core/src/core/org/jnode/vm/classmgr/NotResolvedYetException.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectFlags.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.java trunk/core/src/core/org/jnode/vm/classmgr/SelectorMap.java trunk/core/src/core/org/jnode/vm/classmgr/Signature.java trunk/core/src/core/org/jnode/vm/classmgr/TIBBuilder.java trunk/core/src/core/org/jnode/vm/classmgr/TIBLayout.java trunk/core/src/core/org/jnode/vm/classmgr/TypePragmaFlags.java trunk/core/src/core/org/jnode/vm/classmgr/VmAddressMap.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotatedElement.java trunk/core/src/core/org/jnode/vm/classmgr/VmAnnotation.java trunk/core/src/core/org/jnode/vm/classmgr/VmArray.java trunk/core/src/core/org/jnode/vm/classmgr/VmArrayClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmByteCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmCP.java trunk/core/src/core/org/jnode/vm/classmgr/VmClassLoader.java trunk/core/src/core/org/jnode/vm/classmgr/VmClassType.java trunk/core/src/core/org/jnode/vm/classmgr/VmCompiledCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmCompiledExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstDouble.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstFieldRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstFloat.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstIMethodRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstInt.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstLong.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstMemberRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstMethodRef.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstString.java trunk/core/src/core/org/jnode/vm/classmgr/VmConstantPool.java trunk/core/src/core/org/jnode/vm/classmgr/VmExceptions.java trunk/core/src/core/org/jnode/vm/classmgr/VmField.java trunk/core/src/core/org/jnode/vm/classmgr/VmImplementedInterface.java trunk/core/src/core/org/jnode/vm/classmgr/VmInstanceField.java trunk/core/src/core/org/jnode/vm/classmgr/VmInstanceMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmInterfaceClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmInterpretedExceptionHandler.java trunk/core/src/core/org/jnode/vm/classmgr/VmIsolatedStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmIsolatedStaticsEntry.java trunk/core/src/core/org/jnode/vm/classmgr/VmLineNumberMap.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariable.java trunk/core/src/core/org/jnode/vm/classmgr/VmLocalVariableTable.java trunk/core/src/core/org/jnode/vm/classmgr/VmMember.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmMethodCode.java trunk/core/src/core/org/jnode/vm/classmgr/VmNormalClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmPrimitiveClass.java trunk/core/src/core/org/jnode/vm/classmgr/VmResolvableConstObject.java trunk/core/src/core/org/jnode/vm/classmgr/VmSharedStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmSharedStaticsEntry.java trunk/core/src/core/org/jnode/vm/classmgr/VmSpecialMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticField.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticMethod.java trunk/core/src/core/org/jnode/vm/classmgr/VmStatics.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsAllocator.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsBase.java trunk/core/src/core/org/jnode/vm/classmgr/VmStaticsIterator.java trunk/core/src/core/org/jnode/vm/classmgr/VmType.java trunk/core/src/core/org/jnode/vm/classmgr/VmTypeState.java trunk/core/src/core/org/jnode/vm/classmgr/VmUTF8Convert.java trunk/core/src/core/org/jnode/vm/compiler/BaseMagicHelper.java trunk/core/src/core/org/jnode/vm/compiler/CompileError.java trunk/core/src/core/org/jnode/vm/compiler/CompiledExceptionHandler.java trunk/core/src/core/org/jnode/vm/compiler/CompiledIMT.java trunk/core/src/core/org/jnode/vm/compiler/CompiledMethod.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeViewer.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/DelegatingCompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java trunk/core/src/core/org/jnode/vm/compiler/GCMapIterator.java trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java trunk/core/src/core/org/jnode/vm/compiler/IllegalModeException.java trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/NativeCodeCompiler.java trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java trunk/core/src/core/org/jnode/vm/compiler/ir/AddressingMode.java trunk/core/src/core/org/jnode/vm/compiler/ir/CodeGenerator.java trunk/core/src/core/org/jnode/vm/compiler/ir/Constant.java trunk/core/src/core/org/jnode/vm/compiler/ir/DoubleConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/FloatConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlock.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRBasicBlockFinder.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRControlFlowGraph.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRGenerator.java trunk/core/src/core/org/jnode/vm/compiler/ir/IRTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/IntConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/LinearScanAllocator.java trunk/core/src/core/org/jnode/vm/compiler/ir/LiveRange.java trunk/core/src/core/org/jnode/vm/compiler/ir/LocalVariable.java trunk/core/src/core/org/jnode/vm/compiler/ir/Location.java trunk/core/src/core/org/jnode/vm/compiler/ir/LongConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/MethodArgument.java trunk/core/src/core/org/jnode/vm/compiler/ir/NativeTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/Operand.java trunk/core/src/core/org/jnode/vm/compiler/ir/PhiOperand.java trunk/core/src/core/org/jnode/vm/compiler/ir/PrimitiveTest.java trunk/core/src/core/org/jnode/vm/compiler/ir/ReferenceConstant.java trunk/core/src/core/org/jnode/vm/compiler/ir/RegisterLocation.java trunk/core/src/core/org/jnode/vm/compiler/ir/RegisterPool.java trunk/core/src/core/org/jnode/vm/compiler/ir/SSAStack.java trunk/core/src/core/org/jnode/vm/compiler/ir/StackLocation.java trunk/core/src/core/org/jnode/vm/compiler/ir/StackVariable.java trunk/core/src/core/org/jnode/vm/compiler/ir/Variable.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/AssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryOperation.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BinaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchCondition.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/BranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/ConstantRefAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/PhiAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/Quad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryOperation.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnaryQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/UnconditionalBranchQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VarReturnQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VariableRefAssignQuad.java trunk/core/src/core/org/jnode/vm/compiler/ir/quad/VoidReturnQuad.java trunk/core/src/core/org/jnode/vm/facade/GCStatistics.java trunk/core/src/core/org/jnode/vm/facade/HeapStatistics.java trunk/core/src/core/org/jnode/vm/facade/MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/facade/NoObjectFilter.java trunk/core/src/core/org/jnode/vm/facade/ObjectFilter.java trunk/core/src/core/org/jnode/vm/facade/ObjectVisitor.java trunk/core/src/core/org/jnode/vm/facade/SimpleObjectFilter.java trunk/core/src/core/org/jnode/vm/facade/TypeSizeInfo.java trunk/core/src/core/org/jnode/vm/facade/Vm.java trunk/core/src/core/org/jnode/vm/facade/VmArchitecture.java trunk/core/src/core/org/jnode/vm/facade/VmHeapManager.java trunk/core/src/core/org/jnode/vm/facade/VmProcessor.java trunk/core/src/core/org/jnode/vm/facade/VmThread.java trunk/core/src/core/org/jnode/vm/facade/VmThreadVisitor.java trunk/core/src/core/org/jnode/vm/facade/VmUtils.java trunk/core/src/core/org/jnode/vm/facade/VmWriteBarrier.java trunk/core/src/core/org/jnode/vm/isolate/DataLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/IsolateLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/IsolateStatusImpl.java trunk/core/src/core/org/jnode/vm/isolate/IsolateThread.java trunk/core/src/core/org/jnode/vm/isolate/IsolateThreadFactory.java trunk/core/src/core/org/jnode/vm/isolate/LinkImpl.java trunk/core/src/core/org/jnode/vm/isolate/LinkLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/LinkMessageFactory.java trunk/core/src/core/org/jnode/vm/isolate/LinkMessageImpl.java trunk/core/src/core/org/jnode/vm/isolate/ObjectLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/StatusLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/StringLinkMessage.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolateLocal.java trunk/core/src/core/org/jnode/vm/isolate/VmLink.java trunk/core/src/core/org/jnode/vm/isolate/VmStreamBindings.java trunk/core/src/core/org/jnode/vm/memmgr/HeapHelper.java trunk/core/src/core/org/jnode/vm/memmgr/VmHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefGCStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultHeapManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/DefaultWriteBarrier.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerThread.java trunk/core/src/core/org/jnode/vm/memmgr/def/FinalizerVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCManager.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCMarkVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSetWhiteVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCStack.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCSweepVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCThread.java trunk/core/src/core/org/jnode/vm/memmgr/def/GCVerifyVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/HeapStatisticsVisitor.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmAbstractHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmBootHeap.java trunk/core/src/core/org/jnode/vm/memmgr/def/VmDefaultHeap.java trunk/core/src/core/org/jnode/vm/objects/BootableArrayList.java trunk/core/src/core/org/jnode/vm/objects/BootableHashMap.java trunk/core/src/core/org/jnode/vm/objects/BootableObject.java trunk/core/src/core/org/jnode/vm/objects/Counter.java trunk/core/src/core/org/jnode/vm/objects/CounterGroup.java trunk/core/src/core/org/jnode/vm/objects/Statistic.java trunk/core/src/core/org/jnode/vm/objects/Statistics.java trunk/core/src/core/org/jnode/vm/objects/SynchronizedCounter.java trunk/core/src/core/org/jnode/vm/objects/VmSystemObject.java trunk/core/src/core/org/jnode/vm/performance/PerformanceCounterEvent.java trunk/core/src/core/org/jnode/vm/performance/PerformanceCounters.java trunk/core/src/core/org/jnode/vm/performance/PresetEvent.java trunk/core/src/core/org/jnode/vm/scheduler/IRQManager.java trunk/core/src/core/org/jnode/vm/scheduler/IRQThread.java trunk/core/src/core/org/jnode/vm/scheduler/IdleThread.java trunk/core/src/core/org/jnode/vm/scheduler/KernelDebugger.java trunk/core/src/core/org/jnode/vm/scheduler/Monitor.java trunk/core/src/core/org/jnode/vm/scheduler/MonitorManager.java trunk/core/src/core/org/jnode/vm/scheduler/ProcessorLock.java trunk/core/src/core/org/jnode/vm/scheduler/SpinLock.java trunk/core/src/core/org/jnode/vm/scheduler/SystemThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmProcessor.java trunk/core/src/core/org/jnode/vm/scheduler/VmScheduler.java trunk/core/src/core/org/jnode/vm/scheduler/VmThread.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueue.java trunk/core/src/core/org/jnode/vm/scheduler/VmThreadQueueEntry.java trunk/core/src/core/org/jnode/vm/x86/GDT.java trunk/core/src/core/org/jnode/vm/x86/IOAPIC.java trunk/core/src/core/org/jnode/vm/x86/IOAPICRedirectionEntry.java trunk/core/src/core/org/jnode/vm/x86/LocalAPIC.java trunk/core/src/core/org/jnode/vm/x86/MMXMultiMediaSupport.java trunk/core/src/core/org/jnode/vm/x86/MPBusEntry.java trunk/core/src/core/org/jnode/vm/x86/MPConfigTable.java trunk/core/src/core/org/jnode/vm/x86/MPEntry.java trunk/core/src/core/org/jnode/vm/x86/MPFloatingPointerStructure.java trunk/core/src/core/org/jnode/vm/x86/MPIOAPICEntry.java trunk/core/src/core/org/jnode/vm/x86/MPIOInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPLocalInterruptAssignmentEntry.java trunk/core/src/core/org/jnode/vm/x86/MPProcessorEntry.java trunk/core/src/core/org/jnode/vm/x86/MSR.java trunk/core/src/core/org/jnode/vm/x86/PIC8259A.java trunk/core/src/core/org/jnode/vm/x86/TSS32.java trunk/core/src/core/org/jnode/vm/x86/UnsafeX86.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Architecture64.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Processor64.java trunk/core/src/core/org/jnode/vm/x86/VmX86StackReader.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread32.java trunk/core/src/core/org/jnode/vm/x86/VmX86Thread64.java trunk/core/src/core/org/jnode/vm/x86/X86Cpu.java trunk/core/src/core/org/jnode/vm/x86/X86CpuID.java trunk/core/src/core/org/jnode/vm/x86/X86IRQManager.java trunk/core/src/core/org/jnode/vm/x86/X86MemoryMapEntry.java trunk/core/src/core/org/jnode/vm/x86/X86Vendor.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompiledIMT.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerConstants.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java trunk/core/src/core/org/jnode/vm/x86/compiler/X86JumpTable.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/RegisterVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86Level1ACompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/DoubleWordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/EmitterContext.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerFPU.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPCompilerSSE.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPUHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FPUStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/FloatItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/InlinedMethodInfo.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/IntItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/Item.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemFactory.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/ItemVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/L1AHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/LongItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/MagicHelper.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RefItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/RegisterVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/VirtualStack.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/WordItem.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86GCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86Level1BCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86StackFrame.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/GenericX86CodeGenerator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/X86CodeGenerator.java trunk/core/src/core/org/jnode/vm/x86/compiler/l2/X86RegisterPool.java trunk/core/src/core/org/jnode/vm/x86/compiler/stub/EmptyGCMapIterator.java trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java trunk/core/src/core/org/jnode/vm/x86/performance/Athlon64PerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/DualMSRPerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/P4FamilyPerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/P6PerformanceCouters.java trunk/core/src/core/org/jnode/vm/x86/performance/Pentium4PerformanceCounters.java trunk/core/src/core/org/jnode/vm/x86/performance/X86PerformanceCounters.java trunk/core/src/core/org/jnode/work/Work.java trunk/core/src/core/org/jnode/work/WorkManager.java trunk/core/src/core/org/jnode/work/WorkPlugin.java trunk/core/src/core/org/jnode/work/WorkUtils.java trunk/core/src/driver/org/jnode/driver/AbstractDeviceManager.java trunk/core/src/driver/org/jnode/driver/ApiNotFoundException.java trunk/core/src/driver/org/jnode/driver/Bus.java trunk/core/src/driver/org/jnode/driver/DefaultDeviceManager.java trunk/core/src/driver/org/jnode/driver/Device.java trunk/core/src/driver/org/jnode/driver/DeviceAPI.java trunk/core/src/driver/org/jnode/driver/DeviceAlreadyConnectedException.java trunk/core/src/driver/org/jnode/driver/DeviceAlreadyRegisteredException.java trunk/core/src/driver/org/jnode/driver/DeviceException.java trunk/core/src/driver/org/jnode/driver/DeviceFinder.java trunk/core/src/driver/org/jnode/driver/DeviceFinderPlugin.java trunk/core/src/driver/org/jnode/driver/DeviceInfoAPI.java trunk/core/src/driver/org/jnode/driver/DeviceListener.java trunk/core/src/driver/org/jnode/driver/DeviceManager.java trunk/core/src/driver/org/jnode/driver/DeviceManagerListener.java trunk/core/src/driver/org/jnode/driver/DeviceNotFoundException.java trunk/core/src/driver/org/jnode/driver/DeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/DeviceUtils.java trunk/core/src/driver/org/jnode/driver/Driver.java trunk/core/src/driver/org/jnode/driver/DriverException.java trunk/core/src/driver/org/jnode/driver/DriverPermission.java trunk/core/src/driver/org/jnode/driver/DriverPlugin.java trunk/core/src/driver/org/jnode/driver/InvalidDriverException.java trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireBus.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireDevice.java trunk/core/src/driver/org/jnode/driver/bus/firewire/FireWireDriver.java trunk/core/src/driver/org/jnode/driver/bus/pci/AGPCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/AbstractPCIDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/Capability.java trunk/core/src/driver/org/jnode/driver/bus/pci/CompactHotSwapCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/DeviceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/pci/MSICapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBaseAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBus.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIBusAPI.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIClassToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIConstants.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDescriptors.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDevice.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceConfig.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIException.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIFinder.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType0.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType1.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIHeaderType2.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCIRomAddress.java trunk/core/src/driver/org/jnode/driver/bus/pci/PCI_IDs.java trunk/core/src/driver/org/jnode/driver/bus/pci/PMCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/SlotIDCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/VPDCapability.java trunk/core/src/driver/org/jnode/driver/bus/pci/VendorDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusBus.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDevice.java trunk/core/src/driver/org/jnode/driver/bus/pcmcia/CardBusDriver.java trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMM.java trunk/core/src/driver/org/jnode/driver/bus/smbus/DIMMDriver.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBus.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBusControler.java trunk/core/src/driver/org/jnode/driver/bus/smbus/SMBusDevice.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractDeviceItem.java trunk/core/src/driver/org/jnode/driver/bus/usb/AbstractHostControllerDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/ConfigurationDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/DeviceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/EndPointDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/InterfaceDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/SetupPacket.java trunk/core/src/driver/org/jnode/driver/bus/usb/StringDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/StringDescriptorZero.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBBus.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBConfiguration.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBControlPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBDataPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBDevice.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBEndPoint.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBException.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHostControllerAPI.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHubAPI.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBHubMonitor.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBInterface.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPacket.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBPipeListener.java trunk/core/src/driver/org/jnode/driver/bus/usb/USBRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/HubDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/PortStatus.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubDeviceToDriverMapper.java trunk/core/src/driver/org/jnode/driver/bus/usb/hub/USBHubDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBControlRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBDataRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/spi/AbstractUSBRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/AbstractStructure.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/AbstractTreeStructure.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/FrameList.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/QueueHead.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/Schedule.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/TransferDescriptor.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIConstants.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIControlPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIControlRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCICore.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDataPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDataRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIDriver.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIIO.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipe.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIPipeManager.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIRequest.java trunk/core/src/driver/org/jnode/driver/bus/usb/uhci/UHCIRootHub.java trunk/core/src/driver/org/jnode/driver/character/ChannelAlreadyOwnedException.java trunk/core/src/... [truncated message content] |
From: <ls...@us...> - 2012-07-09 08:15:51
|
Revision: 5900 http://jnode.svn.sourceforge.net/jnode/?rev=5900&view=rev Author: lsantha Date: 2012-07-09 08:15:39 +0000 (Mon, 09 Jul 2012) Log Message: ----------- Applied patch by Francisco Rafael Del Roio: license files related to libraries used by JNode. They are included in the CD too. Modified Paths: -------------- trunk/all/build-x86.xml Added Paths: ----------- trunk/licenses/ trunk/licenses/Apache-1.1 trunk/licenses/Apache-2.0 trunk/licenses/BSD trunk/licenses/GPL-2 trunk/licenses/GPL-3 trunk/licenses/JSCH-0.1-License trunk/licenses/LGPL-2.1 trunk/licenses/LGPL-3 Modified: trunk/all/build-x86.xml =================================================================== --- trunk/all/build-x86.xml 2012-06-04 09:05:31 UTC (rev 5899) +++ trunk/all/build-x86.xml 2012-07-09 08:15:39 UTC (rev 5900) @@ -267,12 +267,16 @@ <attribute name="destfile" /> <sequential> <mkdir dir="@{dir}/boot/grub" /> + <mkdir dir="@{dir}/licenses" /> <copy todir="@{dir}"> <fileset dir="${jnode.kernel.dir}" includes="jnode*.gz"/> </copy> <copy todir="@{dir}"> <fileset dir="${initjars.dir}" /> </copy> + <copy todir="@{dir}/licenses"> + <fileset dir="${root.dir}/licenses"/> + </copy> <copy file="${my-lib.dir}/eltorito.s2" todir="@{dir}/boot/grub" /> <copy file="${my-lib.dir}/fat.s15" todir="@{dir}/boot/grub" /> <copy file="${my-lib.dir}/grub.s1" todir="@{dir}/boot/grub" /> Added: trunk/licenses/Apache-1.1 =================================================================== --- trunk/licenses/Apache-1.1 (rev 0) +++ trunk/licenses/Apache-1.1 2012-07-09 08:15:39 UTC (rev 5900) @@ -0,0 +1,55 @@ + + +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" and + * "Apache Commons" must not be used to endorse or promote products + * derived from this software without prior written permission. For + * written permission, please contact ap...@ap.... + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without + * prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ Added: trunk/licenses/Apache-2.0 =================================================================== --- trunk/licenses/Apache-2.0 (rev 0) +++ trunk/licenses/Apache-2.0 2012-07-09 08:15:39 UTC (rev 5900) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Added: trunk/licenses/BSD =================================================================== --- trunk/licenses/BSD (rev 0) +++ trunk/licenses/BSD 2012-07-09 08:15:39 UTC (rev 5900) @@ -0,0 +1,27 @@ +BSD License + +Copyright (c) 2000-2006, www.hamcrest.org +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of +conditions and the following disclaimer. Redistributions in binary form must reproduce +the above copyright notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the distribution. + +Neither the name of Hamcrest nor the names of its contributors may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. Added: trunk/licenses/GPL-2 =================================================================== --- trunk/licenses/GPL-2 (rev 0) +++ trunk/licenses/GPL-2 2012-07-09 08:15:39 UTC (rev 5900) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Added: trunk/licenses/GPL-3 =================================================================== --- trunk/licenses/GPL-3 (rev 0) +++ trunk/licenses/GPL-3 2012-07-09 08:15:39 UTC (rev 5900) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferrin... [truncated message content] |