Bug 153957 - JSP/Java reformating problem
JSP/Java reformating problem
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Formatting & Indentation
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Dusan Balek
issues@editor
: API, API_REVIEW_FAST
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-26 18:15 UTC by cld71
Modified: 2009-02-19 20:45 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Proposed API change to CodeStylePreferences (8.01 KB, patch)
2009-02-05 15:46 UTC, Dusan Balek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cld71 2008-11-26 18:15:51 UTC
When Format is called on a normal Java file after turning off "Spaces" "Before Parentheses", and "Spaces" "Before Left
Braces" for if statements in the Options the Java file looks like this:
if(value == null){
...

But, when Format is called on a JSP file it looks like this:
<%
if (value == null) {
...

Format should of made the JSP file look like this:
<%
if(value == null){
...

Just like the Java file.
Comment 1 David Konecny 2008-11-27 00:30:43 UTC
mfukala, is this problem at JSP side or is it handled by Java module? Or does this depend on Parsing API?
Comment 2 Marek Fukala 2008-11-28 09:24:15 UTC
The formatting of java code is done by java formatter AFAIK. This may also be a settings problem. Tomasz Slota will tell
you more.
Comment 3 Tomasz Slota 2008-11-28 10:23:16 UTC
i think Dusan is a better person to ask...
Comment 4 Dusan Balek 2008-11-28 12:53:26 UTC
The problem is that org.netbeans.modules.editor.indent.spi.CodeStylePreferences works with Document/FileObject's
mime-type only. CodeStylePreferences should be modified to work also with embeddings.
Comment 5 Petr Dvorak 2009-01-08 17:54:27 UTC
Is the priority set correctly? I would suggest lowering the priority to P3 (standard)...
Comment 6 Vitezslav Stejskal 2009-01-12 11:23:45 UTC
Well, this problem makes all java formating settings non-functional in embedded code. So, perhaps P2 is reasonable here.
Comment 7 Dusan Balek 2009-02-05 15:46:47 UTC
Created attachment 76618 [details]
Proposed API change to CodeStylePreferences
Comment 8 Dusan Balek 2009-02-05 15:50:48 UTC
I would like to propose a small API change to the CodeStylePreferences class (diff is attached).
Comment 9 Vitezslav Stejskal 2009-02-06 09:46:00 UTC
Looks ok to me. Thanks Dusan
Comment 10 Dusan Balek 2009-02-06 11:52:25 UTC
Fixed in jet-main.

See http://hg.netbeans.org/jet-main/rev/f1aaa871c14c
Comment 11 Quality Engineering 2009-02-07 08:40:41 UTC
Integrated into 'main-golden', will be available in build *200902070301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f1aaa871c14c
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #153957: JSP/Java reformating problem - fixed.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo