Docs

Documentation versions (currently viewingVaadin 24)

Modernization Toolkit Analyzer for Eclipse

How to prepare an application with Modernization Toolkit Analyzer for Eclipse.

Modernization Toolkit Analyzer for Eclipse is a tool to assess how well your applications fit the latest Vaadin versions when migrating with the Vaadin Modernization Toolkit.

The Modernization Toolkit is a Vaadin product that accelerates your migration project. It has two components: a Dragonfly transpiler that does automated refactoring of your code; and a Feature Pack that identifies and isolates useful features from your application’s current application platform and makes them available in Vaadin Flow.

The Analyzer works by parsing your project’s Java code and resolving your application’s references to the libraries you specify. It outputs the high-level results to the Eclipse IDE console. The Analyzer comes with two configuration presets for commonly occurring libraries in Swing applications and Vaadin 7 and 8 applications.

The Analyzer report is something you can copy and share with your colleagues, application stakeholders, or with Vaadin experts to discuss. This gives you concrete data to consider and can be the start of your discovery and planning for your application’s future.

Installing

You can install the Modernization Toolkit Analyzer for Eclipse through the Eclipse Marketplace or these sites: https://vaadin.com/eclipse, or https://marketplace.eclipse.org/content/vaadin-tools.

Limitations

To satisfy organizations with strict security policies on installing tools in their network, the Modernization Toolkit Analyzer is limited in a few ways.

If an internet connection is not possible from the location where the Analyzer is to be run, it’s possible to download the coverage data files locally and run them there. Contact Vaadin to get information on how to do this. By default, the Analyzer connects to the Vaadin servers to access the most up-to-date coverage data.

The Analyzer does connect to Vaadin servers to retrieve data files, but it doesn’t send any information to Vaadin. You have full discretion over what about your application or the Analyzer report you might discuss with Vaadin. The Analyzer tool doesn’t have any feature for transmitting information; you can’t use it intentionally or accidentally to send information.

Last, Modernization Toolkit Analyzer doesn’t change your code. It writes all output to the Eclipse console, but nothing to disk.

Using the Analyzer

To use Modernization Toolkit Analyzer with Eclipse, there are a few things to do. First, make sure Eclipse is ready to use the plugin. Then check that your application projects are ready to be analyzed. When that’s done, run the Analyzer and interpret the results. These steps are described in the following sections.

Prepare Eclipse

Modernization Toolkit Analyzer is distributed as a single-file Eclipse plugin JAR that you can copy into the Eclipse /plugins, or the /dropins folder where you opened your current project. You may need to restart Eclipse after copying the file. You’ll then see a button with a Vaadin logo (i.e., }>) appear in the toolbar and an Analyze menu option. You may find it more convenient to download the plugin from the Eclipse marketplace.

Note
Latest Version
By default, the Modernization Toolkit Analyzer connects to Vaadin servers when it starts to fetch information about the latest set of transformation rules. You don’t need the latest version of the Analyzer to get the latest data. However, the Analyzer warns you if your version is incompatible with the latest data formats and prompt you to get a new version.

Prepare Project

The Modernization Toolkit Analyzer for Eclipse depends on the Eclipse environment to resolve all names in the code with the inheritance hierarchy and JARs in which they’re declared. Eclipse is robust and can resolve names in sources that contain errors, so the Analyzer may work even if a project has hundreds of Maven or Java errors. However, the Analyzer typically won’t be able to resolve the errors themselves. For best results, ensure that your project is free of red lines and problems before launching Analyzer.

To save time, consider closing any project in your workspace that doesn’t contain references to the libraries for which you’re searching. The Analyzer skips these libraries and gives you a report more quickly.

Launch & Configure Analyzer

Launch the Analyzer by clicking the button in the toolbar or selecting the Analyze menu option that appeared after you installed the plugin. The Analyzer icon looks like the classic Vaadin logo.

The tool starts with default settings that work with most Vaadin 7 or 8 applications. If your application is Vaadin 7, Vaadin 8, or Vaadin 8 with Vaadin 7 compatibility, you can press the OK button and get started. If you have a Swing application, you can try the built-in presets for Swing by leaving the default settings checkbox active and selecting the Swing radio button.

For finer control, you can edit the pattern to include secondary libraries or add-ons in a search. For example, suppose you have a Vaadin application but you used the Viritin add-on plenty. You can change the search pattern from the default com.vaadin to a semicolon-separated list, com.vaadin;org.vaadin.viritin. To make the pattern field modifiable, deselect the default settings checkbox and edit the field before pressing OK. Then a progress bar should appear.

Interpret Results

Once the analysis is finished, you can view the output. The Modernization Toolkit Analyzer for Eclipse writes output in the Eclipse Console. If this is not visible, you can visualize it in the menu, Window  Show View  Console.

The report is text-only and summarizes statistics on the references in the project code to the pattern entered. Emphasis is on method invocations, constructor invocations, and types. Method invocations are invocations in the project code of methods that are declared in classes that match the pattern. Constructor invocations are new keywords that are matched with constructors that are declared in classes that match the pattern. Types can refer to anywhere a type occurs in the code albeit in an extends clause, a throws clause, or a local variable declaration, to name a few examples.

As a basic rule, a reference in any of these three categories is included in the statistics if it can be resolved to a class that matches the given pattern. This means that invocations on custom subclasses of Vaadin components in your project are included in the statistics if the method is inherited from its Vaadin superclass. Invocations on custom subclasses in your project won’t be included in the statistics if the methods invoked are declared in your own custom subclass.

The statistics include an indication of coverage. A higher coverage rate is always preferred. Coverage refers to a situation that is known and there is confidence that further perfective developer work is not required to achieve feature parity.

Coverage assumes that the modernized application uses the Feature Pack and a handful of utility methods that help bridge the gap in behavior between the existing application and later versions.

As a final note, bear in mind that the Analyzer is taking a measurement of API use of your application. However, there are many possible factors that can skew the results or give an inaccurate reading. If you’re interested in a more careful analysis, please contact Vaadin through https://vaadin.com/company/contact