Skip to content

Commit

Permalink
Perform clean code of bundles/org.eclipse.equinox.p2.engine
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipse-equinox-bot committed Jan 29, 2025
1 parent f62c027 commit 42284c5
Show file tree
Hide file tree
Showing 23 changed files with 59 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ActionManager implements IRegistryChangeListener {
public static final String SERVICE_NAME = ActionManager.class.getName();

private HashMap<String, IConfigurationElement> actionMap;
private TouchpointManager touchpointManager;
private final TouchpointManager touchpointManager;

public ActionManager() {
this.touchpointManager = new TouchpointManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public class CollectEvent extends EventObject {
*/
public static final int TYPE_REPOSITORY_END = 4;

private IArtifactRepository artifactRepo;
private IArtifactRequest[] requests;
private final IArtifactRepository artifactRepo;
private final IArtifactRequest[] requests;

private ProvisioningContext context;
private final ProvisioningContext context;

private int type;
private final int type;

public CollectEvent(int type, IArtifactRepository artifactRepo, ProvisioningContext context, IArtifactRequest[] requests) {
super(requests);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class DownloadManager {
return 0;
};

private Set<IInstallableUnit> ius;
private final Set<IInstallableUnit> ius;

public DownloadManager(ProvisioningContext context, IProvisioningAgent agent) {
this(context, Set.of(), agent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class Engine implements IEngine {

private static final String ENGINE = "engine"; //$NON-NLS-1$
private IProvisioningAgent agent;
private final IProvisioningAgent agent;

public Engine(IProvisioningAgent agent) {
this.agent = agent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ private static class ActionsRecord {
}
}

private List<Object[]> phaseActionRecordsPairs = new ArrayList<>();
private final List<Object[]> phaseActionRecordsPairs = new ArrayList<>();

private Phase currentPhase;
boolean currentPhaseActive;

private List<ActionsRecord> currentActionRecords;
private ActionsRecord currentRecord;

private IProfile profile;
private final IProfile profile;

private ProvisioningContext context;
private final ProvisioningContext context;

private final HashMap<String, Object> sessionServices = new HashMap<>();

private Set<Touchpoint> touchpoints = new HashSet<>();
private final Set<Touchpoint> touchpoints = new HashSet<>();

private final IProvisioningAgent agent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public class InstallableUnitEvent extends EventObject {
public static final int CONFIGURE = 3;
private static final long serialVersionUID = 3318712818811459886L;

private String phaseId;
private boolean prePhase;

private IProfile profile;
private IInstallableUnit iu;
private Touchpoint touchpoint;
private IStatus result;
private int type;
private final String phaseId;
private final boolean prePhase;

private final IProfile profile;
private final IInstallableUnit iu;
private final Touchpoint touchpoint;
private final IStatus result;
private final int type;

public InstallableUnitEvent(String phaseId, boolean prePhase, IProfile profile, IInstallableUnit iu, int type, Touchpoint touchpoint) {
this(phaseId, prePhase, profile, iu, type, touchpoint, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public ActionEntry(String actionId, VersionRange versionRange) {
}

private static final String VERSION_EQUALS = "version="; //$NON-NLS-1$
private ActionManager actionManager;
private final ActionManager actionManager;

public InstructionParser(ActionManager actionManager) {
Assert.isNotNull(actionManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
*/
public class MissingAction extends ProvisioningAction {

private String actionId;
private VersionRange versionRange;
private final String actionId;
private final VersionRange versionRange;

public MissingAction(String actionId, VersionRange versionRange) {
this.actionId = actionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
import org.eclipse.equinox.p2.engine.spi.*;

public class ParameterizedProvisioningAction extends ProvisioningAction {
private ProvisioningAction action;
private Map<String, String> actionParameters;
private final ProvisioningAction action;
private final Map<String, String> actionParameters;
//ActualParameter is used to keep values to which variables have been resolved.
//This is especially useful when undoing in the presence of variables that change (e.g. lastResult)
private Map<String, Object> actualParameters;
private String actionText;
private final Map<String, Object> actualParameters;
private final String actionText;

public ParameterizedProvisioningAction(ProvisioningAction action, Map<String, String> actionParameters, String actionText) {
if (action == null || actionParameters == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public abstract class Phase {
protected int mainPerformWork = 10000;
protected int postPerformWork = 1000;
private Map<String, Object> operandParameters = null;
private Map<String, Object> phaseParameters = new HashMap<>();
private Map<Touchpoint, Map<String, Object>> touchpointToTouchpointPhaseParameters = new HashMap<>();
private Map<Touchpoint, Map<String, Object>> touchpointToTouchpointOperandParameters = new HashMap<>();
private final Map<String, Object> phaseParameters = new HashMap<>();
private final Map<Touchpoint, Map<String, Object>> touchpointToTouchpointPhaseParameters = new HashMap<>();
private final Map<Touchpoint, Map<String, Object>> touchpointToTouchpointOperandParameters = new HashMap<>();
ActionManager actionManager; // injected from phaseset
protected boolean isPaused = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public class PhaseEvent extends EventObject {
public static final int TYPE_START = 1;
public static final int TYPE_END = 2;

private int type;
private final int type;

private String phaseId;
private final String phaseId;

private Operand[] operands;
private final Operand[] operands;

public PhaseEvent(String phaseId, Operand[] operands, int type) {
super(operands);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public Iterator<IInstallableUnit> getCandidates(IEvaluationContext ctx, IExpress
/**
* This storage is to be used by the touchpoints to store data.
*/
private OrderedProperties storage = new OrderedProperties();
private final OrderedProperties storage = new OrderedProperties();

private IUMap ius = new IUMap();
private final IUMap ius = new IUMap();
final Map<IInstallableUnit, OrderedProperties> iuProperties = new HashMap<>();
private boolean changed = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class ProfileEvent extends EventObject implements IProfileEvent {
private static final long serialVersionUID = 3082402920617281765L;

private int reason;
private final int reason;

public ProfileEvent(String profileId, int reason) {
super(profileId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ProfileMetadataRepository extends AbstractMetadataRepository {
public static final String TYPE = "org.eclipse.equinox.p2.engine.repo.metadataRepository"; //$NON-NLS-1$
public static final Integer VERSION = 1;
private IProfile profile;
private HashSet<IRepositoryReference> repositories = new HashSet<>();
private final HashSet<IRepositoryReference> repositories = new HashSet<>();

public ProfileMetadataRepository(IProvisioningAgent agent, URI location, IProgressMonitor monitor) throws ProvisionException {
super(agent, location.toString(), TYPE, VERSION.toString(), location, null, null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ protected class IUPropertiesHandler extends AbstractHandler {

private final String[] required = new String[] {ID_ATTRIBUTE, VERSION_ATTRIBUTE};

private String iuIdentity;
private Map<String, Map<String, String>> iusPropertiesMap;
private final String iuIdentity;
private final Map<String, Map<String, String>> iusPropertiesMap;
private PropertiesHandler propertiesHandler;

public IUPropertiesHandler(AbstractHandler parentHandler, Attributes attributes, Map<String, Map<String, String>> iusPropertiesMap) {
Expand Down Expand Up @@ -168,7 +168,7 @@ public void startElement(String name, Attributes attributes) {

protected class IUsPropertiesHandler extends AbstractHandler {

private Map<String, Map<String, String>> iusPropertiesMap;
private final Map<String, Map<String, String>> iusPropertiesMap;

public IUsPropertiesHandler(AbstractHandler parentHandler, Attributes attributes) {
super(parentHandler, IUS_PROPERTIES_ELEMENT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public IQueryable<IInstallableUnit> getAdditions() {
}

private class QueryablePlan implements IQueryable<IInstallableUnit> {
private boolean addition;
private final boolean addition;

public QueryablePlan(boolean add) {
this.addition = add;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class RollbackOperationEvent extends TransactionEvent {

private static final long serialVersionUID = -2076492953949691215L;
private IStatus cause;
private final IStatus cause;

public RollbackOperationEvent(IProfile profile, PhaseSet phaseSet, Operand[] operands, IEngine engine, IStatus cause) {
super(profile, phaseSet, operands, engine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService {
* Reference to Map of String(Profile id)->Profile.
*/
private SoftReference<Map<String, Profile>> profiles;
private Map<String, ProfileLock> profileLocks = new HashMap<>();
private final Map<String, ProfileLock> profileLocks = new HashMap<>();

private String self;

//Whether the registry should update the self profile when the registry is restored
private boolean updateSelfProfile;
private final boolean updateSelfProfile;

private File store;
private final File store;

ISurrogateProfileHandler surrogateProfileHandler;

Expand Down Expand Up @@ -977,10 +977,10 @@ public void stop() {
// Class representing a particular instance of a profile's state properties.
// Can be used for caching.
class ProfileStateProperties {
private String id;
private File file;
private long timestamp;
private Properties properties;
private final String id;
private final File file;
private final long timestamp;
private final Properties properties;

ProfileStateProperties(String id, File file, Properties properties) {
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TouchpointManager implements IRegistryChangeListener {

private static class TouchpointEntry {

private IConfigurationElement element;
private final IConfigurationElement element;
private boolean createdExtension = false;
private Touchpoint touchpoint = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class CertificateChecker {
private final PGPPublicKeyService keyService;

// Lazily loading
private Supplier<PGPPublicKeyStore> trustedKeys = new Supplier<>() {
private final Supplier<PGPPublicKeyStore> trustedKeys = new Supplier<>() {
private PGPPublicKeyStore cache = null;

public PGPPublicKeyStore get() {
Expand All @@ -90,7 +90,7 @@ public PGPPublicKeyStore get() {

// Lazily loading in case we ever add an extension point for registering
// certificates.
private Supplier<Collection<? extends Certificate>> additionalTrustedCertificates = new Supplier<>() {
private final Supplier<Collection<? extends Certificate>> additionalTrustedCertificates = new Supplier<>() {
private Collection<? extends Certificate> cache = null;

public Collection<? extends Certificate> get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public final class ProfileScope implements IScopeContext {
*/
public static final String SCOPE = "profile"; //$NON-NLS-1$

private String profileId;
private final String profileId;

private IAgentLocation location;
private final IAgentLocation location;

/**
* Creates and returns a profile scope for the given profile id and agent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@
* @since 2.0
*/
public class ProvisioningContext {
private IProvisioningAgent agent;
private final IProvisioningAgent agent;
private URI[] artifactRepositories; //artifact repositories to consult
private final List<IInstallableUnit> extraIUs = Collections.synchronizedList(new ArrayList<>());
private URI[] metadataRepositories; //metadata repositories to consult
private final Map<String, String> properties = new HashMap<>();
private Map<String, URI> referencedArtifactRepositories = null;
private Map<URI, IArtifactRepository> loadedArtifactRepositories = new HashMap<>();
private Map<URI, IMetadataRepository> loadedMetadataRepositories = new HashMap<>();
private final Map<URI, IArtifactRepository> loadedArtifactRepositories = new HashMap<>();
private final Map<URI, IMetadataRepository> loadedMetadataRepositories = new HashMap<>();
private Map<URI, IMetadataRepository> allLoadedMetadataRepositories;
private Map<URI, IArtifactRepository> allLoadedArtifactRepositories;
private Set<URI> failedArtifactRepositories = new HashSet<>();
private Set<URI> failedMetadataRepositories = new HashSet<>();
private final Set<URI> failedArtifactRepositories = new HashSet<>();
private final Set<URI> failedMetadataRepositories = new HashSet<>();

class ArtifactRepositoryQueryable implements IQueryable<IArtifactRepository> {
List<IArtifactRepository> repositories;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
public class Value<T> {
public static final Value<Object> NO_VALUE = new Value<>(null);
private T value;
private final T value;
private Class<T> clazz;

public Value(T val) {
Expand Down

0 comments on commit 42284c5

Please sign in to comment.