diff --git a/java/java-impl-inspections/src/com/intellij/codeInspection/SequencedCollectionMethodCanBeUsedInspection.java b/java/java-impl-inspections/src/com/intellij/codeInspection/SequencedCollectionMethodCanBeUsedInspection.java index 892996055829..88d58b709f24 100644 --- a/java/java-impl-inspections/src/com/intellij/codeInspection/SequencedCollectionMethodCanBeUsedInspection.java +++ b/java/java-impl-inspections/src/com/intellij/codeInspection/SequencedCollectionMethodCanBeUsedInspection.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInspection; import com.intellij.codeInspection.options.OptPane; @@ -90,14 +90,13 @@ public final class SequencedCollectionMethodCanBeUsedInspection extends Abstract PsiExpression collection = qualifierCall.getMethodExpression().getQualifierExpression(); if (collection == null || collection instanceof PsiThisExpression) return; if (!InheritanceUtil.isInheritor(collection.getType(), "java.util.SequencedCollection")) return; - String name = "getFirst"; - report(call, name); + report(call, "getFirst"); } private void report(@NotNull PsiMethodCallExpression call, String name) { holder.registerProblem( Objects.requireNonNull(call.getMethodExpression().getReferenceNameElement()), - JavaBundle.message("inspection.stream.api.migration.can.be.replaced.with.call", name + "()"), + JavaBundle.message("inspection.stream.api.migration.can.be.replaced.with.call", name), new ReplaceWithCallFix(name)); } diff --git a/java/openapi/resources/messages/JavaBundle.properties b/java/openapi/resources/messages/JavaBundle.properties index 94230b4a1c59..5ce1e309b7ed 100644 --- a/java/openapi/resources/messages/JavaBundle.properties +++ b/java/openapi/resources/messages/JavaBundle.properties @@ -86,7 +86,7 @@ checkbox.suggest.replacement.even.if.lambda.may.have.side.effects=Suggest replac checkbox.don.t.warn.in.case.of.multiline.lambda=Don't warn if the parameter of 'List.replaceAll()' is multiline lambda checkbox.suppress.with.suppresswarnings=Suppress with @SuppressWarnings checkbox.treat.get.k.null.the.same.as.containskey.k.may.change.semantics=Treat 'get(k) != null' the same as 'containsKey(k)' (may change semantics) -checkbox.warn.if.only.foreach.replacement.is.available=Warn if only 'forEach' replacement is available +checkbox.warn.if.only.foreach.replacement.is.available=Warn if only 'forEach()' replacement is available checkbox.warn.if.the.loop.is.trivial=Warn if the loop is trivial choose.class=Choose Class class.decorator.or.has.default.constructor=''{0}'' should have default constructor or implement ''Decorator'' pattern @@ -1342,7 +1342,7 @@ highlight.throws.class.name=Highlight Throws {0} class.patterns.panel.add.class=Add Class multiple.usages.of.static.import.found=Multiple Usages of the Static Import Found external.annotations.roots=Annotation Roots -inspection.stream.api.migration.can.be.replaced.with.call=Can be replaced with ''{0}'' call +inspection.stream.api.migration.can.be.replaced.with.call=Can be replaced with ''{0}()'' call highlight.suppressed.warnings.choose.inspections=Choose Inspections to Highlight Suppressed Problems from inspection.magic.constants.should.be.one.of.values=Should be one of: {0}{1,choice,0#|1# or their combination} live.template.context.consumer.function=Consumer function