← Prev in month ← Prev in thread
Next in thread → Next in month →

Incorrect code in section 6.7.4 examples

From
Simon Nash <>
Date
2008-09-15T21:15:48+00:00
ID
Thread
Incorrect code in section 6.7.4 examples
TARGET: Java Common Annotations and APIs, WD 04, section 6.7.4

DESCRIPTION: Incorrect code in section 6.7.4 examples

1. On line 556, the getCallback() call should say getService().
    This is correct in line 548.

2. On line 567, the code shows the invocation of a static method
      ComponentContext.getRequestContext()
    This method isn't static and requires a ComponentContext instance
    that was set by injection.

PROPOSAL:

1. Replace line 556 by:

    MyCallback myCallback = callback.getService();

2. Replace lines 564 through 567 by:

    @Context ComponentContext context;

    public void someMethod() {

        MyCallback myCallback =
            context.getRequestContext().getCallback();
← Prev in month ← Prev in thread
Next in thread → Next in month →