[Ann] InspectorGeneral: Advanced automatic code improvement tools for IDEA
Sixth and Red River Software is pleased to announce the release of InspectorGeneral, a suite of automated code improvement and heuristic bug detection extensions to IntellIJ IDEA.
InspectorGeneral is our most technically advanced product, and the one we are most proud of. Built on IntelliJ IDEA's best-of-breed infrastructure of automated refactoring and code analysis, InspectorGeneral takes them to the next level, providing over two hundred fully-automated code improvement rules, available at a keystroke. To our knowlege, InspectorGeneral is the most powerful and easy-to-use automated code improvement tool available. Here's just a taste of what InspectorGeneral can do:
Control flow rationalization: over a hundred rules for simplifying snarled control flows, including
-Simplification of complex boolean operations
-Removal of "jumps to jumps"
-Merging of parallel conditional branches
-Removal of redundant local variables and unnecessary assignments
-Replacement of for and while loops by the new JDK 1.5 for-each loops
-Replacement of complex loop-breaking flows with simpler constructs
-Replacement of complex nested if statements used as guards with early returns
Tighten access modifiers: encapsulation is key to software development sanity, and InspectorGeneral makes encapsulation trivial
-Mark classes, fields, and methods "private", "protected" or package-local, where possible
-Mark inner classes, fields, and methods "static", where possible
-Mark fields, methods, and classes final if possible
-Mark variables and parameters as final, or removing unnecessary final annotations
-Annotate classes, methods, and fields with @Override and @Deprecated, as appropriate
Infer nullity annotations: IntelliJ IDEA pioneered the idea of allowing developers to declare the potential nullity of their fields, methods, and parameters, with the powerful @NotNull and @Nullable annotations. InspectorGeneral takes that one step further, allowing nullity specifications to be automatically inferred and applied to your code. NullPointerExceptions can be found at edit time, and with no more than the touch of a button.
Normalize references and declarations: a grab-bag of automated code cleanups and improvements, to bring your code to the highest level of polish. One-click improvements include
-Replace fully qualified names with imports
-Remove unnecessary reference qualifiers
-Correctly sort modifiers
-Remove obsolete modifiers
-Modernize array declarations
-Remove redundant interface and superclass declarations
All of this functionality is exposed via a simple and powerful interface, in most cases taking literally no more than a keystroke. With InspectorGeneral, developers can rationalize control flow or tighten access modifiers as easily as they can reformat code or optimize imports today. All of the code improvement functionality can also be automatically triggered on version control check-in, so that your mainline code is always as clean and well-structured as possible.
Additionally, InspectorGeneral includes sixteen heuristic code anomaly detectors, implemented as inspections. Code anomaly detectors go beyond simple inspections, which find code that is obviously buggy or breaks style guidelies. Anomaly detectors can search your code base for the small redundancies and slightly broken symmetries that indicate worrisome code. Exploiting a deep understanding of not just how Java works, but how it is commonly used, InspectorGeneral's
anomaly detectors can point you to bugs that other static analysis tools couldn't possibly detect.
Single user licenses for InspectorGeneral are available at a special introductory price of $69. 14-day evaluation licenses are also available. For more information about InspectorGeneral, or to purchase a license, go to http://www.sixthandredriver.com/inspectorgeneral.html .
Sixth and Red River Software
"Code with Grace and Verve"
Please sign in to leave a comment.
+- The "Tighten access modifiers" inspection is taking an absolute age
That doesn't match what we've seen at all, and we can't seem to reproduce it. Is there anything in the console that might indicate a deeper IDEA problem?+
I'll try and have a look later this afternoon - if I capture a CPU profile, is that something you can use? The CPU is completely pegged while it's running.
I think he's the "you" at the start of the list :)
Thank you very much! Glad to be able to help, and rest assured I shall
shortly be investing the money saved into some of your other tools anyway ;)
Email is on the way, and I'm looking forward to trying out the new
functionality.
Cheers,
N.
Sixth and Red River Software wrote:
I just tried this plugin for the first time and I must say it is very nice. I enjoy the power this plugin gives me; very heavyweight operations in a very lightweight UI.
Here is my first bug report. Optimize String operations on this:
produces uncompilable code:
Bas
Some more bugs. Optimize string operations on this:
Results in all three methods becoming uncompilable.
Bas
Thanks a lot. Now that I have a commercial license I tried it at work, that is I tried to try it at work, but it failed completely:
You should first collect all files that are going to be modified and then present the usual
dialog (that let's me choose between checking out and making files writable locally).
Note that other VCS system also use (or can be configured to use) the exclusive checkout paradigma (I have been working at a client who uses svn that way).
Hello Sixth and Red River Software,
There's a typo in the inspection names: "assymetric" should be "asymmetric".
("Assy metric", lol :) )
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Some minor and not so minor stuff:
In the commit dialog, Infer Nullity Assertions is capitalized while
other entries are not capitalized.
Rationalize control flow: Changed this:
...
} else {
// comment
if (foo) return bar;
}
into this:
...
} else if (foo) return bar;
The comment disappeared!
Rationalize control flow: Changed this:
if (x >= 1) {
// comment
lots of stuff;
}
return foo;
into this:
if (x < 1) return foo;
lots of stuff;
return foo;
Again, the comment disappeared.
IMHO the inspection descriptions are too long.
Most importantly I think the standard disclaimer "This inspection is heuristic in nature..." should have a smaller font size, so that it is clear at first sight that the particular description itself is much shorter.
Also introduce some paragraphs, maybe bullet points, ...
The new feature in Selena where inspection descriptions can be shown by clicking on "more..." is very nice, but for IG inspections it shows a large, unformatted solid chunk of text making me not want to read it at all.
Also these inspections might be good candidates for the "INFO" level. They just trigger too often.
Is that one that starts shouting at you if your cyclomatic complexity is
too high? :)
N.
(maybe slang that only us Brits would understand?)
Dmitry Jemerov wrote:
Oh, and "alt-I" does not work as a mnemonic for "Infer nullity
assertions" since it is already taken by "Commit".
Just encountered this exception:
Assertion failed:
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:89)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:96)
at
com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:264)
at
com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:102)
at
com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:38)
at com.intellij.psi.impl.compiled.ClsFileImpl.b(ClsFileImpl.java:74)
at com.intellij.psi.impl.compiled.ClsFileImpl.getText(ClsFileImpl.java:65)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:40)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:23)
at com.sixrr.ig.inspections.e.visitMethod(e.java:0)
at
com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:155)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1$1.run(LocalInspectionsPass.java:0)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:65)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:1)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:94)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:196)
at
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:14)
at
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:66)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:11)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:264)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:89)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:96)
at
com.intellij.psi.impl.compiled.ClsTypeElementImpl.setMirror(ClsTypeElementImpl.java:20)
at
com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:195)
at
com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:102)
at
com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:38)
at com.intellij.psi.impl.compiled.ClsFileImpl.b(ClsFileImpl.java:74)
at com.intellij.psi.impl.compiled.ClsFileImpl.getText(ClsFileImpl.java:65)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:40)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:23)
at com.sixrr.ig.inspections.e.visitMethod(e.java:0)
at
com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:155)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1$1.run(LocalInspectionsPass.java:0)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:65)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:1)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:94)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:196)
at
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:14)
at
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:66)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:11)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:264)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:89)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:96)
at
com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.setMirror(ClsJavaCodeReferenceElementImpl.java:5)
at
com.intellij.psi.impl.compiled.ClsTypeElementImpl.setMirror(ClsTypeElementImpl.java:85)
at
com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:195)
at
com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:102)
at
com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:38)
at com.intellij.psi.impl.compiled.ClsFileImpl.b(ClsFileImpl.java:74)
at com.intellij.psi.impl.compiled.ClsFileImpl.getText(ClsFileImpl.java:65)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:40)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:23)
at com.sixrr.ig.inspections.e.visitMethod(e.java:0)
at
com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:155)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1$1.run(LocalInspectionsPass.java:0)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:65)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:1)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:94)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:196)
at
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:14)
at
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:66)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:11)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:264)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:89)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:96)
at
com.intellij.psi.impl.compiled.ClsIdentifierImpl.setMirror(ClsIdentifierImpl.java:12)
at
com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:257)
at
com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:102)
at
com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:38)
at com.intellij.psi.impl.compiled.ClsFileImpl.b(ClsFileImpl.java:74)
at com.intellij.psi.impl.compiled.ClsFileImpl.getText(ClsFileImpl.java:65)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:40)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:23)
at com.sixrr.ig.inspections.e.visitMethod(e.java:0)
at
com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:155)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1$1.run(LocalInspectionsPass.java:0)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:65)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:1)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:94)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:196)
at
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:14)
at
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:66)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:11)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:264)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:89)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:96)
at
com.intellij.psi.impl.compiled.ClsParameterListImpl.setMirror(ClsParameterListImpl.java:21)
at
com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:363)
at
com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:102)
at
com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:38)
at com.intellij.psi.impl.compiled.ClsFileImpl.b(ClsFileImpl.java:74)
at com.intellij.psi.impl.compiled.ClsFileImpl.getText(ClsFileImpl.java:65)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:40)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:23)
at com.sixrr.ig.inspections.e.visitMethod(e.java:0)
at
com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:155)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1$1.run(LocalInspectionsPass.java:0)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:65)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:1)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:94)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:196)
at
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:14)
at
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:66)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:11)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:264)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:89)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:96)
at
com.intellij.psi.impl.compiled.ClsReferenceListImpl.setMirror(ClsReferenceListImpl.java:25)
at
com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:191)
at
com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:102)
at
com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:38)
at com.intellij.psi.impl.compiled.ClsFileImpl.b(ClsFileImpl.java:74)
at com.intellij.psi.impl.compiled.ClsFileImpl.getText(ClsFileImpl.java:65)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:40)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:23)
at com.sixrr.ig.inspections.e.visitMethod(e.java:0)
at
com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:155)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1$1.run(LocalInspectionsPass.java:0)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:65)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:1)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:94)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:196)
at
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:14)
at
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:66)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:11)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:264)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:89)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:96)
at
com.intellij.psi.impl.compiled.ClsTypeParametersListImpl.setMirror(ClsTypeParametersListImpl.java:36)
at
com.intellij.psi.impl.compiled.ClsMethodImpl.setMirror(ClsMethodImpl.java:158)
at
com.intellij.psi.impl.compiled.ClsClassImpl.setMirror(ClsClassImpl.java:102)
at
com.intellij.psi.impl.compiled.ClsFileImpl.setMirror(ClsFileImpl.java:38)
at com.intellij.psi.impl.compiled.ClsFileImpl.b(ClsFileImpl.java:74)
at com.intellij.psi.impl.compiled.ClsFileImpl.getText(ClsFileImpl.java:65)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:40)
at
com.intellij.psi.impl.compiled.ClsElementImpl.getText(ClsElementImpl.java:23)
at com.sixrr.ig.inspections.e.visitMethod(e.java:0)
at
com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:155)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1$1.run(LocalInspectionsPass.java:0)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$1.run(LocalInspectionsPass.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
com.intellij.concurrency.JobImpl.scheduleAndWaitForResults(JobImpl.java:65)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:1)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:94)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:196)
at
com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:14)
at
com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:66)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:11)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:264)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:49)
at
com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Thanks - I tried 1.0.5 and it's working much better.
Almost all my 'ifs' stay the way they should be.
My biggest complaint is that IG still inlines local variables that are immediately returned.
(It does so correctly now, keeping the semantics, but I do not want these variables inlined at all
and have configured the Idea inspection accordingly.)
In its current form I think the only sensible way to use IG is to run it, then go
through the change set and check each single modification, undoing unnecessary or unwanted changes
manually.
Or maybe if you have a personal or very small project where you define all standards yourself and
happen to agree with the IG "standard", then you can run it without review...
IMHO it would have been better if all were based closer on the inspections, letting me select
a set of inspection quickfixes to perform and working on the existing inspection settings.
Sixth and Red River Software wrote:
Hello Sixth and Red River Software,
"Duplicate getter" inspection gives false positives if the method contains
an inner class and getters are used in two different methods of the inner
class.
public VcsContextFactory getVcsContextFactory() {
return new VcsContextFactory() {
public FilePath createFilePathOn(VirtualFile vFile) { ApplicationManager.getApplication()...
}
public FilePath createFilePathOn(File file) { ApplicationManager.getApplication()...
}
};
}
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Three more methods which become uncompilable after ivoking "Optimize String Operations":
Bas
I've run across a bug:
If I execute Rationalize Control Flow on this method:
protected void bufferedUpdate(String majorStatus, String minorStatus,
int progressValue)
{
synchronized (_asyncLock) {
_bufferedProgressValue = progressValue;
_bufferedMajorStatus = majorStatus;
_bufferedMinorStatus = minorStatus;
if (_asyncUpdater == null) {
_asyncUpdater = new Runnable()
{
public void run()
{
synchronized (_asyncLock) {
_asyncUpdater = null;
update(_bufferedMajorStatus, _bufferedMinorStatus,
_bufferedProgressValue);
}
}
};
SwingThreadUtilities.traceableInvokeLater(_asyncUpdater);
}
}
}
Then it gets rid of the synchronized block inside the Runnable!
BTW, is this the best place to be reporting bugs, or do you have
somewhere more dedicated?
Cheers,
N.
Sixth and Red River Software wrote:
I've just encountered this exception in Selena 7065, while trying to tighten access modifiers:
Class com.sixrr.ig.utils.jb can not access a member of class com.intellij.history.deprecated.DeprecatedLVCS$1 with modifiers "public"
java.lang.IllegalAccessException: Class com.sixrr.ig.utils.jb can not access a member of class com.intellij.history.deprecated.DeprecatedLVCS$1 with modifiers "public"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.reflect.Method.invoke(Method.java:588)
at com.sixrr.ig.utils.jb.a(jb.java:3)
at com.sixrr.ig.access.TightenAccessModifiersAction.actionPerformed(TightenAccessModifiersAction.java:102)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:15)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:34)
at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:32)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:88)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:7)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:159)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:167)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:66)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Yup, the JetBrains folk seem to be fiddling with the LVCS API on a build-by-build basis, making it almost impossible to keep up with EAP builds. We should have a fix within the next week.
Sixth and Red River Software
"Code with Grace and Verve"
Ah OK, I'll hold off on reporting any more bugs in Selena for the time being then!
Was this ever fixed? Also I asked this the best place to be reporting
bugs, or do you have somewhere more dedicated?
Cheers,
N.
Nathan Brown wrote:
>> Sixth and Red River Software is pleased to announce the release of
>> InspectorGeneral, a suite of automated code improvement and heuristic
>> bug detection extensions to IntellIJ IDEA.
>>
>> InspectorGeneral is our most technically advanced product, and the one
>> we are most proud of. Built on IntelliJ IDEA's best-of-breed
>> infrastructure of automated refactoring and code analysis,
>> InspectorGeneral takes them to the next level, providing over two
>> hundred fully-automated code improvement rules, available at a
>> keystroke. To our knowlege, InspectorGeneral is the most powerful and
>> easy-to-use automated code improvement tool available. Here's just a
>> taste of what InspectorGeneral can do:
>>
>> Control flow rationalization: over a hundred rules for simplifying
>> snarled control flows, including
>> -Simplification of complex boolean operations
>> -Removal of "jumps to jumps"
>> -Merging of parallel conditional branches
>> -Removal of redundant local variables and unnecessary assignments
>> -Replacement of for and while loops by the new JDK 1.5 for-each loops
>> -Replacement of complex loop-breaking flows with simpler constructs
>> -Replacement of complex nested if statements used as guards with
>> early returns
>>
>> Tighten access modifiers: encapsulation is key to software development
>> sanity, and InspectorGeneral makes encapsulation trivial
>> -Mark classes, fields, and methods "private", "protected" or
>> package-local, where possible
>> -Mark inner classes, fields, and methods "static", where possible
>> -Mark fields, methods, and classes final if possible
>> -Mark variables and parameters as final, or removing unnecessary
>> final annotations
>> -Annotate classes, methods, and fields with @Override and
>> @Deprecated, as appropriate
>>
>> Infer nullity annotations: IntelliJ IDEA pioneered the idea of
>> allowing developers to declare the potential nullity of their fields,
>> methods, and parameters, with the powerful @NotNull and @Nullable
>> annotations. InspectorGeneral takes that one step further, allowing
>> nullity specifications to be automatically inferred and applied to
>> your code. NullPointerExceptions can be found at edit time, and with
>> no more than the touch of a button.
>>
>> Normalize references and declarations: a grab-bag of automated code
>> cleanups and improvements, to bring your code to the highest level of
>> polish. One-click improvements include
>> -Replace fully qualified names with imports
>> -Remove unnecessary reference qualifiers
>> -Correctly sort modifiers
>> -Remove obsolete modifiers
>> -Modernize array declarations
>> -Remove redundant interface and superclass declarations
>>
>> All of this functionality is exposed via a simple and powerful
>> interface, in most cases taking literally no more than a keystroke.
>> With InspectorGeneral, developers can rationalize control flow or
>> tighten access modifiers as easily as they can reformat code or
>> optimize imports today. All of the code improvement functionality
>> can also be automatically triggered on version control check-in, so
>> that your mainline code is always as clean and well-structured as
>> possible.
>>
>> Additionally, InspectorGeneral includes sixteen heuristic code anomaly
>> detectors, implemented as inspections. Code anomaly detectors go
>> beyond simple inspections, which find code that is obviously buggy or
>> breaks style guidelies. Anomaly detectors can search your code base
>> for the small redundancies and slightly broken symmetries that
>> indicate worrisome code. Exploiting a deep understanding of not just
>> how Java works, but how it is commonly used, InspectorGeneral's
>> anomaly detectors can point you to bugs that other static analysis
>> tools couldn't possibly detect.
>>
>> Single user licenses for InspectorGeneral are available at a special
>> introductory price of $69. 14-day evaluation licenses are also
>> available. For more information about InspectorGeneral, or to purchase
>> a license, go to http://www.sixthandredriver.com/inspectorgeneral.html .
>>
>> Sixth and Red River Software
>> "Code with Grace and Verve"