Wrong line, but mainly you directly reference colorSpace in the code with array indexes. If you HAVE to directly define array indexes, use a constant "static final int" to do it.