Problems While Converting .aar to .dll With Code CS0102

I am having trouble converting my .aar to .dll

My .aar file contains one class that used method overloading. I have attached code below.

package org.apache.commons.io.input;

public abstract interface TailerListener
{
  public abstract void init(Tailer paramTailer);

  public abstract void fileNotFound();

  public abstract void fileRotated();

  public abstract void handle(String paramString);

  public abstract void handle(Exception paramException);
}

While converting this class to c# standard I am getting error as

Error CS0102 The type 'HandleEventArgs' already contains a definition for 'p0' FCLiveness c:\users.....\Projects\FCLiveness\FCLiveness\obj\Release\generated\src\Org.Apache.Commons.IO.Input.ITailerListener.cs 229 Active

and

Error CS0102 The type 'ITailerListenerImplementor' already contains a definition for 'HandleHandler' FCLiveness c:\users.....\Projects\FCLiveness\FCLiveness\obj\Release\generated\src\Org.Apache.Commons.IO.Input.ITailerListener.cs 293 Active

My Auto Generated ITailerListener.cs

#pragma warning disable 0649
        public EventHandler<HandleEventArgs> HandleHandler;
#pragma warning restore 0649

        public void Handle (global::Java.Lang.Exception p0)
        {
            var __h = HandleHandler;
            if (__h != null)
                __h (sender, new HandleEventArgs (p0));
        }
#pragma warning disable 0649
        public EventHandler<HandleEventArgs> HandleHandler;
#pragma warning restore 0649

        public void Handle (string p0)
        {
            var __h = HandleHandler;
            if (__h != null)
                __h (sender, new HandleEventArgs (p0));
        }

How can I change argument parameter name on basis of argument parameter type.

Thanks.

Answers

  • chad_cumberlandchad_cumberland Member ✭✭
    edited March 20

    I hope you found a resolution to this issue.
    If not I found adding the following to your metadata.xml resolved this issue:

    <metadata>
      <!-- Other Stuff -->
      <attr path="/api/package[@name='org.apache.commons.io.input']/interface[@name='TailerListener']/method[@name='handle' and count(parameter)=1 and parameter[1][@type='java.lang.Exception']]" name="managedName">HandleException</attr>
      <attr path="/api/package[@name='org.apache.commons.io.input']/interface[@name='TailerListener']/method[@name='handle' and count(parameter)=1 and parameter[1][@type='java.lang.String']]" name="managedName">HandleString</attr>
    
      <attr path="/api/package[@name='org.apache.commons.io.input']/class[@name='TailerListenerAdapter']/method[@name='handle' and count(parameter)=1 and parameter[1][@type='java.lang.Exception']]" name="managedName">HandleException</attr>
      <attr path="/api/package[@name='org.apache.commons.io.input']/class[@name='TailerListenerAdapter']/method[@name='handle' and count(parameter)=1 and parameter[1][@type='java.lang.String']]" name="managedName">HandleString</attr>
      <!-- Other Stuff -->
    </metadata>
    

    The reason this seems to be an issue is because of the overload function handle in the interface. So the above changes the two Handle function name to HandleException and HandleString then also edits this for the TailerListenerAdapter.

    Hope this helps

Sign In or Register to comment.