[ANN] SimpleIntentions 1.4.0

I added a new little intention to inspect for redundant method and field modifiers. Currently, these are

- final methods in final classes
- public methods in public interfaces
- transient fields that are static

Each one can be turned on/off separately in the Error settings.

etienne

14 comments
Comment actions Permalink

Hi Etienne,

I mean no offense, but it seems you have missed a couple of inspections
that exist in InspectionGadgets for a long time:

- Final methods in final classes are already highlighted by the
inspection "'final' method in 'final' class".
- Public methods in interfaces are also highlighted by the inspection
"Unnecessary interface modifier".
- Redundant fields initializations are reported by "Redundant field
initialization" in the category "Code Style issues"

Perhaps we should cooperate more:-) The rest of the intentions and
inspections is definitely useful enough that I will keep this plugin
installed.

Bas

etienne wrote:

I added a new little intention to inspect for redundant method

> and field modifiers. Currently, these are


- final methods in final classes
- public methods in public interfaces
- transient fields that are static

Each one can be turned on/off separately in the Error settings.

etienne

0
Comment actions Permalink

I get the following exception in IDEA #5281 when I try to invoke the
quick fix of the "Variable name does not match code style setting"
inspection:

java.lang.AbstractMethodError
at
com.intellij.codeInspection.ex.QuickFixWrapper.invoke(QuickFixWrapper.java:6)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$5$1$1.run(IntentionHintComponent.java:5)
at
com.intellij.openapi.application.impl.ApplicationImpl$9.compute(ApplicationImpl.java:0)
at
com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormattingInside(PostprocessReformattingAspect.java:9)
at
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:156)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$5$1$2.run(IntentionHintComponent.java:1)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:7)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:120)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$5$1.run(IntentionHintComponent.java:0)
at
com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:11)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:24)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:130)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:10)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


Bas

0
Comment actions Permalink

Hi Bas

Thanks for your feedback. Yes, I have overlooked them and will search harder next time before coding.

etienne

0
Comment actions Permalink

Hi Bas

Thanks for the report. I have noticed that too while playing around with Demetra but, honestly, I'm not sure how to deal with this situation since between 5.1 and 6.0 the signature of one of the OpenAPI methods that I call has slightly changed.

I could recompile the sources against Demetra and upload a new plugin version with min build 5000 but then I cannot upload enhancements for the 5.x versions anymore (or did I get this wrong?). Or is there a way that Demetra users see plugin version X in the PluginManager and 5.1 users see plugin version Y in the PluginManager - that would be ideal, I think.

If you (or anybody else) has any experience or thoughts to share on this well-known dilemma, I'd be more than interested in learning about them.

etienne

0
Comment actions Permalink

Etienne,

It's no problem to support different IDEA versions. For the JBoss plugin I'm currently supporting Ariadna, Irida, and Demetra simultaneously. You just have to set the correct since-build attribute (and preferably the until-build too).

Regards,
Martin

0
Comment actions Permalink

Martin,

Do you use quickfixes in the JBoss plugin ?

I've got the same problem than Etienne and i'm afraid that insertion of QuickFix interface in Demetra is a non-compatible change with irida...

0
Comment actions Permalink

Maurice,

No, I'm not using quickfixes. But there are other incompatibilities. I
have no other choice than to work on three different branches.

Maurice Montgénie wrote:

Martin,

Do you use quickfixes in the JBoss plugin ?

I've got the same problem than Etienne and i'm afraid that insertion of QuickFix interface in Demetra is a non-compatible change with irida...


--
Martin Fuhrer
Fuhrer Engineering AG
http://www.fuhrer.com

0
Comment actions Permalink

Hi Martin

Thanks for your comment!

Are you saying that if I upload a plugin version X with since-build=3000 and until-build=4999 and a plugin version Y with since-build=5000 and until-build=5999, users of IDEA 5.x will see version X and users of IDEA 6.x will see version Y, no matter in what order I upload these versions X and Y?

That would be great, of course.

Salutations a Bienne, etienne

0
Comment actions Permalink


Yep, that's exactly what I'm saying. It doesn't matter in what order you upload the versions. It's only a matter of since-build / until-build.

Salutations a Bienne, etienneAre you saying that if I upload a plugin version X
with since-build=3000 and until-build=4999 and a
plugin version Y with since-build=5000 and
until-build=5999, users of IDEA 5.x will see version
X and users of IDEA 6.x will see version Y, no matter
in what order I upload these versions X and Y?

:)

0
Comment actions Permalink

Ah, that's great to know!

In this case, I'll upload a SimpleIntentions version for Demetra as soon as possible.

etienne

0
Comment actions Permalink

Hi Bas

I have just uploaded a separate plugin version for Demetra. All intentions provided by SimpleIntentions should now work with Demetra, too.

etienne

0
Comment actions Permalink

Cool, I'm downloading now. Thank you!

Bas

etienne wrote:

Hi Bas

I have just uploaded a separate plugin version for Demetra. All intentions provided by SimpleIntentions should now work with Demetra, too.

etienne

0
Comment actions Permalink

Hi Etienne,

Is there a way to have a "Clean code" action that could automatically call a bunch of selected intentions on the current file or on a file selection ?

Gilles

0
Comment actions Permalink

Hi Gilles

1) in IDEA 5.x & Demetra, Choose Analyze -> Inspect Code... from menu and define a custom scope and the Inspection Profile to run (or create a new one right from the dialog).

2) In Demetra, whenever some code is highlighted by the inspector, you can do an Alt-Enter -> Cursor Right -> Select 'Run Inspection on...' with various scope possibilities to choose from (including custom scopes). This way, you can run the current inspection on any set of files you want to.

I hope this helps.

etienne

0

Please sign in to leave a comment.