-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setDatabaseResult(EmptyRecycleBinResult) and setDatabaseResult(List<EmptyRecycleBinResult>) #806
Merged
Merged
Add setDatabaseResult(EmptyRecycleBinResult) and setDatabaseResult(List<EmptyRecycleBinResult>) #806
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f942352
Added EmptyRecycleBinResult - documentation
fa19e17
Added EmptyRecycleBinResult - logic
TrangOul 137a4f7
Added EmptyRecycleBinResult mocks to LoggerMockDataCreator
TrangOul fc055e8
Merge branch 'main' into main
TrangOul b75af78
unit tests for EmptyRecycleBinResult and UT improvements
TrangOul d214189
some tests simplified
TrangOul 2861c9e
null coalescing operators
TrangOul 36c937a
System.now and System.today replaced with more explicit equivalents
TrangOul 31d65d6
Bumped package version number, name, and description
jongpie dfd7b8c
[WIP] Fixed some test failures in Logger_Tests
jongpie c37a2dc
Reverted changes to casing in UserInfo.getUsername()
jongpie 85277b4
Reverted changes to System.now() and System.today()
jongpie 1f462c1
Fixed some test failures in Logger_Tests caused by LogEntryHandler tr…
jongpie 367b013
Fixed & suppressed some existing PMD scan violations
jongpie 7741ed2
Added some additional tests in LogEntryEventBuilder_Tests for Databas…
jongpie 09cafe6
[skip ci] Manually created new core unlocked package version
jongpie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jongpie, why? It was correct, according to the Salesforce API.

The IDE complains about the current one:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TrangOul I've never seen that warning in VS Code, but maybe I've disabled whatever option that is - do you know what plugin/feature controls that warning message?
Personally, I've always considered the user of
getUserName()
(capitalN
) a bug in Apex/Salesforce docs. I thinkgetUsername()
should be considered the correct casing - it's consistent with the rest of the platform, and it provides clarification that it is referring to the "username", and the "user's name".Username
with a lowercasen
. The only place I'm aware of in Salesforce that uses the capitalN
is that method name. And since it returns the value of the fieldUser.Username
, I think the method name should use the same casing.User.Username
field has lowercasen
in the field API name, the field label, and the corresponding docsSalesforce login pages (including Community Cloud/Experience Cloud, etc) all
I've also worked on multiple teams (at different companies) where using
getUserName()
is too ambiguous & confusing for people new to Apex (or anyone unfamiliar with theUserInfo
class), occasionally resulting in bugs.UserName
referred to the user's name (i.e., theUser.Name
field that combinesUser.FirstName
andUser.LastName
UserName
referred to the user's username (i.e., theUser.Username
field)I think both are valid thoughts/guesses with the
UserName
casing - Salesforce usesUser
as a prefix on large number of standard fields (listed below), so I think there will always, inevitably, be some confusion ifgetUserName()
refers toUser.Name
orUser.Username
User.UserRoleId
User.UserType
UserPermissions...
, likeUser.UserPermissionsMobileUser
UserPreferences....
, likeUser.UserPreferencesUserDebugModePref
But I've personally never had a situation where using
getUsername()
is unclear/confusing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jongpie, I'm using WebStorm with Illuminated Cloud 2. Here are my settings:

Unfortunately, Salesforce is inconsistent when it comes to letter casing. Another example: SObject:

(in my own code I use
sobject
at the beginning of the name andSObject
later, for examplegetSObjectApiName(sobj)
; IMOsObj
looks goofy)It's even more annoying, since Apex is case-insensitive and such inconsistencies could be fixed in one of the release updated without causing any regression.
I agree with your reasoning that
Username
= username (technical) andUserName
= user's name (user-friendly), and I also stick to "username" as a single word in my own class/function/variable names (and also correct them in code reviews).Nevertheless, I'm sticking to what SF API uses because it simplifies my workflow - I just use automatic formatting (which, obviously, does much more that changing the case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TrangOul thanks for the info & sharing your perspective! I might need to finally try Illuminated Cloud 2 again, it seems like it has a lot of cool features built in that I'd like to try out.
I wasn't aware of those inconsistencies of
sobj.getSObjectType()
andrecordId.getSobjectType()
😭 That's kind of crazy, haha I wish Salesforce would be consistent (especially sinceSObject
andSObjectType
are a Salesforce-created terms). I personally find that having consistency (like always useSObject
, neverSobject
) really helps me with readability when jumping between different parts of the codebase (especially as Nebula Logger's codebase continues to grow in size/lines of code). But I totally understand your approach of sticking to what SF API uses if it simplifies your workflow.