-
Notifications
You must be signed in to change notification settings - Fork 45
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
[MSHARED-1224] Prefer JDK classes to Plexus utils #81
Conversation
if ( !directory.isDirectory() ) | ||
|
||
List<Path> classFiles = Files.walk( directory.toPath() ) | ||
.filter( path -> path.toFile().getName().endsWith( ".class" ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not #getFileName()#toString()
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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.
src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitorUtils.java
Outdated
Show resolved
Hide resolved
This reverts commit 82dddaf.
Trickier than I thought. The problem is that jars on Windows still use forward slash but directories use backslash. |
There was a problem hiding this 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.
@@ -99,7 +97,8 @@ private static void acceptJar( URL url, ClassFileVisitor visitor ) | |||
// ignore files like package-info.class and module-info.class | |||
if ( name.endsWith( ".class" ) && name.indexOf( '-' ) == -1 ) | |||
{ | |||
visitClass( name, in, visitor ); | |||
// Even on Windows Jars use / as the separator character |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment was changed
This completely removes Plexus utils from this package.