google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

NullPointerException when invoking put() method with a null object #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Not sure if it is a design decision to throw the NPE, but would vote for just 
ignoring null objects, or 
throwing a proper dedicated exception. The stacktrace shows the spot:

java.lang.NullPointerException
    at com.googlecode.objectify.ObjectifyFactory.getMetadataForEntity(ObjectifyFactory.java:219)
    at com.googlecode.objectify.impl.ObjectifyImpl.put(ObjectifyImpl.java:183)
    at de.fasthome.gae.ods.AdManager.putRealEstateAd(AdManager.java:80)
    at de.fasthome.server.UploadManager.doPost(UploadManager.java:261)

Original issue reported on code.google.com by drasko.kokic on 27 May 2010 at 4:44

GoogleCodeExporter commented 9 years ago
It's pretty standard practice in the Java SDK for methods to throw NPE when you 
pass them a null they aren't expecting.  What would you rather see as an 
exception?

Original comment by lhori...@gmail.com on 18 Mar 2011 at 5:35