From: <cr...@us...> - 2009-05-03 12:18:26
|
Revision: 5393 http://jnode.svn.sourceforge.net/jnode/?rev=5393&view=rev Author: crawley Date: 2009-05-03 12:17:04 +0000 (Sun, 03 May 2009) Log Message: ----------- Tidying up tests that have moved Modified Paths: -------------- trunk/cli/build-tests.xml trunk/shell/src/test/org/jnode/test/shell/all-tests.xml Removed Paths: ------------- trunk/shell/src/test/org/jnode/test/shell/command/ Modified: trunk/cli/build-tests.xml =================================================================== --- trunk/cli/build-tests.xml 2009-05-03 11:55:49 UTC (rev 5392) +++ trunk/cli/build-tests.xml 2009-05-03 12:17:04 UTC (rev 5393) @@ -1,11 +1,11 @@ -<project name="JNode-Shell-Tests" default="all" basedir="."> +<project name="JNode-CLI-Tests" default="all" basedir="."> <import file="${basedir}/../all/build.xml"/> <target name="help" description="output target descriptions"> <echo> The main targets (tests) for this build are as follows: -all Runs all tests for this project +all Runs all tests for the 'cli' project help Output these messages </echo> </target> Modified: trunk/shell/src/test/org/jnode/test/shell/all-tests.xml =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/all-tests.xml 2009-05-03 11:55:49 UTC (rev 5392) +++ trunk/shell/src/test/org/jnode/test/shell/all-tests.xml 2009-05-03 12:17:04 UTC (rev 5393) @@ -1,8 +1,4 @@ <testSet title="All shell tests"> <include setName="bjorne/bjorne-shell-tests.xml"/> <include setName="bjorne/bjorne-builtin-tests.xml"/> -<!-- <include setName="command/posix/posix-command-tests.xml"/>--> -<!-- <include setName="command/posix/basename-command-tests.xml"/>--> -<!-- <include setName="command/posix/dirname-command-tests.xml"/>--> -<!-- <include setName="command/posix/wc-command-tests.xml"/>--> </testSet> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-05-05 14:12:52
|
Revision: 5410 http://jnode.svn.sourceforge.net/jnode/?rev=5410&view=rev Author: crawley Date: 2009-05-05 14:12:11 +0000 (Tue, 05 May 2009) Log Message: ----------- The isolate invoker now passes the 'environment' to the isolate that runs the command. Modified Paths: -------------- trunk/core/src/openjdk/vm/java/lang/NativeProcessEnvironment.java trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandInvoker.java trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandLauncher.java trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandThreadImpl.java Modified: trunk/core/src/openjdk/vm/java/lang/NativeProcessEnvironment.java =================================================================== --- trunk/core/src/openjdk/vm/java/lang/NativeProcessEnvironment.java 2009-05-04 16:54:44 UTC (rev 5409) +++ trunk/core/src/openjdk/vm/java/lang/NativeProcessEnvironment.java 2009-05-05 14:12:11 UTC (rev 5410) @@ -22,29 +22,79 @@ import org.jnode.vm.VmSystem; import org.jnode.vm.VmIOContext; + import java.util.Map; /** + * This class implements the native methods defined in ProcessEnvironment. + * * @see java.lang.ProcessEnvironment */ -class NativeProcessEnvironment { +public class NativeProcessEnvironment { + // This is the initial environment encoded in a format that matches + // the expectations of the ProcessEnvironment static initializer. + private static byte[][] isolateInitialEnv; + /** + * Set the 'binary' environment that will be returned by {@link #environ()}. + * This can only be done once, and only + * + * @param env + */ + public static void setIsolateInitialEnv(byte[][] env) { + if (isolateInitialEnv != null) { + throw new IllegalStateException("isolate initial env already set"); + } + isolateInitialEnv = env; + } + + /** + * This method gets called just once (per isolate) by the static initializer + * for ProcessEnvironment. It returns the bootstrap environment to be for + * the current isolate, or an empty bootstrap environment if none has been + * provided. + * * @see java.lang.ProcessEnvironment#environ() */ + @SuppressWarnings("unused") private static byte[][] environ() { - //todo implement it - //throw new UnsupportedOperationException(); - return new byte[0][]; + if (isolateInitialEnv == null) { + isolateInitialEnv = new byte[0][]; + } + return isolateInitialEnv; } + /** + * Fetch a named environment variable from the 'current' context + * via the IOContext switch + * + * @param name + * @return + */ + @SuppressWarnings("unused") private static String getenv(String name) { return VmSystem.getIOContext().getEnv().get(name); } + /** + * Fetch the environment map from the 'current' context + * via the IOContext switch + * + * @param name + * @return + */ + @SuppressWarnings("unused") private static Map<String,String> getenv() { return VmSystem.getIOContext().getEnv(); } + /** + * Set the global (to the isolate) environment map. + * + * @param name + * @return + */ + @SuppressWarnings("unused") private static void setGlobalEnv0(Map<String,String> env) { VmIOContext.setGlobalEnv(env); } Modified: trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandInvoker.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandInvoker.java 2009-05-04 16:54:44 UTC (rev 5409) +++ trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandInvoker.java 2009-05-05 14:12:11 UTC (rev 5410) @@ -21,12 +21,18 @@ package org.jnode.shell.isolate; import java.io.IOException; +import java.util.Map; +import java.util.Properties; import org.jnode.shell.AsyncCommandInvoker; +import org.jnode.shell.CommandInfo; +import org.jnode.shell.CommandInvoker; +import org.jnode.shell.CommandLine; import org.jnode.shell.CommandRunner; import org.jnode.shell.CommandShell; import org.jnode.shell.CommandThread; import org.jnode.shell.CommandThreadImpl; +import org.jnode.shell.ShellException; import org.jnode.shell.ShellInvocationException; import org.jnode.shell.SimpleCommandInvoker; @@ -35,7 +41,7 @@ * * @author cr...@jn... */ -public class IsolateCommandInvoker extends AsyncCommandInvoker { +public class IsolateCommandInvoker extends AsyncCommandInvoker implements CommandInvoker { public static final Factory FACTORY = new Factory() { public SimpleCommandInvoker create(CommandShell shell) { @@ -56,6 +62,20 @@ return "isolate"; } + public int invoke(CommandLine cmdLine, CommandInfo cmdInfo, + Properties sysProps, Map<String, String> env) + throws ShellException { + CommandRunner cr = setup(cmdLine, cmdInfo, sysProps, env); + return runIt(cmdLine, cmdInfo, cr); + } + + public CommandThread invokeAsynchronous(CommandLine cmdLine, CommandInfo cmdInfo, + Properties sysProps, Map<String, String> env) + throws ShellException { + CommandRunner cr = setup(cmdLine, cmdInfo, sysProps, env); + return forkIt(cmdLine, cmdInfo, cr); + } + @Override protected CommandThread createThread(CommandRunner cr) throws ShellInvocationException { Modified: trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandLauncher.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandLauncher.java 2009-05-04 16:54:44 UTC (rev 5409) +++ trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandLauncher.java 2009-05-05 14:12:11 UTC (rev 5410) @@ -20,15 +20,28 @@ package org.jnode.shell.isolate; +import java.util.Map; + import javax.isolate.Isolate; import javax.isolate.Link; import org.jnode.shell.CommandRunner; +import org.jnode.vm.Unsafe; import org.jnode.vm.isolate.ObjectLinkMessage; +/** + * This is the class that the isolate invoker uses to launch the user's + * command in the new isolate. + * + * @author cr...@jn... + */ public class IsolateCommandLauncher { /** + * The entry point that used to run the 'application' when the isolate is + * started. The actual command is then passed to us in a Link message + * in the form of a CommandRunner object. + * * @param args */ public static void main(String[] args) { @@ -37,8 +50,19 @@ try { ObjectLinkMessage message = (ObjectLinkMessage) cl.receive(); cr = (CommandRunner) message.extract(); + Map<String, String> env = cr.getEnv(); + int envSize = (env == null) ? 0 : env.size(); + byte[][] binEnv = new byte[envSize * 2][]; + if (envSize > 0) { + int i = 0; + for (Map.Entry<String, String> entry : env.entrySet()) { + binEnv[i++] = entry.getKey().getBytes(); + binEnv[i++] = entry.getValue().getBytes(); + } + } + NativeProcessEnvironment.setIsolateInitialEnv(binEnv); } catch (Exception e) { - e.printStackTrace(); + Unsafe.debugStackTrace(e.getMessage(), e); return; } cr.run(); Modified: trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandThreadImpl.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandThreadImpl.java 2009-05-04 16:54:44 UTC (rev 5409) +++ trunk/shell/src/shell/org/jnode/shell/isolate/IsolateCommandThreadImpl.java 2009-05-05 14:12:11 UTC (rev 5410) @@ -50,6 +50,8 @@ /** * This class implements the CommandThread API for running commands in a new isolates. + * It takes care of assembling the Stream bindings for the new isolate, creating it + * and passing it the CommandRunner that holds the command class and arguments. * * @author cr...@jn... */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-05-05 21:22:26
|
Revision: 5428 http://jnode.svn.sourceforge.net/jnode/?rev=5428&view=rev Author: chrisboertien Date: 2009-05-05 21:22:20 +0000 (Tue, 05 May 2009) Log Message: ----------- Unix 'cut' command Signed-off-by: chrisboertien <chr...@gm...> Modified Paths: -------------- trunk/all/conf/default-plugin-list.xml trunk/cli/descriptors/org.jnode.command.file.xml trunk/cli/src/commands/org/jnode/command/util/IOUtils.java Added Paths: ----------- trunk/cli/src/commands/org/jnode/command/file/CutCommand.java Modified: trunk/all/conf/default-plugin-list.xml =================================================================== --- trunk/all/conf/default-plugin-list.xml 2009-05-05 21:20:25 UTC (rev 5427) +++ trunk/all/conf/default-plugin-list.xml 2009-05-05 21:22:20 UTC (rev 5428) @@ -50,6 +50,7 @@ <plugin id="org.jnode.awt.swingpeers"/> <plugin id="org.apache.tools.archive" /> + <plugin id="org.jnode.command.argument"/> <plugin id="org.jnode.command.archive"/> <plugin id="org.jnode.command.common"/> <plugin id="org.jnode.command.dev"/> Modified: trunk/cli/descriptors/org.jnode.command.file.xml =================================================================== --- trunk/cli/descriptors/org.jnode.command.file.xml 2009-05-05 21:20:25 UTC (rev 5427) +++ trunk/cli/descriptors/org.jnode.command.file.xml 2009-05-05 21:22:20 UTC (rev 5428) @@ -8,6 +8,7 @@ license-name="lgpl"> <requires> + <import plugin="org.jnode.command.argument"/> <import plugin="org.jnode.command.util"/> <import plugin="org.jnode.driver"/> <import plugin="org.jnode.fs"/> @@ -26,6 +27,7 @@ <alias name="cat" class="org.jnode.command.file.CatCommand"/> <alias name="cd" class="org.jnode.command.file.CdCommand" internal="yes"/> <alias name="cp" class="org.jnode.command.file.CpCommand"/> + <alias name="cut" class="org.jnode.command.file.CutCommand"/> <alias name="del" class="org.jnode.command.file.DeleteCommand"/> <alias name="df" class="org.jnode.command.file.DFCommand"/> <alias name="dir" class="org.jnode.command.file.DirCommand"/> @@ -85,6 +87,22 @@ <argument argLabel="target"/> </sequence> </syntax> + <syntax alias="cut"> + <sequence description="select parts of lines"> + <optionSet> + <option argLabel="byte-range" shortName="b" longName="bytes" /> + <option argLabel="char-range" shortName="c" longName="characters"/> + <option argLabel="field-range" shortName="f" longName="fields"/> + <option argLabel="in-delim" shortName="d" longName="delimiter"/> + <option argLabel="suppress" shortName="s" longName="only-delimited"/> + <option argLabel="complement" longName="complement"/> + <option argLabel="out-delim" longName="output-delimiter"/> + </optionSet> + <repeat> + <argument argLabel="files"/> + </repeat> + </sequence> + </syntax> <syntax alias="del"> <sequence description="delete files and directories"> <optionSet> Added: trunk/cli/src/commands/org/jnode/command/file/CutCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/CutCommand.java (rev 0) +++ trunk/cli/src/commands/org/jnode/command/file/CutCommand.java 2009-05-05 21:22:20 UTC (rev 5428) @@ -0,0 +1,248 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2009 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.command.file; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +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; +import org.jnode.shell.AbstractCommand; +import org.jnode.shell.syntax.FileArgument; +import org.jnode.shell.syntax.FlagArgument; +import org.jnode.shell.syntax.StringArgument; + +/** + * Unix `cut` command + * + * TODO add --complement to select byte/chars/fields that are *not* within the given ranges + * TODO make byte-ranges multi-byte character friendly + * @author chris boertien + */ +public class CutCommand extends AbstractCommand { + + private static final String help_byte = "Select only the listed bytes"; + private static final String help_char = "Select only the listed chars"; + private static final String help_field = "Select only the listed fields"; + private static final String help_in_delim = "Use this for the delimeter instead of TAB"; + private static final String help_out_delim = "Replace the input delimeter with this in the output"; + private static final String help_files = "The files to operate on, or stdin if none are given"; + private static final String help_suppress = "Do not output lines that do not contain a delimeter character"; + private static final String help_complement = "Complement the set of selected bytes, chars or fields"; + private static final String help_super = "Remove ranges of bytes, chars, or fields from input lines"; + private static final String err_delim = "An delimeter may only be present when operating on fields."; + private static final String err_multi_mode = "Only one type of list may be specified"; + private static final String err_no_mode = "Must select either a byte, char or field range"; + private static final String err_suppress = "Suppression only makes sense when using fields"; + private static final String fmt_err = "cut: %s%n"; + + private static enum Mode { + BYTE, CHAR, FIELD; + } + + private final NumberListArgument argByteRange; + private final NumberListArgument argCharRange; + private final NumberListArgument argFieldRange; + private final StringArgument argInDelim; + private final StringArgument argOutDelim; + private final FileArgument argFiles; + private final FlagArgument argSuppress; + private final FlagArgument argComplement; + + private PrintWriter err; + private BufferedWriter out; + private File[] files; + private Mode mode; + private NumberRange[] list; + private String inDelim; + private String outDelim; + private boolean suppress; + private boolean complement; + + public CutCommand() { + super(help_super); + argByteRange = new NumberListArgument("byte-range", 0, 1, Integer.MAX_VALUE - 1, help_byte); + argCharRange = new NumberListArgument("char-range", 0, 1, Integer.MAX_VALUE - 1, help_char); + argFieldRange = new NumberListArgument("field-range", 0, 1, Integer.MAX_VALUE - 1, help_field); + argInDelim = new StringArgument("in-delim", 0, help_in_delim); + argOutDelim = new StringArgument("out-delim", 0, help_out_delim); + argFiles = new FileArgument("files", 0, help_files); + argSuppress = new FlagArgument("suppress", 0, help_suppress); + argComplement = new FlagArgument("complement", 0, help_complement); + registerArguments(argByteRange, argCharRange, argFieldRange, argInDelim, argOutDelim, argFiles); + registerArguments(argSuppress, argComplement); + } + + public void execute() { + err = getError().getPrintWriter(); + out = new BufferedWriter(getOutput().getPrintWriter()); + parseOptions(); + + BufferedReader reader; + List<String> lines; + + for (File file : files) { + if (file.getName().equals("-")) { + reader = new BufferedReader(getInput().getReader()); + } else { + reader = IOUtils.openBufferedReader(file); + } + try { + lines = IOUtils.readLines(reader); + } finally { + IOUtils.close(reader); + } + try { + if (mode == Mode.BYTE) { + cutBytes(lines); + } else if (mode == Mode.CHAR) { + cutChars(lines); + } else if (mode == Mode.FIELD) { + cutFields(lines); + } + } catch (IOException e) { + + } finally { + IOUtils.flush(out); + } + } + } + + private void cutBytes(List<String> lines) throws IOException { + // FIXME + // In the case of single-byte characters, this is the right + // path to take, but if characters are multi-byte, then there + // is supposed to be aligning done to make sure a byte-range + // does not fall in the middle of a character. + cutChars(lines); + } + + private void cutChars(List<String> lines) throws IOException { + int limit, start, end; + for (String line : lines) { + limit = line.length(); + for (NumberRange range : list) { + start = Math.min(limit, range.start()); + end = Math.min(limit, range.end()); + if (start == limit) break; + out.write(line.substring(start - 1, end)); + } + out.newLine(); + } + } + + private void cutFields(List<String> lines) throws IOException { + boolean first; + int limit, start, end; + for (String line : lines) { + if (line.indexOf(inDelim) == -1) { + if (!suppress) { + out.write(line); + out.newLine(); + } + continue; + } + String[] fields = line.split(inDelim); + if (fields == null || fields.length == 0) { + out.newLine(); + continue; + } + + first = true; + limit = fields.length; + for (NumberRange range : list) { + start = Math.min(limit, range.start()); + end = Math.min(limit, range.end()); + if (start == limit) break; + for (int i = start - 1; i < end; i++) { + if (!first) { + out.write(outDelim); + } + first = false; + out.write(fields[i]); + } + } + out.newLine(); + } + } + + private void parseOptions() { + if (argByteRange.isSet()) { + mode = Mode.BYTE; + list = argByteRange.getValues(); + } + if (argCharRange.isSet()) { + if (mode != null) { + error(err_multi_mode); + } + mode = Mode.CHAR; + list = argCharRange.getValues(); + } + if (argFieldRange.isSet()) { + if (mode != null) { + error(err_multi_mode); + } + mode = Mode.FIELD; + list = argFieldRange.getValues(); + } + if (mode == null) { + error(err_no_mode); + } + if (argInDelim.isSet()) { + if (mode != Mode.FIELD) { + error(err_delim); + } + inDelim = argInDelim.getValue(); + } else { + inDelim = "\t"; + } + if (argOutDelim.isSet()) { + if (mode != Mode.FIELD) { + error(err_delim); + } + outDelim = argOutDelim.getValue(); + } else { + outDelim = inDelim; + } + if (argSuppress.isSet()) { + if (mode != Mode.FIELD) { + error(err_suppress); + } + suppress = true; + } + complement = argComplement.isSet(); + if (argFiles.isSet()) { + files = argFiles.getValues(); + } else { + files = new File[] {new File("-")}; + } + } + + private void error(String s) { + err.format(fmt_err, s); + exit(1); + } +} Modified: trunk/cli/src/commands/org/jnode/command/util/IOUtils.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/util/IOUtils.java 2009-05-05 21:20:25 UTC (rev 5427) +++ trunk/cli/src/commands/org/jnode/command/util/IOUtils.java 2009-05-05 21:22:20 UTC (rev 5428) @@ -100,6 +100,27 @@ } /** + * Call the flush method of a list of Flushable objects. + * + * This method will not throw a NullPointerException if any of the objects are null. + * + * This method will trap the IOException from flush. + * + * @param objs one or more Flushable objects + */ + public static void flush(Flushable... objs) { + for (Flushable obj : objs) { + if (obj != null) { + try { + obj.flush(); + } catch (IOException e) { + // ignore + } + } + } + } + + /** * Copies data from an Inputstream to an OutputStream. * * This method allocates a 4096 byte buffer each time it is called. @@ -245,6 +266,20 @@ /** * Opens a BufferedReader on a file. + * + * This method will not throw a FileNotFoundException like the FileReader + * constructor would. + * + * @param file the file to open the reader on + * @return the reader, or null if the file could not be opened + * @throws NullPointerException if file is null + */ + public static BufferedReader openBufferedReader(File file) { + return openBufferedReader(file, BUFFER_SIZE); + } + + /** + * Opens a BufferedReader on a file. * * This method will not throw a FileNotFoundException like the FileReader * constructor would. @@ -505,6 +540,7 @@ * @throws NullPointerException if reader is null */ public static List<String> readLines(BufferedReader reader, int max) { + checkNull(reader); List<String> ret = new LinkedList<String>(); String line; int count = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-05-11 20:26:55
|
Revision: 5479 http://jnode.svn.sourceforge.net/jnode/?rev=5479&view=rev Author: chrisboertien Date: 2009-05-11 20:26:47 +0000 (Mon, 11 May 2009) Log Message: ----------- checkstyle fix Signed-off-by: chrisboertien <chr...@gm...> Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java trunk/cli/src/commands/org/jnode/command/file/CutCommand.java trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml trunk/shell/src/shell/org/jnode/shell/CommandInfo.java trunk/shell/src/shell/org/jnode/shell/syntax/ArgumentSpecLoader.java Modified: trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java 2009-05-11 19:59:41 UTC (rev 5478) +++ trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java 2009-05-11 20:26:47 UTC (rev 5479) @@ -22,10 +22,9 @@ import java.util.Arrays; import java.util.Collections; -import java.util.List; import org.jnode.command.util.NumberRange; -import org.jnode.driver.console.CompletionInfo; +//import org.jnode.driver.console.CompletionInfo; import org.jnode.shell.CommandLine.Token; import org.jnode.shell.syntax.CommandSyntaxException; import org.jnode.shell.syntax.Argument; @@ -95,7 +94,7 @@ i++; } } - for (int i = 0; i < (ranges.length - 1); i++ ) { + for (int i = 0; i < (ranges.length - 1); i++) { values.add(ranges[i]); } return ranges[ranges.length - 1]; @@ -125,7 +124,7 @@ private NumberRange[] parseList(String text) throws CommandSyntaxException { int delimPos = text.indexOf(listDelim); if (delimPos == -1) { - return new NumberRange[] { parseRange(text) }; + return new NumberRange[] {parseRange(text)}; } else { String[] rangesText = text.split(listDelim); NumberRange[] ranges = new NumberRange[rangesText.length]; Modified: trunk/cli/src/commands/org/jnode/command/file/CutCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/CutCommand.java 2009-05-11 19:59:41 UTC (rev 5478) +++ trunk/cli/src/commands/org/jnode/command/file/CutCommand.java 2009-05-11 20:26:47 UTC (rev 5479) @@ -96,7 +96,7 @@ registerArguments(argSuppress, argComplement); } - public void execute() { + public void execute() throws IOException { err = getError().getPrintWriter(); out = new BufferedWriter(getOutput().getPrintWriter()); parseOptions(); @@ -123,8 +123,6 @@ } else if (mode == Mode.FIELD) { cutFields(lines); } - } catch (IOException e) { - } finally { IOUtils.flush(out); } Modified: trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java 2009-05-11 19:59:41 UTC (rev 5478) +++ trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java 2009-05-11 20:26:47 UTC (rev 5479) @@ -52,13 +52,10 @@ import java.io.Flushable; import java.io.Writer; import java.io.InputStreamReader; -import java.io.OutputStreamWriter; import java.util.ArrayDeque; import java.util.Deque; /** - * TODO check performance of prefixing, probably needs some buffering. - * TODO implement outputting context lines (requires buffering output lines) * TODO implement Fixed/Basic/Ext matchers * TODO implement --color (if/when possible) * @author peda Modified: trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml 2009-05-11 19:59:41 UTC (rev 5478) +++ trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml 2009-05-11 20:26:47 UTC (rev 5479) @@ -2,3 +2,4 @@ <include setName="wc-command-tests.xml"/> <include setName="cut-command-tests.xml"/> </testSet> + Modified: trunk/shell/src/shell/org/jnode/shell/CommandInfo.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/CommandInfo.java 2009-05-11 19:59:41 UTC (rev 5478) +++ trunk/shell/src/shell/org/jnode/shell/CommandInfo.java 2009-05-11 20:26:47 UTC (rev 5479) @@ -21,7 +21,6 @@ package org.jnode.shell; import org.jnode.shell.syntax.ArgumentBundle; -import org.jnode.shell.syntax.CommandSyntaxException; import org.jnode.shell.syntax.SyntaxBundle; /** Modified: trunk/shell/src/shell/org/jnode/shell/syntax/ArgumentSpecLoader.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/ArgumentSpecLoader.java 2009-05-11 19:59:41 UTC (rev 5478) +++ trunk/shell/src/shell/org/jnode/shell/syntax/ArgumentSpecLoader.java 2009-05-11 20:26:47 UTC (rev 5479) @@ -20,9 +20,7 @@ package org.jnode.shell.syntax; import java.lang.reflect.Constructor; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2009-05-13 18:30:01
|
Revision: 5485 http://jnode.svn.sourceforge.net/jnode/?rev=5485&view=rev Author: chrisboertien Date: 2009-05-13 18:29:31 +0000 (Wed, 13 May 2009) Log Message: ----------- Blackbox tests for cat and grep + grep bugfixes Signed-off-by: chrisboertien <chr...@gm...> Modified Paths: -------------- trunk/cli/descriptors/org.jnode.command.file.xml trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml trunk/distr/descriptors/org.jawk.xml Added Paths: ----------- trunk/cli/src/test/org/jnode/test/command/file/cat-command-tests.xml trunk/cli/src/test/org/jnode/test/command/file/grep-command-tests.xml trunk/cli/src/test/org/jnode/test/command/file/grep-context-tests.xml Modified: trunk/cli/descriptors/org.jnode.command.file.xml =================================================================== --- trunk/cli/descriptors/org.jnode.command.file.xml 2009-05-12 03:07:33 UTC (rev 5484) +++ trunk/cli/descriptors/org.jnode.command.file.xml 2009-05-13 18:29:31 UTC (rev 5485) @@ -57,7 +57,7 @@ <option argLabel="squeeze" shortName="s" longName="sqeeze-blank"/> <option argLabel="show-ends" shortName="E" longName="show-ends"/> </optionSet> - <repeat minCount="1"> + <repeat> <argument argLabel="file"/> </repeat> </sequence> Modified: trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java 2009-05-12 03:07:33 UTC (rev 5484) +++ trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java 2009-05-13 18:29:31 UTC (rev 5485) @@ -65,7 +65,7 @@ public class GrepCommand extends AbstractCommand { private static final Logger log = Logger.getLogger(GrepCommand.class); - private static final boolean DEBUG = true; + private static final boolean DEBUG = false; private static final int BUFFER_SIZE = 8192; private static final String help_matcher_fixed = "Patterns are fixed strings, seperated by new lines. Any of " + @@ -234,9 +234,6 @@ contextStack.addLast(doContextLine(contextStack.removeLast())); } if (contextStack.size() > contextBefore) { - if (contextStack.size() > (contextBefore + 1)) { - log.debug("Too many 'before' lines on stack!"); - } contextStack.removeFirst(); } } else { @@ -250,7 +247,7 @@ } contextStack.removeLast(); flush(); - for (int i = 0; i < contextBefore; i++) { + for (int i = contextBefore - 1; i >= 0; i--) { contextStack.addLast(saveLines[i]); } } else { @@ -259,16 +256,6 @@ } contextStack.addLast(line); } else { - if (!haveLine) { - contextStack.clear(); - } else { - int excessLines = contextAfter - (linesForFlush - linesUntilFlush); - if (excessLines > 0) { - for (int i = 0; i < excessLines; i++) { - contextStack.removeLast(); - } - } - } finish(); } return line; @@ -307,7 +294,13 @@ private void finish() { if (reader == null) return; - if (haveLine) { + if (!haveLine) { + contextStack.clear(); + } else { + int excessLines = (linesForFlush - linesUntilFlush) - contextAfter; + for (int i = 0; i < excessLines; i++) { + contextStack.removeLast(); + } flush(); } doFinish(); @@ -527,14 +520,10 @@ try { parseOptions(); if ((contextBefore > 0) || (contextAfter > 0)) { - debug("Using ContextLineWriter"); - debug("Before=" + contextBefore); - debug("After=" + contextAfter); contextOut = new ContextLineWriter(out, contextBefore, contextAfter); } for (File file : files) { - debug("Processing file: " + file); reader = null; name = file.getPath(); try { @@ -554,7 +543,6 @@ } currentFile = name; if (exitOnFirstMatch) { - debug(" exitOnFirstMatch"); if (matchUntilOne(reader)) { rc = 0; break; @@ -562,29 +550,24 @@ continue; } if (showFileMatch) { - debug(" showFileMatch"); if (matchUntilOne(reader)) { printFile(name); } continue; } if (showFileNoMatch) { - debug(" showFileNoMatch"); if (!matchUntilOne(reader)) { printFile(name); } continue; } if (showCount) { - debug(" showCount"); printFileCount(matchCount(reader)); continue; } - debug(" normal"); matchNormal(reader); } catch (IOException e) { error("IOException greping file : " + file); - e.printStackTrace(); } finally { IOUtils.close(reader); } @@ -919,10 +902,6 @@ } } - if ((prefix & (PREFIX_FILE | PREFIX_NOFILE)) == (PREFIX_FILE | PREFIX_NOFILE)) { - throw new AssertionError("PREFIX_NOFILE && PREFIX_FILE"); - } - if (ContextBoth.isSet()) { contextAfter = contextBefore = ContextBoth.getValue(); } else if (ContextBefore.isSet()) { @@ -930,6 +909,9 @@ } else if (ContextAfter.isSet()) { contextAfter = ContextAfter.getValue(); } + if ((contextAfter > 0 || contextBefore > 0) && showOnlyMatch) { + contextAfter = contextBefore = 0; + } } private void parsePatterns() { Modified: trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml 2009-05-12 03:07:33 UTC (rev 5484) +++ trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml 2009-05-13 18:29:31 UTC (rev 5485) @@ -1,8 +1,9 @@ <testSet title="All file command tests"> + <include setName="cat-command-tests.xml"/> <include setName="cut-command-tests.xml"/> + <include setName="grep-command-tests.xml"/> <include setName="head-command-tests.xml"/> <include setName="paste-command-tests.xml"/> <include setName="tail-command-tests.xml"/> <include setName="wc-command-tests.xml"/> </testSet> - Added: trunk/cli/src/test/org/jnode/test/command/file/cat-command-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/file/cat-command-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/file/cat-command-tests.xml 2009-05-13 18:29:31 UTC (rev 5485) @@ -0,0 +1,141 @@ +<testSet title="cat command tests"> + <plugin id="org.jnode.command.file"/> + <plugin id="org.jnode.shell.bjorne" class="org.jnode.test.shell.bjorne.BjornePseudoPlugin"/> + <testSpec title="stdin->stdout" command="cat" runMode="AS_ALIAS" rc="0"> + <input>1234 +</input> + <output>1234 +</output> + </testSpec> + <testSpec title="single-file" command="run" runMode="AS_SCRIPT" rc="0"> + <script>#!bjorne + cat @TEMP_DIR@/a + </script> + <file name="a" input="true">1234 +</file> + <output>1234 +</output> + </testSpec> + <testSpec title="multi-file 1" command="test" runMode="AS_SCRIPT" rc="0"> + <script>#!bjorne + cat @TEMP_DIR@/a @TEMP_DIR@/b + </script> + <file name="a" input="true">1234 +</file> + <file name="b" input="true">5678 +</file> + <output>1234 +5678 +</output> + </testSpec> + <testSpec title="multi-file 2" command="run" runMode="AS_SCRIPT" rc="0"> + <script>#!bjorne + cat @TEMP_DIR@/b @TEMP_DIR@/a + </script> + <file name="a" input="true">1234 +</file> + <file name="b" input="true">5678 +</file> + <output>5678 +1234 +</output> + </testSpec> + <testSpec title="file+stdin" command="cat" runMode="AS_SCRIPT" rc="0"> + <script>#!bjorne + echo "----" | cat @TEMP_DIR@/a - @TEMP_DIR@/b + </script> + <file name="a" input="true">1234 +</file> + <file name="b" input="true">5678 +</file> + <output>1234 +---- +5678 +</output> + </testSpec> + <!-- Non POSIX tests --> + + <testSpec title="show-all-lines" command="cat" runMode="AS_ALIAS" rc="0"> + <arg>-n</arg> + <input>a +b +c +d +</input> + <output> 1 a + 2 b + 3 c + 4 d +</output> + </testSpec> + <testSpec title="show-all-lines squash" command="cat" runMode="AS_ALIAS" rc="0"> + <arg>-ns</arg> + <input>a +b + + +c +d +</input> + <output> 1 a + 2 b + 3 + 4 c + 5 d +</output> + </testSpec> + <testSpec title="show-nonblank-lines" command="cat" runMode="AS_ALIAS" rc="0"> + <arg>-b</arg> + <input>a +b + +c + +d +</input> + <output> 1 a + 2 b + + 3 c + + 4 d +</output> + </testSpec> + <testSpec title="show-nonblank-lines squash" command="cat" runMode="AS_ALIAS" rc="0"> + <arg>-bs</arg> + <input>a + + +b + + +c + + +d +</input> + <output> 1 a + + 2 b + + 3 c + + 4 d +</output> + </testSpec> + <testSpec title="show-ends" command="cat" runMode="AS_ALIAS" rc="0"> + <arg>-E</arg> + <input>1234 + + + + +</input> + <output>1234$ + $ + $ + $ +$ +</output> + </testSpec> +</testSet> Added: trunk/cli/src/test/org/jnode/test/command/file/grep-command-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/file/grep-command-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/file/grep-command-tests.xml 2009-05-13 18:29:31 UTC (rev 5485) @@ -0,0 +1,7 @@ +<testSet title="grep command tests"> + <include setName="grep-context-tests.xml"/> + <!-- TODO + <include setName="grep-prefix-tests.xml"/> + <include setName="grep-match-tests.xml"/> + --> +</testSet> Added: trunk/cli/src/test/org/jnode/test/command/file/grep-context-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/file/grep-context-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/file/grep-context-tests.xml 2009-05-13 18:29:31 UTC (rev 5485) @@ -0,0 +1,379 @@ +<testSet title="grep context line tests"> + <plugin id="org.jnode.command.file"/> + <!-- + Context lines are not part of the POSIX standard. They are an extension + and therefore we don't need to meet a 'standard'. Though we do try to + make the behavior compatible with gnu grep, as it also has this extension. + --> + + <!-- context tests --> + <testSpec title="context-before 1" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-B</arg> + <arg>2</arg> + <arg>foo</arg> + <input>0 +1 +2 +foo +</input> + <output>1 +2 +foo +</output> + </testSpec> + <testSpec title="context-before 2" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-B</arg> + <arg>2</arg> + <arg>foo</arg> + <input>0 +1 +2 +foo +1 +2 +foo +</input> + <output>1 +2 +foo +1 +2 +foo +</output> + </testSpec> + <testSpec title="context-before 3" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-B</arg> + <arg>2</arg> + <arg>foo</arg> + <input>1 +2 +foo +0 +1 +2 +foo +</input> + <output>1 +2 +foo +----- +1 +2 +foo +</output> + </testSpec> + <testSpec title="context-before 4" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-B</arg> + <arg>2</arg> + <arg>foo</arg> + <input>0 +1 +2 +foo +2 +foo +1 +2 +foo +0 +0 +1 +2 +foo +0 +1 +2 +foo +2 +foo +foo +1 +2 +foo +</input> + <output>1 +2 +foo +2 +foo +1 +2 +foo +----- +1 +2 +foo +----- +1 +2 +foo +2 +foo +foo +1 +2 +foo +</output> + </testSpec> + <testSpec title="context-before 5" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-B</arg> + <arg>2</arg> + <arg>foo</arg> + <input>1 +2 +foo +0 +</input> + <output>1 +2 +foo +</output> + </testSpec> + <testSpec title="context-after 1" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-A</arg> + <arg>1</arg> + <arg>foo</arg> + <input>0 +foo +1 +</input> + <output>foo +1 +</output> + </testSpec> + <testSpec title="context-after 2" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-A</arg> + <arg>1</arg> + <arg>foo</arg> + <input>foo +1 +0 +</input> + <output>foo +1 +</output> + </testSpec> + <testSpec title="context-after 3" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-A</arg> + <arg>1</arg> + <arg>foo</arg> + <input>0 +foo +1 +0 +0 +</input> + <output>foo +1 +</output> + </testSpec> + <testSpec title="context-after 4" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-A</arg> + <arg>2</arg> + <arg>foo</arg> + <input>0 +foo +2 +1 +foo +2 +foo +2 +1 +0 +foo +2 +1 +0 +0 +foo +2 +</input> + <output>foo +2 +1 +foo +2 +foo +2 +1 +----- +foo +2 +1 +----- +foo +2 +</output> + </testSpec> + <testSpec title="context-both 1" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-C</arg> + <arg>1</arg> + <arg>foo</arg> + <input>1 +foo +1 +</input> + <output>1 +foo +1 +</output> + </testSpec> + <testSpec title="context-both 2" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-C</arg> + <arg>1</arg> + <arg>foo</arg> + <input>0 +1 +foo +1 +0 +</input> + <output>1 +foo +1 +</output> + </testSpec> + <testSpec title="context-both 3" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-C</arg> + <arg>1</arg> + <arg>foo</arg> + <input>0 +1 +foo +1 +foo +foo +1 +1 +foo +1 +0 +1 +foo +1 +</input> + <output>1 +foo +1 +foo +foo +1 +1 +foo +1 +----- +1 +foo +1 +</output> + </testSpec> + <testSpec title="context-both 4" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-C</arg> + <arg>2</arg> + <arg>foo</arg> + <input>0 +1 +2 +foo +2 +1 +0 +0 +1 +2 +foo +2 +foo +2 +1 +1 +2 +foo +2 +1 +0 +0 +1 +2 +foo +2 +1 +0 +1 +2 +foo +2 +1 +0 +</input> + <output>1 +2 +foo +2 +1 +----- +1 +2 +foo +2 +foo +2 +1 +1 +2 +foo +2 +1 +----- +1 +2 +foo +2 +1 +----- +1 +2 +foo +2 +1 +</output> + </testSpec> + + <!-- context prefix tests --> + + <testSpec title="context-prefix 1" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-C</arg> + <arg>1</arg> + <arg>-H</arg> + <arg>foo</arg> + <input>0 +1 +foo +1 +0 +</input> + <output>stdin-1 +stdin:foo +stdin-1 +</output> + </testSpec> + + <!-- context error tests --> + <!-- + If the -o option is specified, than context line printing should be + disabled. + --> + <testSpec title="context-error 1" command="grep" runMode="AS_ALIAS" rc="0"> + <arg>-C</arg> + <arg>1</arg> + <arg>-o</arg> + <arg>foo</arg> + <input>1 +foo +1 +</input> + <output>foo +</output> + </testSpec> +</testSet> Modified: trunk/distr/descriptors/org.jawk.xml =================================================================== --- trunk/distr/descriptors/org.jawk.xml 2009-05-12 03:07:33 UTC (rev 5484) +++ trunk/distr/descriptors/org.jawk.xml 2009-05-13 18:29:31 UTC (rev 5485) @@ -23,7 +23,7 @@ </requires> <extension point="org.jnode.shell.aliases"> - <alias name="awk" class="org.jawk.JawkCommand"/> + <alias name="awk" class="org.jawk.JawkMain"/> </extension> <extension point="org.jnode.shell.syntaxes"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-05-22 14:57:21
|
Revision: 5501 http://jnode.svn.sourceforge.net/jnode/?rev=5501&view=rev Author: crawley Date: 2009-05-22 14:57:14 +0000 (Fri, 22 May 2009) Log Message: ----------- Fixing compiler warnings and style issues Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/archive/ArchiveCommand.java trunk/cli/src/commands/org/jnode/command/archive/BZip.java trunk/cli/src/commands/org/jnode/command/archive/TarCommand.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/dev/RemoteOutputCommand.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/GrepCommand.java trunk/cli/src/commands/org/jnode/command/file/Md5SumCommand.java trunk/cli/src/commands/org/jnode/command/file/PasteCommand.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/net/ArpCommand.java trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java trunk/shell/src/shell/org/jnode/shell/syntax/ArgumentSpecLoader.java trunk/shell/src/shell/org/jnode/shell/syntax/DefaultSyntaxManager.java trunk/shell/src/shell/org/jnode/shell/syntax/SyntaxManager.java trunk/shell/src/test/org/jnode/test/shell/syntax/TestSyntaxManager.java Modified: trunk/cli/src/commands/org/jnode/command/archive/ArchiveCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/archive/ArchiveCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/archive/ArchiveCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -87,8 +87,6 @@ private byte[] buffer; - private ArchiveCommand() {} - protected ArchiveCommand(String s) { super(s); } Modified: trunk/cli/src/commands/org/jnode/command/archive/BZip.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/archive/BZip.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/archive/BZip.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -40,7 +40,8 @@ * @author chris boertien */ public class BZip extends ArchiveCommand { - + + @SuppressWarnings("unused") private static final boolean DEBUG = false; private static final String help_compress = "forces compression; regardless of invocation name"; @@ -189,6 +190,7 @@ } } + @SuppressWarnings("unused") private void test(File[] files) { // TODO // requires patch to apache ant to have CBZip2InputStream fail with an Modified: trunk/cli/src/commands/org/jnode/command/archive/TarCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/archive/TarCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/archive/TarCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -217,11 +217,13 @@ private static final String help_paths = "files and directories to include in archive"; private static final String help_recurse = "recurse into directories"; private static final String help_remove = "remove files after adding them to the archive"; + @SuppressWarnings("unused") private static final String help_stdout = "extract files to stdout"; private static final String help_suffix = "append <suffix> to backup files (default ~)"; private static final String help_totals = "display total bytes written after creating the archive"; private static final String help_unlink = "when extracting, delete files if they exist. This is the default" + "action and is used to override other options if they were set"; + @SuppressWarnings("unused") private static final String help_verbose = "list files processed"; private static final String help_verify = "verify the archive after writing it"; private static final String help_xfile = "exclude files matching patterns in <file>"; @@ -278,23 +280,30 @@ private final FileArgument Paths = new FileArgument("paths", Argument.OPTIONAL | Argument.MULTIPLE, help_paths); private File archive; + @SuppressWarnings("unused") private File excludeFile; + @SuppressWarnings("unused") private File fileList; private String suffix = "~"; + @SuppressWarnings("unused") private String exclude = ""; private int mode; private int compress; private int decompress; private boolean recurse; + @SuppressWarnings("unused") private boolean pipeInOut; private boolean backup; private boolean bzip; private boolean gzip; + @SuppressWarnings("unused") private boolean interact; private boolean verify; + @SuppressWarnings("unused") private boolean showTotals; private boolean keepOld; private boolean keepNew; + @SuppressWarnings("unused") private boolean unlink; public TarCommand() { @@ -421,10 +430,8 @@ */ private void concat(File[] archives) throws IOException { InputStream in; - OutputStream out; TarInputStream tin; TarOutputStream tout; - File tmpArchive; // Setup archive for appending tout = appendTarOutputStream(); @@ -462,7 +469,6 @@ OutputStream out; TarOutputStream tout = null; TarEntry entry; - File tmpArchive = null; if (mode == TAR_APPEND && archive.exists()) { tout = appendTarOutputStream(); @@ -498,7 +504,7 @@ InputStream in; TarInputStream tin; TarEntry entry; - TreeMap<String, Long> entries = new TreeMap(); + TreeMap<String, Long> entries = new TreeMap<String, Long>(); if ((in = openFileRead(archive)) == null) { fatal(" ", 1); @@ -531,6 +537,7 @@ } // TODO + @SuppressWarnings("unused") private void delete(String[] names) throws IOException { } Modified: trunk/cli/src/commands/org/jnode/command/archive/Zip.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/archive/Zip.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/archive/Zip.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -112,6 +112,7 @@ private static final int ZIP_UPDATE = 0x80; private static final int ZIP_ALL = 0x3F; private static final int ZIP_INSERT = ZIP_ADD | ZIP_MOVE; + @SuppressWarnings("unused") private static final int ZIP_REQ_ARCH = ZIP_ALL & ~ZIP_INSERT; /* Populated in ZipCommand and UnzipCommand */ @@ -230,9 +231,7 @@ } } - @SuppressWarnings("unchecked") private void list() throws IOException { - Enumeration<ZipEntry> entries; int size = 0; int csize = 0; int count = 0; @@ -604,12 +603,14 @@ error(String.format(fmt_warn_dup, str_zip_warn, str_name_repeat, A.getName())); } + @SuppressWarnings("unused") private void printName(String s) { if (outMode != 0) { out(s); } } + @SuppressWarnings("unused") private void debug(ZipEntry entry) { debug("Name: " + entry.getName()); debug("Directory: " + entry.isDirectory()); Modified: trunk/cli/src/commands/org/jnode/command/archive/ZipCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/archive/ZipCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/archive/ZipCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -20,8 +20,6 @@ package org.jnode.command.archive; -//import java.text.DateFormat; -//import java.text.ParseException; import java.util.ArrayList; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FlagArgument; @@ -43,7 +41,9 @@ private static final String help_exclude = "do not includes files matching a pattern"; private static final String help_include = "only includes files matching a pattern"; + @SuppressWarnings("unused") private static final String fatal_bad_newer = "Invalid newer-than date: "; + @SuppressWarnings("unused") private static final String fatal_bad_older = "Invalid older-than date: "; private final FlagArgument FilesStdin; Modified: trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/argument/NumberListArgument.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -21,7 +21,6 @@ package org.jnode.command.argument; import java.util.Arrays; -import java.util.Collections; import org.jnode.command.util.NumberRange; //import org.jnode.driver.console.CompletionInfo; @@ -112,6 +111,7 @@ private static final boolean debug = false; + @SuppressWarnings("unused") private void error(String s) { if (debug) System.err.println(s); } Modified: trunk/cli/src/commands/org/jnode/command/dev/RemoteOutputCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/dev/RemoteOutputCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/dev/RemoteOutputCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -54,6 +54,7 @@ private static final String help_port = "remote port for the receiver"; private static final String help_udp = "if set, use udp, otherwise use tcp"; private static final String help_super = "send data from System.out,System.err and the logger to a remote receiver"; + @SuppressWarnings("unused") private static final String err_capture = "Cannot capture output from the current shell"; private static final String err_connect = "Connection failed: %s%n"; private static final String err_host = "Unknown host: %s%n"; Modified: trunk/cli/src/commands/org/jnode/command/file/CutCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/CutCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/file/CutCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -80,6 +80,7 @@ private String inDelim; private String outDelim; private boolean suppress; + @SuppressWarnings("unused") private boolean complement; public CutCommand() { Modified: trunk/cli/src/commands/org/jnode/command/file/DFCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/DFCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/file/DFCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -83,13 +83,13 @@ private final FlagArgument argBlock1k; private final IntegerArgument argBlock; - private StringBuilder line; private FileSystemService fss; private DeviceManager dm; private Map<String, String> mountPoints; private PrintWriter out; private int outputType; private int blockSize; + @SuppressWarnings("unused") private boolean all; public DFCommand() { @@ -110,7 +110,6 @@ dm = InitialNaming.lookup(DeviceManager.NAME); mountPoints = fss.getDeviceMountPoints(); out = getOutput().getPrintWriter(true); - line = new StringBuilder(); Device device = null; Modified: trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/file/GrepCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -205,7 +205,7 @@ @Override public void flush() { doFlush(); - while(contextStack.size() > 0) { + while (contextStack.size() > 0) { writer.println(contextStack.removeFirst()); } haveLine = false; @@ -312,6 +312,7 @@ return writer == null; } + @SuppressWarnings("unused") private boolean haveLine() { return haveLine; } @@ -390,17 +391,19 @@ private static final int PREFIX_NOFILE = 0x08; private static final int PREFIX_TAB = 0x10; private static final int PREFIX_NULL = 0x20; + @SuppressWarnings("unused") private static final int PREFIX_ALL = PREFIX_FILE | PREFIX_LINE | PREFIX_BYTE; + @SuppressWarnings("unused") private static final int PREFIX_FL = PREFIX_FILE | PREFIX_LINE; + @SuppressWarnings("unused") private static final int PREFIX_FB = PREFIX_FILE | PREFIX_BYTE; + @SuppressWarnings("unused") private static final int PREFIX_LB = PREFIX_LINE | PREFIX_BYTE; private PrintWriter err; private PrintWriter out; private ContextLineWriter contextOut; private Reader in; - private InputStream stdin; - private OutputStream stdout; private List<File> files; private List<Pattern> patterns; private String prefixLabel; @@ -411,6 +414,7 @@ private int maxCount = Integer.MAX_VALUE; private int contextBefore; private int contextAfter; + @SuppressWarnings("unused") private int patternFlags; private int rc = 1; private int currentLine; @@ -427,9 +431,13 @@ private boolean suppress; private boolean debug; private boolean recurse; + @SuppressWarnings("unused") private boolean dirAsFile; + @SuppressWarnings("unused") private boolean binaryAsText; + @SuppressWarnings("unused") private boolean binaryAsBinary; + @SuppressWarnings("unused") private boolean readDevice; private boolean exitOnFirstMatch; @@ -508,11 +516,9 @@ * Primary entry point */ public void execute() throws Exception { - err = getError().getPrintWriter(); - in = getInput().getReader(); - out = getOutput().getPrintWriter(); - stdout = getOutput().getOutputStream(); - stdin = getInput().getInputStream(); + err = getError().getPrintWriter(); + in = getInput().getReader(); + out = getOutput().getPrintWriter(); LineNumberReader reader; String name; @@ -614,6 +620,7 @@ /** * Uses the MatchResult to only print the substring of the line that matched. */ + @SuppressWarnings("unused") private void matchSubstring(LineNumberReader reader, String name) throws IOException { String line; MatchResult result; @@ -636,11 +643,9 @@ */ private void matchNormal(LineNumberReader reader) throws IOException { String line; - MatchResult result; int matches = 0; while ((matches < maxCount) && ((line = reader.readLine()) != null)) { - result = match(line); currentLine = reader.getLineNumber(); if ((match(line) != null) ^ inverse) { printMatch(line, currentFile, currentLine, currentByte); @@ -972,8 +977,6 @@ } private void parseFiles() { - String line; - String name; BufferedReader reader; files = new ArrayList<File>(); @@ -1008,8 +1011,6 @@ } } - List<String> excludeDirs = new ArrayList<String>(); - for (final String s : ExcludeDir.getValues()) { walker.addDirectoryFilter(new FileFilter() { @Override @@ -1038,7 +1039,7 @@ walker.walk(dirs); } } catch (IOException e) { - // technically, the walker shouldn't let this propogate unless something + // technically, the walker shouldn't let this propagate unless something // is really wrong. error(err_ex_walker); exit(2); @@ -1053,6 +1054,7 @@ if (debug) log.debug(s); } + @SuppressWarnings("unused") private void debugOptions() { debug("Files : " + files.size()); for (File file : files) { Modified: trunk/cli/src/commands/org/jnode/command/file/Md5SumCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/Md5SumCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/file/Md5SumCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -55,7 +55,9 @@ private static final String help_check = "check the MD5 digests for files listed in this file"; private static final String help_super = "Calculate or check MD5 digests"; private static final String fmt_err_open = "Cannot open %s: %s%n"; + @SuppressWarnings("unused") private static final String str_ok = "Ok"; + @SuppressWarnings("unused") private static final String str_fail = "Failed"; private static final String fmt_io_ex = "%s : IO Exception - %s%n"; private static final String fmt_fail_count = "%d file(s) failed%n"; Modified: trunk/cli/src/commands/org/jnode/command/file/PasteCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/PasteCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/file/PasteCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -27,9 +27,7 @@ import java.util.Arrays; import java.util.List; -import org.jnode.command.argument.NumberListArgument; import org.jnode.command.util.IOUtils; -import org.jnode.command.util.NumberRange; import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FileArgument; @@ -177,7 +175,7 @@ if (argFiles.isSet()) { files = Arrays.asList(argFiles.getValues()); } else { - files = new ArrayList(1); + files = new ArrayList<File>(1); files.add(new File("-")); } Modified: trunk/cli/src/commands/org/jnode/command/file/SortCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/SortCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/file/SortCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -68,10 +68,15 @@ private int field; private int offset; private boolean ignoreBlanks; + @SuppressWarnings("unused") private boolean sortNumeric; + @SuppressWarnings("unused") private boolean cmpPrint; + @SuppressWarnings("unused") private boolean cmpAlpha; + @SuppressWarnings("unused") private boolean cmpICase; + @SuppressWarnings("unused") private boolean reverse; } @@ -85,6 +90,7 @@ FieldRange[] ranges; } + @SuppressWarnings("unused") private static class Entry { Key key; String value; @@ -251,7 +257,7 @@ List<String> fields = new LinkedList<String>(); int mark = 0; int i; - while((i = text.indexOf(sep, mark)) != -1) { + while ((i = text.indexOf(sep, mark)) != -1) { fields.add(text.substring(mark, i)); mark = i + 1; } @@ -305,7 +311,9 @@ private final StringArgument argFieldSep = new StringArgument("field-sep", 0, help_field_sep); private final IntegerArgument argSort = new IntegerArgument("sort", 0, " "); + @SuppressWarnings("unused") private static final int SORT_ONE = 1; + @SuppressWarnings("unused") private static final int SORT_TWO = 2; private static final int SORT_LAST = 1; @@ -316,15 +324,25 @@ private FieldRange[] ranges; private String fieldSep; private int rc; + @SuppressWarnings("unused") private int sort; + @SuppressWarnings("unused") private boolean check; + @SuppressWarnings("unused") private boolean merge; + @SuppressWarnings("unused") private boolean unique; + @SuppressWarnings("unused") private boolean reverse; + @SuppressWarnings("unused") private boolean numeric; + @SuppressWarnings("unused") private boolean cmpPrint; + @SuppressWarnings("unused") private boolean cmpAlpha; + @SuppressWarnings("unused") private boolean cmpICase; + @SuppressWarnings("unused") private boolean noBlanks; public SortCommand() { @@ -356,14 +374,14 @@ private void sortOne() { // OPTIMIZE - // This is probably effecient enough for most use cases, but alot + // This is probably efficient enough for most use cases, but a lot // can be done to make this run faster, and not do so much buffering. // But it works for now... // Also of note, the -m (merge only) option is basically ignore, as // we're blindly sorting and merging all in one shot with Collections - // merge sort. Again, not effecient, but it works. + // merge sort. Again, not efficient, but it works. Comparator<String> cmp = new FieldComparator(); - List<String> allLines = new LinkedList(); + List<String> allLines = new LinkedList<String>(); for (File file : files) { List<String> lines; @@ -390,11 +408,12 @@ } } + @SuppressWarnings("unused") private void sortTwo() { } - private void parseOptions(){ + private void parseOptions() { if (argFile.isSet()) { files = Arrays.asList(argFile.getValues()); } else { @@ -427,6 +446,7 @@ err.println(s); } + @SuppressWarnings("unused") private void debug(String s) { if (DEBUG) { error(s); Modified: trunk/cli/src/commands/org/jnode/command/file/TailCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/TailCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/file/TailCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -58,6 +58,7 @@ "from that line"; private static final String help_unchanged = "with -f, reopen the file when the size has not change for <int> " + "iterations to see if it has be unlinked or renamed Default is 5"; + @SuppressWarnings("unused") private static final String help_pid = "with -f, terminate after process PID does (how?)"; private static final String help_sleep = "with -f, sleep for <int> seconds between iterations. Default is 1"; private static final String help_quiet = "never output headers giving file names"; @@ -82,12 +83,15 @@ private PrintWriter err; private int count; + @SuppressWarnings("unused") private int sleep; + @SuppressWarnings("unused") private int unchanged; private boolean headers; private boolean useLines; private boolean reverse; private boolean follow; + @SuppressWarnings("unused") private boolean retry; private boolean first = true; @@ -233,7 +237,6 @@ OutputStream out = getOutput().getOutputStream(); byte[] buffer; int len; - int n; int bufsize = 8 * 1024; if (reverse) { Modified: trunk/cli/src/commands/org/jnode/command/net/ArpCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/net/ArpCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/net/ArpCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -37,6 +37,7 @@ */ public class ArpCommand extends AbstractCommand { + @SuppressWarnings("unused") private static final String help_clear = "if set, clear the ARP cache"; private static final String help_super = "print or clear the ARP cache"; private static final String str_cleared = "Cleared the ARP cache"; Modified: trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/system/LocaleCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -44,6 +44,7 @@ private static final String help_lang = "the local's language"; private static final String help_country = "the locale's country"; private static final String help_variant = "the locale's variant"; + @SuppressWarnings("unused") private static final String help_list = "if set, list the available Locales"; private static final String help_super = "Print or change JNode's default Locale"; private static final String err_no_locale = "No Locale is available for %s %s %s%n"; Modified: trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -64,9 +64,11 @@ private static final String fmt_load = "Loaded plugin %s version %s%n"; private static final String fmt_reload = "Reloaded plugin %s version %s%n"; private static final String fmt_unload = "Unloaded plugin %s%n"; + @SuppressWarnings("unused") private static final String str_state = "state"; private static final String str_active = "active"; private static final String str_inactive = "inactive"; + @SuppressWarnings("unused") private static final String str_version = "version"; private static final String fmt_list = "%s; state %s; version %s"; private static final String fmt_no_plugin = "Plugin %s not found%n"; Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneParser.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -295,7 +295,7 @@ // Deal with cmd_prefix'es before the command name; i.e. assignments and // redirections BjorneToken token; - for (int i = 0; ; i++) { + for (int i = 0; /**/; i++) { token = optPeek(TOK_ASSIGNMENT_BIT | TOK_IO_NUMBER_BIT | TOK_LESS_BIT | TOK_GREAT_BIT | TOK_DLESS_BIT | TOK_DGREAT_BIT | TOK_LESSAND_BIT | TOK_GREATAND_BIT | TOK_LESSGREAT_BIT | TOK_CLOBBER_BIT, Modified: trunk/shell/src/shell/org/jnode/shell/syntax/ArgumentSpecLoader.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/ArgumentSpecLoader.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/shell/src/shell/org/jnode/shell/syntax/ArgumentSpecLoader.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -81,7 +81,7 @@ * @return an array of {@code ArgumentSpec}s * @throws SyntaxFailureException if there was an error in the spec. */ - public ArgumentSpec[] loadArguments(SyntaxSpecAdapter element) { + public ArgumentSpec<?>[] loadArguments(SyntaxSpecAdapter element) { String alias = element.getAttribute("alias"); if (alias == null) { throw new SyntaxFailureException("'argument-bundle' element has no 'alias' attribute"); @@ -96,7 +96,7 @@ doTypeDefs(element.getChild(0)); } if (numArgs > 0) { - ArgumentSpec[] args = new ArgumentSpec[numArgs]; + ArgumentSpec<?>[] args = new ArgumentSpec[numArgs]; for (int i = 0; i < numArgs; i++) { args[i] = doLoad(element.getChild(i + start)); } @@ -130,7 +130,7 @@ /** * Parses an argument. */ - private ArgumentSpec doLoad(SyntaxSpecAdapter element) { + private ArgumentSpec<?> doLoad(SyntaxSpecAdapter element) { if (!element.getName().equals("argument")) { throw new SyntaxFailureException("Not a valid child of 'argument-bundle': " + element.getName()); } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/DefaultSyntaxManager.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/DefaultSyntaxManager.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/shell/src/shell/org/jnode/shell/syntax/DefaultSyntaxManager.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -45,8 +45,8 @@ private final HashMap<String, SyntaxBundle> syntaxes = new HashMap<String, SyntaxBundle>(); - private final HashMap<String, ArgumentSpec[]> arguments = - new HashMap<String, ArgumentSpec[]>(); + private final HashMap<String, ArgumentSpec<?>[]> arguments = + new HashMap<String, ArgumentSpec<?>[]>(); private final ExtensionPoint syntaxEP; @@ -77,7 +77,7 @@ } } - public void add(String alias, ArgumentSpec[] args) { + public void add(String alias, ArgumentSpec<?>[] args) { if (parent == null) { throw new UnsupportedOperationException( "Cannot modify the system syntax manager"); @@ -108,7 +108,7 @@ } public ArgumentBundle getArgumentBundle(String alias) { - ArgumentSpec[] args = arguments.get(alias); + ArgumentSpec<?>[] args = arguments.get(alias); if (args != null) { return makeArgumentBundle(args); } else if (parent != null) { @@ -118,7 +118,7 @@ } } - private ArgumentBundle makeArgumentBundle(ArgumentSpec[] specs) { + private ArgumentBundle makeArgumentBundle(ArgumentSpec<?>[] specs) { Argument<?>[] args = new Argument<?>[specs.length]; for (int i = 0; i < specs.length; i++) { try { @@ -164,7 +164,7 @@ syntaxes.put(bundle.getAlias(), bundle); } } else if (element.getName().equals("argument-bundle")) { - ArgumentSpec[] specs = argumentLoader.loadArguments(adaptedElement); + ArgumentSpec<?>[] specs = argumentLoader.loadArguments(adaptedElement); if (specs != null) { arguments.put(element.getAttribute("alias"), specs); } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/SyntaxManager.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/SyntaxManager.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/shell/src/shell/org/jnode/shell/syntax/SyntaxManager.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -66,7 +66,7 @@ * @param bundle an argument bundle holding the arguments of a bare command * @param alias the alias to bind the arguments to */ - public abstract void add(String alias, ArgumentSpec[] args); + public abstract void add(String alias, ArgumentSpec<?>[] args); /** * Gets the argument bundle for a given alias if one exists. Modified: trunk/shell/src/test/org/jnode/test/shell/syntax/TestSyntaxManager.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/syntax/TestSyntaxManager.java 2009-05-22 13:40:15 UTC (rev 5500) +++ trunk/shell/src/test/org/jnode/test/shell/syntax/TestSyntaxManager.java 2009-05-22 14:57:14 UTC (rev 5501) @@ -39,7 +39,7 @@ syntaxes.put(bundle.getAlias(), bundle); } - public void add(String alias, ArgumentSpec[] args) { + public void add(String alias, ArgumentSpec<?>[] args) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-06-01 14:32:55
|
Revision: 5537 http://jnode.svn.sourceforge.net/jnode/?rev=5537&view=rev Author: crawley Date: 2009-06-01 14:32:48 +0000 (Mon, 01 Jun 2009) Log Message: ----------- Fix code that outputs the usage information following a command syntax exception. Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java trunk/cli/src/commands/org/jnode/command/system/LoadkeysCommand.java trunk/shell/src/shell/org/jnode/shell/CommandRunner.java trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java Removed Paths: ------------- trunk/shell/src/shell/org/jnode/shell/help/SyntaxErrorException.java Modified: trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java 2009-06-01 10:49:03 UTC (rev 5536) +++ trunk/cli/src/commands/org/jnode/command/common/UnixTestCommand.java 2009-06-01 14:32:48 UTC (rev 5537) @@ -27,7 +27,7 @@ import org.jnode.shell.AbstractCommand; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.SyntaxErrorException; +import org.jnode.shell.syntax.CommandSyntaxException; /** @@ -123,7 +123,7 @@ args = commandLine.getArguments(); try { if (bracketted && args.length == 0) { - throw new SyntaxErrorException("missing ']'"); + throw new CommandSyntaxException("missing ']'"); } else if (bracketted && !args[args.length - 1].equals("]")) { processAsOptions(args); res = true; @@ -135,7 +135,7 @@ Object obj = evaluate(); if (pos <= lastArg) { if (args[pos].equals(")")) { - throw new SyntaxErrorException("unmatched ')'"); + throw new CommandSyntaxException("unmatched ')'"); } else { throw new AssertionError("I'm confused! pos = " + pos + ", lastArg = " + lastArg + ", next arg is " + args[pos]); @@ -153,13 +153,13 @@ if (!res) { exit(1); } - } catch (SyntaxErrorException ex) { + } catch (CommandSyntaxException ex) { getError().getPrintWriter().println(ex.getMessage()); exit(2); } } - private Object evaluate() throws SyntaxErrorException { + private Object evaluate() throws CommandSyntaxException { evaluateExpression(false); while (!operatorStack.isEmpty()) { reduce(); @@ -170,27 +170,27 @@ return operandStack.pop(); } - private void evaluateExpression(boolean nested) throws SyntaxErrorException { + private void evaluateExpression(boolean nested) throws CommandSyntaxException { evaluatePrimary(nested); while (pos <= lastArg) { String tok = next(); Operator op = OPERATOR_MAP.get(tok); if (op == null) { - throw new SyntaxErrorException("expected an operator"); + throw new CommandSyntaxException("expected an operator"); } switch(op.kind) { case OP_UNARY: - throw new SyntaxErrorException("misplaced unary operator"); + throw new CommandSyntaxException("misplaced unary operator"); case OP_BINARY: evaluatePrimary(nested); reduceAndPush(op, popOperand()); break; case OP_SPECIAL: if (op.opNo == OP_LPAREN) { - throw new SyntaxErrorException("misplaced '('"); + throw new CommandSyntaxException("misplaced '('"); } else if (op.opNo == OP_RPAREN) { if (!nested) { - throw new SyntaxErrorException("misplaced ')'"); + throw new CommandSyntaxException("misplaced ')'"); } back(); return; @@ -199,7 +199,7 @@ } } - private void evaluatePrimary(boolean nested) throws SyntaxErrorException { + private void evaluatePrimary(boolean nested) throws CommandSyntaxException { String tok = next(); Operator op = OPERATOR_MAP.get(tok); if (op == null) { @@ -211,13 +211,13 @@ operandStack.push(next()); break; case OP_BINARY: - throw new SyntaxErrorException("misplaced binary operator"); + throw new CommandSyntaxException("misplaced binary operator"); case OP_SPECIAL: if (op.opNo == OP_LPAREN) { operatorStack.push(op); // ... as a marker. evaluateExpression(true); if (!next().equals(")")) { - throw new SyntaxErrorException("missing ')'"); + throw new CommandSyntaxException("missing ')'"); } while (operatorStack.peek() != op) { reduce(); @@ -226,13 +226,13 @@ throw new AssertionError("cannot find my marker!"); } } else { - throw new SyntaxErrorException("unmatched ')'"); + throw new CommandSyntaxException("unmatched ')'"); } } } } - private void reduceAndPush(Operator operator, Object operand) throws SyntaxErrorException { + private void reduceAndPush(Operator operator, Object operand) throws CommandSyntaxException { while (!operatorStack.isEmpty() && operator.priority <= operatorStack.peek().priority) { reduce(); } @@ -240,7 +240,7 @@ operandStack.push(operand); } - private void reduce() throws SyntaxErrorException { + private void reduce() throws CommandSyntaxException { Operator operator = operatorStack.pop(); Object operand = null, operand2 = null; if (operator.kind == OP_UNARY) { @@ -321,7 +321,7 @@ } } - private void processAsOptions(String[] args) throws SyntaxErrorException { + private void processAsOptions(String[] args) throws CommandSyntaxException { PrintWriter err = getError().getPrintWriter(); for (String option : args) { if (option.equals("--help")) { @@ -329,7 +329,7 @@ } else if (option.equals("--version")) { err.println("JNode test 0.0"); } else { - throw new SyntaxErrorException("unknown option '" + option + "'"); + throw new CommandSyntaxException("unknown option '" + option + "'"); } } } @@ -346,51 +346,51 @@ operandStack.push(new Long(value)); } - private Object popOperand() throws SyntaxErrorException { + private Object popOperand() throws CommandSyntaxException { if (operandStack.isEmpty()) { - throw new SyntaxErrorException("missing LHS for operator"); + throw new CommandSyntaxException("missing LHS for operator"); } return operandStack.pop(); } - private long toNumber(Object obj) throws SyntaxErrorException { + private long toNumber(Object obj) throws CommandSyntaxException { if (obj instanceof Long) { return ((Long) obj).longValue(); } else if (obj instanceof String) { try { return Long.parseLong((String) obj); } catch (NumberFormatException ex) { - throw new SyntaxErrorException( + throw new CommandSyntaxException( "operand is not a number: '" + obj.toString() + "'"); } } else { - throw new SyntaxErrorException("subexpression is not an INTEGER"); + throw new CommandSyntaxException("subexpression is not an INTEGER"); } } - private boolean toBoolean(Object obj) throws SyntaxErrorException { + private boolean toBoolean(Object obj) throws CommandSyntaxException { if (obj instanceof Boolean) { return obj == Boolean.TRUE; } else if (obj instanceof String) { return ((String) obj).length() > 0; } else { - throw new SyntaxErrorException("operand is an INTEGER"); + throw new CommandSyntaxException("operand is an INTEGER"); } } - private String toString(Object obj) throws SyntaxErrorException { + private String toString(Object obj) throws CommandSyntaxException { if (obj instanceof String) { return (String) obj; } else { - throw new SyntaxErrorException("operand is not a STRING"); + throw new CommandSyntaxException("operand is not a STRING"); } } - private File toFile(Object obj) throws SyntaxErrorException { + private File toFile(Object obj) throws CommandSyntaxException { if (obj instanceof String) { return new File((String) obj); } else { - throw new SyntaxErrorException("operand is not a FILENAME"); + throw new CommandSyntaxException("operand is not a FILENAME"); } } @@ -401,7 +401,7 @@ return args[pos++]; } - private void back() throws SyntaxErrorException { + private void back() throws CommandSyntaxException { pos--; } Modified: trunk/cli/src/commands/org/jnode/command/system/LoadkeysCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/LoadkeysCommand.java 2009-06-01 10:49:03 UTC (rev 5536) +++ trunk/cli/src/commands/org/jnode/command/system/LoadkeysCommand.java 2009-06-01 14:32:48 UTC (rev 5537) @@ -31,9 +31,9 @@ import org.jnode.driver.input.KeyboardLayoutManager; import org.jnode.naming.InitialNaming; import org.jnode.shell.AbstractCommand; -import org.jnode.shell.help.SyntaxErrorException; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.ClassNameArgument; +import org.jnode.shell.syntax.CommandSyntaxException; import org.jnode.shell.syntax.CountryArgument; import org.jnode.shell.syntax.FlagArgument; import org.jnode.shell.syntax.KeyboardLayoutArgument; @@ -109,7 +109,7 @@ if (argAdd.isSet()) { String layoutID = getLayoutID(mgr); if (!argClass.isSet()) { - throw new SyntaxErrorException(ex_syntax_class); + throw new CommandSyntaxException(ex_syntax_class); } String className = argClass.getValue(); mgr.add(layoutID, className); @@ -141,16 +141,16 @@ } } - private String getLayoutID(KeyboardLayoutManager mgr) throws SyntaxErrorException { + private String getLayoutID(KeyboardLayoutManager mgr) throws CommandSyntaxException { if (!argTriple.isSet()) { if (argLayout.isSet()) { return argLayout.getValue(); } else { - throw new SyntaxErrorException(ex_syntax_layout); + throw new CommandSyntaxException(ex_syntax_layout); } } else { if (!argCountry.isSet()) { - throw new SyntaxErrorException(ex_syntax_country); + throw new CommandSyntaxException(ex_syntax_country); } String country = argCountry.getValue(); String language = argLanguage.isSet() ? argLanguage.getValue() : ""; Modified: trunk/shell/src/shell/org/jnode/shell/CommandRunner.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/CommandRunner.java 2009-06-01 10:49:03 UTC (rev 5536) +++ trunk/shell/src/shell/org/jnode/shell/CommandRunner.java 2009-06-01 14:32:48 UTC (rev 5537) @@ -36,9 +36,9 @@ import org.jnode.shell.help.HelpException; import org.jnode.shell.help.HelpFactory; -import org.jnode.shell.help.SyntaxErrorException; import org.jnode.shell.io.CommandIO; import org.jnode.shell.io.CommandOutput; +import org.jnode.shell.syntax.CommandSyntaxException; import org.jnode.vm.VmExit; /** @@ -90,7 +90,7 @@ try { prepare(); execute(); - } catch (SyntaxErrorException ex) { + } catch (CommandSyntaxException ex) { try { HelpFactory.getHelpFactory().getHelp(commandLine.getCommandName(), commandLine.getCommandInfo()).usage(shellErr); shellErr.println(ex.getMessage()); Modified: trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java 2009-06-01 10:49:03 UTC (rev 5536) +++ trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java 2009-06-01 14:32:48 UTC (rev 5537) @@ -31,7 +31,7 @@ import java.security.PrivilegedActionException; import org.jnode.shell.help.HelpFactory; -import org.jnode.shell.help.SyntaxErrorException; +import org.jnode.shell.syntax.CommandSyntaxException; import org.jnode.shell.io.CommandIO; import org.jnode.vm.VmExit; @@ -127,7 +127,7 @@ throw ex2; } } - } catch (SyntaxErrorException ex) { + } catch (CommandSyntaxException ex) { HelpFactory.getHelpFactory().getHelp(cmdName, cmdInfo).usage(err); err.println(ex.getMessage()); } catch (VmExit ex) { Deleted: trunk/shell/src/shell/org/jnode/shell/help/SyntaxErrorException.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/help/SyntaxErrorException.java 2009-06-01 10:49:03 UTC (rev 5536) +++ trunk/shell/src/shell/org/jnode/shell/help/SyntaxErrorException.java 2009-06-01 14:32:48 UTC (rev 5537) @@ -1,33 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2009 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.shell.help; - -/** - * @author qades - */ -public class SyntaxErrorException extends HelpException { - - private static final long serialVersionUID = 1L; - - public SyntaxErrorException(String message) { - super(message); - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-06-08 03:28:41
|
Revision: 5556 http://jnode.svn.sourceforge.net/jnode/?rev=5556&view=rev Author: crawley Date: 2009-06-08 03:28:40 +0000 (Mon, 08 Jun 2009) Log Message: ----------- Put "plain" report files for JUnit tests into <project>/reports/junit Modified Paths: -------------- trunk/cli/build-tests.xml trunk/fs/build-tests.xml trunk/shell/build-tests.xml Modified: trunk/cli/build-tests.xml =================================================================== --- trunk/cli/build-tests.xml 2009-06-08 03:01:05 UTC (rev 5555) +++ trunk/cli/build-tests.xml 2009-06-08 03:28:40 UTC (rev 5556) @@ -15,9 +15,11 @@ </target> <target name="all-junit"> + <delete dir="${basedir}/reports/junit"/> + <mkdir dir="${basedir}/reports/junit"/> <junit showoutput="on" printsummary="on" fork="on"> <classpath refid="cp-test"/> - <test name="org.jnode.test.cli.CLITestSuite"/> + <test name="org.jnode.test.cli.CLITestSuite" todir="${basedir}/reports/junit"/> </junit> </target> Modified: trunk/fs/build-tests.xml =================================================================== --- trunk/fs/build-tests.xml 2009-06-08 03:01:05 UTC (rev 5555) +++ trunk/fs/build-tests.xml 2009-06-08 03:28:40 UTC (rev 5556) @@ -12,9 +12,11 @@ </target> <target name="all-junit"> + <delete dir="${basedir}/reports/junit"/> + <mkdir dir="${basedir}/reports/junit"/> <junit showoutput="on" printsummary="on" fork="on"> <classpath refid="cp-test"/> - <test name="org.jnode.test.fs.filesystem.FSTestSuite"/> + <test name="org.jnode.test.fs.filesystem.FSTestSuite" todir="${basedir}/reports/junit"/> </junit> </target> Modified: trunk/shell/build-tests.xml =================================================================== --- trunk/shell/build-tests.xml 2009-06-08 03:01:05 UTC (rev 5555) +++ trunk/shell/build-tests.xml 2009-06-08 03:28:40 UTC (rev 5556) @@ -39,9 +39,12 @@ </target> <target name="all-junit"> + <delete dir="${basedir}/reports/junit"/> + <mkdir dir="${basedir}/reports/junit"/> <junit showoutput="on" printsummary="on" fork="on"> <classpath refid="cp-test"/> - <batchtest fork="yes"> + <formatter type="plain"/> + <batchtest fork="yes" todir="${basedir}/reports/junit"> <fileset dir="${basedir}/src/test"> <include name="**/*Test.java" /> <!-- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-06-08 06:24:13
|
Revision: 5557 http://jnode.svn.sourceforge.net/jnode/?rev=5557&view=rev Author: crawley Date: 2009-06-08 06:24:06 +0000 (Mon, 08 Jun 2009) Log Message: ----------- Tidy ups Removed Paths: ------------- trunk/sound/build/ Property Changed: ---------------- trunk/cli/ trunk/core/ trunk/fs/ trunk/net/ trunk/shell/ trunk/sound/ Property changes on: trunk/cli ___________________________________________________________________ Modified: svn:ignore - build + build reports Property changes on: trunk/core ___________________________________________________________________ Modified: svn:ignore - build + build reports Property changes on: trunk/fs ___________________________________________________________________ Modified: svn:ignore - build + build reports Property changes on: trunk/net ___________________________________________________________________ Modified: svn:ignore - build + build reports Property changes on: trunk/shell ___________________________________________________________________ Modified: svn:ignore - build + build reports Property changes on: trunk/sound ___________________________________________________________________ Added: svn:ignore + build This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-06-08 10:07:40
|
Revision: 5562 http://jnode.svn.sourceforge.net/jnode/?rev=5562&view=rev Author: crawley Date: 2009-06-08 10:07:38 +0000 (Mon, 08 Jun 2009) Log Message: ----------- Parameter rename Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/nfs/command/NFSHostNameArgument.java trunk/fs/src/fs/org/jnode/partitions/command/IBMPartitionTypeArgument.java trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java trunk/shell/src/shell/org/jnode/shell/CommandLine.java trunk/shell/src/shell/org/jnode/shell/bjorne/AssignmentArgument.java trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompletable.java trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java trunk/shell/src/shell/org/jnode/shell/bjorne/ListCommandNode.java trunk/shell/src/shell/org/jnode/shell/bjorne/SetFlagArgument.java trunk/shell/src/shell/org/jnode/shell/command/test/SuiteCommand.java trunk/shell/src/shell/org/jnode/shell/help/CommandLineElement.java trunk/shell/src/shell/org/jnode/shell/syntax/AliasArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/Argument.java trunk/shell/src/shell/org/jnode/shell/syntax/CountryArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/DeviceArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/EnumArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/FileArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/IntegerArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/KeyboardLayoutArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/LanguageArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/Log4jLoggerArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/LongArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/MappedArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/MuParser.java trunk/shell/src/shell/org/jnode/shell/syntax/PluginArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/PropertyNameArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/ShellPropertyNameArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/ThreadNameArgument.java trunk/shell/src/shell/org/jnode/shell/syntax/URLArgument.java Modified: trunk/fs/src/fs/org/jnode/fs/nfs/command/NFSHostNameArgument.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/nfs/command/NFSHostNameArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/fs/src/fs/org/jnode/fs/nfs/command/NFSHostNameArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -43,7 +43,7 @@ super(name, flags, new String[0], description); } - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { int index = partial.indexOf(':'); if (index <= 0) { return; @@ -88,7 +88,7 @@ for (int i = 0; i < exportEntryList.size(); i++) { ExportEntry exportEntry = exportEntryList.get(i); if (exportEntry.getDirectory().startsWith(partialDirectory)) { - completion.addCompletion(hostName + ":" + exportEntry.getDirectory()); + completions.addCompletion(hostName + ":" + exportEntry.getDirectory()); } } } Modified: trunk/fs/src/fs/org/jnode/partitions/command/IBMPartitionTypeArgument.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/command/IBMPartitionTypeArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/fs/src/fs/org/jnode/partitions/command/IBMPartitionTypeArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -50,12 +50,12 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { partial = partial.toLowerCase(); for (IBMPartitionTypes pt : IBMPartitionTypes.values()) { String code = Integer.toHexString(pt.getCode()); if (code.startsWith(partial)) { - completion.addCompletion(code); + completions.addCompletion(code); } } } Modified: trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/ArgumentCompleter.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -49,10 +49,10 @@ } } - public void complete(CompletionInfo completion, CommandShell shell) { - argument.complete(completion, token == null ? "" : token.text, 0); + public void complete(CompletionInfo completions, CommandShell shell) { + argument.complete(completions, token == null ? "" : token.text, 0); if (token != null) { - completion.setCompletionStart(token.start); + completions.setCompletionStart(token.start); } } Modified: trunk/shell/src/shell/org/jnode/shell/CommandLine.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/CommandLine.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/CommandLine.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -587,7 +587,7 @@ return cmdInfo; } - public void complete(CompletionInfo completion, CommandShell shell) throws CompletionException { + public void complete(CompletionInfo completions, CommandShell shell) throws CompletionException { String cmd = (commandToken == null) ? "" : commandToken.text.trim(); if (!cmd.equals("") && (argumentTokens.length > 0 || argumentAnticipated)) { CommandInfo ci; @@ -627,7 +627,7 @@ syntaxes = new SyntaxBundle(cmd, bundle.createDefaultSyntax()); } try { - bundle.complete(this, syntaxes, completion); + bundle.complete(this, syntaxes, completions); } catch (CommandSyntaxException ex) { throw new CompletionException("Command syntax problem", ex); } @@ -636,7 +636,7 @@ // as an AliasArgument. ArgumentCompleter ac = new ArgumentCompleter( new AliasArgument("cmdName", Argument.SINGLE), commandToken); - ac.complete(completion, shell); + ac.complete(completions, shell); } } Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/AssignmentArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/bjorne/AssignmentArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/bjorne/AssignmentArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -56,14 +56,14 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { int pos = partial.indexOf('='); if (pos != -1) { return; } for (String varName : context.getVariableNames()) { if (varName.startsWith(partial)) { - completion.addCompletion(varName, true); + completions.addCompletion(varName, true); } } } Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompletable.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompletable.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompletable.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -26,7 +26,7 @@ public interface BjorneCompletable { - void complete(CompletionInfo completion, BjorneContext context, + void complete(CompletionInfo completions, BjorneContext context, CommandShell shell, boolean argumentAnticipated) throws CompletionException; Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneCompleter.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -49,10 +49,10 @@ } @Override - public void complete(CompletionInfo completion, CommandShell shell) throws CompletionException { + public void complete(CompletionInfo completions, CommandShell shell) throws CompletionException { if (endToken == null) { if (penultimateToken == null) { - completeCommandWord(completion, shell, new BjorneToken("")); + completeCommandWord(completions, shell, new BjorneToken("")); return; } endToken = penultimateToken; @@ -62,9 +62,9 @@ BjorneToken[] words = command.getWords(); if (words.length > 1 && words[words.length - 1] == penultimateToken) { boolean argumentAnticipated = penultimateToken.end < endToken.end; - command.complete(completion, context, shell, argumentAnticipated); + command.complete(completions, context, shell, argumentAnticipated); } else if (words.length == 1 && words[0] == penultimateToken && penultimateToken.end < endToken.end) { - command.complete(completion, context, shell, true); + command.complete(completions, context, shell, true); } } String partial; @@ -73,12 +73,12 @@ if (penultimateToken == null || penultimateToken.end < endToken.end) { partial = ""; expectedSet = endExpectedSet; - completion.setCompletionStart(endToken.start); + completions.setCompletionStart(endToken.start); token = endToken; } else { partial = penultimateToken.unparse(); expectedSet = penultimateExpectedSet | endExpectedSet; - completion.setCompletionStart(penultimateToken.start); + completions.setCompletionStart(penultimateToken.start); token = penultimateToken; } if (!partial.equals(token.getText())) { @@ -109,38 +109,38 @@ case TOK_ASSIGNMENT: ArgumentCompleter ac = new ArgumentCompleter( new AssignmentArgument("?", context, Argument.MANDATORY, null), token); - ac.complete(completion, shell); + ac.complete(completions, shell); break; case TOK_FOR_WORD: case TOK_FILE_NAME: // Complete against the file system namespace ac = new ArgumentCompleter( new FileArgument("?", Argument.MANDATORY, null), token); - ac.complete(completion, shell); + ac.complete(completions, shell); break; case TOK_COMMAND_NAME: // Complete against the command/alias/function namespaces - completeCommandWord(completion, shell, token); + completeCommandWord(completions, shell, token); break; default: String candidate = BjorneToken.toString(i); if (candidate.startsWith(partial)) { - completion.addCompletion(candidate); + completions.addCompletion(candidate); } } } } - private void completeCommandWord(CompletionInfo completion, CommandShell shell, BjorneToken token) { + private void completeCommandWord(CompletionInfo completions, CommandShell shell, BjorneToken token) { // FIXME ... do aliases and functions ... for (String builtinName : BjorneInterpreter.BUILTINS.keySet()) { if (builtinName.startsWith(token.text)) { - completion.addCompletion(builtinName); + completions.addCompletion(builtinName); } } ArgumentCompleter ac = new ArgumentCompleter( new AliasArgument("?", Argument.MANDATORY, null), token); - ac.complete(completion, shell); + ac.complete(completions, shell); } public void setEndToken(BjorneToken endToken) { Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/ListCommandNode.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/bjorne/ListCommandNode.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/bjorne/ListCommandNode.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -129,7 +129,7 @@ } @Override - public void complete(CompletionInfo completion, CommandShell shell) throws CompletionException { + public void complete(CompletionInfo completions, CommandShell shell) throws CompletionException { // TODO Auto-generated method stub } Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/SetFlagArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/bjorne/SetFlagArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/bjorne/SetFlagArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -54,12 +54,12 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { if (("-" + flagCh).startsWith(partial)) { - completion.addCompletion("-" + flagCh); + completions.addCompletion("-" + flagCh); } if (("+" + flagCh).startsWith(partial)) { - completion.addCompletion("+" + flagCh); + completions.addCompletion("+" + flagCh); } } } Modified: trunk/shell/src/shell/org/jnode/shell/command/test/SuiteCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/test/SuiteCommand.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/command/test/SuiteCommand.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -97,11 +97,11 @@ super(label, flags, description); } - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { Set<String> availCategories = TestManager.getInstance().getCategories(); for (String availCategory : availCategories) { if (availCategory.startsWith(partial)) { - completion.addCompletion(availCategory); + completions.addCompletion(availCategory); } } } Modified: trunk/shell/src/shell/org/jnode/shell/help/CommandLineElement.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/help/CommandLineElement.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/help/CommandLineElement.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -46,7 +46,7 @@ public abstract String format(); public abstract void describe(HelpFactory help, PrintWriter out); - public abstract void complete(CompletionInfo completion, String partial); + public abstract void complete(CompletionInfo completions, String partial); /** * Indicates if the element is satisfied. Modified: trunk/shell/src/shell/org/jnode/shell/syntax/AliasArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/AliasArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/AliasArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -56,7 +56,7 @@ return value.text; } - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { try { // get the alias manager final AliasManager aliasMgr = @@ -65,7 +65,7 @@ // collect matching aliases for (String alias : aliasMgr.aliases()) { if (alias.startsWith(partial)) { - completion.addCompletion(alias); + completions.addCompletion(alias); } } } catch (NameNotFoundException ex) { Modified: trunk/shell/src/shell/org/jnode/shell/syntax/Argument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/Argument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/Argument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -440,13 +440,13 @@ * @param completion the CompletionInfo object for registering any completions. * @param partial the argument string to be completed. */ - public final void complete(CompletionInfo completion, String partial, int flags) { + public final void complete(CompletionInfo completions, String partial, int flags) { if (isSet() && !isMultiple()) { throw new SyntaxMultiplicityException("this argument cannot be repeated"); } flags = (flags & ~NONOVERRIDABLE_FLAGS) | this.flags; checkFlags(flags); - doComplete(completion, partial, flags); + doComplete(completions, partial, flags); } /** Modified: trunk/shell/src/shell/org/jnode/shell/syntax/CountryArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/CountryArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/CountryArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -50,10 +50,10 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { for (String country : validCountries) { if (country.startsWith(partial)) { - completion.addCompletion(country); + completions.addCompletion(country); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/DeviceArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/DeviceArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/DeviceArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -70,7 +70,7 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { final DeviceManager devMgr = getDeviceManager(); // collect matching devices @@ -80,7 +80,7 @@ } final String devId = dev.getId(); if (devId.startsWith(partial)) { - completion.addCompletion(devId); + completions.addCompletion(devId); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/EnumArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/EnumArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/EnumArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -69,11 +69,11 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { for (E e : clazz.getEnumConstants()) { String eName = e.name(); if (eName.startsWith(partial)) { - completion.addCompletion(eName); + completions.addCompletion(eName); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/FileArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/FileArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/FileArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -114,7 +114,7 @@ } @Override - public void doComplete(final CompletionInfo completion, + public void doComplete(final CompletionInfo completions, final String partial, final int flags) { // Get last full directory from the partial pathname. final int idx = partial.lastIndexOf(File.separatorChar); @@ -155,9 +155,9 @@ String name = prefix + n; if (name.startsWith(partial)) { if (new File(f, n).isDirectory()) { - completion.addCompletion(name + File.separatorChar, true); + completions.addCompletion(name + File.separatorChar, true); } else { - completion.addCompletion(name); + completions.addCompletion(name); } } } @@ -170,12 +170,12 @@ int tmp = partial.length() - idx; if ((tmp == 3 && partial.endsWith("..")) || (tmp == 2 && partial.endsWith("."))) { - completion.addCompletion(partial + File.separatorChar, true); + completions.addCompletion(partial + File.separatorChar, true); } // Add "-" as a possible completion? if (partial.length() == 0 && (flags & HYPHEN_IS_SPECIAL) != 0) { - completion.addCompletion("-"); + completions.addCompletion("-"); } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/IntegerArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/IntegerArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/IntegerArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -68,14 +68,14 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { // FIXME ... maybe someone could figure out how to partial // completion efficiently when max - min is large? if (max - min >= 0 && max - min < COMPLETION_THRESHOLD) { for (int i = min; i <= max; i++) { String candidate = Integer.toString(i); if (candidate.startsWith(partial)) { - completion.addCompletion(candidate); + completions.addCompletion(candidate); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/KeyboardLayoutArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/KeyboardLayoutArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/KeyboardLayoutArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -51,13 +51,13 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { try { KeyboardLayoutManager mgr = InitialNaming.lookup(KeyboardLayoutManager.NAME); // collect matching devices for (String layout : mgr.layouts()) { if (layout.startsWith(partial)) { - completion.addCompletion(layout); + completions.addCompletion(layout); } } } catch (NameNotFoundException ex) { Modified: trunk/shell/src/shell/org/jnode/shell/syntax/LanguageArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/LanguageArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/LanguageArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -50,10 +50,10 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { for (String language : validLanguages) { if (language.startsWith(partial)) { - completion.addCompletion(language); + completions.addCompletion(language); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/Log4jLoggerArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/Log4jLoggerArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/Log4jLoggerArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -56,12 +56,12 @@ * Complete against existing logger names. */ @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { Enumeration<?> en = LogManager.getCurrentLoggers(); while (en.hasMoreElements()) { String loggerName = ((Logger) en.nextElement()).getName(); if (loggerName.startsWith(partial)) { - completion.addCompletion(loggerName); + completions.addCompletion(loggerName); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/LongArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/LongArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/LongArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -69,7 +69,7 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { // FIXME ... maybe someone could figure out how to partial // completion efficiently when max - min is large? if (max - min >= 0 && max - min < COMPLETION_THRESHOLD) { @@ -77,7 +77,7 @@ String candidate = Long.toString(i); System.err.println("Testing completion '" + candidate + "'"); if (candidate.startsWith(partial)) { - completion.addCompletion(candidate); + completions.addCompletion(candidate); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/MappedArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/MappedArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/MappedArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -62,13 +62,13 @@ * Complete partial against the domain of the valueMap. */ @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { if (caseInsensitive) { partial = partial.toLowerCase(); } for (String str : valueMap.keySet()) { if (str.startsWith(partial)) { - completion.addCompletion(str); + completions.addCompletion(str); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/MuParser.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/MuParser.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/MuParser.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -108,10 +108,10 @@ * @param bundle the container for Argument objects; e.g. provided by the command. * @throws CommandSyntaxException */ - public void parse(MuSyntax rootSyntax, CompletionInfo completion, + public void parse(MuSyntax rootSyntax, CompletionInfo completions, SymbolSource<Token> source, ArgumentBundle bundle) throws CommandSyntaxException, SyntaxFailureException { - parse(rootSyntax, completion, source, bundle, DEFAULT_STEP_LIMIT); + parse(rootSyntax, completions, source, bundle, DEFAULT_STEP_LIMIT); } /** @@ -127,7 +127,7 @@ * means that there is no limit. * @throws CommandSyntaxException */ - public synchronized void parse(MuSyntax rootSyntax, CompletionInfo completion, + public synchronized void parse(MuSyntax rootSyntax, CompletionInfo completions, SymbolSource<Token> source, ArgumentBundle bundle, int stepLimit) throws CommandSyntaxException, SyntaxFailureException { // FIXME - deal with syntax error messages and completion @@ -166,7 +166,7 @@ if (DEBUG) { log.debug("exhausted syntax stack too soon"); } - } else if (completion != null && !backtrackStack.isEmpty()) { + } else if (completions != null && !backtrackStack.isEmpty()) { if (DEBUG) { log.debug("try alternatives for completion"); } @@ -193,11 +193,11 @@ String symbol = ((MuSymbol) syntax).getSymbol(); token = source.hasNext() ? source.next() : null; - if (completion == null || source.hasNext()) { + if (completions == null || source.hasNext()) { backtrack = token == null || !token.text.equals(symbol); } else { if (token == null) { - completion.addCompletion(symbol); + completions.addCompletion(symbol); backtrack = true; } else if (source.whitespaceAfterLast()) { if (!token.text.equals(symbol)) { @@ -205,8 +205,8 @@ } } else { if (symbol.startsWith(token.text)) { - completion.addCompletion(symbol); - completion.setCompletionStart(token.start); + completions.addCompletion(symbol); + completions.setCompletionStart(token.start); } backtrack = true; } @@ -220,7 +220,7 @@ try { if (source.hasNext()) { token = source.next(); - if (completion == null || source.hasNext() || source.whitespaceAfterLast()) { + if (completions == null || source.hasNext() || source.whitespaceAfterLast()) { arg.accept(token, flags); if (!backtrackStack.isEmpty()) { backtrackStack.getFirst().argsModified.add(arg); @@ -229,13 +229,13 @@ } } } else { - arg.complete(completion, token.text, flags); - completion.setCompletionStart(token.start); + arg.complete(completions, token.text, flags); + completions.setCompletionStart(token.start); backtrack = true; } } else { - if (completion != null) { - arg.complete(completion, "", flags); + if (completions != null) { + arg.complete(completions, "", flags); } backtrack = true; } @@ -353,7 +353,7 @@ } // If we are still backtracking and we are out of choices ... if (backtrack) { - if (completion == null) { + if (completions == null) { throw new CommandSyntaxException("ran out of alternatives", argFailures); } else { if (DEBUG) { Modified: trunk/shell/src/shell/org/jnode/shell/syntax/PluginArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/PluginArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/PluginArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -40,7 +40,7 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { try { // get the plugin manager final PluginManager piMgr = InitialNaming.lookup(PluginManager.NAME); @@ -49,7 +49,7 @@ for (PluginDescriptor descr : piMgr.getRegistry()) { final String id = descr.getId(); if (id.startsWith(partial)) { - completion.addCompletion(id); + completions.addCompletion(id); } } } catch (NameNotFoundException ex) { Modified: trunk/shell/src/shell/org/jnode/shell/syntax/PropertyNameArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/PropertyNameArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/PropertyNameArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -55,12 +55,12 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { Properties ps = AccessController.doPrivileged(new GetPropertiesAction()); for (Object key : ps.keySet()) { String name = (String) key; if (name.startsWith(partial)) { - completion.addCompletion(name); + completions.addCompletion(name); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/ShellPropertyNameArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/ShellPropertyNameArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/ShellPropertyNameArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -53,12 +53,12 @@ } @Override - public void doComplete(CompletionInfo completion, String partial, int flags) { + public void doComplete(CompletionInfo completions, String partial, int flags) { try { for (Object key : ShellUtils.getCurrentShell().getProperties().keySet()) { String name = (String) key; if (name.startsWith(partial)) { - completion.addCompletion(name); + completions.addCompletion(name); } } } catch (NameNotFoundException ex) { Modified: trunk/shell/src/shell/org/jnode/shell/syntax/ThreadNameArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/ThreadNameArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/ThreadNameArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -51,7 +51,7 @@ * Complete the 'partial' against the names of all existing Thread objects * by traversing the ThreadGroup / Thread hierarchy from its root. */ - public void doComplete(final CompletionInfo completion, final String partial, final int flags) { + public void doComplete(final CompletionInfo completions, final String partial, final int flags) { ThreadGroup grp = Thread.currentThread().getThreadGroup(); while (grp.getParent() != null) { grp = grp.getParent(); @@ -60,21 +60,21 @@ final ThreadGroup grp_f = grp; AccessController.doPrivileged(new PrivilegedAction<Void>() { public Void run() { - findList(grp_f, partial, completion); + findList(grp_f, partial, completions); return null; } }); } - private void findList(ThreadGroup grp, String partial, CompletionInfo completion) { + private void findList(ThreadGroup grp, String partial, CompletionInfo completions) { final Thread[] ts = new Thread[grp.activeCount()]; grp.enumerate(ts); for (Thread t : ts) { if (t != null) { final String name = t.getName(); if (name.startsWith(partial)) { - completion.addCompletion(name); + completions.addCompletion(name); } } } @@ -82,7 +82,7 @@ grp.enumerate(gs); for (ThreadGroup g : gs) { if (g != null) { - findList(g, partial, completion); + findList(g, partial, completions); } } } Modified: trunk/shell/src/shell/org/jnode/shell/syntax/URLArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/URLArgument.java 2009-06-08 09:43:59 UTC (rev 5561) +++ trunk/shell/src/shell/org/jnode/shell/syntax/URLArgument.java 2009-06-08 10:07:38 UTC (rev 5562) @@ -62,7 +62,7 @@ } @Override - public void doComplete(final CompletionInfo completion, final String partial, final int flags) { + public void doComplete(final CompletionInfo completions, final String partial, final int flags) { try { // If 'partial' is a well-formed "file:" URL with no host, port, // user or query, do completion on the path component. @@ -78,7 +78,7 @@ for (String c : myCompletion.getCompletions()) { // (Kludge - the 'true' argument prevents an extra space // character from being appended to the completions.) - completion.addCompletion("file:" + c, true); + completions.addCompletion("file:" + c, true); } } } catch (MalformedURLException ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cr...@us...> - 2009-07-06 15:53:18
|
Revision: 5594 http://jnode.svn.sourceforge.net/jnode/?rev=5594&view=rev Author: crawley Date: 2009-07-06 15:23:39 +0000 (Mon, 06 Jul 2009) Log Message: ----------- Fixed some javadoc errors Modified Paths: -------------- 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/shell/src/shell/org/jnode/shell/syntax/Argument.java trunk/shell/src/shell/org/jnode/shell/syntax/MuParser.java Modified: trunk/cli/src/commands/org/jnode/command/util/AbstractDirectoryWalker.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/util/AbstractDirectoryWalker.java 2009-07-06 14:33:04 UTC (rev 5593) +++ trunk/cli/src/commands/org/jnode/command/util/AbstractDirectoryWalker.java 2009-07-06 15:23:39 UTC (rev 5594) @@ -32,6 +32,7 @@ import java.util.regex.Matcher; import org.jnode.shell.PathnamePattern; + /** * <p> * <code>AbstractDirectoryWalker</code> - walk through a directory hierarchy @@ -41,7 +42,7 @@ * relatively to the given directory and walk recursively through the directory * hierarchy until stopping depth is reached. <br> * On its way, it will call "handleFile()" and "handleDir()" for every file and - * directory, that is not filtered out by any of the filteres set for this + * directory, that is not filtered out by any of the filters set for this * DirectoryWalker. * * @author Alexander Kerner @@ -97,7 +98,7 @@ * Create the filter with the given pattern and orientation * * @param pattern the regular expression to match with - * @param exclude, if true, reverse the sense of matching and + * @param exclude if true, reverse the sense of matching and * exclude files that match the pattern. */ public RegexPatternFilter(String pattern, boolean exclude) { @@ -122,7 +123,7 @@ /** * Create the filter with the given mod time and direction * - * @param size the time point to filter on + * @param time the time point to filter on * @param newer if true, accept if the file mtime is > time, false * accepts if the file mtime is <= to time. */ @@ -171,27 +172,27 @@ private volatile boolean cancelled = false; /** - * Walk the directory heirarchies of the given directories. + * Walk the directory hierarchies of the given directories. * * Before walking begins on each of the given directories, the * extending class has a chance to do some initialization through - * {@code handleStartingDir}. Once walking has commenced, each file + * {@link #handleStartingDir(File)}. Once walking has commenced, each file * will be checked against the current set of constraints, and * passed to the extending class for further processing if accepted. * When walking is complete for that branch, the {@code lastAction} * method is called, and the walker moves on to the next directory, * or returns if there are no more directories to walk. * - * If an IOException propogates beyond the {@code walk} method, there + * If an IOException propagates beyond the {@code walk} method, there * is currently no way to resume walking. The following reasons may * cause this to happen. * <ul> * <li>Any of the supplied directories are null, or not a directory. * <li>A SecurityException was triggered, and the caller has not overriden - * the {@code handleRestrictedDir} method. + * the {@link #handleRestrictedFile(File)} method. * </ul> * - * @param dirs Array of <code>File</code> to walk through. + * @param dirs array of {@link java.io.File} to walk through. * @throws IOException if any IO error occurs. * @throws NullPointerException if dirs is null, or contains no directories */ @@ -215,7 +216,7 @@ handle(stack.pop()); } lastAction(cancelled); - // if this was cancelled, we need to clear the stack + // if this was canceled, we need to clear the stack stack.clear(); } } @@ -235,7 +236,7 @@ try { // Don't descend into directories beyond maxDepth if (file.file.isDirectory() && (maxDepth == null || file.depth < maxDepth) && dirNotFiltered(file.file)) { - handleChilds(file); + handleChildren(file); } } catch (SecurityException e) { // Exception rises, when access to folder content was denied @@ -246,7 +247,7 @@ /** * Add a directories contents to the stack. */ - private void handleChilds(final FileObject file) throws IOException, SecurityException { + private void handleChildren(final FileObject file) throws IOException, SecurityException { final Stack<File> stack = new Stack<File>(); final File[] content = file.file.listFiles(); if (content == null) { @@ -292,7 +293,7 @@ * Process a file through a set of file filters. * * This may be called from extending classes in order to bypass - * the regaular walking procedure. + * the regular walking procedure. * * As an example, if the caller simply wants to process specific * files through the filter set, without setting up a full directory @@ -325,10 +326,10 @@ } /** - * Stop walking the current directory heirarchy. + * Stop walking the current directory hierarchy. * * This will not stop the walker altogether if there were multiple directories - * passed to {@code walk}. Instead, walking of the current directory heirarchy + * passed to {@code walk}. Instead, walking of the current directory hierarchy * will stop, {@code lastAction(true)} is called, and the walker is reset with * the next directory. If this it was the last directory, or there was only one * then walk will return without error. @@ -358,7 +359,7 @@ * The maximum depth level (inclusive) at which to stop handling files. * * When the walker reaches this level, it will not recurse any deeper - * into the file heirarchy. If the maximjm depth is 0, the initial directory + * into the file hierarchy. If the maximum depth is 0, the initial directory * will be handled, but the walker will not query for its contents. * * A negative value will be seen as null. @@ -378,8 +379,8 @@ * must be accepted by the set of filters supplied. If no filters are * supplied, then every file and directory will be handled. * - * @param filter <code>FileFilter</code> to be added to this - * DirectoryWalkers FilterSet. + * @param filter a {@link FileFilter} to be added to this + * DirectoryWalker's FilterSet. */ public synchronized void addFilter(FileFilter filter) { filters.add(filter); @@ -392,7 +393,7 @@ * directory filters supplied. If no filters are supplied, then this * will not prevent recursing of directories. * - * @param filter <code>FileFilter</code> to be added + * @param filter {@link FileFilter} to be added */ public synchronized void addDirectoryFilter(FileFilter filter) { dirFilters.add(filter); @@ -400,18 +401,18 @@ /** * Handle a file or directory that triggered a SecurityException. - * - * This method is called, when access to a file was denied.<br> - * Default implementation will rise a <code>IOException</code> instead of - * <code>SecurityException</code>. May be overridden by extending classes to + * This method is called, when access to a file was denied. + * <p> + * The default implementation will raise an {@link IOException} instead of a + * {@link SecurityException}. May be overridden by extending classes to * do something else. * - * Because this method throws an IOException that will propogate beyond the + * Because this method throws an IOException that will propagate beyond the * walk method, if an application wishes to continue walking after encountering * a SecurityException while accessing a file or directory, then it must override * this and provide an implementation that does not throw an exception. * - * @param file <code>File</code>-object, to which access was restricted. + * @param file {@code File} object, to which access was restricted. * @throws IOException in default implementation. */ protected void handleRestrictedFile(final File file) throws IOException { @@ -430,7 +431,7 @@ * Override this to do some initialization before starting to walk each of the * given directory roots. * - * @param file <code>File</code>-object, that represents starting dir. + * @param file {@code File} object, that represents starting dir. * @throws IOException if IO error occurs. */ protected void handleStartingDir(final File file) throws IOException { @@ -438,7 +439,7 @@ } /** - * This method is called, when walking has finished. <br> + * This method is called, when walking has finished. * By default, it does nothing. May be overridden by extending classes to do something else. * @param wasCancelled true, if directory walking was aborted. */ @@ -451,7 +452,7 @@ * * Override this to perform some operation on this directory. * - * @param file <code>File</code>-object, that represents current directory. + * @param file {@code File} object, that represents current directory. * @throws IOException if IO error occurs. */ public abstract void handleDir(final File file) throws IOException; @@ -461,7 +462,7 @@ * * Override this to perform some operation on this file. * - * @param file <code>File</code>-object, that represents current file. + * @param file {@code File} object, that represents current file. * @throws IOException if IO error occurs. */ public abstract void handleFile(final File file) throws IOException; @@ -471,7 +472,7 @@ * * Override this to perform some operation on this special file. * - * @param <code>File</code> object that represents a special file. + * @param file {@code File} object that represents a special file. * @throws IOException if an IO error occurs. */ public void handleSpecialFile(File file) throws IOException { Modified: trunk/cli/src/commands/org/jnode/command/util/IOUtils.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/util/IOUtils.java 2009-07-06 14:33:04 UTC (rev 5593) +++ trunk/cli/src/commands/org/jnode/command/util/IOUtils.java 2009-07-06 15:23:39 UTC (rev 5594) @@ -66,7 +66,7 @@ /** * Call the close method of a list of Closeable objects. * - * If the flush paramater is set to true, and an object implements + * If the flush parameter is set to true, and an object implements * the Flushable interface, then the flush method will be called before * the close method is called. * @@ -121,7 +121,7 @@ } /** - * Copies data from an Inputstream to an OutputStream. + * Copies data from an InputStream to an OutputStream. * * This method allocates a 4096 byte buffer each time it is called. * @@ -129,7 +129,6 @@ * * @param in the stream to read from * @param out the stream to write to - * @param bufferSize the size of buffer to use for the copy * @return the number of bytes read from the input stream * @throws NullPointerException if either in or out are null * @throws IOException if an I/O error occurs @@ -139,7 +138,7 @@ } /** - * Copies data from an Inputstream to an OutputStream. + * Copies data from an InputStream to an OutputStream. * * This method allocates a buffer of 'bufferSize' when it is called. * @@ -432,7 +431,7 @@ * * @param in the reader to read user input from. * @param out the writer to send the prompt to the user - * @param str the prompt to send to the user + * @param prompt the prompt to send to the user * @return true if the user said yes, false if no */ public static boolean promptYesOrNo(Reader in, PrintWriter out, String prompt) { @@ -457,7 +456,7 @@ * * @param in the reader to read user input from. * @param out the writer to send the prompt to the user - * @param str the prompt to send to the user + * @param prompt the prompt to send to the user * @param defaultChoice if the user inputs no reply, this value is returned * @return true if the user said yes, false if no * @throws NullPointerException if in, out or str are null @@ -503,7 +502,7 @@ * * @param in the reader to read user input from. * @param out the writer to send the prompt to the user - * @param str the prompt to send to the user + * @param prompt the prompt to send to the user * @return the string captured from the user, or null if an I/O error occurred. * @throws NullPointerException if in, out or str are null */ @@ -556,7 +555,7 @@ * * @param reader the source to read from * @param max the max number of lines to read, if this is -1 Integer.MAX_VALUE is used - * @returns a list of strings, possibly empty, or null if there was an exception. + * @return a list of strings, possibly empty, or null if there was an exception. * @throws NullPointerException if reader is null */ public static List<String> readLines(Reader reader, int max) { @@ -572,7 +571,7 @@ * * @param reader the source to read from * @param max the max number of lines to read, if this is -1 Integer.MAX_VALUE is used - * @returns a list of strings, possibly empty, or null if there was an exception. + * @return a list of strings, possibly empty, or null if there was an exception. * @throws NullPointerException if reader is null */ public static List<String> readLines(BufferedReader reader, int max) { Modified: trunk/cli/src/commands/org/jnode/command/util/NumberRange.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/util/NumberRange.java 2009-07-06 14:33:04 UTC (rev 5593) +++ trunk/cli/src/commands/org/jnode/command/util/NumberRange.java 2009-07-06 15:23:39 UTC (rev 5594) @@ -35,7 +35,6 @@ * both ranges are also infinite in that direction. * * @author chris boertien - * @see {@link org.jnode.command.argument.NumberRangeArgument} */ public final class NumberRange implements Comparable<NumberRange> { @@ -94,8 +93,7 @@ * is considered less than one that is positively infinite. * * @param that the NumberRange to compare this one to - * @return -1 if this comes before that, 1 if that comes before this, 0 if they are equal - * @see {@link #equals} + * @return -1 if this comes before that, 1 if that comes before this, 0 if they are equal. */ public int compareTo(NumberRange that) { if (equals(that)) { @@ -132,7 +130,7 @@ * </ul> * * @param that the NumberRage to compare with - * @return true if both NumberRanges are equal + * @return true if the NumberRanges are equal */ public boolean equals(NumberRange that) { boolean a1 = isStartInfinite(); @@ -187,7 +185,7 @@ /** * Does this NumberRange represent a range that is positively infinite. * - * @return true if the end position is >= positive infinity. + * @return true if the end position is >= positive infinity. */ public boolean isEndInfinite() { return end >= positiveInfinity; @@ -196,7 +194,7 @@ /** * Does this NumberRange represent a range that is negatively infinite. * - * @return true if the start positition is <= negative infinity + * @return true if the start position is <= negative infinity */ public boolean isStartInfinite() { return start <= negativeInfinity; Modified: trunk/shell/src/shell/org/jnode/shell/syntax/Argument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/Argument.java 2009-07-06 14:33:04 UTC (rev 5593) +++ trunk/shell/src/shell/org/jnode/shell/syntax/Argument.java 2009-07-06 15:23:39 UTC (rev 5594) @@ -437,7 +437,7 @@ * non-trivial completion. Completions should be registered by calling one * of the 'addCompletion' methods on the CompletionInfo. * - * @param completion the CompletionInfo object for registering any completions. + * @param completions the CompletionInfo object for registering any completions. * @param partial the argument string to be completed. */ public final void complete(CompletionInfo completions, String partial, int flags) { Modified: trunk/shell/src/shell/org/jnode/shell/syntax/MuParser.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/MuParser.java 2009-07-06 14:33:04 UTC (rev 5593) +++ trunk/shell/src/shell/org/jnode/shell/syntax/MuParser.java 2009-07-06 15:23:39 UTC (rev 5594) @@ -102,7 +102,7 @@ * have been used to populate Argument values in the ArgumentBundle. * * @param rootSyntax the root of the MuSyntax graph. - * @param completion if this is not <code>null</null>, do a completion parse, and record + * @param completions if this is not <code>null</null>, do a completion parse, and record * the completions here. * @param source the source of Tokens to be parsed * @param bundle the container for Argument objects; e.g. provided by the command. @@ -119,7 +119,7 @@ * have been used to populate Argument values in the ArgumentBundle. * * @param rootSyntax the root of the MuSyntax graph. - * @param completion if this is not <code>null</null>, do a completion parse, and record + * @param completions if this is not <code>null</null>, do a completion parse, and record * the completions here. * @param source the source of Tokens to be parsed * @param bundle the container for Argument objects; e.g. provided by the command. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-07-12 22:22:50
|
Revision: 5605 http://jnode.svn.sourceforge.net/jnode/?rev=5605&view=rev Author: lsantha Date: 2009-07-12 20:10:54 +0000 (Sun, 12 Jul 2009) Log Message: ----------- Fixed code style. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java trunk/core/src/core/org/jnode/vm/MathSupport.java trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java trunk/core/src/test/org/jnode/test/core/CompilerTest.java trunk/core/src/test/org/jnode/test/core/LongTest.java trunk/distr/src/apps/org/jnode/apps/jpartition/JPartitionCommand.java trunk/fs/src/driver/org/jnode/driver/block/GeometryException.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java trunk/fs/src/test/org/jnode/test/support/MockUtils.java trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFFontPeer.java trunk/gui/src/awt/org/jnode/awt/swingpeers/SwingToolkit.java Modified: trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -350,7 +350,7 @@ usedPlugins.put(fragment.getFullPluginId(), fragment); } - for (PluginPrerequisite prerequisite: plugin.descr.getPrerequisites()) { + for (PluginPrerequisite prerequisite : plugin.descr.getPrerequisites()) { String idOfUsedPlugin = createFullPluginId(prerequisite.getPluginId(), prerequisite.getPluginVersion()); usedPlugins.put(idOfUsedPlugin, findPlugin(idOfUsedPlugin)); Modified: trunk/core/src/core/org/jnode/vm/MathSupport.java =================================================================== --- trunk/core/src/core/org/jnode/vm/MathSupport.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/core/src/core/org/jnode/vm/MathSupport.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -53,7 +53,7 @@ } } - if(den == Long.MIN_VALUE) { + if (den == Long.MIN_VALUE) { return 0; } @@ -109,7 +109,7 @@ } } - if(den == Long.MIN_VALUE) { + if (den == Long.MIN_VALUE) { return num; } Modified: trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java =================================================================== --- trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/core/src/core/org/jnode/vm/isolate/VmIsolate.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -55,7 +55,6 @@ import org.jnode.vm.classmgr.VmIsolatedStatics; import org.jnode.vm.classmgr.VmType; import org.jnode.vm.scheduler.VmThread; -import gnu.classpath.SystemProperties; /** * VM specific implementation of the Isolate class. Modified: trunk/core/src/test/org/jnode/test/core/CompilerTest.java =================================================================== --- trunk/core/src/test/org/jnode/test/core/CompilerTest.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/core/src/test/org/jnode/test/core/CompilerTest.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -75,7 +75,7 @@ // "org.jnode.vm.VmStacReader", // "org.jnode.vm.classmgr.VmType", // "org.jnode.test.ArrayLongTest", - "org.jnode.test.ArrayTest", + "org.jnode.test.ArrayTest", // "org.jnode.test.Linpack", // "org.jnode.test.MultiANewArrayTest", // "org.jnode.test.Sieve", @@ -119,7 +119,7 @@ File classlib = new File("./all/lib/classlib.jar").getCanonicalFile(); final VmSystemClassLoader cl = new VmSystemClassLoader(new java.net.URL[]{ classes.toURI().toURL(), - new java.net.URL("jar:"+ classlib.toURI().toURL() + "!/"), + new java.net.URL("jar:" + classlib.toURI().toURL() + "!/"), }, arch); final Vm vm = new Vm("?", arch, cl.getSharedStatics(), false, cl, null); Modified: trunk/core/src/test/org/jnode/test/core/LongTest.java =================================================================== --- trunk/core/src/test/org/jnode/test/core/LongTest.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/core/src/test/org/jnode/test/core/LongTest.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -26,39 +26,39 @@ } private static void divtestLoop(long min, long max) { - for(long i = min; i < max; i++) { + for (long i = min; i < max; i++) { divtest(Long.MIN_VALUE, i); } - for(long i = min; i < max; i++) { + for (long i = min; i < max; i++) { divtest(Long.MAX_VALUE, i); } - for(long i = min; i < max; i++) { + for (long i = min; i < max; i++) { divtest(0, i); } - for(long i = min; i < max; i++) { + for (long i = min; i < max; i++) { divtest(1, i); } - for(long i = min; i < max; i++) { + for (long i = min; i < max; i++) { divtest(-1, i); } } private static void divtest(long num, long den) { - if(den == 0) return; + if (den == 0) return; long q1 = num / den; long q2 = MathSupport.ldiv(num , den); - if(q1 != q2){ + if (q1 != q2) { System.out.println("error for " + num + " / " + den); System.out.println(q1); System.out.println(q2); } q1 = num % den; q2 = MathSupport.lrem(num, den); - if(q1 != q2){ + if (q1 != q2) { System.out.println("error for " + num + " % " + den); System.out.println(q1); System.out.println(q2); Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/JPartitionCommand.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/jpartition/JPartitionCommand.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/distr/src/apps/org/jnode/apps/jpartition/JPartitionCommand.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -79,7 +79,8 @@ /** * {@inheritDoc} */ - public void doExecute(boolean install, InputStream in, PrintStream out, PrintStream err, boolean consoleView, boolean swingView) throws Exception { + public void doExecute(boolean install, InputStream in, PrintStream out, PrintStream err, boolean consoleView, + boolean swingView) throws Exception { ViewFactory viewFactory = consoleView ? new ConsoleViewFactory() : swingView ? new SwingViewFactory() : null; Modified: trunk/fs/src/driver/org/jnode/driver/block/GeometryException.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/GeometryException.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/fs/src/driver/org/jnode/driver/block/GeometryException.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -37,4 +37,4 @@ super(message); initCause(t); } -} \ No newline at end of file +} Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -93,7 +93,7 @@ Catalog catalog = fs.getCatalog(); Superblock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); LeafRecord fileRecord = catalog.createNode(name, this.folder - .getFolderId(), new CatalogNodeId(volumeHeader.getNextCatalogId()), CatalogFile.RECORD_TYPE_FILE); + .getFolderId(), new CatalogNodeId(volumeHeader.getNextCatalogId()), CatalogFile.RECORD_TYPE_FILE); HFSPlusEntry newEntry = new HFSPlusFile(fs, this, name, folderRecord); newEntry.setDirty(); Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -153,7 +153,8 @@ volumeHeader.create(params); log.debug("Volume header : \n" + volumeHeader.toString()); long volumeBlockUsed = - volumeHeader.getTotalBlocks() - volumeHeader.getFreeBlocks() - ((volumeHeader.getBlockSize() == 512) ? 2 : 1); + volumeHeader.getTotalBlocks() - volumeHeader.getFreeBlocks() - ((volumeHeader.getBlockSize() == 512) ? + 2 : 1); // --- log.debug("Write allocation bitmap bits to disk."); writeAllocationFile((int) volumeBlockUsed); Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -27,7 +27,6 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; -import org.jnode.driver.ApiNotFoundException; import org.jnode.fs.FileSystemException; import org.jnode.fs.hfsplus.catalog.CatalogNodeId; import org.jnode.fs.hfsplus.extent.ExtentDescriptor; @@ -436,7 +435,7 @@ return data; } - public void update() throws IOException{ + public void update() throws IOException { fs.getApi().write(1024, ByteBuffer.wrap(data)); } Modified: trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -288,7 +288,7 @@ entryCache.setEntry(entryPath.toString(), child); entryPath.setLength(directoryPathSize); - if(name != null){ + if (name != null) { list.add(name); } } Modified: trunk/fs/src/test/org/jnode/test/support/MockUtils.java =================================================================== --- trunk/fs/src/test/org/jnode/test/support/MockUtils.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/fs/src/test/org/jnode/test/support/MockUtils.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -46,7 +46,8 @@ return createMockObject(name, null, clsArgs, args); } - public static Object createMockObject(Class<?> name, MockInitializer initializer, Class<?>[] clsArgs, Object[] args) { + public static Object createMockObject(Class<?> name, MockInitializer initializer, + Class<?>[] clsArgs, Object[] args) { String shortName = getShortName(name); CGLibCoreMockExt cglibMock = new CGLibCoreMockExt(name, shortName); Mock mock = new Mock(cglibMock); Modified: trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFFontPeer.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFFontPeer.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/gui/src/awt/org/jnode/awt/font/truetype/TTFFontPeer.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -39,7 +39,7 @@ public class TTFFontPeer extends JNodeFontPeer<TTFontProvider, TTFFont> { - public TTFFontPeer(TTFontProvider provider, String name, Map<?,?> attrs) { + public TTFFontPeer(TTFontProvider provider, String name, Map<?, ?> attrs) { super(provider, name, attrs); } Modified: trunk/gui/src/awt/org/jnode/awt/swingpeers/SwingToolkit.java =================================================================== --- trunk/gui/src/awt/org/jnode/awt/swingpeers/SwingToolkit.java 2009-07-12 19:52:16 UTC (rev 5604) +++ trunk/gui/src/awt/org/jnode/awt/swingpeers/SwingToolkit.java 2009-07-12 20:10:54 UTC (rev 5605) @@ -478,7 +478,8 @@ } } else { comp = super.getTopComponentAt(x, y); - SwingBaseWindow<?, ?> window = (SwingBaseWindow<?, ?>) SwingUtilities.getAncestorOfClass(SwingBaseWindow.class, comp); + SwingBaseWindow<?, ?> window = (SwingBaseWindow<?, ?>) SwingUtilities. + getAncestorOfClass(SwingBaseWindow.class, comp); if (window != null) { Rectangle r = window.getBounds(); Insets ins = window.getSwingPeer().getInsets(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-07-17 06:42:49
|
Revision: 5610 http://jnode.svn.sourceforge.net/jnode/?rev=5610&view=rev Author: lsantha Date: 2009-07-17 06:42:48 +0000 (Fri, 17 Jul 2009) Log Message: ----------- Fixed the building of JDWP plugin. Modified Paths: -------------- trunk/all/build.xml trunk/core/descriptors/org.classpath.ext.jdwp.xml Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2009-07-17 06:40:54 UTC (rev 5609) +++ trunk/all/build.xml 2009-07-17 06:42:48 UTC (rev 5610) @@ -390,7 +390,6 @@ <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.jdwp.xml"/> <include name="org.classpath.ext.management.xml"/> <include name="org.classpath.ext.print.xml"/> <include name="org.classpath.ext.security.xml"/> @@ -478,7 +477,6 @@ <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.jdwp.xml"/> <exclude name="org.classpath.ext.management.xml"/> <exclude name="org.classpath.ext.print.xml"/> <exclude name="org.classpath.ext.security.xml"/> Modified: trunk/core/descriptors/org.classpath.ext.jdwp.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.jdwp.xml 2009-07-17 06:40:54 UTC (rev 5609) +++ trunk/core/descriptors/org.classpath.ext.jdwp.xml 2009-07-17 06:42:48 UTC (rev 5610) @@ -11,7 +11,7 @@ license-name="classpath"> <runtime> - <library name="classlib.jar"> + <library name="jnode-core.jar"> <export name="gnu.classpath.jdwp.*"/> <export name="gnu.classpath.jdwp.event.*"/> <export name="gnu.classpath.jdwp.event.filters.*"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-07-22 10:07:30
|
Revision: 5616 http://jnode.svn.sourceforge.net/jnode/?rev=5616&view=rev Author: lsantha Date: 2009-07-22 10:07:29 +0000 (Wed, 22 Jul 2009) Log Message: ----------- Adedd NativeProcesImpl. Modified Paths: -------------- trunk/all/lib/ftp.properties Added Paths: ----------- trunk/core/src/openjdk/vm/java/lang/JNodeProcess.java trunk/core/src/openjdk/vm/java/lang/NativeProcessImpl.java Modified: trunk/all/lib/ftp.properties =================================================================== --- trunk/all/lib/ftp.properties 2009-07-22 08:26:30 UTC (rev 5615) +++ trunk/all/lib/ftp.properties 2009-07-22 10:07:29 UTC (rev 5616) @@ -1,3 +1,3 @@ -classlib.url=http://codemammoth.com/jnodeftp/classlib/20090524110358 -classlib.md5=d49489983eb3850e707c0fe8da830806 -classlib-src.md5=e531cd0e489a81e0e38542b3412077bb \ No newline at end of file +classlib.url=http://codemammoth.com/jnodeftp/classlib/20090722120045 +classlib.md5=db80e29d8154341d4cf4dc8b1476a131 +classlib-src.md5=72ead15492b953ed1b8022b816971730 \ No newline at end of file Added: trunk/core/src/openjdk/vm/java/lang/JNodeProcess.java =================================================================== --- trunk/core/src/openjdk/vm/java/lang/JNodeProcess.java (rev 0) +++ trunk/core/src/openjdk/vm/java/lang/JNodeProcess.java 2009-07-22 10:07:29 UTC (rev 5616) @@ -0,0 +1,53 @@ +package java.lang; + +import java.io.OutputStream; +import java.io.InputStream; +import java.io.IOException; +import java.util.Arrays; + +/** + * + */ +class JNodeProcess extends Process { + + static Process start(String[] cmdarray, java.util.Map<String, String> environment, String dir, + boolean redirectErrorStream) throws IOException { + + System.out.println("cmdarray: " + Arrays.asList(cmdarray)); + System.out.println("environment: " + environment); + System.out.println("dir: " + dir); + System.out.println("redirectErrorStream: " + redirectErrorStream); + + return new JNodeProcess(); + } + + @Override + public OutputStream getOutputStream() { + return null; + } + + @Override + public InputStream getInputStream() { + return null; + } + + @Override + public InputStream getErrorStream() { + return null; + } + + @Override + public int waitFor() throws InterruptedException { + return 0; + } + + @Override + public int exitValue() { + return 0; + } + + @Override + public void destroy() { + + } +} Added: trunk/core/src/openjdk/vm/java/lang/NativeProcessImpl.java =================================================================== --- trunk/core/src/openjdk/vm/java/lang/NativeProcessImpl.java (rev 0) +++ trunk/core/src/openjdk/vm/java/lang/NativeProcessImpl.java 2009-07-22 10:07:29 UTC (rev 5616) @@ -0,0 +1,66 @@ +package java.lang; + +import java.io.IOException; + +/** + * + */ +class NativeProcessImpl { + private NativeProcessImpl() {} + static Process start(String[] cmdarray, java.util.Map<String, String> environment, String dir, + boolean redirectErrorStream) throws IOException { + return JNodeProcess.start(cmdarray, environment, dir, redirectErrorStream); + } +} + +/* +private ProcessImpl() {} // Not instantiable + + private static byte[] toCString(String s) { + if (s == null) + return null; + byte[] bytes = s.getBytes(); + byte[] result = new byte[bytes.length + 1]; + System.arraycopy(bytes, 0, + result, 0, + bytes.length); + result[result.length-1] = (byte)0; + return result; + } + + // Only for use by ProcessBuilder.start() + static Process start(String[] cmdarray, + java.util.Map<String,String> environment, + String dir, + boolean redirectErrorStream) + throws IOException + { + assert cmdarray != null && cmdarray.length > 0; + + // Convert arguments to a contiguous block; it's easier to do + // memory management in Java than in C. + byte[][] args = new byte[cmdarray.length-1][]; + int size = args.length; // For added NUL bytes + for (int i = 0; i < args.length; i++) { + args[i] = cmdarray[i+1].getBytes(); + size += args[i].length; + } + byte[] argBlock = new byte[size]; + int i = 0; + for (byte[] arg : args) { + System.arraycopy(arg, 0, argBlock, i, arg.length); + i += arg.length + 1; + // No need to write NUL bytes explicitly + } + + int[] envc = new int[1]; + byte[] envBlock = ProcessEnvironment.toEnvironmentBlock(environment, envc); + + return new UNIXProcess + (toCString(cmdarray[0]), + argBlock, args.length, + envBlock, envc[0], + toCString(dir), + redirectErrorStream); + } + */ \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-08-12 19:26:04
|
Revision: 5639 http://jnode.svn.sourceforge.net/jnode/?rev=5639&view=rev Author: lsantha Date: 2009-08-12 19:25:56 +0000 (Wed, 12 Aug 2009) Log Message: ----------- Checkstyle upgrade to v 5.0 Modified Paths: -------------- trunk/all/build.xml trunk/all/jnode_checks.xml Added Paths: ----------- trunk/core/lib/checkstyle-all-5.0.jar Removed Paths: ------------- trunk/core/lib/checkstyle-all-4.4.jar Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2009-08-10 21:34:16 UTC (rev 5638) +++ trunk/all/build.xml 2009-08-12 19:25:56 UTC (rev 5639) @@ -1149,7 +1149,7 @@ </target> <target name="checkstyle" description="check the mandatory code conventions"> - <taskdef resource="checkstyletask.properties" classpath="../core/lib/checkstyle-all-4.4.jar"/> + <taskdef resource="checkstyletask.properties" classpath="../core/lib/checkstyle-all-5.0.jar"/> <checkstyle config="jnode_checks.xml"> <fileset dir="../builder/src/builder" includes="**/*.java"/> <fileset dir="../builder/src/configure" includes="**/*.java"/> @@ -1177,7 +1177,7 @@ </target> <target name="checkstyle-new" description="check the recommanded code conventions"> - <taskdef resource="checkstyletask.properties" classpath="../core/lib/checkstyle-all-4.4.jar"/> + <taskdef resource="checkstyletask.properties" classpath="../core/lib/checkstyle-all-5.0.jar"/> <checkstyle config="new_checks.xml"> <!-- <fileset dir="../builder/src/builder" includes="**/*.java"/> Modified: trunk/all/jnode_checks.xml =================================================================== --- trunk/all/jnode_checks.xml 2009-08-10 21:34:16 UTC (rev 5638) +++ trunk/all/jnode_checks.xml 2009-08-12 19:25:56 UTC (rev 5639) @@ -39,6 +39,9 @@ <!-- Checks whether files end with a new line. --> <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> <module name="NewlineAtEndOfFile"/> + <module name="FileTabCharacter"> + <property name="eachLine" value="true"/> + </module> <!-- Checks that property files contain the same keys. --> <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> @@ -129,7 +132,6 @@ </module> <module name="Indentation"/> - <module name="TabCharacter"/> <!-- Modifier Checks --> <!-- See http://checkstyle.sf.net/config_modifiers.html --> Deleted: trunk/core/lib/checkstyle-all-4.4.jar =================================================================== (Binary files differ) Added: trunk/core/lib/checkstyle-all-5.0.jar =================================================================== (Binary files differ) Property changes on: trunk/core/lib/checkstyle-all-5.0.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-08-12 19:27:18
|
Revision: 5640 http://jnode.svn.sourceforge.net/jnode/?rev=5640&view=rev Author: lsantha Date: 2009-08-12 19:27:09 +0000 (Wed, 12 Aug 2009) Log Message: ----------- Fixed coding style. Modified Paths: -------------- trunk/core/src/test/org/jnode/test/core/IsolatedJavaTest.java trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java trunk/shell/src/shell/org/jnode/shell/CommandShell.java trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneContext.java trunk/shell/src/shell/org/jnode/shell/bjorne/ReadBuiltin.java Modified: trunk/core/src/test/org/jnode/test/core/IsolatedJavaTest.java =================================================================== --- trunk/core/src/test/org/jnode/test/core/IsolatedJavaTest.java 2009-08-12 19:25:56 UTC (rev 5639) +++ trunk/core/src/test/org/jnode/test/core/IsolatedJavaTest.java 2009-08-12 19:27:09 UTC (rev 5640) @@ -1,7 +1,6 @@ package org.jnode.test.core; import javax.isolate.Isolate; -import javax.isolate.IsolateStartupException; import javax.isolate.Link; import javax.isolate.LinkMessage; import javax.isolate.IsolateStatus; @@ -12,8 +11,6 @@ import java.net.MalformedURLException; import java.util.ArrayList; import java.util.List; -import java.util.Map; -import java.util.HashMap; import java.util.Properties; import java.util.jar.JarFile; import java.util.jar.Manifest; @@ -75,8 +72,7 @@ arg.startsWith("-agentpath") || arg.startsWith("-javaagent") || arg.startsWith("-splash") || - false - ) { + false) { //ignore } else if (arg.startsWith("-")) { //error invalid option @@ -116,7 +112,7 @@ Link link = newIsolate.newStatusLink(); newIsolate.start(); //wait for exit - for (; ;) { + for (;;) { LinkMessage msg = link.receive(); if (msg.containsStatus() && IsolateStatus.State.EXITED.equals(msg.extractStatus().getState())) break; Modified: trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java =================================================================== --- trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java 2009-08-12 19:25:56 UTC (rev 5639) +++ trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java 2009-08-12 19:27:09 UTC (rev 5640) @@ -21,7 +21,6 @@ package org.jnode.fs.hfsplus; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import junit.framework.TestCase; @@ -33,7 +32,6 @@ import org.jnode.emu.plugin.model.DummyExtensionPoint; import org.jnode.emu.plugin.model.DummyPluginDescriptor; import org.jnode.fs.FSDirectory; -import org.jnode.fs.FileSystemException; import org.jnode.fs.service.FileSystemService; import org.jnode.fs.service.def.FileSystemPlugin; import org.jnode.test.support.TestUtils; Modified: trunk/shell/src/shell/org/jnode/shell/CommandShell.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/CommandShell.java 2009-08-12 19:25:56 UTC (rev 5639) +++ trunk/shell/src/shell/org/jnode/shell/CommandShell.java 2009-08-12 19:27:09 UTC (rev 5640) @@ -396,7 +396,7 @@ try { Thread.sleep(100000); } catch (InterruptedException ex2) { - + //ignore } } finally { if (reader != null) { Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneContext.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneContext.java 2009-08-12 19:25:56 UTC (rev 5639) +++ trunk/shell/src/shell/org/jnode/shell/bjorne/BjorneContext.java 2009-08-12 19:27:09 UTC (rev 5640) @@ -449,7 +449,7 @@ * @param text the text to be processed. * @return the de-quoted text */ - static StringBuilder dequote(String text) { + static StringBuilder dequote(String text) { int len = text.length(); StringBuilder sb = new StringBuilder(len); int quote = 0; @@ -474,7 +474,7 @@ break; default: sb.append(ch); - break; + break; } } return sb; @@ -567,7 +567,7 @@ * @param wordTokens the destination for the tokens. * @throws ShellException */ - void splitAndAppend(BjorneToken token, List<BjorneToken> wordTokens) + void splitAndAppend(BjorneToken token, List<BjorneToken> wordTokens) throws ShellException { String text = token.getText(); StringBuilder sb = null; @@ -1032,8 +1032,7 @@ if (ci.peekCh() == '(') { ci.nextCh(); return dollarParenParenExpand(ci); - } - else { + } else { String commandLine = dollarBacktickExpand(ci, ')').toString(); if (ci.nextCh() != ')') { throw new ShellSyntaxException("Unmatched \"(\" (left parenthesis)"); Modified: trunk/shell/src/shell/org/jnode/shell/bjorne/ReadBuiltin.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/bjorne/ReadBuiltin.java 2009-08-12 19:25:56 UTC (rev 5639) +++ trunk/shell/src/shell/org/jnode/shell/bjorne/ReadBuiltin.java 2009-08-12 19:27:09 UTC (rev 5640) @@ -164,7 +164,7 @@ break; default: sb2.append("\\\n"); - break; + break; } } String ifsWhitespace = sb1.toString(); @@ -183,7 +183,7 @@ ifsNonWhitespace + "][" + ifsWhitespace + "]*(|[^" + ifsWhitespace + "].*)"); } else if (ifsWhitespace.length() > 0) { ifsSplittingPattern = Pattern.compile( - "([^" + ifsWhitespace +"]*)[" + ifsWhitespace + "]+(|[^" + ifsWhitespace + "].*)"); + "([^" + ifsWhitespace + "]*)[" + ifsWhitespace + "]+(|[^" + ifsWhitespace + "].*)"); } else { ifsSplittingPattern = Pattern.compile( "([^" + ifsNonWhitespace + "]*)[" + ifsNonWhitespace + "](.*)"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2009-08-15 16:35:57
|
Revision: 5645 http://jnode.svn.sourceforge.net/jnode/?rev=5645&view=rev Author: fduminy Date: 2009-08-15 16:35:50 +0000 (Sat, 15 Aug 2009) Log Message: ----------- improvements of the onheap command : - replaced HeapStatistics#toString() by HeapStatistics#writeTo(Appendable) for better genericity - added BufferedWriter to the output stream for better performances (it's about 2 times faster with a 2Kb buffer) Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java trunk/core/src/core/org/jnode/vm/memmgr/HeapStatistics.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 2009-08-15 16:23:23 UTC (rev 5644) +++ trunk/cli/src/commands/org/jnode/command/system/OnHeapCommand.java 2009-08-15 16:35:50 UTC (rev 5645) @@ -20,6 +20,7 @@ package org.jnode.command.system; +import java.io.BufferedWriter; import java.io.PrintWriter; import org.jnode.shell.AbstractCommand; @@ -69,7 +70,7 @@ stats.setMinimumTotalSize(argMinTotalSize.getValue()); } - out.println(stats.toString()); + stats.writeTo(new BufferedWriter(getOutput().getWriter(), 2048)); } } Modified: trunk/core/src/core/org/jnode/vm/memmgr/HeapStatistics.java =================================================================== --- trunk/core/src/core/org/jnode/vm/memmgr/HeapStatistics.java 2009-08-15 16:23:23 UTC (rev 5644) +++ trunk/core/src/core/org/jnode/vm/memmgr/HeapStatistics.java 2009-08-15 16:35:50 UTC (rev 5645) @@ -20,6 +20,8 @@ package org.jnode.vm.memmgr; +import java.io.IOException; + import org.jnode.vm.VmSystemObject; /** @@ -46,9 +48,10 @@ public abstract void setMinimumTotalSize(long bytes); /** - * Convert the statistical data to a string. - * - * @see java.lang.Object#toString() + * Write the statistical data to an {@link Appendable}. + * + * @param a + * @throws IOException */ - public abstract String toString(); + public abstract void writeTo(Appendable a) throws IOException; } Modified: trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java =================================================================== --- trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java 2009-08-15 16:23:23 UTC (rev 5644) +++ trunk/core/src/core/org/jnode/vm/memmgr/def/DefHeapStatistics.java 2009-08-15 16:35:50 UTC (rev 5645) @@ -20,6 +20,7 @@ package org.jnode.vm.memmgr.def; +import java.io.IOException; import java.util.TreeMap; import org.jnode.util.NumberUtils; @@ -74,8 +75,11 @@ this.minTotalSize = bytes; } - public String toString() { - final StringBuilder sb = new StringBuilder(); + /** + * {@inheritDoc} + * @throws IOException + */ + public void writeTo(Appendable a) throws IOException { boolean first = true; for (HeapCounter c : countData.values()) { @@ -83,15 +87,13 @@ if (first) { first = false; } else { - sb.append(newline); + a.append(newline); } - c.append(sb); + c.append(a); } } - - return sb.toString(); } - + static final class HeapCounter { private final String name; @@ -122,18 +124,19 @@ return objectSize * (long) instanceCount; } - public void append(StringBuilder sb) { - sb.append(name); - sb.append(" #"); - sb.append(instanceCount); + public void append(Appendable a) throws IOException { + a.append(name); + a.append(" #"); + a.append(Integer.toString(instanceCount)); if (objectSize != 0) { - sb.append(usage); + a.append(usage); long size = getTotalSize(); if (size >= 1024) { - sb.append(NumberUtils.size(size) + " (" + getTotalSize() + "b)"); + a.append(NumberUtils.toBinaryByte(size)).append(" ("); + a.append(Long.toString(size)).append("b)"); } else { - sb.append(size + "b"); + a.append(Long.toString(size)).append('b'); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-08-16 11:35:52
|
Revision: 5650 http://jnode.svn.sourceforge.net/jnode/?rev=5650&view=rev Author: lsantha Date: 2009-08-16 11:35:45 +0000 (Sun, 16 Aug 2009) Log Message: ----------- Replaced DoPrivileged pragma with PrivilegedAction. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/jifs/directories/JIFSDthreads.java trunk/shell/src/shell/org/jnode/shell/syntax/FileArgument.java Modified: trunk/fs/src/fs/org/jnode/fs/jifs/directories/JIFSDthreads.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/jifs/directories/JIFSDthreads.java 2009-08-16 09:56:10 UTC (rev 5649) +++ trunk/fs/src/fs/org/jnode/fs/jifs/directories/JIFSDthreads.java 2009-08-16 11:35:45 UTC (rev 5650) @@ -29,9 +29,7 @@ import org.jnode.fs.jifs.JIFSDirectory; import org.jnode.fs.jifs.JIFSFile; import org.jnode.fs.jifs.files.JIFSFthread; -import org.jnode.annotation.DoPrivileged; - /** * Directory containing one file for each java.lang.thread. Based on the thread * command. @@ -50,14 +48,19 @@ setParent(parent); } - @DoPrivileged public void refresh() { super.clear(); - ThreadGroup grp = Thread.currentThread().getThreadGroup(); - while (grp.getParent() != null) { - grp = grp.getParent(); - } - addGroup(grp); + AccessController.doPrivileged(new PrivilegedAction<Object>() { + @Override + public Object run() { + ThreadGroup grp = Thread.currentThread().getThreadGroup(); + while (grp.getParent() != null) { + grp = grp.getParent(); + } + addGroup(grp); + return null; + } + }); } private void addGroup(final ThreadGroup grp) { Modified: trunk/shell/src/shell/org/jnode/shell/syntax/FileArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/syntax/FileArgument.java 2009-08-16 09:56:10 UTC (rev 5649) +++ trunk/shell/src/shell/org/jnode/shell/syntax/FileArgument.java 2009-08-16 11:35:45 UTC (rev 5650) @@ -23,10 +23,11 @@ import java.io.File; import java.security.AccessController; import java.security.PrivilegedAction; +import java.security.PrivilegedExceptionAction; +import java.security.PrivilegedActionException; import org.jnode.driver.console.CompletionInfo; import org.jnode.shell.CommandLine.Token; -import org.jnode.annotation.DoPrivileged; import sun.security.action.GetPropertyAction; /** @@ -80,34 +81,48 @@ } @Override - @DoPrivileged - protected File doAccept(Token token, int flags) throws CommandSyntaxException { + protected File doAccept(final Token token, final int flags) throws CommandSyntaxException { if (token.text.length() > 0) { - File file = new File(token.text); - if ((flags & HYPHEN_IS_SPECIAL) == 0 || !file.getPath().equals("-")) { - if (isExisting(flags) && !file.exists()) { - throw new CommandSyntaxException("this file or directory does not exist"); - } - if (isNonexistent(flags) && file.exists()) { - throw new CommandSyntaxException("this file or directory already exist"); - } - if ((flags & ALLOW_DODGY_NAMES) == 0) { - File f = file; - do { - // This assumes that option names start with '-'. - if (f.getName().startsWith("-")) { - if (f == file && !file.isAbsolute() && f.getParent() == null) { - // The user most likely meant this to be an option name ... - throw new CommandSyntaxException("unexpected or unknown option"); - } else { - throw new CommandSyntaxException("file or directory name starts with a '-'"); + try { + return AccessController.doPrivileged(new PrivilegedExceptionAction<File>() { + @Override + public File run() throws Exception { + File file = new File(token.text); + if ((flags & HYPHEN_IS_SPECIAL) == 0 || !file.getPath().equals("-")) { + if (isExisting(flags) && !file.exists()) { + throw new CommandSyntaxException("this file or directory does not exist"); } + if (isNonexistent(flags) && file.exists()) { + throw new CommandSyntaxException("this file or directory already exist"); + } + if ((flags & ALLOW_DODGY_NAMES) == 0) { + File f = file; + do { + // This assumes that option names start with '-'. + if (f.getName().startsWith("-")) { + if (f == file && !file.isAbsolute() && f.getParent() == null) { + // The user most likely meant this to be an option name ... + throw new CommandSyntaxException("unexpected or unknown option"); + } else { + throw new CommandSyntaxException( + "file or directory name starts with a '-'"); + } + } + f = f.getParentFile(); + } while (f != null); + } } - f = f.getParentFile(); - } while (f != null); + return file; + } + }); + } catch (PrivilegedActionException x) { + Exception e = x.getException(); + if (e instanceof CommandSyntaxException) { + throw (CommandSyntaxException) e; + } else { + throw new RuntimeException(e); } } - return file; } else { throw new CommandSyntaxException("invalid file name"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-01-02 09:31:40
|
Revision: 5704 http://jnode.svn.sourceforge.net/jnode/?rev=5704&view=rev Author: lsantha Date: 2010-01-02 09:31:33 +0000 (Sat, 02 Jan 2010) Log Message: ----------- Codestyle fixes. Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/file/DuCommand.java trunk/core/src/core/org/jnode/vm/VmMagic.java trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.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/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java Modified: trunk/cli/src/commands/org/jnode/command/file/DuCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/DuCommand.java 2009-12-30 21:12:17 UTC (rev 5703) +++ trunk/cli/src/commands/org/jnode/command/file/DuCommand.java 2010-01-02 09:31:33 UTC (rev 5704) @@ -48,38 +48,52 @@ public class DuCommand extends AbstractCommand { private static final String HELP_SUPER = - "With no arguments, `du' reports the disk space for the current directory. Normally the disk space is printed in units of 1024 bytes, but this can be overridden"; + "With no arguments, `du' reports the disk space for the current directory. Normally the disk space is " + + "printed in units of 1024 bytes, but this can be overridden"; private static final String HELP_DIR = "directory to start printing sizes recursively"; private static final String HELP_ALL = "Show counts for all files, not just directories."; private static final String HELP_BLOCK_SIZE_1 = "Print sizes in bytes, overriding the default block size"; private static final String HELP_TOTAL = - "Print a grand total of all arguments after all arguments have been processed. This can be used to find out the total disk usage of a given set of files or directories."; + "Print a grand total of all arguments after all arguments have been processed. This can be used to " + + "find out the total disk usage of a given set of files or directories."; private static final String HELP_DEREF_ARGS = - "Dereference symbolic links that are command line arguments. Does not affect other symbolic links. This is helpful for finding out the disk usage of directories, such as `/usr/tmp', which are often symbolic links. (not implemented"; + "Dereference symbolic links that are command line arguments. Does not affect other symbolic links. " + + "This is helpful for finding out the disk usage of directories, such as `/usr/tmp', " + + "which are often symbolic links. (not implemented"; private static final String HELP_HUMAN_READABLE_1024 = - "Append a size letter such as `M' for megabytes to each size. Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes. Use the `-H' or `--si' option if you prefer powers of 1000."; + "Append a size letter such as `M' for megabytes to each size. Powers of 1024 are used, not 1000; " + + "`M' stands for 1,048,576 bytes. Use the `-H' or `--si' option if you prefer powers of 1000."; private static final String HELP_HUMAN_READABLE_1000 = - "Append a size letter such as `M' for megabytes to each size. (SI is the International System of Units, which defines these letters as prefixes.) Powers of 1000 are used, not 1024; `M' stands for 1,000,000 bytes. Use the `-h' or `--human-readable' option if you prefer powers of 1024."; + "Append a size letter such as `M' for megabytes to each size. (SI is the International System of Units, " + + "which defines these letters as prefixes.) Powers of 1000 are used, not 1024; " + + "`M' stands for 1,000,000 bytes. Use the `-h' or `--human-readable' option if you prefer " + + "powers of 1024."; private static final String HELP_BLOCK_SIZE_1024 = "Print sizes in 1024-byte blocks, overriding the default block size"; private static final String HELP_COUNT_LINKS = "Count the size of all files, even if they have appeared already (as a hard link). (not implemented"; private static final String HELP_DEREF = - "Dereference symbolic links (show the disk space used by the file or directory that the link points to instead of the space used by the link). (not implemented"; + "Dereference symbolic links (show the disk space used by the file or directory that the link points to " + + "instead of the space used by the link). (not implemented"; private static final String HELP_MAX_DEPTH = - "Show the total for each directory (and file if -all) that is at most MAX_DEPTH levels down from the root of the hierarchy. The root is at level 0, so `du --max-depth=0' is equivalent to `du -s'. (not tested)"; + "Show the total for each directory (and file if -all) that is at most MAX_DEPTH levels down " + + "from the root of the hierarchy. The root is at level 0, so `du --max-depth=0' is equivalent " + + "to `du -s'. (not tested)"; private static final String HELP_BLOCK_SIZE_1024x1024 = "Print sizes in megabyte (that is, 1,048,576-byte) blocks."; private static final String HELP_SUM = "Display only a total for each argument."; private static final String HELP_SEPERATE_DIRS = "Report the size of each directory separately, not including the sizes of subdirectories."; private static final String HELP_ONE_FS = - "Skip directories that are on different filesystems from the one that the argument being processed is on. (not implemented)"; + "Skip directories that are on different filesystems from the one that the argument " + + "being processed is on. (not implemented)"; private static final String HELP_EXCLUDE = - "When recursing, skip subdirectories or files matching PAT. For example, `du --exclude='*.o'' excludes files whose names end in `.o'. (not tested)"; + "When recursing, skip subdirectories or files matching PAT. For example, `du --exclude='*.o'' " + + "excludes files whose names end in `.o'. (not tested)"; private static final String HELP_EXCLUDE_FROM = - "Like `--exclude', except take the patterns to exclude from FILE, one per line. If FILE is `-', take the patterns from standard input. (not implemented)"; + "Like `--exclude', except take the patterns to exclude from FILE, one per line. If FILE is `-', " + + "take the patterns from standard input. (not implemented)"; private static final String HELP_BLOCK_SIZE_CUSTOM = "Print sizes in the user defined block size, overriding the default block size"; private static final String HELP_FS_BLOCK_SIZE = Modified: trunk/core/src/core/org/jnode/vm/VmMagic.java =================================================================== --- trunk/core/src/core/org/jnode/vm/VmMagic.java 2009-12-30 21:12:17 UTC (rev 5703) +++ trunk/core/src/core/org/jnode/vm/VmMagic.java 2010-01-02 09:31:33 UTC (rev 5704) @@ -36,7 +36,8 @@ * Methods in this class can also be called from inside JNode. * * @author Ewout Prangsma (ep...@us...) - * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass} to get the list of "magic" classes (including this class). + * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicClass} to get the list of "magic" classes + * (including this class). * @see {@link org.jnode.vm.compiler.BaseMagicHelper.MagicMethod} to get the list of "magic" methods. */ @MagicPermission Modified: trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.java =================================================================== --- trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.java 2009-12-30 21:12:17 UTC (rev 5703) +++ trunk/core/src/core/org/jnode/vm/classmgr/ObjectLayout.java 2010-01-02 09:31:33 UTC (rev 5704) @@ -21,7 +21,6 @@ package org.jnode.vm.classmgr; import org.jnode.annotation.Inline; -import org.jnode.vm.VmArchitecture; /** * <description> @@ -32,19 +31,21 @@ /** * The offset of the flags of an object from the start of the object. This - * value must be multiplied by {@link VmArchitecture#getReferenceSize() SLOT_SIZE} to get the offset in bytes. + * value must be multiplied by {@link org.jnode.vm.VmArchitecture#getReferenceSize() SLOT_SIZE} + * to get the offset in bytes. */ public static final int FLAGS_SLOT = -2; /** * The offset of the TIB of an object from the start of the object. This - * value must be multiplied by {@link VmArchitecture#getReferenceSize() SLOT_SIZE} to get the offset in bytes. + * value must be multiplied by {@link org.jnode.vm.VmArchitecture#getReferenceSize() SLOT_SIZE} + * to get the offset in bytes. */ public static final int TIB_SLOT = -1; /** * The size of the header of an object. This value must be multiplied by - * {@link VmArchitecture#getReferenceSize() SLOT_SIZE} to get the size in bytes. + * {@link org.jnode.vm.VmArchitecture#getReferenceSize() SLOT_SIZE} to get the size in bytes. */ public static final int HEADER_SLOTS = 2; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java 2009-12-30 21:12:17 UTC (rev 5703) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java 2010-01-02 09:31:33 UTC (rev 5704) @@ -73,7 +73,8 @@ /** * Actual converter from bytecodes to X86 native code. Uses a virtual stack to - * delay item emission, as described in the <a href="http://orp.sourceforge.net/">Open Runtime Platform (ORP)</a> project. + * delay item emission, as described in the <a href="http://orp.sourceforge.net/">Open Runtime Platform (ORP)</a> + * project. * * @author Ewout Prangsma (ep...@us...) * @author Patrik Reali Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java 2009-12-30 21:12:17 UTC (rev 5703) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java 2010-01-02 09:31:33 UTC (rev 5704) @@ -74,7 +74,8 @@ /** * Actual converter from bytecodes to X86 native code. Uses a virtual stack to - * delay item emission, as described in the <a href="http://orp.sourceforge.net/">Open Runtime Platform (ORP)</a> project. + * delay item emission, as described in the <a href="http://orp.sourceforge.net/">Open Runtime Platform (ORP)</a> + * project. * * @author Ewout Prangsma (ep...@us...) * @author Patrik Reali Modified: trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2009-12-30 21:12:17 UTC (rev 5703) +++ trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2010-01-02 09:31:33 UTC (rev 5704) @@ -280,7 +280,7 @@ // never include the parent directory and the current directory in // the result if they exist by any chance. - if (".".equals(name) || "..".equals(name)){ + if (".".equals(name) || "..".equals(name)) { continue; } Modified: trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java =================================================================== --- trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java 2009-12-30 21:12:17 UTC (rev 5703) +++ trunk/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java 2010-01-02 09:31:33 UTC (rev 5704) @@ -177,7 +177,7 @@ for (y = 0, x = 0, sum = 0; x < eeSize; x++) { int value = doEepromCmd((eeReadCmd | (x << 16)), 27); eeprom[x] = value; - sum += (short)value; + sum += (short) value; if (x < 3) { hwAddrArr[y++] = (byte) value; hwAddrArr[y++] = (byte) (value >> 8); @@ -407,7 +407,7 @@ regs.setReg16(SCBeeprom, EE_ENB); eepromDelay(2); regs.setReg16(SCBeeprom, (EE_ENB & ~EE_CS)); - return NumberUtils.toUnsigned((short)retVal); + return NumberUtils.toUnsigned((short) retVal); } // --- OTHER METHODS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-01-30 08:30:35
|
Revision: 5719 http://jnode.svn.sourceforge.net/jnode/?rev=5719&view=rev Author: lsantha Date: 2010-01-30 08:30:27 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Findbugs updated to version 1.3.9. Fixed finbugs ant target. Modified Paths: -------------- trunk/all/build.xml Added Paths: ----------- trunk/builder/lib/findbugs/ trunk/builder/lib/findbugs/lib/ trunk/builder/lib/findbugs/lib/annotations.jar trunk/builder/lib/findbugs/lib/ant.jar trunk/builder/lib/findbugs/lib/asm-3.1.jar trunk/builder/lib/findbugs/lib/asm-analysis-3.1.jar trunk/builder/lib/findbugs/lib/asm-commons-3.1.jar trunk/builder/lib/findbugs/lib/asm-tree-3.1.jar trunk/builder/lib/findbugs/lib/asm-util-3.1.jar trunk/builder/lib/findbugs/lib/asm-xml-3.1.jar trunk/builder/lib/findbugs/lib/bcel.jar trunk/builder/lib/findbugs/lib/buggy.icns trunk/builder/lib/findbugs/lib/commons-lang-2.4.jar trunk/builder/lib/findbugs/lib/dom4j-1.6.1.jar trunk/builder/lib/findbugs/lib/findbugs-ant.jar trunk/builder/lib/findbugs/lib/findbugs.jar trunk/builder/lib/findbugs/lib/jFormatString.jar trunk/builder/lib/findbugs/lib/jaxen-1.1.1.jar trunk/builder/lib/findbugs/lib/jdepend-2.9.jar trunk/builder/lib/findbugs/lib/jsr305.jar trunk/builder/lib/findbugs/lib/mysql-connector-java-5.1.7-bin.jar Removed Paths: ------------- trunk/core/lib/findbugs/ Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2010-01-10 14:46:36 UTC (rev 5718) +++ trunk/all/build.xml 2010-01-30 08:30:27 UTC (rev 5719) @@ -1199,12 +1199,16 @@ </target> <target name="findbugs" depends="assemble-plugins"> - <taskdef name="findbugs" classpath="../core/lib/findbugs/lib/findbugs-ant.jar" + <property name="findbugs.home" value="../builder/lib/findbugs"/> + <property name="findbugs.output" value="${reports.dir}/findbugs.html"/> + <taskdef name="findbugs" classpath="${findbugs.home}/lib/findbugs-ant.jar" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/> - <findbugs home="../core/lib/findbugs/" output="html" outputFile="./build/findbugs.html" > + <findbugs home="${findbugs.home}" output="html" outputFile="${findbugs.output}" > <auxclasspath> <pathelement location="./build/plugins/rt_${jnode-ver}.jar" /> + <pathelement location="./build/plugins/rt.vm_${jnode-ver}.jar" /> <pathelement location="./build/plugins/org.classpath.ext.core_${jnode-ver}.jar" /> + <pathelement location="./build/plugins/org.classpath.ext.security_${jnode-ver}.jar" /> <pathelement location="./build/plugins/nanoxml_1.4.jar" /> <pathelement location="${nanoxml-java.jar}" /> <pathelement location="${log4j.jar}" /> Added: trunk/builder/lib/findbugs/lib/annotations.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/annotations.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/ant.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/ant.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/asm-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/asm-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/asm-analysis-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/asm-analysis-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/asm-commons-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/asm-commons-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/asm-tree-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/asm-tree-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/asm-util-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/asm-util-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/asm-xml-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/asm-xml-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/bcel.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/bcel.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/buggy.icns =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/buggy.icns ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/commons-lang-2.4.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/commons-lang-2.4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/dom4j-1.6.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/dom4j-1.6.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/findbugs-ant.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/findbugs-ant.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/findbugs.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/findbugs.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/jFormatString.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/jFormatString.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/jaxen-1.1.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/jaxen-1.1.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/jdepend-2.9.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/jdepend-2.9.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/jsr305.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/jsr305.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/findbugs/lib/mysql-connector-java-5.1.7-bin.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/findbugs/lib/mysql-connector-java-5.1.7-bin.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-01-30 12:59:38
|
Revision: 5720 http://jnode.svn.sourceforge.net/jnode/?rev=5720&view=rev Author: lsantha Date: 2010-01-30 12:59:18 +0000 (Sat, 30 Jan 2010) Log Message: ----------- PMD updated to version 4.2.5. Fixed 'pmd' Ant target. Modified Paths: -------------- trunk/all/build.xml Added Paths: ----------- trunk/builder/lib/pmd/asm-3.1.jar trunk/builder/lib/pmd/jaxen-1.1.1.jar trunk/builder/lib/pmd/junit-4.4.jar trunk/builder/lib/pmd/pmd-4.2.5.jar Removed Paths: ------------- trunk/builder/lib/pmd/jaxen-core-1.0-fcs.jar trunk/builder/lib/pmd/pmd-3.0.jar trunk/builder/lib/pmd/saxpath-1.0-fcs.jar trunk/builder/lib/pmd/xercesImpl-2.6.2.jar trunk/builder/lib/pmd/xmlParserAPIs-2.6.2.jar Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2010-01-30 08:30:27 UTC (rev 5719) +++ trunk/all/build.xml 2010-01-30 12:59:18 UTC (rev 5720) @@ -93,13 +93,6 @@ <!-- libraries needed to check plugin dependencies --> <property name="bcel-5.1.jar" value="${root.dir}/builder/lib/bcel-5.1.jar" /> - <!-- libraries needed to check rules in source code --> - <property name="pmd.jar" value="${root.dir}/builder/lib/pmd/pmd-3.0.jar"/> - <property name="jaxen.jar" value="${root.dir}/builder/lib/pmd/jaxen-core-1.0-fcs.jar"/> - <property name="saxpath.jar" value="${root.dir}/builder/lib/pmd/saxpath-1.0-fcs.jar"/> - <property name="xerces.jar" value="${root.dir}/builder/lib/pmd/xercesImpl-2.6.2.jar"/> - <property name="xmlParserAPIs.jar" value="${root.dir}/builder/pmd/lib/xmlParserAPIs-2.6.2.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"/> @@ -1076,50 +1069,46 @@ </checkDeps> </target> - <!-- Define the task that check the rules --> - <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" - classpathref="cp-jnode"> - <classpath> - <pathelement location="${pmd.jar}"/> - <pathelement location="${jaxen.jar}"/> - <pathelement location="${saxpath.jar}"/> - <pathelement location="${xerces.jar}"/> - <pathelement location="${xmlParserAPIs.jar}"/> - </classpath> - </taskdef> + <target name="pmd" depends="prepare"> + <echo> + WARNING: PMD rulset must be customized before regular use. + </echo> + <property name="pmd.home" value="../builder/lib/pmd"/> + <!-- Define the task that check the rules --> + <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"> + <classpath> + <fileset dir="${pmd.home}" includes="*.jar"/> + </classpath> + </taskdef> + <!-- Macro used to check that the rules are applied in the source code --> + <macrodef name="checkPMD"> + <attribute name="projectName"/> + <attribute name="webSrcUrl"/> + <attribute name="projectSrc"/> + <sequential> + <property name="nbFailures" value="0"/> + <echo message="Scanning @{projectName}."/> + <property name="tmp" value="../@{projectSrc}"/> + <pmd failuresPropertyName="nbFailures"> + <formatter type="html" toFile="${reports.dir}/pmd_report-@{projectName}.html"/> + <ruleset>rulesets/favorites.xml</ruleset> + <ruleset>rulesets/basic.xml</ruleset> - <!-- Macro used to check that the rules are applied in the source code --> - <macrodef name="checkProjectRules"> - <attribute name="projectName"/> - <attribute name="webSrcUrl"/> - <attribute name="projectSrc"/> - <sequential> - <property name="nbFailures" value="0"/> - <echo message="Scanning @{projectName}."/> - <property name="tmp" value="../@{projectSrc}"/> - <pmd failuresPropertyName="nbFailures"> - <formatter type="html" toFile="${reports.dir}/pmd_report-@{projectName}.html"/> - - <ruleset>rulesets/favorites.xml</ruleset> - <ruleset>rulesets/basic.xml</ruleset> - - <fileset dir="../@{projectSrc}" includes="**/*.java"/> - </pmd> - <echo message="There was ${nbFailures} failures in @{projectName}."/> - </sequential> - </macrodef> - - <target name="checkJNodeRules" depends="prepare"> + <fileset dir="../@{projectSrc}" includes="**/*.java"/> + </pmd> + <echo message="There was ${nbFailures} failures in @{projectName}."/> + </sequential> + </macrodef> <parallel> - <checkProjectRules projectName="distr" webSrcUrl="distr" projectSrc="distr"/> - <checkProjectRules projectName="JNode-Builder" webSrcUrl="builder" projectSrc="builder"/> - <checkProjectRules projectName="JNode-Core" webSrcUrl="core" projectSrc="core"/> - <checkProjectRules projectName="JNode-FS" webSrcUrl="fs" projectSrc="fs"/> - <checkProjectRules projectName="JNode-GUI" webSrcUrl="gui" projectSrc="gui"/> - <checkProjectRules projectName="JNode-Net" webSrcUrl="net" projectSrc="net"/> - <checkProjectRules projectName="JNode-Shell" webSrcUrl="shell" projectSrc="shell"/> - <checkProjectRules projectName="JNode-TestUI" webSrcUrl="textui" projectSrc="textui"/> + <checkPMD projectName="distr" webSrcUrl="distr" projectSrc="distr"/> + <checkPMD projectName="JNode-Builder" webSrcUrl="builder" projectSrc="builder"/> + <checkPMD projectName="JNode-Core" webSrcUrl="core" projectSrc="core"/> + <checkPMD projectName="JNode-FS" webSrcUrl="fs" projectSrc="fs"/> + <checkPMD projectName="JNode-GUI" webSrcUrl="gui" projectSrc="gui"/> + <checkPMD projectName="JNode-Net" webSrcUrl="net" projectSrc="net"/> + <checkPMD projectName="JNode-Shell" webSrcUrl="shell" projectSrc="shell"/> + <checkPMD projectName="JNode-TestUI" webSrcUrl="textui" projectSrc="textui"/> </parallel> </target> Added: trunk/builder/lib/pmd/asm-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/pmd/asm-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/builder/lib/pmd/jaxen-1.1.1.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/pmd/jaxen-1.1.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/builder/lib/pmd/jaxen-core-1.0-fcs.jar =================================================================== (Binary files differ) Added: trunk/builder/lib/pmd/junit-4.4.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/pmd/junit-4.4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/builder/lib/pmd/pmd-3.0.jar =================================================================== (Binary files differ) Added: trunk/builder/lib/pmd/pmd-4.2.5.jar =================================================================== (Binary files differ) Property changes on: trunk/builder/lib/pmd/pmd-4.2.5.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/builder/lib/pmd/saxpath-1.0-fcs.jar =================================================================== (Binary files differ) Deleted: trunk/builder/lib/pmd/xercesImpl-2.6.2.jar =================================================================== (Binary files differ) Deleted: trunk/builder/lib/pmd/xmlParserAPIs-2.6.2.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-01-30 20:55:25
|
Revision: 5721 http://jnode.svn.sourceforge.net/jnode/?rev=5721&view=rev Author: lsantha Date: 2010-01-30 20:55:18 +0000 (Sat, 30 Jan 2010) Log Message: ----------- Findbugs fixes: fixed inconsistent synchronzation. Renamed stack-like methods. Modified Paths: -------------- trunk/core/src/core/org/jnode/util/ByteQueue.java trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java trunk/gui/src/driver/org/jnode/driver/input/usb/USBKeyboardDriver.java trunk/gui/src/driver/org/jnode/driver/ps2/PS2ByteChannel.java trunk/gui/src/driver/org/jnode/driver/ps2/PS2Driver.java Modified: trunk/core/src/core/org/jnode/util/ByteQueue.java =================================================================== --- trunk/core/src/core/org/jnode/util/ByteQueue.java 2010-01-30 12:59:18 UTC (rev 5720) +++ trunk/core/src/core/org/jnode/util/ByteQueue.java 2010-01-30 20:55:18 UTC (rev 5721) @@ -31,7 +31,6 @@ public class ByteQueue { // FIXME ... Looking at the way this class is used, I think it may needs an // atomic drain operation and/or a close operation. - // FIXME ... The method names are wrong. 'PUSH' and 'POP' is for stacks not queues!! // FIXME ... Make the ByteQueue API and behavior mirror the Queue API and behavior. /** @@ -66,7 +65,7 @@ * made by removing (and discarding) the byte at the head of the queue. * @param o the byte to be added to the queue. */ - public synchronized void push(byte o) { + public synchronized void enQueue(byte o) { data[bottom] = o; bottom++; if (bottom >= size) { @@ -88,7 +87,7 @@ * * @return the byte removed, or zero if the method call was interrupted. */ - public synchronized byte pop() { + public synchronized byte deQueue() { while (top == bottom) { /* Q is empty */ try { wait(); @@ -110,7 +109,7 @@ /** * Remove a byte from the head of the queue, blocking with a timeout if data is - * not immediately available. Unlike {@link #pop()}, this method does <b>not</b> + * not immediately available. Unlike {@link #deQueue()}, this method does <b>not</b> * return zero when interrupted! * * @param timeout the maximum time (in milliseconds) to wait for data to become @@ -119,7 +118,7 @@ * @throws InterruptedException if the method call is interrupted. * @throws TimeoutException if no data is available within the required time. */ - public synchronized byte pop(long timeout) + public synchronized byte deQueue(long timeout) throws TimeoutException, InterruptedException { while (top == bottom) { /* Q is empty */ wait(timeout); @@ -140,7 +139,7 @@ /** * Return the byte at the head of the queue without removing it. If data is * not immediately available, the method will block (with a timeout) until - * data is available. Unlike {@link #pop()}, this method does <b>not</b> + * data is available. Unlike {@link #deQueue()}, this method does <b>not</b> * return zero when interrupted! * * @param timeout the maximum time (in milliseconds) to wait for data to become @@ -164,9 +163,15 @@ * Test if there is no data in the queue. * @return {@code true} if the queue is empty, {@code false} otherwise. */ - public boolean isEmpty() { + public synchronized boolean isEmpty() { // FIXME ... this should be synchronized. return (top == bottom); } - + + /** + * Clears the queue. + */ + public synchronized void clear() { + top = bottom = 0; + } } Modified: trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java =================================================================== --- trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java 2010-01-30 12:59:18 UTC (rev 5720) +++ trunk/core/src/core/org/jnode/util/ByteQueueProcessorThread.java 2010-01-30 20:55:18 UTC (rev 5721) @@ -96,7 +96,7 @@ public void run() { while (!stop) { try { - final byte value = queue.pop(); + final byte value = queue.deQueue(); processor.process(value); } catch (Exception ex) { handleException(ex); Modified: trunk/gui/src/driver/org/jnode/driver/input/usb/USBKeyboardDriver.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/input/usb/USBKeyboardDriver.java 2010-01-30 12:59:18 UTC (rev 5720) +++ trunk/gui/src/driver/org/jnode/driver/input/usb/USBKeyboardDriver.java 2010-01-30 20:55:18 UTC (rev 5721) @@ -165,13 +165,13 @@ // Modifier changed final int keyCode = usb_kbd_keycode[i + 224]; // It is an extended keycode - keyCodeQueue.push((byte) KeyboardInterpreter.XT_EXTENDED); + keyCodeQueue.enQueue((byte) KeyboardInterpreter.XT_EXTENDED); if ((old[0] & bit) != 0) { // Released - keyCodeQueue.push((byte) (keyCode | KeyboardInterpreter.XT_RELEASE)); + keyCodeQueue.enQueue((byte) (keyCode | KeyboardInterpreter.XT_RELEASE)); } else { // Pressed - keyCodeQueue.push((byte) keyCode); + keyCodeQueue.enQueue((byte) keyCode); } } } @@ -181,7 +181,7 @@ // Key released final int keyCode = usb_kbd_keycode[old[i] & 0xFF]; if (keyCode > 0) { - keyCodeQueue.push((byte) (keyCode | KeyboardInterpreter.XT_RELEASE)); + keyCodeQueue.enQueue((byte) (keyCode | KeyboardInterpreter.XT_RELEASE)); } else { log.debug("Unknown scancode released " + (old[i] & 0xFF)); } @@ -190,7 +190,7 @@ // Key pressed final int keyCode = usb_kbd_keycode[cur[i] & 0xFF]; if (keyCode > 0) { - keyCodeQueue.push((byte) keyCode); + keyCodeQueue.enQueue((byte) keyCode); } else { log.debug("Unknown scancode pressed " + (cur[i] & 0xFF)); } Modified: trunk/gui/src/driver/org/jnode/driver/ps2/PS2ByteChannel.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/ps2/PS2ByteChannel.java 2010-01-30 12:59:18 UTC (rev 5720) +++ trunk/gui/src/driver/org/jnode/driver/ps2/PS2ByteChannel.java 2010-01-30 20:55:18 UTC (rev 5721) @@ -44,7 +44,7 @@ * @see org.jnode.system.IRQHandler#handleInterrupt(int) */ public void handleScancode(int b) { - queue.push((byte) b); + queue.enQueue((byte) b); } /** @@ -58,7 +58,7 @@ // FIXME: proper exception handling (if end of queue -> IOException) int i; for (i = 0; i < dst.remaining(); i++) { - dst.put(queue.pop()); + dst.put(queue.deQueue()); } return i; } @@ -71,7 +71,7 @@ if (!isOpen()) { throw new ClosedChannelException(); } - return queue.pop(timeout) & 0xFF; + return queue.deQueue(timeout) & 0xFF; } /** @@ -116,11 +116,7 @@ * Remove all data from this channel */ public void clear() { - // FIXME ... there is synchronization issues here. The 'isEmpty' method - // is not synchronized, so we may not see the real state of the queue. - while (!queue.isEmpty()) { - queue.pop(); - } + queue.clear(); } } Modified: trunk/gui/src/driver/org/jnode/driver/ps2/PS2Driver.java =================================================================== --- trunk/gui/src/driver/org/jnode/driver/ps2/PS2Driver.java 2010-01-30 12:59:18 UTC (rev 5720) +++ trunk/gui/src/driver/org/jnode/driver/ps2/PS2Driver.java 2010-01-30 20:55:18 UTC (rev 5721) @@ -51,7 +51,7 @@ * @see org.jnode.system.IRQHandler#handleInterrupt(int) */ public void handleScancode(int b) { - queue.push((byte) b); + queue.enQueue((byte) b); } /** @@ -89,7 +89,7 @@ // FIXME: proper exception handling (if end of queue -> IOException) int i; for (i = 0; i < dst.remaining(); i++) { - dst.put(queue.pop()); + dst.put(queue.deQueue()); } return i; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2010-02-19 07:21:58
|
Revision: 5727 http://jnode.svn.sourceforge.net/jnode/?rev=5727&view=rev Author: lsantha Date: 2010-02-19 07:21:51 +0000 (Fri, 19 Feb 2010) Log Message: ----------- Code style fixes. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.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/InlineBytecodeVisitor.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/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/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/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/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/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/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/X86Level1BCompiler.java trunk/core/src/core/org/jnode/vm/x86/compiler/stub/X86StubCompiler.java Modified: trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -69,14 +69,12 @@ import org.jnode.vm.x86.VmX86Processor32; import org.jnode.vm.x86.VmX86Processor64; import org.jnode.vm.x86.X86CpuID; -import org.jnode.vm.x86.compiler.X86CompilerConstants; import org.jnode.vm.x86.compiler.X86JumpTable; /** * @author epr */ -public class BootImageBuilder extends AbstractBootImageBuilder implements - X86CompilerConstants { +public class BootImageBuilder extends AbstractBootImageBuilder { public static final int LOAD_ADDR = 1024 * 1024; Modified: trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeParser.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -35,6 +35,7 @@ /** * @param bc + * @param cfg * @param handler */ protected CompilerBytecodeParser(VmByteCode bc, ControlFlowGraph cfg, CompilerBytecodeVisitor handler) { Modified: trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/CompilerBytecodeVisitor.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -32,6 +32,7 @@ /** * The given basic block is about to start. + * @param bb */ public abstract void startBasicBlock(BasicBlock bb); @@ -57,6 +58,7 @@ /** * Push the given VmType on the stack. + * @param value */ public abstract void visit_ldc(VmType<?> value); Modified: trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/EntryPoints.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -127,10 +127,11 @@ /** * Create a new instance * - * @param loader + * @param loader the VmClassLoader instance + * @param heapManager heap manager + * @param magic the compiler magic ID */ - public EntryPoints(VmClassLoader loader, VmHeapManager heapManager, - int magic) { + public EntryPoints(VmClassLoader loader, VmHeapManager heapManager, int magic) { try { this.magic = magic; // VmMember class @@ -174,8 +175,7 @@ writeBarrier = (heapManager != null) ? heapManager .getWriteBarrier() : null; if (writeBarrier != null) { - final VmType wbClass = loader.loadClass(writeBarrier.getClass() - .getName(), true); + final VmType wbClass = loader.loadClass(writeBarrier.getClass().getName(), true); arrayStoreWriteBarrier = testMethod(wbClass.getMethod( "arrayStoreWriteBarrier", "(Ljava/lang/Object;ILjava/lang/Object;)V")); @@ -191,105 +191,79 @@ } // MonitorManager - this.vmMonitorManagerClass = loader.loadClass( - "org.jnode.vm.scheduler.MonitorManager", true); - monitorEnterMethod = testMethod(vmMonitorManagerClass.getMethod( - "monitorEnter", "(Ljava/lang/Object;)V")); - monitorExitMethod = testMethod(vmMonitorManagerClass.getMethod( - "monitorExit", "(Ljava/lang/Object;)V")); + this.vmMonitorManagerClass = loader.loadClass("org.jnode.vm.scheduler.MonitorManager", true); + monitorEnterMethod = testMethod(vmMonitorManagerClass.getMethod("monitorEnter", "(Ljava/lang/Object;)V")); + monitorExitMethod = testMethod(vmMonitorManagerClass.getMethod("monitorExit", "(Ljava/lang/Object;)V")); // MathSupport - final VmType vmClass = loader.loadClass("org.jnode.vm.MathSupport", - true); + final VmType vmClass = loader.loadClass("org.jnode.vm.MathSupport", true); ldivMethod = testMethod(vmClass.getMethod("ldiv", "(JJ)J")); lremMethod = testMethod(vmClass.getMethod("lrem", "(JJ)J")); // VmInstanceField - this.vmInstanceFieldClass = loader.loadClass( - "org.jnode.vm.classmgr.VmInstanceField", true); - vmFieldOffsetField = (VmInstanceField) testField(vmInstanceFieldClass - .getField("offset")); + this.vmInstanceFieldClass = loader.loadClass("org.jnode.vm.classmgr.VmInstanceField", true); + vmFieldOffsetField = (VmInstanceField) testField(vmInstanceFieldClass.getField("offset")); // VmStaticField - this.vmStaticFieldClass = loader.loadClass( - "org.jnode.vm.classmgr.VmStaticField", true); - vmFieldStaticsIndexField = (VmInstanceField) testField(vmStaticFieldClass - .getField("staticsIndex")); + this.vmStaticFieldClass = loader.loadClass("org.jnode.vm.classmgr.VmStaticField", true); + vmFieldStaticsIndexField = (VmInstanceField) testField(vmStaticFieldClass.getField("staticsIndex")); // VmInstanceMethod - this.vmInstanceMethodClass = loader.loadClass( - "org.jnode.vm.classmgr.VmInstanceMethod", true); - vmMethodTibOffsetField = (VmInstanceField) testField(vmInstanceMethodClass - .getField("tibOffset")); + this.vmInstanceMethodClass = loader.loadClass("org.jnode.vm.classmgr.VmInstanceMethod", true); + vmMethodTibOffsetField = (VmInstanceField) testField(vmInstanceMethodClass.getField("tibOffset")); // VmMethodCode - this.vmMethodCodeClass = loader.loadClass( - "org.jnode.vm.classmgr.VmMethodCode", true); - vmMethodSelectorField = (VmInstanceField) testField(vmInstanceMethodClass - .getField("selector")); - vmMethodNativeCodeField = (VmInstanceField) testField(vmInstanceMethodClass - .getField("nativeCode")); + this.vmMethodCodeClass = loader.loadClass("org.jnode.vm.classmgr.VmMethodCode", true); + vmMethodSelectorField = (VmInstanceField) testField(vmInstanceMethodClass.getField("selector")); + vmMethodNativeCodeField = (VmInstanceField) testField(vmInstanceMethodClass.getField("nativeCode")); // VmConstIMethodRef - final VmType cimrClass = loader.loadClass( - "org.jnode.vm.classmgr.VmConstIMethodRef", true); - this.vmConstIMethodRefSelectorField = (VmInstanceField) testField(cimrClass - .getField("selector")); + final VmType cimrClass = loader.loadClass("org.jnode.vm.classmgr.VmConstIMethodRef", true); + this.vmConstIMethodRefSelectorField = (VmInstanceField) testField(cimrClass.getField("selector")); // VmProcessor - final VmType processorClass = loader.loadClass( - "org.jnode.vm.scheduler.VmProcessor", true); + final VmType processorClass = loader.loadClass("org.jnode.vm.scheduler.VmProcessor", true); vmThreadSwitchIndicatorOffset = ((VmInstanceField) testField(processorClass.getField("threadSwitchIndicator"))).getOffset(); vmProcessorMeField = (VmInstanceField) testField(processorClass.getField("me")); - vmProcessorStackEnd = (VmInstanceField) testField(processorClass - .getField("stackEnd")); - vmProcessorSharedStaticsTable = (VmInstanceField) testField(processorClass - .getField("staticsTable")); + vmProcessorStackEnd = (VmInstanceField) testField(processorClass.getField("stackEnd")); + vmProcessorSharedStaticsTable = (VmInstanceField) testField(processorClass.getField("staticsTable")); vmProcessorIsolatedStaticsTable = (VmInstanceField) testField(processorClass .getField("isolatedStaticsTable")); // VmType - final VmType typeClass = loader.loadClass( - "org.jnode.vm.classmgr.VmType", true); - vmTypeInitialize = testMethod(typeClass.getMethod("initialize", - "()V")); - vmTypeModifiers = (VmInstanceField) testField(typeClass - .getField("modifiers")); - vmTypeState = (VmInstanceField) testField(typeClass - .getField("state")); + final VmType typeClass = loader.loadClass("org.jnode.vm.classmgr.VmType", true); + vmTypeInitialize = testMethod(typeClass.getMethod("initialize", "()V")); + vmTypeModifiers = (VmInstanceField) testField(typeClass.getField("modifiers")); + vmTypeState = (VmInstanceField) testField(typeClass.getField("state")); vmTypeCp = (VmInstanceField) testField(typeClass.getField("cp")); // VmCP - final VmType cpClass = loader.loadClass( - "org.jnode.vm.classmgr.VmCP", true); + final VmType cpClass = loader.loadClass("org.jnode.vm.classmgr.VmCP", true); vmCPCp = (VmInstanceField) testField(cpClass.getField("cp")); // VmProcessor // VmThread final VmType vmThreadClass = loader.loadClass("org.jnode.vm.scheduler.VmThread", true); - systemExceptionMethod = testMethod(vmThreadClass.getMethod( - "systemException", "(II)Ljava/lang/Throwable;")); + systemExceptionMethod = testMethod(vmThreadClass.getMethod("systemException", "(II)Ljava/lang/Throwable;")); // VmMethod - final VmType vmMethodClass = loader.loadClass( - "org.jnode.vm.classmgr.VmMethod", true); - recompileMethod = testMethod(vmMethodClass.getDeclaredMethod( - "recompileMethod", "(II)V")); + final VmType vmMethodClass = loader.loadClass("org.jnode.vm.classmgr.VmMethod", true); + recompileMethod = testMethod(vmMethodClass.getDeclaredMethod("recompileMethod", "(II)V")); } catch (ClassNotFoundException ex) { throw new NoClassDefFoundError(ex.getMessage()); } } - private final VmMethod testMethod(VmMethod method) { + private VmMethod testMethod(VmMethod method) { if (method == null) { throw new RuntimeException("Cannot find a method"); } return method; } - private final VmField testField(VmField field) { + private VmField testField(VmField field) { if (field == null) { throw new RuntimeException("Cannot find a field"); } Modified: trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/IMTCompiler.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -42,8 +42,10 @@ /** * Compile the given IMT. * + * @param resolver * @param imt * @param imtCollisions + * @return */ public abstract CompiledIMT compile(ObjectResolver resolver, Object[] imt, boolean[] imtCollisions); } Modified: trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/InlineBytecodeVisitor.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -52,6 +52,7 @@ /** * Leave the values on the stack and jump to the end of the inlined method. + * @param jvmType */ public abstract void visit_inlinedReturn(int jvmType); } Modified: trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/OptimizingBytecodeVisitor.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -158,11 +158,11 @@ /** * Initialize this instance. * + * @param entryPoints * @param delegate * @param loader */ - public OptimizingBytecodeVisitor(EntryPoints entryPoints, - InlineBytecodeVisitor delegate, VmClassLoader loader) { + public OptimizingBytecodeVisitor(EntryPoints entryPoints, InlineBytecodeVisitor delegate, VmClassLoader loader) { super(delegate); this.entryPoints = entryPoints; this.loader = loader; Modified: trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java =================================================================== --- trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/compiler/VerifyingCompilerBytecodeVisitor.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -55,8 +55,8 @@ } /** - * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor - * #visit_invokeinterface(org.jnode.vm.classmgr.VmConstIMethodRef, int) + * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor#visit_invokeinterface( + * org.jnode.vm.classmgr.VmConstIMethodRef, int) */ @Override public void visit_invokeinterface(VmConstIMethodRef methodRef, int count) { @@ -65,8 +65,8 @@ } /** - * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor - * #visit_invokespecial(org.jnode.vm.classmgr.VmConstMethodRef) + * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor#visit_invokespecial( + * org.jnode.vm.classmgr.VmConstMethodRef) */ @Override public void visit_invokespecial(VmConstMethodRef methodRef) { @@ -75,8 +75,8 @@ } /** - * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor - * #visit_invokestatic(org.jnode.vm.classmgr.VmConstMethodRef) + * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor#visit_invokestatic( + * org.jnode.vm.classmgr.VmConstMethodRef) */ @Override public void visit_invokestatic(VmConstMethodRef methodRef) { @@ -85,8 +85,8 @@ } /** - * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor - * #visit_invokevirtual(org.jnode.vm.classmgr.VmConstMethodRef) + * @see org.jnode.vm.compiler.DelegatingCompilerBytecodeVisitor#visit_invokevirtual( + * org.jnode.vm.classmgr.VmConstMethodRef) */ @Override public void visit_invokevirtual(VmConstMethodRef methodRef) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86Compiler.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -51,8 +51,7 @@ * @author Ewout Prangsma (ep...@us...) */ @MagicPermission -public abstract class AbstractX86Compiler extends NativeCodeCompiler implements - X86CompilerConstants { +public abstract class AbstractX86Compiler extends NativeCodeCompiler { private EntryPoints context; @@ -65,7 +64,7 @@ /** * Initialize this compiler * - * @param loader + * @param loader the VmClassLoader */ public final void initialize(VmClassLoader loader) { if (context == null) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/AbstractX86StackManager.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -42,8 +42,7 @@ * @param msbReg * @param jvmType the type of the registers contents as a {@link org.jnode.vm.JvmType}. */ - public void writePUSH64(int jvmType, X86Register.GPR lsbReg, - X86Register.GPR msbReg); + public void writePUSH64(int jvmType, X86Register.GPR lsbReg, X86Register.GPR msbReg); /** * Write code to push a 64-bit word on the stack Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/BaseX86MagicHelper.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -34,6 +34,7 @@ * Convert a method code into an X86 condition code. * * @param mcode + * @return */ protected final int methodToCC(MagicMethod mcode) { switch (mcode) { @@ -67,6 +68,7 @@ * Convert a method code into an X86 condition code. * * @param mcode + * @return */ protected final int methodToShift(MagicMethod mcode) { switch (mcode) { @@ -142,7 +144,7 @@ } } - protected static final int methodCodeToOperation(MagicMethod mcode) { + protected static int methodCodeToOperation(MagicMethod mcode) { switch (mcode) { case ATOMICADD: return X86Operation.ADD; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/X86CompilerHelper.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -45,13 +45,18 @@ import org.jnode.vm.scheduler.VmProcessor; import org.jnode.vm.x86.X86CpuID; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS64; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.INTSIZE; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.PROCESSOR64; + /** * Helpers class used by the X86 compilers. * * @author epr * @author patrik_reali */ -public class X86CompilerHelper implements X86CompilerConstants { +public class X86CompilerHelper { /** * Address size ax register (EAX/RAX) Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler32.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -32,11 +32,12 @@ import org.jnode.vm.compiler.CompiledIMT; import org.jnode.vm.compiler.IMTCompiler; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32; + /** * @author Ewout Prangsma (ep...@us...) */ -public final class X86IMTCompiler32 extends IMTCompiler implements - X86CompilerConstants { +public final class X86IMTCompiler32 extends IMTCompiler { /** * Register that holds the selector @@ -60,6 +61,7 @@ * destroyed) * * @param os + * @param method */ public static void emitInvokeInterface(X86Assembler os, VmMethod method) { final int selector = method.getSelector(); @@ -95,8 +97,7 @@ * @see org.jnode.vm.compiler.IMTCompiler#compile(ObjectResolver, Object[], * boolean[]) */ - public CompiledIMT compile(ObjectResolver resolver__, Object[] imt, - boolean[] imtCollisions) { + public CompiledIMT compile(ObjectResolver resolver__, Object[] imt, boolean[] imtCollisions) { final int imtLength = imt.length; // Calculate size of code array @@ -186,10 +187,10 @@ * * @param code * @param ofs + * @param staticsIndex * @return the new offset */ - private final int genJmpStaticsCodeOfs(byte[] code, int ofs, - int staticsIndex) { + private int genJmpStaticsCodeOfs(byte[] code, int ofs, int staticsIndex) { final int offset = (staticsIndex + VmArray.DATA_OFFSET) * 4; // JMP [EDI+codeOfs] code[ofs++] = (byte) 0xFF; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/X86IMTCompiler64.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -33,11 +33,12 @@ import org.jnode.vm.compiler.CompiledIMT; import org.jnode.vm.compiler.IMTCompiler; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS64; + /** * @author Ewout Prangsma (ep...@us...) */ -public final class X86IMTCompiler64 extends IMTCompiler implements - X86CompilerConstants { +public final class X86IMTCompiler64 extends IMTCompiler { /** * Size in bytes of an entry in the IMT jump table generated by this method. @@ -55,6 +56,7 @@ * destroyed) RDX is destroyed * * @param os + * @param method */ public static void emitInvokeInterface(X86Assembler os, VmMethod method) { final int selector = method.getSelector(); @@ -166,10 +168,10 @@ * * @param code * @param ofs + * @param staticsIndex * @return the new offset */ - private final int genJmpStaticsCodeOfs(byte[] code, int ofs, - int staticsIndex) { + private int genJmpStaticsCodeOfs(byte[] code, int ofs, int staticsIndex) { final int offset = (staticsIndex * 4) + (VmArray.DATA_OFFSET * 8); // JMP [RDI+codeOfs] code[ofs++] = (byte) 0xFF; Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -28,6 +28,10 @@ import org.jnode.vm.JvmType; import org.jnode.vm.Vm; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS32; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.LSB; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.MSB; + /** * @author Patrik Reali */ @@ -37,14 +41,21 @@ /** * Initialize a blank item. + * + * @param factory the item factory which created this item. */ DoubleItem(ItemFactory factory) { super(factory); } /** + * @param ec * @param kind * @param offsetToFP + * @param lsb + * @param msb + * @param reg + * @param xmm * @param value */ final void initialize(EmitterContext ec, byte kind, short offsetToFP, X86Register.GPR lsb, @@ -55,7 +66,7 @@ } /** - * @see org.jnode.vm.x86.compiler.l1a.DoubleWordItem#cloneConstant() + * @see DoubleWordItem#cloneConstant(EmitterContext) */ protected DoubleWordItem cloneConstant(EmitterContext ec) { return factory.createDConst(ec, getValue()); @@ -89,8 +100,7 @@ * @param lsb * @param msb */ - protected final void loadToConstant32(EmitterContext ec, X86Assembler os, - GPR32 lsb, GPR32 msb) { + protected final void loadToConstant32(EmitterContext ec, X86Assembler os, GPR32 lsb, GPR32 msb) { final long lvalue = Double.doubleToLongBits(value); final int lsbv = (int) (lvalue & 0xFFFFFFFFL); final int msbv = (int) ((lvalue >>> 32) & 0xFFFFFFFFL); @@ -105,8 +115,7 @@ * @param os * @param reg */ - protected final void loadToConstant64(EmitterContext ec, X86Assembler os, - GPR64 reg) { + protected final void loadToConstant64(EmitterContext ec, X86Assembler os, GPR64 reg) { final long lvalue = Double.doubleToLongBits(value); os.writeMOV_Const(reg, lvalue); } @@ -144,8 +153,8 @@ /** * Push the given memory location on the FPU stack. * - * @param os - * @param reg + * @param os the assembler + * @param reg the * @param disp */ protected void pushToFPU(X86Assembler os, GPR reg, int disp) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleWordItem.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -27,13 +27,14 @@ import org.jnode.assembler.x86.X86Register.GPR64; import org.jnode.vm.JvmType; import org.jnode.vm.Vm; -import org.jnode.vm.x86.compiler.X86CompilerConstants; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.INTSIZE; +import static org.jnode.vm.x86.compiler.X86CompilerConstants.BITS64; + /** * @author Ewout Prangsma (ep...@us...) */ -public abstract class DoubleWordItem extends Item implements - X86CompilerConstants { +public abstract class DoubleWordItem extends Item { /** * LSB Register in 32-bit mode @@ -52,16 +53,20 @@ /** * Initialize a blank item. + * @param factory */ protected DoubleWordItem(ItemFactory factory) { super(factory); } /** + * @param ec * @param kind * @param offsetToFP * @param lsb * @param msb + * @param reg + * @param xmm */ protected final void initialize(EmitterContext ec, byte kind, short offsetToFP, X86Register.GPR lsb, X86Register.GPR msb, X86Register.GPR64 reg, @@ -129,6 +134,7 @@ /** * Create a clone of this item, which must be a constant. * + * @param ec * @return the clone */ protected abstract DoubleWordItem cloneConstant(EmitterContext ec); @@ -148,6 +154,7 @@ * Gets the offset from the LSB part of this item to the FramePointer * register. This is only valid if this item has a LOCAL kind. * + * @param ec * @return the offset */ final int getLsbOffsetToFP(EmitterContext ec) { @@ -157,6 +164,7 @@ /** * Gets the register holding the LSB part of this item in 32-bit mode. * + * @param ec * @return the register */ final X86Register.GPR getLsbRegister(EmitterContext ec) { @@ -174,6 +182,7 @@ * Gets the offset from the MSB part of this item to the FramePointer * register. This is only valid if this item has a LOCAL kind. * + * @param ec * @return the offset */ final int getMsbOffsetToFP(EmitterContext ec) { @@ -183,6 +192,7 @@ /** * Gets the register holding the MSB part of this item in 32-bit mode. * + * @param ec * @return the register */ final X86Register.GPR getMsbRegister(EmitterContext ec) { @@ -199,6 +209,7 @@ /** * Gets the register holding this item in 64-bit mode. * + * @param ec * @return the register */ final X86Register.GPR64 getRegister(EmitterContext ec) { @@ -437,6 +448,7 @@ /** * Load my constant to the given os in 32-bit mode. * + * @param ec * @param os * @param lsb * @param msb @@ -447,6 +459,7 @@ /** * Load my constant to the given os in 64-bit mode. * + * @param ec * @param os * @param reg */ @@ -591,6 +604,7 @@ /** * Push my constant on the stack using the given os. * + * @param ec * @param os */ protected abstract void pushConstant(EmitterContext ec, X86Assembler os); @@ -680,9 +694,10 @@ } /** + * @param ec * @see org.jnode.vm.x86.compiler.l1a.Item#release(EmitterContext) */ - private final void cleanup(EmitterContext ec) { + private void cleanup(EmitterContext ec) { // assertCondition(!ec.getVStack().contains(this), "Cannot release while // on vstack"); final X86RegisterPool pool = ec.getGPRPool(); @@ -721,7 +736,7 @@ setKind((byte) 0); } - private final X86Register request(EmitterContext ec, X86RegisterPool pool) { + private X86Register request(EmitterContext ec, X86RegisterPool pool) { final X86Assembler os = ec.getStream(); final X86Register r; if (os.isCode32()) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/EmitterContext.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -68,6 +68,13 @@ /** * Create a new context + * @param os + * @param helper + * @param vstack + * @param gprPool + * @param xmmPool + * @param ifac + * @param context */ EmitterContext(X86Assembler os, X86CompilerHelper helper, VirtualStack vstack, X86RegisterPool gprPool, Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompiler.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -88,8 +88,6 @@ /** * fadd / dadd * - * @param ec - * @param vstack * @param type */ abstract void add(int type); @@ -97,9 +95,6 @@ /** * fcmpg, fcmpl, dcmpg, dcmpl * - * @param os - * @param ec - * @param vstack * @param gt * @param type * @param curInstrLabel @@ -109,16 +104,14 @@ /** * f2x / d2x * - * @param ec - * @param vstack + * @param fromType + * @param toType */ abstract void convert(int fromType, int toType); /** * fdiv / ddiv * - * @param ec - * @param vstack * @param type */ abstract void div(int type); @@ -126,8 +119,6 @@ /** * fmul / dmul * - * @param ec - * @param vstack * @param type */ abstract void mul(int type); @@ -135,8 +126,6 @@ /** * fneg / dneg * - * @param ec - * @param vstack * @param type */ abstract void neg(int type); @@ -144,8 +133,6 @@ /** * frem / drem * - * @param ec - * @param vstack * @param type */ abstract void rem(int type); @@ -153,8 +140,6 @@ /** * fsub / dsub * - * @param ec - * @param vstack * @param type */ abstract void sub(int type); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerFPU.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -38,9 +38,11 @@ final class FPCompilerFPU extends FPCompiler { /** + * @param bcv * @param os * @param ec * @param vstack + * @param arrayDataOffset */ public FPCompilerFPU(X86BytecodeVisitor bcv, X86Assembler os, EmitterContext ec, VirtualStack vstack, int arrayDataOffset) { @@ -50,8 +52,6 @@ /** * fadd / dadd * - * @param ec - * @param vstack * @param type */ final void add(int type) { @@ -83,9 +83,6 @@ /** * fcmpg, fcmpl, dcmpg, dcmpl * - * @param os - * @param ec - * @param vstack * @param gt * @param type * @param curInstrLabel @@ -166,8 +163,6 @@ /** * f2x / d2x * - * @param ec - * @param vstack */ final void convert(int fromType, int toType) { final ItemFactory ifac = ec.getItemFactory(); @@ -191,8 +186,6 @@ /** * fdiv / ddiv * - * @param ec - * @param vstack * @param type */ final void div(int type) { @@ -230,7 +223,7 @@ * @param vstack * @param items */ - static final void ensureStackCapacity(X86Assembler os, EmitterContext ec, + static void ensureStackCapacity(X86Assembler os, EmitterContext ec, VirtualStack vstack, int items) { final FPUStack fpuStack = vstack.fpuStack; if (!fpuStack.hasCapacity(items)) { @@ -249,7 +242,7 @@ * @param fpuStack * @param fpuReg */ - private static final void fxchST1(X86Assembler os, FPUStack fpuStack, + private static void fxchST1(X86Assembler os, FPUStack fpuStack, FPU fpuReg) { // We need reg to be ST1, if not swap if (fpuReg != X86Register.ST1) { @@ -263,8 +256,6 @@ /** * fmul / dmul * - * @param ec - * @param vstack * @param type */ final void mul(int type) { @@ -296,8 +287,6 @@ /** * fneg / dneg * - * @param ec - * @param vstack * @param type */ final void neg(int type) { @@ -322,6 +311,11 @@ /** * Make sure that the given operand is on the top on the FPU stack. + * @param os + * @param ec + * @param vstack + * @param fpuStack + * @param left */ private static void prepareForOperation(X86Assembler os, EmitterContext ec, VirtualStack vstack, FPUStack fpuStack, @@ -355,8 +349,14 @@ * <p/> * The item at ST0 is popped of the given fpuStack stack. * + * @param os + * @param ec + * @param vstack + * @param fpuStack * @param left * @param right + * @param commutative + * @return */ private static FPU prepareForOperation(X86Assembler os, EmitterContext ec, VirtualStack vstack, FPUStack fpuStack, @@ -424,8 +424,6 @@ /** * frem / drem * - * @param ec - * @param vstack * @param type */ final void rem(int type) { @@ -462,8 +460,6 @@ /** * fsub / dsub * - * @param ec - * @param vstack * @param type */ final void sub(int type) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPCompilerSSE.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -91,7 +91,7 @@ * @param operation * @param commutative */ - private final void arithOperation(int type, int operation, boolean commutative) { + private void arithOperation(int type, int operation, boolean commutative) { final ItemFactory ifac = ec.getItemFactory(); Item v2 = vstack.pop(type); Item v1 = vstack.pop(type); @@ -138,7 +138,7 @@ * @return True if the operand must be swapped. when not commutative, false * is always returned. */ - private final boolean prepareForOperation(Item destAndSource, Item source, + private boolean prepareForOperation(Item destAndSource, Item source, boolean commutative) { // WARNING: source was on top of the virtual stack (thus higher than // destAndSource) Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUHelper.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -24,12 +24,11 @@ import org.jnode.assembler.x86.X86Register; import org.jnode.assembler.x86.X86Register.FPU; import org.jnode.vm.bytecode.StackException; -import org.jnode.vm.x86.compiler.X86CompilerConstants; /** * @author Ewout Prangsma (ep...@us...) */ -final class FPUHelper implements X86CompilerConstants { +final class FPUHelper { /** * Swap ST0 and the given item. Action is emitted to code & performed on @@ -39,7 +38,7 @@ * @param fpuStack * @param item */ - static final void fxch(X86Assembler os, FPUStack fpuStack, Item item) { + static void fxch(X86Assembler os, FPUStack fpuStack, Item item) { if (!fpuStack.isTos(item)) { final FPU fpuReg = fpuStack.getRegister(item); fxch(os, fpuStack, fpuReg); @@ -53,7 +52,7 @@ * @param fpuStack * @param fpuReg */ - static final void fxch(X86Assembler os, FPUStack fpuStack, + static void fxch(X86Assembler os, FPUStack fpuStack, FPU fpuReg) { if (fpuReg == X86Register.ST0) { throw new StackException("Cannot fxch ST0"); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FPUStack.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -58,6 +58,8 @@ /** * Gets the item that is contained in the given register. + * @param fpuReg + * @return */ final Item getItem(FPU fpuReg) { final int idx = tos - (fpuReg.getNr() + 1); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/FloatItem.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -52,7 +52,7 @@ } /** - * @see org.jnode.vm.x86.compiler.l1a.WordItem#cloneConstant() + * @see org.jnode.vm.x86.compiler.l1a.WordItem#cloneConstant(EmitterContext) */ protected WordItem cloneConstant(EmitterContext ec) { return factory.createFConst(ec, getValue()); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/InlinedMethodInfo.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -45,7 +45,10 @@ /** * Initialize this instance. * + * @param previous * @param inlinedMethod + * @param endOfInlineLabel + * @param previousLabelPrefix */ public InlinedMethodInfo(InlinedMethodInfo previous, VmMethod inlinedMethod, Label endOfInlineLabel, String previousLabelPrefix) { @@ -69,6 +72,7 @@ /** * Push the stack elements of the outer method stack. * + * @param ifac * @param vstack */ final void pushOuterMethodStack(ItemFactory ifac, VirtualStack vstack) { @@ -78,6 +82,7 @@ /** * Push the stack elements of the outer method stack and the exit stack. * + * @param ifac * @param vstack * @param eContext */ Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/IntItem.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -25,7 +25,6 @@ import org.jnode.assembler.x86.X86Register.GPR; import org.jnode.vm.JvmType; import org.jnode.vm.Vm; -import org.jnode.vm.x86.compiler.X86CompilerConstants; /** * @author Patrik Reali @@ -33,7 +32,7 @@ * IntItems are items with type INT */ -final class IntItem extends WordItem implements X86CompilerConstants { +final class IntItem extends WordItem { private int value; @@ -47,7 +46,7 @@ } /** - * @see org.jnode.vm.x86.compiler.l1a.WordItem#cloneConstant() + * @see org.jnode.vm.x86.compiler.l1a.WordItem#cloneConstant(EmitterContext) */ protected WordItem cloneConstant(EmitterContext ec) { return factory.createIConst(ec, getValue()); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/Item.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -75,7 +75,7 @@ */ static final byte LOCAL = 0x20; - public static final String toString(int kind) { + public static String toString(int kind) { switch (kind) { case STACK: return "STACK"; @@ -117,6 +117,7 @@ /** * Initialize a blank item. + * @param factory */ protected Item(ItemFactory factory) { this.factory = factory; @@ -185,6 +186,7 @@ /** * Is this item on the stack + * @return */ final boolean isStack() { return (kind == Kind.STACK); @@ -192,6 +194,7 @@ /** * Is this item in a general purpose register + * @return */ final boolean isGPR() { return (kind == Kind.GPR); @@ -199,6 +202,7 @@ /** * Is this item in a SSE register + * @return */ final boolean isXMM() { return (kind == Kind.XMM); @@ -206,6 +210,7 @@ /** * Is this item on the FPU stack + * @return */ final boolean isFPUStack() { return (kind == Kind.FPUSTACK); @@ -213,6 +218,7 @@ /** * Is this item a local variable + * @return */ final boolean isLocal() { return (kind == Kind.LOCAL); @@ -220,6 +226,7 @@ /** * Is this item a constant + * @return */ final boolean isConstant() { return (kind == Kind.CONSTANT); @@ -240,6 +247,7 @@ * Gets the offset from this item to the FramePointer register. This is only * valid if this item has a LOCAL kind. * + * @param ec * @return */ short getOffsetToFP(EmitterContext ec) { @@ -265,6 +273,7 @@ /** * Is this item located at the given FP offset. * + * @param offset * @return */ boolean isAtOffset(int offset) { @@ -297,6 +306,8 @@ /** * Load item into a register / two registers / an FPU register depending on * its type, if its kind matches the mask + * @param eContext + * @param mask */ final void loadIf(EmitterContext eContext, int mask) { if ((kind & mask) > 0) { @@ -306,6 +317,8 @@ /** * Load item into an XMM register if its kind matches the mask + * @param eContext + * @param mask */ final void loadToXMMIf(EmitterContext eContext, int mask) { if ((kind & mask) > 0) { @@ -331,6 +344,7 @@ /** * Push the value of this item on the FPU stack. The item itself is not * changed in any way. + * @param ec */ abstract void pushToFPU(EmitterContext ec); @@ -364,6 +378,8 @@ /** * Spill this item if it uses the given register. + * @param ec + * @param reg */ final void spillIfUsing(EmitterContext ec, X86Register reg) { if (uses(reg)) { @@ -382,7 +398,7 @@ /** * enquire whether the item uses a volatile register * - * @param reg + * @param pool * @return true, when this item uses a volatile register. */ abstract boolean usesVolatileRegister(X86RegisterPool pool); @@ -390,6 +406,7 @@ /** * Verify the consistency of the state of this item. * Throw an exception is the state is inconsistent. + * @param ec */ protected abstract void verifyState(EmitterContext ec); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemFactory.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -52,7 +52,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final IntItem createIConst(EmitterContext ec, int val) { final IntItem item = (IntItem) getOrCreate(JvmType.INT); @@ -63,7 +65,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final FloatItem createFConst(EmitterContext ec, float val) { final FloatItem item = (FloatItem) getOrCreate(JvmType.FLOAT); @@ -74,7 +78,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final RefItem createAConst(EmitterContext ec, VmConstString val) { final RefItem item = (RefItem) getOrCreate(JvmType.REFERENCE); @@ -85,7 +91,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final LongItem createLConst(EmitterContext ec, long val) { final LongItem item = (LongItem) getOrCreate(JvmType.LONG); @@ -96,7 +104,9 @@ /** * Create a constant item * + * @param ec * @param val + * @return */ final DoubleItem createDConst(EmitterContext ec, double val) { final DoubleItem item = (DoubleItem) getOrCreate(JvmType.DOUBLE); @@ -108,6 +118,7 @@ * Create a stack item. * * @param jvmType + * @return */ public Item createStack(int jvmType) { final Item item = getOrCreate(jvmType); @@ -119,6 +130,7 @@ * Create an FPU stack item. * * @param jvmType + * @return */ public Item createFPUStack(int jvmType) { final Item item = getOrCreate(jvmType); @@ -130,6 +142,8 @@ * Create an LOCAL item. * * @param jvmType + * @param ebpOffset + * @return */ public Item createLocal(int jvmType, short ebpOffset) { final Item item = getOrCreate(jvmType); @@ -141,6 +155,8 @@ * Create an XMM item. * * @param jvmType + * @param xmm + * @return */ public Item createLocal(int jvmType, X86Register.XMM xmm) { final Item item = getOrCreate(jvmType); @@ -151,8 +167,10 @@ /** * Create a word register item. * + * @param ec * @param jvmType * @param reg + * @return */ public WordItem createReg(EmitterContext ec, int jvmType, X86Register reg) { final WordItem item = (WordItem) getOrCreate(jvmType); @@ -163,9 +181,11 @@ /** * Create a doubleword register item. * + * @param ec * @param jvmType * @param lsb * @param msb + * @return */ public DoubleWordItem createReg(EmitterContext ec, int jvmType, X86Register.GPR lsb, X86Register.GPR msb) { if (!ec.getStream().isCode32()) { @@ -179,9 +199,10 @@ /** * Create a doubleword register item. * + * @param ec * @param jvmType - * @param lsb - * @param msb + * @param reg + * @return */ public DoubleWordItem createReg(EmitterContext ec, int jvmType, X86Register.GPR64 reg) { final DoubleWordItem item = (DoubleWordItem) getOrCreate(jvmType); @@ -216,8 +237,9 @@ * Get an item out of the cache or if not present, create a new one. * * @param jvmType + * @return */ - private final Item getOrCreate(int jvmType) { + private Item getOrCreate(int jvmType) { final ArrayList<? extends Item> list = getList(jvmType); final Item item; if (list.isEmpty()) { @@ -234,8 +256,9 @@ * Gets the cache array for a given type. * * @param jvmType + * @return */ - private final ArrayList<? extends Item> getList(int jvmType) { + private ArrayList<? extends Item> getList(int jvmType) { switch (jvmType) { case JvmType.INT: return intItems; @@ -256,8 +279,9 @@ * Create a new item of a given type. * * @param jvmType + * @return */ - private final Item createNew(int jvmType) { + private Item createNew(int jvmType) { createCount++; switch (jvmType) { case JvmType.INT: @@ -283,8 +307,9 @@ /** * Gets the item factory. This item factory is singleton per thread. + * @return */ - static final ItemFactory getFactory() { + static ItemFactory getFactory() { ItemFactory fac = (ItemFactory) itemFactory.get(); if (fac == null) { fac = new ItemFactory(); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/ItemStack.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -51,6 +51,8 @@ /** * Constructor; create and initialize stack with default size + * @param expectedKind + * @param maxSize */ ItemStack(int expectedKind, int maxSize) { this.expectedKind = expectedKind; @@ -78,7 +80,7 @@ /** * Grow the stack capacity. */ - private final void grow() { + private void grow() { if (stack.length == maxSize) { throw new StackException("Stack full"); } else { @@ -165,6 +167,7 @@ /** * Reset this stack. The stack will be empty afterwards. + * @param ec */ final void reset(EmitterContext ec) { while (tos != 0) { Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/L1AHelper.java 2010-02-19 07:21:51 UTC (rev 5727) @@ -32,12 +32,12 @@ */ final class L1AHelper { - static final void assertCondition(boolean cond, String message) { + static void assertCondition(boolean cond, String message) { if (!cond) throw new Error("assert failed: " + message); } - static final void assertCondition(boolean cond, String message, Object param) { + static void assertCondition(boolean cond, String message, Object param) { if (!cond) { throw new Error("assert failed: " + message + param); } @@ -46,27 +46,32 @@ /** * Gets the 64-bit equivalent of the given 32-bit register. * + * @param eContext * @param src * @return the 64-bit register. */ - static final GPR64 get64BitReg(EmitterContext eContext, GPR src) { + static GPR64 get64BitReg(EmitterContext eContext, GPR src) { return (GPR64) eContext.getGPRPool().getRegisterInSameGroup(src, JvmType.LONG); } /** * Release a register. * + * @param eContext * @param reg */ - static final void releaseRegister(EmitterContext eContext, X86Register reg) { + static void releaseRegister(EmitterContext eContext, X86Register reg) { final X86RegisterPool pool = eContext.getGPRPool(); pool.release(reg); } /** * Request two register for a 8-byte item. + * @param eContext + * @param jvmType + * @return */ - static final DoubleWordItem requestDoubleWordRegisters( + static DoubleWordItem requestDoubleWordRegisters( EmitterContext eContext, int jvmType) { final X86RegisterPool pool = eContext.getGPRPool(); final X86Assembler os = eContext.getStream(); @@ -89,8 +94,13 @@ /** * Request two register for a 8-byte item. + * @param eContext + * @param jvmType + * @param lsb + * @param msb + * @return */ - static final DoubleWordItem requestDoubleWordRegisters( + static DoubleWordItem requestDoubleWordRegisters( EmitterContext eContext, int jvmType, X86Register.GPR lsb, X86Register.GPR msb) { if (!eContext.getStream().isCode32()) { throw new IllegalModeException("Only support in 32-bit mode"); @@ -108,8 +118,12 @@ /** * Request a 64-bit register for a 8-byte item. + * @param eContext + * @param jvmType + * @param reg + * @return */ - static final DoubleWordItem requestDoubleWordRegister( + static DoubleWordItem requestDoubleWordRegister( EmitterContext eContext, int jvmType, GPR64 reg) { if (!eContext.getStream().isCode64()) { throw new IllegalModeException("Only support in 64-bit mode"); @@ -126,9 +140,10 @@ * Request a register for calcuation, not tied to an item. Make sure to * release the register afterwards. * + * @param eContext * @param reg */ - static final void requestRegister(EmitterContext eContext, X86Register reg) { + static void requestRegister(EmitterContext eContext, X86Register reg) { final X86RegisterPool pool = eContext.getGPRPool(); if (!pool.isFree(reg)) { final Item i = (Item) pool.getOwner(reg); @@ -142,8 +157,12 @@ /** * Request a register of a given type, not tied to an item. Make sure to * release the register afterwards. + * @param eContext + * @param type + * @param supportsBits8 + * @return */ - static final X86Register requestRegister(EmitterContext eContext, int type, + static X86Register requestRegister(EmitterContext eContext, int type, boolean supportsBits8) { final X86RegisterPool pool = eContext.getGPRPool(); X86Register r = pool.request(type, supportsBits8); @@ -159,10 +178,11 @@ * reserve a register for an item. The item is not loaded with the register. * The register is spilled if another item holds it. * + * @param eContext * @param reg the register to reserve * @param it the item requiring the register */ - static final void requestRegister(EmitterContext eContext, X86Register reg, + static void requestRegister(EmitterContext eContext, X86Register reg, Item it) { final X86RegisterPool pool = eContext.getGPRPool(); @@ -182,8 +202,12 @@ /** * Request one register for a single word item. + * @param eContext + * @param jvmType + * @param supportsBits8 + * @return */ - static final WordItem requestWordRegister(EmitterContext eContext, + static WordItem requestWordRegister(EmitterContext eContext, int jvmType, boolean supportsBits8) { final X86RegisterPool pool = eContext.getGPRPool(); final ItemFactory ifac = eContext.getItemFactory(); @@ -196,8 +220,12 @@ /** * Request specific one register for a single word item. + * @param eContext + * @param jvmType + * @param reg + * @return */ - static final WordItem requestWordRegister(EmitterContext eContext, + static WordItem requestWordRegister(EmitterContext eContext, int jvmType, X86Register reg) { final X86RegisterPool pool = eContext.getGPRPool(); final ItemFactory ifac = eContext.getItemFactory(); Modified: trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java =================================================================== --- trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongItem.java 2010-02-13 22:12:20 UTC (rev 5726) +++ trunk/core/src/core/org/jnode/vm/x86/compiler/l1a/LongIt... [truncated message content] |
From: <ls...@us...> - 2010-03-27 06:08:14
|
Revision: 5736 http://jnode.svn.sourceforge.net/jnode/?rev=5736&view=rev Author: lsantha Date: 2010-03-27 06:08:08 +0000 (Sat, 27 Mar 2010) Log Message: ----------- Added support for specifying in jnode.properties the target plugin list of the jar packager. Modified Paths: -------------- trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java trunk/jnode.properties.dist Modified: trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java 2010-03-27 05:39:07 UTC (rev 5735) +++ trunk/builder/src/builder/org/jnode/build/packager/PackagerTask.java 2010-03-27 06:08:08 UTC (rev 5736) @@ -58,6 +58,7 @@ // properties names protected static final String USER_PLUGIN_IDS = "user.plugin.ids"; protected static final String PLUGIN_LIST_NAME = "plugin.list.name"; + protected static final String TARGET_PLUGIN_LIST = "target.plugin.list"; protected static final String FORCE_OVERWRITE_SCRIPTS = "force.overwrite.scripts"; /** Modified: trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java =================================================================== --- trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java 2010-03-27 05:39:07 UTC (rev 5735) +++ trunk/builder/src/builder/org/jnode/build/packager/PluginListInsertor.java 2010-03-27 06:08:08 UTC (rev 5736) @@ -63,9 +63,13 @@ */ private List<String> readPluginIds(String pluginListName) { List<String> pluginIds = new ArrayList<String>(); - + final Properties properties = getProperties(); - final String targetName = properties.getProperty(PLUGIN_LIST_NAME, null); + String targetName = getProject().getProperty(TARGET_PLUGIN_LIST); + if (targetName == null || targetName.trim().length() == 0) { + targetName = properties.getProperty(PLUGIN_LIST_NAME, null); + } + if (targetName == null) { log("property " + PLUGIN_LIST_NAME + " not specified in " + getPropertiesFile().getAbsolutePath(), Project.MSG_ERR); Modified: trunk/jnode.properties.dist =================================================================== --- trunk/jnode.properties.dist 2010-03-27 05:39:07 UTC (rev 5735) +++ trunk/jnode.properties.dist 2010-03-27 06:08:08 UTC (rev 5736) @@ -17,6 +17,9 @@ # jar packager (tool to easily create a jnode plugin from a regular jar file) # user.applications.dir = ${root.dir}/local/applications/ +# The jar packager adds the user plugins to the plugin list specified here. +# target.plugin.list=default + # ----------------------------------------------- # Settings for the bootdisk image This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2010-05-12 10:28:30
|
Revision: 5747 http://jnode.svn.sourceforge.net/jnode/?rev=5747&view=rev Author: fduminy Date: 2010-05-12 10:28:24 +0000 (Wed, 12 May 2010) Log Message: ----------- removed dependencies on PluginRegistryModel by using PluginRegistry interface instead Signed-off-by: Fabien DUMINY <fab...@we...> Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/system/PluginCommand.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/plugin/PluginRegistry.java trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java trunk/shell/src/test/org/jnode/test/shell/harness/TestRunnerBase.java Modified: trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java 2010-04-03 19:17:29 UTC (rev 5746) +++ trunk/cli/src/commands/org/jnode/command/system/PluginCommand.java 2010-05-12 10:28:24 UTC (rev 5747) @@ -147,7 +147,7 @@ } private void loadPlugin(String id, String version) throws PluginException { - mgr.getRegistry().loadPlugin(mgr.getLoaderManager(), id, version); + mgr.getRegistry().loadPlugin(mgr.getLoaderManager(), id, version, true); //resolve=true out.format(fmt_load, id, version); } @@ -156,11 +156,11 @@ final List<PluginReference> refs = reg.unloadPlugin(id); for (PluginReference ref : refs) { if (reg.getPluginDescriptor(ref.getId()) == null) { - reg.loadPlugin(mgr.getLoaderManager(), ref.getId(), ref.getVersion()); + reg.loadPlugin(mgr.getLoaderManager(), ref.getId(), ref.getVersion(), true); //resolve=true } } if (reg.getPluginDescriptor(id) == null) { - reg.loadPlugin(mgr.getLoaderManager(), id, version); + reg.loadPlugin(mgr.getLoaderManager(), id, version, true); //resolve=true } out.format(fmt_reload, id, version); } Modified: trunk/core/src/core/org/jnode/boot/InitJarProcessor.java =================================================================== --- trunk/core/src/core/org/jnode/boot/InitJarProcessor.java 2010-04-03 19:17:29 UTC (rev 5746) +++ trunk/core/src/core/org/jnode/boot/InitJarProcessor.java 2010-05-12 10:28:24 UTC (rev 5747) @@ -33,7 +33,7 @@ import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; import org.jnode.plugin.PluginLoader; -import org.jnode.plugin.model.PluginRegistryModel; +import org.jnode.plugin.PluginRegistry; import org.jnode.system.BootLog; import org.jnode.system.MemoryResource; import org.jnode.util.JarBuffer; @@ -72,7 +72,7 @@ * * @param piRegistry */ - public List<PluginDescriptor> loadPlugins(PluginRegistryModel piRegistry) { + public List<PluginDescriptor> loadPlugins(PluginRegistry piRegistry) { if (jbuf == null) { return null; } @@ -86,7 +86,7 @@ // Load it loader.setBuffer(entry.getValue()); final PluginDescriptor descr = piRegistry.loadPlugin( - loader, "", "", false); + loader, "", "", false); //resolve=false descriptors.add(descr); } catch (PluginException ex) { BootLog.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-04-03 19:17:29 UTC (rev 5746) +++ trunk/core/src/core/org/jnode/boot/Main.java 2010-05-12 10:28:24 UTC (rev 5747) @@ -23,16 +23,16 @@ import java.lang.reflect.Method; import java.util.List; +import org.jnode.annotation.LoadStatics; +import org.jnode.annotation.SharedStatics; +import org.jnode.annotation.Uninterruptible; import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginManager; +import org.jnode.plugin.PluginRegistry; import org.jnode.plugin.manager.DefaultPluginManager; -import org.jnode.plugin.model.PluginRegistryModel; import org.jnode.system.BootLog; import org.jnode.vm.Unsafe; import org.jnode.vm.VmSystem; -import org.jnode.annotation.LoadStatics; -import org.jnode.annotation.SharedStatics; -import org.jnode.annotation.Uninterruptible; /** * First class that is executed when JNode boots. @@ -49,7 +49,7 @@ /** * Initialized in org.jnode.build.x86.BootImageBuilder.initMain(). */ - private static PluginRegistryModel pluginRegistry; + private static PluginRegistry pluginRegistry; /** * First java entry point after the assembler kernel has booted. Modified: trunk/core/src/core/org/jnode/plugin/PluginRegistry.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/PluginRegistry.java 2010-04-03 19:17:29 UTC (rev 5746) +++ trunk/core/src/core/org/jnode/plugin/PluginRegistry.java 2010-05-12 10:28:24 UTC (rev 5747) @@ -59,10 +59,11 @@ * @param loader * @param pluginId * @param pluginVersion + * @param resolve true to resolve the plugin dependencies, false otherwise * @return The descriptor of the loaded plugin. * @throws PluginException */ - public PluginDescriptor loadPlugin(PluginLoader loader, String pluginId, String pluginVersion) + public PluginDescriptor loadPlugin(PluginLoader loader, String pluginId, String pluginVersion, boolean resolve) throws PluginException; /** Modified: trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java =================================================================== --- trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2010-04-03 19:17:29 UTC (rev 5746) +++ trunk/core/src/core/org/jnode/plugin/model/PluginRegistryModel.java 2010-05-12 10:28:24 UTC (rev 5747) @@ -288,29 +288,27 @@ } /** - * Load a plugin from a given loader. - * - * @param loader - * @param pluginId - * @param pluginVersion - * @return The descriptor of the loaded plugin. - * @throws PluginException + * {@inheritDoc} */ - public PluginDescriptor loadPlugin(final PluginLoader loader, final String pluginId, final String pluginVersion) + public PluginDescriptor loadPlugin(final PluginLoader loader, final String pluginId, final String pluginVersion, boolean resolve) throws PluginException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(PluginSecurityConstants.LOAD_PERM); } // Load the requested plugin - final HashMap<String, PluginDescriptorModel> descriptors = new HashMap<String, PluginDescriptorModel>(); - final PluginDescriptorModel descr = loadPlugin(loader, pluginId, pluginVersion, false); - descriptors.put(descr.getId(), descr); - // Load the dependent plugins - loadDependencies(loader, descr, descriptors); - - // Resolve the loaded descriptors. - resolveDescriptors(descriptors.values()); + final PluginDescriptorModel descr = loadPluginImpl(loader, pluginId, pluginVersion); + + if (resolve) { + final HashMap<String, PluginDescriptorModel> descriptors = new HashMap<String, PluginDescriptorModel>(); + descriptors.put(descr.getId(), descr); + // Load the dependent plugins + loadDependencies(loader, descr, descriptors); + + // Resolve the loaded descriptors. + resolveDescriptors(descriptors.values()); + } + return descr; } @@ -343,13 +341,13 @@ if (descriptors.containsKey(id)) { return; } - final PluginDescriptorModel descr = loadPlugin(loader, id, version, false); + final PluginDescriptorModel descr = loadPluginImpl(loader, id, version); descriptors.put(descr.getId(), descr); loadDependencies(loader, descr, descriptors); } /** - * Load a plugin from a given loader. + * Load a plugin from a given loader but doesn't resolve its dependencies. * * @param loader * @param pluginId @@ -357,12 +355,8 @@ * @return The descriptor of the loaded plugin. * @throws PluginException */ - public PluginDescriptorModel loadPlugin(final PluginLoader loader, final String pluginId, - final String pluginVersion, boolean resolve) throws PluginException { - final SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(PluginSecurityConstants.LOAD_PERM); - } + private final PluginDescriptorModel loadPluginImpl(final PluginLoader loader, final String pluginId, + final String pluginVersion) throws PluginException { final PluginRegistryModel registry = this; final PluginJar pluginJar; try { @@ -386,11 +380,7 @@ throw new PluginException(ex); } } - final PluginDescriptorModel descr = pluginJar.getDescriptorModel(); - if (resolve) { - descr.resolve(this); - } - return descr; + return pluginJar.getDescriptorModel(); } /** Modified: trunk/shell/src/test/org/jnode/test/shell/harness/TestRunnerBase.java =================================================================== --- trunk/shell/src/test/org/jnode/test/shell/harness/TestRunnerBase.java 2010-04-03 19:17:29 UTC (rev 5746) +++ trunk/shell/src/test/org/jnode/test/shell/harness/TestRunnerBase.java 2010-05-12 10:28:24 UTC (rev 5747) @@ -225,7 +225,7 @@ PluginManager mgr = InitialNaming.lookup(PluginManager.NAME); PluginRegistry reg = mgr.getRegistry(); if (reg.getPluginDescriptor(id) == null) { - reg.loadPlugin(mgr.getLoaderManager(), id, ver); + reg.loadPlugin(mgr.getLoaderManager(), id, ver, true); //resolve=true } } catch (Exception ex) { System.out.println(ex.getMessage()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |