mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inline same param value: ensure literals are escaped
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ public class RefParameterImpl extends RefJavaElementImpl implements RefParameter
|
||||
return null;
|
||||
}
|
||||
Object constValue = JavaConstantExpressionEvaluator.computeConstantExpression(expression, false);
|
||||
return constValue == null ? VALUE_IS_NOT_CONST : constValue;
|
||||
return constValue == null ? VALUE_IS_NOT_CONST : constValue instanceof String ? "\"" + constValue + "\"" : constValue;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+1
-2
@@ -247,8 +247,7 @@ public class SameParameterValueInspectionBase extends GlobalJavaBatchInspectionT
|
||||
boolean usedForWriting) {
|
||||
final String name = parameter.getName();
|
||||
String stringPresentation = value instanceof PsiType ? ((PsiType)value).getPresentableText() + ".class"
|
||||
: value instanceof String ? "\"" + value + "\""
|
||||
: String.valueOf(value);
|
||||
: String.valueOf(value);
|
||||
return manager.createProblemDescriptor(ObjectUtils.notNull(parameter.getNameIdentifier(), parameter),
|
||||
InspectionsBundle.message("inspection.same.parameter.problem.descriptor",
|
||||
name,
|
||||
|
||||
Reference in New Issue
Block a user