这是indexloc提供的服务,不要输入任何密码
Skip to content

java.lang.ClassCastException thrown after making squid:S1612 changes. #12

@MadAboutProgramming

Description

@MadAboutProgramming

squid:S1612 (Lambdas should be replaced with method references)

I have something called (value -> (value != null) in my project, But sonarQube recommended to change (Objects::nonNull).

After making above changes application stop working by throwing the java.lang.ClassCastException.

Example:

DataStream configurations = env
.addSource(createConfigurations(kafkaProps))
.uid(Constants.KAFKA_SOURCE)
.filter(value -> (value != null));

Made the changes to

DataStream configurations = env
.addSource(createConfigurations(kafkaProps))
.uid(Constants.KAFKA_SOURCE)
.filter(Objects::nonNull));

Exception: java.lang.ClassCastException

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions