Skip to content

Commit 5a21381

Browse files
grendellojonpryor
authored andcommitted
[crc64] Change the hash prefix back to crc64 (#628)
Context: 9b88ce7 Context: 7fe3a11 7fe3a11 fixed the new CRC64 calculation algorithm so that it properly processes all the data, which had the (expected) effect of generating the same checksums for the same data as those generated before commit 9b88ce7. However, 7fe3a11 missed changing the new `c64r2` hash prefix back to `crc64`, thus this commit to make the change. The change will remove any backward incompatibility with code that may rely on the old hash format, including Xamarin.Android tests.
1 parent 933876c commit 5a21381

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

src/Java.Interop.Tools.TypeNameMappings/Java.Interop.Tools.TypeNameMappings/JavaNativeTypeManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class JniTypeName
4141
public
4242
#endif
4343
static class JavaNativeTypeManager {
44-
const string CRC_PREFIX = "c64r2";
44+
const string CRC_PREFIX = "crc64";
4545

4646
public static PackageNamingPolicy PackageNamingPolicy { get; set; } = PackageNamingPolicy.LowercaseCrc64;
4747

tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGeneratorTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void GenerateIndirectApplication (
124124
)
125125
{
126126
var actual = Generate (typeof (IndirectApplication), applicationJavaClass);
127-
var expected = @"package c64r2197ae30a36756915;
127+
var expected = @"package crc64197ae30a36756915;
128128
129129
130130
public class IndirectApplication
@@ -175,7 +175,7 @@ public void monodroidClearReferences ()
175175
public void GenerateExportedMembers ()
176176
{
177177
var actual = Generate (typeof (ExportsMembers));
178-
var expected = @"package c64r2197ae30a36756915;
178+
var expected = @"package crc64197ae30a36756915;
179179
180180
181181
public class ExportsMembers
@@ -187,7 +187,7 @@ extends java.lang.Object
187187
public static final String __md_methods;
188188
static {
189189
__md_methods =
190-
""n_GetInstance:()Lc64r2197ae30a36756915/ExportsMembers;:__export__\n"" +
190+
""n_GetInstance:()Lcrc64197ae30a36756915/ExportsMembers;:__export__\n"" +
191191
""n_GetValue:()Ljava/lang/String;:__export__\n"" +
192192
""n_methodNamesNotMangled:()V:__export__\n"" +
193193
""n_CompletelyDifferentName:(Ljava/lang/String;I)Ljava/lang/String;:__export__\n"" +
@@ -198,17 +198,17 @@ extends java.lang.Object
198198
}
199199
200200
201-
public static c64r2197ae30a36756915.ExportsMembers STATIC_INSTANCE = GetInstance ();
201+
public static crc64197ae30a36756915.ExportsMembers STATIC_INSTANCE = GetInstance ();
202202
203203
204204
public java.lang.String VALUE = GetValue ();
205205
206-
public static c64r2197ae30a36756915.ExportsMembers GetInstance ()
206+
public static crc64197ae30a36756915.ExportsMembers GetInstance ()
207207
{
208208
return n_GetInstance ();
209209
}
210210
211-
private static native c64r2197ae30a36756915.ExportsMembers n_GetInstance ();
211+
private static native crc64197ae30a36756915.ExportsMembers n_GetInstance ();
212212
213213
public java.lang.String GetValue ()
214214
{
@@ -271,7 +271,7 @@ public void monodroidClearReferences ()
271271
public void GenerateInnerClass ()
272272
{
273273
var actual = Generate (typeof (ExampleOuterClass));
274-
var expected = @"package c64r2197ae30a36756915;
274+
var expected = @"package crc64197ae30a36756915;
275275
276276
277277
public class ExampleOuterClass

tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void TearDown ()
2929
public void Crc64 ()
3030
{
3131
JavaNativeTypeManager.PackageNamingPolicy = PackageNamingPolicy.LowercaseCrc64;
32-
Assert.AreEqual ("c64r2b74743e9328eed0a", JavaNativeTypeManager.GetPackageName (typeof (string)));
32+
Assert.AreEqual ("crc64b74743e9328eed0a", JavaNativeTypeManager.GetPackageName (typeof (string)));
3333
}
3434

3535
[Test]

tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/TypeNameMapGeneratorTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ public void WriteJavaToManaged ()
5959
"value-offset=" + offset + "\u0000" +
6060
GetJ2MEntryLine (typeof (ActivityName), "activity/Name", offset, length) +
6161
GetJ2MEntryLine (typeof (ApplicationName), "application/Name", offset, length) +
62-
GetJ2MEntryLine (typeof (DefaultName), "c64r2197ae30a36756915/DefaultName", offset, length) +
63-
GetJ2MEntryLine (typeof (DefaultName.A), "c64r2197ae30a36756915/DefaultName_A", offset, length) +
64-
GetJ2MEntryLine (typeof (DefaultName.A.B), "c64r2197ae30a36756915/DefaultName_A_B", offset, length) +
65-
GetJ2MEntryLine (typeof (DefaultName.C.D), "c64r2197ae30a36756915/DefaultName_C_D", offset, length) +
66-
GetJ2MEntryLine (typeof (ExampleOuterClass), "c64r2197ae30a36756915/ExampleOuterClass", offset, length) +
67-
GetJ2MEntryLine (typeof (ExampleOuterClass.ExampleInnerClass), "c64r2197ae30a36756915/ExampleOuterClass$ExampleOuterClass_ExampleInnerClass", offset, length) +
62+
GetJ2MEntryLine (typeof (DefaultName), "crc64197ae30a36756915/DefaultName", offset, length) +
63+
GetJ2MEntryLine (typeof (DefaultName.A), "crc64197ae30a36756915/DefaultName_A", offset, length) +
64+
GetJ2MEntryLine (typeof (DefaultName.A.B), "crc64197ae30a36756915/DefaultName_A_B", offset, length) +
65+
GetJ2MEntryLine (typeof (DefaultName.C.D), "crc64197ae30a36756915/DefaultName_C_D", offset, length) +
66+
GetJ2MEntryLine (typeof (ExampleOuterClass), "crc64197ae30a36756915/ExampleOuterClass", offset, length) +
67+
GetJ2MEntryLine (typeof (ExampleOuterClass.ExampleInnerClass), "crc64197ae30a36756915/ExampleOuterClass$ExampleOuterClass_ExampleInnerClass", offset, length) +
6868
GetJ2MEntryLine (typeof (InstrumentationName), "instrumentation/Name", offset, length) +
6969
GetJ2MEntryLine (typeof (AbstractClass), "my/AbstractClass", offset, length) +
7070
GetJ2MEntryLine (typeof (ExampleActivity), "my/ExampleActivity", offset, length) +
@@ -139,14 +139,14 @@ public void WriteManagedToJava ()
139139
GetM2JEntryLine (typeof (AbstractClassInvoker), "my/AbstractClass", offset, length) +
140140
GetM2JEntryLine (typeof (ActivityName), "activity/Name", offset, length) +
141141
GetM2JEntryLine (typeof (ApplicationName), "application/Name", offset, length) +
142-
GetM2JEntryLine (typeof (DefaultName.A.B), "c64r2197ae30a36756915/DefaultName_A_B", offset, length) +
143-
GetM2JEntryLine (typeof (DefaultName.A), "c64r2197ae30a36756915/DefaultName_A", offset, length) +
144-
GetM2JEntryLine (typeof (DefaultName.C.D), "c64r2197ae30a36756915/DefaultName_C_D", offset, length) +
145-
GetM2JEntryLine (typeof (DefaultName), "c64r2197ae30a36756915/DefaultName", offset, length) +
142+
GetM2JEntryLine (typeof (DefaultName.A.B), "crc64197ae30a36756915/DefaultName_A_B", offset, length) +
143+
GetM2JEntryLine (typeof (DefaultName.A), "crc64197ae30a36756915/DefaultName_A", offset, length) +
144+
GetM2JEntryLine (typeof (DefaultName.C.D), "crc64197ae30a36756915/DefaultName_C_D", offset, length) +
145+
GetM2JEntryLine (typeof (DefaultName), "crc64197ae30a36756915/DefaultName", offset, length) +
146146
GetM2JEntryLine (typeof (ExampleActivity), "my/ExampleActivity", offset, length) +
147147
GetM2JEntryLine (typeof (ExampleInstrumentation), "my/ExampleInstrumentation", offset, length) +
148-
GetM2JEntryLine (typeof (ExampleOuterClass.ExampleInnerClass), "c64r2197ae30a36756915/ExampleOuterClass$ExampleOuterClass_ExampleInnerClass", offset, length) +
149-
GetM2JEntryLine (typeof (ExampleOuterClass), "c64r2197ae30a36756915/ExampleOuterClass", offset, length) +
148+
GetM2JEntryLine (typeof (ExampleOuterClass.ExampleInnerClass), "crc64197ae30a36756915/ExampleOuterClass$ExampleOuterClass_ExampleInnerClass", offset, length) +
149+
GetM2JEntryLine (typeof (ExampleOuterClass), "crc64197ae30a36756915/ExampleOuterClass", offset, length) +
150150
GetM2JEntryLine (typeof (InstrumentationName), "instrumentation/Name", offset, length) +
151151
GetM2JEntryLine (typeof (NonStaticOuterClass.NonStaticInnerClass), "register/NonStaticOuterClass$NonStaticInnerClass", offset, length) +
152152
GetM2JEntryLine (typeof (NonStaticOuterClass), "register/NonStaticOuterClass", offset, length) +

0 commit comments

Comments
 (0)