Totally forgot about the Java-Foo. Invoking functions on not initialized objects is hard. Thanks for pointing out.
Regards, Jochen Am Mittwoch 04 Januar 2017 13:36:00 schrieben Sie: > On Wed, Jan 4, 2017 at 12:31 PM, Jochen Saalfeld <[email protected]> > > wrote: > > Hey, > > > > The programm is: > > > > ------------- > > > > import org.geotools.referencing.CRS; > > import org.opengis.referencing.FactoryException; > > import org.opengis.referencing.crs.CoordinateReferenceSystem; > > > > public class Test { > > > > public static void main(String[] args) { > > Test test = new Test(); > > test.run(); > > } > > > > public void run() { > > try { > > CoordinateReferenceSystem crs = > > CRS.decode("EPSG:4326"); > > if (CRS.getProjectedCRS(crs).equals(null)) { > > No wonder it NPEs, one cannot do null.equals(null) in Java. > The test should have been if(CRS.getProjectedCRS(crs) == null) ... > > Cheers > Andrea -- [email protected] | intevation.de/ | 0541335083214 | PGPkey: 0x64B67DF4 Intevation GmbH, Neuer Graben 17, 49074 Osnabrueck - AG Osnabrueck, HR B 18998 Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ GeoTools-GT2-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
