Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 153957 - JSP/Java reformating problem
JSP/Java reformating problem
Product: editor
Classification: Unclassified
Component: Formatting & Indentation
All All
: P2 (vote)
: 6.x
Assigned To: Dusan Balek
Depends on:
  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

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.

Comment 11 Quality Engineering 2009-02-07 08:40:41 UTC
Integrated into 'main-golden', will be available in build *200902070301* on (upload may still be in progress)
User: Dusan Balek <>
Log: Issue #153957: JSP/Java reformating problem - fixed.

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