|
From: William T. S. <bu...@vi...> - 2002-08-09 21:30:00
|
Hi all,
Very interesting discussions on rendering, etc. This is just to report a
few code errors.
Just updated my source codes from CVS and tried to build using the ant build
script in gtbuild. Got through core ok, but it upchucked and stopped in
defaultcore. I think I've tracked down a few errors:
in \styles\BasicPolygonStyle.java
line 45 is
this.setFeatureTypeStyles(setFeatureTypeStyles(new
FeatureTypeStyle[]{fts}));
and (I think) should be
this.setFeatureTypeStyles(new FeatureTypeStyle[]{fts});
After fixing the above, I next got the following errors (while executing the
ant build process)
compile:
G:\JavaCode\JavaGIS\GEOTools\geotools2\geotools-src\gtbuild\..\defaultcore/s
rc
Compiling 13 source files
src/org/geotools/styling/DefaultFill.java [98] exception
org.geotools.filter.IllegalFilterException is never thrown in body of
corresponding try statement
} catch (org.geotools.filter.IllegalFilterException ife){
^
src/org/geotools/styling/DefaultFill.java [138] exception
org.geotools.filter.IllegalFilterException is never thrown in body of
corresponding try statement
} catch (org.geotools.filter.IllegalFilterException ife){
^
src/org/geotools/styling/DefaultFill.java [169] exception
org.geotools.filter.IllegalFilterException is never thrown in body of
corresponding try statement
} catch (org.geotools.filter.IllegalFilterException ife){
^
These occur in DefaultFill methods which are all similar to the following
(which generated the final error):
public void setOpacity(String opacity){
try {
this.opacity = new
org.geotools.filter.ExpressionLiteral(opacity);
} catch (org.geotools.filter.IllegalFilterException ife){
LOGGER.severe("error setting opacity: " + ife);
}
}
The problem is that the constructor ExpressionLiteral(string st) in
\filter\ExpressionLiteral.java does not throw an IllegalFilterException.
The constructor is overloaded (for int, double, string and Object), but the
only one which throws the exception is ExpressionLiteral(Object obj). The
solution can take one of two approaches: (1) in DefaultFill, change
setOpacity, setColor, and setBackgroundColor so that they do not try to
catch an IllegalFilterException that is not thrown in ExpressionLiteral, or
(2) give all the constructors in ExpressionLiteral the ability to throw an
IllegalFilterException (even if that will never occur). I'm not sure what
the convention is for overloaded methods, but I would suggest the latter so
you don't have to remember which overloaded methods throw which (if any)
exceptions.
Having made these couple of changes to my local versions of the source code,
the defaultcore module built successfully (using ForteForJava on NT4).
Buck
***********************************************************************
*William T. Stockhausen, PhD e-mail: bu...@vi... *
*Senior Marine Scientist voice : 804-684-7643 *
*Virginia Institute of Marine Science fax : 804-684-7250 *
*College of William and Mary http://www.vims.edu/~buck *
*Greate Road *
*Gloucester Point, VA 23062-1346 *
***********************************************************************
|