Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ private static final class JavaItemCell extends ListCell<JavaRuntime> {
center.setAlignment(Pos.CENTER_LEFT);

label.setAlignment(Pos.CENTER);
label.setMinSize(24, 24);
label.setMaxSize(24, 24);
label.setPrefSize(24, 24);
label.setStyle("-fx-background-color: -monet-secondary-container; -fx-background-radius: 2; -fx-padding: 2; -fx-font-weight: normal; -fx-font-size: 12px;");
FXUtils.setLimitWidth(label, 32);
FXUtils.setLimitHeight(label, 32);

label.setStyle("-fx-background-color: -monet-secondary-container; -fx-background-radius: 2; -fx-padding: 2; -fx-font-weight: normal; -fx-font-size: 16px;");

this.content = new TwoLineListItem();
HBox.setHgrow(content, Priority.ALWAYS);
Expand Down Expand Up @@ -304,15 +304,14 @@ protected void updateItem(JavaRuntime item, boolean empty) {
int parsedVersion = item.getParsedVersion();
label.setText(parsedVersion >= 0 ? String.valueOf(parsedVersion) : "?");

content.setTitle((item.isJDK() ? "JDK" : "JRE") + " " + item.getVersion());
String vendor = JavaInfo.normalizeVendor(item.getVendor());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Annotate the nullable vendor local

When the runtime vendor is absent or equals N/A, JavaInfo.normalizeVendor returns null, so this newly introduced local is nullable but is declared as a plain String. Mark it with @Nullable so the nullability contract remains explicit as required by the repository rules.

AGENTS.md reference: AGENTS.md:L7-L9

Useful? React with 👍 / 👎.


content.setTitle((vendor != null ? vendor : "Unknown") + " " + (item.isJDK() ? "JDK" : "JRE") + " " + item.getVersion());
Comment thread
KSSJW marked this conversation as resolved.
Outdated
content.setSubtitle(item.getBinary().toString());

if (oldItem != item) {
content.getTags().clear();
content.addTag(i18n("java.info.architecture") + ": " + item.getArchitecture().getDisplayName());
String vendor = JavaInfo.normalizeVendor(item.getVendor());
if (vendor != null)
content.addTag(i18n("java.info.vendor") + ": " + vendor);
content.addTag(item.getArchitecture().getDisplayName());
}

SVG newRemoveIcon = item.isManaged() ? SVG.DELETE_FOREVER : SVG.DELETE;
Expand Down