Bug 433921 - Test file Converter/src/test0536/A.java is bogus
Summary: Test file Converter/src/test0536/A.java is bogus
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-01 08:29 EDT by Stephan Herrmann CLA
Modified: 2023-02-08 13:40 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2014-05-01 08:29:07 EDT
This is mostly a test issue, just the last question below might indicate s.t. broken in shippable code.

This file:
   http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.core.tests.model/workspace/Converter/src/test0536/A.java

is supposed to be equal to this attachment:
   https://bugs.eclipse.org/bugs/attachment.cgi?id=7629

but in fact the content is duplicated with some extra text in the middle:

Lines 248-260:
-----8<-----
		}
		System.out.println(output);
	
	}
}Content-Type: text/plain

/*
 * Created on Jan 20, 2004
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package test0536;
-----8<-----

Interestingly the Java editor does *not* show anything beyond the brace closing the first (correct) class declaration! You need to use a text editor to see the duplication.

This surfaced by causing a regression in Object Teams where, for unknown reasons, we all the sudden parse the entire file and create a CUD with duplicate content leading to bad AST structure (package declaration coming *after* imports).

Questions:

=> What makes the tool (at parsing level? at input stream level?) stop reading at the closing brace?

=> Has the file been bogus all the time? Is it an artefact of bogus CVS->git conversion?

=> Do we need to handle the case of stray package declaration late in the file? (That's what currently causes the bad AST structure.) Is such handling present in JDT (where?) and just got broken in Object Teams?
Comment 1 Eclipse Genie CLA 2020-06-17 15:47:49 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 2 Eclipse Genie CLA 2023-02-08 13:40:44 EST
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.