Do not consider compiler introduced methods when determining state class (#14003)

Change-Id: Ia2c3b8331f1ae34effceb0bb624cfaa7ba8578ed