Help save net neutrality! Learn more.
Close

#379 New Language Level Support

open
Other (46)
5
2010-04-27
2010-04-22
No

In revisions 5225-5227, the Java Language Levels were changed.

http://drjava.svn.sourceforge.net/viewvc/drjava?view=rev&revision=5225

From now on, there is only one Language Level called dj, which was the result of combining and modifying dj0 and dj1. The dj2 Language Level has been eliminated (it currently copies the unmodified text from a dj2 file to a java file).

The new Language Level facility can still compile dj0 and dj1 files as dj files. Compiling dj2 files may be broken.

In this feature request, I want to keep track of what we need to do to properly support the new Java Language Levels:

1. Change all file dialogs to open *.java, *.dj0, *.dj1, *.d2 and the new *.dj files.
2. When a *.dj0 or *.dj1 file is opened, the user should be asked if he or she wants to rename the file to *.dj
3. When a *.dj2 file is opened, the user should be asked if he or she wants to rename the file to *.java
4. The diagram and explanation of the Language Levels in the documentation needs to be updated.
5. The Language Levels menu needs to be changed to just "Full Java" and "Simplified Java" or something like that.
6. Since *.dj2 files do not have the line number table anymore, they open the *.java file now. This needs to be fixed.

If I have forgotten anything, please add to the list in a comment.
If you fixed one of these problems, please write what item has been addressed.

Discussion

  • Mathias Ricken

    Mathias Ricken - 2010-04-22

    Comment to 6: This is actually a two-part problem.

    6.1. In JUnit and the debugger, we are missing the line number conversion table. I suggest when a dj2 file is processed and the generated java file doesn't have a conversion table at the top, we create an identity relation (i.e. it maps a line number to itself).

    6.2. Compiler errors in dj2 files aren't caught by the language level converter anymore, so javac compiles the generated java file. Errors in dj2 files are therefore reported in the java file, which is opened. We need additional code here that replaces the java file in the error message with the corresponding dj2 file from which it was generated.

     
  • Mathias Ricken

    Mathias Ricken - 2010-04-27

    As of revision 5236:

    DONE 1. File dialogs can deal with *.java, *.dj, and *.dj#. The open dialogs are "smart" in that they do not display a *.java file if there is a matching language level file. All open dialogs show all kinds of source files, regardless of language level setting in the menu bar.
    DONE 5. The language level menu now only contains "Full Java" and "Functional Java". Regardless, all other language level files will still be compilable (dj2 still breaks).

    .dj files can now be compiled.

     
  • Mathias Ricken

    Mathias Ricken - 2010-04-27
    • assigned_to: nobody --> mgricken
     
  • Mathias Ricken

    Mathias Ricken - 2010-04-27

    As of revision 5237:

    DONE 2. When a *.dj0 or *.dj1 file is saved, the user should be asked if he or she wants to rename the file to *.dj.
    DONE 3. When a *.dj2 file is saved, the user should be asked if he or she wants to rename the file to *.java

    I decided to do this on the save action, not the open, because that's how changing the extension of the project files was handled.

     
  • Mathias Ricken

    Mathias Ricken - 2010-04-27

    As of revision 5238:

    DONE 6.2. Compiler errors reported in .java files are now changed to refer to the .dj2 file, if there was one. The logic is: If the error is in a .java file, and the .java file isn't actually open, but a corresponding .dj2 file is, change the error to refer to the .dj2 file.

     
  • Mathias Ricken

    Mathias Ricken - 2010-04-27

    As of revision 5239:

    DONE 6.1. If a line number map isn't found, as in the case of a .dj2 file copied to a .java file, we map .java line numbers to themselves.

    What's left now is 4. The diagram and explanation of the Language Levels in the documentation needs to be updated.