JDK 19 |
---|
19Fixed |
Relates :
|
|
Relates :
|
JDK-8240989 :
|
|
JDK-8240990 :
|
|
JDK-8242142 :
|
|
JDK-8242162 :
|
|
JDK-8244669 :
|
|
JDK-8244670 :
|
JDK-8235594 documents issues with the SA javascript support (which is most apparent in clhsdb). Since the javascript support no longer works, it has been disabled and will soon be removed. As a result we have lost the following clhsdb commands, which were implemented in javascript: class classes dumpclass dumpheap mem sysprops whatis It would be nice to bring as many of these back as possible by implementing them in java. For some, such as dumpheap and dumpclass, the work is trivial since the only thing the javascript side of the command is doing is invoking some existing java code. We can instead just have a regular clhsdb command (written in java) do the same. I've was easily able to do this for dumpheap already with just a few minutes of work. Other commands will be much more of a challenge since they have a lot of javascript supporting them, and may not be worth the effort. sa.js is where you will find the javascript implementation of these commands. You'll see something like the following for each command: registerCommand("dumpheap", "dumpheap [ file ]", "dumpHeap"); The 3rd argument is the implementation. It can either be a javascript method in the sa.js file, or it can be a java method in JSJavaScriptEngine.java. For dumpHeap it is the latter, and the implementation is simple: public Object dumpHeap(Object[] args) { String fileName = "heap.bin"; if (args.length > 0) { fileName = args[0].toString(); } return new JMap().writeHeapHprofBin(fileName)? Boolean.TRUE: Boolean.FALSE; } It is very easy to move this code into CommandProcessor.java as a new Command in commandList[]. This CR will be used as a parent CR for each command we want to implement in java, which will be handled in subtasks. We can close this CR when all of the have been implemented or determined to not be worth the effort.
|