Problem
src/Xamarin.Android.Build.Tasks/Utilities/AssemblyCompression.cs contains a stale // TODO and a block of dead, commented-out code for an "input assembly size limit" feature that was never enabled. The constant declaration (InputAssemblySizeLimit) and its only usage are both commented out, so the // TODO: consider making it configurable... note refers to a feature that does not exist in the code. The explanatory comment even references "(May 2020)" sizing, making it clearly obsolete clutter.
Location
- File(s):
src/Xamarin.Android.Build.Tasks/Utilities/AssemblyCompression.cs
- Line(s): 50–55 (stale TODO + commented-out constant) and 74–76 (commented-out usage)
Current Code
Block 1 (lines 48–57):
const uint CompressedDataMagic = 0x5A4C4158; // 'XALZ', little-endian
// TODO: consider making it configurable via an MSBuild property, would be more flexible this way
//
// Arbitrary limit of the input assembly size, to clamp down on memory allocation. Our unlinked Mono.Android.dll
// assembly (the biggest one we have) is currently (May 2020) around 27MB, so let's bump the value to 30MB times
// two - it should be more than enough for most needs.
(public/redacted) const ulong InputAssemblySizeLimit = 60 * 1024 * 1024;
static readonly ArrayPool<byte> bytePool = ArrayPool<byte>.Shared;
Block 2 (lines 71–78):
var fi = new FileInfo (data.SourcePath);
if (!fi.Exists)
throw new InvalidOperationException ($"File '{data.SourcePath}' does not exist");
// if ((ulong)fi.Length > InputAssemblySizeLimit) {
// return CompressionResult.InputTooBig;
// }
data.DestinationPath = outputFilePath;
Suggested Fix
Delete the dead commented-out lines so the two blocks become:
Block 1:
const uint CompressedDataMagic = 0x5A4C4158; // 'XALZ', little-endian
static readonly ArrayPool<byte> bytePool = ArrayPool<byte>.Shared;
Block 2:
var fi = new FileInfo (data.SourcePath);
if (!fi.Exists)
throw new InvalidOperationException ($"File '{data.SourcePath}' does not exist");
data.DestinationPath = outputFilePath;
This removes only comments — no executable code changes.
Guidelines
- Do NOT remove the
CompressionResult.InputTooBig enum member (line 21) or its case CompressionResult.InputTooBig: handling in TryCompress (around lines 127–129). They are still referenced by a live switch statement; leaving them untouched keeps this change purely comment-only with zero behavior change. (Compress already never returns InputTooBig today — that is a pre-existing condition and out of scope for this cleanup.)
- Preserve the existing tab indentation and Mono code style; avoid leaving a double blank line where the block was removed.
- This is a comment-only deletion, so no new APIs/language features are introduced and there are no target-framework concerns.
Acceptance Criteria
Fix-finder metadata
- Script:
00-todo-fixme-hack
- Score:
29/30 (actionability: 10, safety: 10, scope: 9)
Generated by Nightly Fix Finder · 544.9 AIC · ⌖ 73.1 AIC · ⊞ 40.5K · ◷
Problem
src/Xamarin.Android.Build.Tasks/Utilities/AssemblyCompression.cscontains a stale// TODOand a block of dead, commented-out code for an "input assembly size limit" feature that was never enabled. The constant declaration (InputAssemblySizeLimit) and its only usage are both commented out, so the// TODO: consider making it configurable...note refers to a feature that does not exist in the code. The explanatory comment even references "(May 2020)" sizing, making it clearly obsolete clutter.Location
src/Xamarin.Android.Build.Tasks/Utilities/AssemblyCompression.csCurrent Code
Block 1 (lines 48–57):
Block 2 (lines 71–78):
Suggested Fix
Delete the dead commented-out lines so the two blocks become:
Block 1:
Block 2:
This removes only comments — no executable code changes.
Guidelines
CompressionResult.InputTooBigenum member (line 21) or itscase CompressionResult.InputTooBig:handling inTryCompress(around lines 127–129). They are still referenced by a liveswitchstatement; leaving them untouched keeps this change purely comment-only with zero behavior change. (Compressalready never returnsInputTooBigtoday — that is a pre-existing condition and out of scope for this cleanup.)Acceptance Criteria
InputAssemblySizeLimitconstant) are removedInputAssemblySizeLimitusage) are removedCompressionResult.InputTooBigenum member and itsswitchcase remain unchangedsrc/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csprojstill buildsFix-finder metadata
00-todo-fixme-hack29/30(actionability:10, safety:10, scope:9)