PIVOT-949: merge from trunk for first part of the fix (add the fallback, but without Java 7 specific features here)