Improved Fully-Qualified References
Since the unlocked package does not have a namespace, orgs can encounter installation errors for Nebula Logger if the target org has any custom Apex code (classes, enums, interfaces, etc.) with the same name as standard class in the Schema
or System
namespace (referred to as name shadowing).
This is the same concept & approach as the changes made in several previous releases (listed below) - but my hope is that this PR finally finishes this effort, and all references are now fully qualified.
This shouldn't cause any functional changes to Nebula Logger - this is to tidy up existing references to avoid name collisions so that more orgs can use the unlocked package.
Core Unlocked Package Changes
Apex Code Changes
-
Switched to using fully-qualified references for these standard classes in the
Schema
andSystem
namespaces :Schema
namespace standard classesApexClass
→Schema.ApexClass
ApexEmailNotification
→Schema.ApexEmailNotification
ApexTrigger
→Schema.ApexTrigger
AsyncApexJob
→Schema.AsyncApexJob
BatchApexErrorEvent
→Schema.BatchApexErrorEvent
CustomPermission
→Schema.CustomPermission
DisplayType
→Schema.DisplayType
FlowDefinitionView
→Schema.FlowDefinitionView
FlowExecutionErrorEvent
→Schema.FlowExecutionErrorEvent
FlowVersionView
→Schema.FlowVersionView
PermissionSet
→Schema.PermissionSet
PermissionSetAssignment
→Schema.PermissionSetAssignment
SoapType
→Schema.SoapType
UserRecordAccess
→Schema.UserRecordAccess
UserRole
→Schema.UserRole
System
namespace standard classesBatchableContext
→System.BatchableContext
Comparable
→System.Comparable
Database
→System.Database
EventBus
→System.EventBus
FinalizerContext
→System.FinalizerContext
InstallHandler
→System.InstallHandler
JSON
→System.JSON
Matcher
→System.Matcher
Pattern
→System.Pattern
PicklistEntry
→System.PicklistEntry
Queueable
→System.Queueable
QueueableContext
→System.QueueableContext
Quiddity
→System.Quiddity
Request
→System.Request
RestContext
→System.RestContext
RestRequest
→System.RestRequest
RestResponse
→System.RestResponse
Schedulable
→System.Schedulable
SchedulableContext
→System.SchedulableContext
Search
→System.Search
TriggerOperation
→System.TriggerOperation
UUID
→System.UUID
-
Scope creep: fixed some flaky tests in
LogBatchPurgeController_Tests
extra-tests
Metadata Changes
- Moved the existing name-shadowing classes in the
extra-tests
directory to be in separate subdirectories (one for each namespace,Schema
andSystem
) - Added several new name-shadowing classes for all of the
Schema
&System
references (mentioned above) that are now using fully-qualified references- These classes are deployed in Nebula Logger's pipeline to enforce that the codebase uses fully-qualified references
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.12...v4.13.13
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oDsQAI
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oDsQAI
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oDsQAI
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oDsQAI