Skip to content

Modernize Java idioms, fix NPEs, clean up redundancies#17

Merged
unknowIfGuestInDream merged 2 commits into
masterfrom
copilot/refactor-project-code
Feb 28, 2026
Merged

Modernize Java idioms, fix NPEs, clean up redundancies#17
unknowIfGuestInDream merged 2 commits into
masterfrom
copilot/refactor-project-code

Conversation

Copilot AI commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Code quality pass across the plugin: fix potential null dereferences, replace pre-generics patterns with modern Java, and remove dead/duplicate code.

Bug fixes

  • FullScreenActionDelegate.execute() / EscActionDelegate.execute()Display.getDefault().getActiveShell() can return null; added null guards to prevent NPE

Code modernization (Activator.java)

  • Index-based for loops → enhanced for-each
  • Unnecessary (Control) / (Menu) casts on already-typed generics removed
  • Anonymous IPropertyChangeListener and Runnable → lambdas
  • Removed redundant local in preferences()

Duplicate code elimination (FullscreenHandlerService)

  • Extracted shared getFullscreenCommand() helper; command ID → constant
  • @SuppressWarnings("restriction") moved to class level (both methods use internal API)
  • Removed unnecessary (ICommandService) cast

Error handling (FullScreenPreferencePage)

  • Empty catch (IOException e) {} → logs via Activator.getDefault().getLog()

Manifest cleanup

  • Removed deprecated Eclipse-LazyStart: true (redundant with existing Bundle-ActivationPolicy: lazy)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…cated header, log errors, extract duplicate code

Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize and fix issues in project code Modernize Java idioms, fix NPEs, clean up redundancies Feb 28, 2026
@unknowIfGuestInDream unknowIfGuestInDream merged commit 75b5fc2 into master Feb 28, 2026
7 checks passed
@unknowIfGuestInDream unknowIfGuestInDream deleted the copilot/refactor-project-code branch February 28, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants