Menu

#734 Should automatically generate public modifier

open
nobody
7
2010-04-10
2009-03-09
No

The "public" modifier is implicit for interfaces, but explicit for classes. When an interface is implemented and the "public" modifier has not been specified, it should be automatically generated by the language level converter. Example:

class FingerExercises {
Object doSomething() {
UnaryFun f = new UnaryFun() {
Object apply(Object arg) { // generate public modifier here
return (Integer)arg * (Integer)arg;}
};
return f.apply(5);
}
}
interface UnaryFun {
public Object apply(final Object arg);
}

Discussion

  • Mathias Ricken

    Mathias Ricken - 2009-03-09

    Sample file

     
  • Mathias Ricken

    Mathias Ricken - 2010-04-10

    This is in the dj2 Advanced Language Level.

     
  • Mathias Ricken

    Mathias Ricken - 2010-04-10
    • priority: 5 --> 7
     

Log in to post a comment.