Skip to content

Commit a73b78e

Browse files
committed
optimization: avoid duplicate empty string array creations for every fix descriptor
1 parent 1954433 commit a73b78e

File tree

1 file changed

+4
-9
lines changed
  • headless-services/commons/commons-rewrite/src/main/java/org/springframework/ide/vscode/commons/rewrite/java

1 file changed

+4
-9
lines changed

headless-services/commons/commons-rewrite/src/main/java/org/springframework/ide/vscode/commons/rewrite/java/FixDescriptor.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2022, 2023 VMware, Inc.
2+
* Copyright (c) 2022, 2024 VMware, Inc.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -18,27 +18,22 @@
1818

1919
final public class FixDescriptor {
2020

21-
private String recipeId;
21+
private static final String[] EMPTY_STRING_ARRAY = new String[0];
2222

23+
private String recipeId;
2324
private RecipeScope recipeScope;
24-
2525
private Range rangeScope;
26-
2726
private List<String> docUris;
28-
2927
private Map<String, Object> parameters;
30-
3128
private String label;
32-
3329
private String[] typeStubs;
34-
3530
private boolean preferred;
3631

3732
public FixDescriptor(String recipeId, List<String> docUris, String label) {
3833
this.recipeId = recipeId;
3934
this.docUris = docUris;
4035
this.label = label;
41-
this.typeStubs = new String[0];
36+
this.typeStubs = EMPTY_STRING_ARRAY;
4237
}
4338

4439
public FixDescriptor withRecipeScope(RecipeScope recipeScope) {

0 commit comments

Comments
 (0)