Skip to content
This repository has been archived by the owner on Apr 28, 2019. It is now read-only.

strings containing scope keywords are being incorrectly matched as documentable code #5

Closed
no-stack-dub-sack opened this issue Feb 16, 2019 · 1 comment · Fixed by #24

Comments

@no-stack-dub-sack
Copy link
Owner

no-stack-dub-sack commented Feb 16, 2019

@reedodeneal opening an issue for your original bug report here for tracking. Again, nice catch! If for some reason you're not up to submitting the fix, I'd be happy to make the change and attribute the credit to you.

Issue: strings containing scope keywords are being incorrectly matched as documentable code. See this line. Use of contains can incorrectly match strings containing scope keywords. Example:

public static void insertJob(Job__c job) {
    String someString = 'for some reason this ' +
    'string contains the word private ' +
    'and creates a very public error.';

    insert job;
}

This would result in documentation that might look like this:

image

Whoops!

The use of startsWith can easily fix this.

@no-stack-dub-sack
Copy link
Owner Author

On second thought... startsWith might not actually solve this, since we could have a case like this:

@TestVisible private static boolean turnOffTrigger = false;

The annotation really should go above, but we can't count on it. Damn...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant