Bug 45572 - PreferenceManager gerPoint always returns default value
Summary: PreferenceManager gerPoint always returns default value
Status: NEW
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: Utilities (show other bugs)
Version: 1.7
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-05 19:14 UTC by Paul Solomon
Modified: 2008-08-05 19:14 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Solomon 2008-08-05 19:14:31 UTC
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;