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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 1ef921ceec Remove unnecessary casts
1ef921ceec is described below

commit 1ef921ceeccb5daecc6d4658a9abe6ff5f212ccf
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Mar 17 16:21:04 2025 +0000

    Remove unnecessary casts
---
 java/org/apache/catalina/core/DefaultInstanceManager.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/core/DefaultInstanceManager.java 
b/java/org/apache/catalina/core/DefaultInstanceManager.java
index 9f23949951..e89f8bf95b 100644
--- a/java/org/apache/catalina/core/DefaultInstanceManager.java
+++ b/java/org/apache/catalina/core/DefaultInstanceManager.java
@@ -377,21 +377,21 @@ public class DefaultInstanceManager implements 
InstanceManager {
                             annotations.add(new 
AnnotationCacheEntry(fieldName, null, resourceAnnotation.name(),
                                     AnnotationCacheEntryType.FIELD));
                         } else if (EJB_PRESENT && (ejbAnnotation = 
field.getAnnotation(EJB.class)) != null) {
-                            annotations.add(new 
AnnotationCacheEntry(fieldName, null, ((EJB) ejbAnnotation).name(),
+                            annotations.add(new 
AnnotationCacheEntry(fieldName, null, ejbAnnotation.name(),
                                     AnnotationCacheEntryType.FIELD));
                         } else if (WS_PRESENT &&
                                 (webServiceRefAnnotation = 
field.getAnnotation(WebServiceRef.class)) != null) {
                             annotations.add(new 
AnnotationCacheEntry(fieldName, null,
-                                    ((WebServiceRef) 
webServiceRefAnnotation).name(), AnnotationCacheEntryType.FIELD));
+                                    webServiceRefAnnotation.name(), 
AnnotationCacheEntryType.FIELD));
                         } else if (JPA_PRESENT && 
(persistenceContextAnnotation =
                                 field.getAnnotation(PersistenceContext.class)) 
!= null) {
                             annotations.add(new 
AnnotationCacheEntry(fieldName, null,
-                                    ((PersistenceContext) 
persistenceContextAnnotation).name(),
+                                    persistenceContextAnnotation.name(),
                                     AnnotationCacheEntryType.FIELD));
                         } else if (JPA_PRESENT &&
                                 (persistenceUnitAnnotation = 
field.getAnnotation(PersistenceUnit.class)) != null) {
                             annotations.add(new 
AnnotationCacheEntry(fieldName, null,
-                                    ((PersistenceUnit) 
persistenceUnitAnnotation).name(),
+                                    persistenceUnitAnnotation.name(),
                                     AnnotationCacheEntryType.FIELD));
                         }
                     }


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

Reply via email to