Type mismatch: cannot convert from ArrayList<?> to Collection<BlockPair>
HashMap hints= new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
hints.put(EncodeHintType.MARGIN,2);
try {
BitMatrix bitMatrix =new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height);
Path file=new File("D:/MyEclipse/code/img.png").toPath();
MatrixToImageWriter.writeToPath(bitMatrix, format, file);
} catch (Exception e) {
e.printStackTrace();
}
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Type mismatch: cannot convert from ArrayList<?> to Collection<BlockPair>
Cannot instantiate the type ArrayList<?>
Syntax error on token "<", ? expected after this token