views:

33

answers:

1

I am using IKVM to compile a large Java library project to a .NET DLL. In so doing, however, the method names are staying according to the Java convention of method names NOT being capitalized - but I want the .NET dll to be used in .NET projects and so would like the method names to be capitalized.

The only exception would be methods which are overloads of JDK methods such as toString() or such - these will have to remain in lower-case.

How should I go about automatically renaming all methods (which are not overloads of JDK methods!), making them into capitalized names?

Note that I've tried using an obfuscator like Proguard but keep running into settings issues and would love a different solution - but if you know of any easy way to do it with Proguard, please let me know!

A: 

I would use sed, awk, and a simple regex to go through and replace methods for you. Methods have a pretty predictable signature..

public|private|protected (some word including void) (maybe static) (maybe synchronized) (the actual method name).

The script would bump everything up.. then the stuff like toString will break compilation if it properly has the @Override annotation.. and you can go back and fix (by hand or with another sed specifically for toString and such).

bwawok