JUnitTestPlugin/IDEA 815 bug (and a patch).

This is mainly to Jacques and anyone else developing the JUnitTestPlugin.

With IDEA 815 (didn't test with any earlier version), the plugin throws a
NullPointerException every time a new project is created. This completely
prevents you from creating a new project.

Fortunately, there's an easy fix for it: change Line 268 in
org.intellij.plugins.junit.JUnitTestConfigurable can be changed from

debug("registering actions from " + getCallerMethod() + " of " +
project.getProjectFile().getName());

to

String projFileName = (project.getProjectFile() != null) ?
project.getProjectFile().getName() : "new project";
debug("registering actions from " + getCallerMethod() + " of " +
projFileName);

It seems that project.getProjectFile() returns null when creating a new
project in 815, but it didn't in 813. I don't know if this is a new bug in
the OpenAPI or a correction of an older bug.

Hope that helps,
Vil.
--
__
o| . / \|o. _ _ ._ _ ._ _ |
\/ ||\/(_|| (|/||| |(/_(_)| |(/_o| |(/_ |_
/ \__
http://website.lineone.net/~vilya

2 comments
Comment actions Permalink

Thanks Vilya,

Funny that we ran into it on the same exact day since that bug as been there
for a long time, waiting to strike. It affects every version ;)

Jacques

"Vilya Harvey" <vilya@lineone.net> wrote in message
news:baea8r$o8h$1@is.intellij.net...

This is mainly to Jacques and anyone else developing the JUnitTestPlugin.

>

With IDEA 815 (didn't test with any earlier version), the plugin throws a
NullPointerException every time a new project is created. This completely
prevents you from creating a new project.

>

Fortunately, there's an easy fix for it: change Line 268 in
org.intellij.plugins.junit.JUnitTestConfigurable can be changed from

>

debug("registering actions from " + getCallerMethod() + " of " +
project.getProjectFile().getName());

>

to

>

String projFileName = (project.getProjectFile() != null) ?
project.getProjectFile().getName() : "new project";
debug("registering actions from " + getCallerMethod() + " of " +
projFileName);

>

It seems that project.getProjectFile() returns null when creating a new
project in 815, but it didn't in 813. I don't know if this is a new bug in
the OpenAPI or a correction of an older bug.

>

Hope that helps,
Vil.
--
__
o| . / \|o. _ _ ._ _ ._ _ |
\/ ||\/(_|| (|/||| |(/_(_)| |(/_o| |(/_ |_
/ \__
http://website.lineone.net/~vilya

>


0
Comment actions Permalink

The only reason I spotted it was because of the project format in 815 being
incompatible with the earlier format. I was trying to create a new project
for some existing code when it struck. Maybe we should ask JetBrains to
change their project format more often, to help everyone track down bugs in
their plugins? ;)

Vil.

Jacques Morel wrote:

Thanks Vilya,

Funny that we ran into it on the same exact day since that bug as been there
for a long time, waiting to strike. It affects every version ;)

Jacques


--
Vilya Harvey, Consultant
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

Disclaimer

This e-mail and any attachments may be confidential and/or legally
privileged. If you have received this email and you are not a named
addressee, please inform the sender at Digital Steps Ltd by phone on
+44 (0)1483 469 480 or by reply email and then delete the email from
your system. If you are not a named addressee you must not use,
disclose, distribute, copy, print or rely on this email. Although
Digital Steps Ltd routinely screens for viruses, addressees should
check this email and any attachments for viruses. Digital Steps Ltd
makes no representation or warranty as to the absence of viruses in this
email or any attachments.

0

Please sign in to leave a comment.