type migration: escape fix name (IDEA-268991)

GitOrigin-RevId: fe568e2e4fcc3408637614b6afd5dce87e9c072c
This commit is contained in:
Anna Kozlova
2021-05-11 12:19:58 +02:00
committed by intellij-monorepo-bot
parent 705bef7a0a
commit 3e78966513
4 changed files with 7 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ inspection.guava.method.chains.option=Report method chains
inspection.guava.return.types.option=Report return types
inspection.guava.variables.option=Report variables
inspection.migrate.assert.to.matcher.description=Assert expression <code>#ref</code> can be replaced with ''{0}'' call #loc
migrate.fix.text=Migrate {0} type to ''{1}''
migrate.fix.text=<html>Migrate {0} type to ''{1}''</html>
migrate.guava.to.java.family.name=Migrate Guava type to Java
migrate.method.chain.fix.text=Migrate method chain type to ''{0}''
inspection.guava.name=Guava's functional primitives can be replaced with Java

View File

@@ -10,6 +10,7 @@ import com.intellij.openapi.command.undo.UndoUtil;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiType;
@@ -42,7 +43,7 @@ public class TypeMigrationVariableTypeFixProvider implements ChangeVariableTypeQ
@NotNull
@Override
public String getText() {
return TypeMigrationBundle.message("migrate.fix.text", myName, getReturnType().getPresentableText());
return TypeMigrationBundle.message("migrate.fix.text", myName, StringUtil.escapeXmlEntities(getReturnType().getPresentableText()));
}
@Override

View File

@@ -8,6 +8,7 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.NotNullLazyValue;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.pom.java.JavaFeature;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
@@ -281,7 +282,7 @@ public final class GuavaInspection extends AbstractBaseJavaLocalInspectionTool {
return TypeMigrationBundle.message("migrate.fix.text",
TypeMigrationProcessor.getPresentation(element),
myTargetType.getCanonicalText(false));
StringUtil.escapeXmlEntities(myTargetType.getCanonicalText(false)));
}
@Nls

View File

@@ -20,6 +20,8 @@ import org.junit.runners.Suite;
ConvertToThreadLocalIntentionTest.class,
ConvertToThreadLocalIntention6Test.class,
GuavaInspectionTest.class,
GuavaInspectionTest.class,
GuavaInspectionTest.class,
})
public class AllTypeMigrationTestSuite {
}