Expression evaluation stopped working in Eclipse (STS)

为君一笑 提交于 2020-01-25 05:20:13

问题


In my years of using Eclipse, I've never seen this and can't figure out what's wrong. For some reason, the Expressions View (as well as the Display View) will no longer evaluate even simple expressions (like "5", "Hello", "myVariable", "1+2"). What I get is, "Evaluations must contain either an expression or a block of well-formed statements".

Weirder still, if I hover over a variable, the tooltip window shows the correct value and let's me drill into the object.

I've tried restarting, refreshing, rebooting, reloading. Googling, logging, and general poking around have yielded nothing either.

I'm running Spring Tool Suite 3.4.0 on Eclipse, Mylyn 3.9, Java 1.7, Windows 7 Pro 64b. I haven't installed or reconfigured anything lately.

Any ideas? Anyone? This is really killing me!


回答1:


O, the weirdness. Came across this question that pointed me to this bug. Apparently, the compiler gets confused with generic methods like this in the class:

public <T extends something> T myMethod() {};

Indeed, if I break on code in another class, the expression engine comes back to life. Certainly not the answer I was expecting.



来源:https://stackoverflow.com/questions/21761992/expression-evaluation-stopped-working-in-eclipse-sts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!