Index: trunk/src/gnu/getopt/Getopt.java
===================================================================
--- trunk/src/gnu/getopt/Getopt.java	(revision 10208)
+++ trunk/src/gnu/getopt/Getopt.java	(revision 10209)
@@ -4,5 +4,5 @@
 /*
 /* This program is free software; you can redistribute it and/or modify
-/* it under the terms of the GNU Library General Public License as published 
+/* it under the terms of the GNU Library General Public License as published
 /* by  the Free Software Foundation; either version 2 of the License or
 /* (at your option) any later version.
@@ -14,6 +14,6 @@
 /*
 /* You should have received a copy of the GNU Library General Public License
-/* along with this program; see the file COPYING.LIB.  If not, write to 
-/* the Free Software Foundation Inc., 59 Temple Place - Suite 330, 
+/* along with this program; see the file COPYING.LIB.  If not, write to
+/* the Free Software Foundation Inc., 59 Temple Place - Suite 330,
 /* Boston, MA  02111-1307 USA
 /**************************************************************************/
@@ -55,5 +55,5 @@
   * which can be retrieved using the getOptopt() method.  To suppress
   * the printing of error messages for this or any other error, set
-  * the value of the opterr instance variable to false using the 
+  * the value of the opterr instance variable to false using the
   * setOpterr() method.
   * <p>
@@ -65,5 +65,5 @@
   * <p>
   * Note that this object expects command line options to be passed in the
-  * traditional Unix manner.  That is, proceeded by a '-' character. 
+  * traditional Unix manner.  That is, proceeded by a '-' character.
   * Multiple options can follow the '-'.  For example "-abc" is equivalent
   * to "-a -b -c".  If an option takes a required argument, the value
@@ -80,5 +80,5 @@
   * <p>
   * The user can stop getopt() from scanning any further into a command line
-  * by using the special argument "--" by itself.  For example: 
+  * by using the special argument "--" by itself.  For example:
   * "-a -- -d" would return an option character of 'a', then return -1
   * The "--" is discarded and "-d" is pointed to by optind as the first
@@ -104,5 +104,5 @@
   *          case 'c':
   *            arg = g.getOptarg();
