简体   繁体   中英

How can I set breakpoint on accessing public static final vars?

When I try to set variable access breakpoint in Eclipse Kepler (I didn't check other versions) on public static final constants Eclipse is creating normal breakpoint as shown below. 变量的正常断点

Is it possible to debug access to public static final variables in Java on Eclipse Kepler?

There is a quite old known bug on eclipse about the impossibility to add watchpoints on final field, that should be fixed on the next release of eclipse (4.4). However, as home said in his comment, your string beeing a compile-time constant expression (see JLS7 4.12.4) it is likely to be inlined, and so even when this bug will get fixed, you wont be able to add a watch point on your field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM