You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "marcio (JIRA)" <ji...@apache.org> on 2007/10/24 23:02:17 UTC

[jira] Created: (OFBIZ-1365) improve get method of GenericEntity class

improve get method of GenericEntity class
-----------------------------------------

                 Key: OFBIZ-1365
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1365
             Project: OFBiz
          Issue Type: Improvement
    Affects Versions: SVN trunk
         Environment: Windows XP Profissional, on intel pentium 4.
            Reporter: marcio
            Priority: Critical
             Fix For: SVN trunk


the orignal method is: 

    public Object get(String name) {
        if (getModelEntity().getField(name) == null) {
            throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
        }
        return fields.get(name);
    }

the improve: 

    public Object get(String name) {
	if (fields != null) {
	    if (fields.get(name) != null) {
		return fields.get(name);
	    }
	}
        if (getModelEntity().getField(name) == null) {
            throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
        }
        return fields.get(name);
    }

this solve my error when i get list of GenericEntity on RMI call .

i hope this help and improve ofbiz.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OFBIZ-1365) improve get method of GenericEntity class

Posted by "Marco Risaliti (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marco Risaliti closed OFBIZ-1365.
---------------------------------

    Resolution: Won't Fix

> improve get method of GenericEntity class
> -----------------------------------------
>
>                 Key: OFBIZ-1365
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1365
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: marcio
>            Priority: Minor
>             Fix For: SVN trunk
>
>
> the orignal method is: 
>     public Object get(String name) {
>         if (getModelEntity().getField(name) == null) {
>             throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
>         }
>         return fields.get(name);
>     }
> the improve: 
>     public Object get(String name) {
> 	if (fields != null) {
> 	    if (fields.get(name) != null) {
> 		return fields.get(name);
> 	    }
> 	}
>         if (getModelEntity().getField(name) == null) {
>             throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
>         }
>         return fields.get(name);
>     }
> this solve my error when i get list of GenericEntity on RMI call .
> i hope this help and improve ofbiz.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-1365) improve get method of GenericEntity class

Posted by "Adam Heath (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537432 ] 

Adam Heath commented on OFBIZ-1365:
-----------------------------------

What is this good for?  What error do you get?  Please tell us why this change is needed; I don't understand from just reading the the comment.

> improve get method of GenericEntity class
> -----------------------------------------
>
>                 Key: OFBIZ-1365
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1365
>             Project: OFBiz
>          Issue Type: Improvement
>    Affects Versions: SVN trunk
>         Environment: Windows XP Profissional, on intel pentium 4.
>            Reporter: marcio
>            Priority: Critical
>             Fix For: SVN trunk
>
>
> the orignal method is: 
>     public Object get(String name) {
>         if (getModelEntity().getField(name) == null) {
>             throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
>         }
>         return fields.get(name);
>     }
> the improve: 
>     public Object get(String name) {
> 	if (fields != null) {
> 	    if (fields.get(name) != null) {
> 		return fields.get(name);
> 	    }
> 	}
>         if (getModelEntity().getField(name) == null) {
>             throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
>         }
>         return fields.get(name);
>     }
> this solve my error when i get list of GenericEntity on RMI call .
> i hope this help and improve ofbiz.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-1365) improve get method of GenericEntity class

Posted by "David E. Jones (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537435 ] 

David E. Jones commented on OFBIZ-1365:
---------------------------------------

Yeah, I'm also curious about what error you get.

My initial impression to the change is: no way. This circumvents a dynamic check that is quite important because it is the only way these generic data structures can be checked (ie they are entity definition based and there is not compile time checking for Java code).

> improve get method of GenericEntity class
> -----------------------------------------
>
>                 Key: OFBIZ-1365
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1365
>             Project: OFBiz
>          Issue Type: Improvement
>    Affects Versions: SVN trunk
>         Environment: Windows XP Profissional, on intel pentium 4.
>            Reporter: marcio
>            Priority: Critical
>             Fix For: SVN trunk
>
>
> the orignal method is: 
>     public Object get(String name) {
>         if (getModelEntity().getField(name) == null) {
>             throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
>         }
>         return fields.get(name);
>     }
> the improve: 
>     public Object get(String name) {
> 	if (fields != null) {
> 	    if (fields.get(name) != null) {
> 		return fields.get(name);
> 	    }
> 	}
>         if (getModelEntity().getField(name) == null) {
>             throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
>         }
>         return fields.get(name);
>     }
> this solve my error when i get list of GenericEntity on RMI call .
> i hope this help and improve ofbiz.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1365) improve get method of GenericEntity class

Posted by "Jacopo Cappellato (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacopo Cappellato updated OFBIZ-1365:
-------------------------------------

    Component/s: framework
       Priority: Minor  (was: Critical)
    Environment:     (was: Windows XP Profissional, on intel pentium 4.)

> improve get method of GenericEntity class
> -----------------------------------------
>
>                 Key: OFBIZ-1365
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1365
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: marcio
>            Priority: Minor
>             Fix For: SVN trunk
>
>
> the orignal method is: 
>     public Object get(String name) {
>         if (getModelEntity().getField(name) == null) {
>             throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
>         }
>         return fields.get(name);
>     }
> the improve: 
>     public Object get(String name) {
> 	if (fields != null) {
> 	    if (fields.get(name) != null) {
> 		return fields.get(name);
> 	    }
> 	}
>         if (getModelEntity().getField(name) == null) {
>             throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
>         }
>         return fields.get(name);
>     }
> this solve my error when i get list of GenericEntity on RMI call .
> i hope this help and improve ofbiz.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.