@Nullable private static InjectionPlace[] dropKnownInvalidPlaces(InjectionPlace[] places) { InjectionPlace[] result = places; for (InjectionPlace place : places) { if (place.getText().contains("matches(\"[^${}/\\\\]+\")")) { result = ArrayUtil.remove(result, place); } } return places.length != 0 && result.length == 0 ? null : result; }
private void removeFromArray(int index) { myChildren = ArrayUtil.remove( myChildren, index, new ArrayFactory<VirtualFileSystemEntry>() { @NotNull @Override public VirtualFileSystemEntry[] create(int count) { return new VirtualFileSystemEntry[count]; } }); }
private static void removeIdFromParentList( final int parentId, final int id, @NotNull VirtualFile parent, VirtualFile file) { int[] childList = FSRecords.list(parentId); int index = ArrayUtil.indexOf(childList, id); if (index == -1) { throw new RuntimeException( "Cannot find child (" + id + ")" + file + "\n\tin (" + parentId + ")" + parent + "\n\tactual children:" + Arrays.toString(childList)); } childList = ArrayUtil.remove(childList, index); FSRecords.updateList(parentId, childList); }