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. ------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com _______________________________________________ Jnode-svn-commits mailing list Jnode-svn-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jnode-svn-commits