Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit ded8cd0

Browse files
committed
Fix variable names
1 parent 06b6012 commit ded8cd0

File tree

6 files changed

+31
-32
lines changed

6 files changed

+31
-32
lines changed

src/main/java/com/mathworks/ci/MatlabInstallation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public static boolean isEmpty() {
7070
}
7171

7272
public static MatlabInstallation getInstallation(String name) {
73-
for (MatlabInstallation _inst : getAll()) {
74-
if (name.equals(_inst.getName())) {
75-
return _inst;
73+
for (MatlabInstallation inst : getAll()) {
74+
if (name.equals(inst.getName())) {
75+
return inst;
7676
}
7777
}
7878
return null;

src/main/java/com/mathworks/ci/MatlabInstallationAxis.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public String getDisplayName() {
4545

4646
@Override
4747
public boolean isInstantiable() {
48-
return !checkMatlabInstallationEmpty();
48+
return !isMatlabInstallationEmpty();
4949
}
5050

51-
public boolean checkUseMATLABVersion(Object it) {
52-
return MatlabItemListener.getMATLABBuildWrapperCheckForPrj(((MatrixProject) it).getFullName()) && !checkMatlabInstallationEmpty();
51+
public boolean checkUseMatlabVersion(Object it) {
52+
return MatlabItemListener.getMatlabBuildWrapperCheckForPrj(((MatrixProject) it).getFullName()) && !isMatlabInstallationEmpty();
5353
}
5454

5555
public MatlabInstallation[] getInstallations () {
@@ -60,7 +60,7 @@ public String getUseMatlabWarning() {
6060
return useMatlabWarning;
6161
}
6262

63-
public boolean checkMatlabInstallationEmpty() {
63+
public boolean isMatlabInstallationEmpty() {
6464
return MatlabInstallation.isEmpty();
6565
}
6666

src/main/java/com/mathworks/ci/MatlabItemListener.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
@Extension
2525
public final class MatlabItemListener extends ItemListener {
26-
private static final Map<String, Boolean> prjCheckMATLABAxis = new HashMap<>();
27-
private static final Map<String, Boolean> prjCheckMATLABBuildWrapper = new HashMap<>();
26+
private static final Map<String, Boolean> prjCheckMatlabAxis = new HashMap<>();
27+
private static final Map<String, Boolean> prjCheckMatlabBuildWrapper = new HashMap<>();
2828

2929
@Override
3030
public void onLoaded(){
@@ -52,40 +52,40 @@ private void checkSingleItem(Item item){
5252
check((MatrixProject) item);
5353
}
5454

55-
private void check(MatrixProject _prj) {
56-
checkForAxis(_prj);
57-
checkForBuildWrapper(_prj);
55+
private void check(MatrixProject prj) {
56+
checkForAxis(prj);
57+
checkForBuildWrapper(prj);
5858
}
5959

60-
private void checkForAxis(MatrixProject _prj) {
60+
private void checkForAxis(MatrixProject prj) {
6161
boolean checkForAxis = false;
62-
Collection<MatrixConfiguration> conf = _prj.getActiveConfigurations();
63-
for(MatrixConfiguration _conf : conf){
64-
String a = _conf.getCombination().get(Message.getValue("Axis.matlab.key"));
65-
if (a != null) {
62+
Collection<MatrixConfiguration> configurations = prj.getActiveConfigurations();
63+
for(MatrixConfiguration conf : configurations){
64+
String matlabAxisValue = conf.getCombination().get(Message.getValue("Axis.matlab.key"));
65+
if (matlabAxisValue != null) {
6666
checkForAxis = true;
6767
break;
6868
}
6969
}
70-
prjCheckMATLABAxis.put(_prj.getFullName(), checkForAxis);
70+
prjCheckMatlabAxis.put(prj.getFullName(), checkForAxis);
7171
}
7272

73-
private void checkForBuildWrapper(MatrixProject _prj) {
73+
private void checkForBuildWrapper(MatrixProject prj) {
7474
boolean checkForBuildWrapper = false;
75-
for(Object _bWrapper : _prj.getBuildWrappersList().toArray()) {
76-
if(_bWrapper instanceof UseMatlabVersionBuildWrapper){
77-
checkForBuildWrapper = ((UseMatlabVersionBuildWrapper) _bWrapper).getMatlabInstallationName() != null || ((UseMatlabVersionBuildWrapper) _bWrapper).getMatlabRootFolder() != null;
75+
for(Object bWrapper : prj.getBuildWrappersList().toArray()) {
76+
if(bWrapper instanceof UseMatlabVersionBuildWrapper){
77+
checkForBuildWrapper = ((UseMatlabVersionBuildWrapper) bWrapper).getMatlabInstallationName() != null;
7878
break;
7979
}
8080
}
81-
prjCheckMATLABBuildWrapper.put(_prj.getFullName(), checkForBuildWrapper);
81+
prjCheckMatlabBuildWrapper.put(prj.getFullName(), checkForBuildWrapper);
8282
}
8383

84-
public static boolean getMATLABAxisCheckForPrj(String prjName) {
85-
return prjCheckMATLABAxis.get(prjName) != null && prjCheckMATLABAxis.get(prjName);
84+
public static boolean getMatlabAxisCheckForPrj(String prjName) {
85+
return prjCheckMatlabAxis.get(prjName) != null && prjCheckMatlabAxis.get(prjName);
8686
}
8787

88-
public static boolean getMATLABBuildWrapperCheckForPrj(String prjName) {
89-
return prjCheckMATLABBuildWrapper.get(prjName) != null && prjCheckMATLABBuildWrapper.get(prjName);
88+
public static boolean getMatlabBuildWrapperCheckForPrj(String prjName) {
89+
return prjCheckMatlabBuildWrapper.get(prjName) != null && prjCheckMatlabBuildWrapper.get(prjName);
9090
}
9191
}

src/main/java/com/mathworks/ci/UseMatlabVersionBuildWrapper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.util.ArrayList;
1414
import java.util.Arrays;
1515
import java.util.List;
16-
import java.util.Objects;
1716
import java.util.function.Function;
1817

1918
import hudson.matrix.MatrixProject;
@@ -126,7 +125,7 @@ public boolean checkAxisAdded() {
126125
if (!isMatrix) {
127126
return false;
128127
}
129-
return MatlabItemListener.getMATLABAxisCheckForPrj(project.getFullName()) && !MatlabInstallation.isEmpty();
128+
return MatlabItemListener.getMatlabAxisCheckForPrj(project.getFullName()) && !MatlabInstallation.isEmpty();
130129
}
131130

132131
public String getMatlabAxisWarning() {

src/main/resources/com/mathworks/ci/MatlabInstallationAxis/config.jelly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
33

44
<j:choose>
5-
<j:when test="${descriptor.checkUseMATLABVersion(it)}">
5+
<j:when test="${descriptor.checkUseMatlabVersion(it)}">
66
<f:block>
77
<div class = "warning">${descriptor.useMatlabWarning}</div>
88
</f:block>
99
</j:when>
1010
</j:choose>
1111

1212
<j:choose>
13-
<j:when test="${descriptor.checkMatlabInstallationEmpty()}">
13+
<j:when test="${descriptor.isMatlabInstallationEmpty()}">
1414
<f:block>
1515
<div class = "error">${descriptor.noInstallationError}</div>
1616
</f:block>

src/main/resources/config.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ builder.matlab.automatictestoption.display.name = Automatic
1313
builder.matlab.customcommandoption.display.name = Custom
1414
Releaseinfo.matlab.version.not.found.error = Error finding MATLAB release for given MATLAB root. Verify MATLAB root path.
1515
matlab.not.found.error = Unable to launch MATLAB from the specified location. Verify the path to MATLAB root folder.
16-
matlab.not.found.error.for.node = Unable to launch MATLAB %s on the node %s. Verify global tool configuration for the specified node.
16+
matlab.not.found.error.for.node = Unable to launch MATLAB '%s' on the node '%s'. Verify global tool configuration for the specified node.
1717
Builder.matlab.modelcoverage.support.warning = To generate a Cobertura model coverage report, use MATLAB R2018b or a newer release.
1818
Builder.matlab.exportstmresults.support.warning = To export Simulink Test Manager results, use MATLAB R2019a or a newer release.
1919
Builder.matlab.runner.script.target.file.linux.name = run_matlab_command.sh

0 commit comments

Comments
 (0)