/** * Returns the value in the last browser context's copy of this * browser-local variable. If the variable has no value for the * last browser context, it is first initialized to the value returned * by an invocation of the {@link #initialValue} method. * * <p>If the last browser context is not available, null is returned. * * @return the last browser context's value of this browser-local */ public T getLast() { BrowserActions browser = BrowserActions.lastBrowserActions(); if (browser == null) { return null; } T result = (T) browser.browserLocals.get(this); if (result == null) { T init = initialValue(); if (init != null) { browser.browserLocals.put(this, init); return init; } } return result; }
/** * Returns the value in the last browser context's copy of this * browser-local variable. If the variable has no value for the * last browser context, it is first initialized to the value returned * by an invocation of the {@link #initialValue} method. * * <p>If the last browser context is not available, null is returned. * * @return the last browser context's value of this browser-local */ public T getLast() { BrowserActions browser = BrowserActions.lastBrowserActions(); if (browser == null) { return null; } T result = (T) browser.browserLocals.get(this); if (result == null) { T init = initialValue(); if (init != null) { browser.browserLocals.put(this, init); return init; } } return result; }