From 8975d3629d45e5d2e80273ab5113f2969811725a Mon Sep 17 00:00:00 2001 From: remm Date: Wed, 21 Jun 2006 09:21:32 +0000 Subject: [PATCH] - Fix annotation names. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@415948 13f79535-47bb-0310-9956-ffa450edef68 --- .../{DeclaresRoles.java => DeclareRoles.java} | 60 +++++++++---------- java/javax/{annotation => ejb}/EJB.java | 68 +++++++++++----------- java/javax/{annotation => ejb}/EJBs.java | 60 +++++++++---------- .../apache/catalina/startup/WebAnnotationSet.java | 8 +-- .../apache/catalina/util/AnnotationProcessor.java | 2 +- .../apache/jasper/runtime/AnnotationProcessor.java | 2 +- 6 files changed, 100 insertions(+), 100 deletions(-) rename java/javax/annotation/security/{DeclaresRoles.java => DeclareRoles.java} (93%) rename java/javax/{annotation => ejb}/EJB.java (94%) rename java/javax/{annotation => ejb}/EJBs.java (94%) diff --git a/java/javax/annotation/security/DeclaresRoles.java b/java/javax/annotation/security/DeclareRoles.java similarity index 93% rename from java/javax/annotation/security/DeclaresRoles.java rename to java/javax/annotation/security/DeclareRoles.java index ccbd951c8..95f8aa194 100644 --- a/java/javax/annotation/security/DeclaresRoles.java +++ b/java/javax/annotation/security/DeclareRoles.java @@ -1,30 +1,30 @@ -/* - * Copyright 2006 The Apache Software Foundation. - * - * Licensed 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 javax.annotation.security; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) - -public @interface DeclaresRoles { - public String[] value(); -} +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed 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 javax.annotation.security; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) + +public @interface DeclareRoles { + public String[] value(); +} diff --git a/java/javax/annotation/EJB.java b/java/javax/ejb/EJB.java similarity index 94% rename from java/javax/annotation/EJB.java rename to java/javax/ejb/EJB.java index 13b308e6b..0a4e44556 100644 --- a/java/javax/annotation/EJB.java +++ b/java/javax/ejb/EJB.java @@ -1,34 +1,34 @@ -/* - * Copyright 2006 The Apache Software Foundation. - * - * Licensed 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 javax.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) - -public @interface EJB { - String name() default ""; - Class businessInterface() default java.lang.Object.class; - String beanName() default ""; - String mappedName() default ""; - String description() default ""; -} +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed 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 javax.ejb; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) + +public @interface EJB { + String name() default ""; + Class businessInterface() default java.lang.Object.class; + String beanName() default ""; + String mappedName() default ""; + String description() default ""; +} diff --git a/java/javax/annotation/EJBs.java b/java/javax/ejb/EJBs.java similarity index 94% rename from java/javax/annotation/EJBs.java rename to java/javax/ejb/EJBs.java index 62e7a9ae0..50ed5d929 100644 --- a/java/javax/annotation/EJBs.java +++ b/java/javax/ejb/EJBs.java @@ -1,30 +1,30 @@ -/* - * Copyright 2006 The Apache Software Foundation. - * - * Licensed 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 javax.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) - -public @interface EJBs { - EJB[] value(); -} +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed 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 javax.ejb; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) + +public @interface EJBs { + EJB[] value(); +} diff --git a/java/org/apache/catalina/startup/WebAnnotationSet.java b/java/org/apache/catalina/startup/WebAnnotationSet.java index eef024aa0..f2261d13a 100644 --- a/java/org/apache/catalina/startup/WebAnnotationSet.java +++ b/java/org/apache/catalina/startup/WebAnnotationSet.java @@ -20,7 +20,7 @@ package org.apache.catalina.startup; import javax.annotation.Resource; import javax.annotation.Resources; -import javax.annotation.security.DeclaresRoles; +import javax.annotation.security.DeclareRoles; import javax.annotation.security.RunAs; import org.apache.catalina.Container; @@ -240,9 +240,9 @@ public class WebAnnotationSet { * Ref JSR 250, equivalent to the security-role element in * the deployment descriptor */ - if (classClass.isAnnotationPresent(DeclaresRoles.class)) { - DeclaresRoles annotation = (DeclaresRoles) - classClass.getAnnotation(DeclaresRoles.class); + if (classClass.isAnnotationPresent(DeclareRoles.class)) { + DeclareRoles annotation = (DeclareRoles) + classClass.getAnnotation(DeclareRoles.class); for (int i = 0; annotation.value() != null && i < annotation.value().length; i++) { context.addSecurityRole(annotation.value()[i]); } diff --git a/java/org/apache/catalina/util/AnnotationProcessor.java b/java/org/apache/catalina/util/AnnotationProcessor.java index 9288eb654..6e11428f6 100644 --- a/java/org/apache/catalina/util/AnnotationProcessor.java +++ b/java/org/apache/catalina/util/AnnotationProcessor.java @@ -21,10 +21,10 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import javax.annotation.EJB; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; +import javax.ejb.EJB; import javax.naming.NamingException; import javax.persistence.PersistenceContext; import javax.persistence.PersistenceUnit; diff --git a/java/org/apache/jasper/runtime/AnnotationProcessor.java b/java/org/apache/jasper/runtime/AnnotationProcessor.java index 915e5f4d7..c9a3197b4 100644 --- a/java/org/apache/jasper/runtime/AnnotationProcessor.java +++ b/java/org/apache/jasper/runtime/AnnotationProcessor.java @@ -21,10 +21,10 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import javax.annotation.EJB; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; +import javax.ejb.EJB; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; -- 2.11.0