mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Merge remote-tracking branch 'origin/GP-1543_Dan_lifespan-REBASED-1'
This commit is contained in:
commit
c8ac656430
349 changed files with 6102 additions and 4225 deletions
|
@ -20,6 +20,7 @@ import java.beans.PropertyChangeListener;
|
|||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.KeyStroke;
|
||||
|
@ -28,8 +29,6 @@ import org.apache.commons.collections4.IteratorUtils;
|
|||
import org.apache.commons.collections4.Predicate;
|
||||
import org.apache.commons.collections4.map.LazyMap;
|
||||
|
||||
import com.google.common.collect.Iterators;
|
||||
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.tool.util.DockingToolConstants;
|
||||
|
@ -282,21 +281,14 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
|
|||
}
|
||||
|
||||
private Iterator<DockingActionIf> getAllActionsIterator() {
|
||||
|
||||
// chain all items together, rather than copy the data
|
||||
Iterator<DockingActionIf> iterator = IteratorUtils.emptyIterator();
|
||||
Collection<Map<String, Set<DockingActionIf>>> maps = actionsByNameByOwner.values();
|
||||
for (Map<String, Set<DockingActionIf>> actionsByName : maps) {
|
||||
for (Set<DockingActionIf> actions : actionsByName.values()) {
|
||||
Iterator<DockingActionIf> next = actions.iterator();
|
||||
|
||||
// Note: do not use apache commons here--the code below degrades exponentially
|
||||
//iterator = IteratorUtils.chainedIterator(iterator, next);
|
||||
iterator = Iterators.concat(iterator, next);
|
||||
}
|
||||
}
|
||||
|
||||
return Iterators.concat(iterator, sharedActionMap.values().iterator());
|
||||
// Note: do not use Apache's IteratorUtils.chainedIterator. It degrades exponentially
|
||||
return Stream.concat(
|
||||
actionsByNameByOwner.values()
|
||||
.stream()
|
||||
.flatMap(actionsByName -> actionsByName.values().stream())
|
||||
.flatMap(actions -> actions.stream()),
|
||||
sharedActionMap.values().stream()).iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,13 +17,12 @@ package ghidra.docking.settings;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import javax.help.UnsupportedOperationException;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import ghidra.util.Msg;
|
||||
|
||||
/**
|
||||
|
@ -107,7 +106,7 @@ public class SettingsImpl implements Settings, Serializable {
|
|||
return false;
|
||||
}
|
||||
if (allowedSettingPredicate != null &&
|
||||
!allowedSettingPredicate.apply(settingsDefinition.getStorageKey())) {
|
||||
!allowedSettingPredicate.test(settingsDefinition.getStorageKey())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -124,7 +123,7 @@ public class SettingsImpl implements Settings, Serializable {
|
|||
return false;
|
||||
}
|
||||
if (name != null && allowedSettingPredicate != null &&
|
||||
!allowedSettingPredicate.apply(name)) {
|
||||
!allowedSettingPredicate.test(name)) {
|
||||
Msg.warn(this, "Ignored disallowed setting '" + name + "'");
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue