xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Solomon <pa...@clearboxsystems.com.au>
Subject Bugfix
Date Tue, 05 Aug 2008 13:43:13 GMT
Hi All,

What is the best way to submit bugfixes? I have found one so far working with batik in the
following file. The fix is below

org.apache.batik.util.PreferenceManager

    public Point getPoint(String key)
    {		
	Point defaultValue = (Point)getDefault(key);
        String sp = internal.getProperty(key);
        if (sp == null) {
            return defaultValue;
        }
        Point result = new Point();
        try {
            int x, y;
            String token;
            StringTokenizer st = new StringTokenizer(sp," ", false);
            if (!st.hasMoreTokens()) {
                // the value is not correctly formated => remove it
                internal.remove(key);
                return defaultValue;
            }
            token = st.nextToken();
            x = Integer.parseInt(token);
            if (!st.hasMoreTokens()) {
                internal.remove(key);
                return defaultValue;
            }
            token = st.nextToken();
            y = Integer.parseInt(token);
// ------------- BUG -----  These 4 lines should be removed 
//          if (!st.hasMoreTokens()) {
//            internal.remove(key);
//              return defaultValue;
//          }
            result.setLocation(x,y);
            return result;
        } catch (NumberFormatException e) {
            internal.remove(key);
            return defaultValue;
        }
    }


Regards,

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message