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:30 UTC

[tomcat] branch 8.5.x updated (1c05856 -> 7cea005)

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

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


    from 1c05856  Backport additional translations
     new b38a103  Remove unused code
     new cb2f846  Improve i18n
     new 7cea005  Better error messages for SMAP generation

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/jasper/compiler/SmapUtil.java      |  6 +-
 .../jasper/resources/LocalStrings.properties       |  5 +-
 .../jasper/resources/LocalStrings_es.properties    |  1 -
 .../jasper/resources/LocalStrings_fr.properties    |  3 +-
 .../jasper/resources/LocalStrings_ja.properties    |  3 +-
 .../apache/jasper/runtime/JspRuntimeLibrary.java   | 76 +++++++---------------
 webapps/docs/changelog.xml                         |  8 +++
 7 files changed, 45 insertions(+), 57 deletions(-)


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


[tomcat] 01/03: Remove unused code

Posted by ma...@apache.org.
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 b38a103ed3cda4595162ac75d43852306e011ab3
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jun 10 14:14:59 2019 +0100

    Remove unused code
---
 .../jasper/resources/LocalStrings.properties       |  1 -
 .../jasper/resources/LocalStrings_es.properties    |  1 -
 .../jasper/resources/LocalStrings_fr.properties    |  1 -
 .../jasper/resources/LocalStrings_ja.properties    |  1 -
 .../apache/jasper/runtime/JspRuntimeLibrary.java   | 70 +++++++---------------
 5 files changed, 23 insertions(+), 51 deletions(-)

diff --git a/java/org/apache/jasper/resources/LocalStrings.properties b/java/org/apache/jasper/resources/LocalStrings.properties
index ecf7b69..8186424 100644
--- a/java/org/apache/jasper/resources/LocalStrings.properties
+++ b/java/org/apache/jasper/resources/LocalStrings.properties
@@ -35,7 +35,6 @@ jsp.error.bad.scratch.dir=The scratchDir you specified: [{0}] is unusable.
 jsp.error.badStandardAction=Invalid standard action
 jsp.error.bad_attribute=Attribute [{0}] invalid for tag [{1}] according to TLD
 jsp.error.bad_tag=No tag [{0}] defined in tag library imported with prefix [{1}]
-jsp.error.beans.nobeaninfo=No BeanInfo for the bean of type [{0}] could be found, the class likely does not exist.
 jsp.error.beans.nomethod=Cannot find a method to read property [{0}] in a bean of type [{1}]
 jsp.error.beans.nomethod.setproperty=Cannot find a method to write property [{0}] of type [{1}] in a bean of type [{2}]
 jsp.error.beans.noproperty=Cannot find any information on property [{0}] in a bean of type [{1}]
diff --git a/java/org/apache/jasper/resources/LocalStrings_es.properties b/java/org/apache/jasper/resources/LocalStrings_es.properties
index dfd3381..cc9f205 100644
--- a/java/org/apache/jasper/resources/LocalStrings_es.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_es.properties
@@ -35,7 +35,6 @@ jsp.error.bad.scratch.dir=El directorio de trabajo especificado: [{0}] no es uti
 jsp.error.badStandardAction=Acción estándar incorrecta
 jsp.error.bad_attribute=El atributo [{0}] no es válido según el TLD especificado
 jsp.error.bad_tag=No existe el tag [{0}] en la biblioteca importada con prefijo [{1}]
-jsp.error.beans.nobeaninfo=No se puede encontrar BeanInfo para el bean  [{0}] seguramente la clase no existe
 jsp.error.beans.nomethod=No puedo encontrar un método para leer la propiedad [{0}] en un bean del tipo [{1}]
 jsp.error.beans.nomethod.setproperty=No puedo encontrar un método para escribir la propiedad [{0}] en un bean del tipo [{2}]
 jsp.error.beans.noproperty=No puedo encontrar información de la propiedad [{0}] en un bean del tipo [{1}]
diff --git a/java/org/apache/jasper/resources/LocalStrings_fr.properties b/java/org/apache/jasper/resources/LocalStrings_fr.properties
index 6220078..5484344 100644
--- a/java/org/apache/jasper/resources/LocalStrings_fr.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_fr.properties
@@ -35,7 +35,6 @@ jsp.error.bad.scratch.dir=Le paramètre "scratchDir" que vous avez spécifié: [
 jsp.error.badStandardAction=L'action n'est pas reconnue comme une action standard.
 jsp.error.bad_attribute=L''attribut [{0}] est incorrect pour le tag [{1}] d''après la TLD indiquée
 jsp.error.bad_tag=Aucun tag [{0}] dans la bibliothèque de tag importée avec le préfixe [{1}]
-jsp.error.beans.nobeaninfo=Pas d''information bean (BeanInfo) pour le bean de type [{0}] n''a pu être trouvée, la classe n''existe probablement pas.
 jsp.error.beans.nomethod=Impossible de trouver une méthode pour lire la propriété [{0}] dans le bean de type [{1}]
 jsp.error.beans.nomethod.setproperty=Impossible de trouver une méthode pour mettre à jour la propriété [{0}] de type [{1}]dans le bean de type [{2}]
 jsp.error.beans.noproperty==Impossible de trouver de l''information sur la propriété [{0}] dans le bean de type [{1}]
diff --git a/java/org/apache/jasper/resources/LocalStrings_ja.properties b/java/org/apache/jasper/resources/LocalStrings_ja.properties
index cfcec7c..0cc1de1 100644
--- a/java/org/apache/jasper/resources/LocalStrings_ja.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_ja.properties
@@ -35,7 +35,6 @@ jsp.error.bad.scratch.dir=あなたが指定したscratchDir: [{0}] は使用で
 jsp.error.badStandardAction=無効な標準アクションです
 jsp.error.bad_attribute=TLDによると、タグ [{1}] の属性 [{0}] は無効です
 jsp.error.bad_tag=プレフィックス [{1}]でインポートされたタグライブラリには、タグ [{0}] は存在しません
-jsp.error.beans.nobeaninfo=タイプ [{0}] のBeanにBeanInfoがないのを検出しました, クラスが存在しないかもしれません
 jsp.error.beans.nomethod=タイプ [{1}] のBean中の属性 [{0}] を読み込むメソッドを発見できませんでした
 jsp.error.beans.nomethod.setproperty=タイプ[{2}]のBeanのタイプ [{1}] の属性 [{0}] を書き込むメソッドを発見できませんでした
 jsp.error.beans.noproperty=タイプ [{1}] のbean中の属性 [{0}] の情報を発見できませんでした
diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index 35653e5..1ef424c 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -692,39 +692,26 @@ public class JspRuntimeLibrary {
         Method method = null;
         Class<?> type = null;
         try {
-            java.beans.BeanInfo info
-                = java.beans.Introspector.getBeanInfo(beanClass);
-            if ( info != null ) {
-                java.beans.PropertyDescriptor pd[]
-                    = info.getPropertyDescriptors();
-                for (int i = 0 ; i < pd.length ; i++) {
-                    if ( pd[i].getName().equals(prop) ) {
-                        method = pd[i].getWriteMethod();
-                        type   = pd[i].getPropertyType();
-                        break;
-                    }
+            java.beans.BeanInfo info = java.beans.Introspector.getBeanInfo(beanClass);
+            java.beans.PropertyDescriptor pd[] = info.getPropertyDescriptors();
+            for (int i = 0 ; i < pd.length ; i++) {
+                if ( pd[i].getName().equals(prop) ) {
+                    method = pd[i].getWriteMethod();
+                    type = pd[i].getPropertyType();
+                    break;
                 }
-            } else {
-                // just in case introspection silently fails.
-                throw new JasperException(
-                    Localizer.getMessage("jsp.error.beans.nobeaninfo",
-                                         beanClass.getName()));
             }
         } catch (Exception ex) {
             throw new JasperException (ex);
         }
         if (method == null) {
             if (type == null) {
-                throw new JasperException(
-                        Localizer.getMessage("jsp.error.beans.noproperty",
-                                             prop,
-                                             beanClass.getName()));
+                throw new JasperException(Localizer.getMessage(
+                        "jsp.error.beans.noproperty", prop, beanClass.getName()));
             } else {
-                throw new JasperException(
-                    Localizer.getMessage("jsp.error.beans.nomethod.setproperty",
-                                         prop,
-                                         type.getName(),
-                                         beanClass.getName()));
+                throw new JasperException(Localizer.getMessage(
+                        "jsp.error.beans.nomethod.setproperty",
+                        prop, type.getName(), beanClass.getName()));
             }
         }
         return method;
@@ -736,36 +723,25 @@ public class JspRuntimeLibrary {
         Method method = null;
         Class<?> type = null;
         try {
-            java.beans.BeanInfo info
-                = java.beans.Introspector.getBeanInfo(beanClass);
-            if ( info != null ) {
-                java.beans.PropertyDescriptor pd[]
-                    = info.getPropertyDescriptors();
-                for (int i = 0 ; i < pd.length ; i++) {
-                    if ( pd[i].getName().equals(prop) ) {
-                        method = pd[i].getReadMethod();
-                        type   = pd[i].getPropertyType();
-                        break;
-                    }
+            java.beans.BeanInfo info = java.beans.Introspector.getBeanInfo(beanClass);
+            java.beans.PropertyDescriptor pd[] = info.getPropertyDescriptors();
+            for (int i = 0 ; i < pd.length ; i++) {
+                if (pd[i].getName().equals(prop)) {
+                    method = pd[i].getReadMethod();
+                    type = pd[i].getPropertyType();
+                    break;
                 }
-            } else {
-                // just in case introspection silently fails.
-                throw new JasperException(
-                    Localizer.getMessage("jsp.error.beans.nobeaninfo",
-                                         beanClass.getName()));
             }
         } catch (Exception ex) {
             throw new JasperException (ex);
         }
         if (method == null) {
             if (type == null) {
-                throw new JasperException(
-                    Localizer.getMessage("jsp.error.beans.noproperty", prop,
-                                         beanClass.getName()));
+                throw new JasperException(Localizer.getMessage(
+                        "jsp.error.beans.noproperty", prop, beanClass.getName()));
             } else {
-                throw new JasperException(
-                    Localizer.getMessage("jsp.error.beans.nomethod", prop,
-                                         beanClass.getName()));
+                throw new JasperException(Localizer.getMessage(
+                        "jsp.error.beans.nomethod", prop, beanClass.getName()));
             }
         }
 


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


[tomcat] 02/03: Improve i18n

Posted by ma...@apache.org.
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 cb2f846e62d9e1a1fee0fe09798bb03bc02953ad
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jun 10 14:18:09 2019 +0100

    Improve i18n
---
 java/org/apache/jasper/resources/LocalStrings.properties    | 2 ++
 java/org/apache/jasper/resources/LocalStrings_fr.properties | 2 ++
 java/org/apache/jasper/resources/LocalStrings_ja.properties | 2 ++
 java/org/apache/jasper/runtime/JspRuntimeLibrary.java       | 6 ++----
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/jasper/resources/LocalStrings.properties b/java/org/apache/jasper/resources/LocalStrings.properties
index 8186424..c2efc27 100644
--- a/java/org/apache/jasper/resources/LocalStrings.properties
+++ b/java/org/apache/jasper/resources/LocalStrings.properties
@@ -300,6 +300,8 @@ jsp.warning.quoteAttributeEL=Warning: Invalid value for the initParam quoteAttri
 jsp.warning.recompileOnFail=Warning: Invalid value for the initParam recompileOnFail. Will use the default value of "false"
 jsp.warning.strictQuoteEscaping=Warning: Invalid value for the initParam strictQuoteEscaping. Will use the default value of "true"
 jsp.warning.suppressSmap=Warning: Invalid value for the initParam suppressSmap. Will use the default value of "false"
+jsp.warning.tagPreDestroy=Error processing preDestroy on tag instance of [{0}]
+jsp.warning.tagRelease=Error processing release on tag instance of [{0}]
 jsp.warning.unknown.sourceVM=Unknown source VM [{0}] ignored
 jsp.warning.unknown.targetVM=Unknown target VM [{0}] ignored
 jsp.warning.unsupported.sourceVM=Unsupported source VM [{0}] requested, using [{1}]
diff --git a/java/org/apache/jasper/resources/LocalStrings_fr.properties b/java/org/apache/jasper/resources/LocalStrings_fr.properties
index 5484344..918f276 100644
--- a/java/org/apache/jasper/resources/LocalStrings_fr.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_fr.properties
@@ -267,6 +267,8 @@ jsp.warning.quoteAttributeEL=WARNING: Valeur invalide pour le paramètre d'initi
 jsp.warning.recompileOnFail=WARNING: Valeur invalide pour le paramètre d'initialisation recompileOnFail, la valeur par défaut "false" sera utilisée
 jsp.warning.strictQuoteEscaping=WARNING: Valeur invalide pour le paramètre d'initialisation strictQuoteEscaping, la valeur par défaut "true" sera utilisée
 jsp.warning.suppressSmap=WARNING : valeur invalide d' l'initParam suppressSmap. La valeur par défaut "false" sera utilisée
+jsp.warning.tagPreDestroy=Erreur lors du traitement de preDestroy pour l''instance de tag [{0}]
+jsp.warning.tagRelease=Erreur lors du traitement de release pour l''instance de tag [{0}]
 jsp.warning.unknown.sourceVM=La VM source [{0}] inconnue a été ignorée
 jsp.warning.unknown.targetVM=La VM cible [{0}] inconnue a été ignorée
 jsp.warning.unsupported.sourceVM=La VM source [{0}] demandée n''est pas supportée, [{1}] sera utilisé
diff --git a/java/org/apache/jasper/resources/LocalStrings_ja.properties b/java/org/apache/jasper/resources/LocalStrings_ja.properties
index 0cc1de1..fdfb51d 100644
--- a/java/org/apache/jasper/resources/LocalStrings_ja.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_ja.properties
@@ -299,6 +299,8 @@ jsp.warning.quoteAttributeEL=警告: initParam の quoteAttributeEL に不正な
 jsp.warning.recompileOnFail=警告: initParam の recompileOnFail に不正な値が指定されました。初期値の "false" を使用します。
 jsp.warning.strictQuoteEscaping=警告:initParam strictQuoteEscapingの値が無効です。 デフォルト値 "true"を使用します。
 jsp.warning.suppressSmap=警告: initParam suppressSmapの値が無効です。デフォルト値 "false" を使用します
+jsp.warning.tagPreDestroy=[{0}]のタグインスタンスでpreDestroyを処理中にエラーが発生しました。
+jsp.warning.tagRelease=[{0}]のタグインスタンスでリリースを処理中にエラーが発生しました。
 jsp.warning.unknown.sourceVM=不明な source VM [{0}]が無視されました
 jsp.warning.unknown.targetVM=不明な target  VM [{0}]が無視されました。
 jsp.warning.xpoweredBy=警告: Invalid value for the initParam xpoweredByの値が無効です。デフォルト値 "false" を使用します
diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index 1ef424c..096f9a6 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -968,8 +968,7 @@ public class JspRuntimeLibrary {
         } catch (Throwable t) {
             ExceptionUtils.handleThrowable(t);
             Log log = LogFactory.getLog(JspRuntimeLibrary.class);
-            log.warn("Error processing release on tag instance of "
-                    + tag.getClass().getName(), t);
+            log.warn(Localizer.getMessage("jsp.warning.tagRelease", tag.getClass().getName()), t);
         }
         try {
             instanceManager.destroyInstance(tag);
@@ -977,8 +976,7 @@ public class JspRuntimeLibrary {
             Throwable t = ExceptionUtils.unwrapInvocationTargetException(e);
             ExceptionUtils.handleThrowable(t);
             Log log = LogFactory.getLog(JspRuntimeLibrary.class);
-            log.warn("Error processing preDestroy on tag instance of "
-                    + tag.getClass().getName(), t);
+            log.warn(Localizer.getMessage("jsp.warning.tagPreDestroy", tag.getClass().getName()), t);
         }
 
     }


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


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

Posted by ma...@apache.org.
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