Move annotations into shared package.

Change-Id: I4f798dd811f09a4433f1d21ea75d4ff9a70002e3
diff --git a/dev/core/src/com/google/gwt/dev/javac/testing/impl/JavaResourceBase.java b/dev/core/src/com/google/gwt/dev/javac/testing/impl/JavaResourceBase.java
index db87a1d..251d5b7 100644
--- a/dev/core/src/com/google/gwt/dev/javac/testing/impl/JavaResourceBase.java
+++ b/dev/core/src/com/google/gwt/dev/javac/testing/impl/JavaResourceBase.java
@@ -303,7 +303,7 @@
       createMockJavaResource("java.lang.String",
           "package java.lang;",
           "import java.io.Serializable;",
-          "import com.google.gwt.core.client.impl.SpecializeMethod;",
+          "import javaemul.internal.annotations.SpecializeMethod;",
           "public final class String implements Comparable<String>, CharSequence, Serializable {",
           "  public String() { }",
           "  public String(char c) { }",
@@ -365,8 +365,8 @@
           "}");
 
   public static final MockJavaResource SPECIALIZE_METHOD =
-      createMockJavaResource("com.google.gwt.core.client.impl.SpecializeMethod",
-          "package com.google.gwt.core.client.impl;",
+      createMockJavaResource("javaemul.internal.annotations.SpecializeMethod",
+          "package javaemul.internal.annotations;",
           "public @interface SpecializeMethod {\n",
           "  Class<?>[] params();\n" +
           "  String target();\n",
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java b/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
index acb56b8..351f423 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
@@ -15,9 +15,6 @@
  */
 package com.google.gwt.dev.jjs.impl;
 
-import com.google.gwt.core.client.impl.DoNotInline;
-import com.google.gwt.core.client.impl.HasNoSideEffects;
-import com.google.gwt.core.client.impl.SpecializeMethod;
 import com.google.gwt.dev.CompilerContext;
 import com.google.gwt.dev.javac.JSORestrictionsChecker;
 import com.google.gwt.dev.javac.JdtUtil;
@@ -4089,21 +4086,21 @@
 
   private void maybeSetDoNotInline(AbstractMethodDeclaration x,
       JMethod method) {
-    if (JdtUtil.getAnnotation(x.binding, DoNotInline.class.getName()) != null) {
+    if (JdtUtil.getAnnotation(x.binding, "javaemul.internal.annotations.DoNotInline") != null) {
       method.setInliningAllowed(false);
     }
   }
 
   private void maybeSetHasNoSideEffects(AbstractMethodDeclaration x,
       JMethod method) {
-    if (JdtUtil.getAnnotation(x.binding, HasNoSideEffects.class.getName()) != null) {
+    if (JdtUtil.getAnnotation(x.binding, "javaemul.internal.annotations.HasNoSideEffects") != null) {
       method.setHasSideEffects(false);
     }
   }
 
   private void maybeAddMethodSpecialization(AbstractMethodDeclaration x, JMethod method) {
     AnnotationBinding specializeAnnotation =
-        JdtUtil.getAnnotation(x.binding, SpecializeMethod.class.getName());
+        JdtUtil.getAnnotation(x.binding, "javaemul.internal.annotations.SpecializeMethod");
     if (specializeAnnotation == null) {
       return;
     }
diff --git a/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Array.java b/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Array.java
index 5e4aacc..af68e85 100644
--- a/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Array.java
+++ b/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Array.java
@@ -18,8 +18,9 @@
 import static java.internal.InternalPreconditions.checkArrayType;
 
 import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.core.client.impl.DoNotInline;
-import com.google.gwt.core.client.impl.HasNoSideEffects;
+
+import javaemul.internal.annotations.DoNotInline;
+import javaemul.internal.annotations.HasNoSideEffects;
 
 /**
  * This is an intrinsic class that contains the implementation details for Java arrays. <p>
diff --git a/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Cast.java b/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Cast.java
index 233e50b..e0d939a 100644
--- a/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Cast.java
+++ b/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Cast.java
@@ -18,7 +18,8 @@
 import static java.internal.InternalPreconditions.checkType;
 
 import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.core.client.impl.HasNoSideEffects;
+
+import javaemul.internal.annotations.HasNoSideEffects;
 
 // CHECKSTYLE_NAMING_OFF: Uses legacy conventions of underscore prefixes.
 
diff --git a/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Exceptions.java b/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Exceptions.java
index fa7ebfb..cac61a5 100644
--- a/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Exceptions.java
+++ b/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Exceptions.java
@@ -16,9 +16,10 @@
 package com.google.gwt.lang;
 
 import com.google.gwt.core.client.JavaScriptException;
-import com.google.gwt.core.client.impl.DoNotInline;
 import com.google.gwt.core.client.impl.StackTraceCreator;
 
+import javaemul.internal.annotations.DoNotInline;
+
 /**
  * This is a magic class the compiler uses to throw and check exceptions.
  */
diff --git a/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Util.java b/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Util.java
index 19ada22..1e9640b 100644
--- a/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Util.java
+++ b/dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Util.java
@@ -16,7 +16,8 @@
 package com.google.gwt.lang;
 
 import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.core.client.impl.DoNotInline;
+
+import javaemul.internal.annotations.DoNotInline;
 
 /**
  * This class is used to access the private, GWT-specific
diff --git a/dev/core/super/javaemul/internal/Internal.gwt.xml b/dev/core/super/javaemul/internal/Internal.gwt.xml
new file mode 100644
index 0000000..5365991
--- /dev/null
+++ b/dev/core/super/javaemul/internal/Internal.gwt.xml
@@ -0,0 +1,22 @@
+<!--                                                                        -->
+<!-- Copyright 2015 Google Inc.                                             -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
+<!-- may not use this file except in compliance with the License. You may   -->
+<!-- may obtain a copy of the License at                                    -->
+<!--                                                                        -->
+<!-- http://www.apache.org/licenses/LICENSE-2.0                             -->
+<!--                                                                        -->
+<!-- Unless required by applicable law or agreed to in writing, software    -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS,      -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        -->
+<!-- implied. License for the specific language governing permissions and   -->
+<!-- limitations under the License.                                         -->
+
+<!-- Internal JRE emultation helpers.                                       -->
+<!-- Do not inherit this module directly; inherit com.google.gwt.core.Core. -->
+<!--                                                                        -->
+<!-- Types from this module should never be used in any user code           -->
+<!--                                                                        -->
+<module>
+  <source path=""/>
+</module>
diff --git a/dev/core/super/com/google/gwt/core/client/impl/CompilerHint.java b/dev/core/super/javaemul/internal/annotations/CompilerHint.java
similarity index 94%
rename from dev/core/super/com/google/gwt/core/client/impl/CompilerHint.java
rename to dev/core/super/javaemul/internal/annotations/CompilerHint.java
index 23a351a..b887a6e 100644
--- a/dev/core/super/com/google/gwt/core/client/impl/CompilerHint.java
+++ b/dev/core/super/javaemul/internal/annotations/CompilerHint.java
@@ -13,7 +13,7 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.google.gwt.core.client.impl;
+package javaemul.internal.annotations;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Target;
diff --git a/dev/core/super/com/google/gwt/core/client/impl/DoNotInline.java b/dev/core/super/javaemul/internal/annotations/DoNotInline.java
similarity index 95%
rename from dev/core/super/com/google/gwt/core/client/impl/DoNotInline.java
rename to dev/core/super/javaemul/internal/annotations/DoNotInline.java
index 7c64aad..4e7321d 100644
--- a/dev/core/super/com/google/gwt/core/client/impl/DoNotInline.java
+++ b/dev/core/super/javaemul/internal/annotations/DoNotInline.java
@@ -13,7 +13,7 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.google.gwt.core.client.impl;
+package javaemul.internal.annotations;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Target;
diff --git a/dev/core/super/com/google/gwt/core/client/impl/HasNoSideEffects.java b/dev/core/super/javaemul/internal/annotations/HasNoSideEffects.java
similarity index 95%
rename from dev/core/super/com/google/gwt/core/client/impl/HasNoSideEffects.java
rename to dev/core/super/javaemul/internal/annotations/HasNoSideEffects.java
index faffa0d..f21fcff 100644
--- a/dev/core/super/com/google/gwt/core/client/impl/HasNoSideEffects.java
+++ b/dev/core/super/javaemul/internal/annotations/HasNoSideEffects.java
@@ -13,7 +13,7 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.google.gwt.core.client.impl;
+package javaemul.internal.annotations;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Target;
diff --git a/dev/core/super/com/google/gwt/core/client/impl/SpecializeMethod.java b/dev/core/super/javaemul/internal/annotations/SpecializeMethod.java
similarity index 96%
rename from dev/core/super/com/google/gwt/core/client/impl/SpecializeMethod.java
rename to dev/core/super/javaemul/internal/annotations/SpecializeMethod.java
index d043ef2..ddab6cd 100644
--- a/dev/core/super/com/google/gwt/core/client/impl/SpecializeMethod.java
+++ b/dev/core/super/javaemul/internal/annotations/SpecializeMethod.java
@@ -13,7 +13,7 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package com.google.gwt.core.client.impl;
+package javaemul.internal.annotations;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Target;
diff --git a/dev/core/test/com/google/gwt/dev/jjs/impl/UnifyAstTest.java b/dev/core/test/com/google/gwt/dev/jjs/impl/UnifyAstTest.java
index 9042d39..305e3f1 100644
--- a/dev/core/test/com/google/gwt/dev/jjs/impl/UnifyAstTest.java
+++ b/dev/core/test/com/google/gwt/dev/jjs/impl/UnifyAstTest.java
@@ -447,7 +447,7 @@
     final MockJavaResource SpecializedImpl =
         JavaResourceBase.createMockJavaResource("test.SpecializedImpl",
             "package test;",
-            "import com.google.gwt.core.client.impl.SpecializeMethod;",
+            "import javaemul.internal.annotations.SpecializeMethod;",
             "public class SpecializedImpl<K> extends Impl<K> implements I {",
             "  @SpecializeMethod(params = {String.class}, target = \"putString\")",
             "  public void put(K k) { }",
diff --git a/user/super/com/google/gwt/emul/Emulation.gwt.xml b/user/super/com/google/gwt/emul/Emulation.gwt.xml
index 0c6f899..41b5213 100644
--- a/user/super/com/google/gwt/emul/Emulation.gwt.xml
+++ b/user/super/com/google/gwt/emul/Emulation.gwt.xml
@@ -15,6 +15,7 @@
 <!-- A JavaScript-based emulation of the Java Runtime library.              -->
 <!-- Do not inherit this module directly; inherit com.google.gwt.core.Core. -->
 <module>
+  <inherits name="javaemul.internal.Internal"/>
   <inherits name="com.google.gwt.logging.LogImpl"/>
   <public path="public" />
 
diff --git a/user/super/com/google/gwt/emul/java/lang/Class.java b/user/super/com/google/gwt/emul/java/lang/Class.java
index 9026e99..701af68 100644
--- a/user/super/com/google/gwt/emul/java/lang/Class.java
+++ b/user/super/com/google/gwt/emul/java/lang/Class.java
@@ -16,10 +16,11 @@
 package java.lang;
 
 import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.core.client.impl.DoNotInline;
 
 import java.lang.reflect.Type;
 
+import javaemul.internal.annotations.DoNotInline;
+
 /**
  * Generally unsupported. This class is provided so that the GWT compiler can
  * choke down class literal references.
diff --git a/user/super/com/google/gwt/emul/java/lang/String.java b/user/super/com/google/gwt/emul/java/lang/String.java
index 77d3d2e..b1c66ec 100644
--- a/user/super/com/google/gwt/emul/java/lang/String.java
+++ b/user/super/com/google/gwt/emul/java/lang/String.java
@@ -16,14 +16,13 @@
 
 package java.lang;
 
-import com.google.gwt.core.client.impl.DoNotInline;
-
 import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
 import java.util.Comparator;
 import java.util.Locale;
 
 import javaemul.internal.HashCodes;
+import javaemul.internal.annotations.DoNotInline;
 
 /**
  * Intrinsic string class.
diff --git a/user/super/com/google/gwt/emul/java/util/AbstractHashMap.java b/user/super/com/google/gwt/emul/java/util/AbstractHashMap.java
index 6d45ead..6f4ba42 100644
--- a/user/super/com/google/gwt/emul/java/util/AbstractHashMap.java
+++ b/user/super/com/google/gwt/emul/java/util/AbstractHashMap.java
@@ -1,12 +1,12 @@
 /*
  * Copyright 2008 Google Inc.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -23,13 +23,14 @@
 import static java.util.ConcurrentModificationDetector.structureChanged;
 
 import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.client.impl.SpecializeMethod;
+
+import javaemul.internal.annotations.SpecializeMethod;
 
 /**
  * Implementation of Map interface based on a hash table. <a
  * href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/HashMap.html">[Sun
  * docs]</a>
- * 
+ *
  * @param <K> key type
  * @param <V> value type
  */
diff --git a/user/super/com/google/gwt/emul/java/util/EnumSet.java b/user/super/com/google/gwt/emul/java/util/EnumSet.java
index 3efa777..95abde9 100644
--- a/user/super/com/google/gwt/emul/java/util/EnumSet.java
+++ b/user/super/com/google/gwt/emul/java/util/EnumSet.java
@@ -20,10 +20,10 @@
 import static java.internal.InternalPreconditions.checkNotNull;
 import static java.internal.InternalPreconditions.checkState;
 
-import com.google.gwt.core.client.impl.SpecializeMethod;
-
 import java.internal.ArrayHelper;
 
+import javaemul.internal.annotations.SpecializeMethod;
+
 /**
  * A {@link java.util.Set} of {@link Enum}s. <a
  * href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/EnumSet.html">[Sun
diff --git a/user/test/com/google/gwt/dev/jjs/test/CompilerMiscRegressionTest.java b/user/test/com/google/gwt/dev/jjs/test/CompilerMiscRegressionTest.java
index 28f0435..a21dbc3 100644
--- a/user/test/com/google/gwt/dev/jjs/test/CompilerMiscRegressionTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/CompilerMiscRegressionTest.java
@@ -15,7 +15,6 @@
  */
 package com.google.gwt.dev.jjs.test;
 
-import com.google.gwt.core.client.impl.DoNotInline;
 import com.google.gwt.core.client.js.JsType;
 import com.google.gwt.dev.jjs.test.overrides.package1.Caller;
 import com.google.gwt.dev.jjs.test.overrides.package1.ClassExposingM;
@@ -36,6 +35,8 @@
 import java.util.List;
 import java.util.Map;
 
+import javaemul.internal.annotations.DoNotInline;
+
 /**
  * Tests Miscelaneous fixes.
  */
diff --git a/user/test/com/google/gwt/dev/jjs/test/HasNoSideEffecstTest.java b/user/test/com/google/gwt/dev/jjs/test/HasNoSideEffecstTest.java
index 8431b70..fb02fd6 100644
--- a/user/test/com/google/gwt/dev/jjs/test/HasNoSideEffecstTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/HasNoSideEffecstTest.java
@@ -15,12 +15,13 @@
  */
 package com.google.gwt.dev.jjs.test;
 
-import com.google.gwt.core.client.impl.DoNotInline;
-import com.google.gwt.core.client.impl.HasNoSideEffects;
 import com.google.gwt.junit.DoNotRunWith;
 import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 
+import javaemul.internal.annotations.DoNotInline;
+import javaemul.internal.annotations.HasNoSideEffects;
+
 /**
  * Tests for {@link HasNoSideEffects}.
  */
diff --git a/user/test/com/google/gwt/dev/jjs/test/SpecializationTest.java b/user/test/com/google/gwt/dev/jjs/test/SpecializationTest.java
index 8d0ac31..7237a97 100644
--- a/user/test/com/google/gwt/dev/jjs/test/SpecializationTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/SpecializationTest.java
@@ -15,11 +15,12 @@
  */
 package com.google.gwt.dev.jjs.test;
 
-import com.google.gwt.core.client.impl.SpecializeMethod;
 import com.google.gwt.junit.DoNotRunWith;
 import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 
+import javaemul.internal.annotations.SpecializeMethod;
+
 /**
  * Tests for {@link SpecializeMethod}.
  */
diff --git a/user/test/com/google/gwt/junit/client/GWTTestCaseStackTraceTest.java b/user/test/com/google/gwt/junit/client/GWTTestCaseStackTraceTest.java
index dab2fc1..94bbb00 100644
--- a/user/test/com/google/gwt/junit/client/GWTTestCaseStackTraceTest.java
+++ b/user/test/com/google/gwt/junit/client/GWTTestCaseStackTraceTest.java
@@ -16,7 +16,6 @@
 
 package com.google.gwt.junit.client;
 
-import com.google.gwt.core.client.impl.DoNotInline;
 import com.google.gwt.core.client.impl.Impl;
 import com.google.gwt.core.shared.GWT;
 import com.google.gwt.core.shared.SerializableThrowable;
@@ -24,12 +23,14 @@
 
 import junit.framework.AssertionFailedError;
 
+import javaemul.internal.annotations.DoNotInline;
+
 /**
  * This class tests stack traces generated by GWTTestCase.
  */
 public class GWTTestCaseStackTraceTest extends GWTTestCaseTestBase {
 
-  private static final int LINE_NUMBER_1 = 41;
+  private static final int LINE_NUMBER_1 = 42;
   private static final int LINE_NUMBER_2 = LINE_NUMBER_1 + 2;
 
   private static final String FILE_NAME = "GWTTestCaseStackTraceTest.java";
@@ -90,7 +91,7 @@
   /** Asserts stack trace generated by {@link #testStackTrace} */
   public static class StackTraceAsserter implements ExceptionAsserter {
     public void assertException(ExpectedFailure annotation, Throwable actual) {
-      final int lineNumber = 100;
+      final int lineNumber = 101;
       assertStackTrace(actual, "testStackTrace", lineNumber, false);
     }
   }
@@ -103,7 +104,7 @@
   /** Asserts stack trace generated by {@link #testStackTrace_withCause} */
   public static class StackTraceAsserterWithCause implements ExceptionAsserter {
     public void assertException(ExpectedFailure annotation, Throwable actual) {
-      final int lineNumber = 113;
+      final int lineNumber = 114;
       assertStackTrace(actual, "testStackTrace_withCause", lineNumber, true);
     }
   }
@@ -116,7 +117,7 @@
   /** Asserts stack trace generated by {@link #testStackTrace_fromDifferentModule} */
   public static class StackTraceAsserterFromDifferentModule implements ExceptionAsserter {
     public void assertException(ExpectedFailure annotation, Throwable actual) {
-      final int lineNumber = 128;
+      final int lineNumber = 129;
       assertStackTrace(actual, "testStackTrace_fromDifferentModule", lineNumber, false);
     }
   }