简体   繁体   English

如何在访问公共静态最终变量时设置断点?

[英]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. 当我尝试在公共静态最终常量的Eclipse Kepler中设置变量访问断点(我没有检查其他版本)时,Eclipse正在创建普通断点,如下所示。 变量的正常断点

Is it possible to debug access to public static final variables in Java on Eclipse Kepler? 是否可以在Eclipse Kepler上的Java中调试对公共静态最终变量的访问?

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). eclipse上有一个相当古老的已知错误 ,即无法在final字段上添加观察点,该错误应在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. 但是,正如home在他的评论中所说,您的字符串是一个编译时常量表达式(请参见JLS7 4.12.4),很可能会内联,因此即使此错误得以解决,您也无法添加手表指向您的领域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java:public static final double不能设置为小数? - Java: public static final double can't be set to decimal fraction? 无法在决赛上公开静态 - Can't public static on a final 如何在java中设置公共静态最终类实例的值 - how to set the values for a public static final class instance in java 如何从 Java 应用程序中的另一个类访问在实用程序类中声明的公共最终静态列表? - How can I access to a public final static list declared into an utility class from another class in a Java application? 我如何从另一个包中实例化Java内部的public static final类 - How can I instantiate a inner public static final class in java from a different package 我可以在Java中嵌套的公共静态抽象类中读取公共静态最终字段吗 - can I read public static final field inside a nested public static abstract class in Java 如何在Eclipse中设置断点? - How can I set breakpoint in Eclipse? 如何在Web服务中序列化公共静态最终字符串? - How to serialize a public static final string in a webservice? 如何在静态类中初始化最终的静态变量? - How can I initialize final static variable in a static class? 单例公共静态最终 - singleton public static final
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM