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 29122 Details for
Bug 114668
[servlets] ServletTemplate in .JETEmitters generates 100 compile warnings
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.
Nathan's proposal to fix warnings in ServletTemplate
ServletTemplate-FIXED.java (text/plain), 9.77 KB, created by
Nathan Vick
on 2005-11-01 17:33:53 EST
(
hide
)
Description:
Nathan's proposal to fix warnings in ServletTemplate
Filename:
MIME Type:
Creator:
Nathan Vick
Created:
2005-11-01 17:33:53 EST
Size:
9.77 KB
patch
obsolete
>package org.eclipse.jst.j2ee.web; > >import org.eclipse.jst.j2ee.internal.web.operations.*; >import java.util.*; > >/** > * Added JavaDoc comment to eleminate warning. > */ >public class ServletTemplate { > /** > * Added JavaDoc comment to eleminate warning. > */ > protected static String nl; > > /** > * Added JavaDoc comment to eleminate warning. > * > * @param lineSeparator > * @return whatever > */ > public static synchronized ServletTemplate create(String lineSeparator) { > nl = lineSeparator; > ServletTemplate result = new ServletTemplate(); > nl = null; > return result; > } > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_1 = "package "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_2 = ";"; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_3 = this.NL + this.NL + "import java.io.IOException;" + this.NL > + "import javax.servlet.ServletException;" + this.NL + "import javax.servlet.http.HttpServletRequest;" + this.NL > + "import javax.servlet.http.HttpServletResponse;" + this.NL + "" + this.NL + "/**" + this.NL > + " * Servlet implementation class for Servlet: "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_4 = this.NL + " *" + this.NL + " */" + this.NL + " "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_5 = "public"; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_6 = " "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_7 = "abstract "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_8 = "final "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_9 = "class "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_10 = " extends "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_11 = " implements "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_12 = ", "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_13 = " {" + this.NL + " /* (non-Java-doc)" + this.NL > + "\t * @see javax.servlet.http.HttpServlet#HttpServlet()" + this.NL + "\t */" + this.NL + "\tpublic "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_14 = "() {" + this.NL + "\t\tsuper();" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_15 = this.NL + "\t" + this.NL + "\t/* (non-Javadoc)" + this.NL > + "\t * @see javax.servlet.Servlet#destroy()" + this.NL + "\t */" + this.NL + "\tpublic void destroy() {" + this.NL > + "\t\t// TODO Auto-generated method stub" + this.NL + "\t\tsuper.destroy();" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_16 = " "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_17 = this.NL > + "\t" > + this.NL > + "\t/* (non-Javadoc)" > + this.NL > + "\t * @see javax.servlet.http.HttpServlet#doDelete(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)" > + this.NL > + "\t */" > + this.NL > + "\tprotected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" > + this.NL + "\t\t// TODO Auto-generated method stub" + this.NL + "\t\tsuper.doDelete(arg0, arg1);" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_18 = " \t"; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_19 = this.NL > + "\t" > + this.NL > + "\t/* (non-Java-doc)" > + this.NL > + "\t * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)" > + this.NL > + "\t */" > + this.NL > + "\tprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" > + this.NL + "\t\t// TODO Auto-generated method stub" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_20 = " \t"; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_21 = this.NL > + "\t" > + this.NL > + "\t/* (non-Java-doc)" > + this.NL > + "\t * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)" > + this.NL > + "\t */" > + this.NL > + "\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {" > + this.NL + "\t\t// TODO Auto-generated method stub" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_22 = " \t"; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_23 = this.NL > + "\t" > + this.NL > + "\t/* (non-Javadoc)" > + this.NL > + "\t * @see javax.servlet.http.HttpServlet#doPut(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)" > + this.NL > + "\t */" > + this.NL > + "\tprotected void doPut(HttpServletRequest request, HttpServletResponse arg1) throws ServletException, IOException {" > + this.NL + "\t\t// TODO Auto-generated method stub" + this.NL + "\t\tsuper.doPut(request, response);" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_24 = " \t"; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_25 = this.NL + "\t" + this.NL + "\t/* (non-Javadoc)" + this.NL > + "\t * @see javax.servlet.Servlet#getServletInfo()" + this.NL + "\t */" + this.NL > + "\tpublic String getServletInfo() {" + this.NL + "\t\t// TODO Auto-generated method stub" + this.NL > + "\t\treturn super.getServletInfo();" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_26 = " "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_27 = this.NL + "\t" + this.NL + "\t/* (non-Javadoc)" + this.NL > + "\t * @see javax.servlet.GenericServlet#init()" + this.NL + "\t */" + this.NL > + "\tpublic void init() throws ServletException {" + this.NL + "\t\t// TODO Auto-generated method stub" + this.NL > + "\t\tsuper.init();" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_28 = " "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_29 = this.NL + "\t" + this.NL + "\t/* (non-Javadoc)" + this.NL > + "\t * @see java.lang.Object#toString()" + this.NL + "\t */" + this.NL + "\tpublic String toString() {" + this.NL > + "\t\t// TODO Auto-generated method stub" + this.NL + "\t\treturn super.toString();" + this.NL + "\t} "; > > /** > * Added JavaDoc comment to eleminate warning. > */ > protected final String TEXT_30 = this.NL + "}"; > > /** > * Added JavaDoc comment to eleminate warning. > * > * @param argument > * @return whatever > */ > public String generate(Object argument) { > StringBuffer stringBuffer = new StringBuffer(); > CreateServletTemplateModel model = (CreateServletTemplateModel) argument; > if (model.getJavaPackageName() != null && model.getJavaPackageName() != "") { > stringBuffer.append(this.TEXT_1); > stringBuffer.append(model.getJavaPackageName()); > stringBuffer.append(this.TEXT_2); > } > stringBuffer.append(this.TEXT_3); > stringBuffer.append(model.getServletClassName()); > stringBuffer.append(this.TEXT_4); > if (model.isPublic()) { > stringBuffer.append(this.TEXT_5); > } > stringBuffer.append(this.TEXT_6); > if (model.isAbstract()) { > stringBuffer.append(this.TEXT_7); > } > if (model.isFinal()) { > stringBuffer.append(this.TEXT_8); > } > > stringBuffer.append(this.TEXT_9); > stringBuffer.append(model.getServletClassName()); > stringBuffer.append(this.TEXT_10); > stringBuffer.append(model.getSuperclassName()); > > List interfaces = model.getInterfaces(); > if (interfaces.size() > 0) { > stringBuffer.append(this.TEXT_11); > } > for (int i = 0; i < interfaces.size(); i++) { > String INTERFACE = (String) interfaces.get(i); > if (i > 0) { > stringBuffer.append(this.TEXT_12); > } > stringBuffer.append(INTERFACE); > } > stringBuffer.append(this.TEXT_13); > stringBuffer.append(model.getServletClassName()); > stringBuffer.append(this.TEXT_14); > if (model.shouldGenDestroy()) { > stringBuffer.append(this.TEXT_15); > } > stringBuffer.append(this.TEXT_16); > if (model.shouldGenDoDelete()) { > stringBuffer.append(this.TEXT_17); > } > stringBuffer.append(this.TEXT_18); > if (model.shouldGenDoGet()) { > stringBuffer.append(this.TEXT_19); > } > stringBuffer.append(this.TEXT_20); > if (model.shouldGenDoPost()) { > stringBuffer.append(this.TEXT_21); > } > stringBuffer.append(this.TEXT_22); > if (model.shouldGenDoPut()) { > stringBuffer.append(this.TEXT_23); > } > stringBuffer.append(this.TEXT_24); > if (model.shouldGenGetServletInfo()) { > stringBuffer.append(this.TEXT_25); > } > stringBuffer.append(this.TEXT_26); > if (model.shouldGenInit()) { > stringBuffer.append(this.TEXT_27); > } > stringBuffer.append(this.TEXT_28); > if (model.shouldGenToString()) { > stringBuffer.append(this.TEXT_29); > } > stringBuffer.append(this.TEXT_30); > return stringBuffer.toString(); > } >}
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 Raw
Actions:
View
Attachments on
bug 114668
:
29120
|
29121
| 29122