RFR: 1818: Get rid of extra REST request in GitLabMergeRequest#author

Erik Joelsson erikj at openjdk.org
Mon Feb 13 22:45:50 UTC 2023


On Mon, 13 Feb 2023 22:31:06 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabMergeRequest.java line 85:
>> 
>>> 83:     @Override
>>> 84:     public HostUser author() {
>>> 85:         return host.parseAuthorField(json);
>> 
>> Did you test this? I would assume you need something like this:
>> Suggestion:
>> 
>>         return host.parseAuthorField(json.get("author"));
>
> Yes, I tested it. We don't need to get author here. Because we get author in this method.
> 
> 
>     HostUser parseAuthorField(JSONValue json) {
>         return parseAuthorObject(json.get("author").asObject());
>     }

Oh, right, I misread the method name. Yes, that should work.

-------------

PR: https://git.openjdk.org/skara/pull/1471


More information about the skara-dev mailing list