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

Unsuppressed warning in Photostream #15

Closed
GoogleCodeExporter opened this issue Feb 25, 2016 · 1 comment
Closed

Unsuppressed warning in Photostream #15

GoogleCodeExporter opened this issue Feb 25, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

[Reported against r20 of Photostream]

As previously reported, there's an unchecked warning in UserTask.java

photostream\UserTask.java:215: warning: [unchecked]
 unchecked generic array creation of type Result[] for varargs parameter
  new UserTaskResult<Result>(UserTask.this, result));

Caused by mixing generics with arrays in the UserTaskResult constructor:

  UserTaskResult(UserTask task, Data... data)

I suspect there's something unsavory about the use of varargs in the
swingworker-style task class, but I don't have a suggested fix, and,
furthermore, the code is actually safe in this instance.

Fix: Please annotate this statement to suppress the needless warning.

 @SuppressWarnings("unchecked")
 final Message message = sHandler.obtainMessage(MESSAGE_POST_RESULT,
   new UserTaskResult<Result>(UserTask.this, result));

(As per Item 26 in Effective Java, 2nd Ed.)

Original issue reported on code.google.com by joe.bowb...@gmail.com on 2 Sep 2008 at 10:11

@GoogleCodeExporter
Copy link
Author

Original comment by romaingu...@gtempaccount.com on 3 Sep 2008 at 3:04

  • 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