Skip to content

Commit

Permalink
Merge branch 'apache:main' into main_BZ69355
Browse files Browse the repository at this point in the history
  • Loading branch information
Chenjp authored Nov 7, 2024
2 parents 258e131 + c8b7758 commit a7e0bd3
Show file tree
Hide file tree
Showing 17 changed files with 410 additions and 18 deletions.
8 changes: 4 additions & 4 deletions build.properties.default
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ objenesis.jar=${objenesis.home}/objenesis-${objenesis.version}.jar
objenesis.loc=${base-maven.loc}/org/objenesis/objenesis/${objenesis.version}/objenesis-${objenesis.version}.jar

# ----- byte-buddy, used by EasyMock, version 1.12.18 or later -----
bytebuddy.version=1.15.4
bytebuddy.version=1.15.10
bytebuddy.checksum.enabled=true
bytebuddy.checksum.algorithm=MD5|SHA-1
bytebuddy.checksum.value=eee284717781f391c48e7c87644480a4|e8bd42992701720649765383ff570f415190b83f
bytebuddy.checksum.value=0b029979f5bf509510f91c1a49fd4adb|635c873fadd853c084f84fdc3cbd58c5dd8537f9
bytebuddy.home=${base.path}/byte-buddy-${bytebuddy.version}
bytebuddy.jar=${bytebuddy.home}/byte-buddy-${bytebuddy.version}.jar
bytebuddy.loc=${base-maven.loc}/net/bytebuddy/byte-buddy/${bytebuddy.version}/byte-buddy-${bytebuddy.version}.jar
Expand All @@ -262,10 +262,10 @@ unboundid.jar=${unboundid.home}/unboundid-ldapsdk-${unboundid.version}.jar
unboundid.loc=${base-maven.loc}/com/unboundid/unboundid-ldapsdk/${unboundid.version}/unboundid-ldapsdk-${unboundid.version}.jar

# ----- Checkstyle, version 6.16 or later -----
checkstyle.version=10.18.2
checkstyle.version=10.20.0
checkstyle.checksum.enabled=true
checkstyle.checksum.algorithm=SHA-512
checkstyle.checksum.value=9c2be68e423fbbc301272c4a96824f84b8ccae23103e9653af3cea8546bc87695f17491a95daf66c19bfb1597cc3113e2656a5eb8256b0f5468d3cef56cc0e66
checkstyle.checksum.value=4c2d4ca9ae531e01c56bb570cfc4b080c577bc7d87c8004f253ba68dbc4c5dd825a43b77cdc3331b8d6fb328a09147e0bbef705657d11c21a6e09b69e299c84e
checkstyle.home=${base.path}/checkstyle-${checkstyle.version}
checkstyle.jar=${checkstyle.home}/checkstyle-${checkstyle.version}-all.jar
checkstyle.loc=${base-gh.loc}/checkstyle/checkstyle/releases/download/checkstyle-${checkstyle.version}/checkstyle-${checkstyle.version}-all.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jaspicAuthenticator.authenticate=Authentification de la requête pour [{0}] avec

persistentProviderRegistrations.deleteFail=Le fichier temporaire [{0}] n''a pas pu être effacé
persistentProviderRegistrations.existsDeleteFail=Le fichier temporaire [{0}] existe déjà et ne peut être effacé
persistentProviderRegistrations.mkdirsFail=Le répertoire [{0}] des enregistrements de fournisseur de persistence ne peut pas être crée
persistentProviderRegistrations.moveFail=Echec de déplacement de [{0}] vers [{1}]
persistentProviderRegistrations.xmlFeatureEncoding=Exception lors de la configuration de JASPIC pour permettre des nom d'encodage Java dans les fichiers de configuration XML, seuls les noms d'encodage IANA seront supportés

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jaspicAuthenticator.authenticate=JASPIC経由で [{0}] へのリクエストを

persistentProviderRegistrations.deleteFail=一時ファイル [{0}] を削除できません。
persistentProviderRegistrations.existsDeleteFail=同名の一時ファイル [{0}] が存在し、削除もできません
persistentProviderRegistrations.mkdirsFail=永続プロバイダー登録用のディレクトリ [{0}] を作成できません
persistentProviderRegistrations.moveFail=[{0}]を[{1}]に移動できませんでした。
persistentProviderRegistrations.xmlFeatureEncoding=XML構成ファイルでJavaエンコーディング名を許可するようにJASPICを構成する際に例外が発生しました。 IANAエンコーディング名のみがサポートされます。

Expand Down
38 changes: 31 additions & 7 deletions java/org/apache/catalina/connector/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -1052,12 +1052,32 @@ public void sendEarlyHints() {
}


