GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [apex] EagerlyLoadedDescribeSObjectResult: False positive with fully qualified SObjectDescribeOptions/FieldDescribeOptions · Issue #5082 · pmd/pmd

[apex] EagerlyLoadedDescribeSObjectResult: False positive with fully qualified SObjectDescribeOptions/FieldDescribeOptions #5082

New issue
Copy link
New issue
Copy link
Closed
#7131
Closed
[apex] EagerlyLoadedDescribeSObjectResult: False positive with fully qualified SObjectDescribeOptions/FieldDescribeOptions#5082
#7131
Copy link
Labels
a:false-positivePMD flags a piece of code that is not problematic
Milestone
7.29.0

Description

@FedeAbella
FedeAbella
opened on Jun 21, 2024
Issue body actions

Affects PMD Version: 7.0.0

Rule: EagerlyLoadedDescribeSObjectResult

Description: When calling SObjectType.getDescribe() using one of the SObjectDescribeOptions enums, the rule still comes up as failed if the option is called using the Schema namespace explicitly.

Code Sample demonstrating the issue:
Failing snippet:

Id niprRecordTypeId = Regulatory_Action__c.SObjectType.getDescribe(
        Schema.SObjectDescribeOptions.DEFERRED
      )
      .getRecordTypeInfosByDeveloperName()
      .get('NIPR')
      .getRecordTypeId();

Not failing snippet:

Id niprRecordTypeId = Regulatory_Action__c.SObjectType.getDescribe(
        SObjectDescribeOptions.DEFERRED
      )
      .getRecordTypeInfosByDeveloperName()
      .get('NIPR')
      .getRecordTypeId();

Expected outcome: The rule should not fail when explicitly invoking the Schema namespace, given this is a correct usage of the enum, accepted by the compiler.

Running PMD through: CLI

Reacted by Renato Oliveira and Marek Madejski

Activity

  1. FedeAbella
    added
    a:false-positivePMD flags a piece of code that is not problematic
    on Jun 21, 2024
  2. TrangOul
    added 5 commits that reference this issue on Oct 1, 2026

    Fix EagerlyLoadedDescribeSObjectResult rule to accept Schema namespac…

    This issue will close once commit 48862a9 is merged into the 'main' branch.
    48862a9

    Fix EagerlyLoadedDescribeSObjectResult rule to accept Schema namespac…

    This issue will close once commit 39b2be4 is merged into the 'main' branch.
    39b2be4

    Allow `Schema.` in `EagerlyLoadedDescribeSObjectResult`

    This issue will close once commit 15e2b86 is merged into the 'main' branch.
    15e2b86

    Allow `Schema.` in `EagerlyLoadedDescribeSObjectResult`

    This issue will close once commit a31810c is merged into the 'main' branch.
    a31810c

    Allow `Schema.` in `EagerlyLoadedDescribeSObjectResult`

    This issue will close once commit 5dd05f6 is merged into the 'main' branch.
    5dd05f6
  3. adangel
    changed the title [-][apex] EagerlyLoadedDescribeSObjectResult rule fails when SObjectDescribeOptions is called using explicit Schema namespace[/-] [+][apex] EagerlyLoadedDescribeSObjectResult: false positive with fully qualified SObjectDescribeOptions[/+] on Oct 23, 2026
  4. adangel
    changed the title [-][apex] EagerlyLoadedDescribeSObjectResult: false positive with fully qualified SObjectDescribeOptions[/-] [+][apex] EagerlyLoadedDescribeSObjectResult: false positive with fully qualified SObjectDescribeOptions/FieldDescribeOptions[/+] on Oct 26, 2026
  5. adangel
    added this to the 7.29.0 milestone on Oct 26, 2026
  6. adangel
    added a commit that references this issue on Oct 26, 2026

    Update release notes (pmd#5082)

    702bded
  7. adangel
    closed this as completedin #7131on Oct 26, 2026
  8. dschach
    added a commit that references this issue on Oct 26, 2026

    [apex] Fix pmd#5082: Allow "Schema." in "EagerlyLoadedDescribeSObject…

    This issue will close once commit f4e059d is merged into the 'main' branch.
    f4e059d
  9. adangel
    changed the title [-][apex] EagerlyLoadedDescribeSObjectResult: false positive with fully qualified SObjectDescribeOptions/FieldDescribeOptions[/-] [+][apex] EagerlyLoadedDescribeSObjectResult: False positive with fully qualified SObjectDescribeOptions/FieldDescribeOptions[/+] on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positivePMD flags a piece of code that is not problematic

    Type

    No type

    Projects

    No projects

      Milestone

      • 7.29.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.