File tree Expand file tree Collapse file tree 6 files changed +23
-27
lines changed
eclipse/plugin/views/snyktoolview
languageserver/protocolextension/messageObjects Expand file tree Collapse file tree 6 files changed +23
-27
lines changed Original file line number Diff line number Diff line change 1
1
# Snyk Security Changelog
2
2
3
+ ## [ 3.2.1]
4
+ ### Changes
5
+ - fixed compatibility with some older Eclipse versions, by removing GSON dependency
6
+
3
7
## [ 3.2.0]
4
8
### Changes
5
9
- Fixed Issue Status view filters for ignored issues not hiding non-shown issues in editor (early access).
Original file line number Diff line number Diff line change @@ -24,8 +24,7 @@ Require-Bundle: org.eclipse.ui,
24
24
org.eclipse.ui.editors,
25
25
org.eclipse.ui.genericeditor,
26
26
org.eclipse.swt,
27
- org.eclipse.jface,
28
- com.google.gson;bundle-version="2.11.0"
27
+ org.eclipse.jface
29
28
Automatic-Module-Name : io.snyk.eclipse.plugin.tests
30
29
Bundle-ActivationPolicy : lazy
31
30
Bundle-ClassPath : .,
Original file line number Diff line number Diff line change 23
23
import org .eclipse .ui .PlatformUI ;
24
24
import org .eclipse .ui .handlers .IHandlerService ;
25
25
26
- import com .google . gson . Gson ;
26
+ import com .fasterxml . jackson . databind . ObjectMapper ;
27
27
28
28
import io .snyk .eclipse .plugin .html .BaseHtmlProvider ;
29
29
import io .snyk .eclipse .plugin .html .HtmlProviderFactory ;
@@ -175,10 +175,16 @@ public CompletableFuture<Void> updateBrowserContent(TreeNode node) {
175
175
String errorJson = ptn .getErrorMessage ();
176
176
if (errorJson != null && !errorJson .isBlank ()) {
177
177
shouldShowDefaultMessage = false ;
178
- var error = new Gson ().fromJson (errorJson , ErrorMessage .class );
179
- String errorHtml = htmlProvider .getErrorHtml (error .error , error .path );
178
+ String errorHTML ;
179
+ try {
180
+ ErrorMessage errorMessage = new ObjectMapper ().readValue (errorJson , ErrorMessage .class );
181
+ errorHTML = htmlProvider .getErrorHtml (errorMessage .error , errorMessage .path );
182
+ } catch (Exception e ) {
183
+ errorHTML = htmlProvider .getErrorHtml ("Error: failed to display error" , "" );
184
+ }
185
+ final String errorHTMLFinal = errorHTML ;
180
186
Display .getDefault ().syncExec (() -> {
181
- browser .setText (errorHtml );
187
+ browser .setText (errorHTMLFinal );
182
188
});
183
189
}
184
190
}
Original file line number Diff line number Diff line change 2
2
3
3
import java .util .Map ;
4
4
5
- import com .google .gson .annotations .SerializedName ;
6
-
7
- public record Fix (
8
- @ SerializedName ("fixId" ) String fixId ,
9
- @ SerializedName ("unifiedDiffsPerFile" ) Map <String , String > unifiedDiffsPerFile ) {
5
+ public record Fix (
6
+ String fixId ,
7
+ Map <String , String > unifiedDiffsPerFile ) {
10
8
// no-arg constructor is generated automatically by Java compiler
11
- }
9
+ }
Original file line number Diff line number Diff line change 3
3
import java .util .ArrayList ;
4
4
import java .util .List ;
5
5
6
- import com .google .gson .annotations .SerializedName ;
7
-
8
6
public class FolderConfig {
9
7
10
- @ SerializedName ("folderPath" )
11
8
private String folderPath ;
12
9
13
- @ SerializedName ("baseBranch" )
14
10
private String baseBranch = "" ;
15
11
16
- @ SerializedName ("localBranches" )
17
12
private List <String > localBranches = new ArrayList <>();
18
13
19
- @ SerializedName ("additionalParameters" )
20
14
private List <String > additionalParameters = new ArrayList <>();
21
-
22
- @ SerializedName ("referenceFolderPath" )
15
+
23
16
private String referenceFolderPath = "" ;
24
-
25
- @ SerializedName ("scanCommandConfig" )
17
+
26
18
private ScanCommandConfig scanCommandConfig ;
27
19
28
20
public FolderConfig (String folderPath ) {
@@ -80,4 +72,4 @@ public ScanCommandConfig getScanCommandConfig() {
80
72
public void setScanCommandConfig (ScanCommandConfig scanCommandConfig ) {
81
73
this .scanCommandConfig = scanCommandConfig ;
82
74
}
83
- }
75
+ }
Original file line number Diff line number Diff line change 2
2
3
3
import java .util .List ;
4
4
5
- import com .google .gson .annotations .SerializedName ;
6
-
7
5
public class FolderConfigsParam {
8
6
9
- @ SerializedName ("folderConfigs" )
10
7
private List <FolderConfig > folderConfigs ;
11
8
12
9
public FolderConfigsParam (List <FolderConfig > folderConfigs ) {
@@ -20,4 +17,4 @@ public List<FolderConfig> getFolderConfigs() {
20
17
public void setFolderConfigs (List <FolderConfig > folderConfigs ) {
21
18
this .folderConfigs = folderConfigs ;
22
19
}
23
- }
20
+ }
You can’t perform that action at this time.
0 commit comments