Skip to content

Conversation

@elharo
Copy link
Contributor

@elharo elharo commented Mar 11, 2023

This completely removes Plexus utils from this package.

@elharo elharo requested a review from michael-o March 11, 2023 15:41
if ( !directory.isDirectory() )

List<Path> classFiles = Files.walk( directory.toPath() )
.filter( path -> path.toFile().getName().endsWith( ".class" ) )
Copy link
Member

Choose a reason for hiding this comment

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

Why not #getFileName()#toString()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Six of one, half dozen of another. I looked at that and saw that getFileName returned a Path instead of a String, which seemed wrong to me. But if you prefer I can change this.

Copy link
Member

Choose a reason for hiding this comment

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

Let's make consistently use NIO2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

might have to revert that. It seems to break the integration tests on Windows in a way that indicates a real issue.

@elharo
Copy link
Contributor Author

elharo commented Mar 24, 2023

Trickier than I thought. The problem is that jars on Windows still use forward slash but directories use backslash.

@elharo elharo marked this pull request as ready for review March 24, 2023 15:14
Copy link
Member

@slawekjaranowski slawekjaranowski left a comment

Choose a reason for hiding this comment

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

Please create issue for it.

if ( name.endsWith( ".class" ) && name.indexOf( '-' ) == -1 )
{
visitClass( name, in, visitor );
// Even on Windows Jars use / as the separator character
Copy link
Member

Choose a reason for hiding this comment

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

The comment is redundant and wrong because this has nothing to do with Windows. REad the PKZIP implementation note: separators are always foward slashes regarding of the OS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's the point. The previous version was using the system dependent line separator, which was why the test was failing on Windows but not Linux.

Copy link
Member

Choose a reason for hiding this comment

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

comment was changed

@slawekjaranowski slawekjaranowski changed the title Prefer JDK classes to Plexus utils [MSHARED-1224] Prefer JDK classes to Plexus utils Apr 7, 2023
@michael-o michael-o self-requested a review April 7, 2023 23:28
@jira-importer
Copy link

Resolve #229

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.

4 participants