Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unchecked cast (Java) #15

Closed
GoogleCodeExporter opened this issue Jul 15, 2015 · 1 comment
Closed

Unchecked cast (Java) #15

GoogleCodeExporter opened this issue Jul 15, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link
Contributor

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
Copy link
Contributor Author

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

  • Changed state: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant