timowest/scalagen

override keyword missing

Closed this issue · 2 comments

When I convert this very simple code :

import java.awt.Label;

public class FirstApplet extends java.applet.Applet {
   public void init (){
      add(new Label("Hello World"));
   }
}

It generates

import java.awt.Label

class FirstApplet extends java.applet.Applet {

  def init() {
    add(new Label("Hello World"))
  }
}

Which does not compile since init overrides a method in Applet.

Note that I am using this https://github.com/dnadolny/java-to-scala-plugin plugin to paste the java code.

Scalagen operates on the source code level, so you will need to use the Override annotation to get the results you want.

I understand, it is really not a big issue.

Maybe you could document such restrictions of the tool in the README ? This file is a good start https://github.com/dnadolny/java-to-scala-plugin/blob/master/README.md (section Problems ...)

For instance this @OverRide behaviour changed a bit between java 5 and 6 I think, maybe also explain which version of Java sources you target.