It's best to avoid mixing arrays and generics for exactly this reason. If you must, and want to get rid of the warning, you can use the @SuppressWarnings("unchecked") annotation on the method containing the offending code. Try to ensure that the method in question contains as little code as possible, as the annotation will suppress all generic casting warnings even if ...