You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Igor V. Stolyarov (JIRA)" <ji...@apache.org> on 2006/08/16 08:15:14 UTC

[jira] Created: (HARMONY-1205) [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly

[classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
-----------------------------------------------------------------------------------------------------

                 Key: HARMONY-1205
                 URL: http://issues.apache.org/jira/browse/HARMONY-1205
             Project: Harmony
          Issue Type: Bug
            Reporter: Igor V. Stolyarov


PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly

Test----------------------------------------------------------------------------------------------------------

import java.beans.*;
------------PropEditorTest.java----------------------
public class PropEditorTest{

    public static void main(String argv[])throws ClassNotFoundException{
        String path[] = PropertyEditorManager.getEditorSearchPath();
        String newPath[] = new String[path.length + 1];
        newPath[0] = "test";
        for(int i = 0; i < path.length ; i++) newPath[i+1] = path[i];
        PropertyEditorManager.setEditorSearchPath(newPath);
        PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
        System.out.println(pe);
        pe.setAsText("111");
        System.out.println(pe.getValue());
    }
}
------------test.StringEditor.java--------------------
package test;
import java.beans.*;

public class StringEditor extends PropertyEditorSupport{
    public StringEditor(final Object source){  
        super(source);  
    }  
   
    public StringEditor(){  
        super();  
    }  

    public void setAsText(String text){
        setValue(text);
    }
}

Output----------------------------------------------------------------------------------
JRockit:
C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
 System optimized over throughput (initial strategy singleparpar))

test.StringEditor@1b4d98
111

Harmony:
C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
java version 1.5 (subset)

(c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
licable.

org.apache.harmony.beans.editors.StringEditor@48324832
Exception in thread "main" java.lang.IllegalArgumentException: 111
        at java.beans.PropertyEditorSupport.setAsText(PropertyEditorSupport.java
:72)
        at PropEditorTest.main(PropEditorTest.java:13)

Test after changing order of search----------------------------------------------
------------PropEditorTest.java----------------------
import java.beans.*;

public class PropEditorTest{

    public static void main(String argv[])throws ClassNotFoundException{
        String path[] = PropertyEditorManager.getEditorSearchPath();
        String newPath[] = new String[path.length + 1];
        newPath[path.length] = "test";
        for(int i = 0; i < path.length ; i++) newPath[i] = path[i];
        PropertyEditorManager.setEditorSearchPath(newPath);
        PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
        System.out.println(pe);
        pe.setAsText("111");
        System.out.println(pe.getValue());
    }
}

Output-----------------------------------------------------------------------------------
JRockit:

C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
 System optimized over throughput (initial strategy singleparpar))

sun.beans.editors.StringEditor@1b49df
111

Harmony:

C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
java version 1.5 (subset)

(c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
licable.

test.StringEditor@485e485e
111


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-1205) [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly

Posted by "Igor V. Stolyarov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1205?page=all ]

Igor V. Stolyarov updated HARMONY-1205:
---------------------------------------

    Attachment: Harmony-1205.patch

Fix attached

> [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1205
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1205
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Igor V. Stolyarov
>         Attachments: Harmony-1205.patch
>
>
> PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
> Test----------------------------------------------------------------------------------------------------------
> import java.beans.*;
> ------------PropEditorTest.java----------------------
> public class PropEditorTest{
>     public static void main(String argv[])throws ClassNotFoundException{
>         String path[] = PropertyEditorManager.getEditorSearchPath();
>         String newPath[] = new String[path.length + 1];
>         newPath[0] = "test";
>         for(int i = 0; i < path.length ; i++) newPath[i+1] = path[i];
>         PropertyEditorManager.setEditorSearchPath(newPath);
>         PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
>         System.out.println(pe);
>         pe.setAsText("111");
>         System.out.println(pe.getValue());
>     }
> }
> ------------test.StringEditor.java--------------------
> package test;
> import java.beans.*;
> public class StringEditor extends PropertyEditorSupport{
>     public StringEditor(final Object source){  
>         super(source);  
>     }  
>    
>     public StringEditor(){  
>         super();  
>     }  
>     public void setAsText(String text){
>         setValue(text);
>     }
> }
> Output----------------------------------------------------------------------------------
> JRockit:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> test.StringEditor@1b4d98
> 111
> Harmony:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
> licable.
> org.apache.harmony.beans.editors.StringEditor@48324832
> Exception in thread "main" java.lang.IllegalArgumentException: 111
>         at java.beans.PropertyEditorSupport.setAsText(PropertyEditorSupport.java
> :72)
>         at PropEditorTest.main(PropEditorTest.java:13)
> Test after changing order of search----------------------------------------------
> ------------PropEditorTest.java----------------------
> import java.beans.*;
> public class PropEditorTest{
>     public static void main(String argv[])throws ClassNotFoundException{
>         String path[] = PropertyEditorManager.getEditorSearchPath();
>         String newPath[] = new String[path.length + 1];
>         newPath[path.length] = "test";
>         for(int i = 0; i < path.length ; i++) newPath[i] = path[i];
>         PropertyEditorManager.setEditorSearchPath(newPath);
>         PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
>         System.out.println(pe);
>         pe.setAsText("111");
>         System.out.println(pe.getValue());
>     }
> }
> Output-----------------------------------------------------------------------------------
> JRockit:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> sun.beans.editors.StringEditor@1b49df
> 111
> Harmony:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
> licable.
> test.StringEditor@485e485e
> 111

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1205) [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly

Posted by "Igor V. Stolyarov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1205?page=comments#action_12435477 ] 
            
Igor V. Stolyarov commented on HARMONY-1205:
--------------------------------------------

Works for me.
Thank you Mikhail.

> [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1205
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1205
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Igor V. Stolyarov
>         Assigned To: Mikhail Loenko
>         Attachments: Harmony-1205.patch
>
>
> PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
> Test----------------------------------------------------------------------------------------------------------
> import java.beans.*;
> ------------PropEditorTest.java----------------------
> public class PropEditorTest{
>     public static void main(String argv[])throws ClassNotFoundException{
>         String path[] = PropertyEditorManager.getEditorSearchPath();
>         String newPath[] = new String[path.length + 1];
>         newPath[0] = "test";
>         for(int i = 0; i < path.length ; i++) newPath[i+1] = path[i];
>         PropertyEditorManager.setEditorSearchPath(newPath);
>         PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
>         System.out.println(pe);
>         pe.setAsText("111");
>         System.out.println(pe.getValue());
>     }
> }
> ------------test.StringEditor.java--------------------
> package test;
> import java.beans.*;
> public class StringEditor extends PropertyEditorSupport{
>     public StringEditor(final Object source){  
>         super(source);  
>     }  
>    
>     public StringEditor(){  
>         super();  
>     }  
>     public void setAsText(String text){
>         setValue(text);
>     }
> }
> Output----------------------------------------------------------------------------------
> JRockit:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> test.StringEditor@1b4d98
> 111
> Harmony:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
> licable.
> org.apache.harmony.beans.editors.StringEditor@48324832
> Exception in thread "main" java.lang.IllegalArgumentException: 111
>         at java.beans.PropertyEditorSupport.setAsText(PropertyEditorSupport.java
> :72)
>         at PropEditorTest.main(PropEditorTest.java:13)
> Test after changing order of search----------------------------------------------
> ------------PropEditorTest.java----------------------
> import java.beans.*;
> public class PropEditorTest{
>     public static void main(String argv[])throws ClassNotFoundException{
>         String path[] = PropertyEditorManager.getEditorSearchPath();
>         String newPath[] = new String[path.length + 1];
>         newPath[path.length] = "test";
>         for(int i = 0; i < path.length ; i++) newPath[i] = path[i];
>         PropertyEditorManager.setEditorSearchPath(newPath);
>         PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
>         System.out.println(pe);
>         pe.setAsText("111");
>         System.out.println(pe.getValue());
>     }
> }
> Output-----------------------------------------------------------------------------------
> JRockit:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> sun.beans.editors.StringEditor@1b49df
> 111
> Harmony:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
> licable.
> test.StringEditor@485e485e
> 111

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (HARMONY-1205) [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1205?page=all ]

Mikhail Loenko reassigned HARMONY-1205:
---------------------------------------

    Assignee: Mikhail Loenko

> [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1205
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1205
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Igor V. Stolyarov
>         Assigned To: Mikhail Loenko
>         Attachments: Harmony-1205.patch
>
>
> PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
> Test----------------------------------------------------------------------------------------------------------
> import java.beans.*;
> ------------PropEditorTest.java----------------------
> public class PropEditorTest{
>     public static void main(String argv[])throws ClassNotFoundException{
>         String path[] = PropertyEditorManager.getEditorSearchPath();
>         String newPath[] = new String[path.length + 1];
>         newPath[0] = "test";
>         for(int i = 0; i < path.length ; i++) newPath[i+1] = path[i];
>         PropertyEditorManager.setEditorSearchPath(newPath);
>         PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
>         System.out.println(pe);
>         pe.setAsText("111");
>         System.out.println(pe.getValue());
>     }
> }
> ------------test.StringEditor.java--------------------
> package test;
> import java.beans.*;
> public class StringEditor extends PropertyEditorSupport{
>     public StringEditor(final Object source){  
>         super(source);  
>     }  
>    
>     public StringEditor(){  
>         super();  
>     }  
>     public void setAsText(String text){
>         setValue(text);
>     }
> }
> Output----------------------------------------------------------------------------------
> JRockit:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> test.StringEditor@1b4d98
> 111
> Harmony:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
> licable.
> org.apache.harmony.beans.editors.StringEditor@48324832
> Exception in thread "main" java.lang.IllegalArgumentException: 111
>         at java.beans.PropertyEditorSupport.setAsText(PropertyEditorSupport.java
> :72)
>         at PropEditorTest.main(PropEditorTest.java:13)
> Test after changing order of search----------------------------------------------
> ------------PropEditorTest.java----------------------
> import java.beans.*;
> public class PropEditorTest{
>     public static void main(String argv[])throws ClassNotFoundException{
>         String path[] = PropertyEditorManager.getEditorSearchPath();
>         String newPath[] = new String[path.length + 1];
>         newPath[path.length] = "test";
>         for(int i = 0; i < path.length ; i++) newPath[i] = path[i];
>         PropertyEditorManager.setEditorSearchPath(newPath);
>         PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
>         System.out.println(pe);
>         pe.setAsText("111");
>         System.out.println(pe.getValue());
>     }
> }
> Output-----------------------------------------------------------------------------------
> JRockit:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> sun.beans.editors.StringEditor@1b49df
> 111
> Harmony:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
> licable.
> test.StringEditor@485e485e
> 111

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (HARMONY-1205) [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1205?page=all ]

Mikhail Loenko resolved HARMONY-1205.
-------------------------------------

    Resolution: Fixed

fixed as a part of HARMONY-1199
Igor, please confirm it can be closed

> [classlib][beans] PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1205
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1205
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Igor V. Stolyarov
>         Assigned To: Mikhail Loenko
>         Attachments: Harmony-1205.patch
>
>
> PropertyEditorManager.findEditor(Class targetType) finds PropertyEditor incorrectly
> Test----------------------------------------------------------------------------------------------------------
> import java.beans.*;
> ------------PropEditorTest.java----------------------
> public class PropEditorTest{
>     public static void main(String argv[])throws ClassNotFoundException{
>         String path[] = PropertyEditorManager.getEditorSearchPath();
>         String newPath[] = new String[path.length + 1];
>         newPath[0] = "test";
>         for(int i = 0; i < path.length ; i++) newPath[i+1] = path[i];
>         PropertyEditorManager.setEditorSearchPath(newPath);
>         PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
>         System.out.println(pe);
>         pe.setAsText("111");
>         System.out.println(pe.getValue());
>     }
> }
> ------------test.StringEditor.java--------------------
> package test;
> import java.beans.*;
> public class StringEditor extends PropertyEditorSupport{
>     public StringEditor(final Object source){  
>         super(source);  
>     }  
>    
>     public StringEditor(){  
>         super();  
>     }  
>     public void setAsText(String text){
>         setValue(text);
>     }
> }
> Output----------------------------------------------------------------------------------
> JRockit:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> test.StringEditor@1b4d98
> 111
> Harmony:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
> licable.
> org.apache.harmony.beans.editors.StringEditor@48324832
> Exception in thread "main" java.lang.IllegalArgumentException: 111
>         at java.beans.PropertyEditorSupport.setAsText(PropertyEditorSupport.java
> :72)
>         at PropEditorTest.main(PropEditorTest.java:13)
> Test after changing order of search----------------------------------------------
> ------------PropEditorTest.java----------------------
> import java.beans.*;
> public class PropEditorTest{
>     public static void main(String argv[])throws ClassNotFoundException{
>         String path[] = PropertyEditorManager.getEditorSearchPath();
>         String newPath[] = new String[path.length + 1];
>         newPath[path.length] = "test";
>         for(int i = 0; i < path.length ; i++) newPath[i] = path[i];
>         PropertyEditorManager.setEditorSearchPath(newPath);
>         PropertyEditor pe = PropertyEditorManager.findEditor(Class.forName("java.lang.String"));
>         System.out.println(pe);
>         pe.setAsText("111");
>         System.out.println(pe.getValue());
>     }
> }
> Output-----------------------------------------------------------------------------------
> JRockit:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC:
>  System optimized over throughput (initial strategy singleparpar))
> sun.beans.editors.StringEditor@1b49df
> 111
> Harmony:
> C:\test>%JAVA_HOME%\bin\java -showversion PropEditorTest
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as app
> licable.
> test.StringEditor@485e485e
> 111

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira