stephanenicolas / robospice

Repo of the Open Source Android library : RoboSpice. RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules.
Apache License 2.0
2.95k stars 545 forks source link

SpiceManager.execute bug? #418

Closed jdulaney closed 9 years ago

jdulaney commented 9 years ago

I was looking through the source code and saw the following:

    /**
     * Execute a request, without using cache. No result from cache will be
     * returned. The method {@link SpiceRequest#loadDataFromNetwork()} will
     * always be invoked. The result will not be stored in cache.
     * @param request
     *            the request to execute.
     * @param requestListener
     *            the listener to notify when the request will finish.
     */
    public <T> void execute(final SpiceRequest<T> request, final RequestListener<T> requestListener) {
        final CachedSpiceRequest<T> cachedSpiceRequest = new CachedSpiceRequest<T>(request, null, DurationInMillis.ALWAYS_RETURNED);
        execute(cachedSpiceRequest, requestListener);
    }

The javadoc says that the cache is never used, but the CachedSpiceRequest uses DurationInMillis.ALWAYS_RETURNED. Shouldn't it be DurationInMillis.ALWAYS_EXPIRED ?

Am I missing something?

Location: SpiceManger.java:443 Robospice 1.4.14

nkeskinov commented 9 years ago

It's irrelevant, actually, because you have a null cache key.