Do not always try to load parameter names

In aosp/Idcca9709603a58da5f067ca32abe1b9f5dc45496 we switched
to always loading all parameter names. However, this may cause issues
when e.g. class <init> method is suppose to contain synthetic parameters
but it does not. ClassReader will try to skip the synthetic params, but
because they do not exist, NPE will occur.

We work around this issue by restoring the previous behavior, which
was to retrieve the param names only when saveParameterNames is true.

There is one drawback though. Previously, if saveParameterNames was false,
we would get invalid names (arg0, arg1...), but annotations would be
correct. With this change, we will get invalid names without any
annotations. However, annotation processing which is the primary user
of these APIs always sets saveParameterNames to true, so there should
not be any issues.

Related to https://bugs.openjdk.java.net/browse/JDK-8177486
1 file changed