From: <des...@sv...> - 2005-11-30 00:05:04
|
Author: desruisseaux Date: 2005-11-29 16:04:23 -0800 (Tue, 29 Nov 2005) New Revision: 17063 Modified: geotools/trunk/gt/plugin/epsg-postgresql/src/org/geotools/referencing/= factory/epsg/PostgreDataSource.java Log: Fixed a NullPointerException (bug pointed out by Richard Didier) Modified: geotools/trunk/gt/plugin/epsg-postgresql/src/org/geotools/refer= encing/factory/epsg/PostgreDataSource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- geotools/trunk/gt/plugin/epsg-postgresql/src/org/geotools/referencing= /factory/epsg/PostgreDataSource.java 2005-11-29 22:21:03 UTC (rev 17062) +++ geotools/trunk/gt/plugin/epsg-postgresql/src/org/geotools/referencing= /factory/epsg/PostgreDataSource.java 2005-11-30 00:04:23 UTC (rev 17063) @@ -149,11 +149,10 @@ final String user, final String password) { - Properties p; + final Properties p =3D new Properties(); try { - p =3D load(); + load(p); } catch (IOException exception) { - p =3D new Properties(); Utilities.unexpectedException("org.geotools.referencing.fact= ory", "DataSource", "<init>", exception); } @@ -176,24 +175,22 @@ /** * Loads the {@linkplain #CONFIGURATION_FILE configuration file}. * - * @return The properties from the configuration file, or {@code nul= l} if the file has not - * been found. + * @param The properties in which to stores the configuration infor= mations. * @throws IOException if the configuration file was found, but an e= rror occured while * reading it. */ - private static Properties load() throws IOException { + private static void load(final Properties p) throws IOException { File file =3D new File(CONFIGURATION_FILE); if (!file.isFile()) { file =3D new File(System.getProperty("user.home", "."), CONF= IGURATION_FILE); if (!file.isFile()) { - return null; + return; } } - final Properties properties =3D new Properties(); final InputStream in =3D new FileInputStream(file); - properties.load(in); + p.load(in); in.close(); - return properties; + return; } =20 /** |