NationalSecurityAgency/ghidra · error · IllegalArgumentException

Unsupported value: {}

Error message

Unsupported value: {}

What it means

Ghidra ChoicesPropertyEditor.setValue(Object) rejects a value not contained in the choices collection given at construction. choices is a distinct, deduplicated list and membership uses Object.equals, so an equal-by-content but different-type object (or null not in the set) is rejected. Throws IllegalArgumentException before mutating state.

Source

Thrown at Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/AbstractDebuggerParameterDialog.java:349

		private final List<?> choices;
		private final String[] tags;

		private final List<PropertyChangeListener> listeners = new ArrayList<>();

		private Object value;

		public ChoicesPropertyEditor(Collection<?> choices) {
			this.choices = choices.stream().distinct().toList();
			this.tags = choices.stream().map(Objects::toString).toArray(String[]::new);
		}

		@Override
		public void setValue(Object value) {
			if (Objects.equals(value, this.value)) {
				return;
			}
			if (!choices.contains(value)) {
				throw new IllegalArgumentException("Unsupported value: " + value);
			}
			Object oldValue;
			List<PropertyChangeListener> listeners;
			synchronized (this.listeners) {
				oldValue = this.value;
				this.value = value;
				if (this.listeners.isEmpty()) {
					return;
				}
				listeners = List.copyOf(this.listeners);
			}
			PropertyChangeEvent evt = new PropertyChangeEvent(this, null, oldValue, value);
			for (PropertyChangeListener l : listeners) {
				l.propertyChange(evt);
			}
		}

		@Override

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Check choices.contains(value) (or editor getter) before calling setValue.
  2. Ensure the value's type and equals() match the choices' elements exactly.
  3. Refresh the editor with a choices collection that includes the value you intend to set.
  4. Guard against null when null is not a permitted choice.

Example fix

// before
editor.setValue(candidate); // throws if not in choices

// after
if (editor.getTags() == null || java.util.Arrays.asList(editor.getTags()).contains(String.valueOf(candidate))) {
    editor.setAsText(String.valueOf(candidate));
}
Defensive patterns

Strategy: validation

Validate before calling

Collection<?> choices = ...; // same set given to the editor
if (choices != null && choices.contains(value)) {
    editor.setValue(value);
} else {
    // log / pick a default from choices
}

Type guard

boolean isAcceptableChoice(java.beans.PropertyEditor ed, Object v) {
    String[] tags = ed.getTags();
    return tags != null && java.util.Arrays.asList(tags).contains(String.valueOf(v));
}

Try / catch

try {
    editor.setValue(value);
} catch (IllegalArgumentException ex) {
    // value not in choices; fall back to choices.iterator().next()
}

Prevention

When it happens

Trigger: Calling setValue(v) where v is not among the original choices; passing a boxed type that differs from the choices' element type; passing null when null was not a choice.

Common situations: A dropdown/combobox model pushes a selected value that was filtered out of the choices; an enum vs String type mismatch; loading a saved/memorized value that no longer exists in the current choice set.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/d43daff875542e59. Report an issue: GitHub.