This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 52094 - [tests] Add import in move class refactoring is not strict
Summary: [tests] Add import in move class refactoring is not strict
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords: T9Y
Depends on: 60588
Blocks:
  Show dependency tree
 
Reported: 2004-12-06 09:12 UTC by ehucka
Modified: 2007-04-03 18:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ehucka 2004-12-06 09:12:02 UTC
Move class tests sometimes fail because of new
import statement is appended with different format
(mostly on windows):

implicit format:

[old imports....]
<new line>

is transformed into:

[old imports....]
import ....  - new appended import statement
<new line>

*********************************************
but it looks sometimes:

[old imports....]
<new line>
import ... - new appended import
<new line>

or

[old imports....]
<new line>
import ... - new appended import
Comment 1 Martin Matula 2004-12-07 12:42:21 UTC
Strange. Are you able to reproduce it manually? Pavle, please look at it.
Comment 2 ehucka 2004-12-08 08:59:27 UTC
Probably no, it is random.
Comment 3 ehucka 2005-01-19 10:26:59 UTC
I've reproduced it manualy on windows XP, project 'default2' from
nbcvs:/refactoring/test/qa-functional/data/projects.
Moved class abc.A to abc.def

When the file was opened in editor moved file was equels as on unix.
But when the file wasn't opened in editor added import statement of
original package (import abc.*;) was moved one line down - a new line
was appended before this import statement.
Comment 4 ehucka 2005-01-21 13:05:06 UTC
It corrupts test results on windows. I'd like to know if it will be
fixed soon or if I should change all tests to use diff ignoring empty
lines.
Comment 5 Pavel Flaska 2005-01-27 13:19:31 UTC
Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/ResourceImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ResourceImpl.java,v
 <--  ResourceImpl.java
new revision: 1.60; previous revision: 1.59
done
Processing log script arguments...
Comment 6 ehucka 2005-01-28 08:32:23 UTC
Tests are still failing because of redundant newlines.
Comment 7 Pavel Flaska 2005-02-02 09:33:42 UTC
Second attempt.

Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/MetadataElement.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/MetadataElement.java,v
 <--  MetadataElement.java
new revision: 1.44; previous revision: 1.43
done
Comment 8 ehucka 2005-02-04 13:58:13 UTC
no change
Comment 9 Pavel Flaska 2005-02-09 12:26:56 UTC
Last attempt. Now there should be no difference on windows and linux
platforms.

Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/ResourceImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ResourceImpl.java,v
 <--  ResourceImpl.java
new revision: 1.63; previous revision: 1.62
done
Processing log script arguments...
Comment 10 ehucka 2005-02-10 10:08:49 UTC
it looks better but some tests still failing by this reason
Comment 11 Pavel Flaska 2005-02-18 10:19:13 UTC
I just tried to run qa-functional tests on my machine and did not see
any problem with newlines. (I tried it 3 times on Linux box)

Is there still any problem on Windows? -- Are the problems exactly
same in different runs or they differ? Is there any possibility to get
incorrectly generated files or create some unified diff to exactly see
what is wrong?
Comment 12 ehucka 2005-02-18 12:37:34 UTC
The results are different only between unix and windows platforms. The
results of one platform are always the same.
I changed a test code to leave tested files in xtest workdir. 
Run tests on windows and check tested files with golden files (made on
unix).
Typical tests with this behaviour are qa-functional - jdk15 - move and
rename.
Comment 13 Pavel Flaska 2005-08-01 12:24:32 UTC
We made some changes in line endings recently and expect that this problem is
not reproducible anymore. When tests will run again, please, check the results
and reopen if recent change did not help.
Comment 14 ehucka 2005-09-19 11:02:25 UTC
v