Skip to content

Commit 6913c42

Browse files
committed
DisplayPostprocessor: set name if creating display
The Display name is not guaranteed to be null by default: it is up to the implementation of each DisplayPlugin. A common case is that the default name will come back as "Untitled-#" if not specified, which will then supercede the requested output name. To avoid this, the DisplayPostprocessor should always pass the default name when creating a display.
1 parent 1cf0e29 commit 6913c42

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/java/org/scijava/display/DisplayPostprocessor.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,9 @@ private void handleOutput(final String defaultName, final Object output) {
113113
}
114114
else {
115115
// create a new display for the output
116-
final Display<?> display = displayService.createDisplay(output);
116+
final Display<?> display = displayService.createDisplay(defaultName, output);
117117
if (display != null) {
118118
displays.add(display);
119-
if (display.getName() == null) {
120-
// set a default name based on the parameter
121-
display.setName(defaultName);
122-
}
123119
}
124120
}
125121
}

0 commit comments

Comments
 (0)