INT-2821 Find Existing Mails if No RECENT Support

Previously, if an IMAP server supports IDLE, but not
RECENT, no existing messages were retrieved until a new
message arrived.

INT-2821 Polishing - Fix Race Condition

Use searchForMessages() when server doesn't support RECENT.

Simply skipping the first idle() doesn't work
because receive() closes the folder, there was a race condition
where a new message could arrive between the previous receive()
and folder.open() in waitForMessages().

Updated mock test so that first call to waitForMessages() finds
messages and does not idle(), and subsequent calls does not
find messages and goes to idle().

Also tested in the debugger against gmail which (at the time of
writing) does not support RECENT.
INT-2832/2833 Aggregator Fix and Documentation

Expire empty groups.

Due to indentation changes, the code changes look more extensive
than they are. In effect the if (group.size() > 0) test is moved
to a narrower scope and the remove(group) is now performed if the
group is empty.

Document expire-groups-upon-completion.

INT-2832 Doc Polishing

PR Review + punctuation.

INT-2833 Add Delay For Expiring Empty Groups

minimumTimeoutForEmptyGroups
INT-2878: MessageGroupStoreReaper's Lifecycle Fix

`MessageGroupStoreReaper` continues to expire `MessageGroups` via `scheduled-task`
when not `running`.

* Add check `isRunning()` to `run()` & `destroy()`
* Additional `MessageGroupStoreReaper` polishing
* Add test-case

JIRA: https://jira.springsource.org/browse/INT-2878

INT-2878: Polishing : PR Comments
INT-2885 Remove DOS Newlines

MessageGroupStoreReaper
INT-2889 Fix Concurrency Problem in Type Converter

In the BeanFactoryTypeConverter, when falling
back to a PropertyEditor (when the source is non-
String and the target is String), the setValue() and getAsText()
methods are used.

This is not thread-safe and one thread might get another's
converted value.

Synchronize the use of the PropertyEditor.

Add test, that reliably reproduces the problem, to verify the
fix.
INT-2861/INT-2862 TCP Outbound Gateway Fixes

INT-2861

Close connection after 'remoteTimeout' because the
socket is dirty (may contain an in-flight reply).

Add test that demonstrates the problem and that it
is resolved.

INT-2862

Remove entries from pendingReplies (map of async responses
for which we are waiting).

Add an assertion to the above test to ensure cleanup.
[artifactory-release] Release version 2.1.5.RELEASE
[artifactory-release] Next development version
INT-2959 Correct Schema GW reply-timeout Doc.

Incorrectly indicated that an exception is thrown when
the gateway times out.
Merge pull request #770 from garyrussell/INT-2959-21x

* garyrussell-INT-2959-21x:
  INT-2959 Correct Schema GW reply-timeout Doc.
INT-2922 Fix TypeConverter Concurrency Issue

During initialization, it is possible for type conversion to fail because a second thread accesses a partially built list of PropertyEditors. This is because getDefaultEditor(Class) is not thread-safe.

* Add a test with mocks and spies to verify concurrent access to the method occurs before the fix, and not after the fix.
* Synchronize the call to getDefaultEditor(), when called from canConvert() and convertValue().
* Only synchronize the call until we have invoked the method at least once.
INT-2955 Fix Collection/Map Conversion

The fix for INT-2650 (to avoid unnecessary array copying) was
too general in that it also prevented types in collections and
maps from being converted.

Add tests to illustrate that such payloads are not converted.

Change code to only short circuit the conversion process if
the payload is a primitive array.

An existing test ensures that arrays are not copied.

Add more tests to complete coverage - discovered another
bug - the early exit after using a property editor to convert
to a String was never taken - it was testing against the
Class of the TypeConverter instead of the Type. If the
target type is a String, we don't need to perform
conversion after the property editor has done its
conversion.

Fix MessageHistory test (was testing MessageHeaders).
INT-2955 Remove Tests with SF 3.1 Dependencies
INT-2969 Update Bundlor Ranges for 2.1.6
Update Spring Social Twitter version to 1.0.4

(Refactor) Use SearchParameters for searching Twitter

bundlor updates
Upgrade Spring Social Twitter to 1.0.5