Make the Java generator use non-hardcoded namespaces.

- Make the Java generator use program->get_namespace("java")
  instead of program->get_java_namespace()
- Eliminate the explicit "java_namespace" in t_program.
- Deprecate the java_namespace token.
- Update example .thrift files and syntax files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665514 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index bb68358..9aa56bd 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -312,11 +312,13 @@
         g_program->set_smalltalk_prefix($2);
       }
     }
+/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
 | tok_java_package tok_identifier
     {
+      pwarning(1, "'cpp_namespace' is deprecated. Use 'namespace cpp' instead");
       pdebug("Header -> tok_java_package tok_identifier");
       if (g_parse_mode == PROGRAM) {
-        g_program->set_java_package($2);
+        g_program->set_namespace("java", $2);
       }
     }
 | tok_cocoa_prefix tok_identifier