DESCRIPTION

Bug 499745: Guard against bad return values in connection framework.

The connection settings framework expects a null return value when no
connection settings could be provided. However it is possible to return
a list of values with some potentially being null. We should ensure our
providers don't do this and guard against this happening from extensions
we don't control.

Change-Id: Ib9473f8af075b1a811ed9a48b1bb63337b29ac21


COMMENTS

author: Nathanael Holden
date: 2016-08-16 15:43:44.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2016-08-16 15:43:50.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11061/

-------------------------------------
author: Zechariah Krause
date: 2016-08-16 15:49:24.000000000

Patch Set 2:

(3 comments)

3 minor comments, but otherwise the PR looks good.

Line:35, containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DefaultTCPConnectionSettingsProvider.java -> Minor comment here: you don't need to instanciate a new array as the argument for Arrays.asList().

Line:59, containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ShellConnectionSettingsProvider.java -> Minor comment here: you don't need to instanciate a new array as the argument for Arrays.asList().

Line:266, containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DefaultDockerConnectionSettingsFinder.java -> I'm not sure we need to check that the list is non empty. I assume that if the list is empty, the 'addAll' method will return immediately.

-------------------------------------
author: Brenden Conley
date: 2016-08-16 15:56:21.000000000

Patch Set 2: Verified-1

Build Failed 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11061/ : ABORTED

-------------------------------------
author: Nathanael Holden
date: 2016-08-16 16:03:13.000000000

Patch Set 2:

You're right about the isEmpty being a bit overkill given that the addAll would take care of it but it does save having to do the full check + copy. ArrayList#addAll doesn't seem to do any quick check if the argument is empty.

-------------------------------------
author: Gerrit Code Review
date: 2016-08-16 16:48:53.000000000

Change has been successfully cherry-picked as c61be318c2dbbfe6165edf350ed299b80974fb9d by Zechariah Krause

-------------------------------------
