Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why does Eclipse 3.1.0 show these 2 warnings? any work arounds

 
Ravi Sathish
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am getting these 2 peculiar problems with Eclipse 3.1.0 on RH Linux 8.3:

Issue#1
Some of my GUI classes show these warnings

Severity 1:The serializable class xxxPanel does not declare a static final serialVersionUID field of type long

Issue#2
On the command line I get these repeated warnings:
** (<unknown>:22753): WARNING **: pango-layout.c:2435: broken PangoLayout

Anyone else facing same problems? any work-arounds

Thanks
Ravi
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't say about #1, but #2 is caused by having a debug build of GTK++ 2.
Older RedHat systems often have such a library. Updating your GTK library makes these (harmless) messages go away.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravi,
This is an optional compilation check in Eclipse 3.1. While you could turn it off, I think you would be better served to add the constant. You can add it by running the serialver tool at the command line. Some plugins allow you to right click the message to generate the id as well. I don't recall whether Eclipse does by default.

[edited to add that I'm discussing message #1]
[ March 03, 2005: Message edited by: Jeanne Boyarsky ]
 
Ravi Sathish
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne

Thanks for the response.

I did a little bit of reaidng about serialVersionUID and found this from
http://serialver.sourceforge.net/serialver.html

The static member variable called serialVersionUID can be included in the code of the new class version that implements a compatible modification. So, all objects serialized by the original class are compatible with the new class.

There they say a versioned class must declare something like this:
private static final long serialVersionUID = 3487495895819393L;

My question is will adding a constant like this have any problems viz. different JVM"s ? We run our code on different platforms

TIA
RAVI
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravi,
In that case, you are actually better off having the serialVersionUID explicitly stated. If you do not have it, the JVM has to calculate one. Aside from taking time, this introduces the [slight] risk that the platforms will calculate it different ways.

In other words using the serialVersionUID will make your code faster and more uniform across platforms.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic