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 150721 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 1
293503_JSPTranslator_if_statement.txt (text/plain), 3.52 KB, created by
Ian Tewksbury
on 2009-10-28 09:19:52 EDT
(
hide
)
Description:
Fix Patch Update 1
Filename:
MIME Type:
Creator:
Ian Tewksbury
Created:
2009-10-28 09:19:52 EDT
Size:
3.52 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 28 Oct 2009 13:18:21 -0000 >@@ -244,6 +244,19 @@ > * EL Translator ID > */ > private String fELTranslatorID; >+ >+ /** >+ * <code>true</code> if code has been appended to a buffer for the current region, >+ * <code>false</code> otherwise >+ */ >+ private boolean fCodeAppended; >+ >+ /** >+ * <code>true</code> if code has been found, such as HTML tags, that is not translated >+ * <code>false</code> otherwise. Usefull for deciding if a place holder needs to be >+ * writen to translation >+ */ >+ private boolean fFoundNonTranslatedCode; > > /** > * A structure for holding a region collection marker and list of variable >@@ -488,6 +501,8 @@ > > fELProblems = new ArrayList(); > >+ fCodeAppended = false; >+ fFoundNonTranslatedCode = false; > } > > /** >@@ -916,7 +931,9 @@ > setCurrentNode(fStructuredDocument.getFirstStructuredDocumentRegion()); > > while (getCurrentNode() != null && !isCanceled()) { >- >+ //no code has been append for this region yet >+ fCodeAppended = 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 +944,23 @@ > // iterate through each region in the flat node > translateRegionContainer(getCurrentNode(), STANDARD_JSP); > } >+ >+ /* if no code was appended for this region then we must >+ * have found non translated code >+ */ >+ if(!fCodeAppended) { >+ fFoundNonTranslatedCode = true; >+ } >+ > if (getCurrentNode() != null) > advanceNextNode(); > } > >+ /* if previously found non translated code then write an empty expression >+ * as a place holder to the user code translation >+ */ >+ writePlaceHolderForNonTranslatedCode(); >+ > /* > * Any contents left in the map indicate start tags that never had end > * tags. While the '{' that is present without the matching '}' would >@@ -2113,6 +2143,11 @@ > if (!nonl && !newText.endsWith(ENDL)) > newText += ENDL; > >+ /* if previously found non translated code then write an empty expression >+ * as a place holder to the user code translation >+ */ >+ writePlaceHolderForNonTranslatedCode(); >+ > if (buffer == fUserCode) { > buffer.append(newText); > if (addToMap) { >@@ -2370,6 +2405,21 @@ > } > > /** >+ * Writes an empty expression to {@link #fUserCode} >+ * if previously found non translated code >+ */ >+ private void writePlaceHolderForNonTranslatedCode() { >+ if(fFoundNonTranslatedCode) { >+ String text = (EXPRESSION_PREFIX + "\"\"" + EXPRESSION_SUFFIX + >+ " //non translated code placeholder"+ ENDL); >+ fUserCode.append(text); >+ fOffsetInUserCode += text.length(); >+ >+ fFoundNonTranslatedCode = false; >+ } >+ } >+ >+ /** > * Set the buffer to the current JSPType: STANDARD_JSP, EMBEDDED_JSP, > * DECLARATION, EXPRESSION, SCRIPTLET (for keepting track of cursor > * position when the final document is built)
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