H i Luong, Are you trapping the null pointer exception because you've been getting one ? And if so, where ?
E.g. if your data store is not being created properly then the code in your example will catch the exception when you try to use the null myDataStore reference. Obviously, in that case you won't have any feature type names. Michael 2008/11/18 fx5900 <[EMAIL PROTECTED]>: > > Hi, > > in the 09shaplab tutorial code line String typeName = > shapefile.getTypeNames()[0]; throws an exception so i created my own try > catch statment using > > try { > // Create an array of string to store the feature types > String[] myFeatureTypeNames = myDataStore.getTypeNames(); > String myFeatureTypeName = myFeatureTypeNames[0]; > > } catch(NullPointerException exc) { > > System.out.println("this may print"); > > } > > but what i would like to know is, in the body code, would it still store the > myFeatureTypeNames in my > myFeatureTypeName variable? If not, is there a simple work around to this?? > > cheers > -- > View this message in context: > http://www.nabble.com/Try-Catch-tp20549037p20549037.html > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Geotools-gt2-users mailing list > Geotools-gt2-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users