You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/04/20 00:35:06 UTC

[GitHub] [dubbo-go-hessian2] wongoo commented on a change in pull request #179: Imp: cache in reflection

wongoo commented on a change in pull request #179:
URL: https://github.com/apache/dubbo-go-hessian2/pull/179#discussion_r411028219



##########
File path: object.go
##########
@@ -375,11 +375,15 @@ func (d *Decoder) decInstance(typ reflect.Type, cls classInfo) (interface{}, err
 	for i := 0; i < len(cls.fieldNameList); i++ {
 		fieldName := cls.fieldNameList[i]
 
-		index, fieldStruct, err := findField(fieldName, typ)
+		index, fieldStruct, err := findFieldWithCache(fieldName, typ)
 		if err != nil {
 			return nil, perrors.Errorf("can not find field %s", fieldName)
 		}
 
+		if fieldStruct == nil {

Review comment:
       the fieldStruct won't be nil if err is nil, this check is redundant.  And should it return error when fieldStruct is nil?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Re: [GitHub] [dubbo-go-hessian2] wongoo commented on a change in pull request #179: Imp: cache in reflection

Posted by YunKun Huang <ht...@gmail.com>.
I have raised a ticket in jira to ask help
https://issues.apache.org/jira/browse/DUBBO-42

On Wed, Apr 22, 2020 at 6:14 PM Huxing Zhang <hu...@apache.org> wrote:

> Hi,
>
> Can we send this notification to notifications@dubbo.apache.org?
>
> On Mon, Apr 20, 2020 at 8:35 AM GitBox <gi...@apache.org> wrote:
> >
> >
> > wongoo commented on a change in pull request #179:
> > URL:
> https://github.com/apache/dubbo-go-hessian2/pull/179#discussion_r411028219
> >
> >
> >
> > ##########
> > File path: object.go
> > ##########
> > @@ -375,11 +375,15 @@ func (d *Decoder) decInstance(typ reflect.Type,
> cls classInfo) (interface{}, err
> >         for i := 0; i < len(cls.fieldNameList); i++ {
> >                 fieldName := cls.fieldNameList[i]
> >
> > -               index, fieldStruct, err := findField(fieldName, typ)
> > +               index, fieldStruct, err := findFieldWithCache(fieldName,
> typ)
> >                 if err != nil {
> >                         return nil, perrors.Errorf("can not find field
> %s", fieldName)
> >                 }
> >
> > +               if fieldStruct == nil {
> >
> > Review comment:
> >        the fieldStruct won't be nil if err is nil, this check is
> redundant.  And should it return error when fieldStruct is nil?
> >
> >
> >
> >
> > ----------------------------------------------------------------
> > This is an automated message from the Apache Git Service.
> > To respond to the message, please log on to GitHub and use the
> > URL above to go to the specific comment.
> >
> > For queries about this service, please contact Infrastructure at:
> > users@infra.apache.org
> >
> >
>
>
> --
> Best Regards!
> Huxing
>

Re: [GitHub] [dubbo-go-hessian2] wongoo commented on a change in pull request #179: Imp: cache in reflection

Posted by Huxing Zhang <hu...@apache.org>.
Hi,

Can we send this notification to notifications@dubbo.apache.org?

On Mon, Apr 20, 2020 at 8:35 AM GitBox <gi...@apache.org> wrote:
>
>
> wongoo commented on a change in pull request #179:
> URL: https://github.com/apache/dubbo-go-hessian2/pull/179#discussion_r411028219
>
>
>
> ##########
> File path: object.go
> ##########
> @@ -375,11 +375,15 @@ func (d *Decoder) decInstance(typ reflect.Type, cls classInfo) (interface{}, err
>         for i := 0; i < len(cls.fieldNameList); i++ {
>                 fieldName := cls.fieldNameList[i]
>
> -               index, fieldStruct, err := findField(fieldName, typ)
> +               index, fieldStruct, err := findFieldWithCache(fieldName, typ)
>                 if err != nil {
>                         return nil, perrors.Errorf("can not find field %s", fieldName)
>                 }
>
> +               if fieldStruct == nil {
>
> Review comment:
>        the fieldStruct won't be nil if err is nil, this check is redundant.  And should it return error when fieldStruct is nil?
>
>
>
>
> ----------------------------------------------------------------
> This is an automated message from the Apache Git Service.
> To respond to the message, please log on to GitHub and use the
> URL above to go to the specific comment.
>
> For queries about this service, please contact Infrastructure at:
> users@infra.apache.org
>
>


-- 
Best Regards!
Huxing