Skip to content

[Core] Replace windows path separator in sub package name #1869

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

Merged
merged 3 commits into from
Jan 25, 2020

Conversation

mpkorstanje
Copy link
Contributor

Summary

Replace windows path separator in sub package name

Closes #1868

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@mpkorstanje mpkorstanje merged commit 98939c3 into master Jan 25, 2020
@mpkorstanje mpkorstanje deleted the fix-windows-path-seperator branch January 25, 2020 21:15
private static String determineSubpackageName(Path baseDir, Path classFile) {
Path relativePath = baseDir.relativize(classFile.getParent());
private static String determineSubpackageName(Path baseDir, Path resource) {
Path relativePath = baseDir.relativize(resource.getParent());
String pathSeparator = baseDir.getFileSystem().getSeparator();
return relativePath.toString().replace(pathSeparator, PACKAGE_SEPARATOR_STRING);

Choose a reason for hiding this comment

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

Thanks :)

by the way ... why not replaceAll instead of replace???

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