diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/util/PersistentToolkitNotification.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/util/PersistentToolkitNotification.java index a1f816c32..c586e71a2 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/util/PersistentToolkitNotification.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/util/PersistentToolkitNotification.java @@ -22,7 +22,8 @@ public final class PersistentToolkitNotification extends ToolkitNotification { private final Consumer checkboxCallback; - public PersistentToolkitNotification(Display display, String title, String description, Consumer checkboxCallback) { + public PersistentToolkitNotification(final Display display, final String title, + final String description, final Consumer checkboxCallback) { super(display, title, description); this.checkboxCallback = checkboxCallback; } @@ -63,7 +64,7 @@ protected void createContentArea(final Composite parent) { // make button text clickable checkboxLabel.addMouseListener(new MouseAdapter() { @Override - public void mouseUp(MouseEvent e) { + public void mouseUp(final MouseEvent e) { doNotShowCheckbox.setSelection(!doNotShowCheckbox.getSelection()); if (checkboxCallback != null) { checkboxCallback.accept(doNotShowCheckbox.getSelection()); @@ -73,7 +74,7 @@ public void mouseUp(MouseEvent e) { doNotShowCheckbox.addSelectionListener(new SelectionAdapter() { @Override - public void widgetSelected(SelectionEvent e) { + public void widgetSelected(final SelectionEvent e) { if (checkboxCallback != null) { checkboxCallback.accept(doNotShowCheckbox.getSelection()); } diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/util/ToolkitNotification.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/util/ToolkitNotification.java index 957bdf890..1363930b9 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/util/ToolkitNotification.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/util/ToolkitNotification.java @@ -43,6 +43,12 @@ private Image getInfoIcon() { return this.infoIcon; } + /** + * Creates the content area for the notification. + * Subclasses may override this method to customize the notification content. + * + * @param parent the parent composite + */ @Override protected void createContentArea(final Composite parent) { Composite container = new Composite(parent, SWT.NONE); @@ -59,12 +65,12 @@ protected void createContentArea(final Composite parent) { } @Override - protected String getPopupShellTitle() { + protected final String getPopupShellTitle() { return this.title; } @Override - protected void initializeBounds() { + protected final void initializeBounds() { Rectangle clArea = getPrimaryClientArea(); Point initialSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); int height = Math.max(initialSize.y, MIN_HEIGHT); @@ -105,7 +111,7 @@ private void repositionNotifications() { } @Override - public boolean close() { + public final boolean close() { activeNotifications.remove(this); repositionNotifications(); if (this.infoIcon != null && !this.infoIcon.isDisposed()) { diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/util/UpdateUtils.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/util/UpdateUtils.java index a1864c89b..a4cba356a 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/util/UpdateUtils.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/util/UpdateUtils.java @@ -20,9 +20,9 @@ import software.aws.toolkits.eclipse.amazonq.plugin.Activator; import software.aws.toolkits.eclipse.amazonq.telemetry.metadata.PluginClientMetadata; -public class UpdateUtils { +public final class UpdateUtils { //env for this link? - private static final String requestURL = "https://amazonq.eclipsetoolkit.amazonwebservices.com/artifacts.xml.xz"; + private static final String REQUESTURL = "https://amazonq.eclipsetoolkit.amazonwebservices.com/artifacts.xml.xz"; private static Version mostRecentNotificationVersion; private static Version remoteVersion; private static Version localVersion; @@ -40,7 +40,7 @@ private UpdateUtils() { private boolean newUpdateAvailable() { //fetch artifact file containing version info from repo - remoteVersion = fetchRemoteArtifactVersion(requestURL); + remoteVersion = fetchRemoteArtifactVersion(REQUESTURL); //return early if either version is unavailable if (remoteVersion == null || localVersion == null) { @@ -59,7 +59,7 @@ public void checkForUpdate() { } } - private Version fetchRemoteArtifactVersion(String repositoryUrl) { + private Version fetchRemoteArtifactVersion(final String repositoryUrl) { HttpURLConnection connection = null; try { URL url = new URL(repositoryUrl); @@ -116,7 +116,7 @@ private void showNotification() { }); } - private static boolean remoteVersionIsGreater(Version remote, Version local) { + private static boolean remoteVersionIsGreater(final Version remote, final Version local) { return remote.compareTo(local) > 0; } }