Commits

Anonymous committed 5bb4aa1

XWork Annotation bugs

Issue number: XW-421
Submitted by: Jonathan Gerrish

git-svn-id: http://svn.opensymphony.com/svn/xwork/branches/xwork_1-2@1208e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (2)

tiger/src/java/com/opensymphony/xwork/util/AnnotationXWorkConverter.java

      * @param clazz   class to look for converter mappings for
      */
     void addConverterMapping(Map mapping, Class clazz) {
-
         try {
             InputStream is = FileManager.loadFile(buildConverterFilename(clazz), clazz);
 
 
                     if (key != null) {
                         try {
-                            if (tc.rule().equals(ConversionType.APPLICATION)) {
+                            //if (tc.rule().equals(ConversionType.APPLICATION)) {
+                        	if (tc.type()  == ConversionType.APPLICATION) {
                                 defaultMappings.put(key, createTypeConverter(tc.converter()));
                             } else {
                                 if (tc.rule().toString().equals(ConversionRule.KEY_PROPERTY) || tc.rule().toString().equals(ConversionRule.CREATE_IF_NULL)) {
                     }
 
                     if (key != null) {
-                        try {
-                            if (tc.rule().equals(ConversionType.APPLICATION)) {
+                    	try {
+                            //if (tc.rule().equals(ConversionType.APPLICATION)) {
+                        	if (tc.type() == ConversionType.APPLICATION) {
                                 defaultMappings.put(key, createTypeConverter(tc.converter()));
                             } else {
                                 if (tc.rule().toString().equals(ConversionRule.KEY_PROPERTY)) {

tiger/src/java/com/opensymphony/xwork/util/Element.java

 
 package com.opensymphony.xwork.util;
 
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
 /**
  * <!-- START SNIPPET: description -->
  * <p/>Sets the Element for type conversion.
  * @author Rainer Hermanns
  * @version $Id$
  */
+@Target({ ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
 public @interface Element {
 
     /**
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.