<div dir="ltr"><div dir="ltr"><div>Hi again,</div><div><br></div><div>I actually managed to get something working decently enough a few hours ago, overriding the Gen.</div><div>Intestesting parts are:</div><div>* setting should-stop.ifError=GENERATE <a href="https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/be1321f92e37952923d61a37b69ce95f7f0a08ec/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/JavacUtils.java#L103">https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/be1321f92e37952923d61a37b69ce95f7f0a08ec/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/JavacUtils.java#L103</a></div><div>* Overriding condition for genCode to ignore errors and process anyway: <a href="https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/be1321f92e37952923d61a37b69ce95f7f0a08ec/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/JavacCompiler.java#L179">https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/be1321f92e37952923d61a37b69ce95f7f0a08ec/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/JavacCompiler.java#L179</a></div><div>* Overriding TransType to avoid a very probable compiler NPE when types mismatch in the file being compiled: <a href="https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/be1321f92e37952923d61a37b69ce95f7f0a08ec/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/ProceedOnErrorTransTypes.java#L35">https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/be1321f92e37952923d61a37b69ce95f7f0a08ec/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/ProceedOnErrorTransTypes.java#L35</a></div><div>* Overriding Gen to capture usual errors during visitXXX and just generate code for `throw new RuntimeException` in such case: <a href="https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/dom-with-javac/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/ProceedOnErrorGen.java">https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/blob/dom-with-javac/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/ProceedOnErrorGen.java</a></div><div><br></div><div>This is far from being bullet-proof, but it's not really meant to. It does already deliver a lot of value in the story of "hotswapping when code still has errors without crashing debug session" which is our unique target here.</div><div>I don't think we'll be trying to push such feature further into OpenJDK/Javac, but would welcome anyone to try it. If anyone is willing to contribute to this code, or to reuse it in some way, feel free to join the discussions at <a href="https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/discussions">https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/discussions</a> .</div><div><br></div><div>Cheers and thanks!</div><div>Mickael<br></div></div>
</div>