This commit is contained in:
2024-11-30 19:03:49 +08:00
commit 1e6763c160
3806 changed files with 737676 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<!-- When adding checks, keep to the order checks are listed under -->
<!-- 'Standard Checks' in the Checkstyle documentation: -->
<!-- http://checkstyle.sourceforge.net/config_coding.html -->
<!-- Cache what has passed checkstyle -->
<property name="cacheFile"
value="${tomcat.output}/res/checkstyle/cachefile-checkstyle.xml"/>
<!-- Headers -->
<module name="RegexpHeader">
<property name="headerFile" value="${basedir}/res/checkstyle/header-al2.txt"/>
<property name="multiLines" value="1, 2, 3, 4"/>
<property name="fileExtensions" value="java,xml,jsp,txt,sh,bat,properties"/>
</module>
<!-- Whitespace -->
<module name="FileTabCharacter"/>
<module name="RegexpSingleline">
<!-- No trailing whitespace -->
<property name="format" value="\s+$"/>
</module>
<module name="TreeWalker">
<!-- Annotations -->
<module name="AnnotationLocation"/>
<module name="AnnotationUseStyle"/>
<module name="MissingOverride"/>
<module name="PackageAnnotation"/>
<!-- Block Checks -->
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true"/>
</module>
<!-- Coding -->
<module name="IllegalInstantiation"/>
<!-- Imports -->
<module name="AvoidStarImport"/>
<module name="AvoidStaticImport">
<property name="excludes"
value="org.apache.catalina.startup.SimpleHttpClient.CRLF"/>
</module>
<module name="IllegalImport">
<property name="illegalPkgs" value="sun,junit.framework"/>
</module>
<module name="ImportOrder">
<property name="groups" value="java,javax,org.hamcrest,org.junit,org,async,jsp2,util"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="above"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Modifiers -->
<module name="ModifierOrder"/>
<!-- ~1750 errors
<module name="RedundantModifier"/>
-->
<!-- Whitespace -->
<module name="GenericWhitespace"/>
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<!-- ~ 1200 errors
<module name="OperatorWrap">
<property name="option" value="eol"/>
</module>
-->
</module>
</module>

View File

@@ -0,0 +1,19 @@
^<\?xml.*>$
^@echo off$
^#!
^\W*$
^(rem)?\W*Licensed to the Apache Software Foundation \(ASF\) under one or more$
^(rem)?\W*contributor license agreements\. See the NOTICE file distributed with$
^(rem)?\W*this work for additional information regarding copyright ownership\.$
^(rem)?\W*The ASF licenses this file to You under the Apache License, Version 2\.0$
^(rem)?\W*\(the "License"\); you may not use this file except in compliance with$
^(rem)?\W*the License\. You may obtain a copy of the License at$
^(rem)?\W*$
^(rem)?\W*http://www.apache.org/licenses/LICENSE-2\.0$
^(rem)?\W*$
^(rem)?\W*Unless required by applicable law or agreed to in writing, software$
^(rem)?\W*distributed under the License is distributed on an "AS IS" BASIS,$
^(rem)?\W*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$
^(rem)?\W*See the License for the specific language governing permissions and$
^(rem)?\W*limitations under the License\.$
^(rem)?\W*$

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<!-- When adding checks, keep to the order checks are listed under -->
<!-- 'Standard Checks' in the Checkstyle documentation: -->
<!-- http://checkstyle.sourceforge.net/config_coding.html -->
<!-- Cache what has passed checkstyle -->
<property name="cacheFile"
value="${tomcat.output}/res/checkstyle/cachefile-javax-checkstyle.xml"/>
<!-- Specific checks for javax.* packages -->
<module name="TreeWalker">
<module name="ImportControl">
<property name="file" value="${basedir}/res/checkstyle/javax-import-control.xml"/>
</module>
</module>
</module>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!DOCTYPE import-control PUBLIC
"-//Puppy Crawl//DTD Import Control 1.1//EN"
"http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
<import-control pkg="javax">
<allow pkg="java"/>
<subpackage name="annotation">
<allow pkg="javax.annotation"/>
</subpackage>
<subpackage name="ejb">
<allow pkg="javax.ejb"/>
</subpackage>
<subpackage name="el">
<allow pkg="javax.el"/>
</subpackage>
<subpackage name="mail">
<allow pkg="javax.mail"/>
</subpackage>
<subpackage name="persistence">
<allow pkg="javax.persistence"/>
</subpackage>
<subpackage name="security">
<subpackage name="auth">
<subpackage name="message">
<allow pkg="javax.crypto" />
<allow class="javax.security.auth.Subject"/>
<allow pkg="javax.security.auth.callback"/>
<allow pkg="javax.security.auth.login"/>
<allow pkg="javax.security.auth.x500"/>
<disallow pkg="javax.security.auth.message.callback" local-only="true"/>
<disallow pkg="javax.security.auth.message.config" local-only="true"/>
<disallow pkg="javax.security.auth.message.module" local-only="true"/>
<subpackage name="config">
<allow class="javax.security.auth.AuthPermission"/>
<allow pkg="javax.security.auth.message"/>
</subpackage>
<subpackage name="module">
<allow pkg="javax.security.auth.message"/>
</subpackage>
</subpackage>
</subpackage>
</subpackage>
<subpackage name="servlet">
<allow pkg="javax.servlet"/>
<disallow pkg="javax.servlet.jsp" local-only="true"/>
<subpackage name="jsp">
<allow pkg="javax.el"/>
<allow pkg="javax.servlet.jsp"/>
</subpackage>
</subpackage>
<subpackage name="websocket">
<allow pkg="javax.websocket"/>
</subpackage>
<subpackage name="xml.ws">
<allow pkg="javax.xwl.ws"/>
</subpackage>
</import-control>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<!-- When adding checks, keep to the order checks are listed under -->
<!-- 'Standard Checks' in the Checkstyle documentation: -->
<!-- http://checkstyle.sourceforge.net/config_coding.html -->
<!-- Cache what has passed checkstyle -->
<property name="cacheFile"
value="${tomcat.output}/res/checkstyle/cachefile-org-checkstyle.xml"/>
<!-- Specific checks for org.* packages -->
<module name="TreeWalker">
<module name="ImportControl">
<property name="file" value="${basedir}/res/checkstyle/org-import-control.xml"/>
</module>
</module>
</module>

