Modify ↓

Opened 3 days ago

Closed 3 days ago

#24949 closed defect (duplicate)

refactor: return empty array instead of null in getSelectedDirection

Reported by: DanProgs <Abenteurer.2901@…> Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description

Changes the getSelectedDirection method to return an empty array
instead of null when no valid direction is found. This avoids potential
NullPointerExceptions and follows the Null Object Pattern.

  • Updated getSelectedDirection to reuse a static EMPTY_DIRECTION constant
  • Adjusted actionPerformed and updateEnabledState to check for array length
  • Fixed unit test to assert an empty array instead of null

Attachments (1)

24949.patch​ (4.0 KB ) - added by DanProgs <Abenteurer.2901@…> 3 days ago.

Download all attachments as: .zip

Change History (3)

by DanProgs <Abenteurer.2901@…>, 3 days ago

Attachment: 24949.patch​ added

comment:1 by wangi, 3 days ago

This was code I added, I've addressed this in the patch attached to #24951.

comment:2 by wangi, 3 days ago

Resolution: → duplicate
Status: new → closed

Closed as duplicate of #24951.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.