Skip to content

Commit

Permalink
Remove 'transient' modifiers on autowired fields
Browse files Browse the repository at this point in the history
These are most probably not needed, as the respective components
will never be serialized.
  • Loading branch information
mederly committed Jun 19, 2020
1 parent 84567b4 commit b3666e1
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 38 deletions.
Expand Up @@ -54,6 +54,7 @@
/**
* @author semancik
*
* TODO decide on transient autowired fields
*/
@Component
public class ModelObjectResolver implements ObjectResolver {
Expand Down
Expand Up @@ -125,8 +125,8 @@ public class ModelController implements ModelService, TaskService, WorkflowServi
@Autowired private PrismContext prismContext;
@Autowired private ProvisioningService provisioning;
@Autowired private ModelObjectResolver objectResolver;
@Autowired private transient ImportAccountsFromResourceTaskHandler importAccountsFromResourceTaskHandler;
@Autowired private transient ObjectImporter objectImporter;
@Autowired private ImportAccountsFromResourceTaskHandler importAccountsFromResourceTaskHandler;
@Autowired private ObjectImporter objectImporter;
@Autowired private HookRegistry hookRegistry;
@Autowired private TaskManager taskManager;
@Autowired private ScriptingExpressionEvaluator scriptingExpressionEvaluator;
Expand All @@ -144,7 +144,7 @@ public class ModelController implements ModelService, TaskService, WorkflowServi
@Autowired private ChangeNotificationDispatcher dispatcher;
@Autowired
@Qualifier("cacheRepositoryService")
private transient RepositoryService cacheRepositoryService;
private RepositoryService cacheRepositoryService;

@Autowired(required = false) // not required in all circumstances
private WorkflowManager workflowManager;
Expand Down
Expand Up @@ -78,7 +78,7 @@ public class ModelDiagController implements ModelDiagnosticService {

@Autowired
@Qualifier("repositoryService")
private transient RepositoryService repositoryService;
private RepositoryService repositoryService;

@Autowired private ProvisioningService provisioningService;
@Autowired private SecurityEnforcer securityEnforcer;
Expand Down
Expand Up @@ -169,7 +169,7 @@ public class ModelInteractionServiceImpl implements ModelInteractionService {
@Autowired private ObjectMerger objectMerger;
@Autowired
@Qualifier("cacheRepositoryService")
private transient RepositoryService cacheRepositoryService;
private RepositoryService cacheRepositoryService;
@Autowired private ReferenceResolver referenceResolver;
@Autowired private SystemObjectCache systemObjectCache;
@Autowired private ArchetypeManager archetypeManager;
Expand Down
Expand Up @@ -70,7 +70,7 @@ public class SchemaTransformer {
private static final String OP_APPLY_SCHEMAS_AND_SECURITY = SchemaTransformer.class.getName() + ".applySchemasAndSecurity";
private static final String OP_APPLY_SCHEMAS_AND_SECURITY_TO_OBJECT = SchemaTransformer.class.getName() + ".applySchemasAndSecurityToObject";

@Autowired @Qualifier("cacheRepositoryService") private transient RepositoryService cacheRepositoryService;
@Autowired @Qualifier("cacheRepositoryService") private RepositoryService cacheRepositoryService;
@Autowired private SecurityEnforcer securityEnforcer;
@Autowired private SystemObjectCache systemObjectCache;
@Autowired private ArchetypeManager archetypeManager;
Expand Down
Expand Up @@ -121,7 +121,7 @@ public class MidpointFunctionsImpl implements MidpointFunctions {
@Autowired private ModelObjectResolver modelObjectResolver;
@Autowired private ProvisioningService provisioningService;
@Autowired private SecurityContextManager securityContextManager;
@Autowired private transient Protector protector;
@Autowired private Protector protector;
@Autowired private OrgStructFunctionsImpl orgStructFunctions;
@Autowired private LinkedObjectsFunctions linkedObjectsFunctions;
@Autowired private WorkflowService workflowService;
Expand Down
Expand Up @@ -104,7 +104,7 @@ public class ChangeExecutor {

@Autowired private TaskManager taskManager;
@Autowired(required = false) private WorkflowManager workflowManager; // not available e.g. during tests
@Autowired @Qualifier("cacheRepositoryService") private transient RepositoryService cacheRepositoryService;
@Autowired @Qualifier("cacheRepositoryService") private RepositoryService cacheRepositoryService;
@Autowired private ProvisioningService provisioning;
@Autowired private PrismContext prismContext;
@Autowired private ExpressionFactory expressionFactory;
Expand Down
Expand Up @@ -89,8 +89,8 @@ public class Clockwork {
@Autowired private ChangeExecutor changeExecutor;
@Autowired private Clock clock;
@Autowired private SystemObjectCache systemObjectCache;
@Autowired private transient ProvisioningService provisioningService;
@Autowired private transient ChangeNotificationDispatcher changeNotificationDispatcher;
@Autowired private ProvisioningService provisioningService;
@Autowired private ChangeNotificationDispatcher changeNotificationDispatcher;
@Autowired private PersonaProcessor personaProcessor;
@Autowired private PrismContext prismContext;
@Autowired private TaskManager taskManager;
Expand All @@ -111,7 +111,7 @@ public class Clockwork {

@Autowired
@Qualifier("cacheRepositoryService")
private transient RepositoryService repositoryService;
private RepositoryService repositoryService;

private static final int DEFAULT_MAX_CLICKS = 200;

Expand Down
Expand Up @@ -46,7 +46,7 @@ public class ClockworkConflictResolver {

@Autowired private Clockwork clockwork;
@Autowired private ContextFactory contextFactory;
@Autowired @Qualifier("cacheRepositoryService") private transient RepositoryService repositoryService;
@Autowired @Qualifier("cacheRepositoryService") private RepositoryService repositoryService;
@Autowired private PrismContext prismContext;

private static final int DEFAULT_MAX_CONFLICT_RESOLUTION_ATTEMPTS = 1; // synchronize with common-core-3.xsd
Expand Down
Expand Up @@ -52,7 +52,7 @@ public class OperationExecutionRecorder {
@Autowired private Clock clock;
@Autowired private SystemObjectCache systemObjectCache;
@Autowired private PrismContext prismContext;
@Autowired @Qualifier("cacheRepositoryService") private transient RepositoryService repositoryService;
@Autowired @Qualifier("cacheRepositoryService") private RepositoryService repositoryService;

private static final int DEFAULT_NUMBER_OF_RESULTS_TO_KEEP = 5;

Expand Down
Expand Up @@ -74,7 +74,7 @@ public class PersonaProcessor {
private ObjectResolver objectResolver;

@Autowired @Qualifier("cacheRepositoryService")
private transient RepositoryService repositoryService;
private RepositoryService repositoryService;

@Autowired private ContextFactory contextFactory;
@Autowired private Clockwork clockwork;
Expand Down
Expand Up @@ -83,7 +83,7 @@ public class ContextLoader implements ProjectorProcessor {

@Autowired
@Qualifier("cacheRepositoryService")
private transient RepositoryService cacheRepositoryService;
private RepositoryService cacheRepositoryService;

@Autowired private SystemObjectCache systemObjectCache;
@Autowired private ArchetypeManager archetypeManager;
Expand Down
Expand Up @@ -75,7 +75,7 @@ public class AssignmentHolderProcessor implements ProjectorProcessor {

@Autowired
@Qualifier("cacheRepositoryService")
private transient RepositoryService cacheRepositoryService;
private RepositoryService cacheRepositoryService;

@ProcessorMethod
public <AH extends AssignmentHolderType> void processFocus(LensContext<AH> context, String activityDescription, XMLGregorianCalendar now,
Expand Down
Expand Up @@ -87,7 +87,7 @@ public class ObjectTemplateProcessor implements ProjectorProcessor {

@Autowired
@Qualifier("cacheRepositoryService")
private transient RepositoryService cacheRepositoryService;
private RepositoryService cacheRepositoryService;

@Autowired private MappingSetEvaluator mappingSetEvaluator;
@Autowired private MatchingRuleRegistry matchingRuleRegistry;
Expand Down
Expand Up @@ -8,27 +8,15 @@

import java.util.ArrayList;
import java.util.List;

import javax.xml.namespace.QName;

import org.springframework.stereotype.Component;

import com.evolveum.midpoint.model.impl.lens.LensContext;
import com.evolveum.midpoint.model.impl.lens.LensFocusContext;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.delta.ItemDelta;
import com.evolveum.midpoint.repo.api.RepositoryService;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
* @author semancik
Expand All @@ -37,13 +25,6 @@
@Component
public class Migrator {

private static final Trace LOGGER = TraceManager.getTrace(Migrator.class);

@Autowired private PrismContext prismContext;
@Autowired
@Qualifier("cacheRepositoryService")
private transient RepositoryService repositoryService;

public <I extends ObjectType, O extends ObjectType> PrismObject<O> migrate(PrismObject<I> original) {
Class<I> origType = original.getCompileTimeClass();
if (ObjectTemplateType.class.isAssignableFrom(origType)) {
Expand Down

0 comments on commit b3666e1

Please sign in to comment.