Bug 1287946 - Move Java bindings to mozilla::java namespace; r=snorp
authorJim Chen <nchen@mozilla.com>
Thu, 21 Jul 2016 13:49:04 -0400
changeset 306210 438384ed5ecffad4d6bc6280e0346b3673f8118f
parent 306209 842f08286adfe26fe60d5f87a3ff0eb0a349d37d
child 306211 a4baceb961e6c6dda640d93ab99ab167e363dbc7
push id30480
push usercbook@mozilla.com
push dateFri, 22 Jul 2016 09:58:20 +0000
treeherdermozilla-central@e0bc88708ffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1287946
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1287946 - Move Java bindings to mozilla::java namespace; r=snorp Currently, auto-generated Java bindings are in the mozilla::widget namespace, and that potentially conflicts with code under widget/android. Moving the bindings to mozilla::java avoids conflicts and makes it more clear that we're using Java bindings.
build/annotationProcessors/AnnotationProcessor.java
build/annotationProcessors/SDKProcessor.java
--- a/build/annotationProcessors/AnnotationProcessor.java
+++ b/build/annotationProcessors/AnnotationProcessor.java
@@ -52,36 +52,36 @@ public class AnnotationProcessor {
 
         headerFile.append(
                 "#ifndef " + getHeaderGuardName(HEADER_FILE) + "\n" +
                 "#define " + getHeaderGuardName(HEADER_FILE) + "\n" +
                 "\n" +
                 "#include \"mozilla/jni/Refs.h\"\n" +
                 "\n" +
                 "namespace mozilla {\n" +
-                "namespace widget {\n" +
+                "namespace java {\n" +
                 "\n");
 
         implementationFile.append(
                 "#include \"GeneratedJNIWrappers.h\"\n" +
                 "#include \"mozilla/jni/Accessors.h\"\n" +
                 "\n" +
                 "namespace mozilla {\n" +
-                "namespace widget {\n" +
+                "namespace java {\n" +
                 "\n");
 
         nativesFile.append(
                 "#ifndef " + getHeaderGuardName(NATIVES_FILE) + "\n" +
                 "#define " + getHeaderGuardName(NATIVES_FILE) + "\n" +
                 "\n" +
                 "#include \"GeneratedJNIWrappers.h\"\n" +
                 "#include \"mozilla/jni/Natives.h\"\n" +
                 "\n" +
                 "namespace mozilla {\n" +
-                "namespace widget {\n" +
+                "namespace java {\n" +
                 "\n");
 
         while (jarClassIterator.hasNext()) {
             generateClass(jarClassIterator.next());
         }
 
         implementationFile.append(
                 "} /* widget */\n" +
--- a/build/annotationProcessors/SDKProcessor.java
+++ b/build/annotationProcessors/SDKProcessor.java
@@ -72,27 +72,27 @@ public class SDKProcessor {
         StringBuilder headerFile = new StringBuilder(GENERATED_COMMENT);
         headerFile.append(
                 "#ifndef " + generatedFilePrefix + "_h__\n" +
                 "#define " + generatedFilePrefix + "_h__\n" +
                 "\n" +
                 "#include \"mozilla/jni/Refs.h\"\n" +
                 "\n" +
                 "namespace mozilla {\n" +
-                "namespace widget {\n" +
+                "namespace java {\n" +
                 "namespace sdk {\n" +
                 "\n");
 
         StringBuilder implementationFile = new StringBuilder(GENERATED_COMMENT);
         implementationFile.append(
                 "#include \"" + generatedFilePrefix + ".h\"\n" +
                 "#include \"mozilla/jni/Accessors.h\"\n" +
                 "\n" +
                 "namespace mozilla {\n" +
-                "namespace widget {\n" +
+                "namespace java {\n" +
                 "namespace sdk {\n" +
                 "\n");
 
         // Used to track the calls to the various class-specific initialisation functions.
         ClassLoader loader = null;
         try {
             loader = URLClassLoader.newInstance(new URL[] { new URL("file://" + sdkJar) },
                                                 SDKProcessor.class.getClassLoader());