ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/unittest/TesterLeakingServlet2.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/unittest/TesterLeakingServlet2.java
Status
scanned
Type
file
Name
TesterLeakingServlet2.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2222 (2.2 KB)
MD5
6a33d3d14578b9fff342886b67a16303
SHA1
94a1ff53e10a6a2c9bce55df66ba547feef6122e
SHA256
18ce6c4616a17f5e77f8500f3a126f5e36b016e2dec70f7d98fa087d1bf37122
SHA512

      
    
SHA1_git
8993b38dcdf00f2092a6f63be499b83862ac8f6f
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TesterLeakingServlet2.java | 2.2 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * 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. */ package org.apache.tomcat.unittest; import java.io.IOException; import java.util.Arrays; import java.util.List; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; public class TesterLeakingServlet2 extends HttpServlet { private static final long serialVersionUID = 1L; private static final Log log = LogFactory.getLog(TesterLeakingServlet2.class); @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<TesterCounter> counterList = TesterThreadScopedHolder.getFromHolder(); TesterCounter counter; if (counterList == null) { log.info("Adding thread local to thread " + Thread.currentThread().getName()); counter = new TesterCounter(); TesterThreadScopedHolder.saveInHolder(Arrays.asList(counter)); } else { counter = counterList.get(0); } counter.increment(); response.getWriter().println( "The current thread served this servlet " + counter.getCount() + " times"); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
48.97
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9