/**
* {@inheritDoc}
* <p>
* <i>Deprecated functionality</i>: calling <code>sendError</code> with a status code of 103 differs from the usual
* behavior. Sending 103 will trigger the container to send a "103 Early Hints" informational response including all
* current headers. The application can continue to use the request and response after calling sendError with a 103
* status code, including triggering a more typical response of any type.
* <p>
* Starting with Tomcat 12, applications should use {@link #sendEarlyHints}.
*/
@Override
public void sendError(int status) throws IOException {
sendError(status, null);
}


/**
* {@inheritDoc}
* <p>
* <i>Deprecated functionality</i>: calling <code>sendError</code> with a status code of 103 differs from the usual
* behavior. Sending 103 will trigger the container to send a "103 Early Hints" informational response including all
* current headers. The application can continue to use the request and response after calling sendError with a 103
* status code, including triggering a more typical response of any type.
* <p>
* Starting with Tomcat 12, applications should use {@link #sendEarlyHints}.
*/
@Override
public void sendError(int status, String message) throws IOException {

Expand All @@ -1070,16 +1090,20 @@ public void sendError(int status, String message) throws IOException {
return;
}

setError();
if (HttpServletResponse.SC_EARLY_HINTS == status) {
sendEarlyHints();
} else {
setError();

getCoyoteResponse().setStatus(status);
getCoyoteResponse().setMessage(message);
getCoyoteResponse().setStatus(status);
getCoyoteResponse().setMessage(message);

// Clear any data content that has been buffered
resetBuffer();
// Clear any data content that has been buffered
resetBuffer();

// Cause the response to be finished (from the application perspective)
setSuspended(true);
// Cause the response to be finished (from the application perspective)
setSuspended(true);
}
}


Expand Down
36 changes: 32 additions & 4 deletions java/org/apache/catalina/connector/ResponseFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,19 +250,47 @@ public void sendEarlyHints() {
response.sendEarlyHints();
}

/**
* {@inheritDoc}
* <p>
* <i>Deprecated functionality</i>: calling <code>sendError</code> with a status code of 103 differs from the usual
* behavior. Sending 103 will trigger the container to send a "103 Early Hints" informational response including all
* current headers. The application can continue to use the request and response after calling sendError with a 103
* status code, including triggering a more typical response of any type.
* <p>
* Starting with Tomcat 12, applications should use {@link #sendEarlyHints}.
*/
@Override
public void sendError(int sc, String msg) throws IOException {
checkCommitted("coyoteResponse.sendError.ise");
response.setAppCommitted(true);
response.sendError(sc, msg);
if (HttpServletResponse.SC_EARLY_HINTS == sc) {
sendEarlyHints();
} else {
response.setAppCommitted(true);
response.sendError(sc, msg);
}
}


/**
* {@inheritDoc}
* <p>
* <i>Deprecated functionality</i>: calling <code>sendError</code> with a status code of 103 differs from the usual
* behavior. Sending 103 will trigger the container to send a "103 Early Hints" informational response including all
* current headers. The application can continue to use the request and response after calling sendError with a 103
* status code, including triggering a more typical response of any type.
* <p>
* Starting with Tomcat 12, applications should use {@link #sendEarlyHints}.
*/
@Override
public void sendError(int sc) throws IOException {
checkCommitted("coyoteResponse.sendError.ise");
response.setAppCommitted(true);
response.sendError(sc);
if (HttpServletResponse.SC_EARLY_HINTS == sc) {
sendEarlyHints();
} else {
response.setAppCommitted(true);
response.sendError(sc);
}
}


Expand Down
4 changes: 4 additions & 0 deletions java/org/apache/catalina/loader/WebappClassLoaderBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import org.apache.tomcat.InstrumentableClassLoader;
import org.apache.tomcat.util.ExceptionUtils;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.buf.ToStringUtil;
import org.apache.tomcat.util.collections.ConcurrentLruCache;
import org.apache.tomcat.util.compat.JreCompat;
import org.apache.tomcat.util.res.StringManager;
Expand Down Expand Up @@ -1160,6 +1161,9 @@ public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundExce
}
}

if (log.isDebugEnabled()) {
log.debug(ToStringUtil.classPathForCNFE(this));
}
throw new ClassNotFoundException(name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ defaultServlet.skipfail=读取失败,因为只有[{0}]个字节可用,但需
defaultServlet.unknownBomConfig=为useBomIfPresent初始化参数提供的[{0}]值无法识别
defaultServlet.xslError=XSL转换器错误


webdavservlet.externalEntityIgnored=请求包含对PublicID[{0}]和SystemID[{1}]的外部实体的引用,该引用被忽略。
webdavservlet.inputstreamclosefail=无法关闭[{0}]的输入流
webdavservlet.jaxpfailed=JAXP 初始化失败
5 changes: 5 additions & 0 deletions java/org/apache/coyote/http2/LocalStrings_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ http2Protocol.jmxRegistration.fail=L'enregistrement dans JMX du protocole HTTP/2

pingManager.roundTripTime=Connection [{0}] Le temps d''aller retour est de [{1}]ns

stream.clientResetRequest=Le client a réinitialisé la stream avant qu'elle ait été complètement lue
stream.closed=Connection [{0}], Flux [{1}], Impossible d''écrire sur un flux après sa fermeture
stream.header.case=Connection [{0}], Flux [{1}], Le nom d''en-tête HTTP [{2}] doit être en miniscules
stream.header.connection=Connection [{0}], Flux [{1}], L''en-tête HTTP [{2}] n''est pas autorisé dans une requête HTTP/2
Expand All @@ -111,6 +112,8 @@ stream.inputBuffer.signal=Des données ont été ajoutées dans inBuffer alors q
stream.inputBuffer.swallowUnread=[{0}] bytes qui ont été auparavant lu dans le tampon d''entrée ont été avalés
stream.notWritable=Connection [{0}], Flux [{1}], Impossible d''écrire sur ce flux
stream.outputBuffer.flush.debug=Connection [{0}], Flux [{1}], envoi des données mises en tampon depuis la position [{2}], writeInProgress [{3}] et closed [{4}]
stream.recycle.duplicate=Connection [{0}], Stream [{1}] Une tentative de double recyclage de la requête et de la réponse associées a été ignorée
stream.recycle.first=Connection [{0}], Stream [{1}] La requête et la réponse associées ont été recyclées
stream.reset.fail=Connection [{0}], Flux [{1}], Echec de réinitialisation du flux
stream.reset.receive=Connection [{0}], Flux [{1}], Réinitialisation reçue à cause de [{2}]
stream.reset.send=Connection [{0}], Flux [{1}], Réinitialisation envoyée à cause de [{2}]
Expand Down Expand Up @@ -149,6 +152,8 @@ upgradeHandler.pruneIncomplete=Connexion [{0}], Flux [{1}], Erreur lors de l''é
upgradeHandler.pruneStart=Connection [{0}] Début de l''élimination des anciens flux, la limite est de [{1}] et il y a actuellement [{2}] flux
upgradeHandler.pruned=Connection [{0}] Elimination du flux terminé [{1}]
upgradeHandler.releaseBacklog=Connection [{0}], Flux [{1}] enlevée de la file d''attente
upgradeHandler.replace.duplicate=Connection [{0}], Stream [{1}] Une tentative de double remplacement de la stream par son implémentation légère a été ignorée
upgradeHandler.replace.first=Connection [{0}], Stream [{1}] Remplacement par l''implémentation légère de stream
upgradeHandler.reset.receive=Connection [{0}], Stream [{1}], Reset a été reçu à cause de [{2}]
upgradeHandler.rst.debug=Connexion [{0}], Flux [{1}], Erreur [{2}], Message [{3}], RST (fermeture du flux)
upgradeHandler.sendPrefaceFail=Connexion [{0}], échec d''envoi de la préface au client
Expand Down
5 changes: 5 additions & 0 deletions java/org/apache/coyote/http2/LocalStrings_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ http2Protocol.jmxRegistration.fail=HTTP/2プロトコルのJMX登録に失敗し

pingManager.roundTripTime=コネクション [{0}] の往復時間は [{1}] ns でした。

stream.clientResetRequest=リクエストが完全に読み取られる前にクライアントがストリームをリセットしました
stream.closed=コネクション [{0}]、ストリーム [{1}]、切断したストリームには書き込みできません
stream.header.case=コネクション [{0}]、ストリーム [{1}]、HTTP ヘッダー名 [{2}] は小文字でなければなりません。
stream.header.connection=コネクション [{0}]、ストリーム [{1}]、HTTP/2 のリクエストには HTTP ヘッダー [{2}] を指定することはできません。
Expand All @@ -111,6 +112,8 @@ stream.inputBuffer.signal=読み込みスレッドが待機している間に in
stream.inputBuffer.swallowUnread=以前に入力ストリームバッファに読み込まれた [{0}] バイトを飲み込ます
stream.notWritable=コネクション [{0}]、ストリーム [{1}]、このストリームには書き込みできません。
stream.outputBuffer.flush.debug=コネクション [{0}]、ストリーム [{1}]、バッファポジション [{2}]で出力をフラッシュ、writeInProgress [{3}]、クローズ [{4}]
stream.recycle.duplicate=Connection [{0}]、Stream [{1}] 関連するリクエストとレスポンスをリサイクルするための重複したリクエストは無視されました
stream.recycle.first=Connection [{0}]、Stream [{1}] 関連するリクエストとレスポンスがリサイクルされました
stream.reset.fail=コネクション [{0}]、ストリーム [{1}]、ストリームをリセットできません。
stream.reset.receive=コネクション [{0}]、ストリーム [{1}]、[{2}] のために受信されたリセット
stream.reset.send=コネクション [{0}]、ストリーム [{1}]、[{2}] が原因で RESET を送信しました。
Expand Down Expand Up @@ -149,6 +152,8 @@ upgradeHandler.pruneIncomplete=コネクション [{0}]、ストリーム [{1}]
upgradeHandler.pruneStart=コネクション [{0}] 古いストリームのプルーニングを開始します。 上限は [{1}] で、現在 [{2}] ストリームがあります。
upgradeHandler.pruned=コネクション [{0}]、完了したストリーム [{1}] は削除します。
upgradeHandler.releaseBacklog=コネクション [{0}]、ストリーム [{1}] はバックログから解放されました
upgradeHandler.replace.duplicate=Connection [{0}]、Stream [{1}] のストリームを軽量実装に置き換える重複した試みは無視されました
upgradeHandler.replace.first=Connection [{0}]、Stream [{1}] が軽量ストリーム実装に置き換えられました
upgradeHandler.reset.receive=Connection[{0}]、Stream[{1}]、[{2}]のためにリセットを受信しました
upgradeHandler.rst.debug=コネクション [{0}]、ストリーム [{1}]、エラー [{2}]、メッセージ [{3}]、RST (ストリームを切断します)
upgradeHandler.sendPrefaceFail=コネクション [{0}]、クライアントにプリフェイスを送信できませんでした。
Expand Down
5 changes: 5 additions & 0 deletions java/org/apache/tomcat/util/buf/LocalStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ hexUtils.fromHex.oddDigits=The input must consist of an even number of hex digit
stringCache.byteTime=ByteCache generation time: {0}ms
stringCache.charTime=CharCache generation time: {0}ms

toStringUtil.classpath.classloader=ClassLoader [{0}] loading classes from:
toStringUtil.classpath.header=Logging class path for each class loader in hierarchy to aid debugging of ClassNotFoundException
toStringUtil.classpath.platform=JRE provided classes
toStringUtil.classpath.unknown=Unknown - not an instance of URLClassLoader

uDecoder.eof=End of file (EOF)
uDecoder.isHexDigit=The hexadecimal encoding is invalid
uDecoder.noSlash=The encoded slash character is not allowed
Expand Down
101 changes: 101 additions & 0 deletions java/org/apache/tomcat/util/buf/ToStringUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* 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.util.buf;

import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;

import org.apache.tomcat.util.res.StringManager;

/**
* Utility class used to provide String representations of objects. It is typically used in debug logging.
*/
public class ToStringUtil {

private static final StringManager sm = StringManager.getManager(ToStringUtil.class);

private static final String INDENT = " ";


private ToStringUtil() {
// Utility class. Hide default constructor.
}


/**
* Generate a String representation of the class path for the given class loader and any parent class loaders to aid
* debugging of {@link ClassNotFoundException}.
*
* @param classLoader The class loader to analyse
*
* @return A String representation of the class path. The format is undefined and may change in future point
* releases. The output includes new lines.
*/
public static String classPathForCNFE(ClassLoader classLoader) {
// The result is expected to be fairly large
StringBuilder result = new StringBuilder(4096);
result.append(sm.getString("toStringUtil.classpath.header"));
result.append("\n");
while (classLoader != null) {
classPathForCNFE(classLoader, result);
classLoader = classLoader.getParent();
}
return result.toString();
}


private static void classPathForCNFE(ClassLoader classLoader, StringBuilder result) {
result.append(INDENT);
result.append(sm.getString("toStringUtil.classpath.classloader", classLoader));
result.append("\n");
if (classLoader instanceof URLClassLoader) {
URL[] urls = ((URLClassLoader) classLoader).getURLs();
for (URL url : urls) {
result.append(INDENT);
result.append(INDENT);
result.append(url);
result.append("\n");
}
} else if (classLoader == ClassLoader.getSystemClassLoader()) {
// From Java 9 the internal class loaders no longer extend
// URLCLassLoader
String cp = System.getProperty("java.class.path");
if (cp != null && cp.length() > 0) {
String[] paths = cp.split(File.pathSeparator);
for (String path : paths) {
result.append(INDENT);
result.append(INDENT);
result.append(path);
result.append("\n");
}
}
} else if (classLoader == ClassLoader.getPlatformClassLoader()) {
// From Java 9 the internal class loaders no longer extend
// URLCLassLoader
result.append(INDENT);
result.append(INDENT);
result.append(sm.getString("toStringUtil.classpath.platform"));
result.append("\n");
} else {
result.append(INDENT);
result.append(INDENT);
result.append(sm.getString("toStringUtil.classpath.unknown"));
result.append("\n");
}
}
}
Loading

0 comments on commit a7e0bd3

Please sign in to comment.