public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Remove ordering limitation (Tom Tromey <tromey@redhat.com>). Date: Tue, 01 Apr 2008 21:43:00 -0000 [thread overview] Message-ID: <20080401214318.24080.qmail@sourceware.org> (raw) The branch, master has been updated via bcb3fa5fdc4667a15386f1ef9a116753d761fb90 (commit) from a0fc4305e0afa24959ac5cd073f65c6bb50eb8b0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit bcb3fa5fdc4667a15386f1ef9a116753d761fb90 Author: Andrew Cagney <cagney@redhat.com> Date: Tue Apr 1 17:36:51 2008 -0400 Remove ordering limitation (Tom Tromey <tromey@redhat.com>). frysk-imports/getopt/ChangeLog 2008-04-01 Andrew Cagney <cagney@redhat.com> Import 2008-03-20 Tom Tromey <tromey@redhat.com> * tools/gnu/classpath/tools/getopt/Parser.java (options): Don't initialize. (add, addFinal): Don't update options. (requireOptions): New method. (printHelp): Synchronize. Call requireOptions. (parse): Call requireOptions. ----------------------------------------------------------------------- Summary of changes: frysk-imports/getopt/ChangeLog | 10 +++++++ .../getopt/gnu/classpath/tools/getopt/Parser.java | 28 +++++++++++++++---- 2 files changed, 32 insertions(+), 6 deletions(-) First 500 lines of diff: diff --git a/frysk-imports/getopt/ChangeLog b/frysk-imports/getopt/ChangeLog index 5d3fc3d..eedda6d 100644 --- a/frysk-imports/getopt/ChangeLog +++ b/frysk-imports/getopt/ChangeLog @@ -1,3 +1,13 @@ +2008-04-01 Andrew Cagney <cagney@redhat.com> + + Import 2008-03-20 Tom Tromey <tromey@redhat.com> + * tools/gnu/classpath/tools/getopt/Parser.java (options): Don't + initialize. + (add, addFinal): Don't update options. + (requireOptions): New method. + (printHelp): Synchronize. Call requireOptions. + (parse): Call requireOptions. + 2007-01-26 Mark Wielaard <mark@klomp.org> * Makefile.am (getopt.jar): Pass JAVACFLAGS to JAVAC. diff --git a/frysk-imports/getopt/src/getopt/gnu/classpath/tools/getopt/Parser.java b/frysk-imports/getopt/src/getopt/gnu/classpath/tools/getopt/Parser.java index b142836..5b18ecb 100644 --- a/frysk-imports/getopt/src/getopt/gnu/classpath/tools/getopt/Parser.java +++ b/frysk-imports/getopt/src/getopt/gnu/classpath/tools/getopt/Parser.java @@ -1,5 +1,5 @@ /* Parser.java - parse command line options - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2008 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -66,7 +66,9 @@ public class Parser private boolean longOnly; - private ArrayList options = new ArrayList(); + // All of the options. This is null initially; users must call + // requireOptions before access. + private ArrayList options; private ArrayList optionGroups = new ArrayList(); @@ -218,7 +220,6 @@ public class Parser */ public synchronized void add(Option opt) { - options.add(opt); defaultGroup.add(opt); } @@ -230,7 +231,6 @@ public class Parser */ protected synchronized void addFinal(Option opt) { - options.add(opt); finalGroup.add(opt); } @@ -242,7 +242,6 @@ public class Parser */ public synchronized void add(OptionGroup group) { - options.addAll(group.options); // This ensures that the final group always appears at the end // of the options. if (optionGroups.isEmpty()) @@ -251,13 +250,29 @@ public class Parser optionGroups.add(optionGroups.size() - 1, group); } + // Make sure the 'options' field is properly initialized. + private void requireOptions() + { + if (options != null) + return; + options = new ArrayList(); + Iterator it = optionGroups.iterator(); + while (it.hasNext()) + { + OptionGroup group = (OptionGroup) it.next(); + options.addAll(group.options); + } + } + public void printHelp() { this.printHelp(System.out); } - void printHelp(PrintStream out) + synchronized void printHelp(PrintStream out) { + requireOptions(); + if (headerText != null) { formatText(out, headerText); @@ -417,6 +432,7 @@ public class Parser */ public synchronized void parse(String[] inArgs, FileArgumentCallback files) { + requireOptions(); try { args = inArgs; hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-04-01 21:43 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080401214318.24080.qmail@sourceware.org \ --to=cagney@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).