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 107182 - Reformat code breaks form source
Summary: Reformat code breaks form source
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks: 106361
  Show dependency tree
 
Reported: 2007-06-19 12:51 UTC by Jiri Prox
Modified: 2007-08-03 07:56 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project (14.55 KB, application/octet-stream)
2007-07-05 14:49 UTC, _ theanuradha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2007-06-19 12:51:11 UTC
Product Version: NetBeans IDE Dev (Build 200706180000) Java: 1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
System: Linux version 2.6.5-1.358 running on i386; UTF-8; en_US (nb) Userdir: /space/u9

The formatting is broken and the file is not compilable if reformat action is called on sources of form

Steps to reproduce:
1) create new JFrame Form
2) switch to source tab
3) reformat code
->
code is not compilable
Comment 1 Jana Maleckova 2007-06-20 10:55:04 UTC
I set this issue as M10 stopper because when this use case is done on form generated in Java Desktop Application, code
is scattered. IMHO users are using code formatting very often and that's the reason why I increased priority
Comment 2 Pavel Flaska 2007-06-20 11:23:09 UTC
Seems to me that we will not have M10.
Comment 3 Dusan Balek 2007-06-21 10:27:21 UTC
Fixed.

Checking in source/src/org/netbeans/modules/java/source/save/Reformatter.java;
/cvs/java/source/src/org/netbeans/modules/java/source/save/Reformatter.java,v  <--  Reformatter.java
new revision: 1.3; previous revision: 1.2
done
Checking in editor/src/org/netbeans/modules/editor/java/NbJavaFormatter.java;
/cvs/java/editor/src/org/netbeans/modules/editor/java/NbJavaFormatter.java,v  <--  NbJavaFormatter.java
new revision: 1.2; previous revision: 1.1
done
Checking in editor/src/org/netbeans/modules/editor/java/JavaKit.java;
/cvs/java/editor/src/org/netbeans/modules/editor/java/JavaKit.java,v  <--  JavaKit.java
new revision: 1.42; previous revision: 1.41
done
Checking in source/src/org/netbeans/api/java/source/SourceUtils.java;
/cvs/java/source/src/org/netbeans/api/java/source/SourceUtils.java,v  <--  SourceUtils.java
new revision: 1.38; previous revision: 1.37
done
Comment 4 Peter Pis 2007-06-26 09:27:56 UTC
Could you please verify this issue for M10?
Comment 5 Jiri Prox 2007-06-26 09:40:42 UTC
verified in trunk and m10
Comment 6 _ theanuradha 2007-07-05 14:47:21 UTC
I think still Reformat code breaks form source 

Product Version: NetBeans IDE Dev (Build 070704) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05 System: Windows
XP version 5.1 running on x86; Cp1252; en_US (nb) Userdir: C:\Documents and Settings\Anurdha\.netbeans\dev

and 
Product Version: NetBeans IDE 6.0 M10 (build 200706281431) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb) Userdir: C:\Documents and
Settings\Anurdha\.netbeans\6.0m10

 
Steps to reproduce:
1) open given Project and open DatasourceConnections.jave 
2) reformat code

Syntax error in code (additional bracket in  after btnModifyMouseReleased() )

PS this code is taken by our module project and some dependency's are missing but it wont make any difference

Comment 7 _ theanuradha 2007-07-05 14:49:19 UTC
Created attachment 44736 [details]
Project
Comment 8 Marian Mirilovic 2007-07-15 23:01:09 UTC
reproducible in 200707150000 with attached project ... tags :
- //GEN-BEGIN:
- //GEN-FIRST:
- //GEN-BEGIN:
are removed from java file. 
Comment 9 Dusan Balek 2007-07-18 13:10:20 UTC
Fixed.

Checking in Reformatter.java;
/cvs/java/source/src/org/netbeans/modules/java/source/save/Reformatter.java,v  <--  Reformatter.java
new revision: 1.5; previous revision: 1.4
done
Comment 10 Jiri Prox 2007-08-03 07:56:44 UTC
Cannot reproduce the second scenario -> marking as verified