Why does scala plugin perform inspections on Java code?

Hello

I have the following code in a Java class:

public JavaRDD<Xdr> decodeKafkaRdd(JavaRDD<ConsumerRecord<byte[], byte[]>> rdd) {
return rdd.map(this::decodeKafkaRecord).filter(Optional::isPresent).map(Optional::get);
}

It worked well and my IDE didn't show any error. But as soon as I installed the scala plugin I got the following error:

I could get rid of this issue by changing my code to:

public JavaRDD<Xdr> decodeKafkaRdd(JavaRDD<ConsumerRecord<byte[], byte[]>> rdd) {
return rdd.map(this::decodeKafkaRecord).filter(xdrOptional -> (Boolean) xdrOptional.isPresent()).map(Optional::get);
}

But an IDE without scala plugin show warnings and advice to refactor the code the way it was before.

Is there any way to disable the scala plugin inspection on Java code?

 

Thank

JF

 

Please sign in to leave a comment.