Skip to content

Commit a048d6b

Browse files
author
Vitaliy Boyko
committed
Fixed checkstyle
1 parent afa8cee commit a048d6b

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

src/com/magento/idea/magento2plugin/actions/generation/generator/LayoutXmlGenerator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ public PsiFile generate(final String actionName) {
115115
null,
116116
false
117117
);
118-
uiComponentTag.setAttribute(LayoutXml.NAME_ATTRIBUTE, layoutXmlData.getUiComponentName());
118+
uiComponentTag.setAttribute(
119+
LayoutXml.NAME_ATTRIBUTE,
120+
layoutXmlData.getUiComponentName()
121+
);
119122
contentContainer.addSubTag(uiComponentTag, false);
120123

121124
if (contentContainerIsGenerated) {

src/com/magento/idea/magento2plugin/indexes/PluginIndex.java

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright © Magento, Inc. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
5+
56
package com.magento.idea.magento2plugin.indexes;
67

78
import com.intellij.openapi.project.Project;
@@ -14,42 +15,62 @@
1415
import com.intellij.util.indexing.FileBasedIndex;
1516
import com.magento.idea.magento2plugin.magento.files.ModuleDiXml;
1617
import com.magento.idea.magento2plugin.util.xml.XmlPsiTreeUtil;
17-
1818
import java.util.ArrayList;
1919
import java.util.Collection;
2020

21-
public class PluginIndex {
21+
public final class PluginIndex {
2222

23-
private static PluginIndex INSTANCE;
23+
private static PluginIndex INSTANCE; //NOPMD
2424

2525
private Project project;
2626

2727
private PluginIndex() {
2828
}
2929

30+
/**
31+
* Getter fo index instance.
32+
*
33+
* @param project Project
34+
* @return PluginIndex
35+
*/
3036
public static PluginIndex getInstance(final Project project) {
31-
if (null == INSTANCE) {
37+
if (null == INSTANCE) { //NOPMD
3238
INSTANCE = new PluginIndex();
3339
}
3440
INSTANCE.project = project;
3541

3642
return INSTANCE;
3743
}
3844

39-
public Collection<PsiElement> getPluginElements(final String name, final GlobalSearchScope scope) {
40-
Collection<PsiElement> result = new ArrayList<>();
45+
/**
46+
* Getter fo plugin elements.
47+
*
48+
* @param name String
49+
* @param scope GlobalSearchScope
50+
* @return Collection
51+
*/
52+
public Collection<PsiElement> getPluginElements(
53+
final String name,
54+
final GlobalSearchScope scope
55+
) {
56+
final Collection<PsiElement> result = new ArrayList<>();
4157

42-
Collection<VirtualFile> virtualFiles =
58+
final Collection<VirtualFile> virtualFiles =
4359
FileBasedIndex.getInstance().getContainingFiles(
4460
com.magento.idea.magento2plugin.stubs.indexes.PluginIndex.KEY,
4561
name,
4662
scope
4763
);
4864

49-
for (VirtualFile virtualFile : virtualFiles) {
50-
XmlFile xmlFile = (XmlFile) PsiManager.getInstance(project).findFile(virtualFile);
51-
Collection<XmlAttributeValue> valueElements = XmlPsiTreeUtil
52-
.findAttributeValueElements(xmlFile, ModuleDiXml.TYPE_ATTR, ModuleDiXml.NAME_ATTR, name);
65+
for (final VirtualFile virtualFile : virtualFiles) {
66+
final XmlFile xmlFile = (XmlFile) PsiManager.getInstance(project).findFile(virtualFile);
67+
final Collection<XmlAttributeValue> valueElements = XmlPsiTreeUtil
68+
.findAttributeValueElements(
69+
xmlFile,
70+
ModuleDiXml.TYPE_ATTR,
71+
ModuleDiXml.NAME_ATTR,
72+
name
73+
);
5374
result.addAll(valueElements);
5475
}
5576
return result;

0 commit comments

Comments
 (0)