diff --git a/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwComponent.java b/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwComponent.java index 7a21e1e9166b..5ac7656b0879 100644 --- a/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwComponent.java +++ b/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/LwComponent.java @@ -186,7 +186,6 @@ public abstract class LwComponent implements IComponent{ public final LwIntrospectedProperty[] getAssignedIntrospectedProperties() { final LwIntrospectedProperty[] properties = new LwIntrospectedProperty[myIntrospectedProperty2Value.size()]; final Iterator iterator = myIntrospectedProperty2Value.keySet().iterator(); - //noinspection ForLoopThatDoesntUseLoopVariable for (int i=0; iterator.hasNext(); i++) { properties[i] = (LwIntrospectedProperty)iterator.next(); } @@ -221,13 +220,12 @@ public abstract class LwComponent implements IComponent{ final HashMap name2property = provider.getLwProperties(getComponentClassName()); if (name2property == null) { - myErrorComponentProperties = (Element)propertiesElement.clone(); + myErrorComponentProperties = propertiesElement.clone(); return; } - final List propertyElements = propertiesElement.getChildren(); - for (int i = 0; i < propertyElements.size(); i++) { - final Element t = (Element)propertyElements.get(i); + final List propertyElements = propertiesElement.getChildren(); + for (Element t : propertyElements) { final String name = t.getName(); final LwIntrospectedProperty property = (LwIntrospectedProperty)name2property.get(name); if (property == null){ @@ -248,9 +246,8 @@ public abstract class LwComponent implements IComponent{ private void readClientProperties(final Element element) { Element propertiesElement = LwXmlReader.getChild(element, UIFormXmlConstants.ELEMENT_CLIENT_PROPERTIES); if (propertiesElement == null) return; - final List clientPropertyList = propertiesElement.getChildren(); - for(int i=0; i clientPropertyList = propertiesElement.getChildren(); + for (Element prop : clientPropertyList) { final String propName = prop.getName(); final String className = LwXmlReader.getRequiredString(prop, UIFormXmlConstants.ATTRIBUTE_CLASS); diff --git a/java/java-impl/src/com/intellij/refactoring/anonymousToInner/AnonymousToInnerHandler.java b/java/java-impl/src/com/intellij/refactoring/anonymousToInner/AnonymousToInnerHandler.java index e7e244e4e70d..26038b5e143b 100644 --- a/java/java-impl/src/com/intellij/refactoring/anonymousToInner/AnonymousToInnerHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/anonymousToInner/AnonymousToInnerHandler.java @@ -171,13 +171,12 @@ public class AnonymousToInnerHandler implements RefactoringActionHandler { myTargetClass.add(aClass); PsiNewExpression newExpr = (PsiNewExpression) myAnonClass.getParent(); - @NonNls StringBuffer buf = new StringBuffer(); + @NonNls StringBuilder buf = new StringBuilder(); buf.append("new "); buf.append(aClass.getName()); if (!myTypeParametersToCreate.isEmpty()) { buf.append("<"); int idx = 0; - //noinspection ForLoopThatDoesntUseLoopVariable for (Iterator it = myTypeParametersToCreate.iterator(); it.hasNext(); idx++) { if (idx > 0) buf.append(", "); String typeParamName = it.next().getName(); @@ -401,7 +400,7 @@ public class AnonymousToInnerHandler implements RefactoringActionHandler { } } - Collections.sort(toAdd, (e1, e2) -> e1.getTextRange().getStartOffset() - e2.getTextRange().getStartOffset()); + toAdd.sort(Comparator.comparingInt(e -> e.getTextRange().getStartOffset())); for (PsiElement element : toAdd) { if (element instanceof PsiClassInitializer) { diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index dee0efb413e6..88d537ff576b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -3497,7 +3497,6 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi // committed text insertion if (commitCount > 0) { - //noinspection ForLoopThatDoesntUseLoopVariable for (char c = text.current(); commitCount > 0; c = text.next(), commitCount--) { if (c >= 0x20 && c != 0x7F) { // Hack just like in javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction processKeyTyped(c); diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapSchemeManager.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapSchemeManager.java index 84663ef0e60b..7334d4ba894d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapSchemeManager.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapSchemeManager.java @@ -24,12 +24,7 @@ import com.intellij.openapi.util.Condition; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Objects; +import java.util.*; import java.util.function.Consumer; import java.util.function.Predicate; @@ -65,7 +60,6 @@ final class KeymapSchemeManager extends AbstractSchemeActions impl if (scheme.isMutable()) return scheme.getMutable(); String name = message("new.keymap.name", keymap.getPresentableName()); - //noinspection ForLoopThatDoesntUseLoopVariable for (int i = 1; containsScheme(name, false); i++) { name = message("new.indexed.keymap.name", keymap.getPresentableName(), i); } diff --git a/platform/platform-impl/src/org/jetbrains/io/MessageDecoder.java b/platform/platform-impl/src/org/jetbrains/io/MessageDecoder.java index 62c3dadbfb64..69ca46bbd8b4 100644 --- a/platform/platform-impl/src/org/jetbrains/io/MessageDecoder.java +++ b/platform/platform-impl/src/org/jetbrains/io/MessageDecoder.java @@ -21,7 +21,6 @@ import io.netty.channel.ChannelHandlerContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; import java.nio.CharBuffer; import java.nio.charset.StandardCharsets; @@ -37,7 +36,7 @@ public abstract class MessageDecoder extends Decoder { } @Nullable - protected final CharSequence readChars(@NotNull ByteBuf input) throws IOException { + protected final CharSequence readChars(@NotNull ByteBuf input) { int readableBytes = input.readableBytes(); if (readableBytes == 0) { input.release(); @@ -85,7 +84,6 @@ public abstract class MessageDecoder extends Decoder { public static boolean readUntil(char what, @NotNull ByteBuf buffer, @NotNull StringBuilder builder) { int i = buffer.readerIndex(); - //noinspection ForLoopThatDoesntUseLoopVariable for (int n = buffer.writerIndex(); i < n; i++) { char c = (char)buffer.getByte(i); if (c == what) { diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties index abe32c422a74..a8339d0f3713 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties @@ -79,10 +79,6 @@ non.final.field.in.equals.display.name=Non-final field referenced in 'equals()' non.final.field.in.equals.problem.descriptor=Non-final field #ref accessed in 'equals()' #loc equals.doesnt.check.class.parameter.display.name='equals()' method which does not check class of parameter equals.doesnt.check.class.parameter.problem.descriptor=#ref() should check the class of its parameter #loc -for.loop.not.use.loop.variable.display.name='for' loop where update or condition does not use loop variable -for.loop.not.use.loop.variable.problem.descriptor.condition=#ref statement has condition which does not use the for loop variable #loc -for.loop.not.use.loop.variable.problem.descriptor.update=#ref statement has update which does not use the for loop variable #loc -for.loop.not.use.loop.variable.problem.descriptor.both.condition.and.update=#ref statement has condition and update which do not use the for loop variable #loc non.final.field.in.hashcode.display.name=Non-final field referenced in 'hashCode()' non.final.field.in.hashcode.problem.descriptor=Non-final field #ref accessed in 'hashCode()' #loc result.of.method.call.ignored.display.name=Result of method call ignored diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspection.java deleted file mode 100644 index 1a1ad5365269..000000000000 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2003-2007 Dave Griffith, Bas Leijdekkers - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.siyeh.ig.bugs; - -import com.intellij.psi.*; -import com.intellij.psi.util.PsiUtil; -import com.siyeh.InspectionGadgetsBundle; -import com.siyeh.ig.BaseInspection; -import com.siyeh.ig.BaseInspectionVisitor; -import com.siyeh.ig.psiutils.ComparisonUtils; -import com.siyeh.ig.psiutils.ExpressionUtils; -import com.siyeh.ig.psiutils.VariableAccessUtils; -import org.jetbrains.annotations.NotNull; - -import static com.intellij.util.ObjectUtils.tryCast; - -public class ForLoopThatDoesntUseLoopVariableInspection extends BaseInspection { - - @Override - @NotNull - public String getDisplayName() { - return InspectionGadgetsBundle.message("for.loop.not.use.loop.variable.display.name"); - } - - @Override - @NotNull - public String buildErrorString(Object... infos) { - final boolean condition = ((Boolean)infos[0]).booleanValue(); - final boolean update = ((Boolean)infos[1]).booleanValue(); - if (condition && update) { - return InspectionGadgetsBundle.message( - "for.loop.not.use.loop.variable.problem.descriptor.both.condition.and.update"); - } - if (condition) { - return InspectionGadgetsBundle.message( - "for.loop.not.use.loop.variable.problem.descriptor.condition"); - } - return InspectionGadgetsBundle.message( - "for.loop.not.use.loop.variable.problem.descriptor.update"); - } - - @Override - public BaseInspectionVisitor buildVisitor() { - return new ForLoopThatDoesntUseLoopVariableVisitor(); - } - - private static class ForLoopThatDoesntUseLoopVariableVisitor extends BaseInspectionVisitor { - - @Override - public void visitForStatement(@NotNull PsiForStatement statement) { - super.visitForStatement(statement); - PsiLocalVariable variable = extractInitializerVariable(statement); - if (variable == null) return; - boolean notUsedInCondition = !conditionUsesVariable(statement, variable); - boolean notUsedInUpdate = !updateUsesVariable(statement, variable); - if (notUsedInCondition || notUsedInUpdate) { - if (!notUsedInCondition && isDeclarationUsedAsBound(statement, variable)) return; - registerStatementError(statement, notUsedInCondition, notUsedInUpdate); - } - } - - private static boolean isDeclarationUsedAsBound(PsiForStatement statement, PsiLocalVariable boundVar) { - PsiBinaryExpression condition = tryCast(PsiUtil.skipParenthesizedExprDown(statement.getCondition()), PsiBinaryExpression.class); - if (condition == null || !ComparisonUtils.isComparisonOperation(condition.getOperationTokenType())) return false; - PsiExpression otherOperand = null; - if (ExpressionUtils.isReferenceTo(condition.getLOperand(), boundVar)) { - otherOperand = condition.getROperand(); - } else if (ExpressionUtils.isReferenceTo(condition.getROperand(), boundVar)) { - otherOperand = condition.getLOperand(); - } - if (otherOperand == null) return false; - PsiReferenceExpression ref = tryCast(PsiUtil.skipParenthesizedExprDown(otherOperand), PsiReferenceExpression.class); - if (ref == null) return false; - PsiVariable indexVar = tryCast(ref.resolve(), PsiVariable.class); - if (indexVar == null) return false; - PsiStatement update = statement.getUpdate(); - return VariableAccessUtils.variableIsIncremented(indexVar, update) || VariableAccessUtils.variableIsDecremented(indexVar, update); - } - - private static PsiLocalVariable extractInitializerVariable(PsiForStatement statement) { - final PsiDeclarationStatement declaration = tryCast(statement.getInitialization(), PsiDeclarationStatement.class); - if (declaration == null) return null; - - final PsiElement[] declaredElements = declaration.getDeclaredElements(); - if (declaredElements.length != 1) return null; - - return tryCast(declaredElements[0], PsiLocalVariable.class); - } - - private static boolean conditionUsesVariable(PsiForStatement statement, PsiLocalVariable variable) { - final PsiExpression condition = statement.getCondition(); - return condition == null || VariableAccessUtils.variableIsUsed(variable, condition); - } - - private static boolean updateUsesVariable(PsiForStatement statement, PsiLocalVariable variable) { - final PsiStatement update = statement.getUpdate(); - return update == null || VariableAccessUtils.variableIsUsed(variable, update); - } - } -} \ No newline at end of file diff --git a/plugins/InspectionGadgets/src/META-INF/InspectionGadgets.xml b/plugins/InspectionGadgets/src/META-INF/InspectionGadgets.xml index 5c3342634ec2..11aac0be2a23 100644 --- a/plugins/InspectionGadgets/src/META-INF/InspectionGadgets.xml +++ b/plugins/InspectionGadgets/src/META-INF/InspectionGadgets.xml @@ -238,10 +238,6 @@ key="equals.doesnt.check.class.parameter.display.name" groupBundle="messages.InspectionsBundle" groupKey="group.names.probable.bugs" enabledByDefault="true" level="WARNING" implementationClass="com.siyeh.ig.bugs.EqualsWhichDoesntCheckParameterClassInspection"/> - - -Reports for loops where the condition or -update does not use the for loop variable. - -

- - - \ No newline at end of file diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/for_does_not_use_var/ForLoopThatDoesntUseLoopVariable.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/for_does_not_use_var/ForLoopThatDoesntUseLoopVariable.java deleted file mode 100644 index 1a5e9d4dd2cd..000000000000 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/for_does_not_use_var/ForLoopThatDoesntUseLoopVariable.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import java.util.List; - -public class ForLoopThatDoesntUseLoopVariable { - boolean test(int i) { - return i < 10; - } - - void bug() { - for (int i = 0; test(i); i++) { - for (int j = 0; test(j); i++) { - System.out.println(i + ":" + j); - } - } - } - - void bug2() { - for (int i = 0; test(i); i++) { - for (int j = 0; test(i); j++) { - System.out.println(i + ":" + j); - } - } - } - - // IDEA-166869 - void test(List lines) { - int i = 0; - for (int size = lines.size(); i < size; i++) { - if (lines.get(i).isEmpty()) break; - } - System.out.println(i); - } - - void test2(List lines) { - int i = 0, j = 0; - for (int size = lines.size(); i < size; j++) { - if (lines.get(i).isEmpty()) break; - } - System.out.println(j); - } -} diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspectionTest.java deleted file mode 100644 index 603df5de585f..000000000000 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ForLoopThatDoesntUseLoopVariableInspectionTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.siyeh.ig.bugs; - -import com.intellij.codeInspection.InspectionProfileEntry; -import com.intellij.testFramework.LightProjectDescriptor; -import com.siyeh.ig.LightInspectionTestCase; -import org.jetbrains.annotations.NotNull; - -public class ForLoopThatDoesntUseLoopVariableInspectionTest extends LightInspectionTestCase { - - public void testForLoopThatDoesntUseLoopVariable() { - doTest(); - } - - @Override - protected InspectionProfileEntry getInspection() { - return new ForLoopThatDoesntUseLoopVariableInspection(); - } - - @Override - protected String getBasePath() { - return "/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/for_does_not_use_var"; - } - - @NotNull - @Override - protected LightProjectDescriptor getProjectDescriptor() { - return JAVA_8; - } -} \ No newline at end of file diff --git a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/config/MethodParameterInjection.java b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/config/MethodParameterInjection.java index fcc3491b4c4b..bd7e056d4617 100644 --- a/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/config/MethodParameterInjection.java +++ b/plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/config/MethodParameterInjection.java @@ -172,7 +172,6 @@ public class MethodParameterInjection extends BaseInjection { public static String fixSignature(final String signature, final boolean parameterNames) { @NonNls final StringBuilder sb = new StringBuilder(); final StringTokenizer st = new StringTokenizer(signature, "(,)"); - //noinspection ForLoopThatDoesntUseLoopVariable for (int i = 0; st.hasMoreTokens(); i++) { final String token = st.nextToken().trim(); if (i > 1) sb.append(", "); @@ -215,7 +214,6 @@ public class MethodParameterInjection extends BaseInjection { if (type instanceof PsiPrimitiveType) return false; if (project.isDefault()) { @NonNls final String text = type.getPresentableText(); - if (text == null) return false; return text.equals("java.lang.String") || text.equals("java.lang.String...") || text.equals("java.lang.String[]"); } else { @@ -239,7 +237,6 @@ public class MethodParameterInjection extends BaseInjection { public static String getParameterTypesString(final String signature) { @NonNls final StringBuilder sb = new StringBuilder(); final StringTokenizer st = new StringTokenizer(signature, "(,)"); - //noinspection ForLoopThatDoesntUseLoopVariable for (int i = 0; st.hasMoreTokens(); i++) { final String token = st.nextToken().trim(); if (i > 1) sb.append(", "); diff --git a/plugins/ant/src/com/intellij/lang/ant/config/execution/OutputParser.java b/plugins/ant/src/com/intellij/lang/ant/config/execution/OutputParser.java index 259ffab8b0f1..792686d2ec18 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/execution/OutputParser.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/execution/OutputParser.java @@ -236,7 +236,6 @@ public class OutputParser{ final int columnNum) { StringTokenizer tokenizer = new StringTokenizer(message, "\n", false); final String[] strings = new String[tokenizer.countTokens()]; - //noinspection ForLoopThatDoesntUseLoopVariable for (int idx = 0; tokenizer.hasMoreTokens(); idx++) { strings[idx] = tokenizer.nextToken(); } diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/designSurface/InsertComponentProcessor.java b/plugins/ui-designer/src/com/intellij/uiDesigner/designSurface/InsertComponentProcessor.java index 7ee2a42b5f71..0098ebf16fee 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/designSurface/InsertComponentProcessor.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/designSurface/InsertComponentProcessor.java @@ -171,7 +171,6 @@ public final class InsertComponentProcessor extends EventProcessor { public static String getUniqueBinding(RadRootContainer root, final String baseName) { // Generate member name based on current code style - //noinspection ForLoopThatDoesntUseLoopVariable for (int i = 0; true; i++) { final String nameCandidate = baseName + (i + 1); final String binding = JavaCodeStyleManager.getInstance(root.getProject()).propertyNameToVariableName( diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunSettingsEditor.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunSettingsEditor.java index 17461fe39e47..90d2ec4bfa15 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunSettingsEditor.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunSettingsEditor.java @@ -27,7 +27,6 @@ import com.intellij.openapi.fileTypes.impl.FileTypeRenderer; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.module.ModuleType; -import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SettingsEditor; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.JavaSdkType; @@ -362,16 +361,14 @@ class XsltRunSettingsEditor extends SettingsEditor { if (fileType instanceof LanguageFileType) { final SyntaxHighlighter sh = SyntaxHighlighterFactory.getSyntaxHighlighter(((LanguageFileType)fileType).getLanguage(), project, null); - if (sh != null) { - v.add(fileType); - } + v.add(fileType); } } catch (Throwable e) { Logger.getInstance(XsltRunSettingsEditor.class.getName()).info("Encountered incompatible FileType: " + fileType.getName(), e); } } - Collections.sort(v, (o1, o2) -> o1.getDescription().compareTo(o2.getDescription())); + Collections.sort(v, Comparator.comparing(FileType::getDescription)); // off v.insertElementAt(null, 0); @@ -471,7 +468,6 @@ class XsltRunSettingsEditor extends SettingsEditor { private static void setSelectedIndex(ButtonGroup group, int i) { final Enumeration buttons = group.getElements(); - //noinspection ForLoopThatDoesntUseLoopVariable for (int j = 0; buttons.hasMoreElements(); j++) { group.setSelected(buttons.nextElement().getModel(), i == j); } @@ -481,7 +477,6 @@ class XsltRunSettingsEditor extends SettingsEditor { final ButtonModel selection = group.getSelection(); if (selection == null) return -1; final Enumeration buttons = group.getElements(); - //noinspection ForLoopThatDoesntUseLoopVariable for (int i = 0; buttons.hasMoreElements(); i++) { final AbstractButton button = buttons.nextElement(); if (group.isSelected(button.getModel())) return i; @@ -598,7 +593,7 @@ class XsltRunSettingsEditor extends SettingsEditor { myEditor.resetFrom(s); } - protected void applyEditorTo(@NotNull XsltRunConfiguration s) throws ConfigurationException { + protected void applyEditorTo(@NotNull XsltRunConfiguration s) { myEditor.applyTo(s); }