Skip to content

Conversation

@LowriJenkins
Copy link
Contributor

Description of work

Add your own description here

Ticket

Link to Ticket

Acceptance criteria

List the acceptance criteria for the PR. The aim is provide information to help the reviewer

Unit tests

Give an overview of unit tests you have added or modified, if applicable. The aim is provide information to help the reviewer

System tests

Mention any automated tests or manual tests that you have added or modified, if applicable. The aim is provide information to help the reviewer

Documentation

Highlight and provide a link to any additions or changes to the documentation, if applicable. The aim is provide information to help the reviewer


Code Review

Final Steps

public class CheckboxLabelProviderTest {


public class mockSelectionListener implements Listener {

Check notice

Code scanning / CodeQL

Inner class could be static Note test

mockSelectionListener should be made static, since the enclosing instance is not used.

Copilot Autofix

AI 6 days ago

To fix the problem, the inner class mockSelectionListener should be made static. This can be done by adding the static keyword to its declaration inside CheckboxLabelProviderTest. This change will prevent all instances of mockSelectionListener from implicitly storing a reference to the outer CheckboxLabelProviderTest instance, improving memory usage and code clarity. Make sure to only modify the class declaration at line 52 in the provided file; since the class itself does not use outer class members, no further changes are needed elsewhere.

Suggested changeset 1
base/uk.ac.stfc.isis.ibex.ui.configserver.tests/src/uk/ac/stfc/isis/ibex/ui/configserver/tests/CheckboxLabelProviderTest.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/base/uk.ac.stfc.isis.ibex.ui.configserver.tests/src/uk/ac/stfc/isis/ibex/ui/configserver/tests/CheckboxLabelProviderTest.java b/base/uk.ac.stfc.isis.ibex.ui.configserver.tests/src/uk/ac/stfc/isis/ibex/ui/configserver/tests/CheckboxLabelProviderTest.java
--- a/base/uk.ac.stfc.isis.ibex.ui.configserver.tests/src/uk/ac/stfc/isis/ibex/ui/configserver/tests/CheckboxLabelProviderTest.java
+++ b/base/uk.ac.stfc.isis.ibex.ui.configserver.tests/src/uk/ac/stfc/isis/ibex/ui/configserver/tests/CheckboxLabelProviderTest.java
@@ -49,7 +49,7 @@
  */
 public class CheckboxLabelProviderTest {
 	
-	public class mockSelectionListener implements Listener {
+	public static class mockSelectionListener implements Listener {
 		private EventListener eventListener;
 		@Override
 		public void handleEvent(Event event) {
EOF
@@ -49,7 +49,7 @@
*/
public class CheckboxLabelProviderTest {

public class mockSelectionListener implements Listener {
public static class mockSelectionListener implements Listener {
private EventListener eventListener;
@Override
public void handleEvent(Event event) {
Copilot is powered by AI and may make mistakes. Always verify output.
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