AliasService should handle nulls better

Description

Currently the AliasService doesn't cope with null arguments very well on calls to getTarget() and getAliases(). Adding null checks means we don't go looking in the cache/db for /alias/null if a tool ever calls these methods with null.

Activity

Show:

Neal Caidin August 14, 2017 at 2:01 PM

Bulk closing issues that have not been updated since 2014 and earlier. Please reopen if this is still an issue and you have new information.

Aaron Zeckoski April 23, 2014 at 6:36 AM

That makes sense but throwing that might start really breaking things. You should probably wait on this patch until the 10 release is out.

Matthew Buckett April 23, 2014 at 6:17 AM

Not suggesting we scan strings for null.

Yep, completely agree on all your points. Just suggesting BaseAliasService does something like:

if (alias == null) {
throw new IdUnusedException("null")
}

Aaron Zeckoski April 23, 2014 at 5:58 AM

On a side note, for SAK-26139, the call does not include any null values. It is a string "/alias/null". If you are suggesting the alias service should scan strings for the word null then I think we need a better plan than hoping that someone did not use the word null in their alias name.

I think the actual issue for that ticket is that the added code does not handle nulls well and that code is in the portal.

Won't Fix

Details

Priority

Affects versions

Components

Assignee

Reporter

Created April 23, 2014 at 5:16 AM
Updated April 25, 2018 at 3:34 PM
Resolved August 14, 2017 at 2:01 PM