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 197538

Summary: Entity annotation not separated by a new line
Product: java Reporter: Jiri Skrivanek <jskrivanek>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: VERIFIED FIXED    
Severity: normal CC: debuggercz, dkonecny, jiriprox, jskrivanek, marfous, mmirilovic, muellermi, pjiricka, sj-nb, tzezula
Priority: P2    
Version: 7.0.1   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: possible workaround on persistence side, diff for EntityWizard

Description Jiri Skrivanek 2011-04-07 14:33:54 UTC
Entity annotation is not separated by a new line if it is created from new file wizard. It occurs only in builds built on windows platform. To reproduce:

- create "Java Web|Web Application"
- open new file wizard
- select "Persistence|Entity Class"
- finish the wizard with some default values
- NewEntity.java file is opened in editor but Entity annotation is concatenated with public keyword (@Entitypublic)
Comment 1 Sergey Petrov 2011-04-07 15:54:52 UTC
Entity creation code create class from template and modify it by addition of implements and annotation, if I comment out implements addition code will be generated in two lines.
Comment 2 Sergey Petrov 2011-04-07 17:10:18 UTC
so far I can reproduce the issue with "hg update - d 2011-02-08"  and can't with "hg update - d 2011-02-05"
Comment 3 Tomas Zezula 2011-04-08 07:06:02 UTC
Honzo, I've already have fix.
Comment 4 Sergey Petrov 2011-04-08 12:04:00 UTC
one more point, unit tests can't reproduce the issue with the same build as I can reproduce the issue manually.
Comment 5 Sergey Petrov 2011-04-11 16:20:31 UTC
Created attachment 107644 [details]
possible workaround on persistence side, diff for EntityWizard
Comment 6 Sergey Petrov 2011-04-11 16:20:47 UTC
how is it going?
I have a workaround on persistence side but I don't like it as final solution, for example with attached diff for EntityWizard generation produce correct entity, but with second source modification task it's likely will cause performance regression.
Comment 7 Sergey Petrov 2011-04-11 16:25:09 UTC
for entity from db next line is generated "@Entity@Table(name = "PRODUCT_CODE")"
Comment 8 Jiri Skrivanek 2011-05-17 12:04:41 UTC
Any progress with this?
Comment 9 Sergey Petrov 2011-07-04 14:16:20 UTC
it looks like I have an issue with session bean from entities now too with @Stateless on wrong line and with extra "{", isn't tested on zip distribution yet, but as I'm going to develop in the area now, it makes the issue more severe now. I'm not sure if latest one case is the same as with @Entity.
Comment 10 Sergey Petrov 2011-09-12 09:42:03 UTC
This issue may be related to issue 199881, also it may be related to some issues I report already(or can find later) but reproducible only with my build system and it's hard to debug these issues also. Affects issues with generation sequence with intermediate step to generate entity etc. As I got it the issue affects windows build platform and isn't specific to my build system only. So upgrading to P2.
Comment 11 Sergey Petrov 2011-09-12 12:20:47 UTC
Jiri, can you try if you can reproduce issue 199881 also? (part related to wrong annotation with extra "{")
Comment 12 Jiri Skrivanek 2011-10-26 08:35:02 UTC
Tomas, could you integrate your fix from august? Now it is reproducible in the latest daily build 201110250600.
Comment 13 Tomas Zezula 2011-10-26 08:38:26 UTC
If I still find it somewhere ;-)
Comment 14 Jiri Skrivanek 2011-11-01 07:47:04 UTC
*** Bug 204478 has been marked as a duplicate of this bug. ***
Comment 15 Jiri Skrivanek 2011-11-14 11:28:37 UTC
Any progress? It blocks some our tests almost for month.
Comment 16 Sergey Petrov 2011-11-14 20:12:56 UTC
*** Bug 205111 has been marked as a duplicate of this bug. ***
Comment 17 Sergey Petrov 2011-11-14 20:13:45 UTC
If it's the issue for official builds now, shouldn't it be a showstopper? P1 may be?
Comment 18 Jan Lahoda 2011-11-21 15:31:33 UTC
This should fix the problem:
http://hg.netbeans.org/jet-main/rev/6bc3b68f72f3

Jirka S. or Jirka P., could you please verify? Tomas, could you please review the fix? Thanks.
Comment 19 Tomas Zezula 2011-11-21 15:37:22 UTC
The patch is OK.
Comment 20 Jiri Skrivanek 2011-11-22 10:13:26 UTC
Verified in custom dev 20111122-9a8edc0fe2de.
Comment 21 Quality Engineering 2011-11-22 15:52:46 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/6bc3b68f72f3
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #197538: correctly skipping '\r' in '\r\n' even in case only one character is to be read.
Comment 23 Quality Engineering 2011-11-23 07:11:48 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/292e0702176d
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #197538: correctly skipping '\r' in '\r\n' even in case only one character is to be read.
Comment 24 Jiri Skrivanek 2011-11-23 10:05:39 UTC
Verified in NetBeans IDE 7.1 RC1 (Build 201111222200).
Comment 25 Martin Fousek 2012-04-12 07:51:08 UTC
*** Bug 199881 has been marked as a duplicate of this bug. ***