Java: C++11 strong enum and various fixes

Take into account strongly-typed values scope name
Your test case might trigger this code, but it has no effect in the subsequent code where the new symname variable is passed on. So either provide a testcase that requires this or it should be removed from the patch.