Bug 534523: SWTBot Drag and Drop broken in Oxygen

The DragSource listener is now identified by examining its class name.
It is an anonymous class in Neon, and a lambda class in Oxygen. Both
class names start by the DragSource class name.

Change-Id: I43e253edf842f907017b901625a38aa70fd4bd38
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/AbstractSWTBot.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/AbstractSWTBot.java
index fee1be1..f874124 100644
--- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/AbstractSWTBot.java
+++ b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/AbstractSWTBot.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008, 2017 Ketan Padegaonkar and others.
+ * Copyright (c) 2008, 2018 Ketan Padegaonkar and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -1157,9 +1157,9 @@
 		final Listener dragSourceListener = syncExec(new Result<Listener>() {
 			@Override
 			public Listener run() {
-				// The DragSource listener is an anonymous class of DragSource
+				// The DragSource listener is an anonymous or lambda class of DragSource
 				for (Listener listener : control.getListeners(SWT.DragDetect)) {
-					if (DragSource.class.equals(listener.getClass().getEnclosingClass())) {
+					if (listener.getClass().getName().startsWith(DragSource.class.getName())) {
 						return listener;
 					}
 				}