-  *            System.out.print("You picked " + (char)c + 
+  *            System.out.print("You picked " + (char)c +
   *                             " with an argument of " +
   *                             ((arg != null) ? arg : "null") + "\n");
@@ -145,13 +145,13 @@
   * options were at the beginning of the command line, and all non-options
   * were at the end.  For example, calling getopt() with command line args
-  * of "-a foo bar -d" returns options 'a' and 'd', then sets optind to 
+  * of "-a foo bar -d" returns options 'a' and 'd', then sets optind to
   * point to "foo".  The program would read the last two argv elements as
-  * "foo" and "bar", just as if the user had typed "-a -d foo bar". 
-  * <p> 
+  * "foo" and "bar", just as if the user had typed "-a -d foo bar".
+  * <p>
   * The user can force getopt() to stop scanning the command line with
   * the special argument "--" by itself.  Any elements occuring before the
   * "--" are scanned and permuted as normal.  Any elements after the "--"
-  * are returned as is as non-option argv elements.  For example, 
-  * "foo -a -- bar -d" would return  option 'a' then -1.  optind would point 
+  * are returned as is as non-option argv elements.  For example,
+  * "foo -a -- bar -d" would return  option 'a' then -1.  optind would point
   * to "foo", "bar" and "-d" as the non-option argv elements.  The "--"
   * is discarded by getopt().
@@ -175,11 +175,11 @@
   * is discarded.
   * <p>
-  * The POSIX/traditional behavior is enabled by either setting the 
+  * The POSIX/traditional behavior is enabled by either setting the
   * property "gnu.posixly_correct" or by putting a '+' sign as the first
-  * character of the option string.  The difference between the two 
+  * character of the option string.  The difference between the two
   * methods is that setting the gnu.posixly_correct property also forces
   * certain error messages to be displayed in POSIX format.  To enable
   * the "return in order" functionality, put a '-' as the first character
-  * of the option string.  Note that after determining the proper 
+  * of the option string.  Note that after determining the proper
   * behavior, Getopt strips this leading '+' or '-', meaning that a ':'
   * placed as the second character after one of those two will still cause
@@ -191,7 +191,7 @@
   * can be as long as desired.  Long options provide a more user-friendly
   * way of entering command line options.  For example, in addition to a
-  * "-h" for help, a program could support also "--help".  
-  * <p>
-  * Like short options, long options can also take a required or non-required 
+  * "-h" for help, a program could support also "--help".
+  * <p>
+  * Like short options, long options can also take a required or non-required
   * argument.  Required arguments can either be specified by placing an
   * equals sign after the option name, then the argument, or by putting the
@@ -205,6 +205,6 @@
   * with no argument and a first non-option argv element of "foo".
   * <p>
-  * Long options can also be specified using a special POSIX argument 
-  * format (one that I highly discourage).  This form of entry is 
+  * Long options can also be specified using a special POSIX argument
+  * format (one that I highly discourage).  This form of entry is
   * enabled by placing a "W;" (yes, 'W' then a semi-colon) in the valid
   * option string.  This causes getopt to treat the name following the
@@ -212,5 +212,5 @@
   * would be equivalent to "--outputdir=foo".  The name can immediately
   * follow the "-W" like so: "-Woutputdir=foo".  Option arguments are
-  * handled identically to normal long options.  If a string follows the 
+  * handled identically to normal long options.  If a string follows the
   * "-W" that does not represent a valid long option, then getopt() returns
   * 'W' and the caller must decide what to do.  Otherwise getopt() returns
@@ -221,7 +221,7 @@
   * few characters as required to uniquely identify it.  If the name can
   * represent multiple long options, then an error message is printed and
-  * getopt() returns a '?'.  
-  * <p>
-  * If an invalid option is specified or a required option argument is 
+  * getopt() returns a '?'.
+  * <p>
+  * If an invalid option is specified or a required option argument is
   * missing, getopt() prints an error and returns a '?' or ':' exactly
   * as for short options.  Note that when an invalid long option is
@@ -242,5 +242,5 @@
   * <p>
   * When getopt() is called and a long option is encountered, one of two
-  * things can be returned.  If the flag field in the LongOpt object 
+  * things can be returned.  If the flag field in the LongOpt object
   * representing the long option is non-null, then the integer value field
   * is stored there and an integer 0 is returned to the caller.  The val
@@ -250,12 +250,12 @@
   * If the flag field in the LongOpt object is null, then the value field
   * of the LongOpt is returned.  This can be the character of a short option.
-  * This allows an app to have both a long and short option sequence 
+  * This allows an app to have both a long and short option sequence
   * (say, "-h" and "--help") that do the exact same thing.
   * <p>
-  * With long options, there is an alternative method of determining 
+  * With long options, there is an alternative method of determining
   * which option was selected.  The method getLongind() will return the
   * the index in the long option array (NOT argv) of the long option found.
   * So if multiple long options are configured to return the same value,
-  * the application can use getLongind() to distinguish between them. 
+  * the application can use getLongind() to distinguish between them.
   * <p>
   * Here is an expanded Getopt example using long options and various
@@ -266,10 +266,10 @@
   * String arg;
   * LongOpt[] longopts = new LongOpt[3];
-  * // 
+  * //
   * StringBuffer sb = new StringBuffer();
   * longopts[0] = new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h');
-  * longopts[1] = new LongOpt("outputdir", LongOpt.REQUIRED_ARGUMENT, sb, 'o'); 
+  * longopts[1] = new LongOpt("outputdir", LongOpt.REQUIRED_ARGUMENT, sb, 'o');
   * longopts[2] = new LongOpt("maximum", LongOpt.OPTIONAL_ARGUMENT, null, 2);
-  * // 
+  * //
   * Getopt g = new Getopt("testprog", argv, "-:bc::d:hW;", longopts);
   * g.setOpterr(false); // We'll do our own error handling
@@ -297,5 +297,5 @@
   *          System.out.println("We picked option " +
   *                             longopts[g.getLongind()].getName() +
-  *                           " with value " + 
+  *                           " with value " +
   *                           ((arg != null) ? arg : "null"));
   *          break;
@@ -308,5 +308,5 @@
   *        case 'd':
   *          arg = g.getOptarg();
-  *          System.out.println("You picked option '" + (char)c + 
+  *          System.out.println("You picked option '" + (char)c +
   *                             "' with argument " +
   *                             ((arg != null) ? arg : "null"));
@@ -328,5 +328,5 @@
   *          //
   *        case '?':
-  *          System.out.println("The option '" + (char)g.getOptopt() + 
+  *          System.out.println("The option '" + (char)g.getOptopt() +
   *                           "' is not valid");
   *          break;
@@ -351,7 +351,7 @@
   * It does not cause only long options to be parsed but instead enables
   * the behavior described above.
-  * <p> 
-  * Note that the functionality and variable names used are driven from 
-  * the C lib version as this object is a port of the C code, not a 
+  * <p>
+  * Note that the functionality and variable names used are driven from
+  * the C lib version as this object is a port of the C code, not a
   * new implementation.  This should aid in porting existing C/C++ code,
   * as well as helping programmers familiar with the glibc version to
@@ -383,9 +383,9 @@
  */
 
-/** 
+/**
   * Describe how to deal with options that follow non-option ARGV-elements.
   *
   * If the caller did not specify anything,
-  * the default is REQUIRE_ORDER if the property 
+  * the default is REQUIRE_ORDER if the property
   * gnu.posixly_correct is defined, PERMUTE otherwise.
   *
@@ -426,5 +426,5 @@
  * Instance Variables
  */
- 
+
 /**
   * For communication from `getopt' to the caller.
@@ -447,15 +447,15 @@
   *
   *  Otherwise, `optind' communicates from one call to the next
-  *  how much of ARGV has been scanned so far.  
+  *  how much of ARGV has been scanned so far.
   */
 protected int optind = 0;
 
-/** 
+/**
   * Callers store false here to inhibit the error message
-  * for unrecognized options.  
+  * for unrecognized options.
   */
 protected boolean opterr = true;
 
-/** 
+/**
   * When an unrecognized option is encountered, getopt will return a '?'
   * and store the value of the invalid option here.
@@ -463,5 +463,5 @@
 protected int optopt = '?';
 
-/** 
+/**
   * The next char to be scanned in the option-element
   * in which the last option character we returned was found.
@@ -469,5 +469,5 @@
   *
   * If this is zero, or a null string, it means resume the scan
-  * by advancing to the next ARGV-element.  
+  * by advancing to the next ARGV-element.
   */
 protected String nextchar;
@@ -479,5 +479,5 @@
 
 /**
-  * This is an array of LongOpt objects which describ the valid long 
+  * This is an array of LongOpt objects which describ the valid long
   * options.
   */
@@ -574,5 +574,5 @@
   */
 public
-Getopt(String progname, String[] argv, String optstring, 
+Getopt(String progname, String[] argv, String optstring,
        LongOpt[] long_options)
 {
@@ -612,5 +612,5 @@
   * Construct a Getopt instance with given input data that is capable of
   * parsing long options and short options.  Contrary to what you might
-  * think, the flag 'long_only' does not determine whether or not we 
+  * think, the flag 'long_only' does not determine whether or not we
   * scan for only long arguments.  Instead, a value of true here allows
   * long arguments to start with a '-' instead of '--' unless there is a
@@ -624,5 +624,5 @@
   */
 public
-Getopt(String progname, String[] argv, String optstring, 
+Getopt(String progname, String[] argv, String optstring,
        LongOpt[] long_options, boolean long_only)
 {
@@ -673,5 +673,5 @@
 
 /**************************************************************************/
- 
+
 /*
  * Instance Methods
@@ -706,5 +706,5 @@
   *
   * Otherwise, `optind' communicates from one call to the next
-  * how much of ARGV has been scanned so far.  
+  * how much of ARGV has been scanned so far.
   */
 public int
@@ -719,5 +719,5 @@
   * This method allows the optind index to be set manually.  Normally this
   * is not necessary (and incorrect usage of this method can lead to serious
-  * lossage), but optind is a public symbol in GNU getopt, so this method 
+  * lossage), but optind is a public symbol in GNU getopt, so this method
   * was added to allow it to be modified by the caller if desired.
   *
@@ -749,5 +749,5 @@
 /**************************************************************************/
 
-/** 
+/**
   * For communication from `getopt' to the caller.
   * When `getopt' finds an option that takes an argument,
@@ -768,5 +768,5 @@
   * Normally Getopt will print a message to the standard error when an
   * invalid option is encountered.  This can be suppressed (or re-enabled)
-  * by calling this method.  There is no get method for this variable 
+  * by calling this method.  There is no get method for this variable
   * because if you can't remember the state you set this to, why should I?
   */
@@ -823,9 +823,9 @@
       if (top - middle > middle - bottom)
         {
-          // Bottom segment is the short one. 
+          // Bottom segment is the short one.
           int len = middle - bottom;
           int i;
 
-          // Swap it with the top part of the top segment. 
+          // Swap it with the top part of the top segment.
           for (i = 0; i < len; i++)
             {
@@ -834,5 +834,5 @@
               argv[top - (middle - bottom) + i] = tem;
             }
-          // Exclude the moved bottom segment from further swapping. 
+          // Exclude the moved bottom segment from further swapping.
           top -= len;
         }
@@ -843,5 +843,5 @@
           int i;
 
-          // Swap it with the bottom part of the bottom segment. 
+          // Swap it with the bottom part of the bottom segment.
           for (i = 0; i < len; i++)
             {
@@ -850,10 +850,10 @@
               argv[middle + i] = tem;
             }
-          // Exclude the moved top segment from further swapping. 
+          // Exclude the moved top segment from further swapping.
           bottom += len;
         }
     }
 
-  // Update records for the slots the non-options now occupy. 
+  // Update records for the slots the non-options now occupy.
 
   first_nonopt += (optind - last_nonopt);
@@ -879,5 +879,5 @@
   boolean ambig;
   boolean exact;
-  
+
   longopt_handled = true;
   ambig = false;
@@ -888,5 +888,5 @@
   if (nameend == -1)
     nameend = nextchar.length();
-  
+
   // Test all lnog options for either exact match or abbreviated matches
   for (int i = 0; i < long_options.length; i++)
@@ -915,5 +915,5 @@
         }
     } // for
-  
+
   // Print out an error if the option specified was ambiguous
   if (ambig && !exact)
@@ -923,5 +923,5 @@
           Object[] msgArgs = { progname, argv[optind] };
           System.err.println(MessageFormat.format(
-                             _messages.getString("getopt.ambigious"), 
+                             _messages.getString("getopt.ambigious"),
                              msgArgs));
         }
@@ -930,12 +930,12 @@
        optopt = 0;
        ++optind;
- 
+
        return('?');
     }
- 
+
   if (pfound != null)
     {
       ++optind;
- 
+
       if (nameend != nextchar.length())
         {
@@ -956,5 +956,5 @@
                       Object[] msgArgs = { progname, pfound.name };
                       System.err.println(MessageFormat.format(
-                                  _messages.getString("getopt.arguments1"), 
+                                  _messages.getString("getopt.arguments1"),
                                   msgArgs));
                     }
@@ -962,16 +962,16 @@
                   else
                     {
-                      Object[] msgArgs = { progname, new 
-                               Character(argv[optind-1].charAt(0)).toString(),
+                      Object[] msgArgs = { progname,
+                               Character.toString(argv[optind-1].charAt(0)),
                                pfound.name };
                       System.err.println(MessageFormat.format(
-                               _messages.getString("getopt.arguments2"), 
+                               _messages.getString("getopt.arguments2"),
                                msgArgs));
                     }
                  }
-   
+
               nextchar = "";
               optopt = pfound.val;
-   
+
               return('?');
             }
@@ -990,8 +990,8 @@
                   Object[] msgArgs = { progname, argv[optind-1] };
                   System.err.println(MessageFormat.format(
-                                     _messages.getString("getopt.requires"), 
+                                     _messages.getString("getopt.requires"),
                                      msgArgs));
                 }
