Based on the comments, if it is an argument, it can be modified.
The only way to prevent the original value from being modified is to create a constant value INSIDE of the method rather than allow it to be injected into the method as an argument.
public String calculateValue() {
const int index_param = 2;
}
A second option would be to add a readonly private field and move your index_param argument passing to the enclosing class' constructor. This way the field could not be changed by your calculateValue() method, although this would require a refactor.
public class ContainingClass
{
private readonly int _index_param;
public ContainingClass(int index_param)
{
_index_param = index_param;
}
}
This would allow you to use your private field inside of calculateValue and it could not be changed, which would be a compile-time check.
Please note that this private field could still be changed via reflection. That said, if you have anyone that desperate to sabotage your codebase, you have larger issues on your hands.