Skip to content

Commit 3051346

Browse files
committed
fix plugin checkstyle issues
1 parent 1121839 commit 3051346

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

plugin/src/software/aws/toolkits/eclipse/amazonq/lsp/manager/DefaultLspManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public LspInstallation getLspInstallation() {
6060
}
6161
}
6262

63-
private static void makeExecutable(final Path filePath, PluginPlatform platform) throws IOException {
63+
private static void makeExecutable(final Path filePath, final PluginPlatform platform) throws IOException {
6464
// don't set file permissions for windows as it has issues using the executable
6565
// otherwise
6666
if (platform == PluginPlatform.WINDOWS) {

plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQChatWebview.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,25 @@ public Object function(final Object[] arguments) {
5757
}
5858

5959
private String getContent() {
60-
String jsFile = PluginUtils.getAwsDirectory(LspConstants.LSP_SUBDIRECTORY).resolve("amazonq-ui.js").toString();
60+
String jsFile = PluginUtils.getAwsDirectory(LspConstants.LSP_SUBDIRECTORY).resolve("amazonq-ui.js").toString();
6161
var jsParent = Path.of(jsFile).getParent();
6262
var jsDirectoryPath = Path.of(jsParent.toUri()).normalize().toString();
63-
63+
6464
server = setupVirtualServer(jsDirectoryPath);
6565
if (server == null) {
66-
return "Failed to load JS";
66+
return "Failed to load JS";
6767
}
68-
69-
var chatJsPath = server.getURI().toString()+"amazonq-ui.js";
68+
69+
var chatJsPath = server.getURI().toString() + "amazonq-ui.js";
7070
return String.format("<!DOCTYPE html>\n"
7171
+ "<html lang=\"en\">\n"
7272
+ "<head>\n"
7373
+ " <meta charset=\"UTF-8\">\n"
7474
+ " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n"
7575
+ " <meta \n"
7676
+ " http-equiv=\"\"Content-Security-Policy\"\" \n"
77-
+ " content=\"\"default-src 'none'; script-src %s 'unsafe-inline'; style-src {javascriptFilePath} 'unsafe-inline'; img-src 'self' data:; object-src 'none'; base-uri 'none'; upgrade-insecure-requests;\"\"\n"
77+
+ " content=\"\"default-src 'none'; script-src %s 'unsafe-inline'; style-src {javascriptFilePath} 'unsafe-inline';"
78+
+ " img-src 'self' data:; object-src 'none'; base-uri 'none'; upgrade-insecure-requests;\"\"\n"
7879
+ " >"
7980
+ " <title>Chat UI</title>\n"
8081
+ " %s\n"
@@ -129,11 +130,10 @@ protected final void handleAuthStatusChange(final boolean isLoggedIn) {
129130
}
130131
});
131132
}
132-
133+
133134
@Override
134-
public void dispose() {
135+
public final void dispose() {
135136
stopVirtualServer(server);
136137
super.dispose();
137138
}
138-
139139
}

plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQView.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,17 @@ private void setupAuthStatusListeners() {
111111
}
112112

113113
/**
114-
* Sets up virtual host mapping for the given path using jetty server
115-
*
114+
* Sets up virtual host mapping for the given path using Jetty server.
116115
* @param jsPath
117116
* @return server launched
118117
*/
119-
protected Server setupVirtualServer(String jsPath) {
118+
protected Server setupVirtualServer(final String jsPath) {
120119
Server server = null;
121120
try {
122121
server = new Server(0);
123122
var servletContext = new ContextHandler();
124123
servletContext.setContextPath("/");
125-
servletContext.addVirtualHosts(new String[] { "localhost" });
124+
servletContext.addVirtualHosts(new String[] {"localhost"});
126125

127126
var handler = new ResourceHandler();
128127

@@ -143,7 +142,7 @@ protected Server setupVirtualServer(String jsPath) {
143142
}
144143
}
145144

146-
protected void stopVirtualServer(Server server) {
145+
protected final void stopVirtualServer(final Server server) {
147146
if (server != null) {
148147
try {
149148
server.stop();

plugin/src/software/aws/toolkits/eclipse/amazonq/views/ToolkitLoginWebview.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected void handleAuthStatusChange(final boolean isLoggedIn) {
5757
Display.getDefault().asyncExec(() -> {
5858
amazonQCommonActions.updateActionVisibility(isLoggedIn, getViewSite());
5959
if (!isLoggedIn) {
60-
browser.setText(getContent());
60+
browser.setText(getContent());
6161
} else {
6262
browser.setText("Signed in");
6363
AmazonQView.showView(AmazonQChatWebview.ID);
@@ -70,13 +70,13 @@ private String getContent() {
7070
URL jsFile = PluginUtils.getResource("webview/build/assets/js/getStart.js");
7171
var jsParent = Path.of(jsFile.toURI()).getParent();
7272
var jsDirectoryPath = Path.of(jsParent.toUri()).normalize().toString();
73-
73+
7474
server = setupVirtualServer(jsDirectoryPath);
7575
if (server == null) {
76-
return "Failed to load JS";
76+
return "Failed to load JS";
7777
}
78-
var loginJsPath = server.getURI().toString()+"getStart.js";
79-
78+
var loginJsPath = server.getURI().toString() + "getStart.js";
79+
8080
return String.format("<!DOCTYPE html>\n"
8181
+ "<html>\n"
8282
+ " <head>\n"
@@ -101,7 +101,7 @@ private String getContent() {
101101
return "Failed to load JS";
102102
}
103103
}
104-
104+
105105
@Override
106106
public void dispose() {
107107
stopVirtualServer(server);

0 commit comments

Comments
 (0)