• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compiler warnings

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I've almost finished my assignment.
During compilation of my application couple of warnings pop out:
- [unchecked] unchecked cast
- [unchecked] unchecked call to
- [unchecked] unchecked method invocation
I use -Xlint:unchecked,fallthrough,path,finally flags when compiling.

Should I care about these warnings?
Will they affect my grade?
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
should you take care of them? certainly.
will they affect your grades? no way to know except trying and I for one don't want to try.

Least you can do is put in some @SuppressWarning annotations where appropriate, better yet handle the warnings whereever it makes even a bit of sense by solving what causes them.
Myself, I resorted to annotations ONLY to get rid of warnings relating to missing SerialVersionIds in my Swing related classes, as there's no intent whatsoever to ever serialise those.
Everything else, I provided a tight solution so there are no warnings to be suppressed.
 
Leszek Zajac
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From now on I compile with -Xlint:all flag.

Did you use @SuppressWarnings("serial") for all
frames, control, tables, tablemodels, cellrenderers?
(Is TableModel a GUI class?)

PS. I have one more unchecked warning to eliminate :-)
 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leszek,

What do you mean by saying "is TableModel a GUI class"? Should it reside in GUI code, is that what you are asking about? Well, it all depends on your design. In mine where controller controls everything, controller creates table model every time new data is to be displayed and passes it to the view, so I can say it does not reside anywhere If you use MVC where model notifies view about changes then your table model should reside in the GUI code. Table model is not an application level model, it is the model on Swing level MVC design and its components.

Good luck on the exam, I plan to schedule mine just after New Year. Currently finishing my choices.txt and uploading after Christmas.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my custom TableModel (as part of the datamodel) did get one (a SerialVersionID that is), the visual classes (JTable descendents etc.) did not.
[ December 22, 2006: Message edited by: Jeroen T Wenting ]
 
Leszek Zajac
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Olek.

My custom table model resides in gui package,
so it won't get serialVersionUID.
In my case the gui class creates table model when client starts.
Later it is filled with data, not recreated. It is not
part of application data model.
I have a thin client, so I don't have controller in it.

Originally posted by Aleksander Zielinski:
Good luck on the exam, I plan to schedule mine just after New Year. Currently finishing my choices.txt and uploading after Christmas.



I'm also planning to take the exam at this time. Good luck to you.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic