This page is no longer maintained — Please continue to the home page at www.scala-lang.org

errors with valid java code

4 replies
michael hohn
Joined: 2009-11-27,
User offline. Last seen 42 years 45 weeks ago.

Hello,

after updating the scala eclipse plugin, some valid java code is
flagged and won't compile.

Valid java code using nested static types now shows up as a
scala problem (eclipse 3.5.2, scala.tools.nsc_2.8.0.r21183-b20100316020204)
The code
: public class CodeContributor {
:
: public enum Extension {
: INIT,
: CONF_TRANSFORMER,
: FINISH;
: }
:
: Extension extension;
: String code;
:
: public CodeContributor(Extension extension, String code) {
: this.extension= extension;
: this.code= code;
: }
:
fails to compile with
| Description | Resource | Path | Location | Type |
| not found: type Extension | CodeContributor.java | .... | line 14 | Scala Problem |

I have seen a report of this on the mailing list, but that didn't provide
specific code. If it would help, I could add a ticket on the bug
tracker.

Cheers,
Michael

Hubert Plociniczak
Joined: 2009-09-12,
User offline. Last seen 42 years 45 weeks ago.
Re: errors with valid java code

I just fixed ticket #3133 which is exactly what you are experiencing.

hubert

Michael Hohn wrote:
> Hello,
>
> after updating the scala eclipse plugin, some valid java code is
> flagged and won't compile.
>
> Valid java code using nested static types now shows up as a
> scala problem (eclipse 3.5.2, scala.tools.nsc_2.8.0.r21183-b20100316020204)
> The code
> : public class CodeContributor {
> :
> : public enum Extension {
> : INIT,
> : CONF_TRANSFORMER,
> : FINISH;
> : }
> :
> : Extension extension;
> : String code;
> :
> : public CodeContributor(Extension extension, String code) {
> : this.extension= extension;
> : this.code= code;
> : }
> :
> fails to compile with
> | Description | Resource | Path | Location | Type |
> | not found: type Extension | CodeContributor.java | .... | line 14 | Scala Problem |
>
> I have seen a report of this on the mailing list, but that didn't provide
> specific code. If it would help, I could add a ticket on the bug
> tracker.
>
> Cheers,
> Michael
>

michael hohn
Joined: 2009-11-27,
User offline. Last seen 42 years 45 weeks ago.
Re: [scala-tools] errors with valid java code

> I just fixed ticket #3133 which is exactly what you are experiencing.
>
Great! Thank you.

michael hohn
Joined: 2009-11-27,
User offline. Last seen 42 years 45 weeks ago.
Re: [scala-tools] errors with valid java code

Hello again,

> I just fixed ticket #3133 which is exactly what you are experiencing.
>
> hubert
>

Your change is in r21207, so I tried the newest Scala Eclipse Plugin,
version 2.8.0.r21209-b20100318035916, but still get the error below.

Just to avoid loading any old jars, I deleted the old version of the
plugin and updated my eclipse target platform to the new version.

Hubert Plociniczak
Joined: 2009-09-12,
User offline. Last seen 42 years 45 weeks ago.
Re: errors with valid java code

I'm afraid I cannot reproduce your problem. Before r21207 compiling your
test case using build manager from the command line gave an error. It no
longer does it after my fix. I also updated my eclipse plugin and seems
to work without any problems. Maybe run eclipse with --clean flag (it
removes the old cruft and I do it always after the update)?

Thanks,
hubert

Michael Hohn wrote:
> From: Hubert Plociniczak
> Subject: Re: [scala-tools] errors with valid java code
> Date: Wed, 17 Mar 2010 19:31:17 +0100
>
> Hello again,
>
>
>> I just fixed ticket #3133 which is exactly what you are experiencing.
>>
>> hubert
>>
>>
>
> Your change is in r21207, so I tried the newest Scala Eclipse Plugin,
> version 2.8.0.r21209-b20100318035916, but still get the error below.
>
> Just to avoid loading any old jars, I deleted the old version of the
> plugin and updated my eclipse target platform to the new version.
>
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland