Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

considering optimizing XxxResolverContext #174

Open
alalag1 opened this issue Apr 28, 2022 · 0 comments
Open

considering optimizing XxxResolverContext #174

alalag1 opened this issue Apr 28, 2022 · 0 comments
Assignees
Milestone

Comments

@alalag1
Copy link
Member

alalag1 commented Apr 28, 2022

Avoid frequent re-creation of this object whose fields are immutable in runtime

public class RequestEntityResolverContextImpl implements RequestEntityResolverContext {
private final Param param;
private final RequestContext context;
private final RequestEntity entity;
private final RequestEntityResolver[] resolvers;
private final RequestEntityResolverAdvice[] advices;
private final int advicesSize;
private int index;
public RequestEntityResolverContextImpl(Param param,
RequestContext context,
RequestEntity entity,
RequestEntityResolver[] resolvers,
RequestEntityResolverAdvice[] advices) {
Checks.checkNotNull(param, "param");
Checks.checkNotNull(context, "context");
Checks.checkNotNull(entity, "entity");
Checks.checkNotNull(resolvers, "resolvers");
this.param = param;
this.context = context;
this.entity = entity;
this.resolvers = resolvers;
this.advices = advices;
this.advicesSize = (advices == null ? 0 : advices.length);
}

same with

public class ParamResolverContextImpl implements ParamResolverContext {

public class RequestEntityResolverContextImpl implements RequestEntityResolverContext {

public class ResponseEntityResolverContextImpl implements ResponseEntityResolverContext {

Env

  • Restlight version: 1.0.0-SNAPSHOT
@LCDZhao-Z LCDZhao-Z self-assigned this May 6, 2022
@LCDZhao-Z LCDZhao-Z added this to the v1.0.1 milestone May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants