Skip to content

Commit

Permalink
Use Class.getDeclaredField() instead of getField() when fetching …
Browse files Browse the repository at this point in the history
…Thrift metadata. (#1729)

Related: #1728

Motivation:

When a user builds a `.thrift` file with the `private-members` option enabled,
Armeria fails to find some fields in the generated code.

Modifications:

- Use `Class.getDeclaredField()` instead of `getField()`.

Result:

- Fixes #1728
  • Loading branch information
edgao authored and trustin committed Apr 22, 2019
1 parent 64fdf38 commit 666155d
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -102,7 +102,7 @@ private ThriftFunction(
continue;
}

final Class<?> fieldType = resultType.getField(fieldName).getType();
final Class<?> fieldType = resultType.getDeclaredField(fieldName).getType();
if (Throwable.class.isAssignableFrom(fieldType)) {
@SuppressWarnings("unchecked")
final Class<Throwable> exceptionFieldType = (Class<Throwable>) fieldType;
Expand Down

0 comments on commit 666155d

Please sign in to comment.