Repository: nvaccess/nvda

Issue:
Java Access Bridge table cells should have the role of the control
<!-- Please read the text in this edit field before filling it in.
Please thoroughly read NVDA's wiki article on how to fill in this template, including how to provide the required files.
Issues may be closed if the required information is not present.
https://github.com/nvaccess/nvda/blob/master/devDocs/githubIssueTemplateExplanationAndExamples.md
Please also note that the NVDA project has a Citizen and Contributor Code of Conduct which can be found at https://github.com/nvaccess/nvda/blob/master/CODE_OF_CONDUCT.md. NV Access expects that all contributors and other community members read and abide by the rules set out in this document while participating or contributing to this project. This includes creating or commenting on issues and pull requests. 

Each of the questions and sections below start with multiple hash symbols (#). Place your answers and information on the blank line below each question.
-->

### Steps to reproduce:
In IntelliJ, PyCharm or may be other Jetbrains IDE, select a method in a class, in the menu go to Refactor -> Refactor this -> Extract superclass. In the dialog which appears there is a table for selecting the methods to extract, navigate up and down the first column.

### Actual behavior:
<!--
Use "Speak command keys" (NVDA+4) and speech viewer to copy and paste here. 
Use braille viewer to copy and paste here.
You may additionally include an explanation.
-->
NVDA speaks 0 or 1 depending on whether the method has been checked/selected.
### Expected behavior:
<!--
Use "Speak command keys" (NVDA+4) and speech viewer to copy and paste here. 
Use braille viewer to copy and paste here.
You may additionally include an explanation.
-->
As these are checkboxes NVDA should announce checked or unchecked state.
### NVDA logs, crash dumps and other attachments:

### System configuration
#### NVDA installed/portable/running from source:
Both installed and source builds.
#### NVDA version:
2022.3.1 and master.
#### Windows version:
Windows 11
#### Name and version of other software in use when reproducing the issue:
Java 17
#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your computer?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Both 2022.3.1 and master show the problem.
#### If NVDA add-ons are disabled, is your problem still occurring?
Yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
N/A


Discussion:

Resolving patch:
diff --git a/source/NVDAObjects/JAB/__init__.py b/source/NVDAObjects/JAB/__init__.py
--- a/source/NVDAObjects/JAB/__init__.py
+++ b/source/NVDAObjects/JAB/__init__.py
@@ -314,12 +314,14 @@ def _get_JABRole(self):
 
 	def _get_role(self):
 		role = JABRolesToNVDARoles.get(self.JABRole,controlTypes.Role.UNKNOWN)
-		if role in ( controlTypes.Role.LABEL, controlTypes.Role.PANEL) and self.parent:
+		if role in (controlTypes.Role.LABEL, controlTypes.Role.PANEL, controlTypes.Role.UNKNOWN) and self.parent:
 			parentRole = self.parent.role
 			if parentRole == controlTypes.Role.LIST:
 				return controlTypes.Role.LISTITEM
 			elif parentRole in (controlTypes.Role.TREEVIEW, controlTypes.Role.TREEVIEWITEM):
 				return controlTypes.Role.TREEVIEWITEM
+			elif parentRole == controlTypes.Role.TABLE:
+				return controlTypes.Role.TABLECELL
 		if role==controlTypes.Role.LABEL:
 			return controlTypes.Role.STATICTEXT
 		return role
@@ -651,8 +653,6 @@ def _get_tableID(self):
 
 class TableCell(JAB):
 
-	role=controlTypes.Role.TABLECELL
-
 	def _get_table(self):
 		if self.parent and isinstance(self.parent,Table):
 			self.table=self.parent


Test patch: