Night Walker
Night Walker

Reputation: 21280

conversion from J# to c#

I am trying to convert code from J# to C# automaticly using the dotPeek tool and I get the following code. What is it param0? The code does not compile because of it.

  public XmlException(Xml this\u00240, string s)
    : base(new StringBuffer().append("XmlParseError:").append(s).ToString())
  {
    this.this\u00240 = param0;
    if (param0 == null)
      ObjectImpl.getClass((object) param0);
    this.parseString = s;
  }

The original J# code:

public XmlException( String s ) {
            super( "XmlParseError:" + s );
            this.parseString = s;
        }


class XmlException extends Exception 

Upvotes: 1

Views: 799

Answers (1)

Lex Li
Lex Li

Reputation: 63254

I think that's a bug in dotPeek, where its translation result is invalid.

If the J# project is large, you may consider use IKVM to host it instead. IKVM is able to run Java code on .NET. http://www.ikvm.net/

Using a decompiler like dotPeek to perform translation is error prone, and personally I don't think it is feasible.

If the J# project is small, you may consider a line by line manual rewrite in C#. That can be even faster if you are familiar with both languages.

Upvotes: 3

Related Questions