minor Deque tidy-up (rebased from dev_5_0)

Minor Java code tidy-up, should be no change in behavior.
--rebased-from #2710