Skip to content

Commit

Permalink
Further fixed issues like #308 by adding empty classes with problemat…
Browse files Browse the repository at this point in the history
…ic names (FieldSet, FieldSetMember, SObjectField, SObjectType and Test for now) - this will cause deployment errors in the pipeline if there are any references that don't use the System/Schema namespaces
  • Loading branch information
jongpie committed May 6, 2022
1 parent 10ea49e commit 439d24f
Show file tree
Hide file tree
Showing 22 changed files with 568 additions and 488 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ global with sharing class LogBatchPurger implements Database.Batchable<SObject>,
@TestVisible
private Integer chainedBatchSize = 200;
@TestVisible
private SObjectType currentSObjectType;
private Schema.SObjectType currentSObjectType;
private List<LoggerPlugin__mdt> pluginConfigurations;
private Map<BatchableMethod, List<LoggerPlugin.Batchable>> methodToExecutedApexPlugins = new Map<BatchableMethod, List<LoggerPlugin.Batchable>>();
private Map<BatchableMethod, List<Flow.Interview>> methodToExecutedFlowPlugins = new Map<BatchableMethod, List<Flow.Interview>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
* @description Returns SObject Type that the handler is responsible for processing
* @return The instance of `SObjectType`
*/
public override SObjectType getSObjectType() {
public override Schema.SObjectType getSObjectType() {
return Schema.LogEntryEvent__e.SObjectType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public without sharing class LogEntryHandler extends LoggerSObjectHandler {
* @description Returns SObject Type that the handler is responsible for processing
* @return The instance of `SObjectType`
*/
public override SObjectType getSObjectType() {
public override Schema.SObjectType getSObjectType() {
return Schema.LogEntry__c.SObjectType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public without sharing class LogEntryTagHandler extends LoggerSObjectHandler {
* @description Returns SObject Type that the handler is responsible for processing
* @return The instance of `SObjectType`
*/
public override SObjectType getSObjectType() {
public override Schema.SObjectType getSObjectType() {
return Schema.LogEntryTag__c.SObjectType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public without sharing class LogHandler extends LoggerSObjectHandler {
* @description Returns SObject Type that the handler is responsible for processing
* @return The instance of `SObjectType`
*/
public override SObjectType getSObjectType() {
public override Schema.SObjectType getSObjectType() {
return Schema.Log__c.SObjectType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public without sharing class LoggerTagHandler extends LoggerSObjectHandler {
* @description Returns SObject Type that the handler is responsible for processing
* @return The instance of `SObjectType`
*/
public override SObjectType getSObjectType() {
public override Schema.SObjectType getSObjectType() {
return Schema.LoggerTag__c.SObjectType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/
@SuppressWarnings('PMD.ExcessivePublicCount')
public with sharing class RelatedLogEntriesController {
private static final SObjectType LOG_SOBJECT_TYPE = Schema.Log__c.SObjectType;
private static final SObjectType LOG_ENTRY_SOBJECT_TYPE = Schema.LogEntry__c.SObjectType;
private static final Schema.SObjectType LOG_SOBJECT_TYPE = Schema.Log__c.SObjectType;
private static final Schema.SObjectType LOG_ENTRY_SOBJECT_TYPE = Schema.LogEntry__c.SObjectType;
private static final String DEFAULT_SORT_FIELD_NAME = String.valueOf(Schema.LogEntry__c.Timestamp__c);
private static final String DEFAULT_SORT_DIRECTION = 'DESC';

Expand Down Expand Up @@ -122,7 +122,7 @@ public with sharing class RelatedLogEntriesController {

private static String getDisplayFieldApiName(Schema.DescribeFieldResult lookupFieldDescribe) {
String relationshipName = lookupFieldDescribe.getRelationshipName();
SObjectType lookupSObjectType = lookupFieldDescribe.getReferenceTo().get(0);
Schema.SObjectType lookupSObjectType = lookupFieldDescribe.getReferenceTo().get(0);

// Use username instead of name for user
if (lookupSObjectType == Schema.User.SObjectType) {
Expand Down Expand Up @@ -276,7 +276,7 @@ public with sharing class RelatedLogEntriesController {
@AuraEnabled
public String name { get; set; }

private FieldSetMetadata(SObjectType sobjectType, String fieldSetName) {
private FieldSetMetadata(Schema.SObjectType sobjectType, String fieldSetName) {
this.fields = new List<FieldMetadata>();

Schema.FieldSet fieldSet = sobjectType.getDescribe().fieldSets.getMap().get(fieldSetName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private class LoggerSObjectHandler_Tests {
}

public class MockDefaultImplementationSObjectHandler extends LoggerSObjectHandler {
public override SObjectType getSObjectType() {
public override Schema.SObjectType getSObjectType() {
return Schema.User.SObjectType;
}
}
Expand All @@ -339,7 +339,7 @@ private class LoggerSObjectHandler_Tests {
this.sobjectType = sobjectType;
}

public override SObjectType getSObjectType() {
public override Schema.SObjectType getSObjectType() {
return this.sobjectType;
}

Expand Down
Loading

0 comments on commit 439d24f

Please sign in to comment.