Integrated: Extend API to support JOL IntelliJ Idea plugin

Sergey Ponomarev github.com+415502+stokito at openjdk.java.net
Tue Oct 6 15:25:13 UTC 2020


On Wed, 30 Sep 2020 13:31:03 GMT, Sergey Ponomarev <github.com+415502+stokito at openjdk.org> wrote:

> [JOL Intellij Idea Plugin](https://github.com/stokito/IdeaJol)  internally uses JOL.
> Internally in the
> [PsiClassAdapter](https://github.com/stokito/IdeaJol/blob/master/src/main/java/com/github/stokito/IdeaJol/PsiClassAdapter.java)
> it makes exactly the same as `org.openjdk.jol.info.ClassData#parse` but it creates the ClassData from Idea's AST/Psi
> tree instead of raw `Class`. Unfortunately to be able to do this we need to extend API a little bit.  Here is a short
> list of changes that I did: 1. Added an overloaded method ClassData.addSuperClassData(ClassData) so I can create an
> instance of `ClassData`  2. Added `lossesInternal`, `lossesExternal` and `lossesTotal` fields to `ClassLayout` so they
> calculated only once on instance creation and then can be accessed multiple times via geters by JTable  3.
> `FieldData.create()` internally evaluate if the field is contended but we do this based on Psi tree. So we need to open
> and make public the `FieldData` constructor.

This pull request has now been integrated.

Changeset: ae59c286
Author:    Sergey Ponomarev <stokito at gmail.com>
Committer: Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jol/commit/ae59c286
Stats:     196 lines in 7 files changed: 169 ins; 10 del; 17 mod

Extend API to support JOL IntelliJ Idea plugin

Reviewed-by: shade

-------------

PR: https://git.openjdk.java.net/jol/pull/4


More information about the jol-dev mailing list