zhoupan / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

jmesa has a lot of compiler warnings #184

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Just a quick peek at the problems view in Eclipse shows a number of
compiler warnings, mostly related to generics, unused imports, and a few
classes missing serialization UIDs.  This patch eliminates these warnings.
 There are no major changes except that I added wildcard parameters for raw
types (except on the tags, I used a @SuppressWarnings annotation because I
think there was some problem in weblogic with that before), and I added
@SupressWarnings in places where unchecked operations were necessary.

After rebuilding the project all tests still pass, and I will do a little
more testing later today.

Original issue reported on code.google.com by bgo...@e1b.org on 13 Mar 2009 at 2:56

Attachments:

GoogleCodeExporter commented 9 years ago
This is great! I will have a look at this over the weekend. I really like how 
Eclipse
has all those warnings built in. I mostly use Netbeans nowadays and sometimes I 
do
miss how many warnings Eclipse would catch.

Original comment by jeff.johnston.mn@gmail.com on 13 Mar 2009 at 7:38

GoogleCodeExporter commented 9 years ago
I started applying the patch tonight. The changes look good! 

I did want to get more of your opinion about the serialVersionUID. My 
understanding
is that you only need to declare this if you have something like a client server
application and you want a way to say that these two objects are identical at a 
byte
code level. The reason is the two applications exist in different JVM's with two
different jar files. At least that's my understanding of it.

If the serialVersionUID is not declared then one will be associated by the JVM.

With that I typically do not declare the serialVersionUID and opted to turn off 
that
warning...

Original comment by jeff.johnston.mn@gmail.com on 16 Mar 2009 at 1:16

GoogleCodeExporter commented 9 years ago
You're absolutely right... actually using a serialVersionUID is probably not 
even a
good idea unless you use it semantically correctly.  Just to clarify, as I 
understand
it is not really necessary to have two versions of the serializable class be 
the same
at the byte code level, but if two versions of the class have the same UID it is
meant to signify that they will serialize/deserialize correctly even though 
they are
different (for example, you would change the serialVersionUID if you added a 
field to
a class that has no logical default that would make it compatible with an older
version of the same class).

To make a long story short, I am fine with just disabling that warning in the 
IDE.  I
just didn't really want to disable the ones that had to do with generics and 
such.

Original comment by bgo...@e1b.org on 16 Mar 2009 at 2:59

GoogleCodeExporter commented 9 years ago
Yep, that sounds right to me as well...I have those changes checked in. I'll 
just let
the changes sit for a few days and then do a release.

Original comment by jeff.johnston.mn@gmail.com on 17 Mar 2009 at 3:07

GoogleCodeExporter commented 9 years ago
Part of the 2.4.2 release.

Original comment by jeff.johnston.mn@gmail.com on 5 Apr 2009 at 1:17