Conversation
LinShunKang
reviewed
Apr 2, 2023
LinShunKang
reviewed
Apr 2, 2023
LinShunKang
reviewed
Apr 2, 2023
LinShunKang
reviewed
Apr 2, 2023
LinShunKang
reviewed
Apr 2, 2023
LinShunKang
reviewed
Apr 2, 2023
LinShunKang
reviewed
Apr 9, 2023
LinShunKang
reviewed
Apr 9, 2023
LinShunKang
reviewed
Apr 9, 2023
LinShunKang
reviewed
Apr 14, 2023
| fileWriter.write("#This is a file automatically generated by MyPerf4J, please do not edit!\n"); | ||
| fileWriter.flush(); | ||
| // 流还没释放导致 | ||
| Assert.assertFalse(tmpFilePath.toFile().renameTo(testFilePath1.toFile())); |
LinShunKang
reviewed
Apr 14, 2023
| Assert.assertTrue(testFilePath2.toFile().setReadOnly()); | ||
| } else { | ||
| // 第一次rename能成功,后续就失败 | ||
| Assert.assertFalse(tmpFilePath.toFile().renameTo(testFilePath2.toFile())); |
LinShunKang
reviewed
Apr 14, 2023
| final File tempFile = buildTmpProfilingFile(filePath); | ||
| final Path destPath = Files.move(tempFile.toPath(), Paths.get(filePath), REPLACE_EXISTING); | ||
| final File destFile = destPath.toFile(); | ||
| // 此处不能设置只读,否则在windows环境下次move的时候会报错 AccessDeniedException |
Owner
There was a problem hiding this comment.
如果 destFile.setReadOnly() 之后再次 move 会报错的话,那 FileTest 的第 89 行就会抛异常
Contributor
Author
There was a problem hiding this comment.
不一样,FileTest 能跑成功,但是 agent 加载到 tomcat 里面就会报错
LinShunKang
force-pushed
the
develop
branch
2 times, most recently
from
October 18, 2025 09:22
fff7d47 to
91761b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
fix #90
Brief ChangeLog
fix SysGenProfilingFile rename fail
Verifying this change
Follow this checklist to help us incorporate your contribution quickly and easily:
[MyPerf4J-XXX] Fix NullPointerException when host is null #XXX. Each commit in the pull request should have a meaningful subject line and body.mvn clean package -Dmaven.test.skip=falseto make sure unit-test pass.