-   
+
               nextchar = "";
               optopt = pfound.val;
@@ -1002,5 +1002,5 @@
             }
         } // else if (pfound)
-   
+
       nextchar = "";
 
@@ -1009,5 +1009,5 @@
           pfound.flag.setLength(0);
           pfound.flag.append(pfound.val);
-   
+
           return(0);
         }
@@ -1015,5 +1015,5 @@
       return(pfound.val);
    } // if (pfound != null)
-  
+
   longopt_handled = false;
 
@@ -1070,5 +1070,5 @@
               optind++;
             }
-          
+
           last_nonopt = optind;
         }
@@ -1106,5 +1106,5 @@
       // If we have come to a non-option and did not permute it,
       // either stop the scan or describe it to the caller and pass it by.
-      if (argv[optind].equals("") || (argv[optind].charAt(0) != '-') || 
+      if (argv[optind].equals("") || (argv[optind].charAt(0) != '-') ||
           argv[optind].equals("-"))
         {
@@ -1115,5 +1115,5 @@
             return(1);
         }
-      
+
       // We have found another option-ARGV-element.
       // Skip the initial punctuation.
@@ -1139,5 +1139,5 @@
      This distinction seems to be the most useful approach.  */
   if ((long_options != null) && (argv[optind].startsWith("--")
-      || (long_only && ((argv[optind].length()  > 2) || 
+      || (long_only && ((argv[optind].length()  > 2) ||
       (optstring.indexOf(argv[optind].charAt(1)) == -1)))))
     {
@@ -1146,5 +1146,5 @@
        if (longopt_handled)
          return(c);
-         
+
       // Can't find it as a long option.  If this is not getopt_long_only,
       // or the option starts with '--' or is not a valid short
@@ -1160,14 +1160,14 @@
                   Object[] msgArgs = { progname, nextchar };
                   System.err.println(MessageFormat.format(
-                                   _messages.getString("getopt.unrecognized"), 
+                                   _messages.getString("getopt.unrecognized"),
                                    msgArgs));
                 }
               else
                 {
-                  Object[] msgArgs = { progname, new 
-                                 Character(argv[optind].charAt(0)).toString(), 
+                  Object[] msgArgs = { progname,
+                                 Character.toString(argv[optind].charAt(0)),
                                  nextchar };
                   System.err.println(MessageFormat.format(
-                                 _messages.getString("getopt.unrecognized2"), 
+                                 _messages.getString("getopt.unrecognized2"),
                                  msgArgs));
                 }
@@ -1177,5 +1177,5 @@
           ++optind;
           optopt = 0;
-    
+
           return('?');
         }
@@ -1188,5 +1188,5 @@
   else
     nextchar = "";
-  
+
   String temp = null;
   if (optstring.indexOf(c) != -1)
@@ -1203,6 +1203,6 @@
             {
               // 1003.2 specifies the format of this message
-              Object[] msgArgs = { progname, new 
-                                   Character((char)c).toString() };
+              Object[] msgArgs = { progname,
+                                   Character.toString((char)c) };
               System.err.println(MessageFormat.format(
                             _messages.getString("getopt.illegal"), msgArgs));
@@ -1210,6 +1210,6 @@
           else
             {
-              Object[] msgArgs = { progname, new 
-                                   Character((char)c).toString() };
+              Object[] msgArgs = { progname,
+                                   Character.toString((char)c) };
               System.err.println(MessageFormat.format(
                             _messages.getString("getopt.invalid"), msgArgs));
@@ -1234,7 +1234,7 @@
           if (opterr)
             {
-              // 1003.2 specifies the format of this message. 
-              Object[] msgArgs = { progname, new 
-                                   Character((char)c).toString() };
+              // 1003.2 specifies the format of this message.
+              Object[] msgArgs = { progname,
+                                   Character.toString((char)c) };
               System.err.println(MessageFormat.format(
                             _messages.getString("getopt.requires2"), msgArgs));
@@ -1250,5 +1250,5 @@
         {
           // We already incremented `optind' once;
-          // increment it again when taking next ARGV-elt as argument. 
+          // increment it again when taking next ARGV-elt as argument.
           nextchar = argv[optind];
           optarg  = argv[optind];
@@ -1297,6 +1297,6 @@
                 {
                   // 1003.2 specifies the format of this message
-                  Object[] msgArgs = { progname, new 
-                                       Character((char)c).toString() };
+                  Object[] msgArgs = { progname,
+                                       Character.toString((char)c) };
                   System.err.println(MessageFormat.format(
                             _messages.getString("getopt.requires2"), msgArgs));
@@ -1304,5 +1304,5 @@
 
               optopt = c;
- 
+
               if (optstring.charAt(0) == ':')
                 return(':');
@@ -1327,6 +1327,6 @@
                         {
                           // 1003.2 specifies the format of this message
-                          Object[] msgArgs = { progname, new 
-                                               Character((char)c).toString() };
+                          Object[] msgArgs = { progname,
+                                               Character.toString((char)c) };
                           System.err.println(MessageFormat.format(
                              _messages.getString("getopt.requires2"), msgArgs));
@@ -1334,5 +1334,5 @@
 
                       optopt = c;
- 
+
                       if (optstring.charAt(0) == ':')
                         return(':');
Index: trunk/src/gnu/getopt/LongOpt.java
===================================================================
--- trunk/src/gnu/getopt/LongOpt.java	(revision 10208)
+++ trunk/src/gnu/getopt/LongOpt.java	(revision 10209)
@@ -5,5 +5,5 @@
 /*
 /* This program is free software; you can redistribute it and/or modify
-/* it under the terms of the GNU Library General Public License as published 
+/* it under the terms of the GNU Library General Public License as published
 /* by  the Free Software Foundation; either version 2 of the License or
 /* (at your option) any later version.
@@ -15,6 +15,6 @@
 /*
 /* You should have received a copy of the GNU Library General Public License
-/* along with this program; see the file COPYING.LIB.  If not, write to 
-/* the Free Software Foundation Inc., 59 Temple Place - Suite 330, 
+/* along with this program; see the file COPYING.LIB.  If not, write to
+/* the Free Software Foundation Inc., 59 Temple Place - Suite 330,
 /* Boston, MA  02111-1307 USA
 /**************************************************************************/
@@ -22,6 +22,4 @@
 package gnu.getopt;
 
-import java.util.Locale;
-import java.util.ResourceBundle;
 import java.text.MessageFormat;
 
@@ -34,5 +32,5 @@
   * session.  Refer to the getopt documentation for details on the
   * format of long options.
-  * 
+  *
   * @version 1.0.5
   * @author Aaron M. Renn (arenn@urbanophile.com)
@@ -55,5 +53,5 @@
 public static final int NO_ARGUMENT = 0;
 
-/** 
+/**
   * Constant value used for the "has_arg" constructor argument.  This
   * value indicates that the option takes an argument that is required.
@@ -116,16 +114,16 @@
   * @param flag If non-null, this is a location to store the value of "val" when this option is encountered, otherwise "val" is treated as the equivalent short option character.
   * @param val The value to return for this long option, or the equivalent single letter option to emulate if flag is null.
-  * 
+  *
   * @exception IllegalArgumentException If the has_arg param is not one of NO_ARGUMENT, REQUIRED_ARGUMENT or OPTIONAL_ARGUMENT.
   */
 public
-LongOpt(String name, int has_arg, 
+LongOpt(String name, int has_arg,
         StringBuffer flag, int val) throws IllegalArgumentException
 {
   // Validate has_arg
-  if ((has_arg != NO_ARGUMENT) && (has_arg != REQUIRED_ARGUMENT) 
+  if ((has_arg != NO_ARGUMENT) && (has_arg != REQUIRED_ARGUMENT)
      && (has_arg != OPTIONAL_ARGUMENT))
     {
-      Object[] msgArgs = { new Integer(has_arg).toString() };
+      Object[] msgArgs = { Integer.toString(has_arg) };
       throw new IllegalArgumentException(MessageFormat.format(
                     _messages.getString("getopt.invalidValue"), msgArgs));
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 10208)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 10209)
@@ -1175,5 +1175,5 @@
         if (value != null && !value.isEmpty()) {
             try {
-                return new Double(value);
+                return Double.valueOf(value);
             } catch (NumberFormatException e) {
                 Main.warn(e);
