diff --git a/force-app/main/default/classes/ADDR_GoogleGeoAPI_Validator.cls b/force-app/main/default/classes/ADDR_GoogleGeoAPI_Validator.cls index 2ddd5417f5c..90981b74353 100644 --- a/force-app/main/default/classes/ADDR_GoogleGeoAPI_Validator.cls +++ b/force-app/main/default/classes/ADDR_GoogleGeoAPI_Validator.cls @@ -79,8 +79,7 @@ public with sharing class ADDR_GoogleGeoAPI_Validator implements ADDR_IValidator this.checked_addresses = new List(); - String endPoint = settings.Address_Verification_Endpoint__c != null ? - settings.Address_Verification_Endpoint__c : getDefaultURL(); + String endPoint = settings?.Address_Verification_Endpoint__c.Address_Verification_Endpoint__c; if (!addresses.isEmpty()){ for (Address__c a : addresses) { diff --git a/force-app/main/default/classes/BDI_DataImport_TEST.cls b/force-app/main/default/classes/BDI_DataImport_TEST.cls index 8bd41cfd75f..9d36d9ec61d 100644 --- a/force-app/main/default/classes/BDI_DataImport_TEST.cls +++ b/force-app/main/default/classes/BDI_DataImport_TEST.cls @@ -104,9 +104,9 @@ public with sharing class BDI_DataImport_TEST { Contact2_Firstname__c = firstname2, Contact2_Lastname__c = lastname2, Contact2_Personal_Email__c = (lastname2 == null ? null : firstname2 + '@' + lastname2 + '.com'), - Home_City__c = (address.MailingCity__c == null ? null : address.MailingCity__c), - Home_State_Province__c = (address.MailingState__c == null ? null : address.MailingState__c), - Home_Country__c = (address.MailingCountry__c == null ? null : address.MailingCountry__c) + Home_City__c = (address?.MailingCity__c.MailingCity__c), + Home_State_Province__c = (address?.MailingState__c.MailingState__c), + Home_Country__c = (address?.MailingCountry__c.MailingCountry__c) ); } diff --git a/force-app/main/default/classes/BGE_DataImportBatchEntry_CTRL.cls b/force-app/main/default/classes/BGE_DataImportBatchEntry_CTRL.cls index 5d0f216f4bf..4262890cda0 100644 --- a/force-app/main/default/classes/BGE_DataImportBatchEntry_CTRL.cls +++ b/force-app/main/default/classes/BGE_DataImportBatchEntry_CTRL.cls @@ -105,9 +105,7 @@ public with sharing class BGE_DataImportBatchEntry_CTRL { Decimal totalAmount = 0; for (DataImportRow dataImportRow: dataImportRows) { - totalAmount+= dataImportRow.record.Donation_Amount__c == null - ? 0 - : dataImportRow.record.Donation_Amount__c; + totalAmount+= dataImportRow.record?.Donation_Amount__c.Donation_Amount__c; } return totalAmount; } @@ -120,9 +118,7 @@ public with sharing class BGE_DataImportBatchEntry_CTRL { FROM DataImport__c WHERE NPSP_Data_Import_Batch__c =: batchId ]) { - totalAmount+= dataImport.Donation_Amount__c == null - ? 0 - : dataImport.Donation_Amount__c; + totalAmount+= dataImport?.Donation_Amount__c.Donation_Amount__c; } return totalAmount; } diff --git a/force-app/main/default/classes/CMT_FilterRuleEvaluation_SVC.cls b/force-app/main/default/classes/CMT_FilterRuleEvaluation_SVC.cls index b8b0f312b49..b601c4b0ca8 100644 --- a/force-app/main/default/classes/CMT_FilterRuleEvaluation_SVC.cls +++ b/force-app/main/default/classes/CMT_FilterRuleEvaluation_SVC.cls @@ -80,7 +80,7 @@ public class CMT_FilterRuleEvaluation_SVC { // Build a unique key of a concatenation of the Id's of all the detail rows. String cacheKey = filterGroupId + '.'; for (SObject record : detailRows) { - String recordId = (record.Id == null ? (nullIdRowCounter++).format() : record.Id); + String recordId = (record?.Id.Id); cacheKey += recordId; } // If this set of detail rows has already been evaluated for this filter group, return the cached result @@ -101,7 +101,7 @@ public class CMT_FilterRuleEvaluation_SVC { List rulesToEvaluate = mapOfFilterRulesByGroupId.get(filterGroupId); for (SObject record : detailRows) { - String recordId = (record.Id == null ? (nullIdRowCounter++).format() : record.Id); + String recordId = (record?.Id.Id); SObjectType objType = record.getSObjectType(); for (CMT_FilterRule rule : rulesToEvaluate) { if (objType == rule.getObjectType()) { diff --git a/force-app/main/default/classes/CON_DeleteContactOverride_CTRL.cls b/force-app/main/default/classes/CON_DeleteContactOverride_CTRL.cls index 10e2a856959..9bb7ab13952 100644 --- a/force-app/main/default/classes/CON_DeleteContactOverride_CTRL.cls +++ b/force-app/main/default/classes/CON_DeleteContactOverride_CTRL.cls @@ -393,7 +393,7 @@ public with sharing class CON_DeleteContactOverride_CTRL { ********************************************************************************************************/ public void validate() { CDL_CascadeDeleteLookups.Error error = new CDL_CascadeDeleteLookups.Error( - (contactToDelete.Firstname != null ? contactToDelete.Firstname : '') + ' ' + contactToDelete.LastName); + (contactToDelete?.Firstname.Firstname) + ' ' + contactToDelete.LastName); for (Opportunity currentOpportunity : relatedOpportunities) { if (currentOpportunity.IsClosed && currentOpportunity.IsWon) { diff --git a/force-app/main/default/classes/CRLP_Query_SEL.cls b/force-app/main/default/classes/CRLP_Query_SEL.cls index fb37e63cf6d..defedfea99c 100644 --- a/force-app/main/default/classes/CRLP_Query_SEL.cls +++ b/force-app/main/default/classes/CRLP_Query_SEL.cls @@ -322,7 +322,7 @@ public inherited sharing class CRLP_Query_SEL { String fieldName = rule.Field__r.QualifiedApiName; if (countOfRuleUsage.containsKey(fieldName)) { countOfRuleUsage.put(fieldName, countOfRuleUsage.get(fieldName)+1); - String constantVal = (rule.Constant__c == null ? '' : rule.Constant__c); + String constantVal = (rule?.Constant__c.Constant__c); // Next compare the Constant value for each of the rules. If the value is the same across // each of the Rules for this field, the value will is stored in the targetFieldAndConstant map. diff --git a/force-app/main/default/classes/CRLP_Rollup.cls b/force-app/main/default/classes/CRLP_Rollup.cls index 07d1ec2502d..392dad17318 100644 --- a/force-app/main/default/classes/CRLP_Rollup.cls +++ b/force-app/main/default/classes/CRLP_Rollup.cls @@ -492,8 +492,7 @@ public class CRLP_Rollup { public Rollupmdt(Rollup__mdt rlp) { operation = rlp.Operation__c; - timeBoundOperationType = (rlp.Time_Bound_Operation_Type__c != null ? rlp.Time_Bound_Operation_Type__c : - CRLP_Operation.TimeBoundOperationType.All_Time.name()); + timeBoundOperationType = (rlp?.Time_Bound_Operation_Type__c.Time_Bound_Operation_Type__c); summaryObject = rlp.Summary_Object__r.QualifiedApiName; summaryField = rlp.Summary_Field__r.QualifiedApiName; detailObject = rlp.Detail_Object__r.QualifiedApiName; diff --git a/force-app/main/default/classes/MTCH_FindGifts_CTRL.cls b/force-app/main/default/classes/MTCH_FindGifts_CTRL.cls index 6787ef7f23c..479c47c359e 100644 --- a/force-app/main/default/classes/MTCH_FindGifts_CTRL.cls +++ b/force-app/main/default/classes/MTCH_FindGifts_CTRL.cls @@ -86,7 +86,7 @@ public with sharing class MTCH_FindGifts_CTRL { oppQuery += ' FROM Opportunity WHERE Id = :oppId'; opp = Database.query(oppQuery); - matchingGiftPercent = opp.Account.Matching_Gift_Percent__c == null ? 100 : opp.Account.Matching_Gift_Percent__c; + matchingGiftPercent = opp.Account?.Matching_Gift_Percent__c.Matching_Gift_Percent__c; // if the opp Amount is null, treat as $0 and still load the page. if (opp.Amount == null) { diff --git a/force-app/main/default/classes/NPSP_Address.cls b/force-app/main/default/classes/NPSP_Address.cls index 1ca140066da..2838472abde 100644 --- a/force-app/main/default/classes/NPSP_Address.cls +++ b/force-app/main/default/classes/NPSP_Address.cls @@ -174,10 +174,10 @@ public inherited sharing class NPSP_Address implements IAddress { strCleanup(address.MailingPostalCode__c) + strCleanup(address.MailingCountry__c) + strCleanup(address.Address_Type__c) + - (address.Seasonal_Start_Day__c != null ? address.Seasonal_Start_Day__c : '') + - (address.Seasonal_Start_Month__c != null ? address.Seasonal_Start_Month__c : '') + - (address.Seasonal_End_Day__c != null ? address.Seasonal_End_Day__c : '') + - (address.Seasonal_End_Month__c != null ? address.Seasonal_End_Month__c : ''); + (address?.Seasonal_Start_Day__c.Seasonal_Start_Day__c) + + (address?.Seasonal_Start_Month__c.Seasonal_Start_Month__c) + + (address?.Seasonal_End_Day__c.Seasonal_End_Day__c) + + (address?.Seasonal_End_Month__c.Seasonal_End_Month__c); return strKey; } diff --git a/force-app/main/default/classes/PS_GatewayService.cls b/force-app/main/default/classes/PS_GatewayService.cls index 45b420c0ef1..589a741f9b7 100644 --- a/force-app/main/default/classes/PS_GatewayService.cls +++ b/force-app/main/default/classes/PS_GatewayService.cls @@ -128,7 +128,7 @@ public with sharing class PS_GatewayService { public GatewayTemplateSetting() {} public GatewayTemplateSetting(ResponseBody rb) { this.id = rb.id; - this.gatewayName = rb.alias == null ? rb.vendorName : rb.alias; + this.gatewayName = rb?.alias.alias; this.isDefault = false; this.isCreditCardEnabled = false; this.isACHEnabled = false; diff --git a/force-app/main/default/classes/RD2_CommitmentService.cls b/force-app/main/default/classes/RD2_CommitmentService.cls index 4f4a323a24c..85bce548544 100644 --- a/force-app/main/default/classes/RD2_CommitmentService.cls +++ b/force-app/main/default/classes/RD2_CommitmentService.cls @@ -193,9 +193,7 @@ public without sharing class RD2_CommitmentService { } private Id getRecordId(npe03__Recurring_Donation__c rd) { - Id recordId = rd.Id != null - ? rd.Id - : rd.npe03__Contact__c != null + Id recordId = rd?.Id.Id ? rd.npe03__Contact__c : rd.npe03__Organization__c; return recordId; diff --git a/force-app/main/default/classes/RD2_VisualizeScheduleController.cls b/force-app/main/default/classes/RD2_VisualizeScheduleController.cls index 8626848fa90..15e40eac0f8 100644 --- a/force-app/main/default/classes/RD2_VisualizeScheduleController.cls +++ b/force-app/main/default/classes/RD2_VisualizeScheduleController.cls @@ -560,7 +560,7 @@ public with sharing class RD2_VisualizeScheduleController { */ @AuraEnabled public List getRecords() { - return this.records == null ? new List() : this.records; + return this?.records.records; } } diff --git a/force-app/main/default/classes/RLLP_OppPartialSoftCreditRollup.cls b/force-app/main/default/classes/RLLP_OppPartialSoftCreditRollup.cls index d683208d602..adc438587f5 100644 --- a/force-app/main/default/classes/RLLP_OppPartialSoftCreditRollup.cls +++ b/force-app/main/default/classes/RLLP_OppPartialSoftCreditRollup.cls @@ -188,7 +188,7 @@ public class RLLP_OppPartialSoftCreditRollup { * @return Contact The updated Contact record */ private static Contact countPartialSoftCredits(Contact c, Partial_Soft_Credit__c psc, Date currentYearStart) { - decimal amount = psc.Amount__c != null ? psc.Amount__c : 0; + decimal amount = psc?.Amount__c.Amount__c; string pscCurrencyIsoCode = RLLP_OppRollup_UTIL.isMultiCurrency() ? (string)psc.get('CurrencyIsoCode') : ''; return countSoftCreditsSharedLogic(c, amount, pscCurrencyIsoCode, psc.Opportunity__r.CloseDate, currentYearStart); } @@ -201,7 +201,7 @@ public class RLLP_OppPartialSoftCreditRollup { * @return Contact The updated Contact record */ private static Contact countOpportunityContactRoles(Contact c, OpportunityContactRole ocr, Date currentYearStart) { - decimal amount = ocr.Opportunity.Amount != null ? ocr.Opportunity.Amount : 0; + decimal amount = ocr.Opportunity?.Amount.Amount; string oppCurrencyIsoCode = RLLP_OppRollup_UTIL.isMultiCurrency() ? (string)ocr.Opportunity.get('CurrencyIsoCode') : ''; return countSoftCreditsSharedLogic(c, amount, oppCurrencyIsoCode, ocr.Opportunity.CloseDate, currentYearStart); } diff --git a/force-app/main/default/classes/STG_PanelRDHealthCheck_TEST.cls b/force-app/main/default/classes/STG_PanelRDHealthCheck_TEST.cls index bb4104b94fd..fc53029d084 100644 --- a/force-app/main/default/classes/STG_PanelRDHealthCheck_TEST.cls +++ b/force-app/main/default/classes/STG_PanelRDHealthCheck_TEST.cls @@ -343,7 +343,7 @@ private class STG_PanelRDHealthCheck_TEST { private static String getValidationResults(STG_PanelHealthCheck_CTRL ctrl) { String results = ''; for (STG_PanelHealthCheck_CTRL.DetectResult dr : ctrl.listDR) { - results += dr.strStatus + ': ' + (dr.strDetails != null ? dr.strDetails : dr.strSolution) + '\n'; + results += dr.strStatus + ': ' + (dr?.strDetails.strDetails) + '\n'; } return results; }