You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The variable idx in getAsStringList method does not updated inside the for-loop, so idx always has the value 0. Since idx is used for Exception handling, it can make debuggers confused.
publicList<String> getAsStringList(StringmethodName) {
// ....List<String> out = newArrayList<String>(v.valueGuesses.size());
intidx = 0;
for (Objectguess : v.valueGuesses) {
Objectresult = guess == null ? null : guessToType(guess, String.class, v, idx);
if (result == null) {
if (v.valueGuesses.size() == 1) {
String[] s = getDefaultIf(methodName, newString[0]);
returnCollections.unmodifiableList(Arrays.asList(s));
}
thrownewAnnotationValueDecodeFail(v,
"I can't make sense of this annotation value. Try using a fully qualified literal.", idx);
}
out.add((String) result);
}
returnCollections.unmodifiableList(out);
}
Expected behavior
publicList<String> getAsStringList(StringmethodName) {
// ....List<String> out = newArrayList<String>(v.valueGuesses.size());
intidx = 0;
for (Objectguess : v.valueGuesses) {
Objectresult = guess == null ? null : guessToType(guess, String.class, v, idx);
if (result == null) {
if (v.valueGuesses.size() == 1) {
String[] s = getDefaultIf(methodName, newString[0]);
returnCollections.unmodifiableList(Arrays.asList(s));
}
thrownewAnnotationValueDecodeFail(v,
"I can't make sense of this annotation value. Try using a fully qualified literal.", idx);
}
out.add((String) result);
idx++;
}
returnCollections.unmodifiableList(out);
}
The text was updated successfully, but these errors were encountered:
Describe the bug
The variable
idx
in getAsStringList method does not updated inside the for-loop, soidx
always has the value0
. Since idx is used for Exception handling, it can make debuggers confused.Expected behavior
The text was updated successfully, but these errors were encountered: