More FxCop findings in release build than in debug build - fxcop

I have found that there are more findings generated when running FxCop against release build than debug build. Anybody experienced the same issue?

Compiler optimizations can lead to differences in FxCop rule behaviour, although the rules that ship with FxCop are usually pretty robust with respect to this. Are the differences you are seeing in custom rules? If not, do you have the CODE_ANALYSIS compilation flag enabled for your release build? If so, what rule(s) are generating problems only in release mode?

Related

Drools IDE with debugger

I am new to creating Drools DRL files and I have been using business-central packaged in latest jbpm artifacts as standalone web interface. I find the IDE for writing drl non intuitive, and validation errors keep stacking up even when I change the code and fix it. Is there a better development tool where we can check syntax, correct compilation errors and also debug/troubleshoot the rule definitions
Short answer is no, there's no such a thing.
The closest thing you could use with latest Drools is the Eclipse Plugin, but you have to use the 7.46.0.Final (source)
With IDEA community you can debug Drools' execution but you cannot put breakpoint inside consequences, and you don't get syntax highlighting out of the box.
The IDEA Ultimate has a Drools plugin but it's not developed by the same team (it's made by JetBrains instead of Red Hat) and has plenty of bugs (source) I'm not even sure it's maintained anymore.
Kogito has some VS Code tooling but still doesn't support DRL files.

Force IntelliJ to rerun anntoation processors?

Is there any way to rerun annotation processors without rebuilding the entire project?
I'm developing an annotation processor which is used in project that takes ~ 10 minutes to build from scratch and it's a bit painful to wait 10 mins to test a change...
General Aspect
This sounds like you don't have a proper testing approach for your annotation processor.
If you do testing always in an integrated environment, you will always have the problem of long running tests. This applys to any test environment that depens on heavy task.
So, my generall advice would be to write lightwight unit tests to check you code is working as expected. That's a general advice I can give you.
This article https://blog.jooq.org/2018/12/07/how-to-unit-test-your-annotation-processor-using-joor/ from Lukas Eder - the founder of JOOQ and that uses java annotation processors as well - is about unit testing java annotation processors.
Only Run Annotation Processors
Intellij Idea
AFAIK there is no way to do this.
Maven
If your project runs on maven, you can trigger annotation processors by just execution the generate-sources phase.
Annotation processor can not be run without the compiler.
If you are not using Maven or Gradle to build the project but is using the IDE's build, invoke the Build | Build Project action. This way IDE will perform an incremental build that will build only changed classes.

What is Gradle build system in Kotlin?

I was reading the Kotlin documentation and I came across the statement,
By default, your project will use the Gradle build system with Kotlin DSL.
What does it mean?
I've seen Gradle Kotlin option while making a new project in IntelliJ:
Can somebody explain me these, and which Bundle I should be using as a beginner?
A build system combines and simplifies some of the key tasks involved in building and distributing your program. The main things a build system does include:
Downloading any dependencies your application has
Running tests against your application
Compiling your code
Packaging up your application and its dependencies into a form you can share with others
You could run all of these tasks separately yourself, but build systems make it a lot easier and less prone to mistakes. In practice, all but the smallest projects use some kind of build system. Gradle is one such tool, but you can also use Maven, or the tools built into an IDE like IntelliJ.
Which one should I use?
If this is a personal project, the build system and tools built into an IDE like IntelliJ are more than good enough.
If you're working with other people, you might want to consider a standalone build system instead. That's because standalone build systems like Gradle can be used with multiple IDEs, and can also be used on the command line without an IDE at all. Large projects with many contributors will often run a build server that runs the build system in an automated way against all new changes, to make sure the code builds and runs as expected.
IDEs like IntelliJ have very good integration with the common build systems, including Maven and Gradle, so you won't disadvantage yourself by choosing them over the built-in IDE tools.
Maven, Gradle, or Gradle with Kotlin?
There are plenty of other resources you can find comparing Maven with Gradle. The crucial difference, though, is the way you write the build script that allows you to customise the dependencies, tests, and other parameters of your build.
In Maven, your build script is an XML file. It follows a rigid structure, providing inputs and configuration to existing tasks and plugins.
In Gradle, the build script was historically written in Groovy, a loosely-typed language that gives you a lot of flexibility. As well as configuring tasks and plugins, you can easily add your own tasks and functions.
You can also choose to write Gradle build scripts in Kotlin. This offers the same flexibility and customisation as Groovy, but the addition of a type system means the IDE can give you much more help with writing the script correctly.

Is Gradle the Equivalent of a Compiler?

From what I know, Gradle is a build automation system that combines and describes the app's project structure, configuration and dependencies to output an APK. Does this mean that the Gradle is equivalent to a compiler?
If they aren't equivalents, then what are the differences and how do they relate?
Gradle is not equivalent to the compiler. Compilers primarily meant for translating the high-level language(i.e. java) into machine code or other intermediate code representation like bytecode. wheres Gradle is a build system that packages the code for you and makes it ready for compilation. If you take an example from android, under the hood, Gradle downloads the defined dependencies and packages everything for you without messing up and simplifies the development flow. It does all the dependencies management for the project. Gradle output is not the translated code, instead, you can say it's arranged code. finally Gradle is not equivalent of any compiler.
There is a similar question on StackOverflow Post. Rather putting post multiple times, you can accept satisfactorily answer, so moderators can remove the duplicate/unaccepted one.

Intellij Idea does not display javac compiler warnings of referencing proprietary API

I'm working with Intellij Idea 10 and Java 6 JDK Update 7. When I run Build --> Rebuild Project command, the javac compilation (using parameter -Xlint:all) displays warnings, but for some reason does not include warnings about the source code referencing Sun proprietary API classes.
When I run javac (yes, the same version that is referenced from Idea) manually from the command line, I can see those warnings all right. And I would like to see the same information in Idea as well. How do I achieve this?
It seems to be a bug. Could be that IDEA doesn't support some of the warning types and doesn't report them. Please submit an issue with the sample project attached.