diff options
author | Raymond Auge | 2019-03-05 04:16:14 +0000 |
---|---|---|
committer | Raymond Auge | 2019-03-05 21:50:21 +0000 |
commit | fd5a393c8790001cf03e3101d4531128d80f81ff (patch) | |
tree | 096550b2afe1c8a9b15338d7b96bedd44312e377 | |
parent | 38c9335ff0dfa501ec99b3ff7d2bf4bc3e67fc52 (diff) | |
download | rt.equinox.bundles-fd5a393c8790001cf03e3101d4531128d80f81ff.tar.gz rt.equinox.bundles-fd5a393c8790001cf03e3101d4531128d80f81ff.tar.xz rt.equinox.bundles-fd5a393c8790001cf03e3101d4531128d80f81ff.zip |
Bug 545084 - [http whiteboard] osgi.http.whiteboard.listener property not being handle properly
Signed-off-by: Raymond Auge <raymond.auge@liferay.com>
-rw-r--r-- | bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java index 10ddadb9b..ecc40fd5f 100644 --- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java +++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/customizer/ContextListenerTrackerCustomizer.java @@ -65,18 +65,19 @@ public class ContextListenerTrackerCustomizer httpServiceRuntime.removeFailedListenerDTO(serviceReference); - String listener = (String)serviceReference.getProperty(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER); + Object listenerObj = serviceReference.getProperty(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER); - if (Boolean.FALSE.toString().equalsIgnoreCase(listener)) { - return result; - } - - if (!Boolean.TRUE.toString().equalsIgnoreCase(listener)) { + if (!(listenerObj instanceof Boolean) && !(listenerObj instanceof String)) { throw new HttpWhiteboardFailureException( - HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER + "=" + listener + " is not a valid option. Ignoring!", //$NON-NLS-1$ //$NON-NLS-2$ + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER + "=" + listenerObj + " is not a valid option. Ignoring!", //$NON-NLS-1$ //$NON-NLS-2$ DTOConstants.FAILURE_REASON_VALIDATION_FAILED); } + if (Boolean.FALSE.equals(listenerObj) || !Boolean.valueOf(String.valueOf(listenerObj)).booleanValue()) { + // Asks to be ignored. + return result; + } + result.set(contextController.addListenerRegistration(serviceReference)); } catch (HttpWhiteboardFailureException hwfe) { |