4.5 Path error - shows red, but compiles

I have a base class (ActionSupport) from webwork.
I have a jar that includes a class that extends ActionSupport (ProfileAction).
I have a class in a separate web project that extends ProfileAction. The third class overrides the doExecute from ActionSupport and calls super.doExecute();

The editor shows doExecute() as an error (red) and if I try to override a method (Ctrl+O) I see the ProfileAction and it's methods, but no reference to ActionSupport.

This code compiles in the IDE (or using ant) and runs fine, but Idea is showing all methods and attributes from the base class (ActionSupport) as errors.

This started when I moved from 4.0 to 4.5. I've deleted all the cache and system files under my profile and restarted to ensure no old copies, but no luck. This doesn't appear to be happening with any other class hierarchy, so I have to assume that I've got something wrong in my config or path settings, but the webwork jar is in the path and I can create similar classes in the same project space with no errors.

7 comments
Comment actions Permalink

Allen Stoker wrote:

>The editor shows doExecute() as an error (red) and if I try to override a method (Ctrl+O) I see the ProfileAction and it's methods, but no reference to ActionSupport.

>
Try Ctrl-I for implement interface method?

0
Comment actions Permalink

I have a similar problem with some methods in some classes that are marked red(erronous).
The methods also won't show up if you try to type the method name and use code completion.
It still compiles, both using IDEA and Ant though.

The problem occured when upgrading to 4.5 from 4.0 (as for you). I'm using a win XP machine.

I did a clean install but had old versions still installed.
Tried to uninstall everything, cleaned up registry and filesystem, but still the problem remains.
A common thing amongst the methods causing trouble seem to be they have a å,ä or ö (common characters in swedish language) in the method name.
Only methods contained in classes located in other modules or libraries seem to cause this problem, not within the same module.
Anyone who has seen this problem and solved it, or is it a bug?

0
Comment actions Permalink

In general I'm finding more cases where 4.5's editor checking is too strict
(stricter than the compiler). One that gets me is the use of mixed
int/double constants in a double array. The following code shows up in red
in 4.5 compaining about ints/doubles in the SIZES array:

private final static int BORDER = 0;
private final static double FILL = 5.0;
private final static double[][] SIZES = {
{ BORDER, FILL, FILL, BORDER }
};

but is perfectly legal Java code (well - it compiles fine anyway!). We have
quite a lot of this type of code layout for setting up TableLayout size
arrays and it isn't always correct to change to all doubles (eg the BORDER
constant above is also used in Swing code which expects an integer).

Cheers,

TicH


0
Comment actions Permalink

In this case, there is nothing to 'implement'. Thomas you seem to be hitting the exact issue. I am also on XP (if that makes a difference) and while I tried to give a specific example, I would agree that this problem only appears when the class is referenced from a jar built elsewhere. The jar where I am seeing this problem was built using ant.

I also don't believe that this is an issue of the editor being 'too tight'. While that may be a valid issue, this case is simply the in-ability for the editor to see past the first class in the ancestry.

0
Comment actions Permalink

To me Richard seems to have found another thing in the editor checking that doesn't work in 4.5. Allen's problem seem to be more directly related to mine.
I think the jetbrains gang has to look into this.

In my case I have problems both with implemented methods in classes implementing interfaces, static methods and static variables(at least constants). I.e it seems as it does impact non-hierarchical methods/fields.

As I mentioned, I think every one of them contains a 'swedish' character.
All these cases should be considered valid Java code (other methods/constants etc. in the same classes are available in code comletion and they're not marked red).

To me it seems as it can't be a configuration issue since some methods/fields in the same class shows up, others don't.
/T

0
Comment actions Permalink

Thomas wrote:

To me Richard seems to have found another thing in the editor checking that doesn't work in 4.5. Allen's problem seem to be more directly related to mine.
I think the jetbrains gang has to look into this.

In my case I have problems both with implemented methods in classes implementing interfaces, static methods and static variables(at least constants). I.e it seems as it does impact non-hierarchical methods/fields.

As I mentioned, I think every one of them contains a 'swedish' character.
All these cases should be considered valid Java code (other methods/constants etc. in the same classes are available in code comletion and they're not marked red).

To me it seems as it can't be a configuration issue since some methods/fields in the same class shows up, others don't.
/T

We would be greatful for a little demo project that shows up the problem. Thanks.

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

My problem is gone! ... but I did not determine root cause.

Here's what I did:
- backed up, then deleted all Idea cache files ( .IntellijIdea/system/* )
- backed up and deleted all project files ( *.iml, *.ipr, *.iwl )
- re-arranged my source files
- create a new project (2 modules, model (java) and web (web module)
- created project 'libraries' for my external jars and DID NOT put them within either project
- reference the appropriate 'libraries' for each module

I think the problem possibilities are:
- something was corrupted going between 4.0 & 4.5 (jar cache space appears to be reused but not compatible)
- the way my jars were included in the path for each module (I was not using the libraries feature)
- incorrect conversion of the project file itself (could also be that I had a strange configuration in 4.0 that the converted didn't account for)
- halucination (just kidding, it WAS real!)

If you started by opening a 4.0 project and letting Idea convert it, I would suggest that you try creating the project in 4.5 from scratch.

Hope this helps...

0

Please sign in to leave a comment.