Bug 495987 - Missing semicolon havoc project
Summary: Missing semicolon havoc project
Status: CLOSED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.13 RC2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2016-06-13 08:41 EDT by Peter Larsen CLA
Modified: 2020-08-27 01:49 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Larsen CLA 2016-06-13 08:41:03 EDT
I can reproduce the following every time, but I dont have a small test example.
Nor am I allowed to give the src or access to it, so it already a bad bug report.

In a project without any errors, I can remove a semicolon for a field decl
<pre>
package octoshape.a.b.c;
public class D extends ...{
	...
	private StreamingToOT checkSoftEvict
</pre>
This causes an error "Syntax error, insert ";" to complete FieldDeclaration" as 
expected.

However a lot of other java files suddenly also gets errors.
It seems most of them are related in some way, others I dont see the direct connection. They all marked with the following errors starting with the first line

<pre>
Multiple markers at this line
	- octoshape.x.y.z cannot be resolved 
	 to a type
	- Syntax error on token "package", assert expected
</pre>

Then continues with 

<pre>
	- octoshape.build.BuildFlags cannot be resolved to a 
	 variable
	- Syntax error on token "import", throw expected
</pre>


Adding the semicolon does not make the wrong errors go away, only the correct about missing semicolon. I can clean and rebuild to make them go away.
Comment 1 Jay Arthanareeswaran CLA 2016-11-18 02:36:41 EST
Hmm.. clearly there's something wrong, but not sure if we can do anything until we get a reproducible test case.
Comment 2 Missing name CLA 2016-12-16 01:03:56 EST
I have this trouble from time to time... and one of those times is right now.

I did a project wide search and replace of import lines in many files to refactor from old deprecated types to new ones. No type refactoring that I know of... so did this with text search and replace..... now all the package declarations are not recognized (same error as above)... cleaning workspace, removing and replacing source dir's do not help

I can resolve on a file-by-file basis by removing (cutting) package declaration, then saving and building, then replacing (pasting) declaration, saving and building..... 1000's of files <cough><cough>

My search and replace searched for one whole import line (e.g., import org.apache.spark.sql.DataFrame;) with two import lines ("import ...Dataset<Row>;\nimport ....Row;")
Comment 3 Stephan Herrmann CLA 2016-12-16 14:47:38 EST
(In reply to Jon Gorrono from comment #2)
> I have this trouble from time to time... and one of those times is right now.

First, may we ask you to backup your workspace showing the error for experiments? This isn't by chance open source, so you could share your workspace?
Comment 4 Missing name CLA 2016-12-16 19:57:31 EST
I'm sorry that I'm not quite sure get what you mean... by 'backup', specifically.

....tar and attach here?

This project is not open source, tho I'm not sure anyone at this (public) university would mind my sharing with eclipse.org rep's, maintaining default copyrights o' course.

I should add that while I have had precisely this problem before using Eclipse (and I *suspect* as a result of mulit-line headerline, import/package, search and replace in java files), I am currently using a mutation of Eclipse called AnypointStudio (MuleSoft).

What would you like to see? .project/.classpath or do you want the whole workspace?
Comment 5 Missing name CLA 2016-12-16 20:01:24 EST
 o i c now, you mean backup before I move forward with some full refresh or something... got it. I'd prefer sharing with a limited audience... is there a way to attach for eclipse team viewing only?
Comment 6 Eclipse Genie CLA 2019-08-31 13:26:21 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Stephan Herrmann CLA 2019-08-31 13:41:13 EDT
sorry I dropped the ball here, but just now found something funny:

(In reply to Jon Gorrono from comment #2)
> My search and replace searched for one whole import line (e.g., import
> org.apache.spark.sql.DataFrame;) with two import lines ("import
> ...Dataset<Row>;\nimport ....Row;")

surely this

import ...Dataset<Row>;

will confuse the parser ... if that happens in 1000s of files, trouble is to be expected.

So I'm guessing in Jon's case it's just that.

For Peter's original issue we'd need more info, I'm afraid.

Closing for now. If you have info for reproduction feel free to re-open.
Comment 8 Peter Larsen CLA 2019-08-31 17:28:01 EDT
I no longer have access to the project, so I cannot reproduce.
The project/product does not even exists except on backup I think.
So I am ok with closing it with worksforme.
Comment 9 Missing name CLA 2020-08-27 01:49:11 EDT
I've since retired. Eclipse, a distant memory ;)

If I read correctly I had generics in import statements that confused the parser? I thought I had seen this done before. Anyways, bon voyage