mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
GP-5577 avoid indexing large projects
This commit is contained in:
parent
2c5669dbd0
commit
96e0532f8d
2 changed files with 6 additions and 5 deletions
|
@ -20,6 +20,7 @@ import java.util.*;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
import ghidra.formats.gfilesystem.FSRL;
|
import ghidra.formats.gfilesystem.FSRL;
|
||||||
|
import ghidra.framework.main.datatable.ProjectDataTablePanel;
|
||||||
import ghidra.framework.model.*;
|
import ghidra.framework.model.*;
|
||||||
import ghidra.util.Swing;
|
import ghidra.util.Swing;
|
||||||
import ghidra.util.task.TaskMonitor;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
@ -119,7 +120,7 @@ public class ProjectIndexService implements DomainFolderChangeListener {
|
||||||
|
|
||||||
private void indexProject(ProjectData projectData, TaskMonitor monitor) {
|
private void indexProject(ProjectData projectData, TaskMonitor monitor) {
|
||||||
int fileCount = projectData.getFileCount();
|
int fileCount = projectData.getFileCount();
|
||||||
if (fileCount < 0) {
|
if (fileCount < 0 || fileCount > ProjectDataTablePanel.MAX_FILE_COUNT) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
monitor.initialize(fileCount, "Indexing Project Metadata");
|
monitor.initialize(fileCount, "Indexing Project Metadata");
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class ProjectDataTablePanel extends JPanel {
|
||||||
|
|
||||||
private static final String MAX_FILE_COUNT_PROPERTY = "ProjectDataTable.maxFileCount";
|
private static final String MAX_FILE_COUNT_PROPERTY = "ProjectDataTable.maxFileCount";
|
||||||
private static final int MAX_FILE_COUNT_DEFAULT = 2000;
|
private static final int MAX_FILE_COUNT_DEFAULT = 2000;
|
||||||
private static int maxFileCount = loadMaxFileCount();
|
public static final int MAX_FILE_COUNT = loadMaxFileCount();
|
||||||
|
|
||||||
private FrontEndPlugin plugin;
|
private FrontEndPlugin plugin;
|
||||||
private PluginTool tool;
|
private PluginTool tool;
|
||||||
|
@ -190,7 +190,7 @@ public class ProjectDataTablePanel extends JPanel {
|
||||||
|
|
||||||
int fileCount = projectData.getFileCount();
|
int fileCount = projectData.getFileCount();
|
||||||
|
|
||||||
if (fileCount < 0 || fileCount > maxFileCount) {
|
if (fileCount < 0 || fileCount > MAX_FILE_COUNT) {
|
||||||
capacityExceeded = true;
|
capacityExceeded = true;
|
||||||
this.projectData.removeDomainFolderChangeListener(changeListener);
|
this.projectData.removeDomainFolderChangeListener(changeListener);
|
||||||
model.setProjectData(null);
|
model.setProjectData(null);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue