Skip to content

Commit

Permalink
optimization: avoid duplicate empty string array creations for every …
Browse files Browse the repository at this point in the history
…fix descriptor
  • Loading branch information
martinlippert committed Nov 19, 2024
1 parent 1954433 commit a73b78e
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022, 2023 VMware, Inc.
* Copyright (c) 2022, 2024 VMware, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -18,27 +18,22 @@

final public class FixDescriptor {

private String recipeId;
private static final String[] EMPTY_STRING_ARRAY = new String[0];

private String recipeId;
private RecipeScope recipeScope;

private Range rangeScope;

private List<String> docUris;

private Map<String, Object> parameters;

private String label;

private String[] typeStubs;

private boolean preferred;

public FixDescriptor(String recipeId, List<String> docUris, String label) {
this.recipeId = recipeId;
this.docUris = docUris;
this.label = label;
this.typeStubs = new String[0];
this.typeStubs = EMPTY_STRING_ARRAY;
}

public FixDescriptor withRecipeScope(RecipeScope recipeScope) {
Expand Down

0 comments on commit a73b78e

Please sign in to comment.