Skip to content

Commit

Permalink
Fix PMD violations
Browse files Browse the repository at this point in the history
  • Loading branch information
spyrkob committed Aug 23, 2023
1 parent 066f78d commit 09a584f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.util.List;
import java.util.Set;

import static org.wildfly.prospero.cli.commands.CliConstants.Commands.FEATURE_PACKS;
import static org.wildfly.prospero.cli.commands.CliConstants.Commands.FEATURE_PACKS_ALIAS;

@CommandLine.Command(name = CliConstants.Commands.FEATURE_PACKS, aliases = {FEATURE_PACKS_ALIAS})
Expand Down Expand Up @@ -134,6 +133,6 @@ private ConfigId parseConfigName() {


public FeaturesCommand(CliConsole console, ActionFactory actionFactory) {
super(console, actionFactory, FEATURE_PACKS, List.of(new AddCommand(console, actionFactory)));
super(console, actionFactory, CliConstants.Commands.FEATURE_PACKS, List.of(new AddCommand(console, actionFactory)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ public static class ModelNotDefinedException extends OperationException {

public ModelNotDefinedException(String msg, Set<String> supportedModels) {
super(msg);
this.supportedModels = supportedModels;
}

public ModelNotDefinedException(String msg, String model, Set<String> supportedModels) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
import java.util.zip.ZipOutputStream;

import static org.wildfly.prospero.metadata.ProsperoMetadataUtils.CURRENT_VERSION_FILE;
import static org.wildfly.prospero.metadata.ProsperoMetadataUtils.METADATA_DIR;
import static org.wildfly.prospero.metadata.ProsperoMetadataUtils.PROVISIONING_RECORD_XML;

public class InstallationMetadata implements AutoCloseable {

Expand Down Expand Up @@ -103,7 +101,7 @@ public static InstallationMetadata loadInstallation(Path base) throws MetadataEx
throw ProsperoLogger.ROOT_LOGGER.unableToReadFile(versionsFile, e);
}

final Path provisioningRecordPath = base.resolve(METADATA_DIR).resolve(ProsperoMetadataUtils.PROVISIONING_RECORD_XML);
final Path provisioningRecordPath = base.resolve(ProsperoMetadataUtils.METADATA_DIR).resolve(ProsperoMetadataUtils.PROVISIONING_RECORD_XML);
ProvisioningConfig provisioningConfig = null;
if (Files.exists(provisioningRecordPath)) {
try {
Expand Down Expand Up @@ -315,10 +313,10 @@ public void recordProvision(boolean overrideProsperoConfig, boolean gitRecord) t
*/
public void updateProvisioningConfiguration() throws MetadataException {
try {
if (!Files.exists(base.resolve(METADATA_DIR).resolve(PROVISIONING_RECORD_XML))) {
if (!Files.exists(base.resolve(ProsperoMetadataUtils.METADATA_DIR).resolve(ProsperoMetadataUtils.PROVISIONING_RECORD_XML))) {
ProsperoMetadataUtils.recordProvisioningDefinition(base);

gitStorage.recordChange(SavedState.Type.INTERNAL_UPDATE, PROVISIONING_RECORD_XML);
gitStorage.recordChange(SavedState.Type.INTERNAL_UPDATE, ProsperoMetadataUtils.PROVISIONING_RECORD_XML);
}

// persist in history
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ private static Optional<FeatureChange> createConfigModelDiff(ProvisioningConfig
return Optional.empty();
}

final String oldConfigId = oldCfgModel==null?null:(oldCfgModel.getModel()+":"+oldCfgModel.getName());
final String newConfigId = newCfgModel==null?null:(newCfgModel.getModel()+":"+newCfgModel.getName());
final String oldConfigId = oldCfgModel==null ? null : oldCfgModel.getModel()+":"+oldCfgModel.getName();
final String newConfigId = newCfgModel==null ? null : newCfgModel.getModel()+":"+newCfgModel.getName();

configChanges.add(new FeatureChange(LAYERS, serialize(oldLayers), serialize(newLayers)));

Expand Down

0 comments on commit 09a584f

Please sign in to comment.