VariableNameUtils#generateVariableName()
should consider following statements
#2776
Labels
bug
Something isn't working
When using
VariableNameUtils#generateVariableName()
to generate variable names to be inserted at a given position in the code (like it is being used in theZipSlip
recipe of rewrite-java-security, which is the only use I found), then the logic should also consider the statements that follow the given cursor (which will roughly be the insertion point for the variable), otherwise when a new variable is inserted it could conflict with following variables.In the following example the utility would for a base name of
s
calculate the names1
even if that conflicts with a variable that follows. Thus, inserting a variable would render the class uncompilable.I am currently facing this issue in the
InstanceOfPatternMatch
recipe.The text was updated successfully, but these errors were encountered: