jspraul / ncloak

Automatically exported from code.google.com/p/ncloak
0 stars 0 forks source link

MappingTask does not handle method overloading correctly #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Obfuscate any assembly with at least one method Overload

What is the expected output? What do you see instead?

Expected to obfuscate correctly. Instead we get an error:

Unhandled Exception: System.ArgumentException: An item with the same key 
has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue 
value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at TiviT.NCloak.Mapping.TypeMapping.AddMethodMapping(String methodName, 
String obfuscatedMethodName) in 
D:\Development\TiviT\ncloak\src\TiviT.NCloak\Mapping\
TypeMapping.cs:line 62
   at TiviT.NCloak.CloakTasks.MappingTask.ProcessAssembly(ICloakContext 
context, AssemblyDefinition definition) in 
D:\Development\TiviT\ncloak\src\TiviT.NCloak\CloakTasks\MappingTask.cs:line 
130
   at TiviT.NCloak.CloakTasks.MappingTask.RunTask(ICloakContext context) in 
D:\Development\TiviT\ncloak\src\TiviT.NCloak\CloakTasks\MappingTask.cs:line 
34
   at TiviT.NCloak.CloakManager.Run(ICloakContext context) in 
D:\Development\TiviT\ncloak\src\TiviT.NCloak\CloakManager.cs:line 96
   at TiviT.NCloak.Console.Program.Main(String[] args) in 
D:\Development\TiviT\ncloak\src\TiviT.NCloak.Console\Program.cs:line 16

Original issue reported on code.google.com by nzpaulma...@gmail.com on 25 Mar 2010 at 9:24

GoogleCodeExporter commented 9 years ago
the recommendation would be to crate a unique key for Dictionary variables, for 
example - include functions arguments with types, etc
same issue would encounter for Fields and Properties.

Original comment by ash...@gmail.com on 26 Mar 2010 at 3:58

GoogleCodeExporter commented 9 years ago
Good job! I just reviewed latest revision 27 - you have now much stronger key 
in dicts!

Original comment by greeno...@gmail.com on 3 May 2010 at 8:20