Skip to content

Conversation

elharo
Copy link
Contributor

@elharo elharo commented Sep 11, 2025

continuing with #1520

@elharo elharo requested a review from Copilot September 11, 2025 11:33
Copy link

@Copilot Copilot AI left a 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.

Comment on lines 123 to 127
@Deprecated
/**
* @throws IOException if an I/O error occurs
* @deprecated use @TempDir (JUnit 5} Or TemporaryFolder (JUnit 4) instead
*/
Copy link
Preview

Copilot AI Sep 11, 2025

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.

Comment on lines 132 to 136
@Deprecated
/**
* @throws IOException if an I/O error occurs
* @deprecated use @TempDir (JUnit 5} Or TemporaryFolder (JUnit 4) instead
*/
Copy link
Preview

Copilot AI Sep 11, 2025

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.

Comment on lines 123 to 128
@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 {
Copy link
Preview

Copilot AI Sep 11, 2025

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.

Comment on lines 132 to 137
@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 {
Copy link
Preview

Copilot AI Sep 11, 2025

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 elharo marked this pull request as ready for review September 11, 2025 12:21
@elharo elharo requested a review from olamy September 11, 2025 12:22
@cstamas
Copy link
Member

cstamas commented Sep 19, 2025

@elharo if this is good to go, pls mark milestone 2.0.12 and merge

@elharo elharo added this to the 2.0.12 milestone Sep 19, 2025
@elharo elharo added the deprecated Pull requests that deprecate features label Sep 19, 2025
@elharo elharo merged commit 71c9124 into master Sep 19, 2025
14 checks passed
@elharo elharo deleted the 1520 branch September 19, 2025 15:27
cstamas added a commit to cstamas/maven-resolver that referenced this pull request Sep 20, 2025
@cstamas cstamas mentioned this pull request Sep 20, 2025
cstamas added a commit that referenced this pull request Sep 20, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated Pull requests that deprecate features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants