1. Efficient Java Static Checks

Practice the following three to improve the quality and maintainability of code.

To execute the above, it is recommended to use IntelliJ IDEA(external site) , an IDE manufactured by JetBrains in Nablarch. An efficient Java static check method using IntelliJ IDEA is explained in this page.

1.1. Run inspection

IntelliJ IDEA has an inspection feature(external site) that performs static analysis, checking for conformity to Java coding conventions and potential bugs, and alerting you in real time.

By default, Inspection is set to warn you about things you should generally be aware of.

If you have established rules for your project, you can use Inspection more effectively by changing the settings to suit your project. Changed settings can be exported and imported to be shared among project developers. See Configure profiles(external site) for how to export and import.

1.2. Unify the format

By using code formatter feature of IntelliJ IDEA, you can unify the code style in your project. See Java Code Formatter Description in Java style guide for how to use it.

1.3. Check if unauthorized APIs are being used

We provide two tools for this check: the IntelliJ IDEA plugin and the SpotBugs plugin which does not depend on IntelliJ IDEA.

1.3.1. Use nablarch-intellij-plugin

nablarch-intellij-plugin is a plugin to use IntelliJ IDEA for supporting Nablarch development and has the following functions.

  • Throws a warning if Nablarch private API is used.
  • Throws warning if Java API registered in the black list is used.

1.3.2. Use Unauthorized API Check Tool

Unauthorized API Check Tool is provided as a SpotBugs plugin. See Unauthorized API Check Tool Description in Java style guide for detailed specifications and instructions.

Note that the blank project has been preconfigured to run in Maven , so it can be checked immediately.