13 Replies Last post: Mar 16, 2012 3:59 PM by Rao Venugopal  
Timo Hoepfner Newbie 13 posts since
Aug 22, 2002
Currently Being Moderated

Feb 2, 2012 2:27 PM

Problem with imports in Java project when Scala plugin is enabled

Hi,

 

I'm doing some tests with Play framework 2.0. I'm seeing problems with imports in Play 2.0 Java projects as long as the Scala plugin is enabled. When it's disabled, the problems vanishes. Play 2.0 Scala projects don't seem to be affected.

 

Reproduction:

1. Download http://download.playframework.org/releases/play-2.0-beta.zip and unzip

2. Add play-2.0-beta/repository/local/play/play_2.9.1/2.0-beta/jars/play_2.9.1.jar as dependency/library to a Java project

3. Add the following Java class to the project:

 

---

package test;

 

import play.*;

 

public class Test {

    public static void main() {

        Application application;

    }

}

---

 

When the Scala plugin is enabled, the import will be marked as having an error ("Cannot resolve symbol play"). When I disable the Plugin, the errors disappears.

 

Explicitly importing play.Application with the Scala Plugin enabled also solves the problem.

 

This is with IDEA 11.0.1 and Scala Plugin 0.5.282.

 

Is this a known problem?

 

Timo

Alexander Podkhalyuzin JetBrains 1,154 posts since
Jun 7, 2008
Currently Being Moderated
Feb 2, 2012 3:25 PM in response to: Timo Hoepfner
Re: Problem with imports in Java project when Scala plugin is enabled

I just started big part of work in Scala plugin to fix Java -> Scala compatibility. When it will be done, your problem will disappear in Java code with enabled Scala plugin.

 

Best regards,

Alexander Podkhalyuzin.

Taras Tielkes Apprentice 1,029 posts since
Oct 20, 2002
Currently Being Moderated
Feb 2, 2012 11:53 PM in response to: Alexander Podkhalyuzin
Re: Problem with imports in Java project when Scala plugin is enabled

Hi Alexander,

 

Will this also fix http://youtrack.jetbrains.net/issue/IDEA-78649?

 

Thanks,

-tt

Alexander Podkhalyuzin JetBrains 1,154 posts since
Jun 7, 2008
Currently Being Moderated
Feb 3, 2012 11:13 AM in response to: Taras Tielkes
Re: Problem with imports in Java project when Scala plugin is enabled

I'm doing very large refactoring, and this issue will be fixed too (and I hope to fix all Java -> Scala compatibility problems). However this refactoring can break anything. So plugin will be unstable some time. I hope this is not very big price for fixing Java -> Scala compatibility (and Groovy -> Scala and so on).

 

Best regards,

Alexander Podkhalyuzin.

Taras Tielkes Apprentice 1,029 posts since
Oct 20, 2002
Currently Being Moderated
Feb 3, 2012 8:04 PM in response to: Alexander Podkhalyuzin
Re: Problem with imports in Java project when Scala plugin is enabled

"No pain, no gain" - eagerly awaiting the next series of nightly builds.

We have some partial Java/Scala projects, I hope we'll be able to catch some bugs

 

-tt

Alexander Podkhalyuzin JetBrains 1,154 posts since
Jun 7, 2008
Currently Being Moderated
Feb 10, 2012 8:43 AM in response to: Timo Hoepfner
Re: Problem with imports in Java project when Scala plugin is enabled

I want to end it until the end of the February.

 

Best regards,

Alexander Podkhalyuzin.

Helena Hjertén Newbie 2 posts since
Mar 13, 2012
Currently Being Moderated
Mar 13, 2012 10:10 PM in response to: Alexander Podkhalyuzin
Re: Problem with imports in Java project when Scala plugin is enabled

What is the status on this?

Alexander Podkhalyuzin JetBrains 1,154 posts since
Jun 7, 2008
Currently Being Moderated
Mar 15, 2012 12:02 PM in response to: Helena Hjertén
Re: Problem with imports in Java project when Scala plugin is enabled

Actually I've done changes, which I want to do, but your problem is still here. I'll check it now then.

 

Best regards,

Alexander Podkhalyuzin.

Alexander Podkhalyuzin JetBrains 1,154 posts since
Jun 7, 2008
Currently Being Moderated
Mar 15, 2012 12:22 PM in response to: Helena Hjertén
Re: Problem with imports in Java project when Scala plugin is enabled

Ok, that was another problem with package object names (which is `package` and `package$` in Java). It's also fixed now. Next update will contain this fix.

So now example with "import play.*" is also works. Thank you.

 

Best regards,

Alexander Podkhalyuzin.

Rao Venugopal Newbie 4 posts since
Apr 13, 2009
Currently Being Moderated
Mar 16, 2012 6:04 AM in response to: Alexander Podkhalyuzin
Re: Problem with imports in Java project when Scala plugin is enabled

Hello Alexander

 

I have a couple of questions

 

a) Are you saying that this is fixed in 0.5.429 of the Scala plugin?

 

b) I tried downloading the plugin and installing but the plugin is not activated (apparently it is not compatible with Idea Ultimate 11.0.2).

Am I missing a dependency? I am able to install 0.5.392 without issues from the Settings -> plugins -> Browse repositories

 

Thanks

-Rao

Taras Tielkes Apprentice 1,029 posts since
Oct 20, 2002
Alexander Podkhalyuzin JetBrains 1,154 posts since
Jun 7, 2008
Currently Being Moderated
Mar 16, 2012 9:33 AM in response to: Rao Venugopal
Re: Problem with imports in Java project when Scala plugin is enabled

IntelliJ IDEA 11.1 will be released soon, you can just wait it. And yes, 0.5.429 contains this fix.

 

Best regards,

Alexander Podkhalyuzin.

Rao Venugopal Newbie 4 posts since
Apr 13, 2009
Currently Being Moderated
Mar 16, 2012 3:59 PM in response to: Alexander Podkhalyuzin
Re: Problem with imports in Java project when Scala plugin is enabled

Thanks for the clarification and your prompt response.

More Like This

  • Retrieving data ...