Skip to content

[fix-finder] Remove #region/#endregion directives from Android.Runtime.XmlReaderPullParser #12014

Description

@github-actions

Problem

The repository style guide explicitly forbids #region / #endregion directives ("Do NOT use #region or #endregion"), but src/Mono.Android/Android.Runtime/XmlReaderPullParser.cs still contains 3 #region blocks (6 directive lines). They violate the coding conventions. Removing them is a purely cosmetic change with no effect on behavior, public API, or generated IL — #region/#endregion are preprocessor directives that the C# compiler ignores.

Location

  • File(s): src/Mono.Android/Android.Runtime/XmlReaderPullParser.cs
  • Line(s): the 6 directive lines belonging to these 3 region pairs:
    • #region IXmlResourceParser implementation (line 31) ... #endregion (line 36)
    • #region IAttributeSet implementation (line 38) ... #endregion (line 124)
    • #region IXmlPullParser implementation (line 148) ... #endregion (line 484)

Current Code

Example (the first, compact block):

		#region IXmlResourceParser implementation
		public void Close ()
		{
			r.Close ();
		}
		#endregion

Suggested Fix

Each of these region names carries useful information — it labels which interface's members follow. Per the repo convention for removing regions, preserve the useful name as a single // comment on the line that held the #region directive, and delete the matching #endregion line. Keep the tab indentation and all code between the directives exactly as-is; do not reflow or re-indent anything else.

Apply exactly these six edits:

Line Current New
31 #region IXmlResourceParser implementation // IXmlResourceParser implementation
36 #endregion (delete the line)
38 #region IAttributeSet implementation // IAttributeSet implementation
124 #endregion (delete the line)
148 #region IXmlPullParser implementation // IXmlPullParser implementation
484 #endregion (delete the line)

(The #region lines are indented with two tabs; keep the same indentation on the replacement // comments.)

Guidelines

  • Follow .editorconfig / Mono style; touch nothing other than the directive lines.
  • Keep the change minimal — no unrelated formatting or blank-line churn.
  • Do not delete or modify any members; only the preprocessor directives.
  • This is a comment-only change and introduces no new APIs, so it compiles against every target framework of Mono.Android.

Acceptance Criteria

  • The 3 #region ... implementation lines are converted to // ... implementation comments (indentation preserved)
  • The 3 matching #endregion lines are removed
  • No other lines in the file changed (no re-indentation or blank-line churn)
  • grep -nE "#region|#endregion" src/Mono.Android/Android.Runtime/XmlReaderPullParser.cs returns nothing
  • All tests pass
  • No new warnings introduced

Fix-finder metadata

  • Script: 03-region-directives
  • Score: 28/30 (actionability: 10, safety: 10, scope: 8)

Generated by Nightly Fix Finder · 119.9 AIC · ⌖ 29.1 AIC · ⊞ 9.3K ·

  • expires on Jul 15, 2026, 2:29 AM UTC

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions