fix for issue #3047 on master branch
unit test for issue #3047 on master branch
Merge pull request #3377 from serkan-ozal/fix/master/issue-3047

Fixes 3047 on Master Bracnh - SortingUtil integer overflow during comparision