-
Notifications
You must be signed in to change notification settings - Fork 137
Deprecate methods that are completely unused or not used outside this… #1581
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
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.
Pull Request Overview
This PR deprecates several utility methods in the TestFileUtils
class that are either completely unused or not used outside this specific utility module. The changes add @Deprecated
annotations to methods that create temporary files and perform file operations, encouraging users to migrate to modern testing frameworks like JUnit 5's @TempDir
or JUnit 4's TemporaryFolder
.
- Added deprecation annotations to methods for creating temporary files and file operations
- Included deprecation documentation suggesting alternative testing approaches
- Marked utility methods that appear to be unused or have limited external usage
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@Deprecated | ||
/** | ||
* @throws IOException if an I/O error occurs | ||
* @deprecated use @TempDir (JUnit 5} Or TemporaryFolder (JUnit 4) instead | ||
*/ |
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.
There's a syntax error in the deprecation message. 'JUnit 5}' should be 'JUnit 5)' - the closing brace should be a closing parenthesis.
Copilot uses AI. Check for mistakes.
@Deprecated | ||
/** | ||
* @throws IOException if an I/O error occurs | ||
* @deprecated use @TempDir (JUnit 5} Or TemporaryFolder (JUnit 4) instead | ||
*/ |
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.
There's a syntax error in the deprecation message. 'JUnit 5}' should be 'JUnit 5)' - the closing brace should be a closing parenthesis.
Copilot uses AI. Check for mistakes.
@Deprecated | ||
/** | ||
* @throws IOException if an I/O error occurs | ||
* @deprecated use @TempDir (JUnit 5} Or TemporaryFolder (JUnit 4) instead | ||
*/ | ||
public static File createTempFile(String contents) throws IOException { |
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 JavaDoc placement is incorrect. The @Deprecated
annotation should come after the JavaDoc comment, not before it. The standard order is: JavaDoc comment, then annotations, then method declaration.
Copilot uses AI. Check for mistakes.
@Deprecated | ||
/** | ||
* @throws IOException if an I/O error occurs | ||
* @deprecated use @TempDir (JUnit 5} Or TemporaryFolder (JUnit 4) instead | ||
*/ | ||
public static File createTempFile(byte[] pattern, int repeat) throws IOException { |
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 JavaDoc placement is incorrect. The @Deprecated
annotation should come after the JavaDoc comment, not before it. The standard order is: JavaDoc comment, then annotations, then method declaration.
Copilot uses AI. Check for mistakes.
@elharo if this is good to go, pls mark milestone 2.0.12 and merge |
PR #1581 left some typos in, that makes javadoc puke: ``` [ERROR] /home/cstamas/Worx/apache-maven/maven-resolver/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileUtils.java:161: error: unterminated inline tag [ERROR] * @deprecated use {@code @tempdir) (JUnit 5) Or {@code TemporaryFolder} (JUnit 4) instead ``` PR #1589 used forbidden chars.
continuing with #1520