mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
Empty array constant used
This commit is contained in:
@@ -22,7 +22,6 @@ import com.intellij.openapi.util.TextRange;
|
||||
import java.util.EventObject;
|
||||
|
||||
public class SelectionEvent extends EventObject {
|
||||
private static final TextRange[] EMPTY_RANGES = new TextRange[0];
|
||||
private final Pair<TextRange[], TextRange> myOldRanges;
|
||||
private final Pair<TextRange[], TextRange> myNewRanges;
|
||||
|
||||
@@ -70,7 +69,7 @@ public class SelectionEvent extends EventObject {
|
||||
|
||||
private static Pair<TextRange[], TextRange> getRanges(int[] starts, int[] ends) {
|
||||
if (starts.length == 0) {
|
||||
return Pair.create(EMPTY_RANGES, TextRange.EMPTY_RANGE);
|
||||
return Pair.create(TextRange.EMPTY_ARRAY, TextRange.EMPTY_RANGE);
|
||||
}
|
||||
final TextRange[] ranges = new TextRange[starts.length];
|
||||
int startOffset = Integer.MAX_VALUE;
|
||||
|
||||
@@ -180,7 +180,7 @@ public class PsiElementListNavigator {
|
||||
listUpdaterTask.init(popup, new ListComponentUpdater() {
|
||||
@Override
|
||||
public void replaceModel(@NotNull List<? extends PsiElement> data) {
|
||||
updatedTargetsList.set(data.toArray(new NavigatablePsiElement[0]));
|
||||
updatedTargetsList.set(data.toArray(NavigatablePsiElement.EMPTY_NAVIGATABLE_ELEMENT_ARRAY));
|
||||
popupUpdater.replaceModel(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ public class SelectTemplateDialog extends DialogWrapper {
|
||||
else {
|
||||
TreePath[] paths = existingTemplatesComponent.getPatternTree().getSelectionModel().getSelectionPaths();
|
||||
if (paths == null) {
|
||||
return new Configuration[0];
|
||||
return Configuration.EMPTY_ARRAY;
|
||||
}
|
||||
Collection<Configuration> configurations = new ArrayList<>();
|
||||
for (TreePath path : paths) {
|
||||
@@ -289,7 +289,7 @@ public class SelectTemplateDialog extends DialogWrapper {
|
||||
configurations.add((Configuration)userObject);
|
||||
}
|
||||
}
|
||||
return configurations.toArray(new Configuration[0]);
|
||||
return configurations.toArray(Configuration.EMPTY_ARRAY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -490,7 +490,7 @@ public class CharArrayUtil {
|
||||
if (lastTextFound < result.size()) {
|
||||
result = result.subList(0, lastTextFound);
|
||||
}
|
||||
return result.toArray(new TextRange[0]);
|
||||
return result.toArray(TextRange.EMPTY_ARRAY);
|
||||
}
|
||||
|
||||
public static boolean containLineBreaks(@NotNull CharSequence seq) {
|
||||
|
||||
@@ -43,8 +43,8 @@ import javax.swing.tree.DefaultTreeModel;
|
||||
import javax.swing.tree.TreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class CvsTree extends JPanel implements CvsTabbedWindow.DeactivateListener, ChildrenLoader<CvsElement> {
|
||||
private CvsElement[] myCurrentSelection = CvsElement.EMPTY_ARRAY;
|
||||
@@ -104,7 +104,7 @@ public class CvsTree extends JPanel implements CvsTabbedWindow.DeactivateListene
|
||||
selection.add(cvsElement);
|
||||
}
|
||||
}
|
||||
myCurrentSelection = selection.toArray(new CvsElement[0]);
|
||||
myCurrentSelection = selection.toArray(CvsElement.EMPTY_ARRAY);
|
||||
mySelectionObservable.notifyObservers(SELECTION_CHANGED);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ public class GithubRepository extends BaseRepositoryImpl {
|
||||
return getIssues(query, offset + limit, withClosed);
|
||||
}
|
||||
catch (GithubRateLimitExceededException e) {
|
||||
return new Task[0];
|
||||
return Task.EMPTY_ARRAY;
|
||||
}
|
||||
catch (GithubAuthenticationException | GithubStatusCodeException e) {
|
||||
throw new Exception(e.getMessage(), e); // Wrap to show error message
|
||||
|
||||
@@ -71,7 +71,7 @@ public class FormEditorErrorCollector extends FormErrorCollector {
|
||||
|
||||
final ErrorInfo errorInfo = new ErrorInfo(myComponent, prop == null ? null : prop.getName(), errorMessage,
|
||||
myProfile.getErrorLevel(HighlightDisplayKey.find(inspectionId), myFormPsiFile),
|
||||
quickFixes.toArray(new QuickFix[0]));
|
||||
quickFixes.toArray(QuickFix.EMPTY_ARRAY));
|
||||
errorInfo.setInspectionId(inspectionId);
|
||||
myResults.add(errorInfo);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class XmlSurroundDescriptor implements SurroundDescriptor {
|
||||
|
||||
@Override
|
||||
@NotNull public Surrounder[] getSurrounders() {
|
||||
return new Surrounder[0]; //everything is in live templates now
|
||||
return Surrounder.EMPTY_ARRAY; //everything is in live templates now
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -227,7 +227,7 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag, HintedReferenc
|
||||
list.add(TextRange.from(psi.getStartOffsetInParent(), psi.getTextLength()));
|
||||
}
|
||||
}
|
||||
myTextElements = elements = list.toArray(new TextRange[0]);
|
||||
myTextElements = elements = list.toArray(TextRange.EMPTY_ARRAY);
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user