Incorrect Copy Loop Detection Due to `String#contains` Logic
メンテナーはふだん 7 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
調査の方向性
app/src/test/java/com/amaze/filemanager/filesystem/OperationsTest.java とエントリーポイント isCopyLoopPossible から始めます。/documents/work や /documents/workk のような、互いに重複しない類似のパスを使って、示されている単体テストを実行または拡張します。このケースでメソッドが false を返せば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary:
The isCopyLoopPossible method incorrectly identifies a copy loop for similar but non-overlapping directory paths due to reliance on string contains logic. Located at app/src/test/java/com/amaze/filemanager/filesystem/OperationsTest.java
To Reproduce
Steps to reproduce the behavior:
- Invoke the
isCopyLoopPossiblemethod programmatically within the app, passing a source file path and a target file path where the target path is similar but not actually a subdirectory of the source (e.g.,/documents/workand/documents/workk). - Observe the method's return value.
Expected behavior
The method should return false, indicating no copy loop is possible because the target directory is not a subdirectory of the source directory.
Actual Outcome
The method returns true, incorrectly suggesting a copy loop is possible due to the similarity of the paths.
Screenshots
For this unit test:
@Test
public void testIsCopyLoopPossibleWithSimilarButNonOverlappingPaths() {
HybridFileParcelable sourceFile = new HybridFileParcelable("/documents/work");
HybridFile targetFile = new HybridFile(OpenMode.FILE, "/documents/workk");
assertFalse("Copy loop should not be detected for similar but non-overlapping paths",
Operations.isCopyLoopPossible(sourceFile, targetFile));
}
Smartphone (please complete the following information):
N/A
Additional context
There was no GUI error. Tried reproducing error on small scale on GUI with android emulator and no issues. Although, when trying to copy parent directory into subdirectory of itself, it copied over just empty directory. Could cause problems on a larger scale.
- 主要言語
- Kotlin
- スター
- 6.5k
- フォーク
- 1.7k
- 平均マージ
- 9日 21時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TeamAmaze/AmazeFileManager のほかの issue
-
Folders with no files are missing the parent directory item in grid layout対応中かも @amandeep25100-a11y が 1 日前に担当しました。 オープンArea-UIUX Issue-Bug Issue-Easy (good first issue)
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
TeamAmaze/AmazeFileManager#4769 · コメント 3 件 ·
メンテナーはふだん 7 日以内に返信
-
Area-UIUX Issue-Bug
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
TeamAmaze/AmazeFileManager#4723 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 7 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 50/100
TeamAmaze/AmazeFileManager#4771 ·
メンテナーはふだん 7 日以内に返信
-
Thumbnail for animated images are broken対応中かも @muhamadsyafii が 2 日前に担当しました。 オープンArea-UIUX Issue-Bug
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
TeamAmaze/AmazeFileManager#4767 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 7 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
TeamAmaze/AmazeFileManager#4766 · コメント 2 件 ·
メンテナーはふだん 7 日以内に返信
TeamAmaze/AmazeFileManager の issue をすべて見る
似ている issue
-
Preserve database capacity during dev deployments対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
world-federation-of-advertisers/cross-media-measurement#4870 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
ankidroid/Anki-Android#23156 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
paritytech/polkadot-android-community#307 ·
メンテナーはふだん 2 日以内に返信
-
android enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信