8000 Issue #16857: api: add new `int process(List<Path> files)` method to RootModule - `add api` by Pankraz76 · Pull Request #16872 · checkstyle/checkstyle · GitHub
[go: up one dir, main page]

Skip to content

Issue #16857: api: add new int process(List<Path> files) method to RootModule - add api #16872

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

Conversation

Pankraz76
Copy link
@Pankraz76 Pankraz76 commented Apr 15, 2025

Issue #16857: api: add new int process(List<Path> files) method to RootModule - add api

@Pankraz76 Pankraz76 changed the title Fix process path adding new api only new Issue #16857: api: add new int process(List<Path> files) method to RootModule Apr 15, 2025
@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch from dbd29bb to 47510ec Compare April 15, 2025 19:17
* @see #destroy()
*/
int process(Collection<Path> files) throws CheckstyleException;

Copy link
Author

Choose a reason for hiding this comment

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

@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch from 47510ec to fbc80b6 Compare April 15, 2025 19:24
@Pankraz76 Pankraz76 changed the title Issue #16857: api: add new int process(List<Path> files) method to RootModule Pull #16872: api: add new int process(List<Path> files) method to RootModule Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch from fbc80b6 to 342ddb9 Compare April 15, 2025 19:27
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch from 342ddb9 to 8d9f2f8 Compare April 15, 2025 20:31
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch from 8d9f2f8 to 2aaf914 Compare April 15, 2025 20:32
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
Pankraz76 pushed a commit to Pankraz76/checkstyle that referenced this pull request Apr 15, 2025
@Pankraz76 Pankraz76 changed the title Pull #16872: api: add new int process(List<Path> files) method to RootModule Pull #16874: api: add new int process(List<Path> files) method to RootModule - add api Apr 16, 2025
@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch 2 times, most recently from 2f3bf40 to 3134505 Compare April 16, 2025 09:37
@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch 2 times, most recently from 422d809 to 5c001a7 Compare April 26, 2025 19:55
@Pankraz76
Copy link
Author

CI happy

@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch 4 times, most recently from bb95a35 to c7631bd Compare April 27, 2025 20:35
@@ -490,9 +490,11 @@ protected final void verify(Checker checker,
throws Exception {
stream.flush();
stream.reset();
final List<File> theFiles = new ArrayList<>();
Collections.addAll(theFiles, processedFiles);
Copy link
Author

Choose a reason for hiding this comment

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

theFiles is kind of strange name anyway, as the just like my is not a good prefix for a field as its pretty generic and therefore adding fluff. its just the files and not need to couple this. just give the value.

Simple List.of( usage should be applied anyway, so lets just elevate this as we already on it.
List<File> files = List.of(processedFiles);

Sorry, something went wrong.

@Pankraz76
Copy link
Author
Pankraz76 commented Apr 28, 2025

@Pankraz76
Copy link
Author

I would suggest to split the PR´s to make it easier to obtain:
image
If we agree, then these should go one after another.

@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch 2 times, most recently from 60fbecc to 7ad51bb Compare April 29, 2025 07:19
@Pankraz76
Copy link
Author

should we split it this way and continue with the tests next, or you want to increase scope of this PR?

@Pankraz76
Copy link
Author

@nrmancuso is this done the right way?

Maybe we merge this and continue with tests: #16872 (comment)

@romani
Copy link
Member
romani commented May 4, 2025

There is no deprecation marker on File class https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/io/File.html
So we should not deprecate old method, it is used for decades without problem, users should use it if they need it.

@Pankraz76
Copy link
Author
Pankraz76 commented May 4, 2025

yes, but then we don´t need any further adjustment, not migrating whole application on new method.

Only one method and a test for mapping and calling old method, thats it.

6D40

@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch from 7ad51bb to f5895a3 Compare May 4, 2025 05:56
@Pankraz76
Copy link
Author

removed deprecation

@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch 3 times, most recently from 18b2218 to 5bff9bd Compare May 7, 2025 08:22
@Pankraz76 Pankraz76 force-pushed the fix-processPath-adding-new-API-only-new branch from 5bff9bd to 9884cc3 Compare May 7, 2025 09:58
@Pankraz76
Copy link
Author

@nrmancuso kindly request your critics on this, ty.

Copy link
Member
@romani romani left a comment

Choose a reason for hiding this comment

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

Items

@Override
public int process(Collection<Path> files) throws CheckstyleException {
return process(files.stream()
.map(Path::toFile)
Copy link
Member

Choose a reason for hiding this comment

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

As we driving to better/modern class usage, we should use Path as primary, and old method that use File so convert to File. Right?

Copy link
Author

Choose a reason for hiding this comment

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

yes, we can do everything in dedicated request.

Copy link
Member

Choose a reason for hiding this comment

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

please do in this PR.

Copy link
Member
@romani romani May 15, 2025

Choose a reason for hiding this comment

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

if we think that PR becomes too big, we can do update of all inernals (non API classes) to Path in first PR.
and in separate add new api method with proper strategy on how to migrate dependent code/projects.

Copy link
Author

Choose a reason for hiding this comment

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

have done already its huge. Why no split? This is not good style.

Copy link
Author

Choose a reason for hiding this comment

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

@Pankraz76 Pankraz76 requested a review from romani May 9, 2025 09:30
@Pankraz76
Copy link
Author

same here. Lets add non breaking API to give support. then move to next increment.

@Pankraz76 Pankraz76 closed this May 20, 2025
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.

3 participants
0