Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 525478

Summary: JDT indexer error "cannot be resolved to a type"
Product: [Eclipse Project] JDT Reporter: Kenneth Styrberg <kenneth.styrberg>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED INVALID QA Contact: Manoj N Palat <manoj.palat>
Severity: major    
Priority: P3 CC: jarthana, loskutov, manoj.palat
Version: 4.7.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Kenneth Styrberg CLA 2017-10-03 02:19:16 EDT
When working in a standard java class file we frequently get the problem that the indexer seems to drop some knowledge of other classes. We get errors stating classes "cannot be resolved to a type". Not all classes get this problem, so some knowledge is still there.

A full clean/rebuild fixes this, but on a large project this is really annoying.

I've enabled the "-debug" flag and added the .options file, but I can't find where to start looking. I've tried some options but can't find any problems.

I can reproduce fairly easily by just adding a new line and pressing ctrl+z or by renaming an method variable.

We work in a full virtual environment on Windows 7. I don't know if there can be some resource problem on our servers that's causing this. I can't remember if I have seen this on a standard PC.

Can anyone give some hints on how to debug this properly?
Comment 1 Jay Arthanareeswaran CLA 2017-10-03 02:24:27 EDT
Copying Manoj who might have some idea about this.
Comment 2 Kenneth Styrberg CLA 2017-10-03 05:44:04 EDT
Ok, I got hold of a standard PC and the problem remains. I've tested with Eclipse 4.5.2 also and the problem was there also.

Can it have anything to do with the fact that we bumped most plugins to Java 1.8 recently?

When error occur in editor, I can still CTRL-mouseclick on the class and it opens as expected, so the editor finds it.
Comment 3 Manoj N Palat CLA 2017-10-05 23:13:19 EDT
@Kenneth: 1) can you please try with Oxygen release or any of the recent I-builds? 2) can you please attach a screen shot of the error? 3) Better ifthere is any reproducible workspace which you can send?

Also, can you explain a bit about "when working in a standard java class"? What is the operation you are initiating - search or any similar?
Comment 4 Kenneth Styrberg CLA 2017-10-06 02:27:28 EDT
I think I've found the problem.
I opened up the .project file in one of the problematic plugins and found out following at the end:

<filteredResources>
  <filter>
    <id>1471866099754</id>
    <name></name>
    <type>22</type>
    <matcher>
      <id>org.eclipse.ui.ide.multiFilter</id>
      <arguments>1.0-name-matches-false-false-*.class</arguments>
    </matcher>
  </filter>
</filteredResources>


Removing this seems to have cured my Eclipse!

So maybe not a bug after all, but a wrong property setting?!
Strange it works for a while before it decides to misbehave.