diff options
author | nsandonato | 2010-02-03 15:33:07 +0000 |
---|---|---|
committer | nsandonato | 2010-02-03 15:33:07 +0000 |
commit | 455c76fd283130c25767c1f08855801d079caf4c (patch) | |
tree | 28c5f990097f18e8dfa7e5df14d48c11c6b9770a /bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html | |
parent | b6b55312c8fc91a17d505e00214f6d07d194fa53 (diff) | |
download | webtools.sourceediting-455c76fd283130c25767c1f08855801d079caf4c.tar.gz webtools.sourceediting-455c76fd283130c25767c1f08855801d079caf4c.tar.xz webtools.sourceediting-455c76fd283130c25767c1f08855801d079caf4c.zip |
[296665] [formatter] JSP cleanup can change case of Java code
Diffstat (limited to 'bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html')
-rw-r--r-- | bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java index 937cd234d5..bfc9de8c30 100644 --- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,6 +33,7 @@ import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument; import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion; +import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer; import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList; import org.eclipse.wst.sse.core.utils.StringUtils; import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration; @@ -173,6 +174,8 @@ public class ElementNodeCleanupHandler extends AbstractNodeCleanupHandler { for (int i = 0; i < attributesLength; i++) { IDOMNode eachAttr = (IDOMNode) attributes.item(i); + if (hasNestedRegion(eachAttr.getNameRegion())) + continue; String oldAttrName = eachAttr.getNodeName(); String newAttrName = oldAttrName; /* @@ -198,6 +201,19 @@ public class ElementNodeCleanupHandler extends AbstractNodeCleanupHandler { } } + /** + * True if container has nested regions, meaning container is probably too + * complicated (like JSP regions) to validate with this validator. + */ + private boolean hasNestedRegion(ITextRegion container) { + if (!(container instanceof ITextRegionContainer)) + return false; + ITextRegionList regions = ((ITextRegionContainer) container).getRegions(); + if (regions == null) + return false; + return true; + } + protected IDOMNode applyTagNameCase(IDOMNode node) { IDOMElement element = (IDOMElement) node; if (element.isCommentTag()) |