CreateNewLangProj throws when the default analysis writing system's ICU locale differs from its tag

オープン 初心者向け
#416 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
backend

調査の方向性

LcmCache.CreateNewLangProjから始め、民族誌リストのファイルが指定されていない場合にInitializeAnthroListがどのように書記体系を選択するかを追ってください。その検索を、issueが既存の例として挙げているCreateAnalysisWritingSystemと比較してください。提示されたpt-BRの呼び出しで再現し、タスクを未完了のまま残したり、キャッシュの破棄時に例外を発生させたりせずに呼び出しが成功することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

LcmCache.CreateNewLangProj throws when no anthropology list file is passed and the default analysis writing system's ICU locale differs from its language tag. pt-BR is one such writing system: its ICU locale is pt_BR.

Cause

With no list file, InitializeAnthroList names the empty Anthropology Categories list in the default analysis writing system. It finds that writing system with:

cache.WritingSystemFactory.GetWsFromStr(analWrtSys != null ? analWrtSys.IcuLocale : userIcuLocale)

GetWsFromStr looks writing systems up by language tag. For pt-BR it gets pt_BR, returns 0, and set_String(0, ...) throws. By then the project is already on disk.

FLEx's new-project dialog passes the FRAME list by default, so FLEx only hits this when the user picks an empty, user-defined list. Callers that create projects without a list file hit it every time.

Repro

LcmCache.CreateNewLangProj(progress, "Test", dirs, synchronizeInvoke,
    new CoreWritingSystemDefinition("pt-BR") { Id = "pt-BR" },
    new CoreWritingSystemDefinition("fr") { Id = "fr" }, "en",
    new HashSet<CoreWritingSystemDefinition>(), new HashSet<CoreWritingSystemDefinition>(), null);

The real exception is hidden. The failed call leaves a non-undoable task open, so disposing the cache throws SynchronizationLockException.

Fix

Look the writing system up by analWrtSys.Id, as CreateAnalysisWritingSystem already does.

主要言語
C#
スター
3
フォーク
15
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sillsdev/liblcm のほかの issue

sillsdev/liblcm の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。