RFR: 1707: Bot warns about "No .jcheck/conf found" when it should not [v5]

Erik Joelsson erikj at openjdk.org
Tue Dec 6 20:43:09 UTC 2022


On Tue, 6 Dec 2022 19:36:27 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabRepository.java line 298:
>> 
>>> 296:                         // Retry once with additional escaping of the path fragment
>>> 297:                         // Only retry when the error is exactly "File Not Found"
>>> 298:                         if (response.statusCode() == 404 && response.body().contains("File Not Found")) {
>> 
>> The comment says 'exactly "File Not Found"' but the conditional uses `.contains`. I think we can switch to `.equals`.
>
> I use contains because the real body is `{"message":"404 File Not Found"}`.  I will use  `response.body().equals("{"message":"404 File Not Found"}")`

Hm, better parse the Json in that case. I don't think the string comparison should include any json code. Something like message.endsWith("File Not Found") seems good enough.

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

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


More information about the skara-dev mailing list