diff --git a/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticUsageRenamingDialog.java b/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticUsageRenamingDialog.java index ca98f25997e3..350b67392567 100644 --- a/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticUsageRenamingDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticUsageRenamingDialog.java @@ -371,7 +371,7 @@ public class AutomaticUsageRenamingDialog extends DialogWrapper { public String getColumnName(int column) { switch(column) { case OLD_NAME_COLUMN: - return RefactoringBundle.message("automatic.renamer.enity.name.column", myRenamer.getEntityName()); + return RefactoringBundle.message("automatic.renamer.entity.name.column", myRenamer.getEntityName()); case NEW_NAME_COLUMN: return RefactoringBundle.message("automatic.renamer.rename.to.column"); default: diff --git a/platform/forms_rt/src/com/intellij/uiDesigner/core/DimensionInfo.java b/platform/forms_rt/src/com/intellij/uiDesigner/core/DimensionInfo.java index 141fabf19696..908143b26cc0 100644 --- a/platform/forms_rt/src/com/intellij/uiDesigner/core/DimensionInfo.java +++ b/platform/forms_rt/src/com/intellij/uiDesigner/core/DimensionInfo.java @@ -17,6 +17,7 @@ package com.intellij.uiDesigner.core; import java.awt.*; import java.util.ArrayList; +import java.util.Arrays; /** * public for test purposes @@ -51,18 +52,16 @@ public abstract class DimensionInfo { } myStretches = new int[getCellCount()]; - for (int i = 0; i < myStretches.length; i++) { - myStretches[i] = 1; - } + Arrays.fill(myStretches, 1); //TODO[anton,vova] handle stretches - final ArrayList elimitated = new ArrayList(); - mySpansAfterElimination = (int[])mySpan.clone(); - Util.eliminate((int[])myCell.clone(), mySpansAfterElimination, elimitated); + final ArrayList eliminated = new ArrayList(); + mySpansAfterElimination = mySpan.clone(); + Util.eliminate(myCell.clone(), mySpansAfterElimination, eliminated); myCellSizePolicies = new int[getCellCount()]; for (int i = 0; i < myCellSizePolicies.length; i++) { - myCellSizePolicies[i] = getCellSizePolicyImpl(i, elimitated); + myCellSizePolicies[i] = getCellSizePolicyImpl(i, eliminated); } } @@ -117,13 +116,13 @@ public abstract class DimensionInfo { return myCellSizePolicies[cellIndex]; } - private int getCellSizePolicyImpl(final int cellIndex, final ArrayList eliminatedCells){ + private int getCellSizePolicyImpl(final int cellIndex, final ArrayList eliminatedCells){ int policyFromChild = getCellSizePolicyFromInheriting(cellIndex); if (policyFromChild != -1) { return policyFromChild; } for (int i = eliminatedCells.size() - 1; i >= 0; i--) { - if (cellIndex == ((Integer)eliminatedCells.get(i)).intValue()) { + if (cellIndex == eliminatedCells.get(i).intValue()) { return GridConstraints.SIZEPOLICY_CAN_SHRINK; } } diff --git a/platform/forms_rt/src/com/intellij/uiDesigner/core/GridLayoutManager.java b/platform/forms_rt/src/com/intellij/uiDesigner/core/GridLayoutManager.java index c42dc5681dac..746edeb9a374 100644 --- a/platform/forms_rt/src/com/intellij/uiDesigner/core/GridLayoutManager.java +++ b/platform/forms_rt/src/com/intellij/uiDesigner/core/GridLayoutManager.java @@ -72,7 +72,7 @@ public final class GridLayoutManager extends AbstractLayout { * Key for accessing client property which is set on the root Swing component of the design-time component * hierarchy and specifies the value of extra insets added to all components. */ - public static Object DESIGN_TIME_INSETS = new Object(); + public static final Object DESIGN_TIME_INSETS = new Object(); private static final int SKIP_ROW = 1; private static final int SKIP_COL = 2; @@ -235,14 +235,11 @@ public final class GridLayoutManager extends AbstractLayout { private static void makeSameSizes(int[] widths) { int max = widths[0]; - for (int i = 0; i < widths.length; i++) { - int width = widths[i]; + for (int width : widths) { max = Math.max(width, max); } - for (int i = 0; i < widths.length; i++) { - widths[i] = max; - } + Arrays.fill(widths, max); } private static int[] getSameSizes(DimensionInfo info, int totalWidth) { @@ -632,9 +629,7 @@ public final class GridLayoutManager extends AbstractLayout { private int[] getMinOrPrefSizes(final DimensionInfo info, final boolean min) { final int[] widths = new int[info.getCellCount()]; - for (int i = 0; i < widths.length; i++) { - widths[i] = myMinCellSize; - } + Arrays.fill(widths, myMinCellSize); // single spaned components for (int i = info.getComponentCount() - 1; i >= 0; i--) { @@ -907,22 +902,20 @@ public final class GridLayoutManager extends AbstractLayout { } public int[] getHorizontalGridLines() { - int[] result = new int [myYs.length+1]; - result [0] = myYs [0]; - for(int i=0; i { - for (int i = 0; i < myShouldRename.length; i++) { - myShouldRename[i] = true; - } + Arrays.fill(myShouldRename, true); fireDataChanged(); }); myUnselectAllButton.addActionListener(e -> { - for (int i = 0; i < myShouldRename.length; i++) { - myShouldRename[i] = false; - } + Arrays.fill(myShouldRename, false); fireDataChanged(); }); @@ -333,12 +327,11 @@ public class AutomaticRenamingDialog extends DialogWrapper { } @Override - public Class getColumnClass(int columnIndex) { + public Class getColumnClass(int columnIndex) { switch (columnIndex) { case CHECK_COLUMN: return Boolean.class; case OLD_NAME_COLUMN: - return String.class; case NEW_NAME_COLUMN: return String.class; default: @@ -350,7 +343,7 @@ public class AutomaticRenamingDialog extends DialogWrapper { public String getColumnName(int column) { switch (column) { case OLD_NAME_COLUMN: - return RefactoringBundle.message("automatic.renamer.enity.name.column", myRenamer.entityName()); + return RefactoringBundle.message("automatic.renamer.entity.name.column", myRenamer.entityName()); case NEW_NAME_COLUMN: return RefactoringBundle.message("automatic.renamer.rename.to.column"); default: diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/ast/builder/strategy/InitializerBuilderStrategySupport.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/ast/builder/strategy/InitializerBuilderStrategySupport.java index d17199634424..a09a2d38c983 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/ast/builder/strategy/InitializerBuilderStrategySupport.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/ast/builder/strategy/InitializerBuilderStrategySupport.java @@ -29,6 +29,7 @@ import org.jetbrains.plugins.groovy.lang.resolve.ast.builder.BuilderAnnotationCo import org.jetbrains.plugins.groovy.lang.resolve.ast.builder.BuilderHelperLightPsiClass; import org.jetbrains.plugins.groovy.transformations.TransformationContext; +import java.util.Arrays; import java.util.Objects; import static org.jetbrains.plugins.groovy.lang.resolve.ast.builder.strategy.DefaultBuilderStrategySupport.getBuilderClassName; @@ -175,9 +176,7 @@ public class InitializerBuilderStrategySupport extends BuilderAnnotationContribu builderClass.getResolveScope() ); final PsiType[] mappings = PsiType.createArray(builderClass.getTypeParameters().length); - for (int i = 0; i < mappings.length; i++) { - mappings[i] = type; - } + Arrays.fill(mappings, type); return myElementFactory.createType(builderClass, mappings); } } diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java index 5770d413cce7..70c32ee00777 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/HighlighterUtil.java @@ -92,9 +92,8 @@ public class HighlighterUtil { return false; } - @SuppressWarnings({"RawUseOfParameterizedType"}) private static boolean purgeInvalidHighlighters(Editor editor, List hl) { - final Set set = ContainerUtil.newIdentityTroveSet(Arrays.asList(editor.getMarkupModel().getAllHighlighters())); + final Set set = ContainerUtil.newIdentityTroveSet(Arrays.asList(editor.getMarkupModel().getAllHighlighters())); boolean hasHighlighter = false; for (Iterator iterator = hl.iterator(); iterator.hasNext();) { final RangeHighlighter h = iterator.next(); @@ -165,9 +164,7 @@ public class HighlighterUtil { final int tabSize = CodeStyle.getSettings(element.getProject()).getTabSize(FileTypeManager.getInstance().getFileTypeByExtension("xml")); final char[] spaces = new char[tabSize]; - for (int i = 0; i < spaces.length; i++) { - spaces[i] = ' '; - } + Arrays.fill(spaces, ' '); final int textOffset = element.getTextOffset(); final int lineStartOffset = e.logicalPositionToOffset(new LogicalPosition(e.offsetToLogicalPosition(textOffset).line, 0));