haohighview / apps-for-android

Automatically exported from code.google.com/p/apps-for-android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsuppressed warning in Photostream

GoogleCodeExporter opened this issue · comments

[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

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

  • Changed state: WontFix