arquillian / continuous-enterprise-development

Testable Solutions for Modern Applications
http://continuousdev.org/
116 stars 150 forks source link

RESTinterceptorEnabler - phantom variable #94

Closed johnament closed 11 years ago

johnament commented 11 years ago

In this code block:

@REST
@Interceptor
public class RESTInterceptorEnabler {

    @Inject
    private Instance<RESTInterceptor> instances;

    @AroundInvoke
    public Object intercept(final InvocationContext context) throws Exception {
        final List<RESTInterceptor> interceptors = sort(instances);
        InvocationContext wraped = new InvocationContext() {
            // Omitted for brevity
         }
        return wraped.proceed();

    }
...
}

The "wraped" (what does that even mean?) variable is never defined, as such as a reader with 0 knowledge about REST I have no clue what you're doing here.

aslakknutsen commented 11 years ago
InvocationContext wraped = new InovocationContext() {}
return wraped.proceed().
johnament commented 11 years ago

I'm blind. Thank you.

Though, I think you should call it "wrapped" to be clearer.

ALRubinger commented 11 years ago

Still needs to be "wrapped", not "wraped".

aslakknutsen commented 11 years ago

Correct, the Code is fixed.. It'll be fixed in the example when ever you setup the auto import snippets.. :)

https://github.com/arquillian/continuous-enterprise-development/blob/master/code/application/web/rest/core/src/main/java/org/cedj/geekseek/web/rest/core/interceptor/RESTInterceptorEnabler.java

ALRubinger commented 11 years ago

Auto-import not gonna happen...too often I edit the code for the book text to snip out irrelevant stuff or format differently for print. :) On Sep 9, 2013 8:13 AM, "Aslak Knutsen" notifications@github.com wrote:

Correct, the Code is fixed.. It'll be fixed in the example when ever you setup the auto import snippets.. :)

https://github.com/arquillian/continuous-enterprise-development/blob/master/code/application/web/rest/core/src/main/java/org/cedj/geekseek/web/rest/core/interceptor/RESTInterceptorEnabler.java

— Reply to this email directly or view it on GitHubhttps://github.com/arquillian/continuous-enterprise-development/issues/94#issuecomment-24068143 .