basisbit / google-diff-match-patch

Automatically exported from code.google.com/p/google-diff-match-patch
Apache License 2.0
0 stars 0 forks source link

Unchecked cast (Java) #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Compiling project generates a warning for line 221:
 linearray = (ArrayList<String>) b[2];
results in:
 Type safety: Unchecked cast from Object to ArrayList<String>

This can be worked around by ignoring warnings of course, so I'm not clear
on whether this is important or not (a relative noob at Java). My apologies
if this is normal behaviour.

What version of the product are you using? On what operating system?
Version 20080624
Built in Eclipse with java 1.6.0.10 on Ubuntu 8.10

Original issue reported on code.google.com by jdfkn...@gmail.com on 8 Nov 2008 at 6:23

GoogleCodeExporter commented 8 years ago
Yes, that line gives me a warning too.  I asked a couple of Java programmers 
here at
Google about it last year, and they told me to ignore it.  The alternative is to
create a dedicated return object with typed parameters.  A rather heavy-weight 
solution.
As for code safety, the warning is 100% groundless.  It won't cause a problem.

However, if anyone has a simple solution, let me know and I'll add it.

Original comment by neil.fra...@gmail.com on 13 Nov 2008 at 1:28