Why do I keep getting “Evaluations must contain either an expression or a block of well-formed statements”?

后端 未结 6 1553

In my code, I am trying to output the value of src in the expressions window.

public void doIt() {
    String src = \"test\";
    System.out.pri         


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-17 11:22

    If your code use any generics, you may want to check this bug:

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=341232

    Occurs in all version of Eclipse up to 4.2. In short certain generics expressions cause Eclipse to completely fail on any evaluation (please see this example: https://bugs.eclipse.org/bugs/attachment.cgi?id=224760). Not sure whether your code uses any generics, but if so, this may be it. Note that it is enough to have one of the troublesome generics somewhere in your class, not necessary in your method.

提交回复
热议问题