Fix SourceMapTest.
SourceMapTest was not being run and was broken.
Change-Id: Ib6a8c840323289a37d05cb08582b5b19db741716
diff --git a/dev/core/src/com/google/gwt/core/ext/soyc/coderef/ClassDescriptor.java b/dev/core/src/com/google/gwt/core/ext/soyc/coderef/ClassDescriptor.java
index c32c069..1ed8ca3 100644
--- a/dev/core/src/com/google/gwt/core/ext/soyc/coderef/ClassDescriptor.java
+++ b/dev/core/src/com/google/gwt/core/ext/soyc/coderef/ClassDescriptor.java
@@ -104,6 +104,7 @@
* Returns the method descriptor associated to the given original method signature.
*/
public MethodDescriptor getMethod(String methodSignature) {
+ methodSignature = MethodDescriptor.normalizeMethodSignature(methodSignature);
return methodsByJsniSignature.get(methodSignature);
}
@@ -124,6 +125,7 @@
* If the method descriptor is not in the current class descriptor, it will be added.
*/
public MethodDescriptor methodFrom(JMethod method, String signature) {
+ signature = MethodDescriptor.normalizeMethodSignature(signature);
MethodDescriptor methodDescriptor = this.methodsByJsniSignature.get(signature);
if (methodDescriptor == null) {
methodDescriptor = MethodDescriptor.from(this, method, signature);
diff --git a/dev/core/src/com/google/gwt/core/ext/soyc/coderef/MethodDescriptor.java b/dev/core/src/com/google/gwt/core/ext/soyc/coderef/MethodDescriptor.java
index 04ab930..8813342 100644
--- a/dev/core/src/com/google/gwt/core/ext/soyc/coderef/MethodDescriptor.java
+++ b/dev/core/src/com/google/gwt/core/ext/soyc/coderef/MethodDescriptor.java
@@ -49,7 +49,17 @@
super(owner, signatureComponents[0]);
this.paramTypes = signatureComponents[1];
// fix for wrong jsni signature for constructors in JMethod.getSignature()
- this.type = signatureComponents[2].equals(" <init>") ? "V" : signatureComponents[2];
+ this.type = normalizeMethodSignature(signatureComponents[2]);
+ }
+
+ private static final String CONSTRUCTOR_POSTFIX = " <init>";
+
+ public static String normalizeMethodSignature(String methodSignature) {
+ if (methodSignature.endsWith(CONSTRUCTOR_POSTFIX)) {
+ return methodSignature.substring(0,
+ methodSignature.length() - CONSTRUCTOR_POSTFIX.length()) + "V";
+ }
+ return methodSignature;
}
public MethodDescriptor(ClassDescriptor owner, String jsniSignature) {
diff --git a/user/test/com/google/gwt/core/ext/test/SourceMapTest.java b/dev/core/test/com/google/gwt/core/ext/linker/SourceMapTest.java
similarity index 98%
rename from user/test/com/google/gwt/core/ext/test/SourceMapTest.java
rename to dev/core/test/com/google/gwt/core/ext/linker/SourceMapTest.java
index efa624e..cc7c17e 100644
--- a/user/test/com/google/gwt/core/ext/test/SourceMapTest.java
+++ b/dev/core/test/com/google/gwt/core/ext/linker/SourceMapTest.java
@@ -13,11 +13,9 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.google.gwt.core.ext.test;
+package com.google.gwt.core.ext.linker;
import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.linker.CastableTypeMap;
-import com.google.gwt.core.ext.linker.SymbolData;
import com.google.gwt.core.ext.soyc.SourceMapRecorderExt;
import com.google.gwt.core.ext.soyc.coderef.ClassDescriptor;
import com.google.gwt.core.ext.soyc.coderef.EntityDescriptor;