DESCRIPTION

Bug 501240 - Do not hide image with <none>:<none> as a result of a build

Extracted the way qualifier is computed, based on images
Set the 'dangling images' filter activation state to 'false' by default
 to get the same result as the CLI
Added tests to verify the qualifier computation

Also:
- renamed custom Assertions with plural form (as AssrtJ does)
- fixed failing tests because mocking the IDockerConnection#getState()
method returns unexpected values in some cases.

Change-Id: I21c4eb03523dd88e18ca23b8a3f30d18f0497efa
Signed-off-by: Zechariah Krause xxx@xxx.xxx


COMMENTS

author: Zechariah Krause
date: 2016-09-28 08:25:27.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2016-09-28 08:25:34.000000000

Patch Set 3:

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

-------------------------------------
author: Zechariah Krause
date: 2016-09-28 08:27:29.000000000

Patch Set 3:

Thanks for the feedback, Arianna Johns. I renamed the local variable to avoid confusion and restored the synchronized() {} block in the listImages() method. I applied the same technique in the listContainers() method, at the same time.

-------------------------------------
author: Brenden Conley
date: 2016-09-28 08:48:03.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11242/ : SUCCESS

-------------------------------------
author: Kaylin Maxwell
date: 2016-09-28 21:48:08.000000000

Patch Set 3:

(4 comments)

Line:149, containers/org.eclipse.linuxtools.docker.ui/plugin.xml -> Why did you do this?  I don't think most users would want to see dangling images by default.  Have you had a request from multiple users?

Line:744, containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java -> I think after reflecting that the routines listContainers and listImages need to return the temp array instead of the real array.  The problem is that the notification happens outside of the lock and it is possible that another thread could come in and alter the array while listeners are processing.  The listener does not use the lock and simply   This is avoided by using the temporary array which is allocated each time.   This bug was in our previous listContainers but was fine for listImages.  I can change this if there aren't other issues with the patch.

Line:1047, containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java -> See above comment with listContainers.

Line:96, containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java -> We can remove this if all references are changed since it is an internal constructor.

-------------------------------------
author: Kaylin Maxwell
date: 2016-09-28 21:48:19.000000000

Patch Set 3: Code-Review-1

-------------------------------------
author: Kaylin Maxwell
date: 2016-09-28 22:00:17.000000000

Patch Set 3:

(1 comment)

Line:744, containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java -> Actually, I may be wrong about this.  It may not matter.  The reference to the array by value is passed and this method changes where the array points to but not internal values.  So, all listeners will be safe either way since they are given a copy that references the array when passed and doesn't change when the caller resets the value.  You might however want to be consistent between the two methods.  I think passing the temp array makes it simpler to understand.

-------------------------------------
author: Kaylin Maxwell
date: 2016-10-03 01:28:37.000000000

Patch Set 4: Patch Set 3 was rebased

-------------------------------------
author: Gerrit Code Review
date: 2016-10-04 02:38:50.000000000

Change has been successfully cherry-picked as f7804b3a331df8f7aef861539a8d18293526b06e by Kaylin Maxwell

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