Fixed build on JDK6, fixed test failures due to JDK-2181173, localization

I  included 3 commits:
- Fixed build on JDK6 of branch jdk7
- Fixed bug caused by JDK-2181173 which changed handling of modality.
- Fixed error in test due to localization on JDK 1.6

I have tested them on JDK 1.6.0.38 and JDK 1.7.0.9 on Windows 7. All test passes. Artifacts are being created correctly, and my project is working again (it runs on JDK6).