Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Scanner.ChangeSetListener #12769

Open
wants to merge 4 commits into
base: jetty-12.1.x
Choose a base branch
from

Conversation

joakime
Copy link
Contributor

@joakime joakime commented Feb 5, 2025

  • Update testing for all Listeners

This is a small subset of the changes from PR #12583 made as a new PR just so we can track these changes separately from the deploy changes.

+ Update testing for all Listeners
@joakime joakime requested review from gregw and janbartel February 5, 2025 17:52
@joakime joakime self-assigned this Feb 5, 2025
Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

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

There is a chance to cleanup this class, in particular by consolidating the "warn" logs.
They should be INFO or DEBUG level, not WARN, since we just log and ignore the failure, and the Scanner continues to operate as nothing happened.
Furthermore, remove the Scanner.warn() method, since in the rest of the class LOG.warn() is used instead.
I would prefer to see LOG.info()/debug() everywhere.

interface Listener should extend java.util.EventListener.

Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

I think the iteration should be turned inside out.

@gregw
Copy link
Contributor

gregw commented Feb 12, 2025

@joakime to expedite my feedback (as my time is short).. I'm working on a branch that implements my suggestions

@gregw gregw mentioned this pull request Feb 12, 2025
@joakime
Copy link
Contributor Author

joakime commented Feb 12, 2025

@gregw @sbordet I took the ideas from PR #12788 and then cleaned it up, added more safety checks, and javadoc too.

@joakime joakime requested review from sbordet and gregw February 12, 2025 16:14
Copy link
Contributor

@janbartel janbartel left a comment

Choose a reason for hiding this comment

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

A couple of niggles, but in the main seems good.

@@ -572,7 +614,7 @@ public void setReportExistingFilesOnStartup(boolean reportExisting)
_reportExisting = reportExisting;
}

public boolean getReportExistingFilesOnStartup()
public boolean isReportExistingFilesOnStartup()
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess if this method isn't referenced anywhere in jetty we might be able to get away with this method rename, but technically we should do a deprecation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was changed to follow Jetty format / syntax.
Also, internally, the Scanner uses this method now, instead of the raw field.
This allows for folks extending Scanner have a better experience, as this now follows Java recommendations.

@joakime joakime requested a review from janbartel February 13, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

4 participants