-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException during icode #93
Comments
Can you isolate the code that causes this, ideally without any external deps. |
I'll see what we can do - it was a long shot that you'd recognise the problem just from the error message :-) |
Lol no chance, I have to duplicate the problem and figure out what construct is causing the error in the AST. |
Well that's a piece of code I don't want to go near again. I can fix the issue by commenting out a return inside a catch block at line 366: case e1: ZkBadVersionException =>
optionalChecker match {
case Some(checker) => //return checker(client, path, data)
case _ => debug("Checker method is not passed skipping zkData match")
}
warn("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path, data,
expectVersion, e1.getMessage))
(false, -1)
case e2: Exception => I can produce a object bob {
def fail(): Boolean = {
try {
true
} catch {
case _ : Throwable =>
Option(true) match {
case Some(bool) => return bool // comment this return and instrumentation succeeds
case _ =>
}
false
}
}
} |
It's likely return statements themselves are not handled well then. I will fix this. |
I can't even get it to pass with the return commented out. |
That's odd - jdk8, scalac 2.10.4? I'll post a full command line when I get home, sorry. |
No 2.11.4 and jdk8. On 31 January 2015 at 15:39, maiflai [email protected] wrote:
|
Ok, will check that too. 2.10 gave a more detailed error message so I was working from that earlier. |
Sorry, I was using version 1.0.2 of the plugin, and yes, that particular object passes when I use 1.0.4 I think I've managed to break 1.0.4 by adding a function call to the return: object bob {
def recover(it: Boolean): Boolean = it
def fail(): Boolean = {
try {
true
} catch {
case _ : Throwable =>
Option(true) match {
case Some(bool) => return recover(bool) // comment this return and instrumentation succeeds
case _ =>
}
false
}
}
} |
Still Scala 2.10 or 2.11? On 1 February 2015 at 10:39, maiflai [email protected] wrote:
|
2.10 definitely, I think 2.11 as well. I created #95 with a failing test |
2.10 is mostly unsupported by the plugin, because of AST issues. If it On 1 February 2015 at 11:37, maiflai [email protected] wrote:
|
Ah, ok, thanks. Re 2.11 - I tried building the plugin with sbt +test, which I thought would build cross-version. However it failed to compile with an xml error. Sorry, I've not got the error to hand, but please could you let me know if the updated test fails with 2.11? |
One that was merged into master do fail on 2.11.4. |
Sorry, that was intended to demonstrate a failing test, and probably my fault for submitting a PR to master. It might be that Stephen has a plan for fixing it in the near future? I think there are a few strategies for coping with this sort of thing with Git - it's not quite the same as commiting to trunk with Subversion or CVS. |
I am going to look at it soon - and personally, since I'm really the only On 2 February 2015 at 20:12, maiflai [email protected] wrote:
|
Yep, cheers, much appreciated. |
Yep, but now it will be a part of community build, which suggest test Also, you are only person doing any major dev on master as long as someone 2015-02-02 21:35 GMT+01:00 maiflai [email protected]:
|
Good points. On 2 February 2015 at 22:02, Jerzy Müller [email protected] wrote:
|
It wasn't a big issue for me, as I'm reading all issues now, but for 2015-02-02 23:04 GMT+01:00 Stephen Samuel [email protected]:
|
Probably caused by SI-8979. Suggested workarounds are to remove return statements (worked in my case) or to use the new compiler backend ( |
I want to assume that this is probably no longer an issue seeing that it's related to 2.10 and 2.11. With modern Scala versions if you still find that this is an issue, please do reopen. |
Hi,
scoverage/gradle-scoverage#35 was raised recently in the gradle-scoverage repository, but I think it's more likely a problem in the compiler plugin.
Compiling with 2.11.5 gives a NullPointerException with no message.
Compiling with 2.10.4 gives the following:
The text was updated successfully, but these errors were encountered: