java - IntelliJ - No such instance method -


using intellij's 12 ultimate, i'm running following code in debugger:

java

import play.api.libs.json.jsvalue; public class foo {   ...  public jsvalue tojson() { ... }  public class fooexample { ...   foo foo = new foo();    system.out.println("...); //<-- breakpoint 

at breakpoint, right-clicked source code , picked "evaluate expression," typing in:

foo.tojson().

but following error showed up:

no such instance method: play.api.libs.json.jsvalue$class.com.foo.foo.tojson ()

am doing wrong? foo#tojson calls scala code, if matters.

edit had breakpoint after instantiation of foo. downvoted it, deserved it.

edit

my answer no longer valid after op modified question (i.e. moved breakpoint actual is)..

a breakpoint hit before line executed. in case foo has not yet been declared or instantiated (i.e. foo constructor has not yet been called). you'll need put breakpoint @ next line (or step on current line) if want evaluate foo.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -