Community
Participate
Working Groups
Build Identifier: Allowing final variables to be changed through the variables view can cause, as expected, unreliable behaviour, especially in large applications. For example, declare a variable as follows: Boolean test = true; In the variables view, expand test and change its "value" field (declared final) to false. This has now changed the value of java.lang.Boolean.TRUE to false, a change that affects the whole JVM and can result in unpredictable behaviour. Should the debugger prevent these kinds of operations? Reproducible: Always
(In reply to comment #0) > Should the debugger prevent these kinds of operations? I would have to say no. If the VM allows the variable modification, I think the onus is on the end-user to not re-value the variable(s). I will have to test it further to see if the variable modification actually changes the VM state or if it is just a locale change. One quick way you can test to see if the value actually changes in the VM is that the variable row will change colour after you save the change (the colour can be changed on the Run/Debug pref page: "Changed value background colour").
if we prevented this we would be bringing back bug 94223. Marking as wontfix.