Skip to content

Commit

Permalink
Fix warnings from use of older code style
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlwilson committed Apr 14, 2024
1 parent 1501176 commit fc21140
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {

apply from: 'plugin-helpers.gradle'

project.ext.pluginVersion = '1.7.3'
project.ext.pluginVersion = '1.8.0'
project.ext.fullVersion = project.git.distVersion() ? "${project.pluginVersion}-${project.git.distVersion()}" : project.pluginVersion

project.ext.pluginDesc = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -45,7 +46,7 @@ public String pluginId() {

@Override
public List<String> pollerPluginIds() {
return null;
return Collections.emptyList();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import static com.tw.go.plugin.setting.DefaultPluginConfigurationView.*;
import static com.tw.go.plugin.util.ValidationUtils.getValidationError;
import static java.util.Collections.singletonList;

public class GerritProvider extends DefaultProvider {

Expand Down Expand Up @@ -61,7 +60,7 @@ public String pluginId() {

@Override
public List<String> pollerPluginIds() {
return singletonList(GERRIT_CS_POLLER_PLUGIN_ID);
return List.of(GERRIT_CS_POLLER_PLUGIN_ID);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.util.Map;

import static com.tw.go.plugin.BuildStatusNotifierPlugin.PLUGIN_SETTINGS_GET_CONFIGURATION;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
import static org.mockito.MockitoAnnotations.openMocks;
Expand All @@ -61,7 +60,7 @@ public void setUp() {
pluginSettingsResponse.setResponseBody(JSONUtils.toJSON(new HashMap<String, String>()));
when(goApplicationAccessor.submit(any(GoApiRequest.class))).thenReturn(pluginSettingsResponse);
when(provider.pluginId()).thenReturn(PLUGIN_ID);
when(provider.pollerPluginIds()).thenReturn(singletonList(POLLER_PLUGIN_ID));
when(provider.pollerPluginIds()).thenReturn(List.of(POLLER_PLUGIN_ID));

plugin.initializeGoApplicationAccessor(goApplicationAccessor);
plugin.setProvider(provider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import java.util.List;
import java.util.Map;

import static java.util.Collections.singletonList;

public class GitHubProvider extends DefaultProvider {
private static final Logger LOGGER = Logger.getLoggerFor(GitHubProvider.class);
public static final String PLUGIN_ID = "github.pr.status";
Expand All @@ -46,7 +44,7 @@ public String pluginId() {

@Override
public List<String> pollerPluginIds() {
return singletonList(GITHUB_PR_POLLER_PLUGIN_ID);
return List.of(GITHUB_PR_POLLER_PLUGIN_ID);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.util.Map;

import static com.tw.go.plugin.BuildStatusNotifierPlugin.PLUGIN_SETTINGS_GET_CONFIGURATION;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
import static org.mockito.MockitoAnnotations.openMocks;
Expand All @@ -61,7 +60,7 @@ public void setUp() {
pluginSettingsResponse.setResponseBody(JSONUtils.toJSON(new HashMap<String, String>()));
when(goApplicationAccessor.submit(any(GoApiRequest.class))).thenReturn(pluginSettingsResponse);
when(provider.pluginId()).thenReturn(PLUGIN_ID);
when(provider.pollerPluginIds()).thenReturn(singletonList(POLLER_PLUGIN_ID));
when(provider.pollerPluginIds()).thenReturn(List.of(POLLER_PLUGIN_ID));

plugin.initializeGoApplicationAccessor(goApplicationAccessor);
plugin.setProvider(provider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@

import static com.tw.go.plugin.setting.DefaultPluginConfigurationView.*;
import static com.tw.go.plugin.util.ValidationUtils.getValidationError;
import static java.util.Collections.unmodifiableList;

public class GitLabProvider extends DefaultProvider {
private static Logger LOGGER = Logger.getLoggerFor(GitLabProvider.class);
private static final Logger LOGGER = Logger.getLoggerFor(GitLabProvider.class);

private static final String PLUGIN_ID = "gitlab.mr.status";
private static final String GITLAB_FB_POLLER_PLUGIN_ID = "git.fb";
private static final String GITLAB_POLLER_PLUGIN_ID = "gitlab.pr";
private static final List<String> POLLER_PLUGINS = unmodifiableList(new ArrayList<String>() {{
add(GITLAB_FB_POLLER_PLUGIN_ID);
add(GITLAB_POLLER_PLUGIN_ID);
}});

public GitLabProvider() {
super(new GitlLabConfigurationView());
Expand All @@ -40,7 +35,7 @@ public String pluginId() {

@Override
public List<String> pollerPluginIds() {
return POLLER_PLUGINS;
return List.of(GITLAB_FB_POLLER_PLUGIN_ID, GITLAB_POLLER_PLUGIN_ID);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import java.util.List;
import java.util.Map;

import static java.util.Collections.singletonList;

public class StashProvider extends DefaultProvider {
public static final String PLUGIN_ID = "stash.pr.status";
public static final String STASH_PR_POLLER_PLUGIN_ID = "stash.pr";
Expand Down Expand Up @@ -57,7 +55,7 @@ public String pluginId() {

@Override
public List<String> pollerPluginIds() {
return singletonList(STASH_PR_POLLER_PLUGIN_ID);
return List.of(STASH_PR_POLLER_PLUGIN_ID);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.util.Map;

import static com.tw.go.plugin.BuildStatusNotifierPlugin.PLUGIN_SETTINGS_GET_CONFIGURATION;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
import static org.mockito.MockitoAnnotations.openMocks;
Expand All @@ -62,7 +61,7 @@ public void setUp() {
pluginSettingsResponse.setResponseBody(JSONUtils.toJSON(new HashMap<String, String>()));
when(goApplicationAccessor.submit(any(GoApiRequest.class))).thenReturn(pluginSettingsResponse);
when(provider.pluginId()).thenReturn(PLUGIN_ID);
when(provider.pollerPluginIds()).thenReturn(singletonList(POLLER_PLUGIN_ID));
when(provider.pollerPluginIds()).thenReturn(List.of(POLLER_PLUGIN_ID));

plugin.initializeGoApplicationAccessor(goApplicationAccessor);
plugin.setProvider(provider);
Expand Down

0 comments on commit fc21140

Please sign in to comment.