Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#81 Compile with Xlint without warnings

Enhancement
open-accepted
Adam
9
2013-03-16
2009-12-01
Adam
No

Turn on -Xlint during compilation and resolve issues this surfaces.

Decide whether or not to always have this on or only during debug.

Discussion

  • Adam
    Adam
    2009-12-01

    • assigned_to: david_benn --> adamweber
    • status: open --> open-accepted
     
  • Adam
    Adam
    2009-12-04

    So I put in Xlint back into my make file to start checking out the errors that I first saw. Only this time, I got nothing. David did you clean them up when I sent you my first broken class? Or maybe I was just dreaming them up when I was trying to get that working?

    Either way let me know. We can just close this one or I can make a patch to just turn Xlint on for all builds.

    Thanks,

     
  • Adam
    Adam
    2009-12-04

    adds xlint to all javac sections

     
    Attachments
  • Adam
    Adam
    2009-12-04

    I no longer see any warning with lint turned on. Attached a patch that turns Xlint on for all javac sections.

     
  • David Benn
    David Benn
    2009-12-04

    Hi Adam. After applying the patch, with "ant clean test" (for example), I see many warnings of the form:

    warning: [serial] serializable class org.aavso.tools.vstar.ui.dialog.ObservationDetailsDialog has no definition of serialVersionUID

    Now, I've seen Eclipse complaining about this too, so it's doing some internal Linting. I have not worried too much about it since in some cases (such as the one above), I'm never going to serialize it. On the other hand, I'm a big fan of as much static analysis/typing as possible. Type Systems Are My Friends. So, I think that we ought to add all missing serialVersionUIDs (could probably script it, or I could just go add them via Eclipse) and turn on Xlint for all builds in order to get the benefits.

     
  • Adam
    Adam
    2009-12-04

    Interesting I don't get any of those. I'll futz with it more.

     
  • Adam
    Adam
    2009-12-07

    some type casting fixes

     
    Attachments
  • Adam
    Adam
    2009-12-07

    I see it was the lack of use of clean on my part to get the errors. I've attached a patch that fixes some casting problems. I'm going to do this in phases as I think all at once would be too much for troubleshooting should something get messed up.

     
  • David Benn
    David Benn
    2012-06-10

    Adding a FindBugs ant target would also be useful.

     
  • David Benn
    David Benn
    2012-06-18

    • priority: 5 --> 9
     
  • David Benn
    David Benn
    2013-03-16

    • milestone: Enhancement_-Phase_1 --> Enhancement-_Phase_2