Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-843

PreferenceManager gerPoint always returns default value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • 1.7
    • None
    • Utilities
    • None
    • Operating System: All
      Platform: All

    Description

      There is a bug in the org.apache.batik.util.PreferenceManager where the function public Point getPoint(String key) always returns the default value for a given key.

      This is due to what looks like a simple cut and paste error in the code, and can be resolved by removing the 4 marked lines in the code snippet below.

      x = Integer.parseInt(token);
      if (!st.hasMoreTokens()) {
      internal.remove(key);
      return defaultValue;
      }
      token = st.nextToken();
      y = Integer.parseInt(token);
      – if (!st.hasMoreTokens())

      { -- internal.remove(key); -- return defaultValue; -- }

      result.setLocation(x,y);
      return result;

      Attachments

        Activity

          People

            batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
            pauls@clearboxsystems.com.au Paul Solomon
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: