Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 154716 Details for
Bug 293503
[validation] JSP syntax validator requires brackets after IF statement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix Patch Update 2
293503_JSPTranslator_if_statement.txt (text/plain), 3.90 KB, created by
Ian Tewksbury
on 2009-12-17 17:17:24 EST
(
hide
)
Description:
Fix Patch Update 2
Filename:
MIME Type:
Creator:
Ian Tewksbury
Created:
2009-12-17 17:17:24 EST
Size:
3.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.jsp.core >Index: src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java,v >retrieving revision 1.51.2.3.2.6 >diff -u -r1.51.2.3.2.6 JSPTranslator.java >--- src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java 18 Sep 2009 04:12:40 -0000 1.51.2.3.2.6 >+++ src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java 17 Dec 2009 22:20:36 -0000 >@@ -246,6 +246,19 @@ > private String fELTranslatorID; > > /** >+ * <code>true</code> if code has been found, such as HTML tags, that is not translated >+ * <code>false</code> otherwise. Useful for deciding if a place holder needs to be >+ * written to translation >+ */ >+ private boolean fFoundNonTranslatedCode; >+ >+ /** >+ * <code>true</code> if code has been translated for the current region, >+ * <code>false</code> otherwise >+ */ >+ private boolean fCodeTranslated; >+ >+ /** > * A structure for holding a region collection marker and list of variable > * information. The region can be used later for positioning validation > * messages. >@@ -488,6 +501,9 @@ > > fELProblems = new ArrayList(); > >+ fFoundNonTranslatedCode = false; >+ fCodeTranslated = false; >+ > } > > /** >@@ -916,7 +932,9 @@ > setCurrentNode(fStructuredDocument.getFirstStructuredDocumentRegion()); > > while (getCurrentNode() != null && !isCanceled()) { >- >+ //no code has been translated for this region yet >+ fCodeTranslated = false; >+ > // intercept HTML comment flat node > // also handles UNDEFINED (which is what CDATA comes in as) > // basically this part will handle any "embedded" JSP containers >@@ -927,10 +945,18 @@ > // iterate through each region in the flat node > translateRegionContainer(getCurrentNode(), STANDARD_JSP); > } >+ >+ //if no code was translated for this region then found "non translated code" >+ if(!fCodeTranslated) { >+ fFoundNonTranslatedCode = true; >+ } >+ > if (getCurrentNode() != null) > advanceNextNode(); > } > >+ writePlaceHolderForNonTranslatedCode(); >+ > /* > * Any contents left in the map indicate start tags that never had end > * tags. While the '{' that is present without the matching '}' would >@@ -1066,6 +1092,11 @@ > else if (type != null && (type == DOMRegionContext.XML_TAG_OPEN || type == DOMRegionContext.XML_END_TAG_OPEN)) { > translateXMLNode(containerRegion, regions); > } >+ //the end tags of these regions are "translated" in a sense >+ else if(type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE || >+ type == DOMJSPRegionContexts.JSP_CLOSE) { >+ this.fCodeTranslated = true; >+ } > } > // } > } >@@ -2112,6 +2143,12 @@ > // add a newline so translation looks cleaner > if (!nonl && !newText.endsWith(ENDL)) > newText += ENDL; >+ >+ //dump any non translated code before writing translated code >+ writePlaceHolderForNonTranslatedCode(); >+ >+ //if appending to the buffer can assume something got translated >+ fCodeTranslated = true; > > if (buffer == fUserCode) { > buffer.append(newText); >@@ -2645,4 +2682,19 @@ > public IStructuredDocument getStructuredDocument() { > return fStructuredDocument; > } >+ >+ /** >+ * <p>Writes an empty expression to {@link #fUserCode} if previously >+ * found non translated code</p> >+ * <p>This should be done before appending any newly translated code.</p> >+ */ >+ private void writePlaceHolderForNonTranslatedCode() { >+ if(fFoundNonTranslatedCode) { >+ String text = (EXPRESSION_PREFIX + "\"\"" + EXPRESSION_SUFFIX + >+ " //non translated code placeholder"+ ENDL); >+ fUserCode.append(text); >+ fOffsetInUserCode += text.length(); >+ fFoundNonTranslatedCode = false; >+ } >+ } > } >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 293503
:
150685
|
150721
| 154716