ASF Bugzilla – Attachment 29822 Details for
Bug 54284
Util.objectNameValueNeedsQuote throws NPE for anonymous Filters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch proposal
patch2.diff (text/plain), 5.16 KB, created by
Violeta Georgieva
on 2013-01-07 11:57:14 UTC
(
hide
)
Description:
patch proposal
Filename:
MIME Type:
Creator:
Violeta Georgieva
Created:
2013-01-07 11:57:14 UTC
Size:
5.16 KB
patch
obsolete
>Index: org/apache/catalina/core/LocalStrings.properties >=================================================================== >--- org/apache/catalina/core/LocalStrings.properties (revision 1429490) >+++ org/apache/catalina/core/LocalStrings.properties (working copy) >@@ -21,6 +21,8 @@ > applicationContext.addRole.ise=Roles can not be added to context {0} as the context has been initialised > applicationContext.addServlet.ise=Servlets can not be added to context {0} as the context has been initialised > applicationContext.attributeEvent=Exception thrown by attributes event listener >+applicationContext.invalidFilterName=Unable to add filter definition due to invalid filter name [{0}]. >+applicationContext.invalidServletName=Unable to add servlet definition due to invalid servlet name [{0}]. > applicationContext.mapping.error=Error during mapping > applicationContext.requestDispatcher.iae=Path {0} does not start with a "/" character > applicationContext.resourcePaths.iae=Path {0} does not start with a "/" character >Index: org/apache/catalina/core/ApplicationContext.java >=================================================================== >--- org/apache/catalina/core/ApplicationContext.java (revision 1429490) >+++ org/apache/catalina/core/ApplicationContext.java (working copy) >@@ -943,7 +943,12 @@ > > private FilterRegistration.Dynamic addFilter(String filterName, > String filterClass, Filter filter) throws IllegalStateException { >- >+ >+ if (filterName == null || filterName.equals("")) { >+ throw new IllegalArgumentException( >+ sm.getString("applicationContext.invalidFilterName", filterName)); >+ } >+ > if (!context.getState().equals(LifecycleState.STARTING_PREP)) { > //TODO Spec breaking enhancement to ignore this restriction > throw new IllegalStateException( >@@ -1083,7 +1088,12 @@ > > private ServletRegistration.Dynamic addServlet(String servletName, > String servletClass, Servlet servlet) throws IllegalStateException { >- >+ >+ if (servletName == null || servletName.equals("")) { >+ throw new IllegalArgumentException( >+ sm.getString("applicationContext.invalidServletName", servletName)); >+ } >+ > if (!context.getState().equals(LifecycleState.STARTING_PREP)) { > //TODO Spec breaking enhancement to ignore this restriction > throw new IllegalStateException( >Index: org/apache/catalina/deploy/ServletDef.java >=================================================================== >--- org/apache/catalina/deploy/ServletDef.java (revision 1429490) >+++ org/apache/catalina/deploy/ServletDef.java (working copy) >@@ -25,6 +25,8 @@ > import java.util.Map; > import java.util.Set; > >+import org.apache.tomcat.util.res.StringManager; >+ > > /** > * Representation of a servlet definition for a web application, as represented >@@ -35,6 +37,9 @@ > > private static final long serialVersionUID = 1L; > >+ private static final StringManager sm = >+ StringManager.getManager(Constants.Package); >+ > // ------------------------------------------------------------- Properties > > >@@ -104,6 +109,10 @@ > } > > public void setServletName(String servletName) { >+ if (servletName == null || servletName.equals("")) { >+ throw new IllegalArgumentException( >+ sm.getString("servletDef.invalidServletName", servletName)); >+ } > this.servletName = servletName; > } > >Index: org/apache/catalina/deploy/LocalStrings.properties >=================================================================== >--- org/apache/catalina/deploy/LocalStrings.properties (revision 1429490) >+++ org/apache/catalina/deploy/LocalStrings.properties (working copy) >@@ -12,6 +12,9 @@ > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > # See the License for the specific language governing permissions and > # limitations under the License. >+filterDef.invalidFilterName=Invalid <filter-name> [{0}] in filter definition. >+ >+servletDef.invalidServletName=Invalid <servlet-name> [{0}] in servlet definition. > > webXml.duplicateEnvEntry=Duplicate env-entry name [{0}] > webXml.duplicateFilter=Duplicate filter name [{0}] >Index: org/apache/catalina/deploy/FilterDef.java >=================================================================== >--- org/apache/catalina/deploy/FilterDef.java (revision 1429490) >+++ org/apache/catalina/deploy/FilterDef.java (working copy) >@@ -25,6 +25,8 @@ > > import javax.servlet.Filter; > >+import org.apache.tomcat.util.res.StringManager; >+ > > /** > * Representation of a filter definition for a web application, as represented >@@ -38,6 +40,9 @@ > > private static final long serialVersionUID = 1L; > >+ private static final StringManager sm = >+ StringManager.getManager(Constants.Package); >+ > // ------------------------------------------------------------- Properties > > >@@ -108,6 +113,10 @@ > } > > public void setFilterName(String filterName) { >+ if (filterName == null || filterName.equals("")) { >+ throw new IllegalArgumentException( >+ sm.getString("filterDef.invalidFilterName", filterName)); >+ } > this.filterName = filterName; > } >
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 54284
:
29817
|
29818
| 29822