Skip to content

Validate string escapes, static inner methods, and comment/annotation interaction#409

Closed
metalshark wants to merge 4 commits into
apex-dev-tools:mainfrom
metalshark:detection-issues
Closed

Validate string escapes, static inner methods, and comment/annotation interaction#409
metalshark wants to merge 4 commits into
apex-dev-tools:mainfrom
metalshark:detection-issues

Conversation

@metalshark

@metalshark metalshark commented Dec 29, 2025

Copy link
Copy Markdown

Added validation for invalid escape sequences in string literals, or static methods declared within inner classes, and annotation/comment positioning that fails to compile.
Updated tests to cover these cases and improved error reporting for both issues.
There were no language errors when these mistakes were being inserted by Agentforce vibes.

Added validation for invalid escape sequences in string literals and for static methods declared within inner classes. Updated tests to cover these cases and improved error reporting for both issues.
Introduces tests to verify that annotations following or separated by comments on the same line before class, inner class, or method declarations are correctly flagged as errors. This ensures proper enforcement of annotation placement rules.
Adds validation to prevent comments between annotations/modifiers and their target declarations (classes, methods, fields, etc). Updates modifier logic to call the new validation and logs issues immediately for class declarations. Test cases are updated to assert on the new error conditions.
@metalshark metalshark changed the title Validate string escapes and static inner methods Validate string escapes, static inner methods, and comment/annotation interaction Dec 30, 2025
Added a note about improved validation for comment placement between annotations/modifiers and their targets.
@kjonescertinia

Copy link
Copy Markdown
Contributor

Thanks for this! I'm going to split this into separate PRs so I can merge each feature independently. Appreciate the contribution.

kjonescertinia added a commit that referenced this pull request Jan 24, 2026
Static methods are not allowed in inner classes in Apex. This change
adds validation to detect and report this error.

Based on work by @metalshark in PR #409.
kjonescertinia added a commit that referenced this pull request Jan 24, 2026
Static methods are not allowed in inner classes in Apex. This change
adds validation to detect and report this error.

Based on work by @metalshark in PR #409.
kjonescertinia added a commit that referenced this pull request Jan 24, 2026
Static methods are not allowed in inner classes in Apex. This change
adds validation to detect and report this error.

Based on work by @metalshark in PR #409.
kjonescertinia added a commit that referenced this pull request Jan 24, 2026
Static methods are not allowed in inner classes in Apex. This change
adds validation to detect and report this error.

Based on work by @metalshark in PR #409.
@nawforce

nawforce commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Thanks again for the contribution here.

This PR bundled several independent checks, so we split the work into focused follow-ups:

Since the actionable work has either landed or has a focused tracking issue, I am closing this stale aggregate PR rather than trying to merge it as-is.

@nawforce nawforce closed this Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants