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

activate IntellijIdea inspection InterfaceMayBeAnnotatedFunctional #3435

Closed
romani opened this Issue Sep 8, 2016 · 8 comments

Comments

Projects
4 participants
@romani
Member

romani commented Sep 8, 2016

original discussion was at #3434 (comment)

we need to review interfaces and confirm that they will stay functional.

https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html

However, the compiler will treat any interface meeting the definition of a functional interface as a functional interface regardless of whether or not a FunctionalInterface annotation is present on the interface declaration.

so there is no rush to activate this inspection. Interfaces in API part should be specially investigated, as we will not be able to revert changes in them easily.

Good task for Checkstyle 8.X releases.

@Kietzmann

This comment has been minimized.

Show comment
Hide comment
@Kietzmann

Kietzmann Jul 4, 2017

Contributor

I'm on it.
Should I add FunctionalInterface annotation in test interfaces?

Contributor

Kietzmann commented Jul 4, 2017

I'm on it.
Should I add FunctionalInterface annotation in test interfaces?

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 4, 2017

Member

@Kietzmann , sorry, but this is GSoC issue
will be addressed on next week.

Member

romani commented Jul 4, 2017

@Kietzmann , sorry, but this is GSoC issue
will be addressed on next week.

@romani romani added the GSoC2017 label Jul 4, 2017

@romani romani changed the title from activate IntelijIdea inspection InterfaceMayBeAnnotatedFunctional to activate IntellijIdea inspection InterfaceMayBeAnnotatedFunctional Jul 9, 2017

@romani romani moved this from To Do to In Progress in Practice What You Preach Jul 9, 2017

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 11, 2017

Member

@Nimfadora , please provide list of violations for me to confirm.

Member

romani commented Jul 11, 2017

@Nimfadora , please provide list of violations for me to confirm.

@Nimfadora

This comment has been minimized.

Show comment
Hide comment
@Nimfadora

Nimfadora Jul 15, 2017

Contributor

@romani here selected inspection is @FunctionalInterface

Contributor

Nimfadora commented Jul 15, 2017

@romani here selected inspection is @FunctionalInterface

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 15, 2017

Member

I am fine to put annotation to all interfaces.
It does give only one limitation is that after such annotation, we can not add another method in interface.
See discussion at https://stackoverflow.com/questions/36881826/what-is-use-of-functional-interface-in-java-8/36882003
But I think such interfaces are already stable.

@rnveach , please review and confirm that you are ok with update to put annotation on all that interfaces.

Member

romani commented Jul 15, 2017

I am fine to put annotation to all interfaces.
It does give only one limitation is that after such annotation, we can not add another method in interface.
See discussion at https://stackoverflow.com/questions/36881826/what-is-use-of-functional-interface-in-java-8/36882003
But I think such interfaces are already stable.

@rnveach , please review and confirm that you are ok with update to put annotation on all that interfaces.

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Jul 16, 2017

Member

@romani I am fine with the annotation if it will not be a problem to remove it if we decide any interface needs a new method.

Member

rnveach commented Jul 16, 2017

@romani I am fine with the annotation if it will not be a problem to remove it if we decide any interface needs a new method.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 16, 2017

Member

Such interfaces already could be used in lambda so any extension to them could potentially do problem with compilation, annotation only one give user certainty that it functional by design.
Let's try.

Member

romani commented Jul 16, 2017

Such interfaces already could be used in lambda so any extension to them could potentially do problem with compilation, annotation only one give user certainty that it functional by design.
Let's try.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 27, 2017

Member

fix is merged

Member

romani commented Jul 27, 2017

fix is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment