NoSuchMethodException using reflection

Good catch but it does not work…
I start to understand now why some people call reflection in java black magic.

This works but really sucks:

           Method[] methods = PGraphics.class.getDeclaredMethods();
                
                for (Method m : methods) {
                    if (m.getName().equals("colorCalc")) {

                        Class<?>[] parameter_types = m.getParameterTypes();
                        if(parameter_types.length == 1) {
                            if(parameter_types[0].getName().equals("int")) {
                                colorCalcMethod_one_int = m;
                                break;
                            }
                        }

                    }
                }

A better solution then the above is still welcome.