Question: The class could not be resolved

Hi,
     I melt a strange problem, the details are:

     (1) I create a java file, and in the .java file ,there are some nested classes( or interface), and the file is very large, about 50000 lines.
     there is a sample like below:

public interface Cst
{
public interface AID_ARROW
{
static final int APPEARANIMNE = 5;
static final int APPEARANIMNW = 1;
static final int APPEARANIMSE = 9;
static final int APPEARANIMSW = 13;
static final int COUNT = 16;
} //AID_ARROW

public interface AID_AXE
{
     ....

     (2) I found that in the project tree, the file is not show a interface icon but a java file icon(the interface should show a interface icon in normal condition),
          and in other classes, when I use the Cst interface or Cst.AID_ARROW, then it shows the error the the class could not be resolved.
     (3) But when compile the file, it is passed...

     (4) Did someone else melt these problem?  Thanks!

5 comments
Comment actions Permalink

Hello yang,

For performance reasons IDEA doesn't parse Java classes which exceed certain
size (2M I believe). You can increase the size, but it's strongly recommended
to split the class into multiple smaller classes instead.

Hi,
I melt a strange problem, the details are:
(1) I create a java file, and in the .java file ,there are some
nested classes( or interface), and the file is very large, about 50000
lines.
there is a sample like below:

 static final int APPEARANIMNE = 5;\\ static final int APPEARANIMNW =
> 1;\\ static final int APPEARANIMSE = 9;\\ static final int
> APPEARANIMSW = 13;\\ static final int COUNT = 16;\\ } //AID_ARROW\\ \\
> public interface AID_AXE\\ {
> ....]]>

(2) I found that in the project tree, the file is not show a
interface icon but a java file icon(the interface should show a
interface icon in normal condition),
and in other classes, when I use the Cst interface or
Cst.AID_ARROW, then it shows the error the the class could not be
resolved.
(3) But when compile the file, it is passed...

(4) Did someone else melt these problem? Thanks!
---
Original message URL:
http://www.jetbrains.net/devnet/message/5228028#5228028

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

it's a very bad design smell if you have any source that large, it should never have been allowed to get that way in the first place.
Anything much over a few hundred lines usually needs refactoring badly, more than a few thousand lines is a disaster (waiting to happen).

There are of course exceptions, but mostly those have to do with reams of comments or embedded SQL (where the latter could be a design flaw in its own right and the former begs the thought whether that text might not need to be in a separate design document).

0
Comment actions Permalink

Hi,


Thanks for you answer.

I know that the code is a bad design, but for some reason that I have to do with it...


could you tell me how to increase the size of the limit?


Thanks very much.

0
Comment actions Permalink

Hi,


Thanks for your answer, but for some reason that I have to do with the code...

do you know how to change the size limit to the java source ?

Thanks very much

0
Comment actions Permalink

Hello yang,


Thanks for you answer.

I know that the code is a bad design, but for some reason that I have
to do with it...


could you tell me how to increase the size of the limit?


Edit the idea.max.intellisense.filesize value in idea.properties.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.