Skip to content

Commit 67e9fc7

Browse files
645: Fixed local variable could be final
1 parent 0918b7a commit 67e9fc7

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/com/magento/idea/magento2plugin/stubs/indexes/js/RequireJsIndex.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,37 @@ public class RequireJsIndex extends FileBasedIndexExtension<String, String> {
4040
@Override
4141
public @NotNull DataIndexer<String, String, FileContent> getIndexer() {
4242
return inputData -> {
43-
Map<String, String> map = new HashMap<>();
44-
JSFile jsFile = (JSFile) inputData.getPsiFile();
43+
final Map<String, String> map = new HashMap<>();
44+
final JSFile jsFile = (JSFile) inputData.getPsiFile();
4545

46-
JSVarStatement jsVarStatement = PsiTreeUtil.getChildOfType(jsFile, JSVarStatement.class);
46+
final JSVarStatement jsVarStatement = PsiTreeUtil.getChildOfType(jsFile, JSVarStatement.class);
4747
if (jsVarStatement == null) {
4848
return map;
4949
}
50-
JSVariable[] jsVariableList = jsVarStatement.getVariables();
51-
for (JSVariable jsVariable : jsVariableList) {
52-
String name = jsVariable.getName();
50+
final JSVariable[] jsVariableList = jsVarStatement.getVariables();
51+
for (final JSVariable jsVariable : jsVariableList) {
52+
final String name = jsVariable.getName();
5353
if (name.equals("config")) {
54-
JSObjectLiteralExpression config = PsiTreeUtil.getChildOfType(jsVariable, JSObjectLiteralExpression.class);
54+
final JSObjectLiteralExpression config = PsiTreeUtil.getChildOfType(jsVariable, JSObjectLiteralExpression.class);
5555
if (config == null) {
5656
return map;
5757
}
5858
parseConfigMap(map, config);
5959

60-
JSProperty pathsMap = config.findProperty("paths");
60+
final JSProperty pathsMap = config.findProperty("paths");
6161
if (pathsMap == null) {
6262
return map;
6363
}
64-
JSObjectLiteralExpression[] pathGroupsWrappers = PsiTreeUtil.getChildrenOfType(pathsMap, JSObjectLiteralExpression.class);
65-
for (JSObjectLiteralExpression pathGroupsWrapper : pathGroupsWrappers) {
66-
JSProperty[] allConfigs = pathGroupsWrapper.getProperties();
67-
for (JSProperty mapping : allConfigs) {
68-
String nameConfig = mapping.getName();
69-
JSExpression value = mapping.getValue();
64+
final JSObjectLiteralExpression[] pathGroupsWrappers = PsiTreeUtil.getChildrenOfType(pathsMap, JSObjectLiteralExpression.class);
65+
for (final JSObjectLiteralExpression pathGroupsWrapper : pathGroupsWrappers) {
66+
final JSProperty[] allConfigs = pathGroupsWrapper.getProperties();
67+
for (final JSProperty mapping : allConfigs) {
68+
final String nameConfig = mapping.getName();
69+
final JSExpression value = mapping.getValue();
7070
if (value == null) {
7171
continue;
7272
}
73-
String valueConfig = value.getText();
73+
final String valueConfig = value.getText();
7474
map.put(nameConfig, valueConfig);
7575
}
7676
}
@@ -85,26 +85,26 @@ private void parseConfigMap(
8585
final Map<String, String> map,
8686
final JSObjectLiteralExpression config
8787
) {
88-
JSProperty configMap = config.findProperty("map");
88+
final JSProperty configMap = config.findProperty("map");
8989
if (configMap == null) {
9090
return;
9191
}
9292

93-
JSObjectLiteralExpression[] configGroupsWrappers = PsiTreeUtil.getChildrenOfType(configMap, JSObjectLiteralExpression.class);
94-
for (JSObjectLiteralExpression configGroupsWrapper : configGroupsWrappers) {
95-
PsiElement[] configGroups = configGroupsWrapper.getChildren();
93+
final JSObjectLiteralExpression[] configGroupsWrappers = PsiTreeUtil.getChildrenOfType(configMap, JSObjectLiteralExpression.class);
94+
for (final JSObjectLiteralExpression configGroupsWrapper : configGroupsWrappers) {
95+
final PsiElement[] configGroups = configGroupsWrapper.getChildren();
9696

97-
for (PsiElement configGroup : configGroups) {
98-
JSObjectLiteralExpression mappingWrapper = PsiTreeUtil.getChildOfType(configGroup, JSObjectLiteralExpression.class);
99-
JSProperty[] allConfigs = mappingWrapper.getProperties();
97+
for (final PsiElement configGroup : configGroups) {
98+
final JSObjectLiteralExpression mappingWrapper = PsiTreeUtil.getChildOfType(configGroup, JSObjectLiteralExpression.class);
99+
final JSProperty[] allConfigs = mappingWrapper.getProperties();
100100

101-
for (JSProperty mapping : allConfigs) {
102-
String nameConfig = mapping.getName();
103-
JSExpression value = mapping.getValue();
101+
for (final JSProperty mapping : allConfigs) {
102+
final String nameConfig = mapping.getName();
103+
final JSExpression value = mapping.getValue();
104104
if (value == null) {
105105
continue;
106106
}
107-
String valueConfig = value.getText();
107+
final String valueConfig = value.getText();
108108
map.put(nameConfig, valueConfig);
109109
}
110110
}

0 commit comments

Comments
 (0)