click here for details... Sakai Executive Director Position Search now open
Issue Details (XML | Word | Printable)

Key: KNL-254
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Stephen Marquard
Reporter: Stephen Marquard
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Kernel - K1

ToolComponent throws NPE if null tool id passed

Created: 19-Aug-2009 07:20   Updated: 05-Mar-2010 02:45
Component/s: Impl
Affects Version/s: 1.0.11
Fix Version/s: 1.0.12, 1.1.0

Time Tracking:
Not Specified

Issue Links:
Incorporate
 

1.0.x Status: Resolved


 Description  « Hide
getTool can throw an NPE if a null toolid is passed, as in this strack trace originating from SiteAction:

It would be better to just return null and let the calling code handle it, especially as null is a valid return value if the tool is not found.

Caused by: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:157)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:730)
at org.sakaiproject.tool.impl.ToolComponent.getTool(ToolComponent.java:267)
at org.sakaiproject.tool.cover.ToolManager.getTool(ToolManager.java:93)
at org.sakaiproject.site.tool.SiteAction.isMultipleInstancesAllowed(SiteAction.java:5804)
at org.sakaiproject.site.tool.SiteAction.saveFeatures(SiteAction.java:8395)
at org.sakaiproject.site.tool.SiteAction.doSave_revised_features(SiteAction.java:5895)
... 47 more


 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Stephen Marquard added a comment - 19-Aug-2009 07:33
r65934

Anthony Whyte added a comment - 08-Oct-2009 08:13
Merged to 1.0.x branch.