This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit d6b5385d4002cb6d9a91f3ded08a03d654033b6e Author: Mark Thomas <[email protected]> AuthorDate: Mon Jun 10 14:33:06 2019 +0100 Better error messages for SMAP generation --- java/org/apache/jasper/compiler/SmapUtil.java | 6 ++++-- java/org/apache/jasper/resources/LocalStrings.properties | 3 ++- java/org/apache/jasper/resources/LocalStrings_fr.properties | 1 + java/org/apache/jasper/resources/LocalStrings_ja.properties | 2 +- webapps/docs/changelog.xml | 8 ++++++++ 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/java/org/apache/jasper/compiler/SmapUtil.java b/java/org/apache/jasper/compiler/SmapUtil.java index 9b11a9d..1325bea 100644 --- a/java/org/apache/jasper/compiler/SmapUtil.java +++ b/java/org/apache/jasper/compiler/SmapUtil.java @@ -198,10 +198,12 @@ public class SmapUtil { File tmpFile = new File(classFile.getPath() + "tmp"); new SDEInstaller(classFile, smap, tmpFile); if (!classFile.delete()) { - throw new IOException("classFile.delete() failed"); + throw new IOException(Localizer.getMessage("jsp.error.unable.deleteClassFile", + classFile.getAbsolutePath())); } if (!tmpFile.renameTo(classFile)) { - throw new IOException("tmpFile.renameTo(classFile) failed"); + throw new IOException(Localizer.getMessage("jsp.error.unable.renameClassFile", + tmpFile.getAbsolutePath(), classFile.getAbsolutePath())); } } diff --git a/java/org/apache/jasper/resources/LocalStrings.properties b/java/org/apache/jasper/resources/LocalStrings.properties index 8a63f5d..b9132dd 100644 --- a/java/org/apache/jasper/resources/LocalStrings.properties +++ b/java/org/apache/jasper/resources/LocalStrings.properties @@ -213,8 +213,9 @@ jsp.error.tld.unable_to_read=Unable to read TLD [{1}] from JAR file [{0}]: [{2}] jsp.error.tlv.invalid.page=Validation error messages from TagLibraryValidator for [{0}] in [{1}] jsp.error.tlvclass.instantiation=Failed to load or instantiate TagLibraryValidator class: [{0}] jsp.error.unable.compile=Unable to compile class for JSP +jsp.error.unable.deleteClassFile=Unable to delete class file [{0}] jsp.error.unable.load=Unable to load class for JSP -jsp.error.unable.rename=Unable to rename class file from [{0}] to [{1}] +jsp.error.unable.renameClassFile=Unable to rename class file from [{0}] to [{1}] jsp.error.unable.to_find_method=Unable to find setter method for attribute: [{0}] jsp.error.unavailable=JSP has been marked unavailable jsp.error.unbalanced.endtag=The end tag "</{0}" is unbalanced diff --git a/java/org/apache/jasper/resources/LocalStrings_fr.properties b/java/org/apache/jasper/resources/LocalStrings_fr.properties index 16e8819..4bb5a8d 100644 --- a/java/org/apache/jasper/resources/LocalStrings_fr.properties +++ b/java/org/apache/jasper/resources/LocalStrings_fr.properties @@ -211,6 +211,7 @@ jsp.error.tlv.invalid.page=Message d''erreurs de validation provenant du TagLibr jsp.error.tlvclass.instantiation=Impossible de charger ou d''instancier la classe TagLibraryValidator: [{0}] jsp.error.unable.compile=Impossible de compiler la classe pour la JSP jsp.error.unable.load=Impossible de charger la classe pour la JSP +jsp.error.unable.renameClassFile=Impossible de renommer le fichier de la classe jsp.error.unable.to_find_method=Impossible de trouver une méthode de mise à jour pour l''attribut: [{0}] jsp.error.unavailable=La JSP a été marquée comme non disponible jsp.error.unbalanced.endtag=Le tag final "</{0}" n''est pas balancé diff --git a/java/org/apache/jasper/resources/LocalStrings_ja.properties b/java/org/apache/jasper/resources/LocalStrings_ja.properties index 8d78d8c..f71b480 100644 --- a/java/org/apache/jasper/resources/LocalStrings_ja.properties +++ b/java/org/apache/jasper/resources/LocalStrings_ja.properties @@ -214,7 +214,7 @@ jsp.error.tlv.invalid.page=[{0}] に対するTagLibraryValidatorの検証エラ jsp.error.tlvclass.instantiation=TagLibraryValidatorクラスのロード又はインスタンス化に失敗しました: [{0}] jsp.error.unable.compile=JSPのクラスをコンパイルできません jsp.error.unable.load=JSPのクラスをロードできません -jsp.error.unable.rename=クラスファイル {0} を {1} にファイル名を変更できません +jsp.error.unable.renameClassFile=クラスファイルの名前を変更できません jsp.error.unable.to_find_method=属性 [{0}] のsetterメソッドが見つかりません jsp.error.unavailable=JSPは利用不可とマークされています jsp.error.unbalanced.endtag=終了タグ "</{0}" の対応が取れていません diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index b95a3f1..d78736b 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -127,6 +127,14 @@ </scode> </changelog> </subsection> + <subsection name="Jasper"> + <changelog> + <add> + Include file names in error messages if SMAP processor is unable to + delete or rename a class file during SMAP generation. (markt) + </add> + </changelog> + </subsection> <subsection name="Cluster"> <changelog> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
