Skip to content

Commit

Permalink
Merge pull request #105 from MarkEWaite/silence-checkstyle-warnings
Browse files Browse the repository at this point in the history
Fix checkstyle warnings from recent changes
  • Loading branch information
MarkEWaite committed Oct 10, 2019
2 parents 197a259 + d5ca460 commit bfe3eb7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;

/** Stores configuration about labels to generate */
/** Stores configuration about labels to generate. */
public class LabelConfig extends AbstractDescribableImpl<LabelConfig> {

private boolean architecture = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
@Extension
public class NodeLabelCache extends ComputerListener {

/** The OS properties for nodes * */
/** The OS properties for nodes. */
private static transient Map<Computer, PlatformDetails> nodePlatformProperties =
Collections.synchronizedMap(new WeakHashMap<>());
/** The labels computed for nodes - accessible package wide. */
Expand All @@ -72,7 +72,7 @@ public final void onOnline(final Computer computer, final TaskListener ignored)
refreshModel(computer);
}

/** When any computer has changed, update the platform labels according to the configuration */
/** When any computer has changed, update the platform labels according to the configuration. */
@Override
public final void onConfigurationChange() {
synchronized (nodePlatformProperties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.Serializable;

/** Stores the platform details of a node */
/** Stores the platform details of a node. */
public class PlatformDetails implements Serializable {

private static final long serialVersionUID = 1L;
Expand All @@ -14,6 +14,13 @@ public class PlatformDetails implements Serializable {
private final String architectureName;
private final String nameVersion;

/**
* Platform details constructor.
*
* @param name name of operating system, as in windows, debian, ubuntu, etc.
* @param architecture hardware architecture, as in amd64, aarh64, etc.
* @param version version of operating system, as in 9.1, 14.04, etc.
*/
public PlatformDetails(String name, String architecture, String version) {
this.name = name;
this.architecture = architecture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ protected PlatformDetails computeLabels(
}

/**
* Maps the ID string from /etc/os-release and /etc/redhat-release to the Distributor ID value
* output by lsb_release -a so that users have the same operating system name in the label whether
* the label was generated using os-release or using lsb_release
* Maps the ID string from /etc/os-release and /etc/redhat-release to the Distributor ID value.
* Matches output by lsb_release -a so that users have the same operating system name in the label
* whether the label was generated using os-release or using lsb_release.
*/
private static final Map<String, String> PREFERRED_LINUX_OS_NAMES = new HashMap<>();

Expand Down Expand Up @@ -287,9 +287,10 @@ String readRedhatReleaseIdentifier(@NonNull String field) {
if (field.equals("ID")) {
value = line.substring(0, line.indexOf(RELEASE)).trim();
}
if (field.equals("VERSION_ID"))
if (field.equals("VERSION_ID")) {
value =
line.substring(line.indexOf(RELEASE) + RELEASE.length(), line.indexOf("(")).trim();
}
}
}
} catch (IOException notFound) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class PlatformLabelerGlobalConfiguration extends GlobalConfiguration {

private LabelConfig labelConfig;

/** Standard constructor. */
public PlatformLabelerGlobalConfiguration() {
load();
if (labelConfig == null) {
Expand Down

0 comments on commit bfe3eb7

Please sign in to comment.