mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
Remove redundant keySet/values calls
GitOrigin-RevId: e972012a4ead404120b0f947c79d059f6d96f942
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a1eecbd0ae
commit
d013c9980e
@@ -187,7 +187,7 @@ public final class HotSwapUIImpl extends HotSwapUI {
|
||||
}
|
||||
|
||||
HotSwapProgressImpl progress = new HotSwapProgressImpl(myProject);
|
||||
if (modifiedClasses.keySet().size() == 1) {
|
||||
if (modifiedClasses.size() == 1) {
|
||||
progress.setSessionForActions(ContainerUtil.getFirstItem(modifiedClasses.keySet()));
|
||||
}
|
||||
progress.addProgressListener(delegatingTo(statusListener, sessions, progress));
|
||||
|
||||
@@ -215,7 +215,7 @@ public class RootDetectionProcessor {
|
||||
private List<DetectedRootData> detectRoots() {
|
||||
Map<ProjectStructureDetector, List<DetectedProjectRoot>> roots = runDetectors();
|
||||
if (myProgressIndicator != null) {
|
||||
myProgressIndicator.setText2(JavaUiBundle.message("progress.text.processing.0.project.roots", roots.values().size()));
|
||||
myProgressIndicator.setText2(JavaUiBundle.message("progress.text.processing.0.project.roots", roots.size()));
|
||||
}
|
||||
|
||||
Map<File, DetectedRootData> rootData = new LinkedHashMap<>();
|
||||
|
||||
@@ -86,7 +86,7 @@ public abstract class RedundantSuppressInspectionBase extends GlobalSimpleInspec
|
||||
}
|
||||
});
|
||||
|
||||
if (suppressedScopes.values().isEmpty()) return ProblemDescriptor.EMPTY_ARRAY;
|
||||
if (suppressedScopes.isEmpty()) return ProblemDescriptor.EMPTY_ARRAY;
|
||||
// have to visit all file from scratch since inspections can be written in any pervasive way including checkFile() overriding
|
||||
Map<InspectionToolWrapper<?, ?>, String> suppressedTools = new HashMap<>();
|
||||
List<InspectionToolWrapper<?, ?>> toolWrappers = getInspectionTools(psiFile, profile);
|
||||
|
||||
@@ -167,7 +167,7 @@ public final class GridImpl extends Wrapper implements Grid, Disposable, UiDataP
|
||||
}
|
||||
|
||||
public ActionCallback restoreLastUiState() {
|
||||
final ActionCallback result = new ActionCallback(myPlaceInGrid2Cell.values().size());
|
||||
final ActionCallback result = new ActionCallback(myPlaceInGrid2Cell.size());
|
||||
for (final GridCellImpl cell : myPlaceInGrid2Cell.values()) {
|
||||
cell.restoreLastUiState().notifyWhenDone(result);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class ExternalSystemTasksTree extends Tree implements Supplier<ExternalTa
|
||||
}
|
||||
|
||||
// Disable tasks execution if it comes from different projects
|
||||
if(map.values().size() != 1) return null;
|
||||
if(map.size() != 1) return null;
|
||||
return map.values().iterator().next();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public final class OfflineInspectionRVContentProvider extends InspectionRVConten
|
||||
public boolean checkReportedProblems(@NotNull GlobalInspectionContextImpl context,
|
||||
final @NotNull InspectionToolWrapper toolWrapper) {
|
||||
final Map<String, Set<OfflineProblemDescriptor>> content = getFilteredContent(context, toolWrapper);
|
||||
return content != null && !content.values().isEmpty();
|
||||
return content != null && !content.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,7 +62,7 @@ public final class OfflineInspectionRVContentProvider extends InspectionRVConten
|
||||
@NotNull Function<? super RefEntity, CommonProblemDescriptor[]> problems) {
|
||||
final Map<String, Set<OfflineProblemDescriptor>> filteredContent = getFilteredContent(context, wrapper);
|
||||
InspectionResultsView view = context.getView();
|
||||
if (filteredContent != null && !filteredContent.values().isEmpty()) {
|
||||
if (filteredContent != null && !filteredContent.isEmpty()) {
|
||||
buildTree(context, filteredContent, wrapper, descriptor -> {
|
||||
final RefEntity element = descriptor.getRefElement(context.getRefManager());
|
||||
return new RefEntityContainer<OfflineProblemDescriptor>(element, new OfflineProblemDescriptor[] {descriptor}) {
|
||||
|
||||
@@ -217,8 +217,8 @@ public final class ImportFromToImportIntention extends PyBaseIntentionAction {
|
||||
} while (feeler != null);
|
||||
String top_name = top_qualifier.getName();
|
||||
Collection<PsiReference> possible_targets = references.keySet();
|
||||
if (star_references.size() > 0) {
|
||||
possible_targets = new ArrayList<>(references.keySet().size() + star_references.size());
|
||||
if (!star_references.isEmpty()) {
|
||||
possible_targets = new ArrayList<>(references.size() + star_references.size());
|
||||
possible_targets.addAll(references.keySet());
|
||||
possible_targets.addAll(star_references);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class PyTypeParserTest extends PyTestCase {
|
||||
myFixture.configureByFile("typeParser/typeParser.py");
|
||||
final String s = "list of (MyObject, collections.Iterable of MyObject, int) or None";
|
||||
PyTypeParser.ParseResult result = PyTypeParser.parse(myFixture.getFile(), s);
|
||||
assertEquals(7, result.getTypes().values().size());
|
||||
assertEquals(7, result.getTypes().size());
|
||||
}
|
||||
|
||||
public void testGenericType() {
|
||||
|
||||
Reference in New Issue
Block a user