google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

NPE in CookiesPatcher #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
from a unit test, call Cookies.removeCookie before setting any cookies

What is the expected output? What do you see instead?
calling remove on non existant cookies should do nothing
instead, I get an NPE

What version of the product are you using? On what operating system?
0.31, 0.32-SNAPSHOT

Please provide any additional information below.

in CookiesPatcher, the cachedCookies hashmap is created on demand in 
setCookieImpl method. However, in removeCookieNative method

  @PatchMethod
  static void removeCookieNative(String name) {
    Map<String, String> cachedCookies = getCookiesMap();
    cachedCookies.remove(name);
  }

it should check if cachecCookies map actually exists before attempting to 
operate on it

Original issue reported on code.google.com by sam.ji...@karoshealth.com on 17 Aug 2011 at 4:16

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 18 Aug 2011 at 8:04

GoogleCodeExporter commented 9 years ago
Sorry for the late answer(I was in vacation), I just fixed this and deployed a 
new 0.32-SNAPSHOT.

Could you please give me some feedback on it ?

Original comment by gael.laz...@gmail.com on 21 Aug 2011 at 8:54

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 22 Aug 2011 at 9:25

GoogleCodeExporter commented 9 years ago
hey sorry for the late reply. I just ran some tests and this new version seems 
to work
thanks again for the good work =D

Original comment by sam.ji...@karoshealth.com on 24 Aug 2011 at 10:45

GoogleCodeExporter commented 9 years ago
Thanks ! :-)

Original comment by gael.laz...@gmail.com on 25 Aug 2011 at 9:02