Title: NPE when @SetsCookie is used but cookie was *not* set by the server · Issue #855 · androidannotations/androidannotations · GitHub
Open Graph Title: NPE when @SetsCookie is used but cookie was *not* set by the server · Issue #855 · androidannotations/androidannotations
X Title: NPE when @SetsCookie is used but cookie was *not* set by the server · Issue #855 · androidannotations/androidannotations
Description: Tested this on version 3.0. Given an interface like this: @Rest(converters = { StringHttpMessageConverter.class, FormHttpMessageConverter.class }) public interface MyCoolRestInterface { @Post("/very/cool?foo={bar}") @SetsCookie({ "YUMMY"...
Open Graph Description: Tested this on version 3.0. Given an interface like this: @Rest(converters = { StringHttpMessageConverter.class, FormHttpMessageConverter.class }) public interface MyCoolRestInterface { @Post("/ver...
X Description: Tested this on version 3.0. Given an interface like this: @Rest(converters = { StringHttpMessageConverter.class, FormHttpMessageConverter.class }) public interface MyCoolRestInterface { @Post("...
Opengraph URL: https://github.com/androidannotations/androidannotations/issues/855
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NPE when @SetsCookie is used but cookie was *not* set by the server","articleBody":"Tested this on version 3.0.\n\nGiven an interface like this:\n\n``` java\n@Rest(converters = { StringHttpMessageConverter.class, FormHttpMessageConverter.class })\npublic interface MyCoolRestInterface {\n @Post(\"/very/cool?foo={bar}\")\n @SetsCookie({ \"YUMMY\" })\n @Accept(MediaType.APPLICATION_FORM_URLENCODED_VALUE)\n String veryCool(MultiValueMap\u003cString, String\u003e params, boolean bar);\n\n @Get(\"needs/cookie\")\n @RequiresCookie(\"YUMMY\")\n String needsCookie();\n}\n```\n\nWhen the response comes back from the server and YUMMY **_is not**_ set, we get an NPE at the for loop in the generated code (see _RIGHT HERE_ below):\n\n``` java\n@Override\npublic String veryCool(MultiValueMap\u003cString, String\u003e params, boolean bar) {\n ...\n String[] requestedCookies = new String[] {\"YUMMY\"};\n List\u003cString\u003e allCookies = response.getHeaders().get(\"Set-Cookie\");\n *** RIGHT HERE *** \u003e for (String rawCookie: allCookies) {\n ...\n}\n```\n\nbecause **_Set-Cookie**_ header is not present, and **allCookies** is **null**. Well, at least in my case it is. This should be better guarded by a null check of the list returned by the _get()_ call.\n","author":{"url":"https://github.com/kutsal","@type":"Person","name":"kutsal"},"datePublished":"2014-01-02T21:07:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/855/androidannotations/issues/855"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b317289d-bc26-1658-63c2-9a5e8ace7c67 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5F0:2355D4:C3E5:FFAD:6A61556A |
| html-safe-nonce | 3f542de1b55846064ce475a81d6688820067fbc5d2edaee063a16ef4e3946aca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUYwOjIzNTVENDpDM0U1OkZGQUQ6NkE2MTU1NkEiLCJ2aXNpdG9yX2lkIjoiMzA3MDY3MDcxNjY4Nzk2MzQ5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fc747e9da2045aea15dfe5cb830e23f17ac79639b4fdaed60f791d449361d821 |
| hovercard-subject-tag | issue:24987228 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/androidannotations/androidannotations/855/issue_layout |
| twitter:image | https://opengraph.githubassets.com/263df799e1ee98e6c37ba66ea79eed3bbfdc498adf4d38565997a0449dbe872e/androidannotations/androidannotations/issues/855 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/263df799e1ee98e6c37ba66ea79eed3bbfdc498adf4d38565997a0449dbe872e/androidannotations/androidannotations/issues/855 |
| og:image:alt | Tested this on version 3.0. Given an interface like this: @Rest(converters = { StringHttpMessageConverter.class, FormHttpMessageConverter.class }) public interface MyCoolRestInterface { @Post("/ver... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kutsal |
| hostname | github.com |
| expected-hostname | github.com |
| None | c258d2b06b498220e3b94af28b26bbbf58f4203a6373725f779afcc867afd263 |
| turbo-cache-control | no-preview |
| go-import | github.com/androidannotations/androidannotations git https://github.com/androidannotations/androidannotations.git |
| octolytics-dimension-user_id | 1315313 |
| octolytics-dimension-user_login | androidannotations |
| octolytics-dimension-repository_id | 3116751 |
| octolytics-dimension-repository_nwo | androidannotations/androidannotations |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3116751 |
| octolytics-dimension-repository_network_root_nwo | androidannotations/androidannotations |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bae60047c72c7890f36d34d78461f3453c546ee2 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width