Skip to content

[fix-finder] Add XML documentation to Action-based Java.Lang.Thread constructors #12264

Description

@github-actions

Problem

The convenience Java.Lang.Thread constructors that accept a .NET Action (instead of an IRunnable) in src/Mono.Android/Java.Lang/Thread.cs lack /// XML documentation. These are public, user-facing APIs shipped in Mono.Android.dll, so IntelliSense and generated API docs show no description for them.

Location

  • File(s): src/Mono.Android/Java.Lang/Thread.cs
  • Line(s): 58, 60, 62, 64, 66

Current Code

public Thread (Action runHandler) : this (new RunnableImplementor (runHandler)) {}

public Thread (Action runHandler, string threadName) : this (new RunnableImplementor (runHandler), threadName) {}

public Thread (ThreadGroup group, Action runHandler) : this (group, new RunnableImplementor (runHandler)) {}

public Thread (ThreadGroup group, Action runHandler, string threadName) : this (group, new RunnableImplementor (runHandler), threadName) {}

public Thread (ThreadGroup group, Action runHandler, string threadName, long stackSize) : this (group, new RunnableImplementor (runHandler), threadName, stackSize) {}

Suggested Fix

Add a /// doc comment to each of the five constructors with a <summary> and a <param> for each parameter. Follow the style already used elsewhere in src/Mono.Android/ (see Android.Util/Log.cs and Android.Views/KeyCharacterMap.cs), including a <seealso href=...> link to the Android Thread documentation. Example for the first two:

/// <summary>
/// Initializes a new <see cref="Thread"/> that runs the specified <paramref name="runHandler"/> when started.
/// </summary>
/// <param name="runHandler">The delegate to execute on the new thread.</param>
/// <seealso href="(developer.android.com/redacted) documentation for <c>java.lang.Thread</c></seealso>
public Thread (Action runHandler) : this (new RunnableImplementor (runHandler)) {}

/// <summary>
/// Initializes a new <see cref="Thread"/> with the specified name that runs the specified <paramref name="runHandler"/> when started.
/// </summary>
/// <param name="runHandler">The delegate to execute on the new thread.</param>
/// <param name="threadName">The name of the new thread.</param>
/// <seealso href="(developer.android.com/redacted),%20java.lang.String)">Android documentation for <c>java.lang.Thread</c></seealso>
public Thread (Action runHandler, string threadName) : this (new RunnableImplementor (runHandler), threadName) {}

Document the remaining three constructors the same way, adding <param name="group">The thread group to which the new thread belongs.</param> and <param name="stackSize">The desired stack size for the new thread, or <c>0</c> to use the default.</param> where applicable.

Guidelines

  • Only add documentation; do not change any behavior or signatures.
  • Use tabs for indentation and Mono formatting conventions (space before ().
  • Match the existing <seealso href=...> doc-link style used in Android.Util/Log.cs.

Acceptance Criteria

  • All five Action-based Thread constructors have /// XML documentation with <summary> and <param> entries.
  • All tests pass
  • No new warnings introduced

Fix-finder metadata

  • Script: 04-missing-xml-docs
  • Score: 30/30 (actionability: 10, safety: 10, scope: 10)

Generated by Nightly Fix Finder · 83.7 AIC · ⌖ 17.3 AIC · ⊞ 9.4K ·

  • expires on Aug 6, 2026, 2:26 AM UTC

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions