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

replace deprecated code in favor of Java 7 core and apache commons libraries #13

Merged
merged 16 commits into from
Jul 22, 2020

Conversation

elharo
Copy link
Contributor

@elharo elharo commented Jul 16, 2020

No description provided.

Copy link
Contributor

@dennisl dennisl 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 that you should not remove the local variables delimiters in AbstractMavenFilteringRequestTest, since it makes the tests prone to interference from the other tests in the class.

@elharo
Copy link
Contributor Author

elharo commented Jul 17, 2020

This is a common misconception. Instance fields are not shared between test methods.

@dennisl
Copy link
Contributor

dennisl commented Jul 17, 2020

My bad. Then we are good to go!

@elharo elharo changed the title replace deprecated code in favor Java 7 core and apache commons libraries replace deprecated code in favor of Java 7 core and apache commons libraries Jul 17, 2020

File emptyDirectoryChild = new File( sourceDirectory, "empty-directory-child" );
emptyDirectory.mkdirs();

File emptyDirectoryChildEmptyChild = new File( emptyDirectoryChild, "empty-child" );
emptyDirectoryChildEmptyChild.mkdirs();

FileUtils.fileWrite( new File( emptyDirectoryChildEmptyChild, ".gitignore" ), "UTF-8", "# .gitignore file" );
FileUtils.write( new File( emptyDirectoryChildEmptyChild, ".gitignore" ), "# .gitignore file", "UTF-8" );
Copy link
Member

Choose a reason for hiding this comment

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

simply using Files.write could avoid external dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not quite a 1:1 replacement. What we really need is Files.writeString from Java 11. We'd also need to change the File objects to Path objects. I'll leave this change for a separate PR if someone wants to take it.

@elharo
Copy link
Contributor Author

elharo commented Jul 22, 2020

java.io.FileNotFoundException: File does not exist: /home/jenkins/jenkins-slave/workspace/maven-box_maven-filtering_i912/m/target/sourceTestGitIgnoreFile
at org.apache.maven.shared.filtering.DefaultMavenResourcesFilteringTest.testShouldReturnGitIgnoreFiles(DefaultMavenResourcesFilteringTest.java:677)

@elharo
Copy link
Contributor Author

elharo commented Jul 22, 2020

Passes locally though.

@elharo elharo merged commit 1a097bd into master Jul 22, 2020
@elharo elharo deleted the i912 branch July 22, 2020 13:26
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