Build #2026 Enums still not recognized?
I saw a post about this earlier. 1.5 enum support was supposed to be in build 2013, a later post said that they were fixed. I've downloaded the latest build (2026) and they still show up as unresolved symbols. All the other 1.5 features are being recognized so unless I have something wrong this seems to still be an issue.
Please sign in to leave a comment.
Chris Hampton wrote:
I guess you should set up 1.5 language level in Paths dialog in order for enums to be recognized.
--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
It strikes me as a less than obvious location for these options. (assset & 1.5 features).
Seems like they should be located under compiler settings to me.
Enums are not working properly for me either (Build 2026).
Yes, I have the "Language Level" set to 1.5.
The following code shows the case values as being
unresolved symbols when viewed in the editor window
(but everything compiles fine).
package test.etest;
public class ETest
{
public enum foo { aaa, bbb, ccc }
public static void main(String[] args)
{
foo x = foo.aaa;
switch(x)
{
case aaa:
break;
case bbb:
break;
case ccc:
break;
}
}
}
Just restart idea an it works (at least for me).
greetings
watzlaw
Anyway it is IMHO a bug.
Sorry for my posting. i just posted before my idea completed code-parsing on startup. i have the same problem
See also http://www.intellij.net/tracker/idea/viewSCR?publicId=33108 .
Tom
This does not work for me either.
"Nathaniel Colangelo" <no_mail@jetbrains.com> wrote in message
news:21382144.1085281344706.JavaMail.itn@is.intellij.net...
>
>
>
>
>
>
>
>
watzlaw wrote:
What the bug is? Doesn't Language Level option clearly states it is effective on restart?
--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
In earlier builds, I too was having limited success with Enums. I have quite a few enums in a project I'm working with 2026 at and I haven't had a single problem, the parsing works fine.
Here's my enum class:
public enum HttpStatusCodeEnum {
HTTP_STATUS_OK (200, "Ok"),
HTTP_STATUS_CREATED (201, "Created"),
HTTP_STATUS_ACCEPTED (202, "Accepted"),
HTTP_STATUS_NO_CONTENT (204, "No Content"),
HTTP_STATUS_MULTIPLE_CHOICES (300, "Multiple Choices"),
HTTP_STATUS_MOVED_PERMANENTLY (301, "Moved Permanently"),
HTTP_STATUS_MOVED_TEMPORARILY (302, "Moved Temporarily"),
HTTP_STATUS_NOT_MODIFIED (304, "Not Modified"),
HTTP_STATUS_BAD_REQUEST (400, "Bad Request"),
HTTP_STATUS_UNAUTHORIZED (401, "Unauthorized"),
HTTP_STATUS_FORBIDDEN (403, "Forbidden"),
HTTP_STATUS_NOT_FOUND (404, "Not Found"),
HTTP_STATUS_INTERNAL_SERVER_ERROR (500, "Internal Server Error"),
HTTP_STATUS_NOT_IMPLEMENTED (501, "Not Implemented"),
HTTP_STATUS_BAD_GATEWAY (502, "Bad Gateway"),
HTTP_STATUS_SERVICE_UNAVAILABLE (503, "Service Unavailable");
private final int value;
private final String description;
private HttpStatusCodeEnum(int value, String description) {
this.value = value;
this.description = description;
}
public int value() {
return value;
}
public String description() {
return description;
}
}
I did restart (many times), and the above
code still is not parsed correctly (the case
labels are all red, and popup messages like
"Cannot resolve symbol 'aaa'" when I mouse
over them.
I understand that it is working for some others,
but it is not working for everyone.
Configuration:
Build 2026, clean install (not upgrade)
Language level: 1.5
Restarted after setting Language level.
Nathaniel Colangelo wrote:
Would you please try to narrow down the problem in a sample project and submit an SCR into the tracker with all the
.ipr, .iml and .java files attached.
Thanks in advance.
--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
yes you are absolutly right. sorry, i just overlooked it.
As described above the problem occurs when using a switch-construct with an enum.
Nathaniel Colangelo wrote:
Yup sorry, this is definitely a bug. Will fix.
Thanks.
Cheers,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Fixed.
"Chris Hampton" <champton@automatedlogic.com> wrote in message
news:28417697.1085179109161.JavaMail.itn@is.intellij.net...
build 2013, a later post said that they were fixed. I've downloaded the
latest build (2026) and they still show up as unresolved symbols. All the
other 1.5 features are being recognized so unless I have something wrong
this seems to still be an issue.
O.K. I found the option and enums are now working for me. Considering JetBrains exceptional job with IDEA it seems strange to have a hard to find (if you don't know to look for it) option at the bottom of a dialog where it doesn't seem to belong. Wouldn't it be possible to enable this feature based on the JDK you're using with the project? You could even notify the user that a restart is needed to enable the features when the JDK is switched, or enable them automatically when the user loads a project with a certain JDK. I can't image anyone wanting to use JDK 1.5 but only use 1.3 features. The option could still exist if they wanted to manually downgrade the language level.
Just a thought...
Fixed you say. In 2026 or in some subsequent build yet to be released? In another thread an answer was given that indicated that a new build would be released that same day - which was yesterday. I took it as an indication of a new build (after 2026). I'm only asking for clarification because I have deliberately postponed some minor projects that would be easier to implement in Java 1.5, while waiting for Java 1.5 support in EAP to settle.
Best regards,
Lars Ugleberg
"Lars Ugleberg" <lars.ugleberg@essnet.se> wrote in message
news:3880271.1085466842369.JavaMail.itn@is.intellij.net...
In the subsequent one.
would be released that same day - which was yesterday. I took it as an
indication of a new build (after 2026).
I don't know why the build was not released yesterday, I suppose there were
some critical issues to be solved. I also hope that the builds will be
released on daily basis now.
some minor projects that would be easier to implement in Java 1.5, while
waiting for Java 1.5 support in EAP to settle.
I don't think that this only bug should prevent you from developing with
1.5, unless you know something else that we here are not yet aware of:)
Best Regards,
Eugene.