You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/06/10 15:57:33 UTC

[tomcat] 03/03: Better error messages for SMAP generation

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 7cea0054f83c5ff65f680a66389c254bac6c913f
Author: Mark Thomas <ma...@apache.org>
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 | 2 ++
 webapps/docs/changelog.xml                               | 8 ++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/jasper/compiler/SmapUtil.java b/java/org/apache/jasper/compiler/SmapUtil.java
index 3611738..73ac335 100644
--- a/java/org/apache/jasper/compiler/SmapUtil.java
+++ b/java/org/apache/jasper/compiler/SmapUtil.java
@@ -198,10 +198,12 @@ public class SmapUtil {
             SDEInstaller installer = new SDEInstaller(classFile, smap);
             installer.install(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 c2efc27..d9c1ce1 100644
--- a/java/org/apache/jasper/resources/LocalStrings.properties
+++ b/java/org/apache/jasper/resources/LocalStrings.properties
@@ -211,7 +211,9 @@ jsp.error.tld.unable_to_get_jar=Unable to get JAR resource [{0}] containing TLD:
 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.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 "&lt;/{0}" is unbalanced
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 612a689..dd8d395 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -53,6 +53,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>
 </section>
 <section name="Tomcat 8.5.42 (markt)" rtext="2019-06-07">
   <subsection name="Catalina">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org