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 120523

Summary: reformat code is removing characters of code
Product: javaee Reporter: Jindrich Sedek <jsedek>
Component: JSPAssignee: Tomasz Slota <tslota>
Status: VERIFIED FIXED    
Severity: blocker CC: dbalek, dkonecny, pjiricka, ttran
Priority: P1    
Version: 5.x   
Hardware: Sun   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: problematic file
reformating this piece of code nearly half of document is removed

Description Jindrich Sedek 2007-10-30 17:50:09 UTC
use attached file
invoke reformat
 ->code is broken and some pieces of code are removed during reformat
Comment 1 Jindrich Sedek 2007-10-30 17:50:34 UTC
Created attachment 52029 [details]
problematic file
Comment 2 Petr Jiricka 2007-10-31 00:04:27 UTC
Data loss -> P1.
Comment 3 Tomasz Slota 2007-10-31 14:46:51 UTC
confirmed, reproducible
Comment 4 Jindrich Sedek 2007-10-31 18:34:12 UTC
Created attachment 52165 [details]
reformating this piece of code nearly half of document is removed
Comment 5 Tomasz Slota 2007-10-31 20:19:42 UTC
Dusan is looking into it, the fix probably needs to be done in the java code
Comment 6 Dusan Balek 2007-11-01 10:42:31 UTC
The problem seems to be that
org.netbeans.modules.web.core.syntax.JavaSourceProviderImpl.FilterImpl.filterCharSequence(CharSequence charSequence)
does not filter the passed charSequence but it always takes the fresh data form the underlying document instead.
Tomasz is working on it.
Comment 7 Dusan Balek 2007-11-01 13:40:09 UTC
java/source part fixed.

Checking in SourceFileObject.java;
/cvs/java/source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java,v  <--  SourceFileObject.java
new revision: 1.21; previous revision: 1.20
done
Comment 8 Tomasz Slota 2007-11-01 14:07:47 UTC
fix completed.

Checking in SimplifiedJSPServlet.java;
/cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/SimplifiedJSPServlet.java,v  <--  SimplifiedJSPServlet.java
new revision: 1.31; previous revision: 1.30
done
Checking in JavaSourceProviderImpl.java;
/cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JavaSourceProviderImpl.java,v  <--  JavaSourceProviderImpl.java
new revision: 1.10; previous revision: 1.9
done
Comment 9 Jindrich Sedek 2007-11-02 12:54:18 UTC
verified.
NetBeans IDE Dev (Build 20071102062308)