Android suitability: fix AnimalSniffer violations in ReflectionUtil, ObjectLayoutBuilder, UIText clipboard
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- backend, mobile-dev
調査の方向性
Read the Technical Notes and inspect UIText's clipboard methods, its private AwtClipboard class, and the nui-libgdx integration. Design a pluggable clipboard strategy that keeps the AWT behavior on desktop and uses Gdx.app.getClipboard() on Android; verify copy and paste work on both platform types.
索引モデルが issue の本文から書いたものです。
説明
AI-assisted issue. Filed by agent driven by @soloturn via GDD.
Context
Wiring up the AnimalSniffer + gummy-bears-api-24 Android-suitability check (#83) surfaced 21 real violations across two modules — genuine gaps between NUI's API surface and what's available on Android, not signature-set false positives. Concrete motivation: DestinationSol's engine module depends directly on nui, nui-libgdx, nui-gestalt, and nui-reflect, and targets Android via libGDX.
Problem / Current State
nui-reflect:ReflectionUtil— 6 violations.resolvedMethodToStringtook ajava.lang.reflect.Executableparameter and calledgetTypeParameters()/getName()/getDeclaringClass()/getGenericParameterTypes()/isVarArgs()on it directly.Executableitself isn't available before API 26, even thoughMethodandConstructoreach declare these same methods directly and have since long before API 24.typeToStringalso calledClass.getTypeName()(API 26+).nui:ObjectLayoutBuilder— 2 violations. UsedConstructor.getParameters()(returnsParameter[]) andParameter.getParameterizedType()to build the argument-type list.java.lang.reflect.Parameteritself isn't available before API 26.nui:UITextclipboard — 13 violations.getClipboardContents()/setClipboardContents()usejava.awt.Toolkit/Clipboard/DataFlavor/StringSelection/Transferable/UnsupportedFlavorExceptiondirectly. Unlike the above two, this isn't fixable by calling a different method — AWT genuinely doesn't exist on Android at all.
Acceptance Criteria
-
ReflectionUtilviolations fixed by calling through the concreteMethod/Constructortype instead of the sharedExecutablesupertype, and reimplementingClass.getTypeName()'s behavior — no public API change (#83) -
ObjectLayoutBuilderviolations fixed by usingConstructor.getGenericParameterTypes()instead of going throughParameter— no public API change (#83) -
UITextclipboard calls isolated into a private nested class (UIText.AwtClipboard) withLinkageErrorcaught by the caller, so invoking copy/paste on a platform withoutjava.awtdegrades to a no-op with a logged warning instead of crashing (#83) -
UITextactually has a working clipboard on platforms without AWT (e.g. Android vianui-libgdx, since libGDX'sGdx.app.getClipboard()is a cross-platform abstraction that works there), not just a graceful no-op — left open, see Technical Notes
Technical Notes
The last item is a real design decision, deliberately left out of #83 to keep that PR focused on the suitability check rather than a clipboard-abstraction redesign: likely a pluggable Clipboard strategy on UIText, defaulting to the current AWT-backed behavior on desktop, with nui-libgdx supplying a Gdx.app.getClipboard()-backed implementation for platforms (including Android) that have it.
Full violation reports (pre-fix, from #83's initial run): nui/build/reports/animalsniffer/main.text, nui-reflect/build/reports/animalsniffer/main.text.
Related
#83
- 主要言語
- Java
- スター
- 4
- フォーク
- 11
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MovingBlocks/TeraNUI のほかの issue
-
Good First Issue Revive: Keep Type: Refactoring
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
MovingBlocks/TeraNUI#45 ·
-
Revive: Keep Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
MovingBlocks/TeraNUI#41 ·
-
Revive: Keep Type: Bug
難易度 3/5 1〜2日 初心者へのやさしさ 43/100
MovingBlocks/TeraNUI#37 ·
-
Revive: Keep Type: Improvement
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
MovingBlocks/TeraNUI#31 · コメント 1 件 ·
-
Revive: Keep Status: Needs Investigation Type: Bug
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
MovingBlocks/TeraNUI#23 ·
MovingBlocks/TeraNUI の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
spAnser/reacharound#38 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
MovingBlocks/Terasology#5415 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100