Deprecation of getTable()

Bringing an application up from Applinx 5.2.5 to 8.2.2, I get a deprecation warning. (bunches, actually)
Here is a code snippet:

package contexts;
import com.sabratec.applinx.baseobject.table.*;
import com.sabratec.applinx.common.generate.GXTableSerializer;
public class Chn_excel extends GXBasicContext
public void gx_onLoad() {
super.gx_onLoad() ;
GXITable gx_table = null;
/// Retrieving A table stored in the http session
Object obj = getSession().getAttribute(EXCEL_TABLE_SESSION_KEY);
if (obj != null){
gx_table = (GXITable)obj;
gx_table = getGXSession().getTable();

How can I fix this easily? Any help will be appreciated.

It is replaced by:


Can you tell me how it would fit into the attached? (5.62 KB)

It’s a little hard to look at the code without the context but basically it should be this, in the else caluse:
gx_table = getGXSession().getScreen().getTables()[0];

Great! Thanks so much for your help, it works fine. Removes several hundred deprecation warnings for me.