IJPL-245459 [java]: drop "Convert to string literal" intention in favour of "Replace char literal with string" intention

GitOrigin-RevId: c889ac6465f22c9b83f79e75af9a6b4a22e774e3
This commit is contained in:
Bas Leijdekkers
2026-05-27 19:44:25 +00:00
committed by intellij-monorepo-bot
parent abcc22c75a
commit c84e13829d
9 changed files with 2 additions and 110 deletions
@@ -31,12 +31,6 @@
<bundleName>messages.JavaBundle</bundleName>
<categoryKey>intention.category.try.statements</categoryKey>
</intentionAction>
<intentionAction>
<language>JAVA</language>
<className>com.intellij.codeInsight.daemon.impl.quickfix.ConvertToStringLiteralAction</className>
<bundleName>messages.JavaBundle</bundleName>
<categoryKey>intention.category.strings</categoryKey>
</intentionAction>
<intentionAction>
<language>JAVA</language>
<className>com.intellij.codeInsight.intention.impl.BreakStringOnLineBreaksIntentionAction</className>
@@ -1,7 +1,7 @@
<html>
<body>
Replaces a character literal with
the equivalent single character string literal. Only characters used in concatenations or other similar contexts
can be changed with this intention.
the equivalent single character string literal. Only characters used in concatenations, or other similar contexts
where both strings and characters can be used, can be changed with this intention.
</body>
</html>
@@ -1 +0,0 @@
String s = <spot>"</spot>literal<spot>"</spot>;
@@ -1 +0,0 @@
String s = <spot>'</spot>literal<spot>'</spot>;
@@ -1,6 +0,0 @@
<html>
<body>
Converts an invalid character literal that has too many characters
into a string literal.
</body>
</html>
@@ -1,20 +0,0 @@
/*
* Copyright 2000-2011 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.
*/
class C {
{
System.out.println('<caret>ab');
}
}
@@ -1,20 +0,0 @@
/*
* Copyright 2000-2011 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.
*/
class C {
{
System.out.println('<caret>a');
}
}
@@ -1,20 +0,0 @@
/*
* Copyright 2000-2011 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.
*/
class C {
{
System.out.println("a");
}
}
@@ -1,34 +0,0 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.intention;
import com.intellij.JavaTestUtil;
import com.intellij.codeInsight.daemon.QuickFixBundle;
import com.intellij.testFramework.fixtures.CodeInsightTestUtil;
import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;
import com.intellij.util.containers.ContainerUtil;
public class ConvertToStringLiteralTest extends JavaCodeInsightFixtureTestCase {
private String myIntention;
@Override
public void setUp() throws Exception {
super.setUp();
myIntention = QuickFixBundle.message("convert.to.string.text");
}
public void testSimple() {
CodeInsightTestUtil.doIntentionTest(myFixture, myIntention, "Simple.java", "Simple_after.java");
}
public void testAvailableOnce() {
myFixture.configureByFile(getTestName(false) + ".java");
assertSize(1, ContainerUtil.filter(myFixture.getAvailableIntentions(), a -> myIntention.equals(a.getText())));
}
@Override
protected String getTestDataPath() {
return JavaTestUtil.getJavaTestDataPath() + "/codeInsight/convertToStringLiteral/";
}
}