View File

@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!DOCTYPE import-control PUBLIC
"-//Puppy Crawl//DTD Import Control 1.1//EN"
"http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
<import-control pkg="org.apache">
<!-- Anything in J2SE is OK but need to list javax by package as not
all javax packages are in J2SE -->
<allow pkg="java"/>
<allow pkg="javax.crypto"/>
<allow class="javax.imageio.ImageIO"/>
<allow pkg="javax.management"/>
<allow pkg="javax.naming"/>
<allow pkg="javax.net"/>
<allow pkg="javax.rmi"/>
<allow pkg="javax.security"/>
<allow pkg="javax.sql"/>
<allow pkg="javax.xml"/>
<allow pkg="org.w3c.dom"/>
<allow pkg="org.xml.sax"/>
<allow pkg="org.ietf.jgss"/>
<subpackage name="catalina">
<allow pkg="javax.annotation"/>
<allow pkg="javax.ejb"/>
<allow pkg="javax.persistence"/>
<allow pkg="javax.servlet"/>
<allow pkg="org.apache.catalina"/>
<disallow pkg="org.apache.catalina.ha"/>
<disallow pkg="org.apache.catalina.tribes"/>
<allow pkg="org.apache.coyote"/>
<allow pkg="org.apache.juli"/>
<allow pkg="org.apache.naming"/>
<allow pkg="org.apache.tomcat"/>
<subpackage name="ant">
<allow pkg="org.apache.tools.ant"/>
<allow class="org.apache.tomcat.util.Base64"/>
<disallow pkg="javax.annotation"/>
<disallow pkg="javax.ejb"/>
<disallow pkg="javax.persistence"/>
<disallow pkg="javax.servlet"/>
<disallow pkg="org.apache.coyote"/>
<disallow pkg="org.apache.juli"/>
<disallow pkg="org.apache.naming"/>
</subpackage>
<subpackage name="ha">
<disallow pkg="javax.annotation"/>
<disallow pkg="javax.ejb"/>
<disallow pkg="javax.persistence"/>
<disallow pkg="org.apache.coyote"/>
<disallow pkg="org.apache.naming"/>
<allow pkg="org.apache.catalina.ha"/>
<allow pkg="org.apache.catalina.tribes"/>
</subpackage>
<subpackage name="storeconfig">
<allow pkg="org.apache.catalina.ha"/>
<allow pkg="org.apache.catalina.tribes"/>
</subpackage>
<subpackage name="tribes">
<disallow pkg="javax.annotation"/>
<disallow pkg="javax.ejb"/>
<disallow pkg="javax.persistence"/>
<disallow pkg="javax.servlet"/>
<disallow pkg="org\.apache\.catalina(?!\.tribes).*" regex="true"/>
<disallow pkg="org.apache.coyote"/>
<disallow pkg="org.apache.naming"/>
<disallow pkg="org.apache.tomcat"/>
<allow pkg="org.apache.catalina.tribes"/>
</subpackage>
</subpackage>
<subpackage name="coyote">
<allow pkg="javax.servlet"/>
<allow pkg="org.apache.coyote"/>
<allow pkg="org.apache.juli"/>
<allow pkg="org.apache.tomcat"/>
<allow pkg="org.apache.tomcat.jni"/>
<allow pkg="org.apache.tomcat.util"/>
</subpackage>
<subpackage name="el">
<allow pkg="javax.el"/>
<allow pkg="org.apache.el"/>
</subpackage>
<subpackage name="jasper">
<allow pkg="javax.el"/>
<allow pkg="javax.servlet"/>
<allow pkg="org.apache.el"/>
<allow pkg="org.apache.jasper"/>
<allow pkg="org.apache.juli"/>
<allow pkg="org.apache.tomcat" exact-match="true"/>
<allow pkg="org.apache.tomcat.util.descriptor"/>
<allow pkg="org.apache.tomcat.util.scan"/>
<allow pkg="org.apache.tomcat.util.security"/>
<allow pkg="org.apache.tools.ant"/>
<allow pkg="org.eclipse.jdt"/>
</subpackage>
<subpackage name="juli">
<allow pkg="org.apache.juli"/>
</subpackage>
<subpackage name="naming">
<allow pkg="javax.mail"/>
<allow pkg="javax.wsdl"/>
<allow pkg="org.apache.juli"/>
<allow pkg="org.apache.naming"/>
<allow class="org.apache.tomcat.util.buf.UDecoder"/>
<allow class="org.apache.tomcat.util.buf.UEncoder"/>
<allow class="org.apache.tomcat.util.http.FastHttpDateFormat"/>
<allow class="org.apache.tomcat.util.http.RequestUtil"/>
<subpackage name="factory.webservices">
</subpackage>
</subpackage>
<subpackage name="tomcat">
<allow pkg="javax.servlet"/>
<subpackage name="buildutil">
<allow pkg="org.apache.tools.ant"/>
<allow pkg="org.apache.tomcat.util"/>
</subpackage>
<subpackage name="dbcp">
<allow pkg="org.apache.juli"/>
<subpackage name="dbcp2">
<allow pkg="org.apache.tomcat.dbcp.dbcp2"/>
<allow pkg="org.apache.tomcat.dbcp.pool2"/>
</subpackage>
<subpackage name="pool2">
<subpackage name="impl">
<allow pkg="org.apache.tomcat.dbcp.pool2"/>
</subpackage>
</subpackage>
</subpackage>
<subpackage name="jni">
<subpackage name="socket">
<allow pkg="org.apache.tomcat.jni"/>
</subpackage>
</subpackage>
<subpackage name="util">
<allow pkg="org.apache.juli"/>
<allow pkg="org.apache.tomcat.jni"/>
<allow pkg="org.apache.tomcat.util"/>
<disallow pkg="org.apache.tomcat.util.scan"/>
<subpackage name="descriptor">
<allow pkg="org.apache.tomcat.util.scan"/>
<allow pkg="org.apache.tomcat" exact-match="true"/>
</subpackage>
<subpackage name="scan">
<allow pkg="org.apache.tomcat" exact-match="true"/>
</subpackage>
</subpackage>
<subpackage name="websocket">
<allow pkg="javax.websocket"/>
<allow pkg="org.apache.juli"/>
<allow pkg="org.apache.tomcat"/>
<allow pkg="org.apache.tomcat.util"/>
<!-- Ideally want to remove this -->
<allow pkg="org.apache.tomcat.websocket.pojo"/>
<disallow pkg="javax.servlet"/>
<subpackage name="pojo">
<allow pkg="org.apache.tomcat.websocket"/>
</subpackage>
<subpackage name="server">
<allow pkg="javax.servlet"/>
<allow pkg="org.apache.coyote.http11.upgrade"/>
<allow pkg="org.apache.tomcat.websocket"/>
</subpackage>
</subpackage>
</subpackage>
</import-control>