Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lolgab
Copy link
Member

@lolgab lolgab commented May 27, 2025

No description provided.

Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

USing .orNull when we assume it can't be a null (because we checked above) is a bit misleading. We could use .get and make our assumption explicit. (Which could lead to failure after the next refactoring, though)

The .orNull is probably "safer", but I'd add a comment.

@lolgab
Copy link
Member Author

lolgab commented May 27, 2025

I think we check if they are the same as before, not if they are not null, so we may print null there. I wouldn't comment only because it's a debug print.

@lefou
Copy link
Member

lefou commented May 27, 2025

If the option might be null, lets use .getOrElse("_"). We replace the unset-value with a _. Or use none if you prefer a word.

I wouldn't comment only because it's a debug print.

IMHO, that doesn't matter. The code must be read and understood nevertheless.

@lolgab
Copy link
Member Author

lolgab commented May 27, 2025

If the option might be null, lets use .getOrElse("_"). We replace the unset-value with a _. Or use none if you prefer a word.

Consider we are already printing null for the other argument:

Java version changed (Some(/opt/homebrew/opt/openjdk@17) -> null), re-starting server

@lefou
Copy link
Member

lefou commented May 27, 2025

IMHO, I would fallback to the real used ones on the rhs, e.g. BuildInfo.millVersion and system.

lefou added 2 commits June 12, 2025 08:51
Use `0.0.0` for the unknown Mill version and `<system>` for the unspecified JVM version.
@lefou
Copy link
Member

lefou commented Jun 12, 2025

I changed it to use 0.0.0 for the unknown last Mill version and <system> for the unspecified JVM version. @lolgab WDYT?

@lefou lefou changed the title Avoid printing "Some()" in Server messages Avoid printing "Some()" and "null" in Server messages Jun 12, 2025
@lolgab
Copy link
Member Author

lolgab commented Jun 12, 2025

Maybe <unknown> instead of 0.0.0?

@lefou lefou marked this pull request as ready for review June 12, 2025 07:22
@lefou lefou merged commit 5b2007d into com-lihaoyi:main Jun 12, 2025
47 checks passed
@lefou lefou added this to the 1.0.0-RC3 milestone Jun 12, 2025
@lolgab lolgab deleted the debug-prints branch June 12, 2025 09:10
@lolgab
Copy link
Member Author

lolgab commented Jun 12, 2025

Thank you! @lefou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants