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

修复ognl表达式获取字段值返回类型错误 #2965

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Allan-QLB
Copy link
Contributor

由于ObjectPropertyAccessor会优先尝试调用字段的get方法或read方法(例如名称为hasXXX的方法),有时候这些方法并不会直接返回字段值,导致无法查看对象的某些字段,例如org.apache.kafka.clients.consumer.internals.Fetcher,查看字段completedFetches返回的是一个boolean类型

public class Fetcher<K, V> implements Closeable {
   
    private final int maxPollRecords;
    private final boolean checkCrcs;
    private final String clientRackId;
    private final ConsumerMetadata metadata;
    private final FetchManagerMetrics sensors;
    private final SubscriptionState subscriptions;
    private final ConcurrentLinkedQueue<CompletedFetch> completedFetches;
   
    private final ApiVersions apiVersions;

    private PartitionRecords nextInLineRecords = null;

  
    public boolean hasCompletedFetches() {
        return !completedFetches.isEmpty();
    }
}

image
企业微信截图_17327018456771

@heroPeak
Copy link

由于ObjectPropertyAccessor会优先尝试调用字段的get方法或read方法(例如名称为hasXXX的方法),有时候这些方法并不会直接返回字段值,导致无法查看对象的某些字段,例如org.apache.kafka.clients.consumer.internals.Fetcher,查看字段completedFetches返回的是一个boolean类型

public class Fetcher<K, V> implements Closeable {
   
    private final int maxPollRecords;
    private final boolean checkCrcs;
    private final String clientRackId;
    private final ConsumerMetadata metadata;
    private final FetchManagerMetrics sensors;
    private final SubscriptionState subscriptions;
    private final ConcurrentLinkedQueue<CompletedFetch> completedFetches;
   
    private final ApiVersions apiVersions;

    private PartitionRecords nextInLineRecords = null;

  
    public boolean hasCompletedFetches() {
        return !completedFetches.isEmpty();
    }
}

image 企业微信截图_17327018456771

请问这个问题在哪个版本修复了啊?我也遇到这个问题了

@Allan-QLB
Copy link
Contributor Author

请问这个问题在哪个版本修复了啊?我也遇到这个问题了

目前还没

@hengyunabc
Copy link
Collaborator

这个可以加些测试不?

@Allan-QLB
Copy link
Contributor Author

这个可以加些测试不?

已加

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

Successfully merging this pull request may close these issues.

